id
stringlengths
33
34
updated
timestamp[s]
published
timestamp[s]
title
stringlengths
9
212
summary
stringlengths
75
2.46k
author
sequence
arxiv:doi
stringlengths
0
71
link
list
arxiv:journal_ref
sequence
arxiv:primary_category
dict
category
sequence
content
stringlengths
0
1.25M
http://arxiv.org/abs/2302.12456v1
2023-02-24T05:14:27
2023-02-24T05:14:27
Logarithmic Switching Cost in Reinforcement Learning beyond Linear MDPs
In many real-life reinforcement learning (RL) problems, deploying new policies is costly. In those scenarios, algorithms must solve exploration (which requires adaptivity) while switching the deployed policy sparsely (which limits adaptivity). In this paper, we go beyond the existing state-of-the-art on this problem that focused on linear Markov Decision Processes (MDPs) by considering linear Bellman-complete MDPs with low inherent Bellman error. We propose the ELEANOR-LowSwitching algorithm that achieves the near-optimal regret with a switching cost logarithmic in the number of episodes and linear in the time-horizon $H$ and feature dimension $d$. We also prove a lower bound proportional to $dH$ among all algorithms with sublinear regret. In addition, we show the ``doubling trick'' used in ELEANOR-LowSwitching can be further leveraged for the generalized linear function approximation, under which we design a sample-efficient algorithm with near-optimal switching cost.
[ "Dan Qiao", "Ming Yin", "Yu-Xiang Wang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12456v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12456v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "stat.ML" ]
Logarithmic Switching Cost in Reinforcement Learning beyond Linear MDPs Dan Qiao1, Ming Yin1,2, and Yu-Xiang Wang1 1Department of Computer Science, UC Santa Barbara 2Department of Statistics and Applied Probability, UC Santa Barbara danqiao,ming yin } { @ucsb.edu, [email protected] Abstract In many real-life reinforcement learning (RL) problems, deploying new policies is costly. In those scenarios, algorithms must solve exploration (which requires adaptivity) while switching the deployed policy sparsely (which limits adaptivity). In this paper, we go beyond the existing state-of-the-art on this problem that focused on linear Markov Decision Processes (MDPs) by considering linear Bellman-complete MDPs with low inherent Bellman error. We propose the ELEANOR-LowSwitching algorithm that achieves the near-optimal regret with a switching cost logarithmic in the number of episodes and linear in the time-horizon H and feature dimension d. We also prove a lower bound proportional to dH among all algorithms with sublinear regret. In addition, we show the "doubling trick" used in ELEANOR-LowSwitching can be further leveraged for the generalized linear function approximation, under which we design a sample- efficient algorithm with near-optimal switching cost. 3 2 0 2 b e F 4 2 ] G L . s c [ 1 v 6 5 4 2 1 . 2 0 3 2 : v i X r a 1 Contents 1 Introduction 1.1 Related works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Problem setup 2.1 Low inherent Bellman error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Main algorithm 4 Main results 3 5 5 7 8 10 5 Proof sketch 11 5.1 Upper bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.2 Lower bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6 Extension to generalized linear function approximation 13 6.1 Problem setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.2 Low switching algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.3 Main results of Algorithm 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7 Conclusion and future work 15 A Proof of Theorem 4.1 19 A.1 Proof of switching cost bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 A.2 Proof of regret bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 B Proof of Theorem 4.2 22 C Proof for Section 6 23 C.1 Proof of upper bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 C.2 Proof of lower bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 D Assisting technical lemmas 25 2 1 Introduction In many real-world reinforcement learning (RL) tasks, limited computing resources make it chal- lenging to apply fully adaptive algorithms that continually update the exploration policy. As a surrogate, it is more cost-effective to collect data in large batches using the current policy and make changes to the policy after the entire batch is completed. For example, in a recommenda- tion system [Afsar et al., 2021], it is easier to gather new data quickly, but deploying a new policy takes longer as it requires significant computing and human resources. Therefore, it's not feasible to switch policies based on real-time data, as typical RL algorithms would require. A practical solution is to run several experiments in parallel and make decisions on policy updates only after the entire batch has been completed. Similar limitations occur in other RL based applications such as healthcare [Yu et al., 2021], robotics [Kober et al., 2013], and new material design [Zhou et al., 2019], where the agent must minimize the number of policy updates while still learning an effective policy using a similar number of trajectories as fully-adaptive methods. On the theoretical side, Bai et al. [2019] brought up the definition of switching cost, which measures the number of policy updates. In this paper, we measure the adaptivity of online reinforcement learning algorithms via global switching cost, and we leave the formal definition to Section 2. In recent years, there has been a growing interest in designing online reinforcement learning algo- rithms with low switching costs [Bai et al., 2019, Zhang et al., 2020, Qiao et al., 2022, Gao et al., 2021, Wang et al., 2021, Kong et al., 2021, Velegkas et al., 2022]. While much progress has been made in achieving near-optimal results, most of the research has focused on the tabular MDP setting and the slightly more general linear MDP setting [Yang and Wang, 2019, Jin et al., 2020]. However, linear MDP is still a restrictive model, and subsequent works have proposed a variety of more general settings, such as low inherent Bellman error [Zanette et al., 2020], generalized lin- ear function approximation [Wang et al., 2019], low Bellman rank [Jiang et al., 2017], low rank [Agarwal et al., 2020], and low Bellman eluder dimension [Jin et al., 2021]. Therefore, it is natural to question whether reinforcement learning with low switching cost is achievable under these more general MDP settings. Our contributions. In this paper, we extend previous results under linear MDP to its two natural extensions, linear Bellman-complete MDPs with low inherent Bellman error [Zanette et al., 2020] and MDP with genaralized linear function approximation [Wang et al., 2019]. Under both settings, we design algorithms with near optimal regret and switching cost. Our contributions are three-fold and summarized as below. • A new algorithm (Algorithm 1) based on "doubling trick" for regret minimization under the H h=1 dh log K) H h=1 dh√K + , where dh is the dimension of feature map is the inherent Bellman error and K is the number of episodes (Theorem low inherent Bellman error setting that achieves global switching cost of O( H h=1 √dh and regret of for the h-th layer, 4.1). The regret bound is known to be minimax optimal [Zanette et al., 2020]. (cid:16)P I P P K O (cid:17) e I • When the inherent Bellman error = 0, we prove a nearly matching switching cost lower H bound (Theorem 4.2) Ω( h=1 dh) for any algorithm with sub-linear regret bound, which implies that the switching cost of our Algorithm 1 is optimal up to log K factor. When applied to linear MDP, Algorithm 1 achieves the same switching cost and better regret bound compared to the previous results [Gao et al., 2021, Wang et al., 2021]. P I 3 Setting Low IBE GLM Algorithms for regret minimization Our Algorithm 1 (Theorem 4.1)† Our Algorithm 2 (Theorem 6.4)⋆ Algorithm 1 of Gao et al. [2021]‡ Linear MDP UCB-Advantage [Zhang et al., 2020] Tabular MDP Tabular MDP Low IBE GLM APEVE [Qiao et al., 2022] Lower bound (Theorem 4.2) Lower bound (Theorem 6.5) (cid:17) O e Regret bound H h=1 dh√K (cid:16)P H√d3K O O(√d3H 4K) (cid:16) (cid:17) e O(√H 3SAK) e O(√H 5S2AK) e If "no-regret" e If "no-regret" Switching cost bound H h=1 dh log K) O( O(dH log K) P O(dH log K) O(H 2SA log K)∗ O(HSA log log K) H h=1 dh) Ω( Ω(dH) P Table 1: Comparison of our results (in blue) to existing works regarding regret bound and (global) switching cost bound. "Low IBE" is short for low inherent Bellman error while "GLM" represents generalized linear function approximation, where both settings generalize linear MDP. For both "Low IBE" and "GLM" settings, we assume the total reward is bounded by 1. In particular, we show the regret bound for "Low IBE" assuming the inherent Bellman error is 0 while the detailed result is shown in Theorem 4.1. We highlight that our switching cost upper bounds under both settings match the corresponding lower bounds up to logarithmic factors. †: Here dh is the dimension of feature map for the h-th layer and K is the number of episodes. When applied to linear MDP, there will be an additional factor of H in the regret bound while dh = d for all h. Therefore, regret bound O(√d2H 4K) and O(dH log K), respectively. ⋆: When applied to and switching cost bound will be linear MDP, there will be an additional factor of H in the regret bound, and the regret bound will : This result is generalized by Wang et al. [2021] whose algorithm has a same be ‡ : The switching cost here is local switching cost switching cost bound under this regret bound. ∗ (defined in Bai et al. [2019]), which is specified to tabular MDP. O(√d3H 4K). e e 4 • We leverage the "doubling trick" used in Algorithm 1 under the generalized linear function approximation setting and propose Algorithm 2 which achieves switching cost of O(dH log K) and regret of , where d is the dimension of feature map (Theorem 6.4). We also prove a nearly matching switching cost lower bound of Ω(dH) for any algorithm with sub- linear regret bound (Theorem 6.5). The pair of results strictly generalize previous results under linear MDP [Gao et al., 2021, Wang et al., 2021]. H√d3K O (cid:17) (cid:16) e 1.1 Related works There is a large and growing body of literature on the statistical theory of reinforcement learn- ing that we will not attempt to thoroughly review. Detailed comparisons with existing work on reinforcement learning with low switching cost [Gao et al., 2021, Wang et al., 2021, Zhang et al., 2020, Qiao et al., 2022] are given in Table 1. Notably, the settings we consider are more general than the well studied tabular or linear MDP, while our results for regret and switching cost are comparable or better than the best known results under linear MDP [Gao et al., 2021, Wang et al., 2021]. While there are low adaptive algorithms under other more general settings than linear MDP, they either consider only pure exploration (without regret guarantee) [Jiang et al., 2017, Sun et al., 2019], or suffer from sub-optimal results comparing to our results [Kong et al., 2021, Velegkas et al., 2022]. In addition to switching cost, there are other measurements of adaptivity. The closest measure- ment is batched learning, which requires decisions about policy updates to be made at only a few (often predefined) checkpoints but does not constrain the number of policy switches. Batched learning has been considered both under bandits [Perchet et al., 2016, Gao et al., 2019] and RL [Wang et al., 2021, Qiao et al., 2022, Zhang et al., 2022b] while the settings are restricted to tabu- lar MDP or linear MDP. Meanwhile, Matsushima et al. [2020] proposed the notion of deployment efficiency, which is similar to batched RL with additional requirement that each policy deployment should have similar size. Deployment efficient RL is studied by some following works [Huang et al., 2022, Qiao and Wang, 2022, Modi et al., 2021]. However, as pointed out by Qiao and Wang [2022], deployment complexity is not a good measurement of adaptivity when studying regret minimiza- tion. Technically speaking, we directly base on ELEANOR [Zanette et al., 2020] and Algorithm 1 of Wang et al. [2019], which admit fully adaptive structure. We apply "doubling trick" when deciding In particular, whether to update the exploration policy, in order to achieve low switching cost. we show that the "information gain" used in previous works under linear MDP [Gao et al., 2021, Wang et al., 2021]: the determinant of empirical covariance matrix can be extended to more general MDPs with linear approximation. Therefore, we only update the exploration policy when the "information gain" doubles, and the switching cost depends only logarithmically on the number of episodes K. 2 Problem setup kΛ = √x⊤Λx. Notations. Throughout the paper, for n ∈ For matrix X ) denote the operator norm, determinant, smallest ), λmax( ), λmin( k*k2, det( * * * eigenvalue and largest eigenvalue, respectively. In addition, we use standard notations such as O . We denote } 1, 2, { Rd×d, Z+, [n] = x k * * * , n ∈ 5 and Ω to absorb constants while O and Ω suppress logarithmic factors. , e e S M = ( Markov Decision Processes. We consider finite-horizon episodic Markov Decision Processes , H, Ph, rh) [Sutton and Barto, (MDP) with non-stationary transitions, denoted by a tuple A is the action space and H is the horizon. The non-stationary is the state space, 1998], where s, a) representing the probability transition kernel has the form Ph : | of transition from state s, action a to next state s′ at time step h. In addition, rh(s, a) ∆([0, 1]) denotes the corresponding distribution of reward.1 Without loss of generality, we assume there is a fixed initial state s1.2 A policy can be seen as a series of mapping π = (π1, , πH), where each πh maps each state s [H]. A h ∆( to a probability distribution over actions, i.e. πh : , sH , aH, rH , sH+1) is generated by the following rule: s1 is fixed, random trajectory (s1, a1, r1, sh), rh [H]. For normalization, we assume that ah [0, 1] almost surely. ∈ S * * * rh(sh, ah), sh+1 ∼ S [0, 1] with Ph(s′ A S × A × S 7→ * * * S → sh, ah), Ph( A ∼ ∈ ∈ ∈ ), h ∀ ∀ *| πh( ∼ H h=1 rh *| ∈ [H], the value function V π Q-values, Bellman operator. Given a policy π and any h ) and Q- h ( P * ∈ H H h(s, a) = Eπ[ sh = s], Qπ ) are defined as: V π value function Qπ sh, ah = t=h rt t=h rt , h( | | * * . Besides, the value function and Q-value function with respect to the optimal s, a s, a], ∈ S × A ) and Q⋆ policy π⋆ is denoted by V ⋆ h applied to Qh+1 is defined , h( h ( * * as ). Then the Bellman operator * h (s) = Eπ[ P P ∀ T h(Qh+1)(s, a) = rh(s, a) + Es′∼Ph(*|s,a) max a′ Qh+1(s′, a′). T Regret. We measure the performance of online reinforcement learning algorithms by the regret. The regret of an algorithm over K episodes is defined as Regret(K) := K Xk=1 [V ⋆ 1 (s1) − V πk 1 (s1)], where πk is the policy it deploys at episode k. Besides, we denote the total number of steps by T := KH. Switching cost. We adopt the global switching cost [Bai et al., 2019], which simply measures how many times the algorithm changes its policy: Nswitch := K−1 Xk=1 1 πk { . = πk+1} Global switching cost is a widely applied measurement of the adaptivity of an online RL algorithm both under the tabular setting [Bai et al., 2019, Zhang et al., 2020, Qiao et al., 2022] and the linear MDP setting [Gao et al., 2021, Wang et al., 2021]. Similar to previous works, our algorithm also uses deterministic policies only. 1We overload the notation r so that r also denotes the expected (immediate) reward function. 2The generalized case where the initial distribution is an arbitrary distribution can be recovered from this setting by adding one layer to the MDP. 6 6 2.1 Low inherent Bellman error In this part, we introduce the linear function approximation, the definition of inherent Bellman error [Zanette et al., 2020] and the connection between the low inherent Bellman error setting and the linear MDP setting [Jin et al., 2020]. , a common approach is to define To encode linear function approximation of the state space Rdh, which can be different across different timestep. Then the a feature map φh : Q-value functions are represented as linear functions of φh, i.e., Qh(s, a) = φh(s, a)⊤θh for some θh S × A → Rdh. S ∈ The feasible parameter class for timestep h is defined as h := B θh { ∈ Rdh φh(s, a)⊤θh | | 1, , (s, a) } ∀ | ≤ which is consistent with our assumption that Qπ h(s, a) 1. ≤ For each feasible parameter θ defined as ∈ B h, the corresponding Q-value function and value function are Qh(θ)(s, a) = φh(s, a)⊤θ, Vh(θ)(s) = max a φh(s, a)⊤θ. Meanwhile, the associated function spaces are h := Q Qh(θh) { | θh h , } ∈ B V h := Vh(θh) { | θh h . } ∈ B Similar to Zanette et al. [2020], we make the following normalization assumption, which is without loss of generality. φh(s, a) k k2 ≤ k2 ≤ θh k 1, ∀ dh, (h, s, a) [H] ∈ [H], θh h ∀ ∈ . × S × A h. ∈ B p Inherent Bellman error. For provably efficient learning, completeness assumption is widely adopted [Zanette et al., 2020, Wang et al., 2020, Jin et al., 2021]. In this paper, we characterize the completeness by assuming an upper bound of the projection error when we project hQh+1 (Qh+1 ∈ Q Definition 2.1. The inherent Bellman error of an MDP with a known linear feature map is defined as the maximum over the timesteps h T h. Formally, we have the following definition of inherent Bellman error. , φh( * { h+1) to [H] of Q ) }h∈[H] * ∈ sup θh+1∈Bh+1 inf θh∈Bh φh(s, a)⊤θh sup s,a | ( T . hQh+1(θh+1))(s, a) | − Similar to Zanette et al. [2020], we assume the inherent Bellman error of the MDP is upper bounded by some (known) constant 0. Below we will show that this setting strictly generalizes the linear I ≥ MDP setting [Jin et al., 2020]. Connections to linear MDP. Since linear MDP admits transition kernel and reward function that is linear in a known feature map φ, for any function V ( ) is a linear ) : * * ) [Jin et al., 2020]. Therefore, a linear MDP with feature map φ and dimension function of φ( , * * = φH = φ and d is a special case of the low inherent Bellman error setting with , hV ( * = 0, φ1 = S → R, T I * * * 7 * * * = dH = d (if ignoring the scale of rewards). More importantly, it is shown that an MDP d1 = = 0) may not be a linear MDP [Zanette et al., 2020], which with zero inherent Bellman error ( means that the setting in this paper is strictly more general and technically demanding than linear MDP. For more discussions about the low inherent Bellman error setting and relavent comparisons, please refer to Section 3 in Zanette et al. [2020]. I 3 Main algorithm In this section, we propose our main algorithm: ELEANOR-LowSwitching (Algorithm 1) and the low switching design for global optimism-based algorithms. We begin with the standard LSVI technique. At the beginning of the k-th episode, assume the parameter for the (h + 1)-th layer is fixed to be θh+1. Then LSVI minimizes the following objective function with respect to θ: k−1 (φτ h)⊤θ rτ h − − Vh+1(θh+1)(sτ h+1) 2 + λ θ k 2 2, k (1) τ =1 (cid:16) X h, aτ h is short for φh(sτ where φτ The minimization problem (1) has a closed form solution: h) and rτ (cid:17) h is the reward encountered at layer h of the τ -th episode. k−1 θh = (Σk h)−1 φτ h h + Vh+1(θh+1)(sτ rτ h+1) , (2) where Σk h = k−1 τ =1 φτ h(φτ (cid:2) h)⊤ + λIdh is the empirical covariance matrix. b (cid:3) τ =1 X P Based on the standard LSVI, we introduce the global optimistic planning below, where an optimiza- tion problem is solved to derive the most optimistic estimate of the Q-value function at the initial state. At each episode where the policy is updated, Algorithm 1 solves the following problem. Definition 3.1 (Optimistic planning). { ̄ξh}h∈[H],{b max θh}h∈[H],{ ̄θh}h∈[H] max a k−1 φ1(s1, a)⊤ ̄θ1 subject to θh = (Σk h)−1 φτ h h + Vh+1( ̄θh+1)(sτ rτ h+1) , τ =1 X b ̄θh = θh + ̄ξh; ̄ξh k (cid:0) kΣk h ≤ q (cid:1) αk h; ̄θh h. ∈ B Definition 3.1 optimizes over the perturbation ̄ξh added to the least square solution constraint on ̄ξh is θh. The b (3) kΣk h ≤ αk h := O( dh + dh+1) + √k , I q where the definition of h will be specified in Appendix A.2. As will be shown in the analysis, the first term accounts for the estimation error of the LSVI, while the second term accounts for e q b ̄ξh k αk p 8 is inherent Bellman error). Finally, with high probability, the model misspecification (recall that there will be a valid solution of the optimization problem (details in Appendix A.2), and therefore Algorithm 1 is well posed. I About global optimism. We highlight that the optimization problem aims at being optimistic only at the initial state instead of choosing a value function everywhere optimistic, as in LSVI-UCB [Jin et al., 2020]. Such global optimism effectively keeps the linear structure of our function class and reduces the dimension of the covering set, since we do not need to cover the quadratic bonus as in Jin et al. [2020]. Algorithmic design. We present the whole learning process in Algorithm 1. For linear function approximation, we characterize the "information gain" (the information we learned from interacting with the MDP) through the determinant of the empirical covariance matrix Σk h (line 5). To achieve low switching cost, we only update the exploration policy when the "information gain" doubles for some layer h [H] (line 7), and each update means the information about some layer has doubled. As will be shown later, such "doubling schedule" will lead to a switching cost depending only logarithmically on K, in stark contrast to its fully adaptive counterpart: ELEANOR [Zanette et al., ̄θh 2020]. When an update occurs, Algorithm 1 solves the optimization problem to derive }h∈[H] { h (line 10) and ensuring global optimism (line 9), takes the greedy policy with respect to φh( , * updates the empirical covariance matrix (line 11). )⊤ ̄θk * ∈ Algorithm 1 ELEANOR-LowSwitching 1: Input: Number of episodes K, regularization λ = 1, feature map , φh( * { }h∈[H], failure proba- ) * bility δ, initial state s1 and inherent Bellman error . I h = λIdh, for all h [H]. ∈ 2: Initialize: Σh = Σ0 3: for k = 1, 2, 4: , K do h, aτ h)φh(sτ h)⊤ + λIdh. , H do h, aτ * * * for h = 1, 2, * * * k−1 Σk τ =1 φh(sτ h = end for P [H], det(Σk 2 det(Σh) then if h) h ∈ ∃ ≥ H+1 = ̄ξk Set ̄θk θk H+1 = 0. H+1 = Solve the optimization problem in Definition 3.1. Set πk b Set Σh = Σk h, h(s) = arg maxa φh(s, a)⊤ ̄θk h, [H]. [H]. ∈ h h ∀ else Set πk ∀ h = πk−1 h ∈ for all h [H]. ∈ end if 14: 15: Deploy policy πk = (πk 1 , 16: end for 5: 6: 7: 8: 9: 10: 11: 12: 13: , πk H) and get trajectory (sk 1, ak 1, rk 1 , , sk H+1). * * * * * * Generalization over previous algorithms. If we remove the update rule in Algorithm 1 and solve Definition 3.1 at all episodes, our Algorithm 1 will degenerate to ELEANOR [Zanette et al., 2020]. Compared to ELEANOR, our Algorithm 1 achieves the same regret bound (shown later) and near optimal switching cost. Meanwhile, Algorithm 1 also strictly generalizes the RARELY SWITCHING OFUL algorithm [Abbasi-Yadkori et al., 2011] designed for linear bandits. Taking H = 1, both our Algorithm 1 and our guarantees (for regret and switching cost) strictly subsumes 9 the RARELY SWITCHING OFUL. In conclusion, we show that low switching cost is possible for RL algorithms with global optimism. Computational efficiency. Although Algorithm 1 is shown to be near optimal both in regret and switching cost, the implementation of the optimization problem is inefficient in general. This is because the max operator breaks the quadratic structure of the constraints. Such issue also exists for our fully adaptive counterpart: ELEANOR [Zanette et al., 2020], and other algorithms based on global optimism [Jiang et al., 2017, Sun et al., 2019, Jin et al., 2021]. We leave the improvement of computation as future work. 4 Main results In this section, we present our main results. We begin with the upper bounds for regret and switching cost. Recall that we assume [0, 1] almost surely, while dh represents the ∈ dimension of the feature map for the h-th layer and is inherent Bellman error. H h=1 rh P I Theorem 4.1 (Main theorem). The global switching cost of Algorithm 1 is bounded by O( log K). In addition, with probability 1 H h=1 dh * δ, the regret of Algorithm 1 over K episodes is bounded by − P Regret(K) H h=1 X ≤ O e H dh√K + h=1 p X dh I K . ! The proof of Theorem 4.1 is sketched in Section 5.1 with details in the Appendix, below we discuss several interesting aspects of Theorem 4.1. Near-optimal switching cost. Our algorithm achieves a switching cost that depends logarith- mically on K, which improves the O(K) switching cost of ELEANOR [Zanette et al., 2020]. We also prove the following information-theoretic limit which says that the switching cost of Algorithm 1 is optimal up to logarithmic factors. Since it is impossible to get sub-linear regret bound with positive inherent Bellman error, we only consider the case where = 0. I Theorem 4.2 (Lower bound for no-regret learning). Assume that the inherent Bellman error and dh is at least Ω( = 0 [H], for any algorithm with sub-linear regret bound, the global switching cost 3 for all h ≥ I ∈ H h=1 dh). The proof of Theorem 4.2 is sketched in Section 5.2 with details in the Appendix. P Application to linear MDP. As discussed in Section 2.1, linear MDP with dimension d is a special case of the low inherent Bellman error setting with = dH = d. Therefore, when applied to linear MDP, our Algorithm 1 will have switching cost bounded by O(dH log K) O(√d2H 3T ), where T = KH.3 Compared to current algorithms achieving and regret bounded by low switching cost under linear MDP [Gao et al., 2021, Wang et al., 2021], we achieve the same switching cost and a regret bound better by a factor of √d. The improvement on regret bound results from global optimism and a smaller linear function class. More importantly, low inherent Bellman error setting is indeed a harder setting than linear MDP. According to Theorem 2 in = 0, d1 = d2 = * * * e I 3When transferring Theorem 4.1 to linear MDP, we need to rescale the reward function by H, and therefore there will be an additional factor of H in our regret bound. 10 Zanette et al. [2020], the regret of our Algorithm 1 is minimax optimal. Together with the lower bound of switching cost (Theorem 4.2), Theorem 4.1 is generally not improvable both in regret and global switching cost. Application to misspecified linear bandits. Taking H = 1, an MDP with low inherent Bellman error will become a linear bandit [Lattimore and Szepesv ́ari, 2020] with model misspecification. For simplicity, we only consider the case where there is no misspecification (i.e. = 0), as studied in Abbasi-Yadkori et al. [2011]. Our result is summarized in the following corollary. I Corollary 4.3 (Results under linear bandit). Suppose H = 1 and = 0, then the MDP reduces to a linear bandit with dimension d. Our Algorithm 1 will reduce to the RARELY SWITCHING OFUL algorithm (Figure 3 in Abbasi-Yadkori et al. [2011]) and is computationally efficient. The O(d√K) with global switching cost of Algorithm 1 is O(d log K), while the regret can be bounded by high probability. I The above corollary is derived by directly plugging H = 1 and d1 = d in Theorem 4.1. Note that our Corollary 4.3 matches the results in Abbasi-Yadkori et al. [2011], and our Algorithm 1 can be applied under the more general case with model misspecification. Therefore, our results can be seen as strict generalization of Abbasi-Yadkori et al. [2011]. e 5 Proof sketch Due to the space constraint, we sketch the proof in this section while more details are deferred to the Appendix. We begin with the proof overview of Theorem 4.1. 5.1 Upper bounds Upper bound of switching cost. Let updates the policy (N is the global switching cost), and we also define k0 = 0. k1, k2, { , kN * * * } be the episodes where the algorithm According to the update rule (line 7 of Algorithm 1), every time the policy is updated, at least one det(Σk [N ]. This further implies h) doubles, which implies that ΠH h=1 det(Σki+1 h=1 det(Σki h ) for all i 2ΠH ∈ ) h ΠH h=1 det(ΣkN h ) ≥ ≥ h=1 det(Σk0 2N ΠH h ). H h=1 dh (details in Lemma D.2) and the Since the left hand side can be upper bounded by KP right hand side is just 2N (from definition), the global switching cost (i.e. N ) is bounded by O( H h=1 dh log K). P Below we give a proof overview of the regret bound. ) = Qh( ̄θk Upper bound of regret. We denote ̄Qk ) = φh( h)( , h( , , h is the solution * * * * * ) = Vh( ̄θk of Definition 3.1 at the k-th episode. Similarly, ̄V k ). In addition, let bk denote the h)( h ( * * [K]. last policy update before episode k, for all k h, where ̄θk )⊤ ̄θk * ∈ Based on concentration inequalities of self-normalized processes, we can show that with high prob- ability, the "best feasible" approximant parameter θ⋆ (Definition A.3) is a feasible solution of Definition 3.1. Therefore, the ̄V k 1 (s1) (summarized 1 (s1) is always a nearly optimistic estimate of V ⋆ 11 in Lemma A.5) and we only need to bound K Regret(K) = V ⋆ 1 (s1) − πbk 1 V (s1) (cid:17) (4) HK + I ≤ K Xk=1 (cid:16) ̄V bk 1 (s1) Xk=1 (cid:16) − πbk 1 V (s1) . (cid:17) Meanwhile, the pointwise Bellman error can be bounded as (this result is stated in Lemma A.6) ̄Qbk h − T h ̄Qbk h+1 (s, a) (cid:12) (cid:16) (cid:12) (cid:12) O( + (cid:17) dh + dh+1). (cid:12) (cid:12) (cid:12) + 2 k ≤ I φh(s, a) k(Σ bk h )−1 αbk h , q where αk h ≤ √K I q As a result, applying regret decomposition accross different layers h martingale difference by Azuma-Hoeffding inequality (Lemma D.1), we have ∈ e p [H] and bounding the K ̄V bk 1 (s1) Xk=1 (cid:16) K H − πbk 1 V (s1) + 2 φh(sk I bk h )−1 (Σ αbk h Xh=1 (cid:18) (cid:19) Xk=1 + Sum of bounded martingale difference q (cid:13) (cid:13) (cid:13) (cid:17) h, ak h) (cid:13) (cid:13) (cid:13) K H k=1 X h=1 X 2 (cid:13) (cid:13) (cid:13) φh(sk h, ak h) (cid:13) (cid:13) (cid:13) (a) bk h )−1 (Σ αbk h q | +HK I H + O( {z dhK). } ≤ ≤ e Due to our update rule based on det(Σk Xh=1 p h), we have (a) ≤ H 2 q Xh=1 αK K h * v u u t K 2K 2 q H αK h * v u u t k=1 X (cid:13) (cid:13) 2 (Σ bk h )−1 K φh(sk h, ak h) Xk=1 (cid:13) (cid:13) h, ak φh(sk h) (cid:13) (cid:13) 2 (Σk h)−1 (cid:13) (cid:13) Kdh p ! (√K Xh=1 H + dh + dh+1) * I p H Xh=1 p e dhK + I dh√K), Xh=1 12 H ≤ h=1 X O ≤ e O( ≤ (5) (6) where the second inequality holds because of Lemma D.3 and our update rule. The third inequality is from elliptical potential lemma (Lemma D.4). Finally, the regret bound results from plugging (6) into (5). 5.2 Lower bound In this part, we sketch the proof of Theorem 4.2. = 0), which has deterministic We construct a hard MDP case with zero inherent Bellman error ( transition kernel. Therefore, deploying some deterministic policy will lead to a deterministic tra- jectory, like pulling an "arm" in the multi-armed bandits (MAB) setting. We further show that H h=1 dh). Together with the lower bounds of switching the number of such "arms" is at least Ω( H cost in multi-armed bandits [Qiao et al., 2022], we can derive the Ω( h=1 dh) lower bound under the low inherent Bellman error setting. P I P 6 Extension to generalized linear function approximation In this section, we consider low adaptive reinforcement learning with generalized linear function approximation [Wang et al., 2019]. We show that the same "doubling schedule" for updating exploration policy (line 7 of Algorithm 1) can be leveraged under this setting, which enables the design of provably efficient algorithms. We begin with the introduction of generalized linear function approximation. 6.1 Problem setup Different from the low inherent Bellman error setting which characterizes Q⋆ using linear functions, we use a function class of generalized linear models (GLMs) to model Q⋆. We denote the dimension of feature map by d and define Bd = x k x { Definition 6.1 (GLM [Wang et al., 2019]). For a known feature map φ : known link function f : [ φ(s, a), θ f ( h 1, 1], the class of generalized linear models is Bd and a (s, a) { S × A → = ) : θ i k2 ≤ . 1 } Rd : [ − 1, 1] Bd . } → → − ∈ ∈ G Similar to Wang et al. [2019], we make the following standard assumption which is without loss of generality. Assumption 6.2. f ( ) is either monotonically increasing or decreasing. Furthermore, there exist * absolute constants 0 < κ1 < κ2 < M , for all such that κ1 ≤ | f ′′(z) | and M < κ2 and f ′(z) | ≤ | ≤ ∞ ∞ 1. z | | ≤ This assumption is naturally satisfied by the identical map f (z) = z and also includes other non- linear maps such as the logistic map f (z) = 1/(1 + e−z). To characterize completeness under this function class, Wang et al. [2019] assumes the function h (defined in Section 2). Similarly, we make class is closed with respect to the Bellman operator the same optimistic closure assumption below. Note that for a fixed constant Γ > 04, the enlarged function class is defined as T 4Γ will be set to depend polynomially on d and log K. 13 Gup = (s, a) { θ → Bd, 0 φ(s, a), θ 1, f ( min { h Γ, A < 0, γ ∈ ≤ ≤ ) + γ i φ(s, a) A k k k2 ≤ . 1 } A k : } Then the optimistic closure assumption is stated below. Assumption 6.3. For all h [H] and g up, we have h(g) T . ∈ G ∈ G ∈ According to Proposition 1 of Wang et al. [2019], this assumption strictly generalizes the standard linear MDP setting by allowing link functions with more expressivity. 6.2 Low switching algorithm We present our Algorithm 2 below. Intuitively speaking, the algorithmic idea is to apply doubling schedule to Algorithm 1 of Wang et al. [2019]. Similar to Algorithm 1, we only update the explo- ration policy when the "information gain" with respect to some layer has doubled (line 7). When the policy is updated, the LSVI step calculates an estimate of θ⋆ (the parameter w.r.t. the real Q⋆ function) iteratively from the H-th layer to the first layer through minimizing (7). Then the h )−1 to the empirical optimistic Q value function is constructed by adding a bonus term γ h) (line 11). Finally, the greedy policy is deployed for collecting data (line 12, ) k(Σk * , φ( * k estimate f (φ( , * 18). )⊤θk * 6.3 Main results of Algorithm 2 In this part, we state the main results about Algorithm 2. We begin with the upper bounds for regret and switching cost. Recall that we still assume [0, 1] almost surely, while d represents the dimension of the feature map. H h=1 rh ∈ P Theorem 6.4 (Main results). The global switching cost of Algorithm 2 is bounded by O(dH * δ, the regret of Algorithm 2 over K episodes is bounded by In addition, with probability 1 − log K). Regret(K) ≤ O H√d3K . (cid:16) (cid:17) e The proof of Theorem 6.4 is deferred to Appendix C due to space limit, below we discuss several interesting aspects of Theorem 6.4. Near-optimal switching cost. Our algorithm achieves a switching cost that depends logarithmi- cally on K, which improves the O(K) switching cost of Algorithm 1 in Wang et al. [2019]. We also prove the following information-theoretic limit which says that the switching cost of Algorithm 2 is optimal up to logarithmic factors. Theorem 6.5 (Lower bound for no-regret learning). For any algorithm with sub-linear regret bound, the global switching cost is at least Ω(dH). Theorem 6.5 is adapted from the lower bound for global switching cost under linear MDP [Gao et al., 2021], and we leave the proof to Appendix C. 14 Algorithm 2 Low-switching-cost LSVI-UCB with generalized linear function approximation 1: Input: Number of episodes K, feature map , φ( * { , failure probability δ, parameters κ1, κ2, M , ) } * h = Id, for all h ∈ [H]. γ = Cκ2κ−1 1 1 + M + κ2 + d2 log( 1+κ2+Γ δ ). q universal constant C. 2: Initialize: Σh = Σ0 3: for k = 1, 2, 4: , K do , H do h, aτ * * * for h = 1, 2, * * * k−1 Σk τ =1 φ(sτ h = end for P [H], det(Σk if h) h ∃ ∈ Set Qk ) = 0. , H+1( * * for h = H, * * * , 1 do h)φ(sτ h, aτ h)⊤ + Id. 2 det(Σh) then ≥ Solve the empirically optimal estimate of θ⋆. θk h = arg min kθk2≤1 k−1 τ =1 X φ(sτ (f ( h h, aτ h), θ ) i − rτ h − max a′∈A Qk h+1(sτ h+1, a′))2. (7) Construct the Q value function: Qk , h( * Set πk Set Σh = Σk h. h(s) = arg maxa∈A Qk h(s, a). end for else , 1, f (φ( ) = min * { * )⊤θk * h) + γ , φ( * k ) k(Σk * h )−1 . } Set πk h = πk−1 h for all h [H]. ∈ end if 17: 18: Deploy policy πk = (πk 1 , 19: end for , πk H) and get trajectory (sk 1, ak 1, rk 1 , , sk H+1). * * * * * * 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: Generalization over previous results. The closest result to our Algorithm 2 is the fully adap- tive Algorithm 1 of Wang et al. [2019], which achieves the same regret bound. In comparison, our Algorithm 2 favors near optimal global switching cost at the same time, which saves computation and accelerates the learning process. H√d3K O (cid:17) (cid:16) e When applying our Algorithm 2 to the linear MDP case, our Theorem 6.4 will imply a regret bound O(√d3H 3T )5 (T = KH) and a global switching cost of O(dH log K), which recovers the results of in Gao et al. [2021], Wang et al. [2021]. Therefore, our result can be considered as generalization of these two results since GLMs allow more general function classes. e 7 Conclusion and future work This paper studied the well motivated problem of online reinforcement learning with low switch- ing cost. Under linear Bellman-complete MDP with low inherent Bellman error, we designed an and algorithm (Algorithm 1) with near optimal regret bound of K O H h=1 dh√K + H h=1 √dh 5The identical link function corresponds to κ1 = κ2 = 1 and M = 0. In addition, due to rescaling of reward P functions, there will be an additional H factor in the regret bound of Theorem 6.4. (cid:16)P e I (cid:17) 15 log K). In addition, we prove a (nearly) matching global global switching cost bound of O( H switching cost lower bound Ω( h=1 dh) for any algorithm with sub-linear regret. At the same time, P we leverage the same "doubling trick" under the generalized linear function approximation setting, and designed a sample-efficient algorithm (Algorithm 2) with near optimal switching cost. P * H h=1 dh Although being more general than linear MDP, the two settings we consider are not the most general ones. The low Bellman eluder dimension setting [Jin et al., 2021] and MDP with differentiable function approximation [Zhang et al., 2022a] can be considered as generalization of the two settings in this paper, respectively. Therefore, our results can be considered as a middle step towards low switching reinforcement learning under more general MDP settings. For further extension, it will be interesting to find out whether low switching cost RL is possible under more general MDP settings (e.g., low Bellman eluder dimension [Jin et al., 2021], differentiable function class [Zhang et al., 2022a, Yin et al., 2023]), and we leave these as future work. Acknowledgments The research is partially supported by NSF Award #2007117. References Yasin Abbasi-Yadkori, D ́avid P ́al, and Csaba Szepesv ́ari. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, pages 2312–2320, 2011. M Mehdi Afsar, Trafford Crump, and Behrouz Far. Reinforcement learning based recommender systems: A survey. arXiv preprint arXiv:2101.06286, 2021. Alekh Agarwal, Sham Kakade, Akshay Krishnamurthy, and Wen Sun. Flambe: Structural com- plexity and representation learning of low rank mdps. Advances in neural information processing systems, 33:20095–20107, 2020. Yu Bai, Tengyang Xie, Nan Jiang, and Yu-Xiang Wang. Provably efficient q-learning with low switching cost. Advances in Neural Information Processing Systems, 32, 2019. Minbo Gao, Tianle Xie, Simon S Du, and Lin F Yang. A provably efficient algorithm for linear markov decision process with low switching cost. arXiv preprint arXiv:2101.00494, 2021. Zijun Gao, Yanjun Han, Zhimei Ren, and Zhengqing Zhou. Batched multi-armed bandits problem. Advances in Neural Information Processing Systems, 32, 2019. Jiawei Huang, Jinglin Chen, Li Zhao, Tao Qin, Nan Jiang, and Tie-Yan Liu. Towards deployment- efficient reinforcement learning: Lower bound and optimality. In International Conference on Learning Representations, 2022. Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Con- textual decision processes with low bellman rank are pac-learnable. In International Conference on Machine Learning-Volume 70, pages 1704–1713, 2017. Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement 16 learning with linear function approximation. 2143. PMLR, 2020. In Conference on Learning Theory, pages 2137– Chi Jin, Qinghua Liu, and Sobhan Miryoosefi. Bellman eluder dimension: New rich classes of rl problems, and sample-efficient algorithms. Advances in neural information processing systems, 34:13406–13418, 2021. Jens Kober, J Andrew Bagnell, and Jan Peters. Reinforcement learning in robotics: A survey. The International Journal of Robotics Research, 32(11):1238–1274, 2013. Dingwen Kong, Ruslan Salakhutdinov, Ruosong Wang, and Lin F Yang. Online sub-sampling for reinforcement learning with general function approximation. arXiv preprint arXiv:2106.07203, 2021. Tor Lattimore and Csaba Szepesv ́ari. Bandit algorithms. Cambridge University Press, 2020. Tatsuya Matsushima, Hiroki Furuta, Yutaka Matsuo, Ofir Nachum, and Shixiang Gu. Deployment- efficient reinforcement learning via model-based offline optimization. In International Conference on Learning Representations, 2020. Aditya Modi, Jinglin Chen, Akshay Krishnamurthy, Nan Jiang, and Alekh Agarwal. Model-free representation learning and exploration in low-rank mdps. arXiv preprint arXiv:2102.07035, 2021. Vianney Perchet, Philippe Rigollet, Sylvain Chassang, and Erik Snowberg. Batched bandit prob- lems. The Annals of Statistics, 44(2):660–681, 2016. Dan Qiao and Yu-Xiang Wang. Near-optimal deployment efficiency in reward-free reinforcement learning with linear function approximation. arXiv preprint arXiv:2210.00701, 2022. Dan Qiao, Ming Yin, Ming Min, and Yu-Xiang Wang. Sample-efficient reinforcement learning with loglog(T) switching cost. In International Conference on Machine Learning, pages 18031–18061. PMLR, 2022. Wen Sun, Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, and John Langford. Model-based rl in contextual decision processes: Pac bounds and exponential improvements over model-free approaches. In Conference on learning theory, pages 2898–2933. PMLR, 2019. Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998. Grigoris Velegkas, Zhuoran Yang, and Amin Karbasi. The best of both worlds: Reinforcement learning with logarithmic regret and policy switches. arXiv preprint arXiv:2203.01491, 2022. Ruosong Wang, Russ R Salakhutdinov, and Lin Yang. Reinforcement learning with general value function approximation: Provably efficient approach via bounded eluder dimension. Advances in Neural Information Processing Systems, 33:6123–6135, 2020. Tianhao Wang, Dongruo Zhou, and Quanquan Gu. Provably efficient reinforcement learning with linear function approximation under adaptivity constraints. Advances in Neural Information Processing Systems, 34, 2021. 17 Yining Wang, Ruosong Wang, Simon S Du, and Akshay Krishnamurthy. Optimism in reinforcement learning with generalized linear function approximation. arXiv preprint arXiv:1912.04136, 2019. Lin Yang and Mengdi Wang. Sample-optimal parametric q-learning using linearly additive features. In International Conference on Machine Learning, pages 6995–7004. PMLR, 2019. Ming Yin, Mengdi Wang, and Yu-Xiang Wang. Offline reinforcement learning with differentiable function approximation is provably efficient. International Conference on Learning Representa- tions, 2023. Chao Yu, Jiming Liu, Shamim Nemati, and Guosheng Yin. Reinforcement learning in healthcare: A survey. ACM Computing Surveys (CSUR), 55(1):1–36, 2021. Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near op- timal policies with low inherent bellman error. In International Conference on Machine Learning, pages 10978–10989. PMLR, 2020. Ruiqi Zhang, Xuezhou Zhang, Chengzhuo Ni, and Mengdi Wang. Off-policy fitted q-evaluation with differentiable function approximators: Z-estimation and inference theory. In International Conference on Machine Learning, pages 26713–26749. PMLR, 2022a. Zihan Zhang, Yuan Zhou, and Xiangyang Ji. Almost optimal model-free reinforcement learning via reference-advantage decomposition. Advances in Neural Information Processing Systems, 33: 15198–15207, 2020. Zihan Zhang, Yuhang Jiang, Yuan Zhou, and Xiangyang Ji. Near-optimal regret bounds for multi- batch reinforcement learning. arXiv preprint arXiv:2210.08238, 2022b. Zhenpeng Zhou, Steven Kearnes, Li Li, Richard N Zare, and Patrick Riley. Optimization of molecules via deep reinforcement learning. Scientific reports, 9(1):1–10, 2019. 18 A Proof of Theorem 4.1 In this section, we prove our main theorem. We first restate Theorem 4.1 below, and then prove the bounds for switching cost and regret in Section A.1 and Section A.2, respectively. Theorem A.1 (Restate Theorem 4.1). The global switching cost of Algorithm 1 is bounded by δ, the regret of Algorithm 1 over K episodes O( * is bounded by log K). In addition, with probability 1 H h=1 dh − P Regret(K) O ≤ e H Xh=1 H dh√K + Xh=1 p dh I K . ! A.1 Proof of switching cost bound Proof of switching cost bound. Let k1, k2, { the policy, and we also define k0 = 0. , kN } * * * be the episodes where the algorithm updates According to the update rule (line 7 of Algorithm 1), for all i such that det(Σki+1 hi ) ≥ 2 det(Σki hi). [N ], there exists some hi [H] ∈ ∈ In addition, for all h, i [H] × ∈ [N ], we have det(Σ ki+1 h ) Combining these two results, we have for all i ∈ det(Σki h ). ≥ [N ], Therefore, it holds that ΠH h=1 det(Σ ki+1 h ) ≥ 2ΠH h=1 det(Σki h ). H h=1 dh KP ΠH h=1 det(ΣkN h ) ≥ ≥ 2N ΠH h=1 det(Σk0 h ) = 2N , (8) (9) where the first inequality is because of Lemma D.2 and our choice that λ = 1. The second inequality is due to recursive application of (8). The last equation holds since we have Σk0 h = Idh for all h. Solving (9), we have N P H h=1 dh log K log 2 ≤ A.2 Proof of regret bound = O( H h=1 dh log K), and therefore the proof is complete. P We first state some technical lemmas from Zanette et al. [2020]. We begin with the following bound on failure probability. Lemma A.2 (Lemma 2 of Zanette et al. [2020]). With probability at least 1 h [H], Vh+1 ∈ V ∈ h+1, δ/2, for all k [K], ∈ − φi h ri h − (cid:16) rh(si h, ai h) + Vh+1(si h+1) E − s′∼Ph(*|si h,ai h)Vh+1(s′) (cid:17) βk h, (10) (Σk h)−1 ≤ q k−1 i=1 X (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) βk h := where dh log(1 + k/dh) + 2dh+1 log(1 + 4√kdh) + log( 2KH δ ) + 1 = q q 19 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) O( dh + dh+1). p e Next, we define the "best" feasible parameters θ⋆ that well approximate the Q⋆ values, and such parameters are going to be a feasible solution for the optimization problem (Definition 3.1). Then we state the accuracy bound of θ⋆. Definition A.3 (Best feasible approximant, Definition 4 of Zanette et al. [2020]). We recursively define the best approximant parameter θ⋆ [H] as: h for h ∈ with ties broken arbitrarily and θ⋆ θ⋆ h = arg min θ∈Bh sup (s,a) φh(s, a)⊤θ (cid:12) (cid:12) (cid:12) H+1 = 0. ( T − hQh+1(θ⋆ h+1))(s, a) (cid:12) (cid:12) (cid:12) (11) Lemma A.4 (Accuracy Bound of θ⋆, Lemma 6 of Zanette et al. [2020]). It holds that for all h [H]: Q⋆ h(s, a) sup (s,a) | φh(s, a)⊤θ⋆ h| ≤ − (H − h + 1) I . (12) ∈ For notational simplicity, for ̄θh which is the solution of Definition 3.1, we denote ̄Qh( , * h) where ̄θk h represents Qh( ̄θk Qh( ̄θh)( )⊤ ̄θh. Besides, ̄Qk , * * ) = Vh( ̄θk ) = Vh( ̄θh)( ) and ̄V k episode. Similarly, ̄Vh( ). h)( h ( * * * * [K]. policy update before episode k, for all k ) = * h is the solution at the k-th In addition, let bk denote the last , ) = φh( * * ∈ Lemma A.5 (Optimism, Lemma 7 of Zanette et al. [2020]). Under the high probability case in + √dh = √k h, for [H] is a feasible solution of the optimization problem (Definition 3.1). Therefore, for all dh + dh+1), then ̄θh = θ⋆ βk h + √k h = αk O( + I I q q Lemma A.2, if we choose all h k ∈ ∈ [K], the optimistic value function satisfies p e In addition to optimism, we also have the following upper bound of Bellman error. ̄V bk 1 (s1) V ⋆ 1 (s1) H . I − ≥ (13) Lemma A.6 (Bound of Bellman error, Lemma 1 of Zanette et al. [2020]). Under the high proba- bility case in Lemma A.2, it holds that for all (k, h, s, a) [K] [H] , ∈ × × S × A h − T ̄Qbk (cid:12) (cid:16) (cid:12) (cid:12) h ̄Qbk h+1 (s, a) (cid:17) (cid:12) (cid:12) (cid:12) ≤ I = I + φh(s, a) k k(Σ bk h )−1 + 2 k φh(s, a) k(Σ + bk I αbk h . (cid:18)p bk h )−1 q βbk h + dh + αbk h q p q (cid:19) (14) Now we are ready to present the regret analysis of Algorithm 1. Proof of regret bound. We prove based on the high probability case in Lemma A.2. 20 First of all, the regret over K episodes can be decomposed as Regret(K) = = = K Xk=1 (cid:16) K k=1 (cid:16) X V ⋆ 1 (s1) V ⋆ 1 (s1) − − HK + I ≤ K Xk=1 (cid:16) K Xk=1 (V ⋆ 1 (s1) − V πk 1 (s1)) πbk 1 V (s1) (cid:17) K ̄V bk 1 (s1) (cid:17) ̄V bk 1 (s1) − + ̄V bk 1 (s1) k=1 (cid:16) X πbk V 1 (s1) , (cid:17) − πbk 1 V (s1) (cid:17) where the last inequality results from Lemma A.5. Note that ̄V bk h (sk h) = ̄Qbk h (sk h, ak h) due to our choice of πk, it holds that for all k, h ∈ ̄V bk h − πbk h V (sk h) = ̄Qbk h (sk h, ak h) h ̄Qbk h+1(sk h, ak h) + T − T h ̄Qbk (cid:16) ≤I + 2 φh(sk (cid:17) h, ak h) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) bk h )−1 (Σ q αbk h + E s′∼Ph(*|sk h,ak h) ̄V bk h+1 − (cid:16) V where the inequality holds because of Lemma A.6. Plugging (16) into (15), we have with probability 1 δ, − Regret(K) HK + I ≤ HK I ≤ H + K H + k=1 X K h=1 (cid:18) X I (cid:13) (cid:13) (cid:13) h,ak h) E s′∼Ph(*|sk h=1 X k=1 (cid:16) X K H HK + I ≤ + 2 I Xk=1 Xh=1 (cid:18) H =2HK I + O( dhK) + K ̄V bk 1 (s1) Xk=1 (cid:16) − πbk 1 V (s1) + 2 φh(sk bk h )−1 (Σ h, ak h) (cid:13) (cid:13) (cid:13) πbk V h+1 ̄V bk h+1 − (cid:16) (cid:17) αbk h q (cid:19) φh(sk h, ak h) (cid:13) (cid:13) (cid:13) 2 H K (cid:13) (cid:13) (cid:13) (s′) (cid:17) − ̄V bk h+1 − (cid:16) αbk h + O( bk h )−1 (Σ q (cid:19) e bk h )−1 (Σ Xh=1 p αbk h , q φh(sk h, ak h) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) Xh=1 p Xk=1 Xh=1 e (15) [H], (16) [K] × (sk h) h, ak h) πbk h V − h+1(sk πbk h+1 (s′), (cid:17) πbk h+1 V (sk h+1) (cid:17) H (cid:17) dhK) (17) where the second inequality is because of (16). The last inequality holds with high probability due dh+1 for to Azuma-Hoeffding inequality (Lemma D.1) and the fact that any k ̄V bk h+1k∞ ≤ k k ̄θbk h+1k2 ≤ [K]. p ∈ 21 Finally, it holds that Regret(K) 2HK I ≤ H H K H + O( dhK) + 2 Xh=1 p H e Xk=1 Xh=1 K 2HK I ≤ + O( dhK) + 2 h=1 p X H e K αK h * v u u t h=1 q X H k=1 X K (cid:13) (cid:13) αbk h bk h )−1 q (Σ φh(sk h, ak h) (cid:13) (cid:13) (cid:13) 2 (Σ h, ak h) (cid:13) (cid:13) (cid:13) φh(sk bk h )−1 (cid:13) (cid:13) h, ak h) φh(sk 2 (Σk h)−1 ≤ ≤ ≤ ≤ O(HK e O(HK e O(HK + + + I I I H e O( h=1 p X e dhK) + 2 dhK) + 2 h=1 X H p Xh=1 p H αK h * v u u t h=1 q X H K 2 k=1 X αK h * Xh=1 q 2K * p dhK) + K log(1 + K) (cid:13) (cid:13) (cid:13) (cid:13) 2dh log(1 + K) H Xh=1 p Kdh + I p dh(dh + dh+1) ! O * e (18) Xh=1 p H dhK + I h=1 X p dh√K), where the second inequality holds according to Cauchy-Schwarz inequality and the fact that αk non-decreasing in k. The third inequality results from Lemma D.3 and the fact that det((Σbk det(Σbk lemma (Lemma D.4). The fifth inequality is derived by the definition of αK The last inequality comes from direct calculation. h is h )−1) = h)−1). The forth inequality is because of elliptical potential h (from Lemma A.5). h)−1 = 2 det((Σk 2 det(Σk h )−1 ≤ The regret analysis is complete. B Proof of Theorem 4.2 In this section, we prove our lower bound of switching cost. Theorem B.1 (Restate Theorem 4.2). Assume that the inherent Bellman error for all h Ω( 3 [H], for any algorithm with sub-linear regret bound, the global switching cost is at least = 0 and dh ≥ I ∈ H h=1 dh). P = We first briefly discuss about our assumptions. We assume zero inherent Bellman error (i.e. 0) since it is possible to derive sub-linear regret bounds only if = 0, and we want to derive lower bounds of switching cost for algorithms with sub-linear regret. Otherwise, the regret bound will always be linear in K. Also, the assumption on dh [H] is without loss of generality. 3 for all h ≥ ∈ I I Proof of Theorem B.1. We first construct an MDP with two states, the initial state s1 and the absorbing state s2. For absorbing state s2, the choice of action is only a0, while for initial state s1, the choice of actions 22 at layer h is a1, a2, { * * * , adh−1} φh(s2, a0) = (1, 0, 0, , 0), φh(s1, ai) = (0, , 0, 1, 0, ), * * * * * * * * * . Then we define the dh-dimensional feature map for the h-th layer: ∈ − [dh 1]), the (i + 1)-th element is 1 while all other elements are 0. where for s1, ai (i We now define the transition kernel and reward function as Ph(s2| Ph(s1| h ∈ inherent Bellman error ( Q-value functions. s2, a0) = 1, rh(s2, a0) = 0, s1, ai) = 1, rh(s1, ai) = rh,i for all dh, where rh,i's are unknown non-zero values. Note that such MDP has zero includes all possible s1, a1) = 1, rh(s1, a1) = 0 for all h [H]. Besides, Ph(s2| = 0) since the function class φh(s, a)⊤θh { [H] and 2 ∈ B θh ≤ ≤ ∈ I } i h | − 1 steps, then at step h the agent takes action ai (i Therefore, for any deterministic policy, the only possible case is that the agent takes action a1 and stays at s1 for the first h 2) and transitions to s2 with reward rh,i, later the agent always stays at s2 with no more reward. For this trajectory, the total reward will be rh,i. Also, for any deterministic policy, the trajectory is fixed, like pulling an "arm" in multi-armed bandits setting. Note that the total number of such "arms" with non-zero H 3. Even h=1 dh) due to our assumption that dh unknown reward is at least if the transition kernel is known to the agent, this MDP is still as difficult as a multi-armed bandits P problem with Ω( H h=1 dh) arms. Together will Lemma B.2 below, the proof is complete. H h=1(dh 2) = Ω( P ≥ ≥ − Lemma B.2 (Lemma H.4 of Qiao et al. [2022]). For any algorithm with sub-linear regret bound under K-armed bandit problem, the switching cost is at least Ω(K). P C Proof for Section 6 In this section, we prove the theorems regarding our Algorithm 2 under the generalized linear func- tion approximation setting. We begin with the upper bounds for switching cost and regret. C.1 Proof of upper bounds Theorem C.1 (Restate Theorem 6.4). The global switching cost of Algorithm 2 is bounded by O(dH δ, the regret of Algorithm 2 over K episodes is bounded by log K). In addition, with probability 1 − * Regret(K) ≤ O H√d3K . (cid:16) (cid:17) e Bd = , φ(s, a) Proof of switching cost bound. Since the feature map in Algorithm 2 satisfies that for all s, a , we have 1 } x S × A { Lemma D.2 still holds, with dh = d for all h (line 7 of Algorithm 2) is identical to Algorithm 1, the O(dH results from identical proof as in Section A.1, with all dh replaced by d. ∈ 1. Therefore, the conclusion of [H]. In addition, because our policy update rule log K) upper bound of switching cost φ(s, a) k k2 ≤ k2 ≤ Rd : x k ∈ ∈ ∈ * Before we prove the upper bound of regret, we state some technical lemmas from Wang et al. [2019]. 23 Lemma C.2 (Corollary 3 of Wang et al. [2019]). We denote the estimated Q value function of R+ such layer h at the k-th episode by Qk , h( * [H] that for all (k, h, s, a) × S × A Qk h(s, a) ). Suppose there exists a function confk * h+1)(s, a) + confk × h(s, a) S × A → h(s, a), h(Qk (19) [K] Q⋆ h : ∈ , ≤ ≤ T h is Bellman operator) and the policy πk is the greedy policy with respect to Qk h, then with (where probability at least 1 T δ, − Regret(K) K H ≤ Xk=1 Xh=1 confk h(sk h, ak h) + O(H K log(1/δ)). p Lemma C.2 is a standard regret decomposition which will be used to bound the regret of Algorithm 2. Below we give a valid choice of the confidence bound confk h. Note that we define bk to be the last policy update before episode k, for all k h for all k Lemma C.3 (Adapted from Lemma 6 of Wang et al. [2019]). With probability 1 for all k, h, s, a [K]. Therefore, Qk δ, it holds that h = Qbk [K]. [K] [H] − ∈ ∈ , ∈ × × S × A φ(s, a), θk ) f ( hi h where γ is defined in Algorithm 2. (cid:12) (cid:12) (cid:12) − T h(Qk h+1)(s, a) (cid:12) (cid:12) (cid:12) γ φ(s, a) k k(Σ bk h )−1, ≤ Therefore, optimism is straightforward. Lemma C.4 (Corollary 5 of Wang et al. [2019]). Under the high probability case in Lemma C.3, Q⋆ for all k, h, s, a , Qk [K] [H] ∈ × × S × A h(s, a) ≥ h(s, a). Combining optimism (Lemma C.4) with Lemma C.3, we have that Qk condition (19) with confk bk h(s, a) = γ h )−1. Below we bound the summation of bonus. h in Algorithm 2 satisfies φ(s, a) k k(Σ Lemma C.5. Assume that confk h(s, a) = γ φ(s, a) k k(Σ bk h )−1, then it holds that K H k=1 X h=1 X confk h(sk h, ak h) = K H γ k=1 X h=1 X φ(sk k h, ak h) k(Σ bk h )−1 ≤ Hγ 4Kd log(1 + K). (20) p Proof of Lemma C.5. K H γ h=1 X k=1 X H φ(sk k h, ak h) k(Σ H K bk h )−1 ≤ K γ v u u t h=1 X φ(sk h, ak h) k=1 X (cid:13) (cid:13) (cid:13) (cid:13) 2 (Σ bk h )−1 2 φ(sk h, ak h) 2 (Σk h)−1 (21) ≤ K γ v u u t h=1 X H K k=1 X γ 2K * ≤ Xh=1 =Hγ p 4Kd log(1 + K), (cid:13) (cid:13) (cid:13) (cid:13) 2d log(1 + K) p 24 where the first inequality holds according to Cauchy-Schwarz inequality. The second inequality re- sults from Lemma D.3 and the fact that det((Σbk h)−1). The third inequality is because of elliptical potential lemma (Lemma D.4). h )−1) = det(Σbk h)−1 = 2 det((Σk 2 det(Σk h )−1 ≤ Now we are ready to present the proof of the regret upper bound. O(H√d3K) regret upper bound is derived by combining Proof of regret upper bound. The final Lemma C.2, Lemma C.5 and the definition that γ = C.2 Proof of lower bound Finally, we present the proof of the lower bound. e O(d). e Theorem C.6 (Restate Theorem 6.5). For any algorithm with sub-linear regret bound, the global switching cost is at least Ω(dH). Proof of Theorem C.6. Since linear MDP is a special case of generalized linear function approxima- tion, the Ω(dH) lower bound of global switching cost in Gao et al. [2021] holds here. D Assisting technical lemmas Lemma D.1 (Azuma-Hoeffding inequality). Let Xi be a martingale difference sequence such that Xi A, A] for some A > 0. Then with probability at least 1 δ, it holds that: [ − ∈ − 2A2n log( 1 δ ). ≤ r n Xi (cid:12) i=1 (cid:12) X (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Lemma D.2 (Lemma C.1 of Wang et al. [2021]). Let [K], we have det(Σk h) 1. Then for all h [H] and k ∈ ∈ Σk h}(h,k)∈[H]×[K] be as defined in Algorithm { (λ + k−1 ≤ dh )dh. Lemma D.3 (Lemma 12 of Abbasi-Yadkori et al. [2011]). Suppose A, B definite matrices satisfying that A < B, then for any x Rd, we have ∈ det(A) det(B) . x k x k 2 A k 2 B ≤ k Rd×d are two positive ∈ Lemma D.4 (Elliptical Potential Lemma, Lemma 26 of Agarwal et al. [2020]). Consider a se- 1 and define quence of d M0 = I, d positive semi-definite matrices X1, × , Mt = Mt−1 + Xt. Then , XT with maxt T r(Xt) * * * ≤ * * * T r(XtM −1 t−1) ≤ 2d log(1 + T d ). T t=1 X 25
http://arxiv.org/abs/2302.12453v1
2023-02-24T05:07:05
2023-02-24T05:07:05
Inducing Neural Collapse in Deep Long-tailed Learning
Although deep neural networks achieve tremendous success on various classification tasks, the generalization ability drops sheer when training datasets exhibit long-tailed distributions. One of the reasons is that the learned representations (i.e. features) from the imbalanced datasets are less effective than those from balanced datasets. Specifically, the learned representation under class-balanced distribution will present the Neural Collapse (NC) phenomena. NC indicates the features from the same category are close to each other and from different categories are maximally distant, showing an optimal linear separable state of classification. However, the pattern differs on imbalanced datasets and is partially responsible for the reduced performance of the model. In this work, we propose two explicit feature regularization terms to learn high-quality representation for class-imbalanced data. With the proposed regularization, NC phenomena will appear under the class-imbalanced distribution, and the generalization ability can be significantly improved. Our method is easily implemented, highly effective, and can be plugged into most existing methods. The extensive experimental results on widely-used benchmarks show the effectiveness of our method
[ "Xuantong Liu", "Jianfeng Zhang", "Tianyang Hu", "He Cao", "Lujia Pan", "Yuan Yao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12453v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12453v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Inducing Neural Collapse in Deep Long-tailed Learning Xuantong Liu1,∗ Jianfeng Zhang2 1 The Hong Kong University of Science and Technology, 2Huawei Noah's Ark Lab Tianyang Hu2 Lujia Pan2 He Cao1 Yuan Yao1,(cid:12) 3 2 0 2 b e F 4 2 ] G L . s c [ 1 v 3 5 4 2 1 . 2 0 3 2 : v i X r a Abstract Although deep neural networks achieve tremen- dous success on various classification tasks, the generalization ability drops sheer when training datasets exhibit long-tailed distributions. One of the reasons is that the learned representations (i.e. features) from the imbalanced datasets are less ef- fective than those from balanced datasets. Specif- ically, the learned representation under class- balanced distribution will present the Neural Col- lapse (N C) phenomena. N C indicates the fea- tures from the same category are close to each other and from different categories are maximally distant, showing an optimal linear separable state of classification. However, the pattern differs on imbalanced datasets and is partially responsible for the reduced performance of the model. In this work, we propose two explicit feature regulariza- tion terms to learn high-quality representation for class-imbalanced data. With the proposed reg- ularization, N C phenomena will appear under the class-imbalanced distribution, and the gen- eralization ability can be significantly improved. Our method is easily implemented, highly effec- tive, and can be plugged into most existing meth- ods. The extensive experimental results on widely- used benchmarks show the effectiveness of our method. 1 INTRODUCTION Modern deep neural networks have shown the ability to outperform humans on many tasks, such as computer vi- sion, natural language processing, playing games, etc., and keep refreshing state-of-the-art performance for complex classification tasks. However, when the training dataset is class-imbalanced, such as a long-tailed distribution, where (a) (b) (c) Figure 1: Illustration of geometry configuration of the zero- centered class means and classifier weights under (a) bal- anced dataset, (b) imbalanced dataset, and (c) imbalanced dataset with our method. The arrows represent classifier weights and the stars are the class centers. The size of the circle around the star reflects the variance of the feature from the same class. In (b) and (c), red and blue represent the majority and minority classes, respectively. Note that under imbalanced label distribution, both the centered class means and classifier weights form an asymmetric structure and are no longer parallel. a few majority classes occupy most of the training samples while a large number of minority classes own very limited samples, the performance of the model drops off a cliff (Van Horn & Perona, 2017; Buda et al., 2018). These imbal- anced distributions are ubiquitous in real-world applications, e.g., fault diagnosis, face recognition, autonomous driving, etc. Therefore, how to improve the discriminative ability of the model trained on the imbalanced dataset has always been a topic of considerable concern. Some recent studies focus on learning more effective repre- sentation to improve the long-tailed recognition ability. Su- pervised contrastive loss (Khosla et al., 2020) is utilized to learn compact within-class and maximally distant between- class representation by introducing uniformly distributed class centers, which leads to improvement in long-tailed per- formance (Li et al., 2022; Cui et al., 2021; Zhu et al., 2022). These characteristics of the feature representation are consis- tent with those learned from balanced datasets (Graf et al., 2021), where the classification models can spontaneously learn tight and discriminative features. However, contrastive Proceedings of the 26th International Conference on Artificial Intel- ligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). * This work is done when Xuantong Liu was doing her in- ternship at Huawei Noah's Ark. (cid:12) Corresponding author email: [email protected]. Inducing Neural Collapse in Deep Long-tailed Learning learning is more computationally expensive and requires more iterations to converge than the standard Cross-Entropy (CE) loss. Meanwhile, the learning behavior of deep classification models in a balanced setting has been investigated both empirically and theoretically (Papyan et al., 2020; Galanti et al., 2021; Han et al., 2022). The Neural Collapse (N C) phenomenon was uncovered by Papyan et al. (2020) when investigating the last-layer embedding, i.e. the feature repre- sentation, and the corresponding classifier weights in deep classification models during training. N C shows that the learned features (or embedded vectors) of the same class will collapse to their class centers. Meanwhile, these class cen- ters, after globally centered, as well as the classifier weights, will form a simplex equiangular tight frame (ETF) during the terminal phase of training (TPT), i.e. when the model achieves zero training error. The ETF structure maximizes the between-class variability so as the Fisher discriminant ratio (Fisher, 1936), resulting in an optimal linear separable state for classification. Subsequent studies have found more characteristics of this phenomenon, including the global op- timal property (Zhu et al., 2021) and generalization ability (Galanti et al., 2021). However, on imbalanced datasets, the deep neural networks will exhibit different geometric structures, and some N C phenomena will no longer occur (Fang et al., 2021; Thram- poulidis et al., 2022). The last-layer features of the same class still converge to their class means, but the class means, as well as the classifier weights, are not in the form of ETFs any more. Specifically, compared to majority classes, the learned features of minority classes will have a larger norm, and correspondingly the norm of classifier weights will be smaller (Kang et al., 2019; Fang et al., 2021). Furthermore, as the imbalance level increases, the phenomenon of Minor- ity Collapse may arise, in which both the learned represen- tations and the classifier weights on minority classes will become indistinguishable (Fang et al., 2021). The absence of some N C property partially explains the performance gap between the balanced and imbalanced datasets. In this paper, we first elaborate that the appearance of N C can help to minimize the generalization error in the imbal- anced problem. According to this property, we propose two simple yet effective regularization terms to explicitly induce all the N C phenomena in neural networks trained on imbalanced datasets. The regularization terms can be added to CE loss directly. Compared with supervised con- trastive learning, these terms have lower computational cost. Our proposed method not only helps the N C to occur faster for models trained on the balanced datasets, but also drives the N C phenomenon to occur on datasets with imbalanced categories. The resulting model can also obtain better gen- eralization ability and robustness without over-training as in Papyan et al. (2020). Furthermore, our proposed method is orthogonal to most existing methods dealing with long- tailed problems. It thus can be easily plugged into the ob- jective function to obtain further improvements. In summary, our contributions can be listed below: • We observe that when training data is imbalanced, the class centers of minority classes move closer to those of the majority classes, making their instances difficult to distinguish. • We demonstrate that, although some N C phenomena do not naturally exist in an imbalanced case, we can achieve lower generalization error when all N C propri- eties hold. Thus we propose two simple yet effective regularization terms to manually induce the N C during imbalanced training. • We experimentally show that our method can signifi- cantly improve the performance in various long-tailed tasks and boost most existing methods. 2 PROBLEM SETUP 2.1 Preliminaries Let fφ ◦ gθ(*) denote a neural network classifier, where gθ(*) is a feature extractor and fφ(*) is a linear classifier. We define H = [h1, * * * , hn]T ∈ Rn×P to be the output of gθ(*). Here P is the dimension of the latent feature, and n is the training sample size. The weights of fφ are denoted by W = [w1, * * * , wK] ∈ RP ×K, and the corresponding bias vector is b = [b1, ..., bK], where K is the number of classes. hi ∈ RP and yi ∈ {k}K k=1 denote the feature and label of the i-th sample. The label matrix is denoted by Y ∈ Rn×K. In the training data, we have n = (cid:80)K k=1 nk, where nk is the sample size of class k. We use || * ||F and || * || to denote the Frobenius norm of a matrix and the l2-norm of a vector. Definition 1 (Simplex ETF). A simplex ETF is a collection of equal-length and maximally-equiangular vectors. We call a P × K matrix M an ETF if it satisfies M TM = α (cid:18) K K − 1 I − 1 K − 1 1K1T K (cid:19) (1) for some non-zero scalar α. Where I is the identity matrix, and 1K is an all-ones vector. (cid:80) Let μk = 1 yi=k hi be the center of class k and μC = nk (cid:80)K 1 k=1 μk be the arithmetic mean of the class centers. K In the balanced case, where we have nk = n K for each class, N C will appear during TPT. The phenomena can be formally described by four properties: • (N C1) Variability collapse. Intra-class variances col- lapse to zero during the terminal phase of training, i.e., for any sample i from class k, we have ||hi − μk|| = 0 (2) Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12) • (N C2) Convergence to simplex ETF. The class cen- ters (after zero-center normalization) converge to the vertices of an ETF, i.e. cos(μk − μC, μk(cid:48) − μC) = − 1 K − 1 , ||μk − μC|| = ||μk(cid:48) − μC||. (3) (4) • (N C3) Convergence to self-duality. The weights of linear classifiers are parallel to the corresponded zero- centered class centers, i.e. wk = α(μk − μC). (5) • (N C4) Simple decision rule. Given a feature, the last- layer classifier's behavior is equivalent to the nearest class center (NCC) decision rule, i.e. arg max k (cid:104)wk, h(cid:105) = arg min ||h − μk|| (6) k 2.2 Neural Collapse and Imbalanced Data In this section, we first illustrate why N C disappears on imbalanced datasets using mean squared error (MSE) loss. Then we demonstrate that the N C properties will lead to a lower generalization error bound thus we can benefit from it under imbalanced distribution. 2.2.1 The Optimal Classifier Under Imbalanced Distribution Some recent studies have shown that the test performance of neural networks trained with MSE loss is comparable to those trained with CE loss in classification tasks (Demirkaya et al., 2020; Fang et al., 2021; Hu et al., 2021; Han et al., 2022). Thanks to its tractability, we can use MSE loss to illustrate the absence of the N C phenomenon on imbalanced datasets. For linear classifiers, the MSE loss is L(H, W ) = 1 2n ||Y − (HW + 1nbT)||2 F . (7) (cid:80)n Let ̄h = 1 i=1 hi be the global feature mean, ΣT = n ̄h) be the total covariance matrix of ̄h)T(H − 1n (H − 1n H and ̇M = [μ1 − ̄h, ..., μK − ̄h] ∈ RP ×K. We can have the closed form of the optimal W and b under the MSE loss as follows. Proposition 1. (Webb & Lowe, 1990). In general, for fixed features H, the optimal weight matrix and the bias vector that minimize L(H, W ) are WLS = Σ† T ̇M Λ, bLS = 1 n 1T n Y − μGWLS, (8) (9) where † denotes the Moore-Penrose pseudoinverse, and Λ = diag(n1, * * * , nK) is a diagonal matrix. From Eq.(9), we can observe that the optimal weight matrix depends on the features and is strongly affected by Λ, i.e. the proportions of classes. Specifically, the classifier weights of the majority classes will have larger norms. The N C phenomena reflect the intimate connection between the last layer features and the classifier weights. Thus, skewed classifiers imply that the features are also biased, and many studies have empirically investigated that the uneven label distribution can lead to an imbalanced feature space (Kang et al., 2020; Fang et al., 2021; Li et al., 2022). Particularly, Fang et al. (2021) show the Minority Collapse phenomenon that reveals the skewed classifier weights en- countering an imbalanced label distribution where majority classes own much more samples than the minority ones. In addition, they theoretically prove that unbiased classifiers can be obtained through over-sampling. However, empirical results show a limited performance improvement or even decline due to the over-fitting of the minority classes (Drum- mond et al., 2003; Weiss et al., 2007). On the other hand, the classifiers are always better tuned than the learned features (Thrampoulidis et al., 2022). Therefore, in this work, we mainly focus on regularizing the embeddings during train- ing to get non-skewed and representative features. Then we tune a balanced classifier based on our well-learned features. 2.2.2 Importance of N C on Imbalanced Datasets As we already know that when the training set is class- imbalanced, the geometric structure of the classifiers and centered class means are not symmetric, which may intro- duce some bias in the model and affect the performance of the test set (Kang et al., 2019, 2020; Fang et al., 2021). Recent work indicates that compact within-class represen- tations along with evenly distributed class centers can help learn high-quality representations, and substantial practice confirms this (Li et al., 2022; Zhu et al., 2022; Cui et al., 2022). These intuitions lead to similar situations with N C. In this section, we explain why the N C can be considered favorable representations and can provide reduced general- ization errors under long-tailed distributions from the per- spective of domain adaptation. As a standard evaluation approach in long-tailed learning, models are usually tested on balanced datasets. Since the training set is imbalanced, we can regard this scenario as a label shift domain adaptation problem, where the source domain is imbalanced, and the target domain is balanced. First, the following proposition shows that properties of N C1 and N C2 can be approximately preserved in the target domain. Proposition 2. (Galanti et al., 2021) Let μS k ) and σS k (resp. σT k ) be the mean and variance of the representa- tions of class k on the source domain (resp. target domain). For any two different classes, k and k(cid:48), with probability at k (resp. μT Inducing Neural Collapse in Deep Long-tailed Learning least 1 − δ over DS, we have 3.1 Feature Regularization σT k + σT k(cid:48) k − μT 2(cid:107)μT k(cid:48)(cid:107)2 √ ≤ (1 + A2) (cid:18) σS 2(cid:107)μS k + σS k(cid:48) k − μS k(cid:48)(cid:107)2 √ (cid:19) + B , (10) where A = O( log(1/δ)/nk) k −μT k(cid:48) || ||μT , B = O( log(1/δ)/nk) k −μS k(cid:48) ||2 ||μS . k −μT The ETF geometry of {μk}K k=1 indicates that the distance (cid:107)μS k − μS k(cid:48)(cid:107) achieve maximum value for all k (cid:54)= k(cid:48). On the other hand, (cid:107)μT k(cid:48)(cid:107) (Galanti et al., 2021). Hence, A and B are upper bounded and diminish to zero as nk gets larger. Therefore, we can roughly speak N C1 and N C2 can generalize to the target domain. k(cid:48)(cid:107) is also lower bounded by (cid:107)μS k −μS We then illustrate how the existence of N C1 and N C2 help to reduce the generalization error. According to Ben-David et al. (2006), for any classifier h, the error on target domain (cid:15)T (h) will be bound by the empirical error on the source domain and the divergence between source and target feature domains plus a constant: (cid:15)T (h) ≤ ˆ(cid:15)S(h) + dH(DZ S , DZ T ) + const, (11) S , DZ where dH(DZ T )1 measures some 'distance' between source and target domains over the feature space Z. Al- though not exactly the same, substituting dH with the Jensen–Shannon distance dJS (Endres & Schindelin, 2003) will not significantly change the result. Theoretically, min- imizing dJS between source and target distributions will reduce the right-hand side of Eq.(11) as well. Let DZ and DY be the distributions defined over the latent feature space and label space, respectively. As DY can be induced from DZ from a generative perspective, according to Zhao et al. (2019), we have dJS(DZ S , DZ T ) ≥ dJS(DY S , DY T ), (12) S , DZ T ) is the lower bounded by dJS(DY i.e., dJS(DZ T ), which is a constant determined by source and target label distributions. S , DY With N C1 and N C2, the distribution over Z collapses to a K-component mixture Dirac distribution. More pre- cisely, we have Pr(Z = h) = Pr(Y = y). In this case, T ) attains its lower bound dJS(DY dJS(DZ T ), which is the objective of some classical domain adaptation algo- rithms (Long et al., 2015; Ganin et al., 2017), S , DZ S , DY 3 LEARNING REPRESENTATION VIA INDUCING NEURAL COLLAPSE The previous analysis inspires us to induce N C phenomena to imbalanced training. We mainly focus on the core proper- ties, N C1 and N C2, and come up with two corresponding regularization terms. 1dH(DZ S , DZ T ) denotes the H-divergence between DZ S and DZ T , a precise definition is provided in Ben-David et al. (2010). Compact within-class features. N C1 underlines that the model is seeking to learn compact within-class features by pushing the last-layer embedding to be close to their class centers, which seems natural but actually hard to achieve in practice. Han et al. (2022) decomposed the MSE loss and discovered that the loss in the late training stages is domi- nated by the (cid:96)2-distance between the feature and the corre- sponding class center. This indicates that although N C1 is the inevitable trend, it is quite difficult to realize. Therefore, we add explicit regularization to make N C1 more inclined to appear. Especially, for the class-imbalanced dataset, we consider the inverse ratio of class sizes as weights to avoid excessive force on the majority classes. This indicates the difference between our N C1 regularization and the center loss (Wen et al., 2016) that pushes all features equally to their class center. Formally, we define the N C1 regular- ization as the within-class feature distance, LW , with the formula of LW = K (cid:88) (cid:88) k=1 yi=k 1 nk ||hi − μk||2 2. (13) Distinct between-class features. N C2 shows that with balanced class distribution, all pairs of centered class means tend to form equal-sized angles, implying the maximally separated between-class features. However, under the imbal- anced distribution, the class centers of the minority classes are close to the majority ones, leading to indistinguishable features. Therefore, we propose N C2 regularization to mini- mize the maximal pairwise cosine similarity between all the centered class means, equivalent to maximizing the minimal pairwise angle. Consider the angular version, the objective of N C2 regularization is: max min k(cid:54)=k(cid:48) arccos (cid:104) ̇μk, ̇μk(cid:48)(cid:105) || ̇μk|| * || ̇μk(cid:48)|| , (14) where ̇μk = μk − μC. As noted in Wang et al. (2020), up- dating the average of each vector's maximum cosine is more efficient than just optimizing the global maximum cosine. Therefore, we define the formula for the N C2 regularization as LB = − 1 K K (cid:88) k=1 min k(cid:48),k(cid:48)(cid:54)=k arccos (cid:104) ̇μk, ̇μk(cid:48)(cid:105) || ̇μk|| * || ̇μk(cid:48)|| . (15) In summary, our proposed feature regularization includes two terms, LW and LB, corresponding to minimize the within-class distance and maximize the between-class dis- crepancy, respectively. They can be easily coupled with supervised losses with a linear classifier to regularize the penultimate layer embedding. Finally, we have the follow- ing loss for training: L = Lsup + λ1LW + λ2LB. (16) Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12) where Lsup denotes the supervised loss, e.g. CE loss and MSE loss. λ1 and λ2 are hyperparameters that control the impact of LW and LB. 3.2 Occurrence of Neural Collapse First, we illustrate that LB will lead all pairs of the K class means to have the same cosine equals to − 1 K−1 , with the following proposition. Proposition 3. (Wang et al., 2020) The minimum of the maximal pair-wise cosine similarity between n vectors is −1 n−1 , which can be reached when the vectors have an equal- sized pair-wise angle and zero mean. Therefore, denote ˆM = [ ̇μK ̇μ1 || ̇μK || ]. Recall that the || ̇μ1|| , ..., objective of LB is to minimize the maximal pair-wise cosine similarity of the centered class means, thus with LB, we have ˆM T ˆM = K K − 1 I − 1 K − 1 1K1T K. (17) According to Definition 1, ˆM form a simplex ETF. Fur- thermore, although LW and LB do not explicitly enforce the centered class means to have an equal norm, we em- pirically observe this desired result (see the experimental result in Section 4.2.1). Let || ̇μ1|| = * * * = || ̇μK|| = α and ̄M = [ ̇μ1, * * * , ̇μK], then we have ̄M T ̄M = α (cid:18) K K − 1 I − 1 K − 1 (cid:19) , 1K1T K (18) indicating the centered class means indeed from an ETF. Therefore, with the proposed feature regularization terms LW and LB, N C1 and N C2 can happen even when the training set is imbalanced. In addition, we can prove that with the existence of N C1 and N C2, retrain the classifier with class-balance sampling, the classifier can become parallel with the centered feature mean, indicating the self-duality (N C3). Ultimately, the symmetric structure of the regularized class means brings about an unbiased linear classifier. Proposition 4. Proposition 1+N C1+N C2+class-balanced sampling can lead to N C3. Proof. With class-balanced sampling, the training label dis- tribution can be regarded as balanced, and ̇M = ̄M . Then the optimal re-trained classifier Wr is n K with the existence of N C1, we have ΣT = ̇M ̇M T. Thus, Wr = ̇M , Σ† T (19) Wr = = = n K n K n K ( ̇M ̇M T)† ̇M ( ̇M ̇M T)† ̇M ̇M T( ̇M T)† ( ̇M T)†, ̇M form a simplex-ETF, thus, with N C2 which implies that ( ̇M T)† = c ̇M for some constant c (Papyan et al., 2020), then we can obtain Wr = α ̇M , demonstrating the asserted self-duality (N C3). In conclusion, with the proposed LW and LB, we can obtain compact within-class and distinct between-class representa- tions under imbalanced-class distribution. In line with linear discriminant analysis (LDA) (Fisher, 1936), this provides an optimal solution for the linear classifier. 4 EXPERIMENTS 4.1 Classification and long-tailed recognition In this section, we conduct various experiments on image classification tasks on both balanced and long-tailed datasets to validate the effectiveness of our method. We denote our approach as NC, indicating the occurrence of the N C phenomena. By default, CE is adopted as Lsup. 4.1.1 Experiment Setup Datasets. Two balanced datasets (CIFAR10 and CI- FAR100) and three long-tailed datasets (CIFAR10-LT, CIFAR100-LT, and ImageNet-LT) are used in our exper- iments. Following Cao et al. (2019), CIFAR10/100-LT are created by downsampling each class's samples to obey an exponential decay with an imbalance ratio r = 100 and 10. Here r = max{nk}/ min{nk}. ImageNet-LT (Liu et al., 2019), including 115,846 samples and 1,000 cate- gories with size ranging from 5 to 1,280, is generated from the ImageNet-2012 (Deng et al., 2009) dataset using a Pareto distribution with the power value α = 6. Baselines. In addition to the typical approaches for ad- dressing imbalanced data, such as re-sampling (RS) and re-weighting (RW) in inverse proportion to the class size, the investigation of more conducive methods that decou- ple representation learning and classifier training, as well as relevant methods inspired by N C, are also carried out. To be specific, we compare traditional supervised learning methods with DRW (Cao et al., 2019), LWS (Kang et al., 2019), and cRT (Kang et al., 2019), and two recent works, namely BBN (Zhou et al., 2020) and MiSLAS (Zhong et al., 2021). Our comparison also includes supervised contrastive learning approaches, namely FCL (Kang et al., 2020), KCL (Kang et al., 2020), and TSC (Li et al., 2022). In addition, the comparison involves N C-inspired methods such as ETF classifier+DR (Yang et al., 2022) and ARB-Loss (Xie et al., 2023). Implementation details. We mainly follow the common training protocol. In all experiments, we adopt SGD opti- mizer with the momentum of 0.9, weight decay of 0.005, Inducing Neural Collapse in Deep Long-tailed Learning and train the model for 200 epochs following Alshammari et al. (2022). We utilize mix-up (Zhang et al., 2018) dur- ing the representation learning stage for all datasets. For CIFAR10/100(-LT), we use ResNet-32 (He et al., 2016) as the backbone and a multi-step schedule that decays the learning rate as its 0.1 at the 160-th and 180-th epochs with initialization of 0.1. We use 4 GeForce GTX 2080Ti GPUs with a batch size of 128. For ImageNet-LT, we use ResNeXt- 50 (Xie et al., 2017) as the backbone and cosine schedule that gradually decays the learning rate from 0.05 to 0. We use 4 Tesla V100 GPUs to train the models with a batch size of 256. We also adopt Randaugment (Cubuk et al., 2020) for ImageNet-LT. We report the average results of three independent trials with different random seeds. Our code is available at https://github.com/Pepper-lll/NCfeature. The hyperparameters λ1 and λ2 need to be adjusted ac- cording to the complexity of the datasets. In general, sim- ple datasets with few categories require a small magnitude of feature regularization, while for complex datasets with plenty of categories, we need larger λ1 and λ2. Besides, similar to Li et al. (2022), we also find that it is better to reg- ularize the feature learning from half of the training process for large-scale datasets, i.e., CIFAR100 and ImageNet-LT. Our hyperparameter settings and the epoch number to start feature regularization are summarized in Table 1. The class centers {μk}K k=1 are updated in each mini-batch, instead of in the entire training set, which has been proved not efficient in large-scale datasets (Wen et al., 2016). Be- sides, our regularization terms are better to combine with re-balancing strategies to ensure the matching between clas- sifier weights and class centers. The combination can lead to a remarkable improvement. In our experiments, we choose DRW and cRT as the re-balancing strategies. cluding Many-shot (>100 samples), Medium-shot (20∼100 samples), and Few-shot (<20 samples). The results show that our method can substantially improve the accuracy of the Medium- and Few-shot categories with almost no impact on the accuracy of the Many-shot categories compared to the plain training with CE. Table 2: Top-1 test accuracy (%) on the balanced datasets. Method CIFAR10 CIFAR100 CE +NC MSE +NC 93.4 93.3 91.1 91.7 71.8 72.1 70.7 71.9 Table 3: Top-1 test accuracy (%) on CIFAR10-LT and CIFAR100-LT. The results of the compared methods are obtained from their respective original papers. The best and second-best results are marked in bold and underlined. Method CIFAR10-LT CIFAR100-LT imbalance ratio CE CE-RS CE-RW CE-DRW LDAM-DRW BBNm MiSLAS KCL TSC 100 70.4 72.8 74.4 75.1 77.0 79.9 82.1 77.6 79.7 ETF classifier+ DR 76.5 83.3 ARB-Loss NC-DRW NC-DRW-cRT 81.9 82.6 10 86.4 87.8 87.9 86.4 88.2 88.4 90.0 88.0 88.7 87.7 90.2 89.8 90.2 100 38.4 36.7 32.5 42.5 43.5 42.6 47.0 42.8 43.8 45.3 47.2 48.6 48.7 10 55.7 57.7 58.2 56.2 58.7 59.2 63.2 57.6 59.0 - 62.1 63.1 63.6 Table 1: Hyperparameter setting. Dateset CIFAR10(-LT) CIFAR100(-LT) ImageNet-LT λ1 0.01 0.01 0.05 λ2 0.1 0.5 1.0 start epoch 0 100 100 4.1.2 Results Balanced data. As we mentioned before, our method is applicable to both balanced and imbalanced datasets. First, we conduct experiments to validate our model on balanced CIFAR10 and CIFAR100 datasets. Table 2 shows that our method can reduce the generalization error with both CE and MSE loss. Imbalanced data. Table 3 and 4 present our results on CIFAR10-LT, CIFAR100-LT, and ImageNet-LT. We can find that our method surpasses existing methods on all three datasets. For ImageNet-LT, we further test the accuracy on three groups of classes according to the sample size, in- Combine with existing approaches. Our regularization terms can be easily plugged into most of the existing algo- rithms. To validate the effectiveness, in Table 5, we add the proposed regularization terms to three different types of algorithms. We follow their original experiment set- tings to compare the performance differences before and after adding regularization terms. The results show that our regularization terms can increase the accuracy in all three algorithms. 4.2 Discussions In this section, to verify the correctness and further explore the properties of our method, we show the learned repre- sentations, performance robustness, and ablation study on various combinations of loss and regularizations. 4.2.1 Representation Analysis We extensively analyze the representations learned with our method to explain the advantages relative to the baseline. Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12) Table 4: Top-1 test accuracy (%) on ImageNet-LT. features learned by our method are more generalizable. Methods CE CE-RS CE-RW CE-DRW CE-cRT CE-LWS MiSLAS FCL KCL TSC ETF classifier+ DR ARB-Loss NC-DRW NC-DRW-cRT Many Medium Few All 68.2 64.6 52.0 52.6 58.8 57.1 61.7 61.4 62.4 63.5 - 60.2 67.1 65.6 38.1 42.6 41.4 45.7 33.0 45.2 51.3 47.0 49.0 49.7 - 51.8 49.7 51.2 5.82 17.8 19.8 31.5 26.1 29.3 35.8 28.2 29.5 30.4 - 38.3 29.0 35.4 45.3 47.8 42.5 46.4 47.3 47.7 52.7 49.8 51.5 52.4 44.7 52.8 53.6 54.2 Table 5: Top-1 test accuracy (%) on real-world long-tail datasets of our methods combined with others. Note that we replicated experiments of RIDE with data distributed paral- lel training and got results with slight differences from Wang et al. (2021). c10, c100 and iNet are short for CIFAR10, CIFAR100 and ImageNet respectively. Method c10-LT c100-LT iNet-LT LDAM-DRW +NC Logit Adjust +NC RIDE (2 experts) RIDE (3 experts) RIDE (4 experts) +NC (2 experts) +NC (3 experts) +NC (4 experts) 77.0 77.1(0.1↑) 77.4 78.8(1.4↑) - - - - - - 42.0 43.2(1.2↑) 43.9 44.6(0.7↑) 46.5 47.5 48.8 46.8(0.3↑) 48.1(0.6↑) 49.1(0.3↑) 48.8 49.5(0.7↑) 51.1 53.2(2.1↑) 51.9 54.2 55.2 52.2(0.3↑) 54.8(0.6↑) 56.0(0.8↑) As for the corresponding analysis of classifiers, we obtained consistent findings with previous studies (Kang et al., 2019) and therefore do not repeat them here. Maximally separated class centers. We compare the pair-wise angles of the centered class means learned on CIFAR10-LT with vanilla training, re-sampling (RS), re- weighting (RW), and the proposed regularization terms in Figure 2. We arrange the class indexes in descending order based on their sizes. Under a long-tailed distribution, the minority class centers move closer to the majority with plain model. In Figure 2(a), the angles between class 8 and 0, class 9 and 1, and class 5 and 3 are around 50◦ which is far lower than the optimal angle of 96◦. RS and RW can assist in the acquisition of more distinguishable features, as demonstrated Figure 2(b) and 2(c)). However, with our regularization terms (Figure 2(d)), we can observe that the pair-wise angles between all the class centers remain consis- tently close to the optimum value. In addition, the significant improvement on the experimental results indicates that the Zero-centered class means with the equal norm. Al- though neither LW nor LB forces the class center to be of equal norm, we can observe it in our experiments, as shown in Figure 3. This result strongly indicates that we can successfully induce N C in imbalanced data. 4.2.2 Robustness We test the robustness of our method against random noise with different neural networks on CIFAR10/100 and their long-tailed version where the imbalance ratio r = 100. Here Resnet-32 and ResNet-18 are employed. ResNet-18 is a wider network with the last-layer feature dimension of 512, while ResNet-32 is 64. The models are all trained with DRW. The results are reported in Table 6. We can observe that our regularization terms can improve the robustness for different model capacities. 4.2.3 Ablation Study We conduct experiments to examine the effectiveness of two regularization terms separately over CE loss and the comparison with center loss. The results, presented in Ta- ble 7, demonstrate that each term can significantly improve accuracy individually, and that their combination produces the best results. Meanwhile, LW consistently produces bet- ter results than center loss, suggesting that modifying the coefficient is crucial. We can also find that N C2 property is more useful, implying the importance of sufficiently distant class centers for the long-tail recognition task. 5 RELATED WORK 5.1 Long-tailed recognition Long-tailed distribution is ubiquitous in the real world, which brings big challenges for most deep learning mod- els. Classical methods dealing with this problem include data re-sampling and loss re-weighting. The former refers to re-sampling the instances to achieve relatively balanced training data, basically including over-sampling (Ando & Huang, 2017; Shelke et al., 2017), under-sampling (Shelke et al., 2017), and class-balanced sampling (Cui et al., 2019). Instead of changing the original data distribution, loss re- weighting uses cost-sensitive re-weighting strategies and as- signs different weights to instances from different classes ac- cording to the sample sizes (Lin et al., 2017; Cui et al., 2019). However, although the re-sampling and re-weighting ap- proaches can improve the performance of minority classes, they may lead to overfitting (Li et al., 2022) and hurt the representation learning (Kang et al., 2019). Recent works also focus on representation learning under long-tailed data distribution. This stream of study mainly Inducing Neural Collapse in Deep Long-tailed Learning Table 6: Random Noise Robustness Results. CE‡ denotes Cross-Entropy loss with the feature regularization LW + LB. Gaussian noise std 0.00 0.10 0.20 0.30 0.40 0.00 0.10 0.20 0.30 0.40 Dataset CIFAR10 CIFAR10-LT CIFAR100 CIFAR100-LT Loss CE CE‡ CE CE‡ CE CE‡ CE CE‡ ResNet-32 76.6 76.6 62.3 63.2 40.0 39.7 25.4 27.2 54.7 57.5 45.3 47.8 23.9 23.9 16.3 16.8 89.4 89.6 75.0 75.5 60.2 59.0 37.2 39.0 93.3 93.1 77.0 79.2 71.8 72.3 42.5 45.7 35.7 39.0 32.5 35.5 14.1 15.1 10.2 11.1 94.9 95.1 79.2 81.0 78.2 78.6 46.8 47.2 ResNet-18 79.2 78.9 63.5 66.5 44.2 46.9 31.6 31.6 56.9 57.1 47.2 51.4 25.0 28.2 23.6 23.3 91.5 91.8 75.7 77.5 65.9 67.8 41.1 41.6 35.9 37.4 33.8 37.9 14.3 16.6 17.6 16.3 (a) vanilla (b) w/ RS (c) w/ RW (d) w/ LW and LB Figure 2: Pair-wise angle degree between centered class means trained on CIFAR10-LT. Note that the optimal pair-wise angle for 10 classes is arccos −1 10−1 ≈ 96.4◦. Table 7: Ablation studies on the effectiveness of each reg- ularization term on CIFAR10/100-LT. Note that we apply DRW for all experiments here. Method CIFAR10-LT CIFAR100-LT imbalance ratio CE +Centor Loss +LW +LB +Centor Loss &LB +LW &LB 100 75.1 78.7 79.1 80.1 77.5 81.9 10 86.4 89.1 88.1 88.6 89.2 89.8 100 42.4 46.3 46.9 47.6 46.5 48.6 10 56.2 61.2 61.3 61.7 61.4 63.1 follows a two-stage training scheme that decouples the rep- resentation and classifier learning (Kang et al., 2019; Zhong et al., 2021; Li et al., 2022; Kang et al., 2020; Zhu et al., 2022). Kang et al. (2019) observed that a high-quality rep- resentation requires fully utilizing the training instances equally, while a re-balancing technique is crucial for an unbiased classifier. On the other hand, some works take advantage of the superior representation learning ability of contrastive loss to extract the feature for deep long-tailed learning; then train a classifier upon the feature extractor with cost-sensitive loss or class-balanced sampling (Kang et al., 2020; Li et al., 2022; Zhu et al., 2022). Supervised con- trastive learning shows superiority in representation learning under imbalanced distribution and achieves SOTA for long- tailed recognition tasks (Li et al., 2022; Zhu et al., 2022; Cui et al., 2022). However, these methods usually converge (a) CIFAR10(-LT) (b) CIFAR100(-LT) Figure 3: The norm of centered class means on a balanced dataset, long-tailed dataset w/ and w/o inducing NC is rep- resented in different colors. Note that the class index is inversely sorted by the sample size. slowly and require complex network structures compared to traditional supervised learning. Researchers also explored methods based on the ensemble. They usually utilize multiple models over different data distributions (Wang et al., 2021) or perform representation learning and classifier training with separate branches (Zhou et al., 2020; Zhu et al., 2022). This kind of approach is generally considered to be orthogonal to the single-model approach described above. 5.2 Neural collapse A recent study (Papyan et al., 2020) discovered the phe- nomenon named Neural Collapse (N C), stating that the last-layer embedding and classifiers will converge to a sym- Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12) metric geometry named simplex Equiangular Tight Frame (ETF) for deep classifiers trained on balanced data. A more precise description of the N C phenomena is delivered in Section 2.1. Subsequent studies indicate that N C will even- tually occur, independent of the loss function, the optimizer, batch-normalization, and regularization, as long as the train- ing data exhibits a balanced distribution (Zhu et al., 2021; Han et al., 2022; Kothapalli et al., 2022). Meanwhile, the intrinsic merit of N C has also been revealed, including ensuring global optimality, stronger generalization and ro- bustness, and transferability (Papyan et al., 2020; Zhu et al., 2021; Galanti et al., 2021). The investigation of N C has also been carried over to the imbalanced data case, where different phenomena are un- covered. Fang et al. (2021) demonstrated that the minority classifiers have smaller pair-wise angles than the majority ones and will even merge together as the imbalance level increases, named Minority Collapse. This phenomenon pro- vides some reason of the performance drop. Thrampoulidis et al. (2022) provides a general frame that is equivalent to ETF for balanced data, and reveals an asymmetric geometry of the last-layer feature and classifiers for imbalanced dis- tribution. Furthermore, the perfect alignment between the class feature means and classifiers vanished under the im- balanced distribution. However, Thrampoulidis et al. (2022) illustrates the general geometry with a special encoding framework and does not discuss whether this geometry with an imbalanced dataset has merit or defect. Inspired by the N C phenomenon, some researchers have attempted to improve the model's classification ability en- countering imbalanced distribution by eliminating Minority Collapse, including fixing the classifier as an ETF (Yang et al., 2022) and adjusting the CE loss (Xie et al., 2023). Distinct from these works, our work analyzes that obtaining high-quality features is the key to the improvement and thus proposes regularization to guide learning representations. 6 CONCLUSIONS In this paper, we argue that the existence of N C is crucial for long-tailed recognition and propose two simple but ef- fective regularization terms to induce the appearance of N C. We empirically show that under the imbalanced data distri- bution, the class centers of minority classes are close to the majority ones, leading to the overlap among different classes over the feature space and confusion of the classifier. With our method, the deep classification models are able to learn compact within-class and maximally distinct between-class features. Extensive experiments confirm that our method can enhance the generalization power of the deep classifica- tion model, especially when the training set is imbalanced. Our method is more efficient than contrastive loss based methods, and we set new state-of-the-art performance for single model based methods on widely used benchmarks. Our proposed regularization guides the representation learn- ing to be of 'optimal' geometry for classification, which is particularly beneficial for training sets with imbalanced labels. However, the learned geometry is validated empiri- cally and lacks complete theoretical guarantees, leading to manually tuning the related hyperparameters. In the future, we plan to formally analyze the geometry obtained with our regularization and provide some theoretical justification for the choice of hyperparameters. Acknowledgements This work was supported in part by National Natu- ral Science Foundation of China / Research Grants Council (NSFC/RGC) Joint Research Scheme Grant N HKUST635/20, Hong Kong Research Grant Council (HKRGC) Grant 16308321, ITF UIM/390, as well as awards from Smale Institute of Mathematics of Computation. This research made use of the computing resources of the X-GPU cluster supported by the HKRGC Collaborative Research Fund C6021-19EF. References Alshammari, S., Wang, Y.-X., Ramanan, D., and Kong, In S. Long-tailed recognition via weight balancing. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6897–6907, 2022. Ando, S. and Huang, C. Y. Deep over-sampling framework for classifying imbalanced data. In Joint European Con- ference on Machine Learning and Knowledge Discovery in Databases, pp. 770–785. Springer, 2017. Ben-David, S., Blitzer, J., Crammer, K., and Pereira, F. Anal- ysis of representations for domain adaptation. Advances in neural information processing systems, 19, 2006. Ben-David, S., Blitzer, J., Crammer, K., Kulesza, A., Pereira, F., and Vaughan, J. W. A theory of learning from different domains. Machine learning, 79(1):151– 175, 2010. Buda, M., Maki, A., and Mazurowski, M. A. A systematic study of the class imbalance problem in convolutional neural networks. Neural networks, 106:249–259, 2018. Cao, K., Wei, C., Gaidon, A., Arechiga, N., and Ma, T. Learning imbalanced datasets with label-distribution- aware margin loss. Advances in neural information pro- cessing systems, 32, 2019. Cubuk, E. D., Zoph, B., Shlens, J., and Le, Q. V. Ran- daugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops, pp. 702–703, 2020. Cui, J., Zhong, Z., Liu, S., Yu, B., and Jia, J. Parametric contrastive learning. In Proceedings of the IEEE/CVF Inducing Neural Collapse in Deep Long-tailed Learning international conference on computer vision, pp. 715– 724, 2021. conference on computer vision and pattern recognition, pp. 770–778, 2016. Cui, J., Zhong, Z., Tian, Z., Liu, S., Yu, B., and Jia, J. Gen- eralized parametric contrastive learning. arXiv preprint arXiv:2209.12400, 2022. Hu, T., Wang, J., Wang, W., and Li, Z. Understanding square loss in training overparametrized neural network classifiers. arXiv preprint arXiv:2112.03657, 2021. Cui, Y., Jia, M., Lin, T.-Y., Song, Y., and Belongie, S. Class- balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9268–9277, 2019. Demirkaya, A., Chen, J., and Oymak, S. Exploring the role of loss functions in multiclass classification. In 2020 54th annual conference on information sciences and systems (ciss), pp. 1–5. IEEE, 2020. Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009. Drummond, C., Holte, R. C., et al. C4. 5, class imbal- ance, and cost sensitivity: why under-sampling beats In Workshop on learning from imbal- over-sampling. anced datasets II, volume 11, pp. 1–8. Citeseer, 2003. Endres, D. M. and Schindelin, J. E. A new metric for prob- ability distributions. IEEE Transactions on Information theory, 49(7):1858–1860, 2003. Fang, C., He, H., Long, Q., and Su, W. J. Exploring deep neural networks via layer-peeled model: Minority col- lapse in imbalanced training. Proceedings of the National Academy of Sciences, 118(43):e2103091118, 2021. Fisher, R. A. The use of multiple measurements in tax- onomic problems. Annals of eugenics, 7(2):179–188, 1936. Galanti, T., Gy ̈orgy, A., and Hutter, M. On the role of neural collapse in transfer learning. In International Conference on Learning Representations, 2021. Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., and Lempitsky, V. S. Domain-adversarial training of neural networks. In Csurka, G. (ed.), Domain Adaptation in Computer Vi- sion Applications, Advances in Computer Vision and Pattern Recognition, pp. 189–209. Springer, 2017. doi: 10.1007/978-3-319-58347-1\ 10. Graf, F., Hofer, C., Niethammer, M., and Kwitt, R. Dis- In Interna- secting supervised constrastive learning. tional Conference on Machine Learning, pp. 3821–3830. PMLR, 2021. Han, X., Papyan, V., and Donoho, D. L. Neural collapse un- der MSE loss: Proximity to and dynamics on the central path. In International Conference on Learning Represen- tations, 2022. He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learn- ing for image recognition. In Proceedings of the IEEE Kang, B., Xie, S., Rohrbach, M., Yan, Z., Gordo, A., Feng, J., and Kalantidis, Y. Decoupling representation and In International classifier for long-tailed recognition. Conference on Learning Representations, 2019. Kang, B., Li, Y., Xie, S., Yuan, Z., and Feng, J. Exploring balanced feature spaces for representation learning. In International Conference on Learning Representations, 2020. Khosla, P., Teterwak, P., Wang, C., Sarna, A., Tian, Y., Isola, P., Maschinot, A., Liu, C., and Krishnan, D. Supervised contrastive learning. Advances in Neural Information Processing Systems, 33:18661–18673, 2020. Kothapalli, V., Rasromani, E., and Awatramani, V. Neural collapse: A review on modelling principles and general- ization. arXiv preprint arXiv:2206.04041, 2022. Li, T., Cao, P., Yuan, Y., Fan, L., Yang, Y., Feris, R. S., Indyk, P., and Katabi, D. Targeted supervised contrastive learning for long-tailed recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6918–6928, 2022. Lin, T.-Y., Goyal, P., Girshick, R., He, K., and Doll ́ar, P. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980–2988, 2017. Liu, Z., Miao, Z., Zhan, X., Wang, J., Gong, B., and Yu, S. X. Large-scale long-tailed recognition in an open world. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2537–2546, 2019. Long, M., Cao, Y., Wang, J., and Jordan, M. Learning trans- ferable features with deep adaptation networks. In Bach, F. and Blei, D. (eds.), Proceedings of the 32nd Interna- tional Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 97–105, Lille, France, 07–09 Jul 2015. PMLR. Papyan, V., Han, X., and Donoho, D. L. Prevalence of neural collapse during the terminal phase of deep learn- ing training. Proceedings of the National Academy of Sciences, 117(40):24652–24663, 2020. Shelke, M. S., Deshmukh, P. R., and Shandilya, V. K. A review on imbalanced data handling using undersampling and oversampling technique. Int. J. Recent Trends Eng. Res, 3(4):444–449, 2017. Thrampoulidis, C., Kini, G. R., Vakilian, V., and Behnia, T. Imbalance trouble: Revisiting neural-collapse geometry. arXiv preprint arXiv:2208.05512, 2022. Xuantong Liu1,∗, Jianfeng Zhang2, Tianyang Hu2, He Cao1, Lujia Pan2, Yuan Yao1,(cid:12) Zhu, J., Wang, Z., Chen, J., Chen, Y.-P. P., and Jiang, Y.- G. Balanced contrastive learning for long-tailed visual recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6908– 6917, 2022. Zhu, Z., Ding, T., Zhou, J., Li, X., You, C., Sulam, J., and Qu, Q. A geometric analysis of neural collapse with unconstrained features. Advances in Neural Information Processing Systems, 34:29820–29834, 2021. Van Horn, G. and Perona, P. The devil is in the tails: Fine-grained classification in the wild. arXiv preprint arXiv:1709.01450, 2017. Wang, X., Lian, L., Miao, Z., Liu, Z., and Yu, S. Long-tailed recognition by routing diverse distribution-aware experts. In International Conference on Learning Representations, 2021. Wang, Z., Xiang, C., Zou, W., and Xu, C. Mma regu- larization: Decorrelating weights of neural networks by maximizing the minimal angles. Advances in Neural Information Processing Systems, 33:19099–19110, 2020. Webb, A. R. and Lowe, D. The optimised internal rep- resentation of multilayer classifier networks performs nonlinear discriminant analysis. Neural Networks, 3(4): 367–375, 1990. Weiss, G. M., McCarthy, K., and Zabar, B. Cost-sensitive learning vs. sampling: Which is best for handling unbal- anced classes with unequal error costs? In Proceedings of the 2007 International Conference on Data Mining (DMIN), volume 7, pp. 35–41, Las Vegas, Nevada, USA, 2007. Wen, Y., Zhang, K., Li, Z., and Qiao, Y. A discriminative feature learning approach for deep face recognition. In European conference on computer vision, pp. 499–515. Springer, 2016. Xie, L., Yang, Y., Cai, D., and He, X. Neural collapse in- spired attraction-repulsion-balanced loss for imbalanced learning. Neurocomputing, 2023. Xie, S., Girshick, R., Doll ́ar, P., Tu, Z., and He, K. Aggre- gated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vi- sion and pattern recognition, pp. 1492–1500, 2017. Yang, Y., Xie, L., Chen, S., Li, X., Lin, Z., and Tao, D. Do we really need a learnable classifier at the end of deep neural network? arXiv preprint arXiv:2203.09081, 2022. Zhang, H., Cisse, M., Dauphin, Y. N., and Lopez-Paz, D. mixup: Beyond empirical risk minimization. In Interna- tional Conference on Learning Representations, 2018. Zhao, H., Des Combes, R. T., Zhang, K., and Gordon, G. On learning invariant representations for domain adaptation. In International Conference on Machine Learning, pp. 7523–7532. PMLR, 2019. Zhong, Z., Cui, J., Liu, S., and Jia, J. Improving calibra- tion for long-tailed recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16489–16498, 2021. Zhou, B., Cui, Q., Wei, X.-S., and Chen, Z.-M. Bbn: Bilateral-branch network with cumulative learning for In Proceedings of the long-tailed visual recognition. IEEE/CVF conference on computer vision and pattern recognition, pp. 9719–9728, 2020.
http://arxiv.org/abs/2302.12449v2
2023-08-15T08:11:16
2023-02-24T04:31:18
SGL-PT: A Strong Graph Learner with Graph Prompt Tuning
Recently, much exertion has been paid to design graph self-supervised methods to obtain generalized pre-trained models, and adapt pre-trained models onto downstream tasks through fine-tuning. However, there exists an inherent gap between pretext and downstream graph tasks, which insufficiently exerts the ability of pre-trained models and even leads to negative transfer. Meanwhile, prompt tuning has seen emerging success in natural language processing by aligning pre-training and fine-tuning with consistent training objectives. In this paper, we identify the challenges for graph prompt tuning: The first is the lack of a strong and universal pre-training task across sundry pre-training methods in graph domain. The second challenge lies in the difficulty of designing a consistent training objective for both pre-training and downstream tasks. To overcome above obstacles, we propose a novel framework named SGL-PT which follows the learning strategy ``Pre-train, Prompt, and Predict''. Specifically, we raise a strong and universal pre-training task coined as SGL that acquires the complementary merits of generative and contrastive self-supervised graph learning. And aiming for graph classification task, we unify pre-training and fine-tuning by designing a novel verbalizer-free prompting function, which reformulates the downstream task in a similar format as pretext task. Empirical results show that our method surpasses other baselines under unsupervised setting, and our prompt tuning method can greatly facilitate models on biological datasets over fine-tuning methods.
[ "Yun Zhu", "Jianhao Guo", "Siliang Tang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12449v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12449v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.CL" ]
SGL-PT: A Strong Graph Learner with Graph Prompt Tuning Yun Zhu, Jianhao Guo, Siliang Tang, Zhejiang University {zhuyun dcd, guojianhao, siliang}@zju.edu.cn 3 2 0 2 g u A 5 1 ] G L . s c [ 2 v 9 4 4 2 1 . 2 0 3 2 : v i X r a Abstract Recently, much exertion has been paid to design graph self- supervised methods to obtain generalized pre-trained models, and adapt pre-trained models onto downstream tasks through standard fine-tuning. But the gap between pretext and down- stream tasks can limit pre-trained models' potential, lead- ing to negative transfer. Meanwhile, prompt tuning has seen emerging success in natural language processing (NLP) by aligning pre-training and fine-tuning with consistent training objectives. In this paper, we identify the challenges for graph prompt tuning: The first is the lack of a strong and universal pre-training task across sundry pre-training methods in graph domain. Such a task should be easily emulated by down- stream tasks, akin to the Masked Language Modeling (MLM) in the NLP domain. The second challenge lies in the diffi- culty of designing a consistent training objective for both pre- training and downstream tasks due to the inherent abstraction of graph data. To overcome above obstacles, we propose a novel framework named SGL-PT which follows the learn- ing strategy "Pre-train, Prompt, and Predict". Specifically, we raise a strong and universal pre-training task coined as SGL that acquires the complementary merits of generative and contrastive self-supervised graph learning. And motivated by prompt design in NLP, we reformulate the downstream task as maksed node prediction by designing a novel verbalizer- free prompting function, resulting in unifying the objectives of pre-text and downstream tasks. Empirical results show that our pre-training method surpasses other baselines under un- supervised setting, and our prompt tuning method can signif- icantly facilitate models on biological datasets over standard fine-tuning and other graph prompt methods. Introduction Graph self-supervised Learning methods (Hou et al. 2022; You et al. 2020) have emerged to create generalized pre- trained models without labels. To adapt these models for downstream tasks, a "pre-train, fine-tune" approach is of- ten used. However, there exists a gap between pre-training and downstream tasks, that hinders knowledge transfer and potentially leads to negative transfer (Zhang et al. 2022) or overfitting (Zhu et al. 2021). For instance, edge prediction (Hu et al. 2020) pre-trained on local node relations may struggle to generalize to graph classification tasks requiring global relations. This shift in representation can lead to neg- ative transfer (Sun et al. 2022). A feasible solution for mitigating this gap is to unify the pre-training and fine-tuning models with consistent training objectives by prompt technique (Liu et al. 2022). Though already mature in NLP domain, graph prompt tuning is still under exploration. We identify the main challenges of graph prompt tuning: (1) The need for a strong and univer- sal pre-training task: graph prompting method requires the pre-training task to capture rich information (e.g., intra-data and inter-data relations). Existing pre-training methods fail to learn rich information in graph domain, because most of them only focus on learning local relations (Hou et al. 2022) or global relations (You et al. 2020) while neglecting the inter-dependency of both. Furthermore, graph prompt meth- ods mandate a pre-training task that can be readily emu- lated, ensuring smooth integration into downstream tasks. However, a pre-training task with these desired characteris- tics is currently absent. (2) The difficulty of reformulating the downstream task in the same format of the pre-training task: unlike the cloze template in NLP domain, how to de- sign meaningful prompt templates and verbalizers for graphs remains an open problem due to the inherent abstraction of graph data. Recently, some works made first attempts on graph prompt tuning. GPPT (Sun et al. 2022) and Graph- Prompt (Liu et al. 2023) unify the pretext and downstream task in a similar format (i.e., edge prediction task). How- ever, edge prediction is a trivial binary classification task, which can not capture rich inter-data information and lose its generality (not solving challenge 1). GPF (Fang et al. 2022) and Prompt Graph (ProG) (Sun et al. 2023) introduce a learnable prompt feature and a learnable prompt graph into the input space as plug-ins, which can be incorporated into any pre-trained models. These methods are more likely new transformation tricks added to input space, while they do not holistically align the training objectives between pretext and downstream tasks, hence not fully addressing challenge 2. In short, the challenges we propose are waiting to be solved. To overcome the above obstacles, we propose a novel graph learning framework coined as SGL-PT that follows the "Pre-train, Prompt and Predict" strategy. Specifically, for challenge 1, we design a strong and universal graph self- supervised method named Strong Graph Learner (SGL). It combines generative and contrastive models for comple- mentary strengths: the generative method has better robust- ness and can ratiocinate the characters of nodes according to neighbor through learning local (intra-data) relations, but lacks discriminative representations; The contrastive method focuses on learning qualified global (inter-data) representa- tions through instance discrimination but may lose detailed information on individual graphs. We effectively combine these two self-supervised methods through asymmetric de- sign and a dynamic queue to obtain a strong and univer- sal self-supervised graph learner. Besides, this pre-training task can be mimicked by the downstream task painlessly. For challenge 2, we design a novel prompting function that introduces a masked super node into individual graphs and reformulates the downstream graph classification as masked node prediction. We realize verbalizer-free class mapping by introducing supervised graph prototypical contrastive learn- ing to establish the mapping between reconstructed features and semantic labels. In this way, we unify the training objec- tives between pretext and downstream tasks. Results show that our pre-training method surpasses other strong genera- tive methods (Hou et al. 2022) and contrastive baselines (Xu et al. 2021a). And our prompt tuning strategy can greatly fa- cilitate models on biological datasets compared to standard fine-tuning and other graph prompt methods. Our contributions are summarized as follows: • We identify the main challenges for graph prompting. And we propose a novel framework following "Pre-train, Prompt, and Predict" strategy to solve the challenges. • We propose a strong and universal graph self-supervised method SGL unifying generative and contrastive mer- its through the asymmetric design. And we unify pre- training and fine-tuning by designing a novel verbalizer- free prompting function. • Empirical results show that our method surpasses other baselines under the unsupervised setting, and our prompt tuning method can significantly facilitate models on bio- logical datasets compared to fine-tuning methods. Related Works Graph Self-supervised Learning Graph self-supervised methods can be classified into three categories: Predictive, Generative and Contrastive (Wu et al. 2021). Predictive method self-generates labels by statistical analysis and designs prediction-based pre-training tasks on the generated labels (Jin et al. 2020). Generative method focuses on learning local (intra-data) relations based on pretext tasks such as feature/edge re- construction (Kipf and Welling 2016; Hou et al. 2022). Recently, the generative-based masked autoencoders (e.g., GraphMAE (Hou et al. 2022)) show their superior perfor- mance across different tasks. Masked autoencoders learn hidden representations by masking partial node features to obtain high-level representations and then reconstructing these masked node features through decoders. These meth- ods focus on the local relations between nodes, which may be incompetent for learning discriminative graph represen- tations and deficient for graph classification task. Contrastive method maximizes the agreement between positive data pairs and pushes away the negative data pairs in the representation space to learn the global (inter-data) rela- tions between graphs (You et al. 2020; Zhu et al. 2022), but may lose the detailed information within a single graph. In our work, we combine the generative and contrastive methods through asymmetric design and a dynamic queue for complementary merits to obtain a strong and universal pre-training method. Prompt-based Learning The training strategy "Pre-train and Fine-tune" is widely used to adapt pre-trained models onto specific downstream tasks. However, this strategy ignores the inherent represen- tation gap between pre-training and downstream tasks and leads to poor performance on few-shot problems. Prompt-based learning (Liu et al. 2022) is a technique arising from NLP to narrow the gap between pre-training and downstream tasks. It reformulates the downstream task to match the format of the pre-training task. This involves designing a prompt template that converts the task into a masked word prediction task. For instance, in sentiment analysis, the label prediction task can be transformed into a masked word prediction by the pre-defined template like "[X]. It is a [MASK] movie" for the input sentence [X]="I love this movie.", aligning with the pre-training mask lan- guage model. The second aspect is the verbalizer design, which maps the output word [MASK] to a specific label. For example, words like 'good, great' may be associated with the label '+', while 'bad, terrible' are associated with the label '-'. The dot product of [MASK] for these tokens provides confidence in assigning the sentence a label. While prompt-based learning is well-established in NLP, it's relatively new in the graph domain. Existing approaches like GPPT (Sun et al. 2022) and GraphPrompt (Liu et al. 2023) rely on edge prediction as a pre-training task and re- formulate the downstream task as edge prediction. But edge prediction is a trivial binary classification task and focuses on learning local (intra-data) relations which will be incom- petent for graph classification. GPF (Fang et al. 2022) in- troduces a universal prompt feature for various pre-trained models, and ProG (Sun et al. 2023) extends GPF and intro- duces a universal graph prompt (i.e., a set of prompt fea- tures), but they do not unify the training objectives of the pertaining and downstream tasks, limiting its potential. In contrast to prior works (Sun et al. 2022; Liu et al. 2023), we address two challenges simultaneously. By con- sidering graph-level task characteristics and the prompt tem- plate's dependence on the pretext task, we redesign the pre- training method and graph prompt template to mitigate rep- resentation gaps. In the following section, we will demon- strate how we overcome these obstacles. Method Preliminaries This work focuses on graph classification task on a series of graphs G = {G1, G2, ..., GK}. Gk = (Xk, Ak, yk) de- notes a single graph, where Xk ∈ RNk×D is the raw node features, Ak ∈ RNk×Nk is the adjacent matrix, and yk is the graph label. For notations, Nk represents node number of graph k, D represents the dimension of raw features, and Ak(i, j) = 1 means there exists an edge between node i and node j in graph k, otherwise 0. E(*) represent GNN encoder and D(*) represents decoder. f (*) , and R(*) represent pro- jection head and readout function respectively. Under unsu- pervised training setting of this work, the label information y is unavailable for each graph during pre-training. Local Branch Mask Node Features [MASK] Online Enc. Node Reps. [MASK] ReRe Re-mask Dec. Recon. Feat. Recon. Recon. Loss Loss momentum Data Augmentation Readout Target Enc. Node Reps. outout Readout outout ReReReReReReReReReReReReReReReReReReReReRe Graph Reps. Graph Reps. Proj. Proj. (cid:2366) (cid:2869) (cid:2870) (cid:2366) + Contra. Contra. Loss Loss Queue Global Branch Figure 1: The pre-training framework:Strong Graph Learner. SGL: Strong Graph Learner for Pre-training In this part, we will introduce our proposed pre-training strategy depicted in Figure 1, which consists of two branches: local and global. For local branch, it focuses on learning intra-data relations via a graph masked au- toencoder. For global branch, it empowers the pre-training model with instance-wise discriminative ability by graph contrastive learning. Then we propose a non-trivial solution to integrate these two branches effectively. Algorithm 1 in Appendix A gives more details about the procedure. Local Branch In this branch, firstly we mask partial nodes' features and then obtain the high-level node repre- sentations H(1) through online encoder Eo. Then, we re- mask the node representations and reconstruct masked node features through the decoder D, this is because Graph- MAE (Hou et al. 2022) empirically found that re-masking the node representations H(1) for decoding will bring per- formance improvement. Finally, we use scaled cosine error as the criterion. Our local branch loss is formulated as: Llocal = | 1 V| Xvi∈ e V e γ xT i ̃xi kxik * k ̃xik (cid:19) 1 − (cid:18) , γ ≥ 1, (1) where V represents masked nodes' set and ̃x denotes recon- structed masked node features. And γ is a scaling factor that adjusts the contribution of each sample. This loss is averaged V. In order to keep the notation un- on the masked nodes' set cluttered, we consider the batch size as 1 here. e In this way, local branch has better robustness and can ratiocinate the characters of nodes according to neighbors. However, this method mainly focuses on learning local re- lations on individual graph, which is incompetent to learn discriminative representations for graph classification. e Global Branch To complement the insufficiency of the local branch and make the encoder capture global (inter- data) discriminative information among graphs, we appeal to graph contrastive learning. Even though data augmentation is an essential part of contrastive learning (You et al. 2020; Shi et al. 2020; Zhu et al. 2022), we empirically found sim- ple augmentations like node feature masking and edge re- moving are good enough to improve the representation abil- ity of the proposed Strong Graph Learner. The processes of the global branch can be concluded as: firstly we obtain node representations H(1) k by online and target encoders. Then through a readout function (e.g., mean pooling), we obtain global representations gk as: k , H(2) gk = 1 Nk Nk Xi Hk(i), (2) where Hk(i) represents the i-th node representation in graph k. Following that, a projection head is added on top of the encoder to map augmented representations to an- other latent space where the contrastive loss is calculated. Finally, we will contrast these representations z through NT-Xent (the normalized temperature-scaled cross-entropy loss (Chen et al. 2020)). The sample with its augmented view is considered as a positive pair, and others are considered as negative pairs. The formula of contrastive loss follows: li = − log exp sim (cid:16) B k=1 exp /τ (cid:16) sim z(1) i , z(2) i z(1) i (cid:16) (cid:17) , z(2) k , (3) (cid:17) /τ P (cid:16) where sim(u, v) = u⊤v/kukkvk computes the similarity score between u and v, τ is temperature parameter, and B denotes the size of mini-batch. (cid:17) (cid:17) How to Integrate Local And Global Branches? Due to consideration of efficiency and performance, the small batch sizes (e.g., 8, 16) are used for training local branch, which is insufficient for effective contrastive learning (Chen et al. 2020). Thus, direct integration of these branches is not fea- sible. To address this, we employ a dynamic queue Q to in- corporate more negative samples and enhance the integra- tion of local and global branches. This dynamic queue holds the first in first out property and we use the target representa- tions H(2) to update this dynamic queue Q. In order to keep the consistency of representations in the dynamic queue to the utmost, we use exponential moving average to update the target encoder Et and projection head ft. Formally, the parameters in Et is updated by θt ← μθt + (1 − μ)θo. Here m ∈ [0, 1) is a momentum coefficient that controls the smoothness of evolving target parameters, we use a rela- tively large momentum (e.g., 0.999) in our experiments em- pirically. With dynamic queue Q, the loss in global branch: li = − log ,z(2) i (cid:17)/τ (cid:17) i e(cid:16)sim(cid:16)z(1) ,z(2) k (cid:17)/τ (cid:17) + B k=1 e(cid:16)sim(cid:16)z(1) i Q j=1 e(cid:16)sim(cid:16)z(1) i ,qj (cid:17)/τ (cid:17) P (4) where Q denotes the size of the dynamic queue. q represents the sampled representations in the dynamic queue. The total loss of the global branch is averaged over batch samples (i.e., Lglobal = 1 B B i li). P P In summary, the overall pre-training loss is defined as Lpre = λpre * Llocal + (1 − λpre) * Lglobal, (5) tokens related to labels. The supervised prototypical con- trastive loss is given by: where λpre ∈ [0, 1] controls the weight of local loss. For most cases, we set λpre as 0.5 which means local and global loss contributes equally. Lproto = −1 C2B2 log Xc Xi,j Verbalizer-free Graph Prompt Tuning After obtaining the pre-trained model from SGL , we pro- pose a novel graph prompt tuning technique that mitigates the representation gap between pre-trained model and down- stream tasks. Through prompt addition, we reformulate the downstream task in the same format as the pre-training task. And with the design of verbalizer-free prompt answer, we get rid of the verbalizer which is hard to design in graph do- main. The process of graph prompt tuning is shown in Fig- ure 2. And Algorithm 2 in Appendix A offers procedures. Mask Node Features {( , , )} Prompt addition (cid:1775) (cid:1798) 2 1 5 (cid:1877) 3 4 S 1 [MASK] 2 [MASK] 3 4 [MASK] 5 Prompt answer prototype contrastive learning prototypes super node Enc. Re-mask Dec. (cid:2198)(cid:2868) (cid:2198)(cid:2869) (cid:2198)(cid:2870) Node Reps. Recon. Feat. Contra. Contra. Loss Loss + Recon. Recon. Loss Loss Figure 2: The framework of verbalizer-free prompt tuning. Prompt Addition: Re-formulate downstream task Prompt-based learning methods mitigate the representation gap by reformulating the downstream task to the same for- mat as the pre-training task, however, it is non-trivial to do so in graph domain due to the inherent abstraction of graph data. To solve the problem, we introduce a masked super node, which connects to all nodes in the graph and therefore has a global receptive field. Thus the representation of the super node can be seen as the representation of the whole graph. To reconstruct the features of the masked super node, we transform the original classification task into masked feature reconstruction, which corresponds to the task during pre-training. This idea is motivated by the prompt tuning in NLP domain, which adds a template with a task slot (masked word) for input sentence and predicts the masked word of the slot (Liu et al. 2022), remaining different to previous graph prompt works (Sun et al. 2022). Prompt Answer: Verbalizer-free Class Mapping We have reformulated the downstream task as masked node fea- ture reconstruction. Since there are no semantic and repre- sentative input features related to labels for the masked su- per nodes, it is hard to use verbalizer to establish mappings between reconstructed features and their semantic labels. In this work, we get rid of the verbalizer by introducing the supervised prototypical contrastive learning (SPCL) (Li et al. 2020; Cui et al. 2022) for class mapping. Specifically, the prototypes represent essential features corresponding to labels. As depicted in Figure 2, we will obtain class pro- totypes pc by SPCL and use these prototypes as semantic exp (cid:0) sim i , zc zc /τ j (cid:1) i , zc′ zc j′ sim (cid:0) c′,j′ exp (cid:16) (cid:16) P exp (sim (zc i , pc) /τ ) c′ exp (sim (zc i , pc′) /τ ) (cid:1) (cid:17) , /τ (cid:17) (6) + −1 C2B Xi,c log P where the first part is instance-instance loss which draws intra-class pairs close and pushes inter-class pairs away in the representation space. And the second part represents instance-prototype loss which makes the similarity scores between instances of class c and prototype pc larger than other prototypes. Class prototypes pc are learnable vectors, which are updated by the second part loss. These two parts both use NT-Xent which is the same as the global branch. Prompt Tuning Through prompt engineering (i.e., prompt addition and prompt answer), we reformulate the downstream task in the same format as pre-training method, which means the original classification task is transformed into reconstructing the super node's representations. In order to keep the training objective consistent with pre- training and avoid catastrophic forgetting of the pre-trained knowledge, we use Llocal as an auxiliary loss with a low masking rate during prompt tuning. The overall loss of prompt tuning is defined as: Lprompt = λprompt * Llocal + (1 − λprompt) * Lproto, (7) where λprompt ∈ [0, 1] controls the contribution of each com- ponent loss. We set λprompt as 0.1 for all datasets to focus on learning class prototypes used for classification. In this way, we implement verbalize-free graph prompt tuning. This loss holds a similar format with Lpre. Prediction Similar to prompt tuning, we add a masked super node in the original graph and hope to reconstruct its corresponding class prototype. Specifically, by comparing the representa- tion of the super node gsup with each class prototype pc, we can get the predicted class probability: P (yi|g) = . (8) exp C j=1 exp sim (cid:0) gsup, pi (cid:0) sim (cid:0) (cid:1)(cid:1) gsup, pj (cid:0) (cid:1)(cid:1) P We will choose the highest score as our predicted class: ̃y = argmaxk P (yk|gsup). (9) Experiments In this section, we will introduce the datasets and experi- mental setups of graph classification that we used. Then we evaluate the performance of the proposed self-supervised pre-training method SGL. Thirdly, we prove the effective- ness of our prompt tuning framework SGL-PT compared with standard fine-tuning and other graph prompt methods under semi-supervised and few-shot settings. After that, we conduct ablation study to prove the necessity of the design. Additionally, we perform sensitivity analysis on crucial hyperparameters (e.g., dynamic queue size Q and loss coefficient λ) in Appendix C. We substantiate the ro- bustness and generality of our pre-training method with supplementary experiments (e.g., molecule property pre- diction (over 2 million graphs) and node classification) in Appendix C, showcasing SOTA performance. Fur- thermore, we empirically validate the effectiveness of our prompt design in few-shot node-level tasks within Appendix C. Moreover, we assess parameter efficiency among various prompt methods to show SGL-PT's effi- ciency in Appendix D. Datasets We perform experiments of graph-level tasks on widely used 12 datasets from TUDataset (Morris et al. 2020). The statis- tics of the used datasets can be found in Table 1. They can be classified into two categories: biological and social net- works. More details of these datasets are in Appendix B. Datasets PROTEINS DD MUTAG NCI1 NCI-H23 P388 MOLT-4 IMDB-B IMDB-M COLLAB REDDIT-B REDDIT-M12K type Biological Biological Biological Biological Biological Biological Biological Social Social Social Social Social # graphs Avg # nodes Avg # edges 1113 1178 188 4110 40353 41472 39765 1000 1500 5000 2000 11929 39.06 284.32 17.93 29.87 26.07 22.11 26.10 19.77 13.00 74.49 508.52 391.41 72.82 715.66 19.79 32.30 28.10 23.56 28.14 96.53 65.94 2457.78 594.87 456.89 Table 1: Statistics of graph classification datasets. Evaluation of Proposed Pre-trained Method In this section, we will evaluate our pre-training method SGL under unsupervised setting. Baselines Our baselines mainly consist of three cate- gories: supervised methods, graph kernel methods, and other unsupervised methods. Specifically, we compare with three supervised baselines: GCN (Kipf and Welling 2017), GIN (Xu et al. 2019) and DiffPool (Ying et al. 2018). The SOTA graph kernel methods include graphlet ker- nel (GL) (Shervashidze et al. 2009), Weisfeiler-Lehman sub-tree kernel (WL) (Shervashidze et al. 2011) and deep graph kernel (DGK) (Yanardag and Vishwanathan 2015). We also compare with unsupervised representation learn- ing methods including sub2vec (Adhikari et al. 2018), graph2vec (Narayanan et al. 2017), EdgePred (Hu et al. 2020), InfoGraph (Sun et al. 2019), GraphCL (You et al. 2020), JOAO (You et al. 2021), SimGRACE (Xia et al. 2022), MVGRL (Hassani and Khasahmadi 2020), In- foGCL (Xu et al. 2021a) and GraphMAE (Hou et al. 2022). The introduction of baselines can be found in Appendix B. Experiment Setup The quality of the pre-trained graph encoder is then evaluated by the linear separability of the final representations. Namely, an additional trainable linear classifier is built on top of the frozen encoder following (Hou et al. 2022; You et al. 2020). We adopt GIN (Xu et al. 2019) as our encoder and decoder with the default setting in (Hou et al. 2022). The complete hyper-parameters and more de- tails are listed in Appendix B. Analysis The results are listed in Table 2 and Table 3, from which we can draw the conclusions: SGL outperforms kernel methods on all datasets by a large margin (e.g., 3.2% absolute improvement over the SOTA graph kernel method DGK on PROTEINS). And our method even outperforms the best supervised model (i.e., GIN) on eight out of twelve datasets, which closes the gap between unsupervised methods and supervised methods. Compared with other unsupervised methods, SGL achieves SOTA results except on MUTAG. We suspect this dataset is too small to inspire the full potential of our pre- training method. On larger scale datasets in Table 3, our method surpasses other methods by considerable margins (e.g., around 1.3% absolute improvement over other meth- ods on NCI-H23 dataset). The strong results show the supe- riority of our proposed pre-training method SGL. Evaluation of Proposed Prompt-tuning In this section, we aim to investigate the effectiveness of our proposed prompt method SGL-PT. And we will conduct experiments under different settings (i.e., semi-supervised, few-shot settings) to achieve this goal. Our prompt method can be applied to other pre-training methods with a little modifications which can be found in Appendix C. Semi-supervised Setting Experiments follow a semi-supervised setting with pre- training & fine-tuning (Chen et al. 2020; You et al. 2020). We don't fix the pre-trained model and tune all parameters for downstream tasks. In more limited source scenarios like the next section (few-shot setting), we will freeze the pre- trained model and only train additional parameters for down- stream tasks (e.g., classifier). Baselines To thoroughly investigate the effectiveness of the proposed SGL-PT, we compare it with methods of dif- ferent training strategies. Firstly all the baselines (except 'No pre-train.') are pre- trained with pretext tasks. Then for fine-tuning methods, we obtain the pre-trained models in advance and fine-tune them with a linear classifier on downstream labeled data. For GPPT, EdgePred serves as the pre-training method, with downstream tasks reformulated into edge prediction tasks following their prompt design. GraphPrompt, akin to GPPT, employs EdgePred for pre-training and adapts down- stream tasks into edge prediction, employing a simplified prompt template featuring weighted summation readout. GPF⋆ employs SGL as the pre-trained model, integrating a learnable graph prompt feature onto node attributes. In the case of ProG⋆, SGL is also the pre-trained model, incor- porating a learnable prompt graph into the original graph. In the context of SGL-PT, SGL serves as the pre-trained model, and we reframe downstream tasks in a similar format Supervised Graph Kernels Self-supervised Methods GCN GIN DiffPool GL WL DGK sub2vec graph2vec EdgePred Infograph GraphCL JOAO SimGRACE MVGRL InfoGCL GraphMAE SGL PROTEINS 74.9±3.3 76.2±2.8 75.1±3.5 71.67±0.55 72.92±0.56 73.30±0.82 53.03±5.55 73.30±2.05 73.12±1.54 74.44±0.31 74.39±0.45 74.55±0.41 75.35±0.09 - - 75.30±0.39 76.55±0.19 DD 75.9±2.5 75.3±2.9 - 72.54±3.83 79.78±0.36 73.50±1.01 54.33±2.44 70.32±2.32 72.34±1.04 72.85±1.78 78.62±0.40 77.32±0.54 77.44±1.11 - - 79.42±0.42 80.54±0.65 NCI1 80.2±2.0 82.7±1.7 - - 80.01±0.50 80.31±0.46 52.89±1.61 73.22±1.81 74.41±1.50 76.20±1.06 77.87±0.41 78.07±0.47 79.12±0.44 - 80.20±0.60 80.40±0.30 80.91±0.42 MUTAG 85.6±5.8 89.4±5.6 85.0±10.3 81.66±2.11 80.72±3.00 87.44±2.72 61.05±15.79 83.15±9.25 84.49±1.56 89.01±1.13 86.80±1.34 87.35±1.02 89.01±1.31 89.70±1.10 91.20±1.30 88.19±1.26 88.83±1.44 IMDB-B 70.4±3.4 75.1±5.1 72.6±3.9 65.87±0.98 72.30±3.44 66.96±0.56 55.26±1.54 71.10±0.54 68.48±1.11 73.03±0.87 71.14±0.44 70.21±3.08 71.30±0.77 74.20±0.70 75.10±0.90 75.52±0.66 75.88±0.47 IMDB-M 51.9±3.8 52.3±2.8 - 43.89±0.38 46.95±0.46 44.55±0.52 36.67±0.83 50.44±0.87 44.83±0.65 49.69±0.53 48.58±0.67 49.20±0.77 - 51.20±0.50 51.40±0.80 51.63±0.52 52.84±0.26 COLLAB 79.0±1.8 80.2±1.9 78.9±2.3 56.30±0.60 69.30±3.44 64.66±0.50 55.26±1.54 71.10±0.54 64.80±1.16 70.65±1.13 71.36±1.15 69.50±0.36 71.72±0.82 - 80.00±1.30 80.32±0.46 80.80±0.23 REDDIT-B - 92.4±2.5 92.1±2.6 77.34±0.18 68.82±0.41 78.04±0.39 71.48±0.41 75.78±1.03 84.48±0.68 82.50±1.42 89.53±0.84 85.29±1.35 89.51±0.89 84.50±0.60 - 88.01±0.19 89.97±0.48 Table 2: Graph classification accuracies of supervised, kernel and unsupervised methods on small-scale datasets. The reported results of baselines are from previous papers if available. GIN EdgePred Infograph GraphCL JOAO MVGRL NCI-H23 78.41±0.36 72.49±0.72 78.69±0.69 76.37±1.08 76.69±1.13 78.08±0.46 GraphMAE 77.09±0.33 79.98±0.53 SGL MOLT-4 72.40±1.07 70.53±1.98 71.29±0.53 73.26±1.14 72.49±0.74 74.63±0.32 73.91±0.51 75.10±0.52 P388 82.63±0.90 72.28±0.97 78.00±1.38 79.92±1.21 79.86±1.96 80.20±0.89 80.55±0.48 81.75±0.47 RDT-M12K 35.01±1.48 28.65±1.48 33.14±0.74 33.79±2.47 35.76±1.42 32.21±1.35 33.77±1.35 36.24±1.83 Table 3: Results of supervised GIN and self-supervised methods on larger scale datasets. The baseline results are obtained using their official implementations. to the pre-training task. Furthermore, in order to demonstrate the superiority our prompt method is not only dependent on a superior pre-train model, we replace the EdgePred with SGL in GPPT, GraphPrompt which are coined as GPPT⋆ and GraphPrompt⋆ respectively. We use grid search on im- portant hyper-parameters to get the best performance. Experimental Setup We ensure a fair comparison by us- ing the same model configuration for all methods. The de- tailed settings and hyper-parameters are in Appendix B. Analysis Table 4 summarizes the results of different train- ing strategies, and we can get the following information: For fine-tuning-based methods, the order of performance follows "EdgePred < GraphCL < GraphMAE < SGL", which is similar to the results in previous unsupervised learning. Our method SGL surpasses other fine-tuning- based methods, which again testifies the effectiveness of our pre-training method SGL. It is worth noting that EdgePred even cannot outperform 'No pre-train.' on some datasets, which indicates EdgePred method triggers negative transfer. SGL-PT outperforms all fine-tuning-based methods and surpasses SGL by a large margin (around 3% average im- provement on all datasets), which proves the existence of representation gap between pre-training and downstream tasks and the urgency of minimizing such gap. It also shows that SGL-PT outperforms GPPT and GraphPrompt by a large margin (around 6% average improvement on all datasets). The reason GPPT and GraphPrompt perform poorly is that they only utilize limited learned knowledge of the pre-trained model. And SGL-PT surpasses GPF⋆ and ProG⋆ by a considerable margin (around 5% average im- provement on all datasets), which proves the effectiveness of unifying the training objectives. We can find GPPT⋆, GPF⋆, ProG⋆ and GraphPrompt⋆ even perform worse than SGL due to catastrophic forgetting from inconsistent objectives on some datasets (e.g., For DD dataset, GPPT⋆, GPF⋆ and GraphPrompt⋆ lag 2.8%, 0.8%, 6.2% and 1.8% behind SGL⋆ respectively). This experiment serves as proof that the effectiveness of our prompt tun- ing method is not dependent on a superior pre-train model, what matters is to establish consistent training objectives that align with both pre-train and downstream tasks. Few-shot Setting In many real-world scenarios, it is challenging to collect and label a large amount of data. Few-shot learning is a well-known case of low-resource scenarios. We conduct ex- periments in such a setting to prove the effectiveness of our method in low-resource scenarios. Experiments on more datasets can be found in Appendix C. Experimental Setup In this section, we evaluate different training strategies with more limited supervision in a few- shot setting. This entails having only a small number of la- beled graphs per class, denoted as k-shot classification. We perform experiments with 1-shot and 3-shot graph classifica- tion to evaluate all methods. The model setup remains con- sistent with the previous section. Additionally, for prompt methods, we freeze the pre-trained model and exclusively train supplementary parameters for downstream tasks. Analysis Table 5 summarizes the results of different train- ing strategies, and we can obtain the following results: In few-shot setting, prompt methods can achieve better performance than standard fine-tuning-based methods (e.g., GPPT outperforms EdgePred, SGL-PT outperforms SGL.) which proves the essential of unifying the pre-training and downstream tasks. FT PT 10%L.R. No pre-train. EdgePred GraphCL GraphMAE SGL⋆ GPPT GPPT⋆ GraphPrompt GraphPrompt⋆ GPF⋆ ProG⋆ SGL-PT⋆ PROTEINS 67.98±0.41 68.12±0.93 68.58±0.84 68.79±0.77 69.41±1.05 68.26±0.87 65.28±1.99 71.00±0.46 71.26±0.43 67.19±0.75 66.88±0.90 72.94±0.24 DD 68.32±0.39 66.77±0.68 68.60±0.49 68.70±0.31 68.81±0.40 66.53±0.85 66.04±0.72 65.24±1.26 67.07±0.50 67.97±0.50 67.76±0.80 75.37±0.16 NCI1 64.00±0.22 63.31±0.72 68.08±0.48 65.19±0.48 66.51±0.28 62.85±1.20 66.24±0.51 60.55±2.17 64.47±0.27 67.37±0.55 64.59±0.40 68.80±0.18 MUTAG 64.19±0.53 67.72±0.33 64.76±0.65 71.16±0.83 72.51±1.83 71.13±1.81 71.29±2.07 71.78±0.75 70.42±0.54 71.85±1.04 69.16±1.52 80.07±1.37 NCI-H23 55.14±1.29 63.44±1.32 65.77±0.52 64.25±1.44 64.18±1.29 53.44±0.81 51.86±0.70 55.39±0.85 60.61±2.51 63.24±1.51 68.33±0.60 69.71±0.15 IMDB-B 69.10±0.28 67.24±1.63 69.95±1.83 69.46±0.33 69.62±0.24 66.04±0.82 69.52±0.55 62.60±2.32 69.88±0.23 69.60±0.43 70.18±0.54 70.40±0.77 IMDB-M Imp(%) 43.25±0.34 0.00 41.57±0.38 +0.88 43.39±0.62 +2.45 44.09±0.49 +2.81 44.69±0.56 +3.39 38.64±1.40 −0.73 43.56±0.56 +0.26 40.33±0.60 −0.72 43.44±0.31 +2.16 43.44±0.43 +2.67 44.23±0.53 +2.73 45.28±0.41 +7.31 Table 4: Fine-tuning (FT) and prompt tuning (PT) results under semi-supervised setting. 10%L.R. denotes 10% label rate of training data. 'No pre-train.' means GIN training from scratch. Imp(%) represents the average improvement of each method over No pre-train. ⋆ means that we use SGL as their pre-trained models. Few-shot EdgePred GraphCL GraphMAE SGL⋆ GPPT GPPT⋆ GraphPrompt GraphPrompt⋆ GPF⋆ ProG⋆ SGL-PT⋆ PROTEINS DD NCI1 MUATG NCI-H23 1-shot 57.25±2.80 59.40±1.87 58.46±3.75 58.76±1.02 58.10±1.11 58.64±2.43 58.94±2.37 59.95±2.71 57.76±2.07 57.99±1.47 61.02±2.63 3-shot 58.36±2.06 59.91±2.88 59.29±1.62 59.73±2.65 58.63±0.81 60.02±1.66 62.01±1.47 62.93±1.37 59.32±2.43 60.99±0.96 64.47±2.10 1-shot 50.88±2.85 52.30±2.51 51.31±1.63 52.87±4.15 50.45±1.49 54.47±3.49 53.62±1.09 55.03±2.40 53.58±2.99 52.75±3.27 57.15±1.92 3-shot 52.02±1.21 53.39±2.87 54.14±1.15 54.51±2.91 51.50±2.04 56.92±2.20 53.38±1.37 58.21±0.95 54.24±2.15 54.32±1.57 61.12±2.42 1-shot 50.75±0.30 51.51±0.28 51.45±1.45 51.88±1.65 51.50±0.81 51.29±2.16 51.49±0.38 52.65±1.06 51.68±0.40 51.65±1.04 53.08±2.06 3-shot 50.94±0.56 51.72±0.55 52.67±1.86 53.22±2.11 51.25±0.47 52.10±2.37 51.64±0.58 52.50±1.21 51.91±0.88 52.03±0.35 55.24±1.28 1-shot 57.01±4.83 57.92±3.43 57.67±4.11 58.68±2.28 63.23±4.35 63.13±3.53 67.62±1.93 68.22±2.86 60.15±4.98 61.37±2.78 72.88±5.20 3-shot 58.71±4.04 62.39±1.53 60.92±3.54 62.47±2.51 66.06±2.55 65.86±1.65 70.03±2.18 71.40±3.12 61.93±3.03 62.42±1.70 78.60±1.81 1-shot 51.94±1.85 52.28±3.13 50.40±1.58 52.06±2.69 51.55±1.19 49.88±2.20 55.03±0.75 52.90±2.47 51.19±2.93 50.48±1.27 55.61±1.74 3-shot 52.45±2.35 54.85±2.14 53.72±1.61 55.67±1.08 51.84±1.14 50.03±1.96 56.97±1.25 52.57±1.89 54.20±3.77 52.66±1.94 58.76±2.09 FT PT Table 5: Fine-tuning&prompt tuning results under few-shot setting. ⋆ means that we use SGL as their pre-trained models. Full w/o local branch w/o global branch w/o dynamic queue PROTEINS 76.55±0.19 74.68±0.50 75.18±0.40 74.85±0.43 DD 80.54±0.65 79.67±0.46 79.54±0.54 78.50±0.46 NCI1 80.91±0.42 79.12±0.35 80.18±0.28 80.37±0.15 MUTAG 88.83±1.44 85.22±1.25 86.81±2.12 85.23±1.13 IMDB-B 75.88±0.47 74.42±0.16 75.24±0.55 74.89±0.38 IMDB-M 52.84±0.26 50.59±0.32 51.63±0.52 51.06±0.71 COLLAB 80.80±0.23 78.19±0.12 80.33±0.38 80.51±0.29 REDDIT-B 89.97±0.48 86.67±0.37 87.83±0.11 86.70±0.50 Table 6: Ablation studies for SGL by masking local branch, global branch and dynamic queue under the unsupervised setting. And SGL-PT can still outperform other methods which proves the effectiveness of our prompt design even in low- resource scenarios. (e.g., SGL-PT surpasses other methods by over 7 % absolute improvement on the MUTAG of 5- shot.) Even with a stronger pre-trained model, GPPT⋆, GPF⋆, ProG⋆ and GraphPrompt⋆ still perform moderately on most datasets, highlighting the importance of unifying the training objectives of pre-training and downstream tasks to fully ex- ploit learned knowledge. These findings underscore the ne- cessity to solve the challenges we proposed simultaneously. Ablation Study To prove the effectiveness of the design of our pre-training method SGL, we conduct ablation experiments that mask different components under the same model configuration. SGL contains two branches (i.e., local and global), and we mask them separately. 'w/o global branch' means that we only use the local branch. 'w/o local branch' means that we only use the contrastive learning method. And 'w/o dynamic queue' represents that we do not use the dynamic queue to provide adequate negative samples. From Table 6, the results of 'w/o dynamic queue' lags far behind SGL, which demon- strates the dynamic queue is essential to integrate these two branches better. Disjunct single branches also lag behind SGL, this means through efficient combination, we acquire complementary strengths of both generative (local branch) and contrastive (global branch) methods. Conclusion In this work, we identify the main challenges for graph prompt tuning. To solve them, we propose a "Pre-train, prompt and predict" framework coined as SGL-PT. This framework unifies the pre-training and downstream task in the same format and minimizes the training objective gap. Specifically, we design a strong and universal pre-training task that acquires the complementary strengths of generative and contrastive methods. Based on this pre-training method, we design a novel verbalizer-free prompting function to re- formulate the downstream task in the same format as our pre-training method. Empirical results show that our pre- training method surpasses other baselines under the unsuper- vised setting, and our prompt tuning method can greatly fa- cilitate pre-trained models compared to standard fine-tuning methods and other graph prompt tuning techniques. References Adhikari, B.; Zhang, Y.; Ramakrishnan, N.; and Prakash, B. A. 2018. Sub2vec: Feature learning for subgraphs. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, 170–182. Springer. Alemi, A. A.; Fischer, I.; Dillon, J. V.; and Murphy, K. 2016. arXiv preprint Deep variational information bottleneck. arXiv:1612.00410. Chang, C.-C.; and Lin, C.-J. 2011. LIBSVM: A Library for Support Vector Machines. ACM Trans. Intell. Syst. Technol., 2(3). Chen, T.; Kornblith, S.; Norouzi, M.; and Hinton, G. 2020. A simple framework for contrastive learning of visual repre- sentations. In International conference on machine learning, 1597–1607. PMLR. Cui, G.; Hu, S.; Ding, N.; Huang, L.; and Liu, Z. 2022. Prototypical Verbalizer for Prompt-based Few-shot Tuning. In Proceedings of the 60th Annual Meeting of the Associa- tion for Computational Linguistics (Volume 1: Long Papers), 7014–7024. Davis, J.; and Goadrich, M. 2006. The relationship between In Proceedings of the Precision-Recall and ROC curves. 23rd international conference on Machine learning, 233– 240. Fang, T.; Zhang, Y.; Yang, Y.; and Wang, C. 2022. Prompt tuning for graph neural networks. arXiv preprint arXiv:2209.15240. Fey, M.; and Lenssen, J. E. 2019. Fast graph representation learning with PyTorch Geometric. ArXiv preprint. Hassani, K.; and Khasahmadi, A. H. 2020. Contrastive In Inter- multi-view representation learning on graphs. national Conference on Machine Learning, 4116–4126. PMLR. Hjelm, R. D.; Fedorov, A.; Lavoie-Marchildon, S.; Grewal, K.; Bachman, P.; Trischler, A.; and Bengio, Y. 2018. Learn- ing deep representations by mutual information estimation and maximization. In International Conference on Learning Representations. Hou, Z.; Liu, X.; Cen, Y.; Dong, Y.; Yang, H.; Wang, C.; and Tang, J. 2022. Graphmae: Self-supervised masked graph au- toencoders. In Proceedings of the 28th ACM SIGKDD Con- ference on Knowledge Discovery and Data Mining, 594– 604. Hu, W.; Liu, B.; Gomes, J.; Zitnik, M.; Liang, P.; Pande, V.; and Leskovec, J. 2020. Strategies For Pre-training Graph Neural Networks. In International Conference on Learning Representations (ICLR). Jin, W.; Derr, T.; Liu, H.; Wang, Y.; Wang, S.; Liu, Z.; and Tang, J. 2020. Self-supervised learning on graphs: Deep in- sights and new direction. arXiv preprint arXiv:2006.10141. Kipf, T. N.; and Welling, M. 2016. Variational Graph Auto- Encoders. NIPS Workshop on Bayesian Deep Learning. Kipf, T. N.; and Welling, M. 2017. Semi-Supervised Clas- sification with Graph Convolutional Networks. In Interna- tional Conference on Learning Representations (ICLR). Li, J.; Zhou, P.; Xiong, C.; and Hoi, S. 2020. Prototypical Contrastive Learning of Unsupervised Representations. In International Conference on Learning Representations. Liu, P.; Yuan, W.; Fu, J.; Jiang, Z.; Hayashi, H.; and Neubig, G. 2022. Pre-Train, Prompt, and Predict: A Systematic Sur- vey of Prompting Methods in Natural Language Processing. ACM Comput. Surv. Just Accepted. Liu, Z.; Yu, X.; Fang, Y.; and Zhang, X. 2023. Graphprompt: Unifying pre-training and downstream tasks for graph neural networks. In Proceedings of the ACM Web Conference 2023, 417–428. Morris, C.; Kriege, N. M.; Bause, F.; Kersting, K.; Mutzel, P.; and Neumann, M. 2020. TUDataset: A collection of benchmark datasets for learning with graphs. In ICML 2020 Workshop on Graph Representation Learning and Beyond (GRL+ 2020). Narayanan, A.; Chandramohan, M.; Venkatesan, R.; Chen, L.; Liu, Y.; and Jaiswal, S. 2017. graph2vec: Learn- ing distributed representations of graphs. arXiv preprint arXiv:1707.05005. Oord, A. v. d.; Li, Y.; and Vinyals, O. 2018. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748. Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; Desmaison, A.; K ̈opf, A.; Yang, E.; DeVito, Z.; Raison, M.; Tejani, A.; Chilamkurthy, S.; Steiner, B.; Fang, L.; Bai, J.; and Chintala, S. 2019. PyTorch: An Imperative Style, High- Performance Deep Learning Library. In Proc. of NeurIPS. Sen, P.; Namata, G.; Bilgic, M.; Getoor, L.; Galligher, B.; and Eliassi-Rad, T. 2008. Collective classification in net- work data. AI magazine, 29(3): 93–93. Shervashidze, N.; Schweitzer, P.; Van Leeuwen, E. J.; Mehlhorn, K.; and Borgwardt, K. M. 2011. Weisfeiler- lehman graph kernels. Journal of Machine Learning Re- search, 12(9). Shervashidze, N.; Vishwanathan, S.; Petri, T.; Mehlhorn, K.; and Borgwardt, K. 2009. Efficient graphlet kernels for large graph comparison. In Artificial intelligence and statistics, 488–495. PMLR. Shi, H.; Luo, D.; Tang, S.; Wang, J.; and Zhuang, Y. 2020. Run away from your teacher: Understanding byol by a novel self-supervised approach. arXiv preprint arXiv:2011.10944. Sterling, T.; and Irwin, J. J. 2015. ZINC 15–ligand discovery for everyone. Journal of chemical information and model- ing, 55(11): 2324–2337. Sun, F.-Y.; Hoffmann, J.; Verma, V.; and Tang, J. 2019. Info- graph: Unsupervised and semi-supervised graph-level rep- resentation learning via mutual information maximization. arXiv preprint arXiv:1908.01000. Sun, M.; Zhou, K.; He, X.; Wang, Y.; and Wang, X. 2022. GPPT: Graph Pre-Training and Prompt Tuning to Generalize Graph Neural Networks. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, KDD '22, 1717–1727. New York, NY, USA: Asso- ciation for Computing Machinery. ISBN 9781450393850. Zhu, Q.; Ponomareva, N.; Han, J.; and Perozzi, B. 2021. Shift-robust gnns: Overcoming the limitations of localized graph training data. Advances in Neural Information Pro- cessing Systems, 34: 27965–27977. Zhu, Y.; Guo, J.; Wu, F.; and Tang, S. 2022. RoSA: A Ro- bust Self-Aligned Framework for Node-Node Graph Con- trastive Learning. In Raedt, L. D., ed., Proceedings of the Thirty-First International Joint Conference on Artificial In- telligence, IJCAI-22, 3795–3801. International Joint Confer- ences on Artificial Intelligence Organization. Main Track. Sun, X.; Cheng, H.; Li, J.; Liu, B.; and Guan, J. 2023. All in One: Multi-Task Prompting for Graph Neural Networks. In Proceedings of the 26th ACM SIGKDD international con- ference on knowledge discovery & data mining (KDD'23). Wang, M.; Zheng, D.; Ye, Z.; Gan, Q.; Li, M.; Song, X.; Zhou, J.; Ma, C.; Yu, L.; Gai, Y.; Xiao, T.; He, T.; Karypis, G.; Li, J.; and Zhang, Z. 2019. Deep Graph Library: A Graph-Centric, Highly-Performant Package for Graph Neu- ral Networks. arXiv preprint arXiv:1909.01315. Wu, L.; Lin, H.; Tan, C.; Gao, Z.; and Li, S. Z. 2021. Self- supervised Learning on Graphs: Contrastive, Generative, or Predictive. IEEE Transactions on Knowledge and Data En- gineering. Wu, Z.; Ramsundar, B.; Feinberg, E. N.; Gomes, J.; Ge- niesse, C.; Pappu, A. S.; Leswing, K.; and Pande, V. 2018. MoleculeNet: a benchmark for molecular machine learning. Chemical science, 9(2): 513–530. Xia, J.; Wu, L.; Chen, J.; Hu, B.; and Li, S. Z. 2022. Sim- grace: A simple framework for graph contrastive learning without data augmentation. In Proceedings of the ACM Web Conference 2022, 1070–1079. Xu, D.; Cheng, W.; Luo, D.; Chen, H.; and Zhang, X. 2021a. InfoGCL: Information-Aware Graph Contrastive Learning. In Ranzato, M.; Beygelzimer, A.; Dauphin, Y.; Liang, P.; and Vaughan, J. W., eds., Advances in Neural Information Processing Systems, volume 34, 30414–30425. Curran As- sociates, Inc. Xu, K.; Hu, W.; Leskovec, J.; and Jegelka, S. 2019. How Powerful are Graph Neural Networks? In International Con- ference on Learning Representations. Xu, M.; Wang, H.; Ni, B.; Guo, H.; and Tang, J. 2021b. Self-supervised graph-level representation learning with lo- cal and global structure. In International Conference on Ma- chine Learning, 11548–11558. PMLR. Yan, X.; Cheng, H.; Han, J.; and Yu, P. S. 2008. Mining sig- nificant graph patterns by leap search. In Proceedings of the 2008 ACM SIGMOD international conference on Manage- ment of data, 433–444. Yanardag, P.; and Vishwanathan, S. 2015. Deep graph ker- In Proceedings of the 21th ACM SIGKDD interna- nels. tional conference on knowledge discovery and data mining, 1365–1374. Ying, Z.; You, J.; Morris, C.; Ren, X.; Hamilton, W.; and Leskovec, J. 2018. Hierarchical graph representation learn- ing with differentiable pooling. Advances in neural infor- mation processing systems, 31. You, Y.; Chen, T.; Shen, Y.; and Wang, Z. 2021. Graph con- trastive learning automated. In International Conference on Machine Learning, 12121–12132. PMLR. You, Y.; Chen, T.; Sui, Y.; Chen, T.; Wang, Z.; and Shen, Y. 2020. Graph contrastive learning with augmentations. Advances in Neural Information Processing Systems, 33: 5812–5823. Zhang, W.; Deng, L.; Zhang, L.; and Wu, D. 2022. A sur- vey on negative transfer. IEEE/CAA Journal of Automatica Sinica, 1–25. A. Algorithm Algorithm of SGL The overall processes of SGL can be described as Algo- rithm 1. The input graphs will be fed into two branches (i.e., local and global). In the local branch, we will mask partial node features. Then through the online encoder Eo, we will obtain fragmentary representations. Following (Hou et al. 2022), we will re-mask node representations. And fi- nally through a decoder, we restore the input features on masked nodes. The reconstructed loss is computed by Equa- tion 1.Meanwhile, in the global branch, we will augment input graphs and feed them into target encoder Et, readout function R and target projection head ft to obtain global representations z(2), and we will make use of node repre- sentation in local branch to obtain other view representations z(1) through readout function and online projection head fo. Finally, through Equation 5, we obtain the global loss in the global branch. And the total loss is computed by a weighted sum of Llocal, Lglobal. The online encoder, projection head and decoder are updated by gradient descent. But the tar- get encoder and projection head are updated by momentum update. Algorithm 1: Pretraining method: SGL Input: Online and target encoders Eo, Et, online and target projectors fo, ft, decoder D and readout function R, feature mask function M and augmentation function A, unlabeled graph classification dataset G, training epochs E. Output: Optimal pre-trained encoder E ⋆ o for i ← 1 to E do // For Local branch G(1) ← M(G), H(1) ← Eo(G(1)) ; ̃X(1) ← D(H(1)) ; Calculate the loss Llocal of local branch according to Equation 1; // For global branch G(2) ← A(G), H(2) ← Eo(G(2)); Summarize graph representation through readout function g(1) ← R(H(1)), g(2) ← R(H(2)) ; z(1) ← fo(g(1)), z(2) ← ft(g(2)) ; Calculate the loss Lglobal of global branch according to Equation 4; Lpre = λpre * Llocal + (1 − λpre) * Lglobal ; Update parameters of Eo, D and fo by applying gradient descent to minimize Lpre ; // Momentum update t ← mθi−1 θi t + (1 − m)θi o ; Using z(2) to update dynamic queue Q ; end Algorithm of Graph Prompt Tuning The overall process of graph prompt tuning SGL-PT can be concluded in Algorithm 2. Firstly, we will add a masked super node on each downstream graph and reformulate the downstream task as masked node prediction. We use proto- type contrastive to get rid of the verbalizer, and additionally we will mask partial node features and calculate reconstruc- tion loss to avoid catastrophic forgetting. Lastly, the pro- totype contrastive loss and reconstruction loss are linearly combined through coefficient λprompt. Algorithm 2: Graph Prompt Tuning Input: Pretrained encoder E ⋆ o , prompt addition function P, feature mask function M , labeled downstream dataset G, training epochs E for i ← 1 to E do ˆG ← M ◦ P(G), H ← E ⋆ ̃X ← D(H) ; Calculate the reconstruction loss Llocal according to Equation 1; o ( ˆG) ; Select the super node representation as graph representation g ← H[0] ; Calculate the prototype contrastive loss Lproto according to Equation 6; Lprompt = λprompt * Llocal + (1 − λprompt) * Lproto ; Update parameters of E ⋆ descent to minimize Lprompt. o by applying gradient end B. Experimental Details Datasets In this subsection, we give a more detailed description of the datasets used in the main paper. More descriptions can be found in (Yan et al. 2008; Yanardag and Vishwanathan 2015). For bioinformatics datasets: 1. MUTAG: This dataset consists of 188 mutagenic aromatic and heteroaromatic nitro compounds. Each compound is represented as a graph, with nodes corresponding to atoms and edges indicating bonds between them. There are 7 discrete labels associated with the mutagenic activity of the compounds. 2. PROTEINS: In this dataset, nodes represent secondary structure elements (SSEs) in protein structures. An edge is established between two nodes if the corresponding SSEs are neighboring in the amino-acid sequence or in 3D space. The dataset contains protein structures with 3 discrete labels, representing helix, sheet, or turn. 3. DD: The dataset comprises 1178 protein structures, each depicted as a graph wherein amino acids serve as nodes, and edges connect two nodes if their spatial sepa- ration is within 6 Angstroms. The objective of this predic- tive endeavor is the categorization of the protein structures as either enzymatic or non-enzymatic entities. Importantly, it's worth noting that nodes are uniformly labeled across all datasets. 4. NCI1: Derived from the National Cancer Institute (NCI), this dataset is a subset of chemoinformatics datasets. It contains chemical compounds that have been screened for their ability to suppress or inhibit the growth of a panel of human tumor cell lines. NCI1 has 37 discrete labels, repre- senting different outcomes of the cell line growth inhibition assay. 5. NCI-H23, MOLT-4 and P388: They offer insights into the biological activities of small molecules, including bioas- say records for anticancer screenings across various can- cer cell lines, specifically categorized as 'Non-Small Cell Lung', 'Leukemia' and 'Leukemia' respectively. These datasets offer a diverse range of chemical and bi- ological contexts, providing challenges for graph classifica- tion tasks with varying numbers of labels and graph struc- tures. For social network datasets: 1. IMDB-BINARY and IMDB-MULTI: These datasets are based on movie collab- oration networks. Each graph represents the ego-network of an actor or actress, where nodes correspond to individu- als and an edge is present between two nodes if they have collaborated in the same movie. IMDB-BINARY is a bi- nary classification task where the goal is to classify each graph into a specific movie genre. IMDB-MULTI is a multi- class classification task with the objective of classifying the graphs into various movie genres. 2. REDDIT-BINARY and REDDIT-M12K: These datasets capture online discussion threads. Nodes in these graphs represent users participating in discussions, and edges are formed when users interact by responding to each other's comments. REDDIT-BINARY involves bi- nary classification, aiming to classify graphs into specific community or subreddit labels. REDDIT-M12K extends this to multi-class classification consisting of 11 different subreddits, namely, "AskReddit, AdviceAnimals, atheism, aww, IAmA, mildlyinteresting, Showerthoughts, videos, todayilearned, worldnews, TrollXChromosomes." And the goal is to predict which subreddit a given discussion graph belongs to. 3. COLLAB: Derived from scientific collaboration data, this dataset consists of ego-networks representing re- searchers in different fields. Each graph focuses on re- searchers from a specific scientific field, such as High En- ergy Physics, Condensed Matter Physics, or Astrophysics. The classification task involves assigning each graph to the corresponding scientific field. These datasets provide diverse scenarios for evaluating graph classification algorithms, with each graph represent- ing a unique context of collaboration or interaction, and the classification tasks focusing on predicting genres, commu- nities, or scientific fields. It has to note that social networks do not contain raw node attributes, we use node degrees as their attributes following (Hou et al. 2022). As for biological graphs, we use their cat- egorical node attributes. Baselines In this part, we will introduce the baselines used in our ex- periments: • Edge prediction (EdgePred) (Hu et al. 2020) treat ex- isting links as training signals. Its training objective is binary cross-entropy loss. • Unsupervised And Semi-Supervised Graph-level Repre- sentation Learning via Mutual Information Maximiza- tion (InfoGraph) (Sun et al. 2019) takes a pair of global representation and patch representation as input and em- ploys a discriminator to determine if they belong to the same graph based on Deep InfoMax (Hjelm et al. 2018). This process generates all possible positive and negative samples in a batch-wise manner. • Graph Contrastive Learning with Augmentations (GraphCL) (You et al. 2020) proposes various aug- mentation techniques for graph data and investigates their impacts on different types of datasets. Firstly, the input graph will be fed into two random augmentation functions to generate two graph views, then these augmented graphs will be fed into GNN encoder with readout function to obtain graph representations. Finally, these graph representations will be used to contrast with InfoNCE loss (Oord, Li, and Vinyals 2018). • Graph Contrastive Learning Automated (JOAO) (You et al. 2021) introduces the concept of joint augmenta- tion optimization, which formulates a bi-level optimiza- tion problem by simultaneously optimizing the selection of augmentations and the contrastive objective. • A Simple Framework for Graph Contrastive Learning without Data Augmentation (SimGRACE) (Xia et al. 2022) eliminates data augmentation while introducing encoder perturbations to generate distinct views for graph contrastive learning. • Contrastive Multi-View Representation Learning on Graphs (MVGRL) (Hassani and Khasahmadi 2020) uti- lizes the information of multi-views for contrasting. Firstly, it will use the edge diffusion function to gener- ate an augmented graph. And asymmetric encoders will be applied on the original graph and diffusion graph to acquire node embeddings. Next, a readout function is employed to derive graph-level representations. Original node representations and augmented graph-level repre- sentation are regarded positive pairs. Additionally, the augmented node representations and original graph-level representation are also considered as positive pairs. The negative pairs are constructed through random shuffling. Learning (InfoGCL) (Xu et al. 2021a) suggests minimizing the mutual information between contrastive parts while preserving task-relevant information within both the individual module and the overall framework. This approach aims to minimize information loss during graph representation learning, following the Information Bottleneck principle (Alemi et al. 2016). • Information-Aware Graph Contrastive • Self-Supervised Masked Autoencoders Graph (GraphMAE) (Hou et al. 2022) is a masked au- toencoder. It will mask partial input node attributes firstly and then the encoder will compress the masked graph into latent space, finally a decoder aims to reconstruct the masked attributes. Evaluation Protocol Unsupervised Representation Learning For small-scale datasets, we follow (Hou et al. 2022; You et al. 2020) to assess our SGL pre-training method. After pre-training, we keep the model fixed to generate graph-level representa- tions. These representations are then fed into a downstream LIB-SVM (Chang and Lin 2011) classifier on small-scale datasets. It's important to note that all self-supervised meth- ods are trained using unsupervised data. The evaluation of the pre-trained model involves training only a classifier with supervised data from the downstream task. Reported results include the mean accuracy from 10-fold cross-validation, with standard deviation after 5 runs, on small-scale datasets. larger-scale datasets (NCI-H23, MOLT-4, P388, REDDIT-M12K), due to LIB-SVM's convergence issues, we adopt a one-layer MLP as the downstream classifier. Results are reported as the mean performance from 5-fold cross-validation, using accuracy for REDDIT-M12K and ROC-AUC (Davis and Goadrich 2006) for others. For Semi-supervised Setting To assess our proposed prompt method, we carry out experiments in both semi-supervised and few-shot settings. In the semi-supervised setup, we fix the label rate at 10%, indicating that only 10% of the train- ing data contains labels. We perform parameter tuning for both encoders and additional downstream components (e.g., classifier) to optimize performance on downstream tasks. Few-shot Setting In contrast to the previous section, we introduce even scarcer supervised signals in this scenario to simulate low-resource conditions. Specifically, each class comprises only one or three instances for training data, known as 1-shot and 3-shot graph classification. To address concerns of overfitting and parameter efficiency, we solely fine-tune the downstream parameters in the few-shot setting. Hyper-parameters All hyper-parameters used in unsupervised learning are listed in Table 7. The coefficients in Equation 5 is 0.5 for most datasets except COLLAB and NCI1 (0.9). For the lo- cal branch, we adopt similar hyper-parameters in (Hou et al. 2022). And for the global branch, we do not use augmen- tation in relatively large datasets (e.g., NCI1 and ZINC). For other small datasets, we use grid search to obtain the augmentation ratios. For the training hyper-parameters (e.g., batch size, epochs and etc), we adopt similar settings in (Hou et al. 2022). As for the hyper-parameters in the prompt tuning, Table 9 gives you the details. During prompt tuning, we still mask partial nodes' features at a low rate mask (10%) to avoid the catastrophic forgetting of the pre-training knowledge and over-fitting. For all methods, we use the same hyper- parameters for a fair comparison. You can increase the num- ber of training epochs, the downstream performance may be boosted further. All the pre-trained models are finetuned un- der the same setting. Some hyper-parameters are searched with grid search. The learning rate is searched in 0.01, 0.001, 0.0001 and the readout function is in mean, max, sum. And we use the same batch size. Computer Infrastructures Specifications For hardware, most experiments are conducted on a com- puter server with four GeForce RTX 2080Ti GPUs with 11GB memory and 48 Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz. Besides, our models are implemented by Pytorch Geometric 2.0.4 (Fey and Lenssen 2019), DGL 0.9.1 (Wang et al. 2019) and Pytorch 1.11.0 (Paszke et al. 2019). All the datasets used in our work are available in DGL and PyTorch Geometric libraries. For molecular prop- erty prediction, our implementation is based on the code in https://github.com/snap-stanford/pretrain-gnns with Pytorch Geometric 2.0.4 on GeForce RTX 3090. C. Additional Experiments Due to space constraints in the main content, this section will encompass additional experiments involving molecule prop- erty prediction and node classification. These endeavors aim to demonstrate the robustness and versatility of our method. Furthermore, we will delve into an analysis of important hy- perparameters, specifically focusing on the dynamic queue size (Q) and loss coefficient (λ). Lastly, we will evaluate our graph prompting method on more datasets and apply it to other pre-training methods. Molecule Property Prediction Besides the single-label graph classification task in the main content, we also evaluate our pre-training method on an- other graph-level task (i.e., molecular property prediction) to predict chemical molecule properties. In this experiment, a larger molecule dataset is employed to pre-train the model, followed by fine-tuning on smaller downstream datasets. This experiment serves to assess the ability of our pre- training method to generalize across different distributions, showcasing its potential for transfer learning. Datasets ZINC dataset is used for pre-training which consists of 2 million unlabeled molecules sampled from ZINC15 (Sterling and Irwin 2015). Other eight datasets are downstream datasets contained in MoleculeNet (Wu et al. 2018), input node features are atom number and chirality tag, and edge features are bond type and direction. Scaffold- split is used to splits graphs into train/val/test sets that mimic real-world use cases. The statistics of these datasets can be found in Table 10. These datasets are widely used for eval- uating the transferability of pre-training methods (You et al. 2020; Sun et al. 2019; You et al. 2021). Baselines We employ several baselines containing no pre-trained GIN (i.e., directly fine-tune on downstream dataset without self-supervised pre-training), as well as GraphCL (You et al. 2020), JOAO (You et al. 2021), GraphLoG (Xu et al. 2021b), GraphMAE (Hou et al. 2022) and three different pre-training strategies (i.e., Infomax, At- trMasking and ContextPred) proposed in (Hu et al. 2020) which incorporates the domain knowledge heuristically that correlates with the specific downstream datasets. All base- lines (except No-pretrain) will firstly be pre-trained on ZINC datasets and then adopt them on downstream datasets. Model configuration Local branch Global branch Training hidden size num layer activation norm scaling factor masking rate replace rate Q momentum tempurate feat mask1 feat mask2 drop edge1 drop edge2 batch size epochs learning rate weight decay optimizer scheduler PROTEINS 512 3 prelu BN 1 0.5 0.0 1024 0.995 2 0.4 0.1 0.0 0.1 32 100 0.00015 0.0 Adam False DD 512 2 prelu BN 1 0.1 0.1 1024 0.999 2 0.1 0.2 0 0 32 80 0.001 0.0 NCI1 MUTAG IMDB-B IMDB-M COLLAB REDDIT-B ZINC 300 512 5 2 relu prelu BN BN 1 2 0.25 0.25 0.0 0.1 4096 1024 0.999 0.999 0.05 2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 256 16 100 300 0.001 0.001 0.0 0.0 Adam False 512 2 prelu BN 1 20 0.001 1024 0.999 2 0.2 0.5 0.1 0.2 32 60 0.00015 0.0 Adam False 512 3 prelu BN 1 0.5 0.0 1024 0.995 2 0.0 0.2 0.0 0.4 32 50 0.00015 0.0 Adam False 512 2 prelu LN 1 0.75 0.1 1024 0.999 0.08 0.3 0.3 0.0 0.0 8 120 0.00015 0.0 Adam False 256 2 relu BN 1 0.75 0.0 1024 0.999 2 0.2 0.3 0.0 0.2 32 20 0.00015 0.0 Adam True 32 5 prelu BN 2 0.75 0.1 1024 0.999 2 0.2 0.5 0.0 0.3 64 22 0.0005 0.0 Adam False Adam Adam True True Table 7: Hyper-parameters for pre-training method. NCI-H23 MOLT-4 Model Local Global Training hidden size num layer activation norm scaling factor masking rate replace rate Q momentum tempurate feat mask1 feat mask2 drop edge1 drop edge2 batch size epochs learning rate weight decay optimizer scheduler 128 3 prelu BN 2 0.25 0.1 1024 0.999 2 0.0 0.2 0.0 0.0 16 100 0.0001 5e-4 Adam True 128 3 prelu BN 2 0.25 0.1 1024 0.999 2 0.1 0.1 0.0 0.0 32 100 0.0001 5e-4 Adam True P388 512 2 prelu BN 2 0.25 0.1 1024 0.999 2 0.2 0.2 0.0 0.0 16 100 0.0001 5e-4 Adam True RDT-M12K 32 5 prelu BN 2 0.75 0.1 1024 0.999 2 0.2 0.4 0.0 0.4 32 100 0.00015 0 Adam True Table 8: Hyper-parameters for pre-training method. PROTEINS DD NCI1 MUTAG NCI-H23 MOLT-4 P388 IMDB-B IMDB-M mask. 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 epochs 30 50 50 50 10 10 10 20 20 lr 0.01 0.0001 0.001 0.001 0.001 0.01 0.001 0.001 0.001 bs 32 32 16 64 32 32 32 32 32 optimizer Adam Adam Adam Adam Adam Adam Adam Adam Adam Table 9: Hyper-parameters for Prompt Tuning. 'mask.' means masking rate, 'lr' represents learning rate and 'bs' is batch size. Experimental Setup We evaluate SGL under the trans- fer learning setting as follows (Hou et al. 2022; You et al. 2020). Firstly, we pre-train the model with 2 million unla- beled molecules sampled from the ZINC15(Sterling and Ir- win 2015), and then we finetune the pre-trained models in 8 multi-label multi-class benchmark datasets contained in MoleculeNet (Wu et al. 2018) with scaffold-split. In our ex- periments, in the local branch, we will reconstruct node fea- tures and not reconstruct edge features like (Hou et al. 2022). In the global branch, we set dynamic queue size Q, tempera- ture and momentum as 4096, 0.05 and 0.999 separately. And for simplicity, we do not use additional augmentation here. For evaluation, we run experiments 10 times and report the mean and standard deviation of ROC-AUC scores(%) on 8 downstream datasets following (Hou et al. 2022; You et al. 2020). Analysis From Table 11, you can find SGL surpasses other methods and reaches SOTA performance on eight datasets. It reaches around 8% improvement on No-pretrain GIN which proves our pre-training method SGL is strong enough. And it can enhance GraphMAE a lot on many datasets (e.g., 3.5% and 2.3% gains on MUV and SIDER datasets) which further shows the effectiveness of combining contrastive and gener- ative methods. Node Classification Datasets We choose three commonly used citation datasets, i.e., Cora, CiteSeer and PubMed (Sen et al. 2008), in this part. These datasets consist of nodes representing dif- ferent papers and edges signifying citation relationships be- tween them. Each node is associated with a bag-of-words representation of the corresponding paper, and the label cor- responds to the academic topic of the paper. Further details about the dataset statistics can be found in Table 12. # graphs # binary prediction tasks Avg. # nodes ZINC 2,000,000 - 26.6 BBBP Tox21 ToxCast 7,831 2,039 12 1 18.6 24.1 8,576 617 18.8 SIDER ClinTox MUV 93,087 1,477 1,427 17 2 27 24.2 26.2 33.6 HIV 41,127 1 24.5 BACE 1,513 1 34.1 Table 10: Data statistics of datasets used for molecular property prediction. ZINC dataset is used for pre-training. No-pretrain ContextPred AttrMasking Infomax GraphCL JOAO GraphLoG GraphMAE SGL (Ours) BBBP 65.5±1.8 64.3±2.8 64.3±2.8 68.8±0.8 69.7±0.7 70.2±1.0 72.5±0.8 72.0±0.6 72.6±0.4 Tox21 74.3±0.5 75.7±0.7 76.7±0.4 75.3±0.5 73.9±0.7 75.0±0.3 75.7±0.5 75.5±0.6 76.7±0.4 ToxCast 63.3±1.5 63.9±0.6 64.2±0.5 62.7±0.4 62.4±0.6 62.9±0.5 63.5±0.7 64.1±0.3 64.3±0.2 SIDER 57.2±0.7 60.9±0.6 61.0±0.7 58.4±0.8 60.5±0.9 60.0±0.8 61.2±1.1 60.3±1.1 62.6±0.4 ClinTox 58.2±2.8 65.9±3.8 71.8±4.1 69.9±3.0 76.0±2.7 81.3±2.5 76.7±3.3 82.3±1.2 83.3±0.9 MUV 71.7±2.3 75.8±1.7 74.7±1.4 75.3±2.5 69.8±2.7 71.7±1.4 76.0±1.1 76.3±2.4 79.8±1.3 HIV 75.4±1.5 77.3±1.0 77.2±1.1 76.0±0.7 78.5±1.2 76.7±1.2 77.8±0.8 77.2±1.0 78.7±0.4 BACE 70.0±2.5 79.6±1.2 79.3±1.6 75.9±1.6 75.4±1.4 77.3±0.5 83.5±1.2 83.1±0.9 84.3±0.4 Avg. 67.0 70.4 71.1 70.3 70.8 71.9 73.4 73.8 75.3 Table 11: Results on downstream molecular property prediction benchmarks. Avg represents the average performance of each method. Dataset # N # E # F # C H Cora CiteSeer PubMed 2078 3327 19717 5278 4676 44327 1433 3703 500 7 6 3 0.81 0.74 0.80 Table 12: Details of used datasets, where we substitute N for Nodes, E for Edges, F for Features, C for Classes, H for Homophily ratio. Experimental Setup We follow the same experimental setup in GraphMAE (Hou et al. 2022). After finishing unsu- pervised pre-training, we will freeze the pre-trained model and exclusively train a linear classifier using labeled train- ing data for downstream tasks. The specific hyperparame- ters are listed in Table 13. And we report the mean accuracy with standard deviation after 20 runs. For simplicity, we only compare with GraphMAE here because it is a strong base- line. Furthermore, in this section, we assess the performance of our prompt method in a few-shot setting1. The model configuration remains consistent with the above. For stan- dard fine-tuning approaches, all parameters are fine-tuned using downstream data. In contrast, for prompt methods, pre-trained models are kept frozen, with only additional pa- rameters for the downstream task will be tuned. Analysis Table 14 shows the results of unsupervised rep- resentation learning and illustrates the consistent superiority of our SGL pre-training method across these three datasets, which proves the effectiveness of combining contrastive and 1In order to achieve prompt tuning on node classification, we will extract ego graphs for each target node and subsequently as- sign ego graph labels based on the corresponding node labels. The subsequent steps mirror the graph-level process. type hidden size num head num layer activation norm scaling factor masking rate replace rate Q momentum tempurate feat mask1 feat mask2 drop edge1 drop edge2 loss coeff. epochs learning rate weight decay optimizer scheduler Cora GAT 512 4 2 prelu BN 3 0.5 0.05 1024 0.999 2 0.0 0.1 0.1 0.5 0.1 1500 0.001 2e-4 Adam True CiteSeer GAT 512 2 2 prelu BN 3 0.5 0.1 102400 0.999 2 0.1 0.5 0.0 0.1 0.08 300 0.001 2e-5 Adam True PubMed GAT 1024 4 2 prelu BN 3 0.75 0.0 1024 0.999 2 0.3 0.3 0.2 0.2 0.1 1000 0.001 1e-5 Adam True Model Local Global Training Table 13: Hyper-parameters for pre-training method. generative methods. Moreover, our prompt tuning approach for node classi- fication also demonstrates its effectiveness, as seen in Ta- ble 15. Notably, our prompt method achieves over 3% ab- solute improvement compared to standard fine-tuning ap- proaches and over 2.4 % absolute improvement compared to another graph prompt method, GPPT, on 5-shot Cora dataset. These results show the superiority of our prompt de- sign even on node-level tasks. Cora CiteSeer PubMed GraphMAE 83.77±0.62 84.15±0.35 SGL 73.04±0.28 73.48±0.27 81.05±0.30 81.31±0.41 Table 14: The mean accuracy with standard deviation of unsupervised representation learning for node classification with 20 different random seeds. Cora PubMed 3-shot 5-shot 3-shot 5-shot GraphMAE 68.50±1.67 SGL 70.32±0.74 72.48±1.08 74.14±0.82 68.80±0.36 68.98±0.62 73.08±0.56 73.72±0.77 GPPT SGL-PT 72.14±2.64 73.84±1.89 74.80±1.76 77.26±0.98 69.52±0.80 70.08±1.71 72.50±0.93 75.50±0.90 Table 15: The mean accuracy with standard deviation of FT & PT for node classification. GPPT uses SGL as its pre- trained model in this table. Evaluating SGL-PT on Other Graph-level Datasets Due to space constraints, only partial results of prompt tun- ing are presented in the main content. In this section, ad- ditional experiments are exhibited in Table 16. The conclu- sions align with those stated in the main paper. MOLT-4 P388 1-shot 3-shot 1-shot 3-shot GraphMAE 52.80±1.85 52.67±2.31 SGL 52.90±1.64 52.75±2.80 52.45±2.92 53.96±3.37 53.39±1.41 54.66±1.53 GPPT SGL-PT 50.08±0.68 52.97±2.10 50.77±1.23 54.68±1.72 50.37±2.40 54.89±1.87 52.52±3.77 55.33±2.13 Table 16: The mean ROC-AUC with standard deviation of FT & PT for graph classification on other datasets. GPPT uses SGL as its pre-trained model in this table. Applying SGL-PT on Other Pre-trained Methods Our prompt method can also be applied to other contrastive methods, because our prompt loss is Lprompt = λprompt * Llocal +(1 − λprompt)*Lproto, by setting the coefficient λprompt as 0, our prompt aligns the objectives of pre-text and down- stream tasks (i.e., contrastive loss). To validate this asser- tion, we substitute the pre-trained model with the GraphCL model. The outcomes are detailed in Table 17. Our approach Figure 3: Sensitivity analysis of the dynamic queue Q's size. consistently outperforms standard fine-tuning by a signifi- cant margin. For instance, on 3-shot DD dataset, SGL-PT surpasses GraphCL by more than 6% absolute improvement, and on 3-shot MUTAG dataset, it shows over 12% absolute improvement. Furthermore, our prompt method achieves su- perior results compared to other graph prompt methods, un- derscoring the efficacy of our prompt design. This success also validates the adaptability of our prompt approach to other contrastive methods. DD MUTAG 1-shot 3-shot 1-shot 3-shot GraphCL⋄ GPPT⋄ GPF⋄ SGL-PT⋄ 52.30±2.51 53.39±2.87 57.92±3.43 62.39±1.53 54.11±2.09 55.66±2.20 57.15±1.53 58.31±2.40 58.30±1.26 59.49±1.25 65.46±5.02 59.43±3.40 68.58±5.49 69.51±2.56 64.07±2.38 74.47±2.32 Table 17: The mean accuracy with standard deviation of FT & PT for graph classification. ⋄ means we use GraphCL as their pre-trained models. Sensitivity Analysis Analysis on Q In the ablation study, we find that the dy- namic queue is essential to integrate contrastive and gener- ative methods better. In this section, we dig into the impact of the size Q of the dynamic queue. The results are shown in Figure 3, and we can find that the performance moves up with the increase of Q and the gets best performance when Q reaches 512 or 1024. This size is much larger than batch size (e.g., 8, 16), which shows the necessity of the dynamic queue to integrate the two branches. Analysis on λ During pre-training, the model captures both local and global information, so we set λpre as 0.5. During prompt tuning, we focus on learning class prototypes used for classification, so we lower the ra- tio of Llocal (λprompt as 0.1). Empirically, we found the performance of downstream tasks will drop with λprompt (for DD, λprompt=0.0, 0.1, 0.3, 0.5, 0.7, 0.9. increasing Acc=74.30.5, 75.40.2, 74.50.5, 73.30.5, 73.20.4, 73.00.4). So, we set λprompt as 0.1 for all datasets. D. Parameter Efficiency We compare trainable parameters with GIN, GPPT, GPF, ProG and GraphPrompt and SGL-PT in Table 18. The 'GIN' entry represents the number of parameters required to train Method GIN GPPT GPF ProG GraphPrompt SGL-PT DD Params(K) MUTAG Params(K) COLLAB Params(K) 820 258 1.10 1.87 0.50 1 10 1 0.07 0.13 0.03 0.06 296 64 1.10 4.67 0.25 0.75 Table 18: Study of parameter efficiency. a GIN model from scratch, which is significantly more than other methods. For prompt methods, we will freeze the pre- trained models and only calculate the downstream task- specific parameters. GPPT requires task tokens (used for classification) and a structure token involving attention mod- ule (used for neighbor aggregation) to accomplish down- stream tasks, resulting in significantly more trainable pa- rameters than other prompt methods. For GPF, it needs to initialize a learnable vector as well as a downstream classi- fier. For ProG, it needs to initialize a learnable prompt graph (i.e., a set of learnable vectors). For GraphPrompt, it intro- duces a learnable weighted summation readout function but needs to execute clustering to obtain class prototypes. As for SGL-PT, we only require training class prototypes for clas- sification. GraphPrompt, while having the fewest trainable parame- ters, does require additional computational time due to its clustering process for obtaining class prototypes. This step becomes increasingly time-consuming as the downstream data expands. For example, in semi-supervised settings, ex- ecuting GraphPrompt on NCI-H23 takes more than a day, while other methods complete the task in just two hours. To conclude, while GraphPrompt has fewer trainable pa- rameters than SGL-PT, the efficiency and effectiveness of SGL-PT surpass GraphPrompt.
http://arxiv.org/abs/2302.12448v1
2023-02-24T04:29:44
2023-02-24T04:29:44
Subspace based Federated Unlearning
Federated learning (FL) enables multiple clients to train a machine learning model collaboratively without exchanging their local data. Federated unlearning is an inverse FL process that aims to remove a specified target client's contribution in FL to satisfy the user's right to be forgotten. Most existing federated unlearning algorithms require the server to store the history of the parameter updates, which is not applicable in scenarios where the server storage resource is constrained. In this paper, we propose a simple-yet-effective subspace based federated unlearning method, dubbed SFU, that lets the global model perform gradient ascent in the orthogonal space of input gradient spaces formed by other clients to eliminate the target client's contribution without requiring additional storage. Specifically, the server first collects the gradients generated from the target client after performing gradient ascent, and the input representation matrix is computed locally by the remaining clients. We also design a differential privacy method to protect the privacy of the representation matrix. Then the server merges those representation matrices to get the input gradient subspace and updates the global model in the orthogonal subspace of the input gradient subspace to complete the forgetting task with minimal model performance degradation. Experiments on MNIST, CIFAR10, and CIFAR100 show that SFU outperforms several state-of-the-art (SOTA) federated unlearning algorithms by a large margin in various settings.
[ "Guanghao Li", "Li Shen", "Yan Sun", "Yue Hu", "Han Hu", "Dacheng Tao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12448v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12448v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CR", "cs.DC", "math.OC" ]
Subspace based Federated Unlearning Guanghao Li 1 Li Shen 2 Yan Sun 3 Yue Hu 1 Han Hu 4 Dacheng Tao 2 3 3 2 0 2 b e F 4 2 ] G L . s c [ 1 v 8 4 4 2 1 . 2 0 3 2 : v i X r a Abstract Federated learning (FL) enables multiple clients to train a machine learning model collaboratively without exchanging their local data. Federated unlearning is an inverse FL process that aims to remove a specified target client's contribution in FL to satisfy the user's right to be forgotten. Most existing federated unlearning algorithms require the server to store the history of the parameter up- dates, which is not applicable in scenarios where the server storage resource is constrained. In this paper, we propose a simple-yet-effective subspace based federated unlearning method, dubbed SFU, that lets the global model perform gradient ascent in the orthogonal space of input gradient spaces formed by other clients to eliminate the target client's contribution without requiring additional storage. Specifically, the server first collects the gradients generated from the target client after per- forming gradient ascent, and the input represen- tation matrix is computed locally by the remain- ing clients. We also design a differential privacy method to protect the privacy of the representation matrix. Then the server merges those representa- tion matrices to get the input gradient subspace and updates the global model in the orthogonal subspace of the input gradient subspace to com- plete the forgetting task with minimal model per- formance degradation. Experiments on MNIST, CIFAR10, and CIFAR100 show that SFU outper- forms several state-of-the-art (SOTA) federated unlearning algorithms by a large margin in various settings. 1. Introduction The traditional training approach of deep learning usually brings together data from various participants. However, 1National University of Defense Technology, China 2JD Ex- plore Academy, China 3The University of Sydney, Australia 4Beijing Institute of Technology, China. Correspondence to: Li Shen <[email protected]>. Preliminary work. Copyright 2023 by the author(s). some data, e.g., medical records (Liu et al., 2017), cannot be moved from the hospital due to data privacy and personal- will concerns. Federated learning (FL) (McMahan et al., 2017) is one of the most popular decentralized machine learning methods to solve the above problems. It trains a global model by transmitting the model parameters be- tween clients and the server, which obviates the need of transferring the underlying data (Li et al., 2022a; 2020a;b). Recent privacy legislations (Bussche, 2017; Pardau, 2018; Shastri et al., 2019) provide data owners the right to be forgotten. In the machine learning context, the right to be forgotten requires that (i) the user data is deleted from the entity storing it and (ii) the influence of the data on the model is removed (Halimi et al., 2022). Federated unlearn- ing is the embodiment of the user's right to be forgotten in the FL scenario, where the goal is to remove the contribu- tion of specific clients' data from the global model while maintaining the model's accuracy. Three challenges in FL make the traditional machine unlearning approach unsuit- able for federated unlearning: (1) Limited Access to the dataset: The server in FL cannot directly access all data and perform related operations, which makes forgetting tech- niques that rely on dataset segmentation cannot be applied to FL scenarios. (2) Model aggregation: The initial model of each client in each training round depends on the model aggregation of the clients that participated in the training in the previous round. Removing the contribution of a client will affect the model aggregation and affect the subsequent training of other clients (Nasr et al., 2018; Melis et al., 2019; Song et al., 2020). (3) Client selection: Since not all clients can participate in the training process in each round, the contribution of each client to the global model is not contin- uous, and the contribution can only be made when the client is selected. There has been some current work on federated unlearning. To remove the contribution of a specific target client in the final global model, a naive idea is to retrain the model on the remaining clients after removing the target one (Bourtoule et al., 2021). However, some clients may only have lim- ited storage, and they may delete data at any time after the training process. It will make even the most naive way of re- training the model from scratch impractical since the client may not have the same data as that used in the training time. Another idea in federated unlearning is to store the client's Subspace based Federated Unlearning historical updated gradient data in the server and use it to roll back the trained global model (Wu et al., 2022). The above unlearning methods all require the client or server to retain some additional data or gradient information, which is not possible in FL scenarios with limited storage resources. In each FL training round, local training of each client is a process that reduces the empirical loss (Rumelhart et al., 1986). We argue that unlearning can be formulated as the inverse process of learning, in the sense that the gradient ascent on the target client can realize the forgetting of the client data. However, the loss is unbounded and we need to limit the gradient of training to ensure the quality of the model after unlearning (Chen & Wainwright, 2015). The whole process can be regarded as a constraint-solving problem to maximize the empirical loss of the target client within the constraints of the model performance. In this paper, we propose a Subspace-based Federated Unlearning method, dubbed SFU. SFU restricts the gradient of the target client's gradient ascent to the orthogonal space of the input space of the remaining clients to remove the target client's contribution from the final trained global model. In SFU, the server only needs the gradient information provided by the target client and the representation matrix information provided by other clients, without directly accessing the original data of each client. On the other hand, SFU can be used for models in any training phase without considering the specific details of model training and model aggregation. At the same time, SFU does not require the client or server to store additional historical gradient information or data. Specifically, SFU participants can be divided into three kinds of roles: the target client to be forgotten, the remain- ing clients, and the server. In SFU, the target client performs gradient ascent locally based on the global model and sends the gradient to the server; each remaining client selects a cer- tain amount of local data to build a representation matrix and send it to the server; the server receives the representation matrix from each client and merges it to obtain the input sub- space with Singular Value Decomposition (SVD) (Hoecker & Kartvelishvili, 1996); the server finally projects the gra- dient of the target client into the orthogonal subspace of the input space and updates the global model with it. In addition, we design a differential privacy method to protect the privacy of clients in the process of sending the represen- tation matrices (Li et al., 2021; Truex et al., 2019). It needs each client to add random perturbation factors to each vec- tor of the representation matrix to prevent possible privacy leaks and those perturbation factors have no effect on the input space search and the final model. Empirical results show that SFU beats other SOTA baselines with 1%-10% improvement in test sets. In the end, we summarize the main contributions as follows: • We first introduce subspace learning to federated un- learning and propose a new federated unlearning al- gorithm called SFU, which trains the global model by gradient ascent in an orthogonal subspace perpendicu- lar to the input space of the remaining clients to achieve the forgetting goal without large performance loss and additional storage costs. • We design a differential privacy method to prevent the possible privacy leakage caused by the transmission of the client representation matrix during the process of unlearning. This method adds random perturbation factors to each vector of the representation matrix but does not affect the unlearning process. • We conduct extensive experiments to evaluate the ef- fectiveness of SFU, which significantly outperforms several SOTA baselines on various datasets including MNIST, CIFAR10, and CIFAR100. 2. Related Work Machine unlearning. The term "machine unlearning" is a process to forget a piece of training data completely which needs to revert the effects of the data on the extracted fea- tures and models. Machine unlearning is first proposed by Cao & Yang (2015), and they transform the statistical query learning into a summation form and achieve unlearning by updating a small part of the summation. However, this algorithm only works for those transformable traditional machine learning methods, machine unlearning for different ML models has been explored. Ginart et al. (2019) formu- late the problem and the concept of effective data deletion in machine learning. They also propose two efficient deletion solutions for the K-means clustering algorithm. Izzo et al. (2021) focus on supervised linear regression and propose an approximate data deletion method called projective residual update (PRU) for linear and logistic models. The compu- tational cost of PRU is linear in the feature dimension, but PRU is not applicable for more complex models such as neural networks. Baumhauer et al. (2022) introduce the more general framework SISA to reduce the computational overhead associated with forgetting. The main idea of SISA is to split the training data into several disjoint fragments, each of which trains a sub-model. To remove a specific sample, the algorithm simply retrains the sub-model that is learned from this sample. However, existing machine learning works focus on ML models in traditional central- ized settings, where training data is assumed to be globally accessible, which is not suitable for learning in FL settings. Federated unlearning. Compared with centralized learn- ing, there are few works on unlearning in FL. Liu et al. (2021) first introduce unlearning into the field of FL and propose FedEraser. The main idea is to adjust the historical parameter updates of federated clients through the retrain- Subspace based Federated Unlearning ing process in FL and reconstruct the unlearning model. However, this process requires additional communication between the client and the server. Recently, Wu et al. (2022) develop a forgetting approach that removes historical pa- rameter updates from the target client and recovers model performance through a knowledge distillation process. Both of these steps require the server to keep a history of all client updates. In addition, the knowledge distillation approach requires the server to have some additional unlabeled data. In some application scenarios, meeting these requirements may not be a matter of course. In contrast, our method does not need the server to store historical updates or additional unlabeled data and has better privacy. Our method mainly solves the case where a client (referred to as the target client) wants to remove its contribution from the global model. We let the global model perform gradient ascent in the orthog- onal subspace of the input space of remaining clients to achieve federated unlearning. Different from these works (and the one we propose), Wang et al. (2022) propose a for- getting framework for forgetting a specific class or category in FL. Our approach is closely related to the federated unlearning approach recently proposed by Halimi et al. (2022). They formulate the unlearning problem as a constrained maxi- mization problem by restricting to an (cid:96)2-norm ball around a suitably chosen reference model and allowed the target client to perform the unlearning by using the Projected Gra- dient Descent (PGD) algorithm (Thudi et al., 2022). How- ever, (cid:96)2-norm ball can not provide an effective guarantee for the performance of the model after unlearning. We add con- straints on the performance of the unlearning model. Our method restricts the gradient ascent to a subspace orthogo- nal to the input space of other clients, and this constrained gradient update has minimal impact on the performance of the model on other clients. We will quantitatively show that our method has a performance guarantee. 3. Methodology We propose a novel federated unlearning method, as shown in Algorithm 1, that can eliminate the client's contribution and vastly reduce the unlearning cost in the FL system. This method does not require the server to keep the history of parameter updates from each client or additional training. The key idea is to use the restricted gradient information of the target client to modify the final trained model. 3.1. Problem Setup Algorithm 1 Subspace-based Federated Unlearning (SFU) 1: Input: The number of samples in each client p, the global model w, local dataset Di of client i, random factors λl i for layer l in client i. 2: Target client CI : 3: gi ← −η(cid:96)i(w; (x, y)); 4: Send gi to the server; 5: Other clients: 6: Representation matrix for layer l in client i: Rl i = ixl 2, ..., λl ixl p]; i to the server; 1, λl ixl [λl 7: Send Rl 8: server: 9: Rl = [Rl N ]; 10: Performing SVD on Rl = U lΣl(V l)T ; 11: Sl = span{ul 1,1, ul ̃gCI = proj(gCI , S); 12: 13: w = w − (gCI − ̃gCI ) CI +1..., Rl CI +1, Rl 2,1, ..., ul 1, ..., Rl k,1}; model w over the dataset D (cid:44) (cid:83) i∈[N ] Di : arg min w L(w) = N (cid:88) i=1 |Di| |D| Li(w), w∗ = arg min L(w), (1) (2) w where Li(w) = E(x,y)∼Di[(cid:96)i(w; (x, y))] is the empirical loss of Ci and during federated training, each client min- imizes their empirical risk Li(w), w∗ is the final model trained by the FL process. Now we consider how to forget the contribution of the tar- get client CI . A natural idea is to increase the empirical risk LCI (w) of the target client CI , which is equivalent to reversing the learning process. However, simply maximiz- ing the loss can influence the effect of the model on other clients. Federated unlearning needs to forget the contribu- tion of the target client CI while ensuring the overall model performance. Thus, the objective of federated unlearning is defined below: arg max w Li(w) = E(x,y)∼Di [(cid:96)i(w; (x, y))] s.t. Lul(w) − Lul(w∗) ≤ δ (3) where δ is a small change in the empirical loss, Lul() is the empirical loss of the FL system after removing the target client. Suppose that there are N clients, denoted as C1, ..., CN , respectively. Client Ci has a local dataset Di. The goal of traditional FL is to collaboratively learn a machine learning Lul(w) = (cid:88) i∈[N \CI ] |Di| |Dun| Li(w), (4) where Dun (cid:44) (cid:83) removing the target client. i∈[N \CI ] Di is the remaining data set after 3.2. Unlearning Metrics output y: Subspace based Federated Unlearning Comparing the difference between the unlearned model and the retrained model is one of the criteria used to measure the effect of unlearning. Common dissimilarity metrics include model test accuracy difference (Bourtoule et al., 2021), (cid:96)2- distance (Wu et al., 2020) or, and Kullback-Leibler (KL) divergence (Sekhari et al., 2021). However, in the FL sce- nario, it is difficult to intuitively indicate whether the con- tribution of a given client can be removed from the evalua- tion method based on model differences. Other metrics in- clude privacy leakage in the differential privacy framework (Sekhari et al., 2021) and membership inference attacks (Graves et al., 2021; Baumhauer et al., 2022). In this paper, we use the backdoor triggers (Gu et al., 2017) as an effec- tive way to evaluate the performance of unlearning methods, similar to Wu et al. (2022). In particular, the target client uses a dataset with a certain fraction of images that have a backdoor trigger inserted in them. Thus, the global FL model becomes susceptible to the backdoor trigger. Then, a successful unlearning process should produce a model that reduces the accuracy of the images with the backdoor trig- ger, while maintaining good performance on regular (clean) images. Note that we use the backdoor triggers as a way to evaluate the performance of unlearning methods; we do not consider any malicious client (Xie et al., 2020; Bagdasaryan et al., 2020; Fung et al., 2020) 3.3. Subspace-based Federated Unlearning (SFU) We introduce a novel Subspace-based federated unlearning framework, named SFU. The main insight of the SFU is that we constrain the gradients generated by the target client's gradient ascent to the input subspace of the other clients to remove the contribution of the target client from the global model. As shown in Fig. 1, SFU participants can be divided into three kinds of roles: the target client to be forgotten, the remaining clients, and the server. The target client performs gradient ascent to upload the gradient to the server. Other clients compute the local representation matrix and upload it to the server. The server is responsible for the computation of other client input Spaces and the unlearning update of the global model. Next, we will introduce the specific tasks of the three participants respectively. 3.3.1. GRADIENT ASCENT ON THE TARGET CLIENT To find a model with a large empirical loss in target client CI , we can simply make several local passes of (mini-batch stochastic) gradient ascent in client CI and add these gra- dient updates to the global model. In order to satisfy the constraints of Eq. (3), we need to consider a more reason- able way to add the updated gradient of client CI to the global model (Zhou et al., 2020; Qian et al., 2015). W x = y1. When this model accepts a gradient update ∆w, the output becomes: (5) (W + ∆w)x = y2. (6) The difference between the two outputs is: ∆y = y2 − y1 = (W + ∆w)x − W x = ∆wx. (7) When ∆y is 0, the difference between the two outputs is minimized, which requires the updated gradient ∆w to be perpendicular to the original input gradient subspace x. Therefore, we can project the updated gradient of the target client CI into the orthogonal space of the gradient subspace of Dun to minimize the degradation of the glob model performance (Farajtabar et al., 2020). 3.3.2. COMPUTATION OF REPRESENTATION MATRIX We first need to consider how to represent the input space in Dun, the data of other clients. For an individual network, we construct the gradient subspace by the following two steps: • For each layer l of the network, We first construct a representation matrix, Rl = [xl ] concate- nating ns representations along the column obtained from forward pass of ns random samples from the current training dataset through the network. 2, ..., xl ns 1, xl • Next, we perform SVD on Rl = U lΣl(V l)T fol- 1)k according to lowed by its k-rank approximation (Rl the following criteria for the given coefficient, (cid:15)l : ||(Rl))k||2 F ≥ (cid:15)l||Rl||2 F . (8) 2,1, ..., ul 1,1, ul Sl = span{ul k,1}, spanned by the first k vectors in U l 1 as the space of significant represen- tation at layer l since it contains all the directions with highest singular values in the representation (Saha et al., 2021). For FL scenarios, we need the data on each client to seek the gradient subspace of the Dun. First, all clients excluding the target client CI select the same number of representations matrix of local samples for each layer Rl i and send them to the central server to construct the representation matrix. To protect the privacy of the representation matrix, we de- sign a differential privacy algorithm. We add random factors λl i to the representation of layer l from client i to avoid leak- ing data information about the client data and it does not affect the search process of the subspace because of the nature of the orthogonal matrix.In Eq. (7), if Given a neural network W and an input x we can obtain an ∆wx = 0, (9) Subspace based Federated Unlearning • Step 3. The server perform SVD on the set of repre- sentation R to get the set of input gradient subspace S, project gCI onto S and removes the contribution of the target client CI by updating the global model w as Eq. 11. In the end, we give several comments on the proposed SFU algorithm. Note that subspace learning has been commonly used to solve continual learning (Saha et al., 2021), meta learning (Jiang et al., 2022), adversarial training (Li et al., 2022c), and fast training of deep learning models (Li et al., 2022b). However, SFU is the first work to use the orthogonal space of input gradient space for federated unlearning. In addition, SFU needs to seek subspace from dispersed stored data and should consider the privacy leakage risk. 4. Experiments In this section, we empirically evaluate the effectiveness of SFU using different model architectures on three datasets. We divide the unlearning process into two parts: the re- moval of specific client contributions and the recovery of model performance. The experimental results show that our unlearning strategies can effectively remove the con- tribution of the target client from the global model with low-performance loss and can quickly recover the accuracy of the model in a few rounds of training. We first intro- duce the experimental setup and then present the evaluation results. 4.1. Experimental Setup Datasets: We evaluate SFU using three popular datasets: MNIST(Xiao et al., 2017), CIFAR10, and CI- FAR100 (Krizhevsky et al., 2009) as described below: • MNIST: It is a dataset that contains a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28×28 grayscale image associated with a label from 10 classes. • CIFAR10: It consists of 60,000 32 × 32 color images in 10 classes, with 6000 images per class. There are 50,000 training images and 10,000 test images. • CIFAR100: It has 100 classes. Each class has 600 color images of size 32 × 32, of which 5000 are used as a training set, and 100 are used as a test set. The training difficulty of the dataset is increasing from MNIST, CIFAR10 to CIFAR100. We adopt two data dis- tribution Settings, including IID (Independent-Identically- Distributed) as well as Non-IID (Non Independent- Identically-Distributed). The Non-IID setting that we adopt is Dirichlet(β): Label distribution on each device follows the Figure 1: The pipeline of the SFU.The whole process takes place after the FL model has been trained. The orange client represents the target client whose contribution is to be removed; The blue ones represent other clients. The boxes on the right of the image represent global model updates that happen on the server. we have ∆w(λx) = 0. (10) The final set of representation matrix in the server is R = (cid:8)R1, R2, ..., RL(cid:9), and Rl = [λl ]. 2xl 2, ..., λl 1,1, λl 1xl N xl ns 3.3.3. UPDATE OF THE GLOBAL MODEL ON THE SERVER After several local passes of (mini-batch stochastic) gradient ascent, client CI sends the updated gradient gCI to the server. The server performs the update of the global model w after collecting the set of representation matrix R and the gradient gCI . The server first perform SVD (Rumelhart et al., 1986) on R to get the set of input gradient subspace S = (cid:8)S1, S2, ..., SL(cid:9). To achieve the goal of Equation 3, we need to project gCI onto S and get projection ̃gCI . gCI − ̃gCI orthogonal to R and the server update the global model w with gCI − ̃gCI : w = w − (gCI − ̃gCI ). (11) The updated model w removes the contribution of the target client CI and maintains a similar performance to the original global model. After a global model is trained, a complete SFU training process mainly includes three steps as shown in Fig.1: • Step 1. Besides target client CI , each client selects the same number of samples to calculate the representation matrix R1 for each layerl of the network and sends it to the server after adding random factors λl i. • Step 2. The target client CI performs several local passes of gradient ascent locally and sends the updated gradient to the server. Client 1Client CIClient N(target client). . .. . .ServerMatrix R1Gradient gCIMatrix R2Representation matrixgCIgCI - gCIgci~Gradient Subspace1123~ Subspace based Federated Unlearning Table 1: Accuracy results after unlearning (IID). Dataset MNIST CIFAR10 CIFAR100 Dataset MNIST CIFAR10 CIFAR100 network MLP CNN MLP CNN ResNet MLP CNN ResNet network MLP CNN MLP CNN ResNet MLP CNN ResNet FedAvg UL GA SFU test acc 97.73 99.31 49.15 72.83 76.12 18.86 37.47 39.68 atk acc 93.26 91.29 89.66 99.36 98.27 9.93 97.77 90.38 test acc 77.19 42.36 26.17 18.75 43.75 2.24 2.51 7.38 atk acc 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 test acc 96.80 92.33 48.61 57.48 73.58 13.42 20.12 37.63 atk acc 0.0 19.28 0.01 0.37 65.98 0.00 1.41 6.73 test acc 97.66 99.29 49.08 57.75 44.60 18.70 36.31 26.84 atk acc 0.15 0.21 0.0 0.0 0.0 0.0 0.0 0.0 Table 2: Accuracy results after retraining (IID). Retraining test acc 97.88 99.48 48.77 74.86 76.95 18.47 38.25 40.15 atk acc 0.0 11.55 0.00 0.00 7.23 0.0 0.0 0.81 UL-Distillation test acc 97.88 99.20 47.83 72.33 77.47 9.43 27.05 38.43 atk acc 0.0 0.31 0.0 0.51 9.68 0.0 0.0 0.79 GA-retraining test acc 97.05 99.34 48.09 72.43 77.19 18.81 37.08 38.11 atk acc 9.30 37.13 20.36 26.47 81.06 2.46 51.36 61.91 SFU-retraining test acc 97.91 99.37 48.81 72.87 76.84 18.46 37.81 40.93 atk acc 0.28 12.63 0.10 2.18 3.12 0.0 14.39 0.92 Dirichlet distribution, where β is a concentration parameter (β > 0). connected layers with 800 and 500 neurons and a Relu layer. Baselines. We chose three typical federated unlearning algorithms as our baseline: (1) Retraining: This method retrains the entire FL system without the target client being forgotten, which is an effec- tive but computationally and communicationally expensive algorithm; (2) "UL" Wu et al. (2022): This method forgets the target client by subtracting historical parameter updates of the target client from the global model. Then, "UL" uses the knowledge distillation method to remedy the skew of the unlearning model caused by the subtraction without using any data from the target clients. (3) "GA": GA uses gradient ascent information on the target client to update the global model. Gradient ascent makes the loss of the model increase, which is the inverse pro- cess of learning and can achieve unlearning. However, the loss of gradient ascent is unbounded so we set the gradient clip norm when the global model is updated to reduce the probability of producing a random model. Models. We employ three neural network architectures in our experiments. • MLP: This is a fully-connected neural network archi- tecture with 2 hidden layers. The number of neurons in the layers is 200 and 100, respectively. • CNN: This network architecture consists of 2 convolu- tional layers with 64 5 × 5 filters followed by 2 fully • ResNet: we use a smaller version of ResNet18 (He et al., 2016), with three times fewer feature maps across all layers. We used two networks MLP and CNN for the MNIST dataset, while we used the above three network structures for the CIFAR10 and CIFAR100 datasets. We use Py- Torch (Oord et al., 2018) to implement those models. Evaluation metric. We use backdoor attacks in the target client's updates to the global model as described before, so that we can intuitively investigate the unlearning effect based on the attack success rate of the unlearned global model. In Tab. 1 and Tab. 2, we record the attack success rate as "atk acc". A lower "atk acc" represents a cleaner contribution removal from the target client. In our exper- iments, we implement the backdoor attack using a "pixel pattern" trigger of size 2 × 2 and change the label to "9". Because of the prediction error of the model, We can con- sider an error rate of less than 10% as successful forgetting of the target client contribution. We also use the accuracy metric on the clean test data to measure the performance of the model after unlearning which is denoted "test acc" in Tab. 1 and Tab. 2. A high accuracy indicates that un- learning has little impact on the performance of the model. Current unlearning methods usually adopt certain methods to recover the model accuracy after unlearning, so we divide our evaluation of the unlearning approach into two respects: the removal of specific client contributions and the recovery of model performance. Subspace based Federated Unlearning (a) MNIST (b) CIFAR10 Figure 2: Model accuracy after execution of SFU and other baselines at various stages of FL model training. (c) CIFAR100 (a) MNIST (b) CIFAR10 Figure 3: Model accuracy after execution of SFU and other baselines under different degrees of data heterogeneity. The original global model is obtained by training with 10 clients, including one target client. (c) CIFAR100 Implementation details. We consider two scenarios: (i) We have ten clients with one target client, and all clients participate fully during each training round. (ii) We have 100 clients with one target client and only 10% of the clients participate during each training round. In the experiment of removal of specific client contributions, We conduct un- learning experiments on the FL model after 100 rounds of training; In the experiment of recovery of model perfor- mance, We start FL training with the stochastic model for full retraining. we start FL training on the unlearned local model without the involvement of the target client for SFU and GA. We use the knowledge of the public data on the server for distillation learning to recover the model accuracy for UL. Tab. 2 and Tab. 1 only show the results of scenario (i). Results of scenario (ii) and other implementation details are shown in Appendix A due to limited space. 4.2. Results of Contribution Removal We conducted extensive experiments to determine the ad- vantage of SFU in removing the contribution of a specific client in the global model. In addition, we demonstrate the robustness and superiority of SFU in different training degrees of the model and different data heterogeneity. All results are reported based on the global model after perform- ing unlearning. The results show that SFU can effectively remove the contribution of target clients under the premise of ensuring model accuracy, and has strong robustness to data heterogeneity and the training degree of the model. Efficient forgetting by SFU. Tab. 1 reports the unlearn- ing effects of SFU and the other baselines on different IID datasets and model architectures. The results show that SFU can efficiently complete the contribution removal of target clients. We observe that SFU successfully eliminates the contribution of target customers and achieves low precision for backdoor data. For example, SFU can reduce the back- door attack success rate to or close to 0% in all datasets. Other baselines also can achieve similar results. This shows that the current unlearning methods can effectively remove the contribution of the target client. High model accuracy for SFU. The results in Tab. 1 also report the accuracy of the model on the clean test set data after unlearning for each baseline. The results show that SFU achieves the best results on various datasets and dif- ferent model architectures. However, the UL method will cause great damage to the performance of the model, and the direct gradient ascent has a large probability of producing a low-accuracy model. For example, on the CNN architecture of the MNIST dataset, the accuracy of the UL model is only 42.76%, which is 56.55% lower than the accuracy of the original FL model 99.31%. The accuracy of the model gen- erated by GA is 92.33%, which is 7% lower than the 99.29% accuracy of the model generated by SFU, which indicates that restricting the gradient in the orthogonal subspace of the input space can reduce the loss of the original model Subspace based Federated Unlearning (a) MNIST (b) CIFAR10 Figure 4: Convergence plots for SFU and other baselines in different datasets with CNN. (c) CIFAR100 performance. Robustness of the original model maturity. Federated un- learning can occur at any stage of FL, so it is possible that the model does not converge when federated unlearning is performed. We define the maturity of the model in terms of the number of rounds of model training, where the more rounds the model is trained, the more mature it is. Fig. 2 reports the effect of each baseline with unlearning at differ- ent rounds of the FL model training. The results show that SFU can ensure the performance of the model to the greatest extent at any round of model training, and the accuracy of SFU is similar to that of FL model training. UL is easy to remove in the early stage of model training. However, as the model continues to train, the integration degree of each client model increases, simply subtracting the historical weight of the client is easy to cause a significant decline in the accuracy of the model. For example, the UL accuracy in the MNIST dataset dropped from 97% to 66% as the model trained. GA has similar results to SFU, but still has lower accuracy than SFU, which indicates that SFU is robust to the original model maturity. Robustness on heterogeneous data. We test different un- learning algorithms on MNIST datasets with different de- grees of heterogeneity, and ten clients are selected to form the FL system. Fig. 3 shows that enhancing data distribution heterogeneity will reduce the effect of various unlearning algorithms. It is because the aggregation of the global model becomes more complex with the increase of model hetero- geneity, which makes it more challenging to separate the contributions of specific clients under the premise of ensur- ing model accuracy. However, the accuracy of SFU is close to that of the original FL model and the retrained model in all Settings, which indicates that SFU is robust to data heterogeneity. 4.3. Results of Model Accuracy Recovery Below, we report the accuracy of the final model and the recovery efficiency of different methods. All results are reported based on the global model after unlearning. High final accuracy of the SFU. Tab. 2 reports the model performance of each algorithm after 10 rounds of accuracy recovery training and after 100 rounds of full retraining. We find that almost all methods can achieve a low success rate of backdoor attacks except for GA. The reason why GA has a high success rate of backdoor attacks is that the algorithm after unlearning is still near the original model, and it is easy to converge to the original model with high accuracy and a high success rate of backdoor attacks. The final accuracy of SFU is the highest among all the methods, and sometimes it can even exceed the accuracy of retraining, which proves that updating in the subspace will produce a better-initialized model to achieve higher accuracy. High-speed precision recovery for SFU. To compare the model accuracy recovery speed of SFU with each baseline, we calculate the accuracy and backdoor attack success rate of different methods in terms of the number of FL training rounds after unlearning, and the results are shown in Fig. 4. We observe that SFU is able to achieve high accuracy after one round of training, while other methods require 5 or even more rounds of training to achieve. SFU is more efficient in terms of computation and communication cost on the retained clients than the baseline of retraining while achieving comparable backdoor accuracy. 5. Conclusion In this paper, we propose a novel federated unlearning ap- proach that can successfully eliminate the contribution of a specified client to the global model, which also can min- imize the model accuracy loss by performing a gradient ascent process within the subspace at any stage of model training. Our approach only relies on the target client to be forgotten from the federation without the server or any other client keeping track of its history of parameter updates. Our method also provides a differential privacy method to protect the representation matrix information during train- ing. We have used a backdoor attack to effectively evaluate the performance of the proposed method. Our experimental results demonstrate the efficiency and effectiveness of SFU. Subspace based Federated Unlearning References Bagdasaryan, E., Veit, A., Hua, Y., Estrin, D., and Shmatikov, V. How to backdoor federated learning. In International Conference on Artificial Intelligence and Statistics, pp. 2938–2948. PMLR, 2020. Baumhauer, T., Sch ̈ottle, P., and Zeppelzauer, M. Machine unlearning: Linear filtration for logit-based classifiers. Machine Learning, 111(9):3203–3226, 2022. Bourtoule, L., Chandrasekaran, V., Choquette-Choo, C. A., Jia, H., Travers, A., Zhang, B., Lie, D., and Papernot, N. Machine unlearning. In 2021 IEEE Symposium on Security and Privacy (SP), pp. 141–159. IEEE, 2021. Bussche, A. The EU General Data Protection Regulation (GDPR): A Practical Guide. Springer, 2017. Cao, Y. and Yang, J. Towards making systems forget with machine unlearning. In 2015 IEEE Symposium on Secu- rity and Privacy, pp. 463–480. IEEE, 2015. Chen, Y. and Wainwright, M. J. Fast low-rank estimation by projected gradient descent: General statistical and algorithmic guarantees. arXiv preprint arXiv:1509.03025, 2015. Farajtabar, M., Azizan, N., Mott, A., and Li, A. Orthogonal gradient descent for continual learning. In International Conference on Artificial Intelligence and Statistics, pp. 3762–3773. PMLR, 2020. Hoecker, A. and Kartvelishvili, V. Svd approach to data unfolding. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detec- tors and Associated Equipment, 372(3):469–481, 1996. Izzo, Z., Smart, M. A., Chaudhuri, K., and Zou, J. Approx- imate data deletion from machine learning models. In International Conference on Artificial Intelligence and Statistics, pp. 2008–2016. PMLR, 2021. Jiang, W., Kwok, J., and Zhang, Y. Subspace learning for effective meta-learning. In International Conference on Machine Learning, pp. 10177–10194. PMLR, 2022. Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009. Li, G., Hu, Y., Zhang, M., Liu, J., Yin, Q., Peng, Y., and Dou, D. Fedhisyn: A hierarchical synchronous federated learning framework for resource and data heterogeneity. In Proceedings of the 51st International Conference on Parallel Processing, pp. 1–11, 2022a. Li, L., Fan, Y., Tse, M., and Lin, K.-Y. A review of appli- cations in federated learning. Computers & Industrial Engineering, 149:106854, 2020a. Li, Q., Wen, Z., Wu, Z., Hu, S., Wang, N., Li, Y., Liu, X., and He, B. A survey on federated learning systems: vision, hype and reality for data privacy and protection. IEEE Transactions on Knowledge and Data Engineering, 2021. Fung, C., Yoon, C. J., and Beschastnikh, I. The limitations of federated learning in sybil settings. In RAID, pp. 301– 316, 2020. Li, T., Sahu, A. K., Talwalkar, A., and Smith, V. Feder- ated learning: Challenges, methods, and future directions. IEEE signal processing magazine, 37(3):50–60, 2020b. Ginart, A., Guan, M., Valiant, G., and Zou, J. Y. Making ai forget you: Data deletion in machine learning. Advances in neural information processing systems, 32, 2019. Graves, L., Nagisetty, V., and Ganesh, V. Amnesiac ma- chine learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 11516–11524, 2021. Gu, T., Dolan-Gavitt, B., and Garg, S. Badnets: Identify- ing vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017. Halimi, A., Kadhe, S., Rawat, A., and Baracaldo, N. Fed- erated unlearning: How to efficiently erase a client in fl? arXiv preprint arXiv:2207.05521, 2022. He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learn- ing for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Li, T., Tan, L., Huang, Z., Tao, Q., Liu, Y., and Huang, X. Low dimensional trajectory hypothesis is true: Dnns can be trained in tiny subspaces. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022b. Li, T., Wu, Y., Chen, S., Fang, K., and Huang, X. Subspace adversarial training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13409–13418, 2022c. Liu, G., Ma, X., Yang, Y., Wang, C., and Liu, J. Fed- eraser: Enabling efficient client-level data removal from federated learning models. In 2021 IEEE/ACM 29th In- ternational Symposium on Quality of Service (IWQOS), pp. 1–10. IEEE, 2021. Liu, Y., Gadepalli, K., Norouzi, M., Dahl, G. E., Kohlberger, T., Boyko, A., Venugopalan, S., Timofeev, A., Nelson, P. Q., Corrado, G. S., et al. Detecting cancer metas- tases on gigapixel pathology images. arXiv preprint arXiv:1703.02442, 2017. Subspace based Federated Unlearning Truex, S., Baracaldo, N., Anwar, A., Steinke, T., Ludwig, H., Zhang, R., and Zhou, Y. A hybrid approach to privacy- preserving federated learning. In Proceedings of the 12th ACM workshop on artificial intelligence and security, pp. 1–11, 2019. Wang, J., Guo, S., Xie, X., and Qi, H. Federated unlearning via class-discriminative pruning. In Proceedings of the ACM Web Conference 2022, pp. 622–632, 2022. Wu, C., Zhu, S., and Mitra, P. Federated unlearning with knowledge distillation. arXiv preprint arXiv:2201.09441, 2022. Wu, Y., Dobriban, E., and Davidson, S. Deltagrad: Rapid re- training of machine learning models. In International Conference on Machine Learning, pp. 10355–10366. PMLR, 2020. Xiao, H., Rasul, K., and Vollgraf, R. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. Xie, C., Huang, K., Chen, P.-Y., and Li, B. Dba: Distributed backdoor attacks against federated learning. In Interna- tional conference on learning representations, 2020. Zhou, Y., Wu, Z. S., and Banerjee, A. Bypassing the ambient dimension: Private sgd with gradient subspace identifica- tion. arXiv preprint arXiv:2007.03813, 2020. McMahan, B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. Communication-efficient learning of deep networks from decentralized data. In Artificial intelli- gence and statistics, pp. 1273–1282. PMLR, 2017. Melis, L., Song, C., De Cristofaro, E., and Shmatikov, V. Exploiting unintended feature leakage in collaborative learning. In 2019 IEEE symposium on security and pri- vacy (SP), pp. 691–706. IEEE, 2019. Nasr, M., Shokri, R., and Houmansadr, A. Comprehensive privacy analysis of deep learning. In Proceedings of the 2019 IEEE Symposium on Security and Privacy (SP), pp. 1–15, 2018. Oord, A. v. d., Li, Y., and Vinyals, O. Representation learn- ing with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. Pardau, S. L. The california consumer privacy act: Towards a european-style privacy regime in the united states. J. Tech. L. & Pol'y, 23:68, 2018. Qian, Q., Jin, R., Yi, J., Zhang, L., and Zhu, S. Efficient distance metric learning by adaptive sampling and mini- batch stochastic gradient descent (sgd). Machine Learn- ing, 99:353–372, 2015. Rumelhart, D. E., Hinton, G. E., and Williams, R. J. Learn- ing representations by back-propagating errors. nature, 323(6088):533–536, 1986. Saha, G., Garg, I., and Roy, K. Gradient projection memory for continual learning. arXiv preprint arXiv:2103.09762, 2021. Sekhari, A., Acharya, J., Kamath, G., and Suresh, A. T. Re- member what you want to forget: Algorithms for machine unlearning. Advances in Neural Information Processing Systems, 34:18075–18086, 2021. Shastri, S., Wasserman, M., and Chidambaram, V. The seven sins of {Personal-Data} processing systems under {GDPR}. In 11th USENIX Workshop on Hot Topics in Cloud Computing (HotCloud 19), 2019. Song, M., Wang, Z., Zhang, Z., Song, Y., Wang, Q., Ren, J., and Qi, H. Analyzing user-level privacy attack against federated learning. IEEE Journal on Selected Areas in Communications, 38(10):2430–2444, 2020. Thudi, A., Deza, G., Chandrasekaran, V., and Papernot, N. Unrolling sgd: Understanding factors influencing ma- chine unlearning. In 2022 IEEE 7th European Symposium on Security and Privacy (EuroS&P), pp. 303–319. IEEE, 2022. A. Appendix: More Experiment Results Subspace based Federated Unlearning We run experiments on the true world datasets of including MNIST, CIFAR10, and CIFAR100. We consider two scenarios: (i) We have ten clients with one target client, and all clients participate fully during each training round. (ii) We have 100 clients with one target client and only 10% of the clients participate during each training round. We detailed describe the experiment settings and the experimental results of scenario (ii) in the following. A.1. Setups Dataset. We adopt real-world datasets including MNIST, CIFAR10, and CIFAR100. MNIST(Xiao et al., 2017) dataset contains 60,000 training data and 10,000 test data in 10 classes. Each data sample is a 28×28 grayscale image. CIFAR10 dataset contains 50,000 training data and 10,000 test data in 10 classes. Each data sample is a 3×32×32 color image. CIFAR100 (Krizhevsky et al., 2009) includes 50,000 training data and 10,000 test data in 100 classes as 500 training samples per class, as shown in Table 3. For MNIST and CIFAR10/100, we normalize the pixel value within a specific mean and std value in our code, which are [0.5, 0.5, 0.5] for mean and [0.5, 0.5, 0.5] for std. Table 3: The similarity between predicted and real data distribution Datasets Training Data Test Data Class Size MNIST CIFAR-10 CIFAR-100 60000 50,000 50,000 10,000 10,000 10,000 10 10 100 28 × 28 3 × 32 × 32 3 × 32 × 32 (a) IID (b) Dir 0.3 Figure 5: Heat maps for each client with CIFAR10 dataset under different data partitions. The color bar denotes the number of data samples. Each rectangle represents the number of data samples of a specific class in a party. Dataset Partitions. To fairly compare with the other baselines, we introduce the heterogeneity by splitting the total dataset by sampling the label ratios from the Dirichlet distribution. An additional parameter is used to control the level of heterogeneity of the entire data partition. In order to visualize the distribution of heterogeneous data, we make the heat maps of the label distribution in different datasets, as shown in Fig. 5. It could be seen that for heterogeneity weight equals to 0.3 in Dirichlet distribution, about 10% to 20% of the categories dominate on each client, which is the blue block in Fig. 2. The IID dataset is totally averaged in each client, which is the blue block in Fig. 2. Baselines. • Retraining the entire FL system without the target client being forgotten; Subspace based Federated Unlearning Table 4: Accuracy results after unlearning (100 clients). Dataset MNIST CIFAR10 CIFAR100 Dataset MNIST CIFAR10 CIFAR100 network MLP CNN MLP CNN ResNet MLP CNN ResNet network MLP CNN MLP CNN ResNet MLP CNN ResNet FedAvg UL GA SFU test acc 94.41 98.47 40.04 55.11 48.38 13.5 16.59 15.05 atk acc 0.02 0.0 0.0 0.0 2.83 0.0 0.0 0.25 test acc 94.41 98.47 40.04 55.11 48.38 13.5 16.59 15.05 atk acc 0.02 0.0 0.0 0.0 2.83 0.0 0.0 0.25 test acc 94.38 98.26 39.81 54.95 47.79 13.47 16.57 15.32 atk acc 0.02 0.0 0.01 0.37 0.57 0.0 0.0 0.0 test acc 94.51 98.44 40.04 55.04 47.47 13.51 16.62 14.93 atk acc 0.0 0.0 0.0 0.0 0.27 0.0 0.0 0.0 Table 5: Accuracy results after retraining (100 clients). Retraining test acc 94.44 98.45 40.13 55.11 47.33 13.14 16.97 15.39 atk acc 0.02 0.0 0.0 0.00 3.51 0.0 0.0 0.12 UL-Distillation test acc 94.44 98.41 40.13 55.27 50.93 13.42 16.57 15.01 atk acc 0.02 0.0 0.0 0.0 2.52 0.0 0.0 0.25 GA-retraining test acc 94.43 98.43 39.95 55.36 48.36 13.17 16.57 14.92 atk acc 0.02 0.0 20.36 0.0 1.63 0.0 0.0 0.14 SFU-retraining test acc 94.98 98.44 41.49 56.13 49.93 13.30 17.51 16.09 atk acc 0.0 12.63 0.10 0.0 0.94 0.0 0.0 0.09 • Forgetting the target client based on the knowledge distillation Wu et al. (2022). This method subtracts historical parameter updates of the target client from the global model. Then, it uses the knowledge distillation method to remedy the skew of the unlearning model caused by the subtraction. We use "UL" to denote this kind of algorithm in our experiments; • The global model is updated using gradient ascent information on the target client. To reduce the probability of producing a random model, we set the gradient clip norm when the global model is updated. We refer to this approach as "GA" in our experiments. Implementation Details. In the experiment of removal of specific client contributions, We conduct unlearning experi- ments on the FL model after 100 rounds of training, where the hyperparameter Settings of each method are as follows: For SFU, we set the learning rate as 0.01, epoch as 1, and mini-batch size as 64 for gradient ascent on the target client, and each client selects 10 samples to solve the local expression matrix. The random factor in differential privacy is generated by sampling from a uniform distribution of[0.5 − 1]. For SVD parameters we followed the setting of Saha et al. (2021). For UL and GA, we set the same learning rate and mini-batch as SFU, and the public data set of UL on the server is formed by randomly sampling one-tenth of the total data. In the experiment of recovery of model performance, We start FL training with the stochastic model for full retraining. we start FL training on the unlearned local model without the involvement of the target client for SFU and GA. We use the knowledge of the public data on the server for distillation learning to recover the model accuracy for UL. A.2. Experimental results for scenario (ii). We compare the performance of SFU and other baselines on the setting of scenario (ii).Tab. 4 and Tab. 5 show that the success rate of backdoor attacks in scenario (ii) are lower than it in Tab. 1 and Tab. 2. When the client has a certain probability of being selected in the FL system, the target client has little contribution to the final model. However, the discussion about forgetting accuracy is still consistent with the interpretation in Sec. 4.2 and Sec. 4.3.
http://arxiv.org/abs/2302.13854v1
2023-02-24T04:28:46
2023-02-24T04:28:46
A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm
We developed a fast and modular deep learning algorithm to search for lookalike signals of interest in radio spectrogram data. First, we trained an autoencoder on filtered data returned by an energy detection algorithm. We then adapted a positional embedding layer from classical Transformer architecture to a frequency-based embedding. Next we used the encoder component of the autoencoder to extract features from small (~ 715,Hz with a resolution of 2.79Hz per frequency bin) windows in the radio spectrogram. We used our algorithm to conduct a search for a given query (encoded signal of interest) on a set of signals (encoded features of searched items) to produce the top candidates with similar features. We successfully demonstrate that the algorithm retrieves signals with similar appearance, given only the original radio spectrogram data.
[ "Peter Xiangyuan Ma", "Steve Croft", "Andrew P. V. Siemion" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.13854v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.13854v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.SP", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.SP", "astro-ph.IM", "cs.LG", "cs.SD", "eess.AS" ]
RASTI 000, 1–8 (2023) Preprint 28 February 2023 Compiled using rasti LATEX style file v3.0 3 2 0 2 b e F 4 2 ] P S . s s e e [ 1 v 4 5 8 3 1 . 2 0 3 2 : v i X r a A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm Peter Xiangyuan Ma,1★ Steve Croft,2,3 Andrew P. V. Siemion2,3,4,5 1Department of Mathematics, University of Toronto, 40 St. George Street, Toronto, ON M5S 2E4, Canada 2Radio Astronomy Laboratory, 501 Campbell Hall, University of California, Berkeley, CA 94720, USA 3SETI Institute, Mountain View, CA 94043, USA 4Jodrell Bank Centre for Astrophysics, The University of Manchester, M13 9PL, UK 5University of Malta, Institute of Space Sciences and Astronomy Accepted XXX. Received YYY; in original form ZZZ ABSTRACT We developed a fast and modular deep learning algorithm to search for lookalike signals of interest in radio spectrogram data. First, we trained an autoencoder on filtered data returned by an energy detection algorithm. We then adapted a positional embedding layer from classical Transformer architecture to a frequency-based embedding. Next we used the encoder component of the autoencoder to extract features from small (∼ 715 Hz with a resolution of 2.79 Hz per frequency bin) windows in the radio spectrogram. We used our algorithm to conduct a search for a given query (encoded signal of interest) on a set of signals (encoded features of searched items) to produce the top candidates with similar features. We successfully demonstrate that the algorithm retrieves signals with similar appearance, given only the original radio spectrogram data. Key words: Deep Learning – Machine Learning – Signal Processing – Radio Astronomy – Technosignatures 1 INTRODUCTION 1.2 Classical Reverse Image Search Algorithms 1.1 Interference Rejection in Radio Astronomy The rejection of radio frequency interference (RFI) is a perennial challenge for radio astronomy, particularly given the increase in satel- lite constellations that transmit at a range of radio frequencies and are detectable even at remote observing sites. RFI rejection is tradi- tionally performed using statistical or machine learning techniques that risk rejecting a potential signal of interest (SOI) in the process of flagging RFI signals (Pinchuk & Margot 2022). This is a particular problem when searching for astrophysical transients or for technosig- natures, since the signal morphology may not be known ahead of time and it may be rejected before a human has the opportunity to review it. Novel deep learning algorithms have been successfully used to address these kinds of problems (Ma et al. 2023). An alternative approach, which is relatively unexplored, is to start with the SOI, search through some database of signals (including RFI), and if the signals match, to then decide whether to keep or discard the SOI. This is of particular interest in technosignature searches where the vetting of candidate signals (e.g. BLC1; Sheikh et al. 2021) is rather onerous using existing methods. The ability to find additional examples of a given SOI at different times or different parts of the observed band can be invaluable in determining the nature of the signal. The focus of this paper is to develop an algorithm that allows us to reverse search a given SOI and return similar signals. We take inspiration from well known reverse image search algorithms. ★ E-mail: [email protected] © 2023 The Authors Reverse image searches are commonly employed in search engines and social media. These algorithms take an input image as a search term and return the locations of the same or similar images from across the web. These sites use algorithms like Scale-Invariant Fea- ture Transforms (SIFT; Lowe 1999), Maximally Stable Extremal Regions (MSER; Matas et al. 2004) or Bag of Words/Vocabulary Tree (Csurka et al. 2004) to power their search. Here we will briefly review some of these approaches and extend them to our work. 1.2.1 Scale-Invariant Feature Transforms A Scale-Invariant Feature Transform (SIFT) is an algorithm that takes an image, locates special "locally distinct points", and describes the features around such points using measurements such as the gradient in intensity or maximum intensity, etc. (Lowe 1999). This process produces pairs of vectors: the coordinates of the locally distinct point, and the corresponding descriptor vector that contains the features of that point. The locally distinct points are produced from a process of differ- ence of Gaussians performed at varying resolutions of the images. To compute the descriptor vector we measure the gradients in pixel intensity over a region about the locally distinct points. Together this builds a feature extractor. Finally, to perform a search, we match the key points between images and check the similarity between the descriptor vectors. More concretely we can use a technique called a Vocabulary Tree, described in section 1.2.3. 2 P.X Ma et al. 1.2.2 Maximally stable extremal regions The maximally stable extremal regions (MSER) algorithm, like SIFT, attempts to find key points in the image. Specifically, it looks for ob- jects called "blobs", defined as areas of an image that have connected elements, contrasting backgrounds, and close-to-uniform pixel in- tensities (Matas et al. 2004). MSER works by taking various thresholds in the range (0, 255) and blacking or whitening out pixels depending on this threshold. The blacking and whitening of pixels create the "blobs". We perform a connected component analysis and track how the blobs evolve as we adjust the threshold. MSER helps pull out small regions of images that contain distinctive boundaries which we can use to label distinct points and compute descriptor vectors for each blob. These can then be used to compare and match. 1.2.3 Bag of Words / Vocabulary Tree The Vocabulary Tree approach in computer vision effectively im- plements a Bag of Words (BoW) model to compare images to each other (Csurka et al. 2004). We first run a local feature extractor like SIFT (section 1.2.1). We then construct a "codebook" containing codewords that describe several similar patches identified by SIFT. One simple means of determining codewords is to use K-Means clus- tering to produce centroids, which we denote as codewords. We can then compare and contrast images by comparing the corresponding codebooks using a variety of algorithms. However, a key limitation in this approach is that SIFT ignores the spatial relationships between local patches, which we know is incredibly important in describing an image accurately. This leaves room for improvement. 1.3 Deep Learning for Computer Vision Deep learning overcomes some of the shortcomings of the afore- mentioned algorithms and has been proven to effectively solve a wide range of image problems with the advent of Convolutional Neural Networks (CNN; LeCun et al. 1999). CNN's are simple in that they are a traditional neural network with the addition of con- volutional layers. These layers operate by performing convolution operations between input data and a kernel. These operations have built-in inductive bias. For example, these operations are equivalent to translations that the algorithm exploits as fundamental properties in images. More concretely, this is because in images, small trans- lations often do not change the prediction outcomes (Goodfellow et al. 2016). For example, if we take a picture of a dog and move the dog 5 pixels to the right, the image is still that of a dog. By using a convolutional layer we are baking this assumption into the model without getting the model to learn it from scratch. More formally this allows us to restrict the priors on the weights thus reducing the size of the model and allowing vast improvements in both performance and scale. More specifically CNN's have been proven to be efficient feature extractors of both local and global features which address the shortcomings described in Section 1.2.3. Due to the exceptional performance of CNN's on a wide range of image tasks, they have been widely adopted in industry for a variety of computer vision challenges (Krizhevsky et al. 2017; Koul et al. 2019) including for reverse image search algorithms (Singh & Gowdar 2021). 1.3.1 Autoencoders Autoencoders are special cases of CNN's, employing a symmetrical CNN architecture that takes in an input and outputs a reconstruction RASTI 000, 1–8 (2023) of the original input. However, these models have a bottleneck that constricts the flow of data (Baldi 2012). This bottleneck divides the network into two: an encoder and a decoder. The encoder takes an input image and compresses the data through the bottleneck and the decoder attempts to reverse that process. Intuitively this builds an efficient feature extractor since the encoder is attempting to reduce the input into the most important features such that the decoder can reconstruct the original input (Goodfellow et al. 2016). This kind of automatic feature extraction technique will serve as the core of our approach. 1.4 Problem Statement Despite these algorithms being industry-standard, out-of-the-box so- lutions fail to satisfy our needs. Firstly, these traditional (not deep learning) techniques disregard large-scale spatial features, as de- scribed in section 1.2.3. Traditional algorithms fail to capture com- plex structures within the data. This is partially the reason why tra- ditional computer vision techniques are being superseded by deep learning in tackling computer vision problems. Secondly, under cer- tain circumstances, we want to bias our model towards particular features, for example, frequency. Currently, there is no encoding of information on the radio frequency of the signal in any of these methods. During our search process, sometimes we wish to match signals that not only appear similar to each other, but also are located in similar regions of the frequency band. On the surface, this appears to be a trivial problem: simply filter out the candidates after the search is completed. However, there exists a trade-off between visually similar signals and signals that are just close by in frequency. Thus if one wants to search for both similar appearing signals and signals close by in frequency we need to "bake in" the information about the frequency into the search process rather than apply it as a secondary filter. Classical search algorithms do not have an out-of-the-box solution to embedding complex features such as signal frequency. The central questions we want to answer are: Given a signal in a radio spectrogram, can we find all lookalike signals? Can we also find similar signals in similar regions of the frequency band? Can we make these approaches modular? 2 METHODS We begin by outlining the structure of our approach. First, we build a feature extractor using an autoencoder. To do so we describe our data source in section 2.1, the cleaning of the data in section 2.2, and data preprocessing in section 2.3. We then move to build the model in 2.4. We train and test the model in section 2.5. We extend the model capabilities using a modular frequency embedding strategy discussed in 2.6, and finally assemble the algorithm in section 2.7. 2.1 Data Source The training, validation, and testing dataset are derived from real observations from Breakthrough Listen's Green Bank Telescope 1.8 − 2.9 GHz dataset, sourced from several different observational campaigns (Enriquez et al. 2017; Price et al. 2018; Price et al. 2020; Price et al. 2021). We used the high-frequency resolution data product where each frequency bin is 2.79 Hz wide (Lebofsky et al. 2019b), since our goal is to tackle data that contains RFI, and RFI can have A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm 3 fine resolution in the frequency domain. The data is open source and are available from the Breakthrough Listen Open Data Archive1. 2.2 Data Filtering Energy Detection Since we are working with real data, we need to balance the training features. Large regions of the spectrograms consist of Gaussian noise, so if we did not filter the data to extract signals, then the resulting model would be biased towards generating noise rather than real signals. To perform this filtering we apply a simple energy detection process2. First we perform a simple bandpass filtering on the entire obser- vation. This removes the polyphase filterbank shape imposed by the first of a two-stage channelization procedure (Lebofsky et al. 2019a). This is done by collapsing the spectrogram in the time dimension and fitting a piece-wise polynomial spline to each ∼ 3 MHz-wide coarse channel. We subtract the fitted polynomial from the data. Finally, we iterate through windows of size 715 Hz and search for excess energy above the expectations of Gaussian random noise. We chose an S-score threshold of 512 (D'Agostino & Pearson 1973). We also perform a complementary energy detection process where we select regions consistent with Gaussian noise by inverting the threshold condition. When constructing the training set we use an equal number of "signal" and "noise" regions, thus balancing the dataset. 2.3 Data and Preprocessing To create the training set we randomly draw 30 observations from a total of 12,000, and draw an additional six observations for the test set (excluding those already selected as part of the training set). We chose 30 and 6 to keep computing time reasonable. Running energy detection required 30 minutes to process each file and with 30 exam- ples it already provided more than 2 million training samples which is more than enough to demonstrate our algorithm's capabilities. The spectrograms have a time resolution of 18.25 s and a frequency resolution of 2.79 Hz, giving the dataset 3 × 108 frequency channels. We then split the band into ∼ 715 Hz "snippets". This resulted in a training set of approximately 2 million snippets and a test set of 300,000 snippets. We then log normalize the data, add a constant to make all the values positive, and scale the data to have a final range within 0 and 1. Examples of the resulting snippets are shown in Figure 1. Note that the normalization is done per snippet indepen- dently of each other sample. These snippets are used as inputs to the autoencoder, and the targets are the same snippets. 2.4 Autoencoder As described in section 1.3.1, our autoencoder consists of an encoder and a decoder (Baldi 2012). The encoder consists of five convolu- tional layers (LeCun et al. 1999), with filter sizes of 16, 32, 32, 32, and 32 respectively. In between each layer is a 2-D Maxpool layer (Krizhevsky et al. 2017) of size (1,2). A batch normalization layer (Ioffe & Szegedy 2015) is included between the final maxpool layer and the convolutional layer. This is followed by three dense layers of size 32, 16, and 5 respectively. All the activations used are ReLu (Fukushima 1975) activations. The model was built using Tensorflow (Abadi et al. 2015) and Keras (Chollet et al. 2015). 1 http://seti.berkeley.edu/opendata 2 https://github.com/FX196/SETI-Energy-Detection The decoder is similar but in reverse order. We once again have dense layers of size 16, and 32 where the output is then reshaped and fed into a convolutional transpose (Baldi 2012) layer which upscales the image back to the same dimension of the input. Between the five convolutional layers, we have batch normalization and maxpool size of (2,1). The model architecture is shown in Figure 2. 2.5 Training and Validation The training scheme is standard. We fitted the model using the ADAM (Kingma & Ba 2014) optimizer with a learning rate of 1 × 10−4, uti- lizing an early stopping routine with the patience of 10 epochs trained in batches of 16 samples, for 100 epochs. We then visually evaluated how well the model reconstructed the original spectrogram. Figure 1 shows a few randomly drawn examples. The reconstruction achieves our desired level of accuracy in that visually the reconstructions appear similar to the inputs. We proceed with this model (Figure 3). 2.6 Frequency Embedding Signal morphology varies with frequency, given that transmitters of different types occupy different regions of the band. For exam- ple, WiFi and Bluetooth signals are common in our spectra around 2.4 GHz. However, during our training phase and in the construction of our model this frequency information is not preserved in the fea- ture extractor. Should a user choose to search for signals that are also similar in frequency this information would be lost. However, we can add frequency information to the feature vector. Initially, this appears trivial - one can simply extend the fea- ture vector by a dimension and add the frequency information here. However, this would mean that frequency is an orthogonal feature to all the other extracted features. We know, however, that signal morphology is correlated to some extent with frequency. Here we borrow techniques from Natural Language Processing (specifically transformer architectures) to encode frequency information in feature vectors called Positional Embeddings (Vaswani et al. 2017). Positional embeddings work by taking encoded feature vectors and perturbing these vectors by small offsets based on their position to obtain an ideal balance between correct adjustment and over- adjustment which could lead to confusion with other signals. One can imagine this as trying to build miniature clusters in some high- dimensional feature space where each element of the cluster is unique but the elements of the cluster don't intersect with other clusters. The adjustment vector is found using Equation 1, adapted from the paper "Attention Is All You Need" (Vaswani et al. 2017), P(k, i) =    sin( k n cos( ), i d k i−1 d n i even ), i odd (1) The variable k is the index in position, so if we have a sequence of length L, we pick an integer k ∈ [0, L]. The index in the feature vector is denoted i, and i ∈ [0, d] where d is the dimension of the embedding space. The variable n is a tunable hyperparameter, where Vaswani et al. choose n = 10, 000. These equations ought to satisfy two conditions: (i) The adjustments are unique for a given frequency index k. (ii) The adjustments are bounded, in order to prevent the adjust- ment vector from over-adjusting. The functions are all bounded between [0, 1] satisfying condition (ii). The sinusoidal functions are unique to each position, satisfying RASTI 000, 1–8 (2023) 4 P.X Ma et al. Figure 1. A random sample of training examples. A variety of RFI signals are seen in these snippets. Figure 2. A representation of our autoencoder model. The encoder shows a progressive compression of data, forcing the network to decide the most important features of the original spectrogram. Figure 3. Eight randomly drawn real observations (top row) and their corresponding autoencoder reconstructions (bottom row). The autoencoder can reconstruct the signals in the input data. We see that the reconstruction of the signal appears good, whereas the reconstruction of the noise is slightly poorer. This isn't a concern since the main focus should be on the signal. RASTI 000, 1–8 (2023) 0200010Time [18.25s]0200020002000200020002000200020002000200010Time [18.25s]0200020002000200020002000200020002000200010Time [18.25s]0200020002000200020002000200020002000200Frequency [2.79 Hz]010Time [18.25s]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0200Frequency [2.79 Hz]0.20.30.40.50.6Power [normalized]EncoderLayer 18: DenseLayer 1: Conv 2D Layer 2: Maxpool 2D Layer 3: Batch Norm. Layer 4: Conv 2D Layer 5: Maxpool 2D Layer 6: Batch Norm. Layer 7: Conv 2D Layer 8: Maxpool 2D Layer 9: Batch Norm. Layer 10: Conv 2D Layer 11: Maxpool 2D Layer 12: Batch Norm. Layer 13: Conv 2D Layer 14: Maxpool 2D Layer 15: Batch Norm. Layer 16: FlattenLayer 17: DenseBottleneckInputLayer 20: DenseLayer 23: Conv 2D Layer 24: Maxpool 2D Layer 25: Batch Norm. Layer 22: ReshapeLayer 21: DenseLayer 26: Conv 2D Layer 27: Maxpool 2D Layer 28: Batch Norm. Layer 29: Conv 2D Layer 30: Maxpool 2D Layer 31: Batch Norm. Layer 32: Conv 2D Layer 34: Maxpool 2D Layer 35 Batch Norm. Layer 36: Conv 2D Layer 37: Maxpool 2D Layer 38: Batch Norm. OutputLayer 38: Conv 2D Decoder0100200051015 ReconstructionTime [18.25s]01002000100200010020001002000100200010020001002000100200Frequency [2.79 Hz]051015Time [18.25s]Real Obs0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0100200Frequency [2.79 Hz]0.20.30.40.50.6Power [normalized] A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm 5 those used as input, we select 10 filtered Energy Detection snippets at random and perform a search using the same observation set as used for the SOI observations. Images of the spectrograms used can be found in our GitHub repository3. In the first method, we use the classical SIFT + Bag of Words al- gorithm described in section 1.2. We run SIFT through each window of the spectrogram and generate a set of descriptor vectors for each image. Then we use K-Means clustering with 800 centroids to build a codebook. The codebook is built by taking the fitted centroids as the codewords and then looping back in the descriptor vectors and assigning them a codeword. Then for each image, we created a his- togram of codewords, hence treating it as a BoW model. Finally, we performed a match between the histogram of the SOI and the histograms of each candidate signal. The matches use the K-Nearest Neighbours approach (Cover & Hart 1967). Results are shown in Figure 6. One downside to this approach is that the algorithm is very slow. For each observation, we need to generate millions of descriptor vectors and repeat the SIFT operation millions of times. Unlike deep learning-based approaches, these feature vectors can be generated in parallel on the GPU using much more efficient methods. Next, we applied our algorithm without using frequency embed- ding techniques (Figure 7). We see that this approach was able to retrieve more convincing candidates than the classical SIFT+ BoW approach. When we investigate where the candidates lie in frequency space, we see that many are close to the frequency of the true signal (Figure 7). Finally, we applied our algorithm with frequency embedding (Fig- ure 8). The resulting signals show even higher visual similarity to the input signal. Additionally, the frequency distribution of the matches is closer to the frequency of the input signal, showing that the fre- quency embedding was successful. 4 DISCUSSION Our algorithm is more successful than classical approaches in re- turning similar candidates. The algorithm also runs approximately 20 times faster than our classical implementations at our data center because our algorithm can take advantage of GPUs with deep learn- ing hardware acceleration such as tensor cores. Traditional matching techniques suffer an inability to generalize large-scale features as discussed in Section 1.2. Furthermore, the addition of frequency em- bedding results in candidates that have a better match in frequency to the input signal, which is desirable under certain situations. In addition, it appears that SIFT-based algorithms tend to match local features and thus have a tendency to match noise (see Figure 6), un- like the Deep Learning based approaches where models were able to learn more global features resulting in better matches overall. Looking forward we believe this algorithm has a wide range of practical use in transient radio astronomy. One particularly exciting use case is to help automate signal verification steps for candidate technosignature signals such as BLC1 (Sheikh et al. 2021). By au- tomatically searching for potential lookalikes based on signal mor- phology, rather than relying on more low-level parameters of a signal, such as drift rate, signal width, or signal-to-noise ratio, we can do a better job of distinguishing between true anomalies, and RFI. More generally, this technique can be used to build an RFI database. Many RFI databases consist simply of frequency ranges that are excluded (for example, the frequency ranges corresponding Figure 4. A visualization of the patterns in the embedding confirms that they are unique for each position we encode. We used a dimension of 512 and a sequence length of 100 for demonstration purposes; in the actual algorithm, we used a dimension of 4 and a sequence of 1000. Figure 5. Visualization of the search process and the flow of data. We first extract features from the SOI and the set of possible candidates. Then we apply frequency embedding, and finally, we produce the similarity scores by matrix multiplication. condition (i). We can measure similarity in positions using metrics such as cosine similarity or Euclidean distance. The embeddings are visualized in Figure 4. The choice of sequence length determines how many frequency chunks the band is broken into. Our choice of 1000 bins (giving ∼ 1 MHz chunks) is a compromise between small chunks (which increase computational resource intensity) and large chunks (which reduce accuracy). 2.7 The Search Algorithm We now combine the components of our algorithm and use them to perform a search. The search has three elements. First, the feature extractor, using the encoder of the Autoencoder, extracts features from the spectrogram. Second, we index and construct the frequency embedding for each of the extracted features and add those to the encoded vectors. We repeat this process with the SOI. Finally, we compute similarity scores between the SOI and the images in the search list. This similarity score is the cosine similarity metric and is computed efficiently by performing a matrix multiplication and renormalizing by the respective vector norms. The procedure is vi- sualized in Figure 5. 3 RESULTS We perform three sets of tests. First, we apply the classical SIFT + BoW algorithm to the problem discussed in Section 1.2. Second, we apply our algorithm to the problem but without the frequency em- bedding step. Lastly, we apply our algorithm with frequency embed- dings to the problem and assess the results, in order to demonstrate the modularity of our design. To assess the ability of the algorithm to return similar signals to 3 https://github.com/PetchMa/Reverse_Radio_Search RASTI 000, 1–8 (2023) 0100200300400500Feature Dimension020406080Position In Band0.50.00.51.0EncoderEncoded FeaturesEncoderFrequency EmbeddingsMatrix MultiplyAnd RenormalizeCandidatesSignal of InterestSimilarity ScoreElement-wise additionElement-wise addition 6 P.X Ma et al. Figure 6. (a) The top 10 candidates with the closest similarity to the target [shown as the top left box], using the SIFT + BoW algorithm. The best candidate is shown in the top right box. Note: that this method did not find itself because this uses a KNN matching algorithm that excludes the trivial case (b) Frequency distribution of the top 10,000 most similar hits. Figure 7. (a) The top 10 candidates with the closest similarity to the target [shown as the top left box] for our deep learning algorithm with no frequency embedding. The best match is unsurprisingly, the input signal [top right box]. (b) Frequency distribution of the top 10,000 most similar hits. RASTI 000, 1–8 (2023) True Target - 1961.27 MHzBest Match: 1946.5 [MHz]2675.36 [MHz]1931.76 [MHz]1960.81 [MHz]2329.24 [MHz]2659.12 [MHz]2443.12 [MHz]1960.83 [MHz]1960.84 [MHz]1951.91 [MHz]1931.71 [MHz]180020002200240026002800Frequency [MHz]0250050007500Num of Similar HitsHit BinsTrue SOI bin0.00.20.40.60.81.0(a)Power [normalized](b)True Target - 1961.27 MHzBest Match: 1961.27 [MHz]1951.17 [MHz]1964.53 [MHz]1954.33 [MHz]1933.56 [MHz]1934.22 [MHz]1948.56 [MHz]1953.33 [MHz]1964.43 [MHz]1964.21 [MHz]1963.9 [MHz]180020002200240026002800Frequency [MHz]02000Num of Similar HitsHit BinsTrue SOI bin0.00.20.40.60.81.0(a)Power [normalized](b) A Deep Neural Network Based Reverse Radio Spectrogram Search Algorithm 7 Figure 8. (a) The top 10 candidates with the closest similarity to the target [shown as the top left box] for our deep learning algorithm with frequency embedding. Again, the best match is the input signal [top right box]. (b) Frequency distribution of the top 10,000 most similar hits. The algorithm retrieves matches at frequencies close to the input frequency while maintaining similar signal morphology to the input. to GPS satellites). Our algorithm enables a finer-grained approach, comparing signal morphologies without necessitating the exclusion of large ranges in frequency, thus helping to make more efficient use of the spectrum and expanding the power of the search. Another use case is to perform template searches. For example, one can build theoretical models that simulate some desired signal, and search the recorded observations for signals that match. The next step in the development of our algorithm is to modify it to handle a wider range of data products. For example, developing a model to handle arbitrary collections of spectrogram data (data from different receivers or even telescopes). Or perhaps building a model that can deal with cases where the spectral resolution varies (e.g. combining data products with 3 Hz resolution and 1 Hz resolution). We also plan to extend our approach to series (or cadences) of multiple observations, which intersperse scans of the target star with comparison scans of neighboring targets. Signals such as BLC1, which appear only in scans of the primary target, are consistent with being spatially localized on the sky. However, the dataset in which BLC1 was discovered also contained "lookalike" signals at other frequencies, indicating that they were likely due to particularly pernicious RFI. By applying our new methodology to cadences of data, we can much more easily locate lookalike signals at other frequencies, or in scans of other targets, providing an additional powerful means of screening technosignature candidates. 5 DATA RELEASE AND CODE AVAILABILITY ACKNOWLEDGEMENTS Breakthrough Listen is managed by the Breakthrough Initiatives, sponsored by the Breakthrough Prize Foundation4. We are grateful to the staff of the Green Bank Observatory for their help with in- stallation and commissioning of the Breakthrough Listen backend instrument and extensive support during Breakthrough Listen obser- vations. We thank Yuhong Chen for his helpful discussion on the Energy Detection Algorithm. REFERENCES Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G. S., Davis, A., Dean, J., Devin, M., Ghemawat, S., Goodfellow, I., Harp, A., Irving, G., Isard, M., Jia, Y., Jozefowicz, R., Kaiser, L., Kudlur, M., Levenberg, J., Mané, D., Monga, R., Moore, S., Murray, D., Olah, C., Schuster, M., Shlens, J., Steiner, B., Sutskever, I., Talwar, K., Tucker, P., Vanhoucke, V., Vasudevan, V., Viégas, F., Vinyals, O., Warden, P., Wattenberg, M., Wicke, M., Yu, Y., & Zheng, X., 2015. TensorFlow: Large-scale machine learning on heterogeneous systems, Software avail- able from tensorflow.org. Baldi, P., 2012. Autoencoders, unsupervised learning, and deep architectures, in Proceedings of ICML workshop on unsupervised and transfer learning, pp. 37–49, JMLR Workshop and Conference Proceedings. Chollet, F. et al., 2015. Keras, https://keras.io. Cover, T. & Hart, P., 1967. Nearest neighbor pattern classification, IEEE Transactions on Information Theory, 13(1), 21–27. Csurka, G., Dance, C., Fan, L., Willamowski, J., & Bray, C., 2004. Visual categorization with bags of keypoints, in Workshop on statistical learning in computer vision, ECCV, vol. 1, pp. 1–2, Prague. All source code is released here and the data is publicly released here. 4 http://www.breakthroughinitiatives.org RASTI 000, 1–8 (2023) True Target - 1961.27 MHzBest Match: 1961.27 [MHz]1951.17 [MHz]1964.53 [MHz]1954.33 [MHz]1933.56 [MHz]1934.22 [MHz]1948.56 [MHz]1953.33 [MHz]1964.43 [MHz]1964.21 [MHz]1963.9 [MHz]180020002200240026002800Frequency [MHz]0100020003000Num of Similar HitsHit BinsTrue SOI bin0.00.20.40.60.81.0(a)Power [normalized](b) Czech, D., Gajjar, V., Siemion, A., Drew, J., Worden, S. P., Green, J. A., Craig, D., & Amy, S., 2021. Expanded Capability of the Breakthrough Listen Parkes Data Recorder for Observations with the UWL Receiver, Research Notes of the American Astronomical Society, 5, 114, ADS Bib- code: 2021RNAAS...5..114P. Sheikh, S. Z., Smith, S., Price, D. C., DeBoer, D., Lacki, B. C., Czech, D. J., Croft, S., Gajjar, V., Isaacson, H., Lebofsky, M., MacMahon, D. H. E., Ng, C., Perez, K. I., Siemion, A. P. V., Webb, C. I., Zic, A., Drew, J., & Worden, S. P., 2021. Analysis of the breakthrough listen signal of interest blc1 with a technosignature verification framework, Nature Astronomy, 5(11), 1153–1162. Singh, P. N. & Gowdar, T. P., 2021. Reverse image search improved by deep learning, in 2021 IEEE Mysore Sub Section International Conference (MysuruCon), pp. 596–600. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., & Polosukhin, I., 2017. Attention is all you need. This paper has been typeset from a TEX/LATEX file prepared by the author. 8 P.X Ma et al. D'Agostino, R. & Pearson, E. S., 1973. Tests for departure from normality. b 1, Biometrika, 60(3), empirical results for the distributions of b 2 and 613. √ Enriquez, J. E., Siemion, A., Foster, G., Gajjar, V., Hellbourg, G., Hickish, J., Isaacson, H., Price, D. C., Croft, S., DeBoer, D., Lebofsky, M., MacMa- hon, D. H. E., & Werthimer, D., 2017. The Breakthrough Listen Search for Intelligent Life: 1.1–1.9 GHz Observations of 692 Nearby Stars, ApJ, 849(2), 104, Publisher: American Astronomical Society. Fukushima, K., 1975. Cognitron: A self-organizing multilayered neural net- work, Biological Cybernetics, 20(3-4), 121–136. Goodfellow, I., Bengio, Y., & Courville, A., 2016. Deep Learning, MIT Press, http://www.deeplearningbook.org. Ioffe, S. & Szegedy, C., 2015. Batch normalization: Accelerating deep net- work training by reducing internal covariate shift. Kingma, D. P. & Ba, J., 2014. Adam: A method for stochastic optimization. Koul, A., Ganju, & Kasam, M., 2019. Practical deep learning for cloud and mobile, O'Reilly Media, Sebastopol, CA. Krizhevsky, A., Sutskever, I., & Hinton, G. E., 2017. ImageNet classification with deep convolutional neural networks, Commun. ACM, 60(6), 84–90. Lebofsky, M., Croft, S., Siemion, A. P. V., Price, D. C., Enriquez, J. E., Isaacson, H., MacMahon, D. H. E., Anderson, D., Brzycki, B., Cobb, J., Czech, D., DeBoer, D., DeMarines, J., Drew, J., Foster, G., Gajjar, V., Gizani, N., Hellbourg, G., Korpela, E. J., Lacki, B., Sheikh, S., Werthimer, D., Worden, P., Yu, A., & Zhang, Y. G., 2019a. The Breakthrough Listen Search for Intelligent Life: Public Data, Formats, Reduction, and Archiving, PASP, 131(1006), 124505, Publisher: IOP Publishing. Lebofsky, M., Croft, S., Siemion, A. P. V., Price, D. C., Enriquez, J. E., Isaacson, H., MacMahon, D. H. E., Anderson, D., Brzycki, B., Cobb, J., Czech, D., DeBoer, D., DeMarines, J., Drew, J., Foster, G., Gajjar, V., Gizani, N., Hellbourg, G., Korpela, E. J., Lacki, B., Sheikh, S., Werthimer, D., Worden, P., Yu, A., & Zhang, Y. G., 2019b. The Breakthrough Listen Search for Intelligent Life: Public Data, Formats, Reduction, and Archiving, PASP, 131(1006), 124505, Publisher: IOP Publishing. LeCun, Y., Haffner, P., Bottou, L., & Bengio, Y., 1999. Object Recogni- tion with Gradient-Based Learning, in Shape, Contour and Grouping in Computer Vision, Lecture Notes in Computer Science, pp. 319–345, eds Forsyth, D. A., Mundy, J. L., di Gesú, V., & Cipolla, R., Springer, Berlin, Heidelberg. Lowe, D., 1999. Object recognition from local scale-invariant features, in Proceedings of the Seventh IEEE International Conference on Computer Vision, IEEE. Ma, P. X., Ng, C., Rizk, L., Croft, S., Siemion, A. P. V., Brzycki, B., Czech, D., Drew, J., Gajjar, V., Hoang, J., Isaacson, H., Lebofsky, M., MacMahon, D. H. E., de Pater, I., Price, D. C., Sheikh, S. Z., & Worden, S. P., 2023. A deep-learning search for technosignatures from 820 nearby stars, Nature Astronomy. Matas, J., Chum, O., Urban, M., & Pajdla, T., 2004. Robust wide-baseline stereo from maximally stable extremal regions, Image and vision com- puting, 22(10), 761–767. Pinchuk, P. & Margot, J.-L., 2022. A machine learning–based direction-of- origin filter for the identification of radio frequency interference in the search for technosignatures, The Astronomical Journal, 163(2), 76. Price, D. C., MacMahon, D. H. E., Lebofsky, M., Croft, S., DeBoer, D., En- riquez, J. E., Foster, G. S., Gajjar, V., Gizani, N., Hellbourg, G., Isaacson, H., Siemion, A. P. V., Werthimer, D., Green, J. A., Amy, S., Ball, L., Bock, D. C.-J., Craig, D., Edwards, P. G., Jameson, A., Mader, S., Preisig, B., Smith, M., Reynolds, J., & Sarkissian, J., 2018. The Breakthrough Listen search for intelligent life: Wide-bandwidth digital instrumentation for the CSIRO Parkes 64-m telescope, Publications of the Astronomical Society of Australia, 35, Publisher: Cambridge University Press. Price, D. C., Enriquez, J. E., Brzycki, B., Croft, S., Czech, D., DeBoer, D., DeMarines, J., Foster, G., Gajjar, V., Gizani, N., Hellbourg, G., Isaacson, H., Lacki, B., Lebofsky, M., MacMahon, D. H. E., Pater, I. d., Siemion, A. P. V., Werthimer, D., Green, J. A., Kaczmarek, J. F., Maddalena, R. J., Mader, S., Drew, J., & Worden, S. P., 2020. The Breakthrough Listen Search for Intelligent Life: Observations of 1327 Nearby Stars Over 1.10-3.45 GHz, AJ, 159(3), 86. Price, D. C., MacMahon, D. H. E., Lebofsky, M., Isaacson, H., Sheikh, S., RASTI 000, 1–8 (2023)
http://arxiv.org/abs/2302.12445v2
2023-06-15T06:19:25
2023-02-24T04:11:18
DeAR: Accelerating Distributed Deep Learning with Fine-Grained All-Reduce Pipelining
Communication scheduling has been shown to be effective in accelerating distributed training, which enables all-reduce communications to be overlapped with backpropagation computations. This has been commonly adopted in popular distributed deep learning frameworks. However, there exist two fundamental problems: (1) excessive startup latency proportional to the number of workers for each all-reduce operation; (2) it only achieves sub-optimal training performance due to the dependency and synchronization requirement of the feed-forward computation in the next iteration. We propose a novel scheduling algorithm, DeAR, that decouples the all-reduce primitive into two continuous operations, which overlaps with both backpropagation and feed-forward computations without extra communications. We further design a practical tensor fusion algorithm to improve the training performance. Experimental results with five popular models show that DeAR achieves up to 83% and 15% training speedup over the state-of-the-art solutions on a 64-GPU cluster with 10Gb/s Ethernet and 100Gb/s InfiniBand interconnects, respectively.
[ "Lin Zhang", "Shaohuai Shi", "Xiaowen Chu", "Wei Wang", "Bo Li", "Chengjian Liu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12445v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12445v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.DC" ]
DeAR: Accelerating Distributed Deep Learning with Fine-Grained All-Reduce Pipelining Lin Zhang†, Shaohuai Shi‡∗, Xiaowen Chu§†, Wei Wang†, Bo Li†, Chengjian Liu¶ †The Hong Kong University of Science and Technology, ‡Harbin Institute of Technology, Shenzhen, §The Hong Kong University of Science and Technology (Guangzhou), ¶Shenzhen Technology University [email protected], [email protected], [email protected], {weiwa, bli}@cse.ust.hk, [email protected] 3 2 0 2 n u J 5 1 ] G L . s c [ 2 v 5 4 4 2 1 . 2 0 3 2 : v i X r a Abstract-Communication scheduling has been shown to be effective in accelerating distributed training, which enables all- reduce communications to be overlapped with backpropagation computations. This has been commonly adopted in popular distributed deep learning frameworks. However, there exist two fundamental problems: (1) excessive startup latency proportional to the number of workers for each all-reduce operation; (2) it only achieves sub-optimal training performance due to the dependency and synchronization requirement of the feed-forward computation in the next iteration. We propose a novel scheduling algorithm, DeAR, that decouples the all-reduce primitive into two continuous operations, which overlaps with both backprop- agation and feed-forward computations without extra communi- cations. We further design a practical tensor fusion algorithm to improve the training performance. Experimental results with five popular models show that DeAR achieves up to 83% and 15% training speedup over the state-of-the-art solutions on a 64-GPU cluster with 10Gb/s Ethernet and 100Gb/s InfiniBand interconnects, respectively. I. INTRODUCTION Training a complex deep neural network (DNN) model over a large data set requires a massive amount of compute resources and is typically performed on a cluster of GPU machines [1]–[3]. To accelerate distributed training, many dif- ferent ways of parallelism have been proposed recently, such as data-parallel [4], model-parallel [1], pipeline-parallel [5], and the combination of the above [6]. Among them, the data-parallel synchronous stochastic gradient descent (S-SGD) algorithms are the most popular when each worker machine has sufficient GPU memory to hold the training model. In S-SGD, the training data is sharded across multiple GPU workers. Each worker iteratively updates the training model by aggregating the local gradients computed with local data samples. To efficiently support gradient aggregation, current training frameworks use the all-reduce architecture [2,4,7]– [10], in which gradient aggregation is performed with an all- reduce collective. The all-reduce architecture has been widely adopted in practice to distributed training, according to the MLPerf training benchmarks1. As the model size and the number of workers increase, gradient aggregation requires extensive data communications, which easily become the bottleneck [11,12]. System-level optimizations are thus needed to address this scalability issue. *Corresponding author. 1https://mlcommons.org/en/training-normal-11/ One effective approach that exploits the layer-wise structure of DNN models is to pipeline gradient calculation (computing tasks) with gradient aggregation (communication tasks) in the backpropagation stage, so as to hide the communication over- head and thus improve the system throughput [13,14]. This approach, known as wait-free backpropagation (WFBP) [13], has been implemented as the default mechanism in mod- ern deep learning (DL) frameworks such as TensorFlow, PyTorch-DDP [15], and Horovod [16,17]. However, WFBP only pipelines communications with gradient computations in the backpropagation stage, which does not consider the feed- forward stage, thus making it sub-optimal. It is worth pointing out that feed-forward computations account for around one third of the total computation time in each iteration [18], which can be properly exploited to further accelerating the training speed. However, it is challenging to enable pipelining between the communication tasks for gradient aggregation and the next iteration's feed-forward computing tasks under the all-reduce architecture, for two reasons. First, a tensor's gradient aggre- gation is an all-reduce primitive, which can only begin after its gradient has been calculated in backpropagation and should be synchronized before the next iteration's feed-forward com- putation. Thus, it only allows coarse-grained scheduling be- the all- tween communications and computations. Second, reduce communication tasks are coming in a first-in, first- out (FIFO) order with the dependency of backpropagation computing tasks. Communication tasks can be re-ordered to be pipelined with feed-forward computing tasks. Yet, different workers execute the computing tasks concurrently, such a re- ordering needs to be done collectively in a consistent manner by all workers to ensure the correctness of all-reduce results. Therefore, this requires synchronization among workers in each iteration, which causes extra communication overheads. To address the two challenges above, we propose a new scheduling algorithm called DeAR2 that decouples the all- reduce primitive to two operations, so as to enable fine- grained scheduling without introducing extra communication overhead. DeAR applies three novel techniques to distributed training for the all-reduce architecture. To the best of our knowledge, we are the first to decouple the all-reduce primitive without introducing extra time costs so that communications 2Source code can be found in https://github.com/lzhangbv/dear pytorch. become possible to be overlapped with feed-forward compu- tations in distributed training. parameter. Formally, the update formula at the ith iteration can be represented as follows. First, though the all-reduce operation is a primitive in distributed training, all-reduce implementations can be handled as a combination of basic routines [19]–[22]. For example, a classic implementation of the widely used ring-based all- reduce is a combination of a reduce-scatter collective followed by an all-gather collective [19,20]. Based on the nature of all- reduce implementations, we decouple the all-reduce primitive to two continuous collectives in distributed training, which allows a fine-grained schedule of communication tasks. Second, given that one all-reduce primitive is decoupled into two operations, we propose to schedule the first operation to be pipelined with backpropagation computing tasks, and the second operation pipelined with feed-forward computing tasks. By doing so, there is no need to re-order the communication tasks while enabling the pipelining between the communica- tion tasks and all the computing tasks without introducing any extra communication overhead during training. Third, due to the pipelining between the communication tasks and feed-forward computing tasks, tensor fusion tech- niques [16,23,24], which have been proven effective in reduc- ing the latency overhead in WFBP [13], becomes impractical in DeAR. The main challenge is how to determine which tensor should (not) be fused. To this end, we propose a dynamic tensor fusion algorithm using Bayesian optimization in DeAR to judiciously determine which tensors should be fused to improve the training efficiency, without any prior knowledge about the model and cluster configurations. We implemented DeAR atop PyTorch. Our implementation provides an easy-to-use API such that users can integrate our training algorithm by adding a few lines of code. Extensive experiments are conducted with popular DNNs on a 64- GPU cluster under various system configurations. Experi- mental results show that, compared with the state-of-the-art solutions, including PyTorch-DDP, Horovod, MG-WFBP [23], and ByteScheduler [25], DeAR accelerates the model training by up to 83% and 15% over 10Gb/s Ethernet and 100Gb/s InfiniBand interconnects, respectively. In all experiments, the training speedup enabled by DeAR reaches 72.3-99.2% of the maximum possible. II. BACKGROUND AND MOTIVATION A. Mini-batch SGD The training of DNN models is to minimize a designed loss function L(w, X), where w is the model parameter and X is the training data. In mini-batch SGD, the model param- eters is updated iteratively based on its first-order gradient. Specifically, at each iteration i, a mini-batch data (Xi) is randomly sampled to calculate the loss through feed-forward from the first layer; and then the first- order gradient w.r.t. the model parameter is calculated through backpropagation. Then, the gradient is used to update the layer to the last wi+1 = wi − η∇L(wi, Xi), (1) where η is the learning rate, wi and Xi are the model parameter and sampled data at iteration i, respectively. Thus, in a single-GPU environment, the training time is mainly consumed in the feed-forward and backpropagation computing tasks. B. S-SGD When exploiting multiple workers (e.g., GPUs) to train a single model, synchronous SGD (S-SGD) with data paral- lelism is a de-facto approach for training as it preserves the convergence properties of mini-batch SGD. In S-SGD, each iteration's training data Xi is distributed to P workers as X p i at worker p, where p = 1, 2, ..., P on a P -worker cluster, and all workers keep consistent parameters at every iteration. The update rule of S-SGD is wi+1 = wi − η 1 P P (cid:88) p=1 ∇L(wi, X p i ). (2) It is seen that the distributed gradients should be aggregated before updating the model parameter, which introduces com- munication costs and limits the system scaling efficiency. In practice, the gradient aggregation (GA) can be implemented through a parameter server [26] or an all-reduce collective. We focus on the all-reduce implementation in this work. In summary, the iteration time of S-SGD contains the feed- forward computation time, the backpropagation computation time, and the communication time of gradient aggregation. Due to the layer-wise structure of DNN models, the com- puting tasks and communication tasks can be organized as a directed acyclic graph (DAG) as shown in Fig. 1(a). One layer's communication (ARl) can only begin after its gradient has been calculated (BPl), and its feed-forward computation (FFl) should wait for the completion of ARl. According to the DAG, it is possible to schedule the order of different tasks so that they can be overlapped to shorten the iteration time. C. Wait-free backpropagation Gradient aggregation of some layers can be overlapped with backpropagation using the wait-free backpropagation algo- rithm (WFBP) [13,14], in which the gradient communication can immediately begin after the gradient is calculated. Due to the nature of backpropagation, where the gradients are calculated from the last layer to the first layer, multiple layers communications are scheduled with a first-in-first-out (FIFO) order as shown in Fig. 1(b). In modern DNN models, there are many layers which have a relatively small number of gradients that need to be aggregated, thus WFBP requires tensor fusion (e.g., MG-WFBP [23]) to alleviate the startup overhead in all- reduce communications as shown in Fig. 1(c). However, WFBP and its variant only allow the gradient aggregation communication tasks to be pipelined with back- propagation computing tasks as shown in Fig. 1(b)(c). That learning frameworks. Instead, to enable some communication tasks to be overlapped with feed-forward computing tasks, ByteScheduler [25] re-orders the communication tasks and issues the tasks in an "optimal" order by allowing large tensors to be partitioned into multiple small tensors as shown in Fig. 1(d). First, the communication of the second layer (i.e., AR2), which can only begin after ARL to AR3 in a FIFO order, is scheduled to be executed prior to ARL−1. Second, some large tensors may be partitioned into multiple small tensors to provide finer-grained scheduling. For example, the tensor of layer 2's gradient is partitioned to two tensors which can be separately completed with two all-reduce operations. The pri- ority scheduling and tensor partitioning techniques in enabling the communication tasks to be pipelined with feed-forward computing tasks may work well in the PS architecture [25], but it would have significant performance issues in the all-to- all architecture due to the following two problems. First, re-ordering the communication tasks requires all workers, which execute computing tasks concurrently during training, to have a consensus on communicating a particular tensor. In other words, before aggregating the gradient of a layer, all workers should negotiate with each other that the layer is ready for communicating to ensure the correctness of training. This would introduce extra communication over- heads. Even though the negotiation only needs to communicate several bytes of data, it may have significant latency with the increasing number of workers, especially on high-latency interconnects (e.g., 10Gb/s Ethernet). Second, using tensor partitioning for a finer-grained sched- ule may introduce extra startup overheads of communications. the time cost of an all-reduce communication Generally, contains a startup overhead that is proportional to the number of workers [20]–[23]. For example, in the widely used ring- based all-reduce algorithm, which is a default in NCCL, the startup time is linear to the number of GPUs [21]. Therefore, partitioning a tensor to n smaller tensors to be communicated separately would introduce extra n − 1 startup overheads. For example, on a 64-GPU cluster with 10Gb/s Ethernet, all-reducing a 1MB message takes around 4.5ms, while all- reducing a 500KB message takes around 3.9ms. In summary, existing scheduling techniques to enable the pipelining between communication tasks and feed-forward computing tasks are impractical for distributed training in the all-to-all architecture. Pipelining the communication tasks with feed-forward computing tasks is expected to save one to third of the computation time, but the introduced extra communication overhead in ByteScheduler may be larger than the hidden computation time, resulting an even worse performance. (a) DAG of computing and communication tasks. (b) WFBP. (c) WFBP with tensor fusion. (d) ByteScheduler: priority scheduling and tensor partitioning. Fig. 1: (a) The DAG of computing and communication tasks in an L-layer DNN, and (b-d) the timeline of S-SGD algorithms with different schedules. (b) WFBP: Gradient communication of each layer begins after that layer's gradients are calculated and the communications are executed in a FIFO order. (c) The gradients of nearby layers are fused to be communicated together. (d) ByteScheduler: large tensors may be partitioned into multiple smaller tensors and the order of communications is based on their priorities but not FIFO. is, the feed-forward computing tasks of the next iteration can only begin after all the GA communication tasks of the current iteration have been completed. Thus, the communication tasks have no opportunity to be pipelined with the feed-forward computing tasks, which is sub-optimal if the communication time cannot be fully hidden by the backpropagation com- putation time. The feed-forward computing tasks normally consume around one to third of the total computation time at each iteration [18]. If one can pipeline the communication tasks with feed-forward computing tasks, the one to third computation time could also be saved. D. Priority scheduling and tensor partitioning Though ByteScheduler regards the gradient aggregation as a pair of (PUSH, PULL) in the PS architecture to enable a finer-gained schedule, it cannot use the (PUSH, PULL) feature in all-reduce which is a primitive in existing deep This motivates us to decouple the all-reduce primitive based on its implementation nature to two operations for a finer-grained schedule, and it does not introduce any extra communication overhead. BPLBPL-1BP1FF1FFL-1FFLARLARL-1AR1.........BP computing taskFF computing taskGA communication taskPrecedence constraintBPLBPL-1BP1...TimeARLARL-1AR1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARL,L-1AR3,2,1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARLAR1FF1FFL-1...FFLARLAR2ARL-1...ARL-1...AR2BPLBPL-1BP1FF1FFL-1FFLARLARL-1AR1.........BP computing taskFF computing taskGA communication taskPrecedence constraintBPLBPL-1BP1...TimeARLARL-1AR1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARL,L-1AR3,2,1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARLAR1FF1FFL-1...FFLARLAR2ARL-1...ARL-1...AR2BPLBPL-1BP1FF1FFL-1FFLARLARL-1AR1.........BP computing taskFF computing taskGA communication taskPrecedence constraintBPLBPL-1BP1...TimeARLARL-1AR1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARL,L-1AR3,2,1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARLAR1FF1FFL-1...FFLARLAR2ARL-1...ARL-1...AR2BPLBPL-1BP1FF1FFL-1FFLARLARL-1AR1.........BP computing taskFF computing taskGA communication taskPrecedence constraintBPLBPL-1BP1...TimeARLARL-1AR1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARL,L-1AR3,2,1...FF1FFL-1...FFLBPLBPL-1BP1...TimeARLAR1FF1FFL-1...FFLARLAR2ARL-1...ARL-1...AR2 III. DEAR: DECOUPLING THE ALL-REDUCE PRIMITIVE The design philosophy of our DeAR is to decouple the all-reduce primitive to two continuous operations without introducing extra communication overheads. A. Decoupling all-reduce with zero overhead According to the inherent feature of all-reduce primitive that tries to maximally utilize the network bandwidth or minimally reduce the latency [21,27], it should be implemented with multiple rounds of communications, each of which has mul- tiple workers participating in sending and receiving messages simultaneously. Thus, it is very common that the all-reduce algorithm is implemented with a combination of other basic routines [20]. For example, the ring-based all-reduce algorithm can be implemented by a ring-based reduce-scatter operation followed by a ring-based all-gather operation [21]. Thus, the- oretically, the all-reduce primitive can be decoupled into two or more continuous operations whose total time equals to the time cost of the all-reduce primitive. The decoupled operations of a primitive will allow finer-grained tasks scheduling in distributed training. As our goal is to enable some communication tasks to be pipelined with feed-forward computing tasks, we break down the all-reduce operation OPar into two continuous communi- cation operations, say OP1 and OP2. Note that the total time of OP1 and OP2 equals to the time of OPar, which means the decoupling is free. Therefore, OP1 of different layers can still be pipelined with backpropagation computing tasks, while OP2 can be pipelined with feed-forward computing tasks. The DAG of computing and communication tasks in DeAR is shown in Fig. 2(a). One layer's gradient aggregation is composed of two continuous communication operations. Compared to Fig. 1(a), the fine-grained DAG with decoupled all-reduce allows us to schedule OP1 and OP2 communication tasks separately, which offers great opportunities to pipeline the communication tasks with feed-forward computing tasks without tensor partitioning. In this work, we use the ring-based all-reduce algorithm, which is widely used in distributed training, as an example to show how we decouple it with zero overhead. Note that the key idea of DeAR can be applied in any all-reduce algorithms as long as they can be decoupled into two operations without introducing any extra overhead. In the ring-based algorithm on a P -worker cluster, the d elements are divided to P chunks, each of which has d/P elements. In the first step, each chunk will be reduced to each worker via P − 1 communication rounds, which is a reduce-scatter operation and it takes a time complexity of trs = (P − 1)(α + d P β), (3) where α and β are the latency and transmission time per element between two workers according to the α − β cost model [28]. As we only focus on the communication time, we omit the overhead of arithmetic operations of accumulating elements in Eq. 3. (a) DAG of computing and communication tasks in DeAR. (b) Timeline of DeAR with an order of FIFO for communications. (c) Timeline of DeAR with tensor fusion. Fig. 2: (a) The DAG of computing and communication tasks with an L-layer DNN in DeAR. (b) DeAR without tensor fusion: the decomposed communications are executed in a FIFO order. (c) DeAR with tensor fusion: Nearby gradients could be merged to a single one for the decoupled operations. In the second step, each reduced chunk at every worker is broadcast to all other workers, which is an all-gather operation and it also takes P −1 communication rounds in the ring-based algorithm. The all-gather operation has a time complexity of tag = (P − 1)(α + d P β). (4) Putting Eq. 3 and Eq. 4 together, we achieve the time complexity of an all-reduce operation as follows. tar = 2(P − 1)α + 2(P − 1)d P β. (5) B. Pipelining communication tasks without re-ordering By decoupling the all-reduce primitive to two continuous it becomes possible to pipeline the first com- operations, munication operation with backpropagation computing tasks, and pipeline the second communication operation with feed- forward computing tasks as shown in 2(b). To guarantee data dependencies between tasks at run-time, we propose 1) Back- Pipe: starting the communication task of OP1 immediately when the gradient of one layer is ready in the backward pass, and 2) FeedPipe: waiting for the completion of the communication task of OP2 of one layer before its feed- forward computation, and starting the communication task of OP2 of the next layer. Besides, we synchronize all the tasks of OP1 at the end of BackPipe to ensure the dependencies between OP1 and OP2. In doing so, our DeAR can execute the communication tasks asynchronously to support pipelining with both feed-forward and backpropagation computing tasks, while preserving data BPLBPL-1BP1FF1FFL-1FFLARL->OP1ARL-1->OP1AR1->OP1.........ARL->OP2ARL-1->OP2AR1->OP2BPLBPL-1BP1...Time...BPLBPL-1BP1...TimeARL->OP1ARL-1->OP1AR1->OP1...FF1FFL-1...FFLARL->OP2...AR1->OP2ARL-1->OP2ARL->OP1ARL-1,L-2->OP1AR1->OP1FF1FFL-1...FFLARL->OP2...AR1->OP2ARL-1->OP2BPLBPL-1BP1FF1FFL-1FFLARL->OP1ARL-1->OP1AR1->OP1.........ARL->OP2ARL-1->OP2AR1->OP2BPLBPL-1BP1...Time...BPLBPL-1BP1...TimeARL->OP1ARL-1->OP1AR1->OP1...FF1FFL-1...FFLARL->OP2...AR1->OP2ARL-1->OP2ARL->OP1ARL-1,L-2->OP1AR1->OP1FF1FFL-2...FFLARL->OP2...AR1->OP2ARL-1,L-2->OP2FFL-1BPLBPL-1BP1FF1FFL-1FFLARL->OP1ARL-1->OP1AR1->OP1.........ARL->OP2ARL-1->OP2AR1->OP2BPLBPL-1BP1...Time...BPLBPL-1BP1...TimeARL->OP1ARL-1->OP1AR1->OP1...FF1FFL-1...FFLARL->OP2...AR1->OP2ARL-1->OP2ARL->OP1ARL-1,L-2->OP1AR1->OP1FF1FFL-2...FFLARL->OP2...AR1->OP2ARL-1,L-2->OP2FFL-1 dependencies between tasks without any requirement to adjust the order of communication tasks. That is, communication tasks are issued among all workers consistently from the last layer to the first layer during backpropagation and its reverse order during feed-forward, respectively. Therefore, all workers do not need the time-consuming negotiation with each other to reach a consensus in which tensors should be aggregated. In summary, compared with the WFBP [13,14] or its variant [16,23] algorithms, DeAR is able to overlap the gradi- ent aggregation communications with both feed-forward and backpropagation computing tasks. Compared with ByteSched- uler [25], DeAR enables a finer-grained tasks schedule in distributed training without the requirement of partitioning tensors and re-ordering the communication tasks. Moreover, DeAR reserves the property of tensor fusion as like WFBP, where the gradients in nearby layers can be merged together to be communicated once to reduce the startup over- head. Unlike ByteScheduler which exploits tensor partitioning (a mutual operation with tensor fusion) to provide a fine- grained schedule, DeAR schedules OP1 with backpropagation computing tasks and OP2 with feed-forward computing tasks, which means OP1 in different layers are possible to be merged to be communicated together and it is similar to OP2. We discuss the details about tensor fusion in the following section. IV. TENSOR FUSION IN DEAR Tensor fusion [16,23] has been proven to be a simple yet effective approach to reducing the startup overheads of all-reduce operations. It has become a default feature in distributed DL frameworks like PyTorch-DDP [15] and Horovod [16]. However, how to determine which layers should be merged is quite challenging as merging any nearby layers requires to wait for their backpropagation computing tasks to be completed. A. Preliminary of tensor fusion techniques In the standard all-reduce primitive case (like PyTorch- DDP and Horovod), where the communication tasks only overlap with backpropagation computing tasks, a buffer with a pre-defined size (e.g., 25MB in PyTorch-DDP and 64MB in Horovod) is allocated to store the ready-to-communicate tensors. When the total size of ready tensors reaches out of the buffer size, the buffer is communicated for aggregation with an all-reduce operation, which means multiple tensors stored in the buffer only communicate once at each iteration. The buffer data is then copied back to the original tensors when the current all-reduce operation completes. Due to the gradients in different layers become ready in a backward order, fusing any two layers needs to wait for the completion of all gradients in these two layers as shown in Fig. 1(c). Thus, it is non-trivial to determine the optimal buffer size to achieve minimal iteration time. One can also measure the backpropagation computation time of each layer and estimate the communication time of all-reduce to dynamically determine whether the benefit of merging any two nearby layers is larger than the sacrifice of Fig. 3: Bayesian optimization example: 9 samples; buffer size for training DenseNet-201. tuning the waiting time [23]. Yet, two main issues may make the solution impractical [23]. First, the layer-wise backpropagation time is quite difficult to be correctly measured as each layer gradient may be computed asynchronously. Second, the variant tensor sizes in a DNN model make it difficult to predict the communication time accurately by a simple model. Different from the previous works, DeAR pipelines some communication tasks with feed-forward computing tasks, which means that tensor fusion of any two layers may af- fect the granularity of feed-forward pipelining as shown in Fig. 2(c). Layer L − 1 and layer L − 2 are fused to be communicated once using OP1 so that OP2 of these two layers should also be invoked only once and it should be synchronized before the feed-forward computation of layer L − 2. In this case, OP2 of layer L − 1 cannot be overlapped with the feed-forward computation of layer L − 2. As a result, though DeAR reserves the property of tensor fusion, it is non- trivial to determine which layers should be fused to achieve minimal iteration time. B. Bayesian optimization based tensor fusion In DeAR, fusing the gradients of any two nearby layers has two drawbacks. 1) It requires to wait for the completion of the two layers' gradient computations to start the communication of reduce-scatter, which means the current ready layer cannot start communication immediately. 2) It reduces the opportunity of overlapping all-gather of one layer with the feed-forward computation of its previous layer. Thus, one should carefully choose the tensor fusion strategy such that the overall iteration time can be shortened. Due to the difficulty in formulating the tensor fusion problem with heuristic or optimal solutions, we choose to use Bayesian optimization (BO) [29,30], which attempts to find good parameters of an unknown objective function in as few number of trials as possible [16,25]. The target of BO used in DeAR is try to achieve maximum training performance (measured as the system throughput, i.e., the number of training samples that can be processed per second) during run-time in our system. We use P (x) to denote the performance model of our system, which is unknown, and x is the buffer size which is an input parameter used for tensor fusion. Note that different x may generate different tensor fusion solutions. Specifically, nearby layers are put into one group if their total number of gradients does not exceed the 020406080100Buffer Size (MB)2.02.53.03.5Throughput (samples/sec)1e3SamplesPrediction95% confidence interval size x. Gradients in one group will have only one reduce- scatter operation during backpropagation, and one all-gather operation during feed-forward. We would like to update x dynamically such that P (x) converges to a stable value. BO is effective to find near-optimal tensor fusion solu- tions for three reasons. First, BO uses the Gaussian process regression in predicting the function value, so it has no constraints on the objective function format and only relies i.e., ˆP (x1), ˆP (x2), ..., ˆP (xn). on the existing observations, Second, BO usually needs a few number of trials to find good solutions, which only requires very small search costs. This is because BO suggests the next system configuration based on a well-defined acquisition function [31]. In this work, we use expected improvement (EI) acquisition function to pick the next point that can maximize the expected improvement over the current best result. Third, BO can tolerate uncertainty with quantitative confidence interval. For example, by tuning the EI hyper-parameter, we find BO can balance between exploitation and exploration during the search process, which is helpful to escape from a local optimum. In general, smaller EI hyper- parameter prefers exploitation (i.e., most points are around the peaks), while larger value prefers exploration (i.e., the points are more spread out across the whole range) [31]. In this problem, we set EI hyper-parameter as 0.1 to prefer buffer size exploration, e.g., from 1MB to 100MB (see Fig. 3). To support BO during training, we first use a default buffer size x1 = 25MB to initialize the tensor fusion configuration and measure the average system throughput (i.e., ˆP (x1)) over multiple steps (e.g., 10 steps). Based on this measurement ˆP (x1), BO fits the performance function and suggests the next buffer size x2, which can be used to generate a new tensor fusion solution. By repeating this process, BO can predict the performance accurately with enough samples, and find a good tensor fusion solution. For example, in Fig. 3, we use BO to find the buffer size for training DenseNet-201 [32] in DeAR. With only 9 samples, it returns a nearly optimal value at 35MB with a good confidence. In practice, tens of trials are enough to find a good solution for DeAR (see Figure 10), while the BO tuner developed for Horovod is much more costly, as it needs to search multiple system configurations including buffer size, cycle time, response cache, and hierarchical collective algo- rithms [16]. V. IMPLEMENTATION We implement our prototype system, DeAR, based on PyTorch and NCCL. In the system, we wrap a communication library using C/C++ based on NCCL and expose APIs for high-level scripts in Python. The overview of our DeAR implementation is shown in Fig. 4. The blue components are new in DeAR, but they are totally transparent to end users. Users only need to change their code (normally with several new inserted lines) to use DeAR. A. Workflow of DeAR We implement our DeAR as a middle layer between user code and communication primitives. DeAR does not change Fig. 4: Overview of our system (blue parts are new). the original DAG constructed in PyTorch. A distributed opti- mizer is implemented in DeAR to handle the gradient commu- nications in hook functions provided by PyTorch APIs. Before communicating gradients through reduce-scatter or all-gather, gradients should be put in the tensor fusion controller which determines whether the pushed tensor should be copied to the buffer to be communicated together. When the buffer should be aggregated among all workers, DeAR invokes the wrapped NCCL APIs (e.g., ncclReduceScatter and ncclAllGather) in communication package. B. User usage 1 import dear # +++ 2 dear.init() # +++ 3 optim = torch.optim.SGD(model.parameters(), ...) 4 optim = dear.DistOptim(optim, model, ...) # +++ 5 # Training 6 model.train() 7 for i in range(epochs): 8 for data, target in train_loader: 9 train_step(optim, data, target) ... 10 11 # Validation 12 optim.synchronize() # +++ 13 optim.step() # +++ 14 model.eval() 15 validation() Listing 1: Code example of using DeAR To make our DeAR be easily integrated with existing user code, we design a distributed optimizer (DistOptim) that is exposed to users. Users only need to wrap their original PyTorch optimizer instances to our DistOptim and initialize a new instance of the optimizer as the sample code shown in Listing 1. The first two lines should be inserted to initialize the run-time of DeAR. Then line 4 is inserted after the standard optimizer instance and the training code remains unchanged. As DeAR pipelines the communication tasks of current itera- tion with the next iteration's feed-forward computing tasks, the communication tasks should be forced to synchronize GPUsEthernet or InfiniBandMPIHardwareCommunication PrimitivesNCCLCommunication PackageC/C++ WrapperPipeTrain CoreUser ScriptsPyTorch Distributed OptimizerCBO-based Tensor FusionDistributed optimizer_forward_pre_hook_backward_hookregister_forward_pre_hookregister_backward_hook Tensor fusion controller_generate_solution_fuse_tensorsCommunication PackageUser scriptsCoreGPUsEthernet or InfiniBandMPINCCLCommunication Primitives to update the model parameters (lines 12 and 13) before evaluating the model. VI. EVALUATION A. Experimental settings Testbeds. We conduct experiments on a 16-node dense- GPU cluster, which has 64 Nvidia GTX 2080Ti GPUs with four GPUs per node. The cluster is connected with both 10Gb/s Ethernet (10GbE) and 100Gb/s InfiniBand (100GbIB). Thus, we can choose two different network configurations to test the scalability of different algorithms. Each node has 512GiB RAM and the same software configurations. Specif- ically, each node is installed with Ubuntu18.04, CUDA-10.2, cuDNN-7.6, NCCL-2.10, OpenMPI-4.0, and PyTorch-1.8. We use NCCL APIs for all collective communications in our experiments. DNN models. We choose two popular types of DNNs. They are image classification models, CNNs, on the ImageNet dataset [33], and NLP pre-training models BERT [34]. The detailed settings are shown in Table I. A training sample is an image with a resolution of 224 × 224 × 3 for CNNs, and a sentence with a length of 64 words for BERTs. TABLE I: DNN details for experiments. "BS" denotes the mini-batch size per GPU. "# Layers" represents the number of learnable layers. "# Tensors" and "# Param." denote the number of learnable parameter tensors and the number of elements (million) in these tensors, respectively. Application Image Classification NLP Pre-training Model ResNet-50 [35] DenseNet-201 [32] Inception-v4 [36] BERT-Base [34] BERT-Large [34] BS # Layers # Tensors # Param. (M) 161 64 604 32 449 64 206 64 398 32 25.6 20.0 42.7 110.1 336.2 107 402 299 105 201 Baselines. We compare our system with existing state- of-the-art systems including Horovod-0.21.3 [16], PyTorch- DDP [15] (at PyTorch-1.8), ByteScheduler3, and MG-WFBP4. All the systems are based on the DL framework PyTorch. B. Verification of all-reduce breakdowns To verify that the decoupling of all-reduce has almost zero overhead with different message sizes on dense-GPU clusters, we measure the elapsed-time of all-reduce and its decoupling methods (i.e., reduce-scatter, all-gather, and their combination). We run experiments using nccl-tests5 on the 64- GPU cluster connected with 10GbE. The results are shown in Fig. 5, in which we can see that both reduce-scatter and all-gather take around half of the time of all-reduce with both small and large sizes messages. Thus, DeAR enables a finer-grained schedule for the decoupled communication tasks without introducing extra communication overheads. 3https://github.com/bytedance/byteps/tree/bytescheduler/bytescheduler (at GitHub commit 33fe89). Note that ByteScheduler cannot support PyTorch- 1.8, so we configure PyTorch-1.4 when running ByteScheduler. 4https://github.com/HKBU-HPML/MG-WFBP (at GitHub commit 5b8ad5) 5https://github.com/NVIDIA/nccl-tests (a) Small size: (1K, 1M) (b) Large size: (1M, 100M) Fig. 5: Performance comparison with different message aggre- gation methods. "RSAG" represents the all-reduce algorithm that is implemented with a reduce-scatter operation followed by an all-gather operation. (a) 64 GPUs with 10GbE (b) 64 GPUs with 100GbIB Fig. 6: Speedups without tensor fusion. The performance of WFBP is used as the baseline. ByteScheduler runs out-of- memory (OOM) in BERT-Large. C. Speed comparison w/o tensor fusion We first show the benefits of overlapping the communica- tion tasks with feed-forward computing tasks in our DeAR without any tensor fusion techniques. We compare DeAR with existing scheduling algorithms without tensor fusion including WFBP [13] and ByteScheduler [25]. For a fair comparison with WFBP, we implement the all-reduce API with a reduce- scatter operation followed by an all-gather operation. The speedup results are shown in Fig. 6, using the performance of WFBP as the baseline. Compared with WFBP which only pipelines the commu- nications with backpropagation computing tasks, our DeAR achieves 6%-19% improvement tested cases due to our fine-grained schedule where the communication tasks are pipelined with both feed-forward and backpropagation computing tasks. in all ByteScheduler also pipelines the communications with both it feed-forward and backpropagation computing tasks, but 0.00.20.40.60.81.0Tensor size [bytes]1e602468Time [ms]Reduce-scatterAll-gatherRSAGAll-reduce0.00.20.40.60.81.0Tensor size [bytes]1e8050100150200Time [ms]Reduce-scatterAll-gatherRSAGAll-reduceResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.900.951.001.051.101.151.201.25Speedup<0.9<0.9OOMWFBPByteSchedulerDeARResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.900.951.001.051.10Speedup<0.9<0.9<0.9OOM uses tensor partitioning and task re-ordering to achieve finer- grained scheduling of tasks. However, tensor partitioning and re-ordering require extensive extra communication overheads under the all-to-all architecture, ByteScheduler runs very slow in most cases especially on CNNs, thus its bars in Fig. 6 are very low (e.g., < 0.9). DeAR significantly outperforms ByteScheduler, especially on CNNs. In contrast, on BERT models which have much larger tensor sizes, the performance of ByteScheduler is relatively good since partitioning large tensor sizes does not introduce dramatic extra startup over- heads. (a) 64 GPUs with 10GbE (b) 64 GPUs with 100GbIB Fig. 7: Speedups with tensor fusion. The performance of Horovod is used as the baseline. MG-WFBP runs out-of- memory (OOM) in training BERT-Large. D. Speed comparison w/ tensor fusion Due to the high latency of the all-to-all collectives, ten- sor fusion has become a default feature to accelerate dis- tributed training. Though DeAR decouples one all-reduce op- eration to two operations for better communication scheduling, we need to use tensor fusion for high latency collectives (§IV). We compare our DeAR with existing state-of-the- art algorithms including Horovod, PyTorch-DDP, and MG- WFBP [23], which are all equipped with tensor fusion tech- niques. For a fair comparison, we fix the buffer size of all algorithms with 25MB, except MG-WFBP. The results are shown in Fig. 7, where we use the performance of Horovod as the baseline. On the 10GbE cluster. On the 64-GPU cluster with a relatively high-latency and low-bandwidth 10GbE network, we can see that DeAR with tensor fusion always outperforms all the other methods. Specifically, our DeAR achieves 6%- 83% (an average of 36%) improvement over existing methods on the five tested models. DeAR achieves near-linear scaling efficiency on 64 GPUs in CNNs whose number of parameters is moderate (as shown in Table I). Though DeAR achieves sig- nificant improvement over other methods on BERT models, the scaling efficiency is still low due to the high communication- to-computation ratio. It typically requires some algorithmic- level optimizations like gradient compression [37]. We will leave it as our future work to introduce gradient compression techniques into our DeAR scheduling framework. On the 100GbIB cluster. On the 64-GPU cluster with a low-latency and high-bandwidth 100GbIB network, the startup problem in distributed training is less significant. Even so, the end-to-end performance improvement of our DeAR over existing methods can be up to 15% (an average of 8%). In the 100GbIB network, the scalability of traditional methods like Horovod and PyTorch-DDP is close to linear scale in CNNs. For example, in the 64-GPU case of running ResNet-50, Horovod achieves 91% scaling efficiency leaving limited room for further improvement. Therefore, the improvement of DeAR in 100GbIB over other methods is less significant than that of 10GbE. Given the model size and network configurations, we discuss their maximum speedups in the next subsection. E. Maximum speedups on 64-GPU clusters Intuitively, on a P -GPU cluster, the maximum speedup over a single GPU should be P , i.e., linear scale. However, due to the communication constraint, the maximum speedup may be smaller than P . In DeAR, each training iteration time is composed of four parts: feed-forward computation (tf f ), backpropagation computation (tbp), gradient communication of reduce-scatter (trs) and gradient communication of all- gather (tag). The all-reduce time is tar = trs+tag. Given a DL model with m gradient size and a cluster with P workers, the communication time should be larger than the time when the link bandwidth is fully utilized. For the ring-based all-reduce algorithm, tar ≥ 2m/B according to Eq. 5, where B = 1/β is the minimum link bandwidth between any two workers. Thus, for any scheduling algorithms that pipeline communications with computations, the speedup of the overall throughput on the P -worker system over the single worker is limited by Smax = P × (tf f + tbp) tf f + tbp + tar − min{trs, tbp} − min{tag, tf f } , (6) where min{trs, tbp} and min{tag, tf f } are the overlapped time during backpropagation and feed-forward, respectively. Optimally, either computations or communications are fully hidden. According to the link bandwidth of 10GbE and 100GbIB and the model size shown in Table I, we can compare the achieved speedups of DeAR on the 64-GPU cluster over a single GPU with the maximum speedups as shown in Table. II. It is seen that given a high communication-to-computation ratio, the linear scaling efficiency may not be reachable. For example, on the 10GbE cluster, theoretically, running BERT models on 64 GPUs can only achieve less than 25.5 times speedup over a single GPU. In our DeAR which has two level of pipelining between communications and computations, it achieves an average of 93.6% and 83.9% of the theoretical ResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.500.751.001.251.501.752.00SpeedupOOMHorovodPyTorch-DDPMG-WFBPDeARResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.900.951.001.051.101.151.20SpeedupOOM TABLE II: Comparison between the real speedup (S) of DeAR on 64-GPU clusters over single GPU and the theoretical maximal speedup (Smax). Model ResNet-50 DenseNet-201 Inception-v4 BERT-Base BERT-Large 59.8 56.5 94.5% 64 57.2 89.4% 64 52.8 82.5% 64 54.0 84.4% 25.5 23.9 93.9% 64 49.6 77.5% 12.1 11.8 98.0% 51.8 37.5 72.3% 61.6 61.1 99.2% 64 61.6 96.2% 10- GbE 100- GbIB Smax S S Smax Smax S S Smax optimal speedup on 10GbE and 100GbIB interconnects, re- spectively. Thus, reduce-scatter has more communication tasks to be overlapped with computing tasks than all-gather. DeAR vs. Horovod. In the results on the breakdown of the iteration time, we can see that DeAR has a smaller non-overlapped communication time than Horovod. Though our DeAR has a similar pipelining with Horovod during backpropagation, DeAR has the opportunity to further pipeline the communications with feed-forward computations, which contributes to the performance improvement. G. Studies of tensor fusion Tensor fusion is an important technique to improve perfor- mance as shown in Fig. 9. The tensor fusion version of DeAR with BO (DeAR-BO) achieves 1.35×-4.54× and 1.29×-1.78× improvement over the version w/o tensor fusion (DeAR w/o TF) under 10GbE and 100GbIB interconnects, respectively. 1) Performance comparison between w/ BO and w/o BO Fig. 8: Time breakdowns. The communication time excludes the part hidden by computations. F. Time breakdowns To understand the improvement of DeAR over existing methods clearer, we break down the iteration time into three parts: feed-forward (FF) computation time, backpropagation (BP) computation time, and gradient aggregation communica- tion time (under the 10GbE network configuration) as shown in Fig. 8. The blue bars are the non-overlapped communica- tion time in one iteration, which means the hidden time by computations is excluded. As both DeAR and Horovod use the same back-end of PyTorch, the FF and BP computation times are the same on the same model. In DeAR, there are two parts of communication, reduce-scatter and all-gather. We use RS-only to indicate that DeAR excludes the time of all- gather, and AG-only to indicate that DeAR excludes the time of reduce-scatter in Fig. 8. RS-only vs. AG-only. In the decoupling of all-reduce, reduce-scatter and all-gather operations have the same message size for communication and they have the same communi- cation complexity as shown in Eq. 3 and Eq. 4. In other words, the communication time of reduce-scatter and all- gather operations should be the same without considering the overlapping with computations. However, as shown in Fig. 8, RS-only has a less communication overhead than AG-only. The reason is that the reduce-scatter operations are overlapped with backpropagation computing tasks which typically take two times slower than feed-forward computing tasks [18]. (a) On the 10GbE cluster (b) On the 100GbIB cluster Fig. 9: Speed improvements with dynamic tensor fusion. Determining which tensors should be fused is very impor- tant in affecting the training performance. We compare our BO-based tensor fusion method (DeAR-BO) with two naive tensor fusion methods, a fixed number of four nearby layers (DeAR-NL) and a fixed buffer size (5MB) threshold (DeAR- FB), and BO-based Horovod. The results are shown in Fig. 9. Horovod-BO vs. Horovod-FB. Horovod with BO (Horovod-BO) achieves only slight improvement in ResNet-50 and DenseNet-201 over Horovod with a fixed buffer (Horovod- FB) size (64MB by default), while Horovod-BO has no improvement in BERT-Base over Horovod-FB. The results indicate that Horovod-FB may be a good solution in tensor fusion for WFBP and tuning the buffer size does not help improve the performance. DeAR-NL vs. DeAR-FB. By merging a fixed number of consecutive layers, DeAR-NL is normally worse than Horovod-FB or DeAR-FB in CNNs as CNNs have a very imbalanced number of parameters in different layers. For the model (BERT-Base) that has a very balanced distribution of parameters in different layers, DeAR-NL performs better than Horovod-FB and DeAR-FB. DeAR-FB vs. Horovod-FB. With the opportunity of over- lapping communications with both feed-forward and back- propagation computing tasks, DeAR-FB normally outperforms Horovod-FB. Since DeAR requires to pipeline tasks during feed-forward, the configured buffer size is more sensitive to the time performance than Horovod-FB. Thus, DeAR-FB only achieves a marginal improvement over Horovod-FB. ResNet-50DenseNet-201Inception-v4BERT-BaseBERT-Large0.00.51.01.52.02.53.0Time [s]RS-onlyRS-onlyRS-onlyRS-onlyRS-onlyAG-onlyAG-onlyAG-onlyAG-onlyAG-onlyDeARDeARDeARDeARDeARHorovodHorovodHorovodHorovodHorovodFF ComputationBP ComputationCommunicationResNet-50DenseNet-201BERT-Base0.00.51.01.52.0Throughput (samples/s)1e4Horovod-FBHorovod-BODeAR w/o TFDeAR-NLDeAR-FBDeAR-BOResNet-50DenseNet-201BERT-Base0.00.51.01.5Throughput (samples/s)1e4 (a) On the 10GbE cluster (b) On the 100GbIB cluster Fig. 10: Tuning cost of different search algorithms. Error bars show standard deviation. (a) ResNet-50 (b) BERT-Base Fig. 11: Speed comparison with different batch sizes. DeAR-BO vs. others. Using BO in DeAR, the buffer size can be well adjusted during run-time. Hence, DeAR- BO can improve the training speed over DeAR-FB, and the evaluated it achieves the best performance among all methods. Specifically, DeAR-BO is around 22%-56% and 7%- 14% faster than Horovod-FB on 10GbE and 100GbIB 64-GPU clusters, respectively. 2) Search cost comparison between BO and other methods In DeAR, we use BO to find a good buffer size. Actually, one can also use random search or grid search to find the solution. However, both random search and grid search take a much larger number of iterations to find a good solution. For example, as shown in Fig.10, in training different models, BO takes several trials to find a stable solution while random and grid search take tens of trials. In DNN training, one cannot consume too much number of iterations to tune their time performance related parameters, otherwise it may result in a longer end-to-end training time than the naive methods. The average cost of BO is 0.207 seconds per trial over 20 trials. H. Performance with different batch sizes The local mini-batch size has a direct impact on the feed- forward and backpropagation computation time, thus training with different batch sizes has different communication-to- computation ratios on the same model, which would affect the opportunity for overlapping. We compare our DeAR with the existing methods on the 10GbE cluster using ResNet- 50 and BERT-Base under different batch sizes as shown in Fig. 11. The batch size is the local mini-batch size for each GPU running on the 64-GPU clusters. Smaller batch size indi- cates shorter computation time while the communication time remains unchanged (if not overlapped). The results show that our DeAR is robust to the mini-batch size and it outperforms all other methods in all tested cases. I. Potential improvement on larger-scale clusters Due to the hardware limit, we are unable to perform exper- iments on larger-scale GPU clusters to verify the performance of DeAR. We provide some discussions here. According to Fig. 7, we can see that the improvement of our DeAR over existing methods on 100GbIB (an average of 8%) is much smaller than on 10GbE (an average of 36%). In our experiment environments, the two clusters are with the same GPU hardware, which means the FF and BP computation time remain unchanged while the network speed of 100GbIB is 10 times faster than 10GbE. That is, existing methods should be better scaling efficiency with a higher network speed, which makes the optimization room be smaller. For example, in ResNet-50, Horovod achieves 58.2× speedup on 64 GPUs with 100GbIB over the single GPU while the maximum speedup is only 64× (Table II). Therefore, any optimization cannot achieve improvement larger than 10% over Horovod. We argue that with increasing size of the cluster and more powerful GPUs, DeAR could have a higher improvement over Horovod and PyTorch-DDP as the communication-to- computation ratio becomes larger. Formally, the theoretical optimal iteration time for DeAR and baseline algorithms with perfect overlapping is given by tDeAR = max{tf f , tag} + max{tbp, trs}, tbaseline = tf f + max{tbp, tar}, (7) (8) where tf f and tbp are feed-forward and back-propagation com- putation time, trs, tag, and tar are reduce-scatter, all-gather, and all-reduce communication time, respectively. Assume that tar = 2trs = 2tag and tbp = 2tf f , we can derive that tbaseline − tDeAR =    0, tag − tf f , tf f , if tag ≤ tf f , if tf f < tag ≤ 2tf f , otherwise. (9) This implies that, if we implement DeAR properly to over- lap communications with forward and backward computa- tions, DeAR can always outperform baseline algorithms such as Horovod and PyTorch-DDP. As the communication-to- computation ratio becomes larger, the saved iteration time can be at most one feed-forward computation cost of tf f . VII. RELATED WORK There are many studies in addressing the communication problem of distributed training, like asynchronous training [38, 39] and gradient compression [40]–[43]. A more comprehen- sive introduction can be found in recent survey papers [44,45]. Here we highlight some very related work from the systems perspective in S-SGD. ResNet-50DenseNet-201BERT-Base0102030# of TrialsRandomBOGrid SearchResNet-50DenseNet-201BERT-Base0102030# of Trials8163264Batch Size0.00.51.01.5Throughput (samples/s)1e4HorovodPyTorch-DDPMG-WFBPDeAR8163264Batch Size024Throughput (samples/s)1e3 A. Efficient all-reduce design As the all-reduce collective is very ubiquitous in distributed deep learning, there are many works providing efficient al- gorithms for different cluster configurations [2,7,8,14,37,46]– [50]. For example, the double-binary trees algorithm [46] has been integrated in NCCL to scale-out on extremely large- scale GPU clusters. Some particular all-reduce algorithms are also designed for different cluster topology, like [51] on Torus networks, [8,48] on NVLink-based GPU servers, [37,47] on public cloud clusters, and [50] on heterogeneous GPU clusters. These designs are orthogonal to our DeAR as long as these algorithms can be decoupled into two operations without introducing extra overheads. For example, one can decompose the double-binary tree-based all-reduce [46] into tree-based reduce and tree-based broadcast, and decompose the hierar- chical ring-based all-reduce [51] into intra-node and inter- node reduce-scatter and all-gather. We leave decoupling more all-reduce algorithms as our future work, and the decoupling configuration can be automatically tuned using BO. B. Communication scheduling Due to the layer-wise structure of DNN models and even tensor-wise in modern deep learning frameworks like PyTorch and TensorFlow, the computing and communication tasks are generally organized as a directed acyclic graph (DAG). Thus, the tasks without any dependency can be executed concurrently, making it possible to hide some communication costs by overlapping them with computing tasks. The wait- free backpropagation (WFPB) algorithm [13,14] was the early scheduling method that pipelines the communication tasks of gradient aggregation with gradient calculation during back- propagation. Then some tensor fusion techniques (e.g., [17,23, 24,52,53]) were further proposed to address the high latency problem in WFBP with all-reduce. As the communication of some large tensors may block the execution of higher-priority tensors, ByteScheduler [25] proposes tensor partitioning in priority scheduling to provide a finer-grained schedule of overlapping between computing and communication tasks. ZeRO [54] decoupled all-reduce like DeAR, but it was to shard parameters to optimize memory rather than optimizing communication efficiency. To shard parameters, ZeRO requires one all-gather for each forward pass and one extra all-gather for each backward pass, which unfortunately has increased the total communication overheads compared with DeAR. In the recent PyTorch v1.13 release, FullyShardedDataParallel6 has combined the ideas of ZeRO's parameter sharding and DeAR's FeedPipe to alleviate the memory and communication it does not consider dynamic overheads, respectively, but tensor fusion to explore the optimal training performance. VIII. CONCLUSION In this work, we proposed a novel communication schedul- ing algorithm named DeAR with fine-grained all-reduce 6https://pytorch.org/docs/stable/fsdp.html pipelining. In DeAR, we first decoupled the all-reduce prim- itive into two continuous communication operations without introducing any extra communication overhead to enable a fine-grained schedule of computations and communications. Then we proposed to pipeline the backpropagation and feed- forward computing tasks with the first operations and second operations of the decoupled all-reduce primitives, respectively. To integrate the effective tensor fusion technique, we proposed a practical tensor fusion method using Bayesian optimization in DeAR to further reduce the communication time with- out considering the DNN model and network configuration. Extensive experiments were conducted on a 64-GPU cluster connected with two types of networks (10Gb/s Ethernet and 100Gb/s InfiniBand) on different applications including CNNs and BERTs. Experimental results show that DeAR achieves up to 83% improvement over existing state-of-the-art methods. ACKNOWLEDGMENTS The research was supported in part by a RGC RIF grant under the contract R6021-20, RGC GRF grants under the contracts 16209120, 16200221, 16207922, 16213120, the Na- tional Natural Science Foundation of China (NSFC) (Grant No. 62272122), and the National Natural Science Foundation of China (NSFC) (Grant No. 62002240). REFERENCES [1] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, M. Ran- zato, A. Senior, P. Tucker, K. Yang et al., "Large scale distributed deep networks," in Proc. of NeurIPS, 2012, pp. 1223–1231. [2] X. Jia, S. Song, S. Shi, W. He, Y. Wang, H. Rong, F. Zhou, L. Xie, Z. Guo, Y. Yang, L. Yu, T. Chen, G. Hu, and X. Chu, "Highly scalable deep learning training system with mixed-precision: Training ImageNet in four minutes," in Proc. of Workshop on Systems for ML and Open Source Software, collocated with NeurIPS 2018, 2018. [3] Y. You, J. Li, S. Reddi, J. Hseu, S. Kumar, S. Bhojanapalli, X. Song, J. Demmel, K. Keutzer, and C.-J. Hsieh, "Large batch optimization for deep learning: Training bert in 76 minutes," in International Conference on Learning Representations, 2020. [4] P. Goyal, P. Doll ́ar, R. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He, "Accurate, large minibatch SGD: Training ImageNet in 1 hour," arXiv preprint arXiv:1706.02677, 2017. [5] Y. Huang, Y. Cheng, A. Bapna, O. Firat, D. Chen, M. Chen, H. Lee, J. Ngiam, Q. V. Le, Y. Wu et al., "GPipe: Efficient training of giant neural networks using pipeline parallelism," Proc. of NeurIPS, vol. 32, 2019. [6] D. Narayanan, M. Shoeybi, J. Casper, P. LeGresley, M. Patwary, V. Ko- rthikanti, D. Vainbrand, P. Kashinkunti, J. Bernauer, B. Catanzaro et al., "Efficient large-scale language model training on GPU clusters using megatron-LM," in Proc. of SC, 2021, pp. 1–15. [7] A. A. Awan, K. Hamidouche, A. Venkatesh, and D. K. Panda, "Efficient large message broadcast using NCCL and CUDA-aware MPI for deep learning," in Proc. of The 23rd European MPI Users' Group Meeting, 2016, pp. 15–22. [8] M. Cho, U. Finkler, and D. Kung, "Blueconnect: Novel hierarchical all- reduce on multi-tired network for deep learning," in Proceedings of the Conference on Systems and Machine Learning (SysML), 2019. [9] C.-H. Chu, P. Kousha, A. A. Awan, K. S. Khorassani, H. Subramoni, and D. K. Panda, "NV-group: link-efficient reduction for distributed deep learning on modern dense GPU systems," in Proceedings of the 34th ACM International Conference on Supercomputing, 2020, pp. 1–12. [10] S. Shi, Z. Tang, X. Chu, C. Liu, W. Wang, and B. Li, "A quantitative survey of communication optimizations in distributed deep learning," IEEE Network, vol. 35, no. 3, pp. 230–237, 2020. [11] P. Xu, S. Shi, and X. Chu, "Performance evaluation of deep learning tools in docker containers," in 2017 3rd International Conference on Big Data Computing and Communications (BIGCOM). IEEE, 2017, pp. 395–403. [12] S. Shi, W. Qiang, and X. Chu, "Performance modeling and evaluation of distributed deep learning frameworks on GPUs," in Proc. of The 4th International Conference on Big Data Intelligence and Computing. IEEE, 2018. [13] H. Zhang, Z. Zheng, S. Xu, W. Dai, Q. Ho, X. Liang, Z. Hu, J. Wei, P. Xie, and E. P. Xing, "Poseidon: An efficient communication archi- tecture for distributed deep learning on GPU clusters," in 2017 USENIX Annual Technical Conference (USENIX ATC 17), 2017, pp. 181–193. [14] A. A. Awan, K. Hamidouche, J. M. Hashmi, and D. K. Panda, "S- caffe: Co-designing MPI runtimes and Caffe for scalable deep learning on modern GPU clusters," in Proceedings of the 22nd ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, 2017, pp. 193–205. [15] S. Li, Y. Zhao, R. Varma et al., "Pytorch distributed: Experiences on accelerating data parallel training," Proc. of VLDB, vol. 13, no. 12. [16] A. Sergeev and M. D. Balso, "Horovod: fast and easy distributed deep learning in TensorFlow," arXiv preprint arXiv:1802.05799, 2018. [17] J. Romero, J. Yin, N. Laanait, B. Xie, M. T. Young, S. Treichler, V. Starchenko, A. Borisevich, A. Sergeev, and M. Matheson, "Accel- erating collective communication in data parallel training across deep learning frameworks," in Proc. of NSDI, 2022, pp. 1027–1040. [18] V. Sze, Y.-H. Chen, T.-J. Yang, and J. S. Emer, "Efficient processing of deep neural networks: A tutorial and survey," Proceedings of the IEEE, vol. 105, no. 12, pp. 2295–2329, 2017. [19] M. Barnett, L. Shuler, R. van de Geijn, S. Gupta, D. Payne, and J. Watts, "Interprocessor collective communication library (intercom)," in Pro- ceedings of IEEE Scalable High Performance Computing Conference, 1994, pp. 357–364. [20] R. Rabenseifner, "Optimization of collective reduction operations," in Springer, 2004, International Conference on Computational Science. pp. 1–9. [21] R. Thakur, R. Rabenseifner, and W. Gropp, "Optimization of collective communication operations in MPICH," The International Journal of High Performance Computing Applications, vol. 19, no. 1, pp. 49–66, 2005. [22] T. Hoefler, W. Gropp, R. Thakur, and J. L. Tr ̈aff, "Toward performance models of MPI implementations for understanding application scaling issues," in European MPI Users' Group Meeting. Springer, 2010, pp. 21–30. [23] S. Shi, X. Chu, and B. Li, "MG-WFBP: Efficient data communication for distributed synchronous SGD algorithms," in IEEE INFOCOM 2019- IEEE Conference on Computer Communications. IEEE, 2019, pp. 172– 180. [24] --, "MG-WFBP: Merging gradients wisely for efficient communica- tion in distributed deep learning," IEEE Transactions on Parallel and Distributed Systems, vol. 32, no. 8, pp. 1903–1917, 2021. [25] Y. Peng, Y. Zhu, Y. Chen, Y. Bao, B. Yi, C. Lan, C. Wu, and C. Guo, "A generic communication scheduler for distributed DNN training acceleration," in Proc. of SOSP, 2019, pp. 16–29. [26] M. Li, D. G. Andersen, J. W. Park, A. J. Smola, A. Ahmed, V. Josifovski, J. Long, E. J. Shekita, and B.-Y. Su, "Scaling distributed machine learning with the parameter server." in OSDI, vol. 14, 2014, pp. 583– 598. [27] P. Patarasuk and X. Yuan, "Bandwidth optimal all-reduce algorithms for clusters of workstations," Journal of Parallel and Distributed Comput- ing, vol. 69, no. 2, pp. 117–124, 2009. [28] R. Thakur and W. D. Gropp, "Improving the performance of collective operations in MPICH," in European Parallel Virtual Machine/Message Passing Interface Users' Group Meeting. Springer, 2003, pp. 257–267. [29] J. Snoek, H. Larochelle, and R. P. Adams, "Practical bayesian optimiza- tion of machine learning algorithms," Proc. of NeurIPS, vol. 25, 2012. constrained [Online]. Available: "Bayesian Optimization: Open source for Python," 2014–. [30] F. Nogueira, global optimization tool https://github.com/fmfn/BayesianOptimization [31] O. Alipourfard, H. H. Liu, J. Chen, S. Venkataraman, M. Yu, and M. Zhang, "Cherrypick: Adaptively unearthing the best cloud config- urations for big data analytics," in NSDI, 2017. [32] G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger, "Densely connected convolutional networks," in Proceedings of the IEEE confer- ence on computer vision and pattern recognition, 2017, pp. 4700–4708. [33] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, "ImageNet: A large-scale hierarchical image database," in Proc. of CVPR, 2009, pp. 248–255. [34] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, "BERT: Pre- training of deep bidirectional transformers for language understanding," in Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), 2019, pp. 4171–4186. [35] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proc. of CVPR, 2016, pp. 770–778. [36] C. Szegedy, S. Ioffe, V. Vanhoucke, and A. A. Alemi, "Inception-v4, inception-resnet and the impact of residual connections on learning," in Proc. of The 31st AAAI, 2017. [37] S. Shi, X. Zhou, S. Song, X. Wang, Z. Zhu, X. Huang, X. Jiang, F. Zhou, Z. Guo, L. Xie et al., "Towards scalable distributed training of deep learning on public cloud clusters," Proceedings of Machine Learning and Systems, vol. 3, pp. 401–412, 2021. [38] S. Zheng, Q. Meng, T. Wang, W. Chen, N. Yu, Z.-M. Ma, and T.-Y. Liu, "Asynchronous stochastic gradient descent with delay compensation," in International Conference on Machine Learning, 2017, pp. 4120–4129. [39] X. Lian, Y. Huang, Y. Li, and J. Liu, "Asynchronous parallel stochastic gradient for nonconvex optimization," in Proc. of NeurIPS, 2015, pp. 2737–2745. [40] D. Alistarh, D. Grubic, J. Li, R. Tomioka, and M. Vojnovic, "QSGD: Communication-efficient SGD via gradient quantization and encoding," in Proc. of NeurIPS, 2017, pp. 1709–1720. [41] Y. Lin, S. Han, H. Mao, Y. Wang, and W. J. Dally, "Deep gradient compression: Reducing the communication bandwidth for distributed training," in International Conference on Learning Representations, 2018. [42] S. Shi, K. Zhao, Q. Wang, Z. Tang, and X. Chu, "A convergence analysis of distributed SGD with communication-efficient gradient sparsifica- tion." in IJCAI, 2019, pp. 3411–3417. [43] D. Basu, D. Data, C. Karakus, and S. Diggavi, "Qsparse-local-SGD: Dis- tributed SGD with quantization, sparsification and local computations," in Proc. of NeurIPS, 2019, pp. 14 695–14 706. [44] Z. Tang, S. Shi, X. Chu, W. Wang, and B. Li, "Communication-efficient distributed deep learning: A comprehensive survey," arXiv preprint arXiv:2003.06307, 2020. [45] T. Ben-Nun and T. Hoefler, "Demystifying parallel and distributed deep learning: An in-depth concurrency analysis," ACM Computing Surveys (CSUR), vol. 52, no. 4, pp. 1–43, 2019. [46] P. Sanders, J. Speck, and J. L. Tr ̈aff, "Two-tree algorithms for full bandwidth broadcast, reduction and scan," Parallel Computing, vol. 35, no. 12, pp. 581–594, 2009. [47] L. Luo, P. West, J. Nelson, A. Krishnamurthy, and L. Ceze, "PLink: Discovering and exploiting locality for accelerated distributed training on the public cloud," in Proceedings of Machine Learning and Systems 2020, 2020, pp. 82–97. [48] G. Wang, S. Venkataraman, A. Phanishayee, N. Devanur, J. Thelin, and I. Stoica, "Blink: Fast and generic collectives for distributed ML," in Proceedings of Machine Learning and Systems 2020, 2020, pp. 172– 186. [49] J. Dong, Z. Cao, T. Zhang, J. Ye, S. Wang, F. Feng, L. Zhao, X. Liu, L. Song, L. Peng et al., "EFLOPS: Algorithm and system co-design for a high performance distributed training platform," in 2020 IEEE International Symposium on High Performance Computer Architecture (HPCA). IEEE, 2020, pp. 610–622. [50] X. Miao, X. Nie, Y. Shao, Z. Yang, J. Jiang, L. Ma, and B. Cui, "Heterogeneity-aware distributed machine learning training via partial reduce," in Proceedings of the 2021 International Conference on Man- agement of Data, 2021, pp. 2262–2270. [51] H. Mikami, H. Suganuma, Y. Tanaka, Y. Kageyama et al., "Massively distributed sgd: Imagenet/resnet-50 training in a flash," arXiv preprint arXiv:1811.05233, 2018. [52] Y. You, A. Buluc ̧, and J. Demmel, "Scaling deep learning on GPU and knights landing clusters," in Proc. of SC, 2017, pp. 1–12. [53] S. Shi, X. Chu, and B. Li, "Exploiting simultaneous communications to accelerate data parallel distributed deep learning," in IEEE INFOCOM 2021-IEEE Conference on Computer Communications. IEEE, 2021, pp. 1–10. [54] S. Rajbhandari, J. Rasley, O. Ruwase, and Y. He, "Zero: Memory optimizations toward training trillion parameter models," in Proc. of SC. IEEE, 2020, pp. 1–16.
http://arxiv.org/abs/2302.12444v3
2023-08-14T05:22:10
2023-02-24T04:10:54
On the Training Instability of Shuffling SGD with Batch Normalization
We uncover how SGD interacts with batch normalization and can exhibit undesirable training dynamics such as divergence. More precisely, we study how Single Shuffle (SS) and Random Reshuffle (RR) -- two widely used variants of SGD -- interact surprisingly differently in the presence of batch normalization: RR leads to much more stable evolution of training loss than SS. As a concrete example, for regression using a linear network with batch normalization, we prove that SS and RR converge to distinct global optima that are "distorted" away from gradient descent. Thereafter, for classification we characterize conditions under which training divergence for SS and RR can, and cannot occur. We present explicit constructions to show how SS leads to distorted optima in regression and divergence for classification, whereas RR avoids both distortion and divergence. We validate our results by confirming them empirically in realistic settings, and conclude that the separation between SS and RR used with batch normalization is relevant in practice.
[ "David X. Wu", "Chulhee Yun", "Suvrit Sra" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12444v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12444v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "math.OC" ]
3 2 0 2 g u A 4 1 ] G L . s c [ 3 v 4 4 4 2 1 . 2 0 3 2 : v i X r a On the Training Instability of Shuffling SGD with Batch Normalization David X. Wu UC Berkeley, Berkeley, CA, USA 94720 Chulhee Yun KAIST, Seoul, Korea, 02455 Suvrit Sra Massachusetts Institute of Technology, Cambridge, MA, USA 02139 [email protected] [email protected] [email protected] Abstract We uncover how SGD interacts with batch normalization and can exhibit undesirable training dynamics such as divergence. More precisely, we study how Single Shuffle (SS) and Random Reshuffle (RR)-two widely used variants of SGD-interact surprisingly differently in the presence of batch normalization: RR leads to much more stable evolution of training loss than SS. As a concrete example, for regression using a linear network with batch normalization, we prove that SS and RR converge to distinct global optima that are "distorted" away from gradient descent. Thereafter, for classification we characterize conditions under which training divergence for SS and RR can, and cannot occur. We present explicit constructions to show how SS leads to distorted optima in regression and divergence for classification, whereas RR avoids both distortion and divergence. We validate our results by confirming them empirically in realistic settings, and conclude that the separation between SS and RR used with batch normalization is relevant in practice. 1 Introduction Recent work in deep learning theory attempts to uncover how the choice of optimization algorithm and architecture influence training stability and efficiency. On the optimization front, stochastic gradient descent (SGD) is the de facto workhorse, and its importance has correspondingly led to the development of many different variants that aim to increase the ease and speed of training, such as AdaGrad (Duchi et al., 2011) and Adam (Kingma and Ba, 2014). In reality, practitioners often do not use with-replacement sampling of gradients as required by SGD. Instead they use without-replacement sampling, leading to two main variants of SGD: single-shuffle (SS) and random-reshuffle. SS randomly samples and fixes a permutation at the beginning of training, while RR randomly resamples permutations at each epoch. These shuffling algorithms are often more practical and can have improved convergence rates (Cha et al., 2023; Cho and Yun, 2023; Haochen and Sra, 2019; Safran and Shamir, 2020; Yun et al., 2021b; 2022). Architecture design offers another avenue for practitioners to train networks more efficiently and encode salient inductive biases. Normalizing layers such as BatchNorm (BN) (Ioffe and Szegedy, 2015), LayerNorm (Ba et al., 2016), or InstanceNorm (Ulyanov et al., 2016) are often 1 (a) Depths 1, 2, and 3 linear+BN networks. (b) Finetuned ResNet18. Figure 1: Surprising training phenomena using SS/RR+BN. used with SGD to accelerate convergence and stabilize training. Recent work studies how these scale-invariant layers affect training through the effective learning rate (Li and Arora, 2019; Li et al., 2020; Lyu et al., 2022; Wan et al., 2021). Motivated by these practical choices, we study how SS and RR interact with batch normalization at training time. Our experiments (Fig. 1) suggest that combining SS and BN can lead to surprising and undesirable training phenomena: (i) The training risk often diverges when using SS+BN to train linear networks (i.e. without nonlinear activations) on real datasets (see Figure 1a), while using SS without BN does not cause divergence (see Figure 10). (ii) Divergence persists after tuning the learning rate and other hyperparameters (Section 4.3) and also manifests more quickly in deeper linear networks (Figure 1a). (iii) SS+BN usually converges slower than RR+BN in nonlinear architectures such as ResNet18 (see Figure 1b). In light of these surprising experimental findings, we seek to develop a theoretical explanation. 1.1 Summary of our contributions We develop a theoretical and experimental understanding of how shuffling SGD and BN collude to create divergence and other undesirable training behavior. Since these phenomena manifest themselves on the training risk, our results are not strictly coupled with generalization. Put simply, the aberrant training dynamics stem from BN not being permutation invariant across epochs. This simple property interacts with SS undesirably, although a priori it is not obvious whether it should. More concretely, one expects SGD+BN to optimize the gradient descent (GD) risk in expectation. However, due to BN's sensitivity to permutations, both SS+BN and RR+BN implicitly train induced risks different from GD, and also from each other. • In Section 3.2, we prove that the network f (X; Θ) = W ΓBN(X) converges to the optimum for the distorted risk induced by SS and RR (Theorems 3.2.2 and 3.2.3); the diagonal matrix Γ denotes the trainable scale parameters in the BN layer. Our proof requires a delicate analysis of the evolution of gradients, the noise arising from SS, and the two-layer architecture. Due to the presence of Γ, our results do not assume a fully-connected linear network, which 2 02004006008001000Epoch1.52.02.53.03.54.0GD train riskDepth123ShufflingRRSS01020304050Epoch104103102101100GD train riskLR0.0010.0030.010.03ShufflingRRSS distinguishes them from prior convergence results. In Section 3.3, we present a toy dataset for which SS is distorted away from GD with constant probability while RR averages out the distortion to align with GD. We validate our theoretical findings on synthetic data in Section 3.4. • In Section 4.1, we connect properties of the distorted risks to divergence. With this step, we provide insights into which regimes can lead to divergence of the training risk (The- orems 4.1.3 and 4.1.4). We show that in certain regimes, SS+BN can suffer divergence, whereas RR+BN provably avoids divergence. These results motivate our construction of a toy dataset where SS leads to divergence with constant probability while RR avoids diver- gence (Section 4.2). In Section 4.3, we empirically validate our results on deeper linear+BN networks on a variety of datasets and hyperparameters. Our experiments also demonstrate that SS trains more slowly than RR in more realistic nonlinear settings, including ReLU+BN networks and ResNet18. In doing so, we extend the relevance of our theoretical results to more complex and realistic settings. 1.2 Related work Interplay between BN and SGD. Prior theoretical work primarily studied how BN interacts with GD or with-replacement SGD (Arora et al., 2018; Cai et al., 2019; Li and Arora, 2019; Lyu et al., 2022; Santurkar et al., 2018; Wan et al., 2021). Arora et al. (2018); Wan et al. (2021) assumed global bounds on the smoothness with respect to network parameters and the SGD noise to analyze convergence to stationary points. We instead prove convergence to the global minimum of the SS distorted risk Lπ with no such assumptions (Theorem 3.2.2). Li and Arora (2019) assumed the batch size is large enough to ignore SGD noise, whereas we explicitly exhibit and study the separation between shuffling SGD and GD. For fully scale-invariant networks trained with GD, Lyu et al. (2022) identified an oscillatory edge of stability behavior around a manifold of minimizers. Our BN network has trainable scale-variant parameters W and Γ, and we train with shuffling SGD instead of GD. Hence, the noise that leads to distorted risks is fundamentally different. BN's effect on risk function. Previous work identified the distortion of risk function due to noisy batch statistics in BN. Yong et al. (2020) studied the asymptotic regularization effect of noisy batch statistics in expectation for with-replacement SGD. In contrast, we characterize this noise nonasymptotically w.h.p. over π for SS and a.s. with respect to the data for RR. Wu and Johnson (2021) studied the difficulty of precisely estimating the population statistics at train time, especially when using an exponential moving average. We avoid these issues altogether by evaluating directly on the GD risk. Moreover, we prove concentration inequalities for without-replacement batch statistics (Proposition C.2.4). In the presence of BN, it is common practice to use ghost batch Ghost batch normalization. normalization, a scheme which break up large batches into virtual "ghost" batches, as this tends to improve the generalization of the network (Hoffer et al., 2017; Shallue et al., 2019; Summers and Dinneen, 2020). Minibatch statistics are calculated with respect to the ghost batches, and each gradient step is computed by summing the gradient contributions from the ghost batches. This algorithm is closely related to our method of analysis for SS+BN/RR+BN. Indeed, in our 3 setup we also break up the full batch into mini-batches, and our analysis reduces to showing that SS+BN and RR+BN trajectories track those obtained by following the aggregate gradient signal from summing over mini-batches. We comment more on the similarities between ghost BN and our setup in Section 3.1. Shuffling and optimization. Outside SGD, the effect of random shuffling has also been studied for classical nonlinear optimization schemes such as coordinate gradient descent (CGD) and ADMM (see Gürbüzbalaban et al. (2020); Sun et al. (2020) and references therein). On convex quadratic optimization problems, they demonstrate separations in convergence rates between SS, RR, and with-replacement sampling. Our main focus is the optimum that the algorithms converge to rather than their convergence rates. Implicit bias. Our work is also motivated by a burgeoning line of work which studies the implicit bias of different optimization algorithms (Gunasekar et al., 2018; Jagadeesan et al., 2022; Ji and Telgarsky, 2018; 2019; 2020; Soudry et al., 2018; Yun et al., 2021a). These results establish how optimization algorithms such as gradient flow (GF), gradient descent (GD) or even with- replacement SGD are biased towards certain optima. For example, in the interpolating regime, GD converges to the min-norm solution (Gunasekar et al., 2018; Woodworth et al., 2020) for linear regression and the max-margin classifier for classification (Nacson et al., 2019a;b; Soudry et al., 2018). Most directly related to our work is Cao et al. (2023); they establish that linear (CNN) models ΓBN(W X) with BN as the final layer trained with GD converge to the (patchwise) uniform-margin classifier with an explicit convergence rate faster than linear models without BN. Notably, their techniques are able to control the training dynamics of the W inside of BN. In contrast, our networks are of the form W ΓBN(X), so the network is no longer scale-invariant with respect to W , which is essential to their analysis. Furthermore, we study the surprising interactions between shuffling SGD and BN compared to full-batch GD and BN, whereas they use full-batch GD. Finally, while our work does not focus on generalization, it is connected in spirit to implicit bias. Indeed, our analysis centers the study of how the risk functions and optima are affected by choices of the optimizer (SS/RR) and the architecture (BN). 2 Problem setup For n ∈ Z+ we use the notation [n] ≜ {1, . . . , n}. We write π to denote a permutation of [n], and Sn is the symmetric group of all such π. For any matrix A ∈ Rd×n, π ◦ A ∈ Rd×n is result of shuffling the columns of A according to π. Also, ∥A∥2 and ∥A∥F refer to the spectral norm and Frobenius norm, respectively. We write σmin(A) ≜ inf∥v∥=1 ∥Av∥ to denote minimum singular value of A. According to our notation, σmin(A) > 0 only if A is tall or square. We use Span(A) to denote the span of A's columns. The (coordinatewise) sign function sgn(*) : R → {−1, 0, 1} is defined as sgn(x) = x/|x| for x ̸= 0 and sgn(0) = 0. Data. Let Z = (X, Y ) be the given dataset, with X = (cid:2)x1 feature matrix and corresponding labels Y = (cid:2)y1 * * * yn we will assume Y ∈ {±1}1×n. * * * xn (cid:3) ∈ Rd×n representing the (cid:3) ∈ Rp×n. In the classification setting 4 * * * xq Prediction model. A batch normalization (BN) layer can be separated into a normalizing component BN and a scaling component Γ; we ignore the bias parameters for analysis. Given any matrix B = (cid:2)x1 (cid:3) ∈ Rd×q (here, q ≥ 2 is arbitrary), the normalizing transform BN(*) maps it to BN(B) ∈ Rd×q by operating coordinatewise on each xi in B. In particular, for the kth coordinate of xi, denoted as xi,k, the transform BN sends xi,k (cid:55)→ xi,k−μk√ k are the σ2 k +ε batch empirical mean and variance of the kth coordinate, respectively, and ε is an arbitrary positive constant used to avoid numerical instability. For technical reasons, we omit ε in our analysis. The scaling matrix Γ ∈ Rd×d is a diagonal matrix which models the tunable coordinatewise scale parameters inside the BN layer. where μk and σ2 Throughout the paper, we consider neural networks of the form f (*; Θ) = W ΓBN(*)1. We use Θ = (W , Γ) to denote the collection of all parameters in the network. With the presence of batch normalization layers, the output of f is a function of the input datapoint as well as the batch it belongs to. Even changing one point of a batch B can affect the batch statistics (i.e., μk's and σ2 k 's) and in turn change the outputs of f for the entire batch. The collection of network outputs for B reads f (B; Θ) = W ΓBN(B). Loss functions. We study regression with squared loss l( ˆy, y) ≜ ∥ ˆy − y∥2 and binary classi- fication with logistic loss l( ˆy, y) ≜ − log(ρ(y ˆy)), where ρ(t) = 1/(1 + e−t). Let ˆY , Y ∈ Rp×q denote network outputs and true labels for a mini-batch of q datapoints, respectively. Define the mini-batch risk as the columnwise sum L( ˆY , Y ) ≜ q ∑ i=1 l( ˆY:,i, Y:,i), where Y:,i denotes the ith column of Y . Optimization methods. We consider shuffling-based variants of SGD, namely single-shuffle (SS) and random-reshuffle (RR). These algorithms proceed in epochs, i.e., full passes through shuffled dataset. As the names suggest, SS randomly samples a permutation π ∈ Sn at the beginning of the first epoch and adheres to this permutation. RR randomly resamples permutations πk ∈ Sn at each epoch k. Throughout, the (mini-)batch size will be denoted as B. For simplicity, we assume that the n datapoints can be divided into m batches of size B. With a permutation π ∈ Sn, the dataset Z = (X, Y ) is thus perfectly partitioned into m batches (X 1 π ), where X j π ∈ Rd×B and Y j π ∈ Rp×B consist of the (j(B − 1) + 1, . . . , jB)th columns of the shuffled π ◦ X and π ◦ Y , respectively. π ), . . . , (X m π , Y m π, Y 1 For a parameter Θ optimized with SS or RR, we denote the jth iterate on the kth epoch by Θk j . 0 which is equal to the last iterate of the previous epoch The starting iterate of the kth epoch is Θk Θk−1 m . For each j ∈ [m], SS and RR perform a mini-batch SGD update with stepsize ηk > 0: Θk j ← Θk j−1 − ηk∇ΘL( f (X j πk ; Θk j−1), Y j πk ). 1We can readily generalize to arbitrary learned (but frozen) feature mappings under suitable changes to the assumptions. 5 3 Main regression results: convergence to optima of distorted risks In this section, we introduce the framework of distorted risks to elucidate the distinction between SS+BN and RR+BN. This framework also applies to classification; we continue to study it in Section 4. We then present our global convergence results (Theorems 3.2.2 and 3.2.3) for the distorted risks induced by SS and RR for squared loss regression. In the one-dimensional case, we uncover an averaging relationship between the SS and RR optima (Proposition 3.3.1) which can help RR reduce distortion. We exemplify this averaging relationship with a simple example and extend it to higher dimensions with experiments on synthetic data. 3.1 Framework: the idea of distorted risks We now formally introduce the notion of a distorted risk. Distorted risks are crucial to our analysis, as they encode the interaction between shuffling SGD and BN. We show that these distorted risks Lπ and LRR are respectively induced by certain batch normalized datasets X π and X RR. Recall that the network outputs for a batch depend on the entire batch. The undistorted risk we actually want to minimize is the risk which corresponds to full-batch GD. Define the GD features X GD ≜ BN(X), which induces this GD risk: LGD(Θ) ≜ L( f (X; Θ), Y ) = L(W ΓX GD, Y ). However, during epoch k, SS or RR optimizes a distorted risk dependent on πk. To see why, define the SS dataset X π ≜ BNπ(X) ≜ (cid:2)BN(X 1 π) * * * Y m π Yπ ≜ (cid:2)Y 1 (cid:3), * * * BN(X m π )(cid:3) π for every permutation π ∈ Sn. Similarly, form the RR dataset (X RR, YRR) ∈ Rd×(n*n!) × Rp×(n*n!) by concatenating the SS datasets (X π, Yπ) across all π. Crucially, the SS data X π encodes the distortion due to the interaction between SS with permutation π and BN; the RR data X RR does the same for RR and BN. Indeed, since SS uses fixed π, it implicitly optimizes the SS distorted risk Lπ(Θ) ≜ m ∑ j=1 L( f (X j π; Θ), Y j π) = L(W ΓX π, Yπ). Likewise, by collapsing the epoch update into a noisy "SGD" update, we observe that RR over epochs implicitly optimizes the RR distorted risk LRR(Θ) ≜ 1 n! ∑ π∈Sn Lπ(Θ) = 1 n! L(W ΓX RR, YRR). We reiterate that SS and RR distortions originate from using both shuffling and batch normal- ization: shuffling alters the batch-dependent affine transforms that BN applies. With this notation, the connection between SS+BN/RR+BN and ghost BN becomes more evident: one can view the full batch as the batch in ghost BN and the mini-batches as the virtual ghost batches. Moreover, the proofs of Theorems 3.2.2 and 3.2.3 demonstrate that ghost BN would witness the same type of distortion as SS+BN/RR+BN. To aid clarity, we adopt the convention that overlines connote batch normalization with some batching, and vice versa. For example, the SS dataset X π ≜ BNπ(X) is normalized, while the shuffled dataset Xπ = π ◦ X is not. 6 3.2 Convergence results for regression We now present our main regression results: SS+BN and RR+BN converge to the global optima of their respective distorted risks encoded by the SS dataset X π and the RR dataset X RR. We require the following rank assumptions. Assumption 1 (Full rank assumption). (a) X π ∈ Rd×n satisfies rank(X π) ≥ d. In particular, σmin(X πX (b) X RR ∈ Rd×(n*n!) satisfies rank(X RR) ≥ d. In particular, σmin(X RRX ⊤ π ) > 0. ⊤ RR) > 0. It is natural to ask when Assumption 1 holds. We demonstrate that the following milder assumption implies it; the assumption states that the feature matrix X is drawn from a joint density on matrices in a potentially non-i.i.d. fashion. Assumption 2. X is drawn from a density with respect to the Lebesgue measure on Rd×n. Since BN centers the mini-batch features, we have rank(X π) ≤ min (cid:8)d, (B − 1) n (cid:9) and B)(cid:9).2 We now show that if B > 2 these upper bounds are achieved rank(X RR) ≤ min (cid:8)d, (B − 1)(n almost surely. Thus, we identify reasonable conditions under which Assumption 1 holds almost surely over the draw of data, irrespective of shuffling. Proposition 3.2.1. Assume Assumption 2 and B > 2. Then we have rank(X π) = min (cid:8)d, (B − 1) n and rank(X RR) = min (cid:8)d, (B − 1)(n for X π, and if (B − 1)(n (cid:9) B ≥ d, Assumption 1(a) holds a.s. B)(cid:9) a.s.. Consequently, if (B − 1) n B) ≥ d, Assumption 1(b) holds a.s. for X RR. B B Although we could have just assumed Assumption 1, the nonlinearity introduced by BN makes it nontrivial to identify mild sufficient conditions on the original features to control the rank of SS and RR datasets. Furthermore, controlling the rank of these datasets is crucial to our analysis of GD risk divergence in the classification setting (see Section 4). Next, we present our main SS convergence result: SS converges for appropriate stepsizes. We defer the proof and explicit convergence rates to Appendix A.1. Theorem 3.2.2 (Convergence of SS). Let f (*; Θ) = W ΓBN(*) be a linear+BN network initialized at Θ1 0) = (0, I). We train f using SS with permutation π and suppose that Assumption 1(a) 0 = (W 1 0 , Γ1 holds for this π. SS uses the following decreasing stepsize, which is well-defined: ηk = 1 kβ * min (cid:16) (cid:110) O 1 σmin(X πX ⊤ π ) (cid:17) , (cid:112) 2β − 1 poly(σmin(X poly(n, d, ∥Y ∥F) ⊤ π )) (cid:111) , where 1/2 < β < 1. Then the risk Lπ(Θk 0) converges to the global minimum L∗ π as k → ∞. Theorem 3.2.2 shows that using both SS and BN induces the network to converge to the global optimum of the SS distorted risk instead of the usual GD risk. The proof proceeds by aggregating the epoch-wise gradient updates on the collapsed matrix W Γ. The main difficulty lies in carefully bounding the accumulation of various types of noise. We now turn to RR convergence. For the sake of analysis, we make the following compact iterates assumption which is common in the RR literature (Ahn et al., 2020; Haochen and Sra, 2019; Nagaraj et al., 2019; Rajput et al., 2020). 2Note that XRR contains many duplicate batches; only (n B) of them are unique, up to permutations of B columns inside a batch. 7 Assumption 3. For all (i, k), the iterates Θk constant ARR. i = (W k i , Γk i ) satisfy (cid:13) (cid:13) (cid:13)W k i Γk i (cid:13) (cid:13) (cid:13)2 ≤ ARR for some absolute Finally, we can show that RR converges in expectation to the global optimum of the RR distorted risk LRR. We defer the proof and explicit convergence rates to Appendix A.2. Theorem 3.2.3 (Convergence of RR). Assume Assumption 1(b) and Assumption 3. Using the same f and initialization as in Theorem 3.2.2. we train training f using RR with the following decreasing stepsize, which is well-defined: ηk = 1 kβ * min (cid:16) (cid:110) O 1 σmin(X RRX ⊤ RR) (cid:17) , (cid:112) 2β − 1 poly(n, d, ∥Y ∥F, ARR) (cid:111) , where 1/2 < β < 1. Then the risk LRR(Θk k → ∞. 0) converges in expectation to the global minimum L∗ RR as The proof of Theorem 3.2.3 is similar to the SS case; the main subtlety is using Assumption 3 to handle expectations. The main takeaway of Theorems 3.2.2 and 3.2.3 is that SS+BN and RR+BN converge to the optima of the SS and RR distorted risks, respectively. These distorted optima may differ from optimum of the GD risk. Moreover, the required stepsize for convergence is usually smaller for SS (where the requirement depends on π) compared to RR. 3.3 RR averages out SS distortion Having shown that the two different algorithms drive the network parameters to global optima of two different distorted risks, it behooves us to study these optima. By collapsing the final layers W and Γ into a single matrix M = W Γ ∈ Rp×d, we can study the global optima M ∗ π and M ∗ RR on the normalized datasets X π and X RR. These global optima naturally correspond to the global optima of Lπ and LRR. In this section we illustrate how RR can average out SS distortion in the one-dimensional case. We first relate the SS optima M ∗ RR = ∑π YπX ⊤ π (∑π X πX π to the RR optimum M ∗ RR. A simple gradient calcula- ⊤ π )−1. Since BN enforces the unit variance constraint, ⊤ π = n if d = 1. Simple algebraic manipulation then implies the following proposition. tion reveals M ∗ X πX Proposition 3.3.1. If d = 1, M ∗ RR = 1 n! ∑π∈Sn M ∗ π. Proposition 3.3.1 identifies an explicit averaging relationship between RR and SS in the one- dimensional case. This motivates the following simple construction where RR's averaging behavior removes SS distortion. Dataset: SS distorted with constant probability, RR averages out distortion. We visualize our toy dataset with 16n datapoints where d = p = 1, B = 2, and n = 3 in Figure 2a, along with the possible SS optima M ∗ π. The dataset is comprised of four clusters of 4n points in the square [−1, 1]2. By vertical symmetry of the clusters and Proposition 3.3.1, the RR and GD optima coincide at zero. However, SS is distorted away from GD. An anticoncentration calculation shows M ∗ π ̸= 0 π| = Ω( 1√ with probability 1 − O( 1√ ) with constant probability. The key insight is n n linking SS distortion to breaking symmetry in the SS dataset (see Proposition E.1.1 for details). ) and |M ∗ 8 3.4 Regression experiments For our regression experiments, we used synthetic data with n = 100, B = 10, and d = 10. For i ∈ [n], we sampled xi ∼ N(0, Id) and generated yi = Mtruexi + εi ∈ R with Mtrue ∼ U[−1, 1]d and εi ∼ N(0, 1). We trained the network W ΓBN(X) using SS and RR with an inverse learning rate schedule. We observed convergence to near optimal values on the SS and RR risks (Figure 7), which supports the convergence results (Theorems 3.2.2 and 3.2.3). We also extended the toy dataset to the synthetic setup described above. As Figure 2b makes apparent, SS is consistently distorted away from the GD optimum, whereas RR averages out this distortion effect. We generated 500 datasets and evaluated the distortion for each one with the normalized distance d(M ) ≜ ∥M −M ∗ π) for 1000 ∥MGD∗∥ random draws of π. For RR, we approximated d(M ∗ RR) as follows. We sampled 1000 fresh random permutations to approximate the RR dataset X RR, which we then used to approximate M ∗ RR (since it is intractable to average over all n! permutations). . For SS, we computed the mean d(M ∗ GD∥ (a) Dataset with 48 datapoints demonstrating dis- tortion of SS optima M ∗ π. (b) Normalized distance to GD optimum d(M ) = (cid:13) (cid:13)M − M ∗ GD (cid:13) (cid:13)M ∗ GD (cid:13) (cid:13)/ (cid:13) (cid:13). Figure 2: Top: toy dataset for regression, showing how RR can average out the distortion of SS. Bottom: histogram of distortion of SS and RR optima on synthetic data for d = 10. The SS optima significantly deviate from the GD optima, whereas the RR optima are relatively close. This supports the intuition that RR can nontrivially smooth out the bias of SS in higher dimensions. 4 Main classification results: divergence regimes based on distorted risks We now turn to analyzing linear+BN binary classifiers f (X; Θ) = sgn(W ΓBN(X)) trained with the logistic risk. To characterize divergence, we identify salient properties of the distorted risks first introduced in Section 3.1. These properties identify regimes where the SS+BN classifier can 9 1.000.750.500.250.000.250.500.751.001.000.750.500.250.000.250.500.751.00Cluster 1Cluster 2Cluster 3Cluster 4ZZ1Z2Z3Z4M*GDM*M*RR0.20.40.60.81.0050100150200Normalized distance to GD optimumRRSS diverge on the GD risk (Theorem 4.1.3) yet the RR+BN classifier does not diverge (Theorem 4.1.4). This motivates the construction of a toy dataset (Section 4.2) where the optimal SS classifier diverges on the GD risk with constant probability. In Section 4.3 we extend our results to more realistic networks and datasets, demonstrating that these phenomena are not an artifact of our theoretical setup. Our theoretical results offer some justification for the empirical phenomenon of divergence when SS SGD is combined with BN for classification. We briefly remark on why we analyze divergence conditions instead of directional convergence. The main difficulty lies in analyzing SGD instead of GD. One could hope to extend the techniques for directional convergence for homogeneous networks in Lyu and Li (2019) to the stochastic setting, but this is outside the scope of our paper. Furthermore, the analyses for deep linear networks such as Ji and Telgarsky (2020) rely on invariants which do not hold for us due to the diagonal Γ and the BN layers for deeper networks. Throughout, we use v = (W Γ)⊤ ∈ Rd to refer to the vector that determines the decision boundary of our classifier f . We remind the reader of the datasets which induce the different ≜ (X GD, YGD) = distorted risks (Section 3.1). Given dataset Z = (X, Y ), the GD dataset is ZGD (BN(X), Y ). Similarly define the SS dataset Z π ≜ (X π, Yπ) = (BNπ(X), π ◦ Y ) and the RR ≜ (X RR, YRR) by concatenating Z π over all permutations π. If the labels are clear dataset ZRR from context, we occasionally abuse terminology and refer to the features as the dataset. 4.1 Analysis of problem structure for classification To analyze the optima of the distorted risks, we introduce relevant concepts from Ji and Telgarsky (2019). Given a dataset Z = (X, Y ) = {(xi, yi)}n i=1, with labels yi ∈ {±1}, greedily define a maximal linearly separable subset SLS ≜ (X LS, Y LS) as follows. Include (xi, yi) in SLS if there exists a classifier ui ∈ Rd with yiu⊤ i xj ≥ 0 for all j. For reasons that will be clear shortly, denote the complement of SLS in Z by SSC ≜ (X SC, Y SC). i xi > 0 and yju⊤ In particular, there exists a classifier u such that: (1) SLS is perfectly separated by u (2) the datapoints X SC in SSC are orthogonal to u, so they are on the decision boundary. We can choose u to be the max-margin classifier uMM on SLS. The notation SSC is chosen because the logistic risk is strongly convex when restricted to bounded subsets of Span(X SC), meaning there is a unique finite minimizer vSC in this subspace. Ji and Telgarsky (2019) show that linear classifiers trained on the logistic risk with GD are implicitly biased towards the ray vSC + t * uMM for t > 0. We now identify a salient property of the distorted risks. Definition 1 (Separability decomposition). The separability decomposition of dataset Z refers to Z = SLS ⊔ SSC. If SLS = Z, we say Z is linearly separable (LS). If both SLS and SSC are nonempty, we say Z is partially linearly separable (PLS). Finally, if SSC = Z, we slightly abuse terminology and say Z is strongly convex (SC). 3 Because the logistic loss does not always have finite infima, we now introduce the notion of an optimal direction. 3Here, PLS refers to the "general case" discussed in Ji and Telgarsky (2019), but we chose to use this alternative terminology because we found the term "general" can lead to confusion. 10 Definition 2 (Optimal direction). Given dataset Z = (X, Y ), we say a sequence of iterates v(t) infimizes L if L(v(t)⊤X, Y ) → infw∈Rd L(w⊤X, Y ). We call v ∈ Rd an optimal direction if there exists u ∈ Rd such that {u + tv}t≥1 infimizes L.4 Definition 1 is motivated by the following results which identify how the separability decom- position affects optimal directions. Their proofs are deferred to Appendix B.4. Lemma 4.1.1. Let Z = SLS ⊔ SSC. If v is an optimal direction for L, then v⊤x = 0 for all x ∈ Span(X SC) and yiv⊤xi > 0 for every (xi, yi) ∈ SLS. Combining the above lemma and the definitions yields the following proposition, which characterizes SS and RR divergence using the separability decomposition. π )⊥ converge in direction to some optimal direction v∗ Proposition 4.1.2. Suppose Assumption 1(a) holds, the iterates vπ(t) infimize Lπ, and their projections onto Span(X SC π for Lπ. Then the GD risk LGD diverges if and only if Z π is PLS or LS and there exists some (xi, yi) ∈ ZGD such that yiv∗⊤ π xi < 0. The analogous statement holds true for ZRR under Assumption 1(b). Furthermore, the "if" part holds true for SS and RR without Assumption 1. In particular, Proposition 4.1.2 implies that if the RR dataset is SC and rank d, the GD risk does not diverge. Moreover, it naturally leads to the question of understanding ranks and separability decompositions of the SS and RR datasets; the former question is already answered by Proposition 3.2.1. To analyze the separability decomposition with high probability or almost surely, we assume the labels are balanced. Assumption 4 (Balanced classes). The data Z either has (a) an equal number of positive and negative examples; or (b) at least B positive and B negative examples. Finally, we informally state our main classification: SS+BN can diverge in some regimes (see Theorem B.2.1 for details). Theorem 4.1.3 (SS+BN can diverge (informal))). Assume Assumption 2, Assumption 4(a), and B > 2. B , SS can diverge if B = Ω(log n) and ZGD's separability decomposition can change If d ≤ (B − 1) n with small perturbations. Otherwise, SS can diverge regardless of the batch size and the separability decomposition of ZGD. Whereas Theorem 4.1.3 establishes regimes where SS+BN can diverge, we can show that RR+BN prevents divergence in a much larger regime (see Theorem B.3.1 for details). Theorem 4.1.4 (RR+BN does not diverge (informal)). Assume Assumption 2, Assumption 4(b), and B > 2. If d ≤ (B − 1)(n B), RR does not diverge almost surely. Theorem 4.1.3 implies that one cannot prevent SS divergence by simply increasing the batch size B; it is also necessary for the GD dataset to be "robustly" LS or SC. Moreover, as soon as d > (B − 1) n B , SS can diverge. In stark contrast, Theorem 4.1.4 establishes that even for small B, RR is almost surely robust to divergence as long as d ≤ (B − 1)(n B). Although our theorems do not prove that SS+BN necessarily diverges, they offer some theoretical explanation for why SS+BN appears to be less stable than RR+BN for classification. 4This definition is catered towards the SC+full rank X or PLS/LS case. However, since Proposition 3.2.1 provides sufficient conditions for full-rank data, this subtlety is unimportant. 11 4.2 RR prevents divergence while SS diverges We present a toy dataset where SS drastically distorts the optimal direction, leading to divergence with constant probability. Meanwhile, RR does not diverge on this dataset. We use d = B = 2 to simplify the construction.5 (a) Toy classification dataset showing divergence of SS with constant probability. (b) 3 layer linear+BN networks trained with varying stepsizes. Figure 3: Left: Toy dataset demonstrating divergence of GD risk with constant probability. The dashed lines trace out the convex hulls of the positive and negative points. Right: divergence of GD risk for a variety of stepsizes on CIFAR10. Note that there was eventually a separation for η = 10−4 (see Figure 8). Dataset: SS diverges with contsant probability; RR does not. We describe our construction (Figure 3a) at a high level; see Proposition E.2.1 for details. The GD dataset is PLS with unique optimal direction v∗ GD (its decision boundary is the purple dash-dotted line). Moreover, with constant probability the SS dataset is PLS with unique optimal direction v∗ π (green dotted line) − + distorted away from v∗ err and X π misclassifies points in the GD dataset (X err). Under the additional assumptions in Proposition 4.1.2, the GD risk diverges. Finally, since the RR dataset is SC and rank d, RR does not diverge on the GD dataset. GD. Also, v∗ 4.3 Experiments on linear and nonlinear networks We now verify our theoretical classification results on linear+BN and extend them to nonlinear networks on a variety of real-world datasets. This demonstrates that the separation between SS, RR, and GD is relevant in realistic settings and not merely an artifact of the linear setting. We refer to the linear+BN network W ΓBN(X) as 1-layer linear network, and also consider deeper linear networks with tunable parameters inside BN layers. We observe strikingly different 5Since B = 2, there is no contradiction with Theorem 4.1.3. 12 1.51.00.50.00.51.01.51.00.50.00.51.0X+errX+corXerrXcorXbdrXbdrZGDPosNeg(v*GD)x=0(v*)x=002004006008001000Epoch1.52.02.53.03.54.0GD train riskLR0.00010.0010.01ShufflingRRSS (a) ZGD = (BN(A0 0X), Y ) at initialization. (b) ZGD = (BN(AT 0 X), Y ) after training. (c) Z π = (BNπ(A0 0X), Yπ) at initialization. (d) Z π = (BNπ(AT 0 X), Yπ) after training. Figure 4: Snapshots of GD dataset ZGD and SS dataset Z π before and after running SS for T = 104 epochs with 32 positive and negative synthetic examples. While the GD dataset remains SC, the SS dataset become LS. Here B = 16, η = 10−2, and ε = 10−5 for BN. training behaviors in the shallow and deep linear networks. The networks are formally defined in Appendix D; see https://github.com/davidxwu/sgd-batchnorm-icml for the experiment code. Figure 5: 3 layer ReLU+BN MLP on (left to right): CIFAR10, CIFAR100, and MNIST. Note the slower convergence for SS versus RR. As a motivating example, we ran an experiment on synthetic data (Fig. 4) with the 2-layer linear network f (X) = W ΓBN(AX). Note that the tunable matrix A acts before BN. Intriguingly, 13 2101221012PositiveNegative2101221012PositiveNegative21012321012PositiveNegative2101221012PositiveNegative02004006008001000Epoch104103102101100GD train risk02004006008001000Epoch103102101100GD train risk02004006008001000Epoch105104103102101100GD train riskLR0.00010.0010.01ShufflingRRSS Figure 6: ResNet18 finetuned on (left to right): CIFAR10, CIFAR100, and MNIST. Note the slower convergence for SS versus RR across datasets. For the smallest learning rate η = 10−3, we observed a separation after 200 epochs. we observe that the SS dataset with features X π = BNπ(AX) is SC at initialization, but updating A with SS makes it LS after training. Moreover, the batch size is large relative to n, so this dataset satisfies the necessary conditions for divergence in Proposition 4.1.2 and Theorem 4.1.3. More specifically, Figures 4a and 4c plot the 2-dimensional GD and SS datasets, respectively, which are SC at initialization. However, after training with SS, we can see from Figures 4b and 4d that SS updates A to make the SS dataset LS, whereas the GD dataset stays SC. Hence, by Proposition 4.1.2, the GD risk diverges. This example partially explains the discrepancy in training behavior between the 1-layer and deeper networks. Indeed, whereas the 1-layer architecture has static Z π, the deeper networks have evolving weights inside BN which can push Z π to be LS/PLS. To exhibit the above divergence on real data, we conducted experiments on the CIFAR10. Using SS and RR, we trained linear+BN networks of depths up to 3 for T = 103 epochs using stepsize η = 10−2, batch size B = 128, and 512 hidden units per layer (see Appendix D for precise details). As depicted in Figure 1a, we consistently observed SS divergence for the deeper networks (see Figure 9 for more evidence of divergence). As predicted by Theorem 4.1.4, RR did not exhibit divergence behavior. These phenomena persisted despite ablating the learning rate in {0.01, 0.001, 0.0001}, momentum in {0, 0.9, 0.99}, and batch size in {32, 64, 128}. The learning rate ablation is shown in Figure 3b; see Appendix D for the rest. For the nonlinear experiments, we extended to the CIFAR10, MNIST, and CIFAR100 datasets. We used SS and RR to train 3-layer 512 hidden unit MLPs with BN and ReLU activation for T = 103 epochs, and also to finetune pretrained ResNet18 for T = 50 epochs. We consistently observed that in the final stages of training (i.e., relatively small training risk), SS trained slower than RR across all of the datasets, even after tuning the learning rate (see Figures 5 and 6). 5 Conclusion This paper established that training BN networks with SS can lead to undesirable training behavior, including slower convergence or even divergence of the GD risk. However, RR provably mitigates this divergence behavior, and experimental evidence suggests that using RR usually converges faster than SS. This separation in training behavior between SS, RR, and GD is because data shuffling directly affects how BN operates on mini-batches. Our theoretical results establish a separation for the special case where BN is applied to the input features. The more general and realistic case where BN is applied to dynamically evolving layers is left as an important 14 01020304050Epoch104103102101100GD train risk01020304050Epoch103102101100GD train risk01020304050Epoch104103102101100GD train riskLR0.0010.0030.010.03ShufflingRRSS direction for future work. We also observed in preliminary experiments that a similar separation manifested for generalization, and we hope that adopting a similar perspective will prove fruitful in pursuing this direction. One concrete path towards studying the implicit bias of shuffling SGD and BN with dynamically evolving layers is to combine our techniques with those of Cao et al. (2023). We remark that similar surprising phenomena may arise when using other design choices that are implemented in a mini-batch fashion such as mixup (Zhang et al., 2017) and Sharpness-Aware Minimization (SAM) (Foret et al., 2020). For these reasons, we generally recommend that practitioners use RR instead of SS. Further future directions include establishing directional convergence for homogeneous classifiers trained with shuffling SGD and theoretically understanding conditions under which deeper networks diverge faster. Acknowledgements Part of the work was done while DW was an undergraduate at MIT. DW acknowledges support from NSF Graduate Research Fellowship DGE-2146752. CY acknowledges support by Institute of Information & communications Technology Planning & evaluation (IITP) grant (No. 2019-0- 00075, Artificial Intelligence Graduate School Program (KAIST)) funded by the Korea government (MSIT). CY is also supported by the National Research Foundation of Korea (NRF) grants (No. NRF-2019R1A5A1028324, RS-2023-00211352) funded by the Korea government (MSIT). CY acknowledges support from a grant funded by Samsung Electronics Co., Ltd. SS acknowledge support from an NSF CAREER grant (1846088), and NSF CCF-2112665 (TILOS AI Research Institute). DW appreciates helpful discussions with Xiang Cheng, Sidhanth Mohanty, Erik Jenner, Louis Golowich, Sam Gunn, and Thiago Bergamaschi. References Pankaj K. Agarwal, Leonidas J. Guibas, Sariel Har-Peled, Alexander Rabinovitch, and Micha Sharir. Penetration depth of two convex polytopes in 3d. Nord. J. Comput., 7(3):227–240, 2000. Kwangjun Ahn, Chulhee Yun, and Suvrit Sra. Sgd with shuffling: optimal rates without component convexity and large epoch requirements. arXiv preprint arXiv:2006.06946, 2020. Sanjeev Arora, Zhiyuan Li, and Kaifeng Lyu. Theoretical analysis of auto rate-tuning by batch normalization. arXiv preprint arXiv:1812.03981, 2018. Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. Rémi Bardenet and Odalric-Ambrym Maillard. Concentration inequalities for sampling without replacement. Bernoulli, 21:1361–1385, 2015. Stephen Boyd, Stephen P Boyd, and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004. Yongqiang Cai, Qianxiao Li, and Zuowei Shen. A quantitative analysis of the effect of batch normalization on gradient descent. In International Conference on Machine Learning, pages 882–890. PMLR, 2019. 15 Yuan Cao, Difan Zou, Yuanzhi Li, and Quanquan Gu. The implicit bias of batch normal- ization in linear models and two-layer linear convolutional neural networks. arXiv preprint arXiv:2306.11680, 2023. Jaeyoung Cha, Jaewook Lee, and Chulhee Yun. Tighter lower bounds for shuffling SGD: Random permutations and beyond. arXiv preprint arXiv:2303.07160, 2023. Hanseul Cho and Chulhee Yun. SGDA with shuffling: faster convergence for nonconvex-PŁ minimax optimization. In International Conference on Learning Representations, 2023. John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of machine learning research, 12(7), 2011. Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimiza- tion for efficiently improving generalization. arXiv preprint arXiv:2010.01412, 2020. Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Characterizing implicit bias in terms of optimization geometry. In International Conference on Machine Learning, pages 1832–1841. PMLR, 2018. Mert Gürbüzbalaban, Asuman Ozdaglar, Nuri Denizcan Vanli, and Stephen J Wright. Randomness and permutations in coordinate descent methods. Mathematical Programming, 181:349–376, 2020. Jeff Haochen and Suvrit Sra. Random shuffling beats sgd after finite epochs. In International Conference on Machine Learning, pages 2624–2633. PMLR, 2019. Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the general- ization gap in large batch training of neural networks. Advances in Neural Information Processing Systems, 30, 2017. Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pages 448–456. PMLR, 2015. Meena Jagadeesan, Ilya Razenshteyn, and Suriya Gunasekar. Inductive bias of multi-channel linear convolutional networks with bounded weight norm. In Conference on Learning Theory, pages 2276–2325. PMLR, 2022. Ziwei Ji and Matus Telgarsky. Gradient descent aligns the layers of deep linear networks. arXiv preprint arXiv:1810.02032, 2018. Ziwei Ji and Matus Telgarsky. The implicit bias of gradient descent on nonseparable data. In Conference on Learning Theory, pages 1772–1798. PMLR, 2019. Ziwei Ji and Matus Telgarsky. Directional convergence and alignment in deep learning. Advances in Neural Information Processing Systems, 33:17176–17186, 2020. Charles R Johnson. Matrix theory and applications, volume 40. American Mathematical Soc., 1990. Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 16 Zhiyuan Li and Sanjeev Arora. An exponential learning rate schedule for deep learning. arXiv preprint arXiv:1910.07454, 2019. Zhiyuan Li, Kaifeng Lyu, and Sanjeev Arora. Reconciling modern deep learning with traditional optimization analyses: The intrinsic learning rate. Advances in Neural Information Processing Systems, 33:14544–14555, 2020. Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. arXiv preprint arXiv:1906.05890, 2019. Kaifeng Lyu, Zhiyuan Li, and Sanjeev Arora. Understanding the generalization benefit of normalization layers: Sharpness reduction. Advances in Neural Information Processing Systems, 36, 2022. Andreas Maurer. Concentration inequalities for functions of independent variables. Random Structures & Algorithms, 29(2):121–138, 2006. Boris Mityagin. The zero set of a real analytic function. arXiv preprint arXiv:1512.07276, 2015. Mor Shpigel Nacson, Jason Lee, Suriya Gunasekar, Pedro Henrique Pamplona Savarese, Nathan Srebro, and Daniel Soudry. Convergence of gradient descent on separable data. In Kama- lika Chaudhuri and Masashi Sugiyama, editors, Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics, volume 89 of Proceedings of Machine Learning Research, pages 3420–3428. PMLR, 16–18 Apr 2019a. URL https://proceedings.mlr.press/ v89/nacson19b.html. Mor Shpigel Nacson, Nathan Srebro, and Daniel Soudry. Stochastic gradient descent on separable In Kamalika Chaudhuri and Masashi data: Exact convergence with a fixed learning rate. Sugiyama, editors, Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics, volume 89 of Proceedings of Machine Learning Research, pages 3051–3059. PMLR, 16–18 Apr 2019b. URL https://proceedings.mlr.press/v89/nacson19a.html. Dheeraj Nagaraj, Prateek Jain, and Praneeth Netrapalli. Sgd without replacement: Sharper rates for general smooth convex functions. In International Conference on Machine Learning, pages 4703–4711. PMLR, 2019. Lam M Nguyen, Quoc Tran-Dinh, Dzung T Phan, Phuong Ha Nguyen, and Marten van Dijk. A unified convergence analysis for shuffling-type gradient methods. Journal of Machine Learning Research, 22(207):1–44, 2021. Shashank Rajput, Anant Gupta, and Dimitris Papailiopoulos. Closing the convergence gap of sgd without replacement. In International Conference on Machine Learning, pages 7964–7973. PMLR, 2020. Itay Safran and Ohad Shamir. How good is sgd with random shuffling? In Conference on Learning Theory, pages 3250–3284. PMLR, 2020. Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch normalization help optimization? Advances in neural information processing systems, 31, 2018. 17 Christopher J Shallue, Jaehoon Lee, Joseph Antognini, Jascha Sohl-Dickstein, Roy Frostig, and George E Dahl. Measuring the effects of data parallelism on neural network training. Journal of Machine Learning Research, 20(112):1–49, 2019. Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19 (1):2822–2878, 2018. Cecilia Summers and Michael J. Dinneen. Four things everyone should know to improve batch In International Conference on Learning Representations, 2020. URL https:// normalization. openreview.net/forum?id=HJx8HANFDH. Ruoyu Sun, Zhi-Quan Luo, and Yinyu Ye. On the efficiency of random permutation for admm and coordinate descent. Mathematics of Operations Research, 45(1):233–271, 2020. MTCAJ Thomas and A Thomas Joy. Elements of information theory. Wiley-Interscience, 2006. Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016. Ruosi Wan, Zhanxing Zhu, Xiangyu Zhang, and Jian Sun. Spherical motion dynamics: Learning In A. Beygelzimer, dynamics of normalized neural network using SGD and weight decay. Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=RcbphT7qjTq. Blake Woodworth, Suriya Gunasekar, Jason D Lee, Edward Moroshko, Pedro Savarese, Itay Golan, Daniel Soudry, and Nathan Srebro. Kernel and rich regimes in overparametrized models. In Conference on Learning Theory, pages 3635–3673. PMLR, 2020. Lei Wu, Qingcan Wang, and Chao Ma. Global convergence of gradient descent for deep linear residual networks. arXiv preprint arXiv:1911.00645, 2019. Yuxin Wu and Justin Johnson. Rethinking" batch" in batchnorm. arXiv preprint arXiv:2105.07576, 2021. Hongwei Yong, Jianqiang Huang, Deyu Meng, Xiansheng Hua, and Lei Zhang. Momentum batch normalization for deep learning with small batch size. In European Conference on Computer Vision, pages 224–240. Springer, 2020. Chulhee Yun, Shankar Krishnan, and Hossein Mobahi. A unifying view on implicit bias in training linear neural networks. In International Conference on Learning Representations, 2021a. Chulhee Yun, Suvrit Sra, and Ali Jadbabaie. Open problem: Can single-shuffle SGD be better than reshuffling SGD and GD? In Conference on Learning Theory, pages 4653–4658. PMLR, 2021b. Chulhee Yun, Shashank Rajput, and Suvrit Sra. Minibatch vs local sgd with shuffling: Tight convergence bounds and beyond. In International Conference on Learning Representations, 2022. Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. Yi Zhou and Yingbin Liang. Characterization of gradient dominance and regularity conditions for neural networks. arXiv preprint arXiv:1710.06910, 2017. 18 A Proofs for regression results In this appendix, we provide the full details for the proof of convergence for SS and RR in the regression case. Additional notation. We introduce some additional notation which we will use throughout the proof of Theorems 3.2.2 and 3.2.3. For a matrix A, we use Ai,: and A:,j to denote the ith row and jth column of A, respectively. We also use Ai,j to denote the (i, j)th entry of A. The Hadamard product of two matrices A, B ∈ Rm×n is denoted by A ⊙ B, with (A ⊙ B)i,j = Ai,jBi,j. The diagonal operator diag : Rm×m → Rm×m is defined by diag(A) = I ⊙ A. We denote the Frobenius inner product ⟨A, B⟩F = ∑i,j Ai,jBi,j and its induced norm by ∥A∥F. i . For simplicity, we will often say the (i, k)th iterate to refer to Θk Also recall from Section 2 that when Θ is optimized with SS or RR, the ith iterate on the kth epoch is denoted by Θk i . Denote the collapsed parameter matrix defined in Section 3 by M ≜ W Γ. We will abuse notation and ≜ W k sometimes denote the (i, k)th iterate by M k i i Recall that the mini-batch risk used for updating the (i, k)th iterate of SS or RR is given by (cid:13) 2 (cid:13) (cid:13) π ; Θk L( f (X i+1 the kth epoch and X j π ◦ X and π ◦ Y , respectively. Since this notation is a bit lengthy, we simplify it to L(X j L( f (X j M = W Γ, so we will sometimes abuse notation and write Γk i BN(X i+1 π ) where π denotes the permutation chosen for π ∈ Rp×B consist of the (jB − B + 1, . . . , jB)th columns of π; Θ) ≜ π) for any j ∈ [m]. Here, we can also view the mini-batch risk as a function of ) = π ∈ Rd×B and Y j π − W k i (cid:13) (cid:13)Y i+1 (cid:13) π; Θ), Y j i ), Y i+1 Γk i . π F L(X j (cid:13) (cid:13)Y j π; M ) ≜ (cid:13) π; M ) ≜ −(Y j (cid:13) π − M BN(X j (cid:13) π) (cid:13) π))BN(X j π − M BN(X j F 2 , π)⊤. ∇M L(X j For SS, we work with a fixed permutation π ∈ Sn and input dataset (X, Y ). Recall that we defined X π ≜ BNπ(X) from Section 3, i.e., the column-wise concatenation of all batches after π )]. When the context of parameters Θ = (W , Γ) batch normalization: X π = [BN(X 1 and permutation π ∈ Sn chosen by SS are clear, we denote the collection of outputs over the dataset by ˆYπ ≜ W ΓX π. Also recall that the distorted SS risk Lπ(Θ) we set out to optimize is defined to be Lπ(Θ) = Lπ(W , Γ) = (cid:13) F. With M ≜ W Γ, we also abuse notation and write π) * * * BN(X m (cid:13)Yπ − W ΓX π (cid:13) (cid:13) 2 Lπ(M ) ≜ (cid:13) (cid:13)Yπ − M X π (cid:13) (cid:13) 2 F, ∇M Lπ(M ) ≜ −(Yπ − M X π)X ⊤ π . We will use big–O notation throughout to simplify the presentation of the proofs. When we (cid:13) write O(ηt (cid:13)F, and various absolute constants defined explicitly below. These constants have at most polynomial dependence on these parameters and absolute constants. k) for some exponent t ≥ 1, we hide constants that depend on m, (cid:13) (cid:13)X π A.1 Proof of convergence for SS Let us first prove Theorem 3.2.2. First, we draw the reader's attention to some standard properties in optimization theory that allow us to prove global convergence. We then sketch out the proof in Appendix A.1.2 and flesh out the details in subsequent sections. 19 A.1.1 Optimization properties It is profitable to keep in mind the general idea behind proving global convergence of SGD for a function L(Θ), which has been exploited in Ahn, Yun, and Sra (2020); Nguyen, Tran-Dinh, Phan, Nguyen, and van Dijk (2021); Zhou and Liang (2017). The following two properties of the optimization problem are critical in such approaches: Property 1 (Smoothness). G-smoothness of L, i.e., the gradients of L are G-Lipschitz. In particular, it implies the following two standard properties: (i) L(Θ) ≤ L(Θ′) + ⟨∇ΘL(Θ′), Θ − Θ′⟩ + G 2 ∥Θ′ − Θ∥2 for all Θ, Θ′ in the domain of L. (ii) The Hessian H = ∇2 ΘL(Θ) satisfies ∥H∥2 ≤ G for all Θ in the domain of L. Property 2 (PŁ condition). The loss function L satisfies the α-Polyak-Łojasiewicz condition, i.e., ∥∇L(Θ)∥2 ≥ 2α(L(Θ) − L∗) for all Θ in the domain of L. In our case, we can use global smoothness and strong convexity (which implies the PŁ condition) of Lπ with respect to M = W Γ, but these global properties do not hold with respec to our optimization variables Θ = (W , Γ). Importantly, unlike the analyses of Ahn, Yun, and Sra (2020); Nguyen, Tran-Dinh, Phan, Nguyen, and van Dijk (2021), we cannot directly leverage the global smoothness and strong convexity as is, because we do not directly perform gradient updates on M . Instead, we effectively use a "dynamic" PŁ condition which depends on Γ. The subtlety in the analysis is to show that such behavior can be controlled to ensure convergence in the end. Finally, a third property - which is often exploited to prove convergence results for linear neural networks - is the notion of an (approximate) invariance property satisfied by the layers of the neural network. Indeed, in the continuous time case, i.e., when we minimize Lπ(Θ(t)) with gradient flow ̇Θ(t) = −∇ΘLπ(Θ(t)), such an invariance can be directly shown by the differential equations, see Wu, Wang, and Ma (2019) for instance. To that end, define the following quantity D ≜ I + diag(W ⊤W − Γ2), (A.1) which we refer to as the invariance matrix. For each iterate Θk i can also be naturally defined. In gradient flow, D(t) actually remains invariant with time t ∈ [0, ∞). We quickly prove this property here, and later prove that an approximate version holds in the discrete and stochastic case, although the bounds are messier. i of SS, the corresponding Dk Fact A.1.1. In the gradient flow formulation, we have d and discrete time formulation, we have dt D(t) = 0. Moreover, in both the gradient flow Proof. For the proof, we write out the (full) gradients of Lπ with respect to W and Γ for reference: diag(W ⊤∇W Lπ) = (∇ΓLπ)Γ. (A.2) ∇W Lπ = −(Yπ − ˆYπ)X ∇ΓLπ = − diag(W ⊤(Yπ − ˆYπ)X Γ, ⊤ π ⊤ π ). (A.3) (A.4) A direct calculation shows that diag(W ⊤∇W Lπ) = (∇ΓLπ)Γ. Due to the gradient flow Γ(t) = −∇ΓLπ, so it dt W (t) = −∇W Lπ and d dt formulation ̇Θ(t) = −∇ΘLπ(Θ(t)) we have d follows from Equation (A.2) that d dt D(t) = 0. 20 We now formally state the smoothness and PŁ guarantees for our setup. Lemma A.1.2 (Smoothness with respect to M ). The SS risk Lπ is Gπ–smooth with respect to M = W Γ, where Gπ ≜ (cid:13) (cid:13)X π (cid:13) (cid:13) 2 2. Proof. We directly check the Lipschitz gradient condition. Indeed, we have (cid:13)∇M Lπ(M ) − ∇M Lπ(M ′)(cid:13) (cid:13) (cid:13)2 ⊤ π − (Yπ − M ′X π)X = ⊤ π (cid:13) (cid:13) (cid:13)(Yπ − M X π)X (cid:13) (cid:13)(M − M ′)X πX (cid:13) (cid:13) (cid:13) (cid:13)2 (cid:13)M − M ′(cid:13) (cid:13) (cid:13)2, (cid:13)X π ≤ (cid:13) ⊤ π (cid:13) (cid:13) = 2 2 (cid:13) (cid:13) (cid:13)2 Note that the same inequality holds (with the same value of Gπ) if we instead used the Frobenius norm, due to the fact that ∥AB∥F ≤ ∥B∥2∥A∥F in the last line. Lemma A.1.3 (Strong convexity with respect to M ). Under Assumption 1(a), SS risk Lπ is απ–strongly convex with respect to M = W Γ, where Hence, Lπ is also απ–PŁ with respect to M . απ ≜ σmin(X πX ⊤ π ). Proof. Take the Hessian of Lπ(M ) with respect to the vectorized version vec(M ) of M to ⊤ obtain ∇2 π ⊗ Ip, where ⊗ denotes the Kronecker product. Then evidently vec(M )Lπ(M ) = X πX ⊤ π )Ip. Owing to Assumption 1(a), this proves the claim. vec(M )Lπ(M ) ⪰ σmin(X πX ∇2 A.1.2 Proof sketch of convergence Proof sketch of Theorem 3.2.2. The high level idea is this: we want to prove that Lπ(M k π as k → ∞. However, we will instead show the much stronger statement that Lπ(M k π for all i ∈ [m]. Our high level approach is heavily inspired by the proof strategies in Ahn et al. (2020); Wu et al. (2019). Indeed, many of the technical lemmas in Appendix A.1.4 are analogous to ones proved in Wu et al. (2019), and the motivation for unrolling shuffling mini-batch updates to an epoch update with additional noise comes from Ahn et al. (2020). i ) → L∗ 0 ) → L∗ As a necessary ingredient of the proof, we will demonstrate that for sufficiently small chosen ηk, we have an update equation that roughly looks like (modulo constants and noise terms) Lπ(M k+1 i ) − L∗ π ≲ (1 − ηk)(Lπ(M k i ) − L∗ π) + O(η2 k ) for all 0 ≤ i ≤ m − 1. (A.5) Remark A.1.4. Note that it is not necessarily the case that Lπ(M k i+1) − L∗ π ≲ (1 − ηk)(Lπ(M k i ) − L∗ π) + O(η2 k ) That is, the SS excess risk Lπ does not necessarily "decrease" from one iterate to the next; however, we can instead guarantee that the per-epoch progress bound (Equation (A.5)) holds for any fixed iteration index i ∈ [m] after every epoch. 21 We impose an ordering relation on pairs (a, b) in the natural way: we say (a, b) ≤ (i, k) if k = b and a ≤ i, or if b < k. This is just tracking whether the iteration index (a, b) (the ath iterate of the bth epoch) is seen before the iterate (i, k). To complete the induction on an iterate (i, k + 1) we need three inductive hypotheses L[a, b], D[a, b], and R[a, b] to hold for all (a, b) < (i, k + 1). We define them formally below. Hypothesis 1 (Loss stays bounded by an absolute constant). For all a, b satisfying 0 ≤ a ≤ m − 1 and b ≥ 1, the inductive property L[a, b] states Lπ(Θb a) ≤ CL, for some appropriately chosen absolute constant CL. In particular, we can set CL ≜ max (cid:8)Lπ(Θ1 t ) : 0 ≤ t ≤ m − 1(cid:9). Since we only look at the loss values for the first epoch, CL is indeed an absolute constant depending on π. Hypothesis 2 (Loss satisfies one-epoch inequality). For all a, b satisfying 0 ≤ a ≤ m − 1 and b > 1, the inductive property R[a, b] states that Lπ(M b a ) − L∗ π ≤ (cid:16) 1 − (cid:17) απηk 2 (Lπ(M b−1 a ) − L∗ π) + O(η2 k ), where the constant hidden in the O(η2 k ) does not depend on k. Hypothesis 3 (Approximate invariances hold). For all a, b satisfying 0 ≤ a ≤ m − 1 and b ≥ 1, the inductive property D[a, b] states that (cid:40) (cid:13) (cid:13)Db (cid:13) a (cid:13) (cid:13) (cid:13)2 ≤ CD ∑b−1 CD ∑b t=1 η2 t=1 η2 t ≤ 1 2 t ≤ 1 2 if a = 0, otherwise, where CD is an appropriately chosen absolute constant which does not depend on a or b. Since the first iterate of the kth epoch Θk 0 is the same as the last iterate of the (k − 1)th epoch m, the same convention applies to inductive hypotheses; for example, by L[m, k − 1] we mean Θk L[0, k]. In particular, the inductive hypotheses imply the following claims. (i) By Corollary A.1.8, L[a, b] implies that (cid:13) (cid:13)M b a (cid:13) (cid:13)2 ≤ C1/2 L +∥Yπ∥F ⊤ π ) σmin(X ≜ ξ. (ii) Also by Corollary A.1.8, D[a, b] and L[a, b] together imply that we have 2 + ξ) 2 + ξ). For the sake of notational convenience we will write Cw ≜ ≤ d2( 1 (cid:13) (cid:13)W b a (cid:13) (cid:13) 2 2 and (cid:113) 2 Γb a (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2 + d2( 1 3 ≤ 3 2 + d2( 1 2 2 + ξ), so that max (cid:110)(cid:13) (cid:13)W b a (cid:13) (cid:13)2, (cid:111) (cid:13) (cid:13) (cid:13) Γb a (cid:13) (cid:13) (cid:13)2 ≤ Cw. (iii) By Corollary A.1.13, D[a, b] implies that σmin(Γb a)2 ≥ 1/2. (iv) By Proposition A.1.23, if R[a, b] holds for all (a, b), then for appropriately chosen ηk, the risk Lπ(M b a ) converges to L∗ π at a sublinear rate. We will explain at a high level how these statements together allow us to conclude that L[i, k + 1], D[i, k + 1], and R[i, k + 1] hold. The idea, as in Ahn, Yun, and Sra (2020), is to accumulate the gradient updates in each epoch and isolate the signal and noise components of each gradient update. For clarity of exposition, we assume for now that i = 0. Here are a couple subtleties which we spell out explicitly, including how to generalize to i > 0. 22 • We are not directly performing gradient updates on M ; we instead perform gradient updates on W and Γ. Nevertheless, the effective gradient signal for M can still be extracted, and we term the remaining noise the mismatched gradient noise. For every iterate (j, k), this will formally be denoted by qk j . • We are not taking a full batch gradient step from M k . Rather, we are taking mini-batch updates which induce path dependency. Nevertheless, as previous works have shown, even at iterate (j, k), we can still extract the full-batch gradient signal evaluated at M k 0 , and we term the remaining noise the path dependent noise. For every iterate (j, k), this will formally be denoted by ek j . 0 to M k+1 0 • If i > 0, then the stepsize changes from ηk to ηk+1 in the middle of our pass through the entire dataset. Nevertheless, it's not hard to see that this noise should be relatively small, of k ), as ηk = Ω(1/k). We will call this the stepsize noise, the order ηk+1 − ηk - which is O(η2 accumulation of which for an epoch update starting from iterate (i, k) to (i, k + 1) will be denoted by s(i,k) (i,k+1). We can accumulate these noise terms across the update across epoch k to form a composite 0 will be denoted by ̃gk. We 0 ) because we only perform direct gradient updates on the noise term rk. The full-batch update signal for M starting from M k emphasize that ̃gk ̸= ∇M Lπ(M k component layers W and Γ. Then as we will show in Appendix A.1.3, we can write M k+1 0 = M k 0 − ηk ̃gk + η2 k rk. (A.6) Next, as seen in Lemma A.1.2, Lπ is globally Gπ–smooth with respect to M for some absolute constant Gπ which depends on π. Thus, using the smoothness inequality as in Property 1, we obtain Lπ(M k+1 0 ) − Lπ(M k 0 ) ≤ (cid:68) ∇M Lπ(M k 0 ), M k+1 0 − M k 0 (cid:69) + F Gπ 2 (cid:13) (cid:13)M k+1 (cid:13) 0 − M k 0 (cid:13) (cid:13) (cid:13) 2 F . The main idea is that we have the following inequality (proved in Lemma A.1.14) that shows 0 ), it is nonetheless correlated to the "correct" gradient update that even though ̃gk ̸= ∇M Lπ(M k ∇M Lπ(M k 0 ): (cid:68) ∇M Lπ(M k 0 ), ̃gk(cid:69) F ≥ σmin(Γk 0)2(cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F ≥ (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F , 1 2 due to the inductive hypothesis D[0, k]. For the stated stepsizes ηk, one can then plug in the gradient update Equation (A.6) and massage the inequalities a bit to obtain that Lπ(M k+1 0 ) − Lπ(M k 0 ) ≤ − ηk 4 (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F + O(η2 k ), (A.7) where the constant hidden by the big–O notation is poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F ). We now use απ-strong convexity of Lπ with respect to M (and hence απ-PŁ) shown in Lemma A.1.3 to obtain Lπ(M k+1 0 ) − L∗ π ≤ (cid:16) 1 − (cid:17) απηk 2 23 (Lπ(M k 0 ) − L∗ π) + O(η2 k ). (A.8) Note that this is precisely the statement of R[0, k + 1]. Provided that we can appropriately bound the noise terms rk to get the asserted O(η2 k ) term above, this will imply R[0, k + 1]. For sufficiently small stepsizes ηk, we can also use Equation (A.8) to prove L[0, k + 1]. ≤ On the other hand, to prove D[0, k + 1], we can directly bound the update k ) and combine this with the inductive hypothesis D[m − 1, k] using the triangle inequality. If k < ∞, so the absolute constant CD can be O(η2 the stepsize ηk = O(1/kβ) for 1/2 < β < 1, then ∑k≥1 η2 ≤ 1 2 . picked such that 0 − Dk (cid:13) (cid:13)Dk+1 (cid:13) m−1 0 Hence, R[0, k], as stated in Equation (A.8), holds for all k by induction. We can thus unroll the π under the stated stepsize assumptions, as 0 ) converges to L∗ (cid:13) (cid:13) (cid:13)2 inequality and conclude that Lπ(M k desired. (cid:13) (cid:13)Dk+1 (cid:13) (cid:13) (cid:13) (cid:13)2 We now outline the structure of the proceeding sections, which fill in the details of the above proof sketch. In Appendix A.1.3, we explicitly write out the accumulation of gradient updates across an entire epoch, decomposing into signal and noise components. In Appendix A.1.4, we prove some technical lemmas controlling the singular values and norms of various weight matrices and gradients via the approximate invariance matrix D and the inductive hypotheses. In Appendix A.1.5 we leverage the norm bounds developed in Appendix A.1.4 to demonstrate that the accumulated noise terms defined in Appendix A.1.3 are negligible. Using these results, we are able to establish the R[i, k + 1] and L[i, k + 1] in Appendix A.1.6. We then turn to bounding the approximate invariances to establish D[i, k + 1] in Appendix A.1.7. The stray details of the induction are spelled out in Appendix A.1.8. A.1.3 Rewriting SS epoch gradient updates To show that L[0, k + 1] holds, we need to accumulate gradients from M k First, we look at a single iterate update. For every j < m we have 0 to M k+1 0 M k j+1 = (W k = M k j − ηk∇W L(X j+1 j − ηkgk j + η2 k qk j , π ; Θk j ))(Γk j − ηk∇ΓL(X j+1 π ; Θk j )) where we have defined gk j ≜ ∇W L(X j+1 π ; Θk j )Γk j + W k j ∇ΓL(X j+1 π ; Θk j ), . (A.9) (A.10) (A.11) which is the gradient of the (j + 1)th batch of X π evaluated on the jth iterate on epoch k, and qk j ≜ ∇W L(X j+1 π ; Θk j )∇ΓL(X j+1 π ; Θk j ), (A.12) which is the mismatched gradient noise term associated with the fact that we performed gradient updates on W and Γ rather than M directly. The key observation here is that j = ∇M L(X j+1 gk π ; M k j )(Γk j )2 + W k j diag((W k j )⊤∇M L(X j+1 π ; M k j )). In other words, gk to M through the "interaction terms" Γk j is correlated to the "true" mini-batch gradient ∇M L(X j+1 j and W k j . π ; M k j ) with respect 24 We show in Lemma A.1.16 that we can control the size of the noise terms qk j which arise from the fact that we are not truly taking gradient updates with respect to M . More specifically, Lemma A.1.16 implies that = O(1). (cid:13) (cid:13) (cid:13)qk j (cid:13) (cid:13) (cid:13)F Next, we actually accumulate gradients. The main obstacle we have to deal with is that the mini-batch updates prevent the gradient accumulation from being exactly equal to the full-batch update starting at M k 0 . Inspired by the approach in Ahn et al. (2020, Theorem 1), we separate out j into a signal term ̃gk the gradient update gk j . Specifically, we write j and noise term ek M k j+1 = M k j − ηk ̃gk j + η2 k ek j + η2 k qk j , (A.13) where 0)Γk is the signal of the gradient update of the (j + 1)th batch evaluated with parameter values Θk 0 (instead of Θk 0 + W k π ; Θk π ; Θk ≜ ∇W L(X j+1 0 ∇ΓL(X j+1 (A.14) 0), ̃gk j j ) and ≜ ek j ̃gk j − gk j ηk . (A.15) In particular, in Lemma A.1.18 below we show that (cid:13) (cid:13) (cid:13)ek j is negligible with respect to the true gradient signal. (cid:13) (cid:13) (cid:13)F = O(1), so that indeed the noise term Taking this as given for now, when we accumulate the gradient updates across epoch k, we see that we can define ̃gk ≜ m−1 ∑ j=0 so that the accumulation reads j = ∇W Lπ(Θk ̃gk 0)Γk 0 + W k 0 ∇ΓLπ(Θk 0), M k+1 0 = M k 0 − ηk ̃gk + η2 k (ek j + qk j ) m−1 ∑ j=0 k rk, = M k 0 − ηk ̃gk + η2 where we have additionally defined the composite noise term: rk ≜ m−1 ∑ j=0 (ek j + qk j ), (A.16) (A.17) (A.18) (A.19) Note that if we instead start from i > 0, then the composite noise term rk will have an additional noise term s(i,k) (i,k+1), which we will address in Appendix A.1.5. In particular, we show there that the norm of s(i,k) (i,k+1) is O(1). Combining this with Lemmas A.1.16 and A.1.18, we can conclude that (cid:13)rk(cid:13) (cid:13) = O(1). (cid:13)F A.1.4 Norm and singular value bounds based on approximate invariances In this section, we prove several helper lemmas which help us bound noise terms in Appendix A.1.5 and the approximate invariances in Appendix A.1.7. 25 Upper bounds on the norms of W and Γ. Much of Wu, Wang, and Ma (2019) is dedicated towards showing that the approximate invariances control the weight norms. The trouble with directly extending their strategy lies in the fact that in our setting the invariance D is diagonal, which complicates the process of bounding various matrix norms. We first state the following technical lemma which involves the operator norm of Hadamard products. Lemma A.1.5 (3.1f in Johnson (1990)). Let A, B ∈ Rd×d be matrices such that A is positive definite. Then ∥A ⊙ B∥2 ≤ ∥A∥2∥B∥2 We leverage Lemma A.1.5 to prove the following useful helper lemma that relates bounds on (cid:13)I ⊙ W ⊤W (cid:13) (cid:13) (cid:13)2 to ∥W ∥2. (cid:13)I ⊙ W ⊤W (cid:13) (cid:13) (cid:13)2 (cid:13)I ⊙ W ⊤W (cid:13) (cid:13) ≤ β2. (cid:13)2 ≤ β, where W ∈ Rp×d. Then ∥W ∥2 ≤ (cid:112)dβ. Conversely, if Lemma A.1.6. Suppose ∥W ∥2 ≤ β, then :,2W:,2, . . . , W ⊤ Proof. Note that I ⊙ W ⊤W is a diagonal matrix with diagonal entries W ⊤ where W:,i denotes the ith column of W . Hence Tr(cid:0)I ⊙ W ⊤W (cid:1) = ∥W ∥2 F ≤ dβ (or tighter by replacing d with the rank of W ), from which it follows that ∥W ∥2 ≤ (cid:112)dβ. For the other direction, we set A = I and B = W ⊤W in Lemma A.1.5, so 2 ≤ β2, as desired. (cid:13)I ⊙ W ⊤W (cid:13) (cid:13) (cid:13)2 F. Hence ∥W ∥2 :,1W:,1, W ⊤ ≤ ∥W ∥2 :,dW:,d, With Lemma A.1.6 in hand, we prove the following technical lemma which gives a uniform bound on the norms of Γ and W based on ξ = ∥W Γ∥2. Lemma A.1.7. If ∥D∥2 ≤ ε < 1 and ∥W Γ∥2 ≤ ξ, we have ∥W ∥2 ≤ d (cid:112) 1 − ε + ξ, and (cid:13)Γ2(cid:13) (cid:13) (cid:13)2 Proof. We have from ∥W Γ∥2 ≤ ξ that ≤ 1 + ε + d2(1 − ε + ξ). Next, our hypothesis that ∥D∥2 = (cid:13) (cid:13) (cid:13) ≤ ξ2. (cid:13)W Γ2W ⊤(cid:13) (cid:13) (cid:13)2 (cid:13)I + diag(W ⊤W ) − Γ2(cid:13) (cid:13)2 ≤ ε implies that W Γ2W ⊤ ⪰ W ((1 − ε)I + diag(W ⊤W ))W ⊤. Taking norms of both sides and applying the reverse triangle inequality, we obtain that ξ2 ≥ (cid:13) (cid:13) (cid:13)W diag(W ⊤W )W ⊤(cid:13) (cid:13) (cid:13)2 − (1 − ε)∥W ∥2 2. (cid:13)W diag(W ⊤W )W ⊤(cid:13) (cid:13) We now lower bound Note here that diag(W ⊤W )i,i = ∥W:,i∥2  (cid:13)2. In particular, we expand out the matrix product. 2. Thus we can write W diag(W ⊤W )W ⊤ as    ∥W:,1∥2 2   W:,1 W:,2 * * * W:,d       ∥W:,2∥2 2 . . .          ∥W:,d∥2 2 26 W ⊤ :,1 W ⊤ :,2 ... W ⊤ :,d     , from which we observe that the ith diagonal entry of W diag(W ⊤W )W ⊤ is (W diag(W ⊤W )W ⊤)i,i = d ∑ j=1 (cid:13) (cid:13)W:,j (cid:13) (cid:13) 2 2W2 i,j. (cid:12) It follows that Tr(cid:0)W diag(W ⊤W )W ⊤(cid:1) = ∑d (cid:12) (the RHS is also known as the max norm). For our case we set A = W diag(W ⊤W )W ⊤ and note that the diagonal is nonnegative. So in fact in our case we obtain 4 2. Note that ∥A∥2 ≥ maxi,j (cid:13) (cid:13)W:,j (cid:12) (cid:12)Ai,j j=1 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)W diag(W ⊤W )W ⊤(cid:13) (cid:13) (cid:13)2 ≥ 1 d d ∑ j=1 (cid:13) (cid:13)W:,j (cid:13) (cid:13) 4 2. Now notice that ∑j find that (cid:13) (cid:13)W:,j (cid:13) (cid:13) 4 2 = ∑j(∑i W2 i,j)2. Applying Cauchy-Schwarz to the outer sum we (cid:13) (cid:13)W:,j (cid:13) (cid:13) 4 2 ≥ ∑ j i,j)2 (∑j ∑i W2 d , but the RHS is equal to ∥W ∥4 F. Since ∥W ∥F ≥ ∥W ∥2, we conclude that (cid:13)W diag(W ⊤W )W ⊤(cid:13) (cid:13) (cid:13)2 ∥W ∥4 2 d2 (cid:13) (cid:13) ≥ . In summary, we have ∥W ∥4 2 d2 − (1 − ε)∥W ∥2 2 − ξ2 ≤ 0. Applying the quadratic formula, we find that ∥W ∥2 ≤ d (cid:112) 1 − ε + ξ. For the bound on ∥Γ∥2, we start from the definition of D and apply the reverse triangle inequality to obtain so we obtain where we used follows. (cid:13)I ⊙ W ⊤W (cid:13) (cid:13) (cid:13)2 (cid:12) (cid:12) (cid:12)1 + (cid:13) (cid:13)diag(W ⊤W ) (cid:13) (cid:13) (cid:13) (cid:13)2 − (cid:13) (cid:13)Γ2(cid:13) (cid:13)2 (cid:12) (cid:12) (cid:12) ≤ ε, (cid:13)Γ2(cid:13) (cid:13) (cid:13)2 ≤ ∥W ∥2 ≤ 1 + ε + ∥W ∥2 2, 2 from Lemma A.1.6. From this, the conclusion directly Under the inductive hypotheses, Lemma A.1.7 implies that we can uniformly bound max This is spelled out in the following corollary. Corollary A.1.8 (Norms stay bounded). Suppose that L[j, k] and D[j, k] hold. Define (cid:110)(cid:13) (cid:13) (cid:13)W k j (cid:13) (cid:13) (cid:13)2 , (cid:13) (cid:13) (cid:13) Γk j (cid:111) . (cid:13) (cid:13) (cid:13)2 Cw ≜ (cid:115) 3 2 + d2 (cid:19) , + ξ (cid:18) 1 2 with ξ ≜ C1/2 L + ∥Yπ∥F σmin(X ⊤ π ) . 27 Here CL was defined in Hypothesis 1. Then and (cid:13) (cid:13)M k (cid:13) j (cid:13) (cid:13) (cid:13) ≤ ξ, max (cid:110)(cid:13) (cid:13)W k (cid:13) j (cid:13) (cid:13) (cid:13)2 , (cid:13) (cid:13) (cid:13) Γk j (cid:13) (cid:13) (cid:13)2 (cid:111) ≤ Cw. Proof. We have by triangle inequality that (cid:13) (cid:13)M k (cid:13) j X π (cid:13) (cid:13) (cid:13)2 ≤ (cid:13) (cid:13)M k (cid:13) j X π (cid:13) (cid:13) (cid:13)F ≤ (cid:13) (cid:13)Yπ − M k (cid:13) j X π (cid:13) (cid:13) (cid:13)F + ∥Yπ∥F ≤ Lπ(M k j )1/2 + ∥Yπ∥F. Since L[j, k] holds, we have have (cid:13) (cid:13) (cid:13)M k obtain ≥ σmin(X (cid:13) (cid:13) (cid:13)M k j X π (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13)2 ⊤ π ) j (cid:13) (cid:13) (cid:13)Yπ − M k j X π (cid:13) (cid:13) (cid:13) 2 F ≤ CL. Furthermore, as n ≥ d, we know that and by Item Assumption 1(a) we have σmin(X ⊤ π ) > 0. Hence we (cid:13) (cid:13)M k (cid:13) j (cid:13) (cid:13) (cid:13)2 ≤ C1/2 ⊤ π ) L + ∥Yπ∥F σmin(X (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13)M k j = ξ. It follows that ξ works as a bound on holds by assumption, this means that the hypothesis on Dk all the hypotheses of Lemma A.1.7 are satisfied. We can thus conclude that for the application of Lemma A.1.7. Since D[j, k] j is satisfied with ε = 1/2. In summary, max (cid:110)(cid:13) (cid:13)W k (cid:13) j (cid:13) (cid:13) (cid:13)2 , (cid:13) (cid:13) (cid:13) Γk j (cid:13) (cid:13) (cid:13)2 (cid:111) ≤ Cw, as desired. The importance of these upper bounds on weight norms is that they allow us to upper bound the norms of gradients of L with respect to various parameters. Upper bounding the norms of gradients. The following lemma gives an upper bound on the norms of various gradients. Lemma A.1.9. For any a ∈ [m] and Θ = (W , Γ) we have ∥∇W L(X a ∥∇ΓL(X a ∥∇M L(X a π; Θ)∥2 π; Θ)∥2 π; M )∥2 F ≤ ∥Γ∥2 F ≤ ∥W ∥2 F ≤ ∥BN(X a 2∥BN(X a 2∥BN(X a π)∥2 π)∥2 π)∥2 2L(X a 2L(X a 2L(X a π; M ) π; Θ) π; Θ) Proof. First, we have by definition L(X a π; Θ) = ∥W ΓBN(X a π) − Y a π ∥2 F. Hence, the mini-batch gradients can be computed explicitly as ∇M L(X a ∇W L(X a ∇ΓL(X a π; M ) = −(Y a π; Θ) = ∇M L(X a π; Θ) = diag(W ⊤∇M L(X a π − M BN(X a π; M )Γ, π; M )). π))BN(X a π)⊤, (A.20) (A.21) (A.22) 28 Since L(X a π; M ) = ∥Y a π − M BN(X a π)∥2 F and ∥AB∥F ≤ ∥A∥2∥B∥F, Equation (A.20) gives ∥∇M L(X a π; M )∥2 F ≤ ∥BN(X a π)∥2 2L(X a π; M ). It thus follows from Equation (A.21) that ∥∇W L(X a π; Θ)∥2 F ≤ ∥Γ∥2 2∥∇M L(X a π; Θ)∥2 F ≤ ∥Γ∥2 2∥BN(X a π)∥2 2L(X a π; Θ). Similarly, inspecting Equation (A.22), since ∥diag(A)∥2 F ≤ ∥A∥2 F, we have ∥∇ΓL(X a π; Θ)∥2 F ≤ (cid:13) (cid:13)W ⊤∇M L(X a (cid:13) π; Θ) (cid:13) (cid:13) (cid:13) 2 F ≤ ∥W ∥2 2∥BN(X a π)∥2 2L(X a π; Θ). As a consequence of Corollary A.1.8, under the inductive hypotheses we can also bound the gradient norms by absolute constants. Corollary A.1.10. Assume D[j, k] and L[j, k] hold. Then, for any a ∈ [m], we have (cid:13) (cid:13)∇M L(X a (cid:13) (cid:13) (cid:13)∇W L(X a (cid:13) (cid:13) (cid:13)∇ΓL(X a (cid:13) π; M k j ) π; Θk j ) π; Θk j ) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2 F 2 F 2 F ≤ CL∥BN(X a π)∥2 2, ≤ C2 wCL∥BN(X a π)∥2 2, ≤ C2 wCL∥BN(X a π)∥2 2, where Cw was previously defined in Corollary A.1.8. We now turn from upper bounds to lower bounds. The crux here is to start with bounding the minimum singular value of Γ away from zero. This in turns allows us to lower bound the correlation between ̃gk and ∇M Lπ(M k 0 ) away from zero. As we will see, we can also show similar correlation lower bounds for the cases i > 0. Bounding the minimum singular value of Γ2. i ) away from zero, we need to show that the approximate invariances prevent Γ from vanishing on any coordinate. To do so, we appeal to an alternate formulation of the Courant-Fisher theorem for singular values, which we restate below for completeness. In order to bound σmin(Γk Theorem A.1.11 (Courant-Fisher). Let A, B ∈ Rm×n. Then |σk(A) − σk(B)| ≤ ∥A − B∥2 for k ∈ [min{m, n}]. With this in mind, we formally prove that the minimum singular value of Γ2 is bounded away from zero. Lemma A.1.12. Suppose that ∥D∥2 = (cid:13) (cid:13)I + diag(W ⊤W − Γ2)(cid:13) (cid:13)2 ≤ ε. Then we have σmin(Γ2) ≥ 1 − ε. 29 Proof. Setting A ≜ I + diag(W ⊤W ) and B ≜ Γ2 in Courant-Fisher yields (cid:12) (cid:12)σd(I + diag(W ⊤W )) − σd(Γ2) (cid:12) (cid:12) (cid:12) (cid:12) ≤ (cid:13) (cid:13) (cid:13)I + diag(W ⊤W ) − Γ2(cid:13) (cid:13) (cid:13)2 . Since the RHS is just D, we obtain that σmin(Γ2) ≥ 1 + σmin(diag(W ⊤W )) − ∥D∥2. The conclusion easily follows. Under the inductive hypothesis D[i, k], i.e. (cid:13) (cid:13)Dk 2 , this immediately implies the following i corollary. We will see in the following section (in Corollary A.1.15) that this minimum singular value bound for Γk i can be interpreted in the following manner. Although the effective PŁ condition evolves dynamically, the associated PŁ constant always stays bounded away from zero. ≤ 1 (cid:13) (cid:13)2 Corollary A.1.13 (PŁ bounded away from zero). Assume D[i, k] holds. Then we have σmin(Γk i )2 ≥ 1 2 . The accumulated gradient signal is correlated with the full-batch gradient signal. Lemma A.1.14 (Correlation of ̃gk and ∇M Lπ(M k 0 )). For all k, we have (cid:68) ∇M Lπ(M k 0 ), ̃gk(cid:69) F Proof. Recall that we previously defined ≥ σmin(Γk 0)2(cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F . ̃gk ≜ ∇W Lπ(Θk 0)Γk 0 + W k 0 ∇ΓLπ(Θk 0). Note that if we have A, Λ ∈ Rn×n, with Λ = diag(λ1, . . . , λn) a diagonal matrix with nonnegative entries, then ⟨A, AΛ⟩F = (cid:68) AΛ1/2, AΛ1/2(cid:69) (cid:13) (cid:13) (cid:13)AΛ1/2(cid:13) (cid:13) (cid:13) 2 F = F ≥ min i λi∥A∥2 F. Also, we have ⟨A, diag(A)⟩F = ⟨diag(A), diag(A)⟩F = ∥diag(A)∥2 Hence combining Equations (A.20) and (A.22) and the above inequalities, we have F ≥ 0. (cid:68) ∇M Lπ(M k 0 ), ̃gk(cid:69) (cid:68) = F (cid:68) = ∇M Lπ(M k 0 ), ∇W Lπ(Θk 0)Γk 0 (cid:69) (cid:68) + ∇M Lπ(M k ∇M Lπ(M k F (cid:69) 0 ), W k 0 ), ∇M Lπ(M k F 0 ∇ΓLπ(Θk 0) 0)2(cid:69) F 0 )⊤∇M Lπ(M k 0 ), diag((W k (cid:13) 2 (cid:13) (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) 0 )(Γk . F (cid:68) + (W k 0)2(cid:13) ≥ σmin(Γk 0 )⊤∇M Lπ(M k 0 )) (cid:69) F 30 We obtain the following corollary of the above lemma and Corollary A.1.13. Corollary A.1.15. Assume D[0, k] holds. We have 0 ), ̃gk(cid:69) ∇M Lπ(M k (cid:68) F ≥ (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F . 1 2 More generally, assume D[i, k] holds. We have (cid:68) ∇M Lπ(M k i ), ̃g(i,k)(cid:69) ≥ F (cid:13) (cid:13)∇M Lπ(M k (cid:13) i ) (cid:13) (cid:13) (cid:13) 2 F , 1 2 (A.23) (A.24) where ̃g(i,k) is the analogous quantity to ̃gk for accumulating gradients starting at iterate (i, k) rather than (0, k). It is defined more formally in Eq. (A.26). A.1.5 Bounding noise terms We now turn to bounding the composite noise term rk. This is crucial to ensure the global convergence via Equation (A.8) and also to control the approximate invariances. Mismatched gradient noise is negligible. As promised, we show that the mismatched gradient noise terms qk j are negligible when we accumulate gradients from M k 0 to M k+1 . 0 Lemma A.1.16. Assume that L[j, k] and D[j, k] hold for j < m. Then we have Furthermore, for any t < m we have (cid:13) (cid:13)qk (cid:13) j (cid:13) (cid:13) (cid:13)F ≤ C2 wCL (cid:13) (cid:13)BN(X j+1 (cid:13) π ) (cid:13) (cid:13) (cid:13) 2 2 . t ∑ j=0 (cid:13) (cid:13)qk (cid:13) j (cid:13) (cid:13) (cid:13)F ≤ C2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F. Proof. Recall the definition of qk j , reproduced here for reference: qk j ≜ ∇W L(X j+1 π ; Θk j )∇ΓL(X j+1 π ; Θk j ). Since L[j, k] and D[j, k] hold for (j, k), we can apply Corollary A.1.10 to conclude that (cid:13) (cid:13)qk (cid:13) j (cid:13) (cid:13) (cid:13)F ≤ C2 wCL (cid:13) (cid:13)BN(X j+1 (cid:13) π ) (cid:13) (cid:13) (cid:13) 2 2 . Since the inductive hypotheses hold for every j < m, when we accumulate the noise terms from (0, k) to (t, k), we can apply the above bound to conclude that t ∑ j=0 (cid:13) (cid:13)qk (cid:13) j (cid:13) (cid:13) (cid:13)F ≤ t ∑ j=0 (cid:13) (cid:13)BN(X j+1 (cid:13) π ) (cid:13) (cid:13) (cid:13) 2 2 C2 wCL (cid:13) (cid:13)BN(X j+1 (cid:13) π ) (cid:13) (cid:13) (cid:13) 2 F ≤ C2 wCL = C2 wCL m−1 ∑ j=0 (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F, where the last equality used the definition of X π. 31 Path dependent noise arising from mini-batch updates is negligible. In order to bound the noise term coming from mini-batch updates, we first prove the following auxiliary lemma that shows that the iterates don't move far within an epoch. Lemma A.1.17. Fix t ≤ m and assume D[j, k] and L[j, k] hold for all j < t. Then we have (cid:13) (cid:13)W k (cid:13) t − W k 0 (cid:13) (cid:13) (cid:13)2 ≤ √ tηkCwC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13)F. The same inequality holds true if we replace W with Γ. We also have (cid:13) (cid:13)M k (cid:13) t − M k 0 (cid:13) (cid:13) (cid:13)2 √ ≤ 2 tηkC2 wC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13)F Proof. We have by definition that + η2 k C2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F. W k t = W k 0 − ηk t−1 ∑ j=0 ∇W l(X j+1 π ; Θk j ). Now, we have (cid:13) (cid:13)W k (cid:13) t − W k 0 (cid:13) (cid:13) (cid:13)2 ≤ ηk t−1 ∑ j=0 (cid:13) (cid:13)∇W l(X j+1 (cid:13) π ; Θk j ) (cid:13) (cid:13) (cid:13)2 ≤ ηkCwC1/2 L t (cid:13) ∑ (cid:13)BN(X j+1 (cid:13) π ) j=0 (cid:13) (cid:13) tηkCwC1/2 (cid:13)X π (cid:13)F L (cid:13) (cid:13) (cid:13)2 √ ≤ where in the first line we have applied the triangle inequality, in the second line we have applied Corollary A.1.10, and in the last line we have applied Cauchy-Schwarz. The same proof holds for Γ. For M , Equation (A.10) gives M k t = M k 0 − ηk t−1 ∑ j=0 gk j + η2 k t−1 ∑ j=0 qk j . Combining Eq. (A.11) and Corollaries A.1.8 and A.1.10 yields (cid:13) (cid:13)gk (cid:13) j (cid:13) (cid:13) (cid:13)2 ≤ (cid:13) (cid:13) (cid:13) Γk j ≤ 2C2 (cid:13) (cid:13) (cid:13)2 wC1/2 L (cid:13) (cid:13)∇W L(X j+1 (cid:13) (cid:13) (cid:13)BN(X j+1 (cid:13) π ) π ; Θk j ) (cid:13) (cid:13) (cid:13)2 . (cid:13) (cid:13) (cid:13)2 + (cid:13) (cid:13)W k (cid:13) j (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13)∇ΓL(X j+1 (cid:13) π ; Θk j ) (cid:13) (cid:13) (cid:13)2 Hence, summing up over j, using Cauchy-Schwarz, and applying the noise bound Lemma A.1.16, it follows that (cid:13) (cid:13)M k (cid:13) t − M k 0 (cid:13) (cid:13) (cid:13)2 √ ≤ 2 tηkC2 wC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13)F + η2 k C2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F. Now we show that the noise term (cid:13) (cid:13) (cid:13)ek j (cid:13) (cid:13) (cid:13)2 is O(1). 32 Lemma A.1.18. If L[j, k] and D[j, k] both hold for all j < m then we have for each j that (cid:13) (cid:13)ek (cid:13) j (cid:13) (cid:13) (cid:13)2 (cid:112) ≤ 4 jC2 wC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F (C1/2 L + C2 w (cid:13) (cid:13)X π (cid:13) (cid:13)F ) + O(ηk). Hence, we also have m−1 ∑ i=0 (cid:13) (cid:13)ek (cid:13) j (cid:13) (cid:13) (cid:13)2 ≤ 4m3/2C2 wC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F (C1/2 L + C2 w (cid:13) (cid:13)X π (cid:13) (cid:13)F ) + O(ηk). Proof. Inspecting the definition of ek j (Eq. (A.15)), let us bound the quantity ηkek j = ∇W L(X j+1 π ; Θk (cid:124) π ; Θk j )Γk j (cid:125) 0)Γk 0 − ∇W L(X j+1 (cid:123)(cid:122) (I) π ; Θk 0) − W k (cid:123)(cid:122) (II) j ∇ΓL(X j+1 π ; Θk j ) (cid:125) . 0 ∇ΓL(X j+1 + W k (cid:124) First, we have by triangle inequality and the identity Equation (A.21) that the norm of (I) is at most ≤ (cid:13) (cid:13) (cid:13) (cid:13) 0 − ∇W L(X j+1 (cid:13)∇W L(X j+1 π ; Θk 0)Γk (cid:13) (cid:13) (cid:13)∇W L(X j+1 0)Γk π ; Θk (cid:13) + (cid:13) (cid:13)∇M L(X j+1 j − Γk 0(Γk Γk (cid:13) 0) (cid:13) (cid:13) (cid:13) (cid:13)∇M L(X j+1 π ; M k (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13)∇M L(X j+1 0(Γk j − Γk Γk (cid:13) 0) (cid:32) (cid:13) (cid:13) (cid:13)2 π ; Θk 0)Γk π ; Θk j j − ∇W L(X j+1 π ; M k 0 ) 0 − ∇M L(X j+1 π ; M k 0 ) 0 )Γk (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13)2 j )Γk Γk j (cid:13) (cid:13) (cid:13) ≤ + j (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13)∇M L(X j+1 (cid:13) + (cid:13) (cid:13) (cid:13) Γk j (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13)2 π ; M k 0 )Γk 0 − ∇M L(X j+1 π ; M k 0 )Γk j (cid:13) (cid:13) (cid:13)2 π ; M k j )Γk j (cid:13) (cid:13) (cid:13)2 j − ∇M L(X j+1 π ; M k j )Γk j + 0 )Γk π ; M k (cid:13) (cid:13)∇M L(X j+1 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)∇M L(X j+1 j − Γk Γk (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:13)∇M L(X j+1 0 ) − ∇M L(X j+1 (cid:13) (cid:13) (cid:13) (cid:13)2 π ; M k (cid:13) (cid:13) (cid:13)2 Γk j ) 0 π ; M k 0 ) (cid:13) (cid:13) (cid:13)2 π ; M k j ) (cid:13) (cid:13) (cid:13)2 . ≤ ( (cid:13) (cid:13) (cid:13) (cid:13) Γk (cid:13) (cid:13)2 0 (cid:13) Γk (cid:13) (cid:13) j + + (cid:13) (cid:13) (cid:13) 2 (cid:33) (cid:13) (cid:13) (cid:13)2 Applying the weight bounds in Corollaries A.1.8 and A.1.10 and Lemma A.1.17 to the first term yields an upper bound of 2Cw * ((cid:112) jηkCwC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13)F ) * ( (cid:13) (cid:13)BN(X j+1 (cid:13) π ) (cid:13) (cid:13) (cid:13)2 C1/2 L ) ≤ 2 (cid:112) jηkC2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F. Turning to the second term, we can apply the smoothness bound in Lemma A.1.2 and the inductive bounds in Corollaries A.1.8 and A.1.10 and Lemma A.1.17 to obtain an upper bound of C2 w (cid:13) (cid:13)BN(X j+1 (cid:13) π ) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)M k (cid:13) j − M k 0 (cid:13) (cid:13) (cid:13)2 2 2 (cid:112) ≤ 2 jηkC4 wC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13) 3 F 33 + η2 k C4 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 4 F. Putting it together, we have (I) ≤ 2 (cid:112) jηkC2 wC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F (C1/2 L + C2 w (cid:13) (cid:13)X π (cid:13) (cid:13)F ) + η2 k C4 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 4 F. Similarly, for (II) we have the exact same bound since we can apply Lemma A.1.5 to remove (cid:13) (cid:13) (cid:13)2 the diagonal operator and uniformly bound (cid:13) (cid:13) (cid:13)W k by Cw. (cid:13) (cid:13) (cid:13)2 and Γk j (cid:13) (cid:13) (cid:13) j Finally, combining (I) and (II) and dividing through by ηk, we can conclude that (cid:13) (cid:13)ek (cid:13) j (cid:13) (cid:13) (cid:13)2 (cid:112) ≤ 4 jC2 wC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F (C1/2 L + C2 w (cid:13) (cid:13)X π (cid:13) (cid:13)F ) + O(ηk). Summing up (cid:13) (cid:13) (cid:13)ek j (cid:13) (cid:13) (cid:13)2 over all j and crudely bounding ∑m−1 j=0 (cid:112)j ≤ m3/2, we see that m−1 ∑ i=0 (cid:13) (cid:13)ek (cid:13) j (cid:13) (cid:13) (cid:13)2 ≤ 4m3/2C2 wC1/2 L (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F (C1/2 L + C2 w (cid:13) (cid:13)X π (cid:13) (cid:13)F ) + O(ηk). Stepsize noise is negligible for i > 0. We now quickly show that the effect of generalizing the induction to i > 0 is negligible. In particular, we can carry out the same proof, except we will have to redefine the per-epoch update so it can account for gradient updates starting at an arbitrary iterate (i, k) rather than (0, k). We explicitly redefine these terms below by quickly revisiting the signal-noise decomposition in Appendix A.1.3. Recall that a single-iterate update at iteration (a, b) can be written as (Equation (A.10)) M b a+1 = M b a − ηbgb a + η2 b qb a, where we defined gb a qb a ≜ ∇W L(X a+1 ≜ ∇W L(X a+1 π ; Θb π ; Θb a)Γb a + W b a)∇ΓL(X a+1 a ∇ΓL(X a+1 π ; Θb a). π ; Θb a), Consider carrying out the same accumulation as in Appendix A.1.3, but this time choosing (i, k) instead (0, k) as the "pivot." For this purpose, we will change our notational convention a little bit and use superscripts to denote the pivot or the starting point (i, k). As the redefinitions of the "signal" ̃gb a (Equation (A.14)) and path dependent noise eb a (Equation (A.15)), we define π ; Θk i )Γk i + W k i ∇ΓL(X a+1 π ; Θk i ), ̃g(i,k) a ≜ ∇W L(X a+1 ≜ ̃g(i,k) a − gb a ηk e(i,k) (a,b) , for indices (a, b) satisfying (i, k) ≤ (a, b) ≤ (i − 1, k + 1). This way, the accumulation of updates on M from iteration (i, k) to (i − 1, k + 1) can be 34 represented as M k+1 i = M k i − ηk m−1 ∑ j=i gk j + η2 k m−1 ∑ j=i qk j − ηk+1 i−1 ∑ j=0 gk+1 j + η2 k+1 i−1 ∑ j=0 qk+1 j = M k i − ηk (i−1,k+1) ∑ (a,b)=(i,k) gb a + η2 k (i−1,k+1) ∑ (a,b)=(i,k) qb a − (ηk+1 − ηk) i−1 ∑ j=0 gk+1 j + (η2 k+1 − η2 k ) i−1 ∑ j=0 qk+1 j = M k i − ηk ̃g(i,k) + η2 k (cid:16) (i−1,k+1) ∑ (a,b)=(i,k) (cid:17) e(i,k) (a,b) + qb a + η2 k s(i,k) (i,k+1) (A.25) where in the last equality we used gb ̃g(i,k) (a redefinition of ̃gk from Equation (A.16)) and the stepsize noise s(i,k) a = ̃g(i,k) a − ηke(i,k) (a,b) and also defined the accumulated signal (i,k+1) as ̃g(i,k) ≜ (i−1,k+1) ∑ (a,b)=(i,k) ̃g(i,k) a = ∇W Lπ(Θk i )Γk i + W k i ∇ΓLπ(Θk i ), s(i,k) (i,k+1) ≜ − ηk+1 − ηk η2 k i−1 ∑ j=0 gk+1 j + η2 k+1 − η2 k η2 k i−1 ∑ j=0 qk+1 j . (A.26) (A.27) As a sanity check, we can quickly see that the stepsize noise s(i,k) (i,k+1) is zero if i = 0. Now notice that Equation (A.25) can be thought of as a generalization of the per-epoch update (Equation (A.17)) originally obtained for i = 0. For now, suppose we ignore the last term of Equation (A.25) involving the stepsize noise s(i,k) (i,k+1). Then, if we carry out the above analysis for bounding the remaining terms in Equation (A.25), there is no difference in the argument up to reindexing; we can consider this as using ηk for the stepsize even for the iterates (a, b) where b = k + 1. In particular, the lemmas of the previous sections all hold up to reindexing notation. (i,k+1) is of the same order as the Therefore, it now suffices to show that the stepsize noise s(i,k) (cid:13) (cid:13)s(i,k) (cid:13) (cid:13) (cid:13) (cid:13)F Lemma A.1.19. Assume L[j, k + 1] and D[j, k + 1] hold for all j ≤ i − 1. Suppose that other noise terms; in particular, = O(1). (i,k+1) ηk = O (cid:19) , (cid:18) 1 kβ for some 1/2 < β < 1. Then the stepsize noise (cid:13) (cid:13)s(i,k) (cid:13) (i,k+1) (cid:13) (cid:13) (cid:13)F = O(1). Proof. Since D[j, k + 1] holds, Lemma A.1.16 demonstrates that (cid:13) (cid:13)gk+1 (cid:13) hand, Corollaries A.1.8 and A.1.10 show that have ηk+1 − ηk = O(1/kβ+1) = O(η2 k ). Similarly η2 (cid:13) (cid:13) (cid:13)s(i,k) (cid:13) (cid:13) into Eq. (A.27), we conclude that (cid:13)F (cid:13) (cid:13) (cid:13)2 k+1 − η2 = O(1), as desired. (i,k+1) j (cid:13) (cid:13)qk+1 (cid:13) j (cid:13) (cid:13) (cid:13)2 = O(1). On the other = O(1). Since ηk = O(1/kβ) and β ≤ 1, we k ). Plugging these k = O(1/k2β+1) = O(η3 35 Composite noise term is negligible. Now that we have formally defined the stepsize noise that arise for i > 0, we also redefine the composite noise term rk (Equation (A.19)) originally defined for i = 0. The updated definition is simply r(i,k) ≜ (cid:16) (i−1,k+1) ∑ (a,b)=(i,k) (cid:17) e(i,k) (a,b) + qb a + s(i,k) (i,k+1), which allows us to rewrite the epoch update spelled out in Equation (A.25) as M k+1 i = M k i − ηk ̃g(i,k) + η2 k r(i,k)., (A.28) (A.29) which is a generalization of Equation (A.18). It is left to show formally that the composite noise term r(i,k) defined in Equation (A.28), a, the path dependent noise e(i,k) (a,b) obtained from combining the mismatched gradient noise terms qb for (i, k) ≤ (a, b) ≤ (i − 1, k + 1), and the stepsize noise s(i,k) (i,k+1), is indeed O(1). Proposition A.1.20 (Composite noise term). Suppose L[a, b] and D[a, b] hold for (i, k) ≤ (a, b) ≤ (i − 1, k + 1), and ηk = O(1/kβ) for some 1/2 < β < 1. Then the composite noise term r(i,k) satisfies (cid:13) (cid:13) (cid:13)r(i,k)(cid:13) (cid:13) (cid:13)F ≤ poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F ) + O(ηk). Proof. Combining Lemmas A.1.16, A.1.18 and A.1.19, taking care to analyze the constants (which are all poly(m, Cw, CL, )) hidden by the big–O notation, yields the desired result. (cid:13) (cid:13)X π (cid:13) (cid:13)F A.1.6 Accumulated loss update In this section, we formally account for the noise terms and prove that an accumulated loss inequality holds. More precisely, we can use the gradient update spelled out in Equation (A.29) and the noise bounds in Appendix A.1.5 to obtain a single epoch loss update. In other words, this section prove the inductive step that the hypotheses R[i, k + 1] and L[i, k + 1] holds. For the sake of simplicity, in this section we focus on the case i = 0. However, as discussed above, the case i > 0 only adds a negligible stepsize error and the same arguments go through. We start with the following proposition, which proves the hypothesis R[0, k + 1]. Proposition A.1.21. Assume that L[j, k] and D[j, k] hold for all j < m. Consider optimizing the linear+BN network with stepsize satisfying ηk ≤ 1 2kβ , for 1/2 < β < 1. Then Lπ(M k+1 0 ) − L∗ π ≤ (cid:16) 1 − (cid:17) απηk 2 (Lπ(M k 0 ) − L∗ π) + poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F )η2 k , (A.30) where the poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F ) term is independent of k and has constant degree. Proof. First, we use the Gπ-smoothness of Lπ with respect to M guaranteed by Lemma A.1.2 to obtain Lπ(M k+1 0 ) − Lπ(M k 0 ) ≤ (cid:68) ∇M Lπ(M k 0 ), M k+1 0 − M k 0 (cid:69) + F Gπ 2 (cid:13) (cid:13)M k+1 (cid:13) 0 − M k 0 (cid:13) (cid:13) (cid:13) 2 F . 36 Using the gradient update Equation (A.18) and Cauchy-Schwarz, we can upper bound the RHS by (cid:68) ∇M Lπ(M k (cid:68) 0 ), −ηk ̃gk + η2 0 ), ̃gk(cid:69) ∇M Lπ(M k ≤ −ηk k rk(cid:69) + F Gπ 2 + η2 k F (cid:13) (cid:13) (cid:13)rk(cid:13) (cid:13) (cid:13)F (cid:13) (cid:13) (cid:13) 0 − M k (cid:13) (cid:13)M k+1 (cid:13) (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) 0 2 F (cid:13) (cid:13) (cid:13)F + Gπ 2 (cid:13) (cid:13)M k+1 (cid:13) 0 − M k 0 (cid:13) (cid:13) (cid:13) 2 F . Next, we can use Lemma A.1.17, with t = m, together with the inequality (a + b)2 ≤ 2a2 + 2b2, to obtain an upper bound of (cid:68) ≤ −ηk ∇M Lπ(M k + Gπ 2 (4mη2 k C4 wCL 0 ), ̃gk(cid:69) (cid:13) (cid:13)X π F (cid:13) (cid:13) + η2 k (cid:13) (cid:13) (cid:13)rk(cid:13) (cid:13) (cid:13)F k C4 + η4 wC2 L (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13)X π (cid:13) ). 4 F 2 F (cid:13) (cid:13) (cid:13)F Then, because the inductive hypotheses apply we can apply Corollary A.1.10 to bound F. Moreover, since gradients, Corollary A.1.15 to bound the inner product (cid:10)∇M Lπ(M k ηk = O(1/kβ), we can use Proposition A.1.20 to bound (cid:13)F. This yields an upper bound of 0 ), ̃gk(cid:11) (cid:13)rk(cid:13) (cid:13) − ηk 2 (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) η2 ηk k 2 2 − + (cid:32) ≤ 2 (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) + η2 k (cid:13) (cid:13) (cid:13) F (cid:33) (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13)F (cid:13) (cid:13) (cid:13)rk(cid:13) (cid:13) (cid:13)F + poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F )η2 k (cid:13) (cid:13) (cid:13) 2 F + poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F )η2 k ≤ − ∥∇M Lπ(k)∥2 ηk 4 In the second line, we have used ab ≤ 1 ηk ≤ 1 2 to reduce higher order terms of ηk. F + poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F )η2 k 2 (a2 + b2), and throughout, we have used the assumption Putting it together, we find that Lπ(M k+1 0 ) − Lπ(M k 0 ) ≤ − ηk 4 (cid:13) (cid:13)∇M Lπ(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F + poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F )η2 k We now use απ–strong convexity with respect to M (and hence απ-PŁ) guaranteed by Lemma A.1.3 to obtain Lπ(M k+1 0 ) − L∗ π ≤ (cid:16) 1 − (cid:17) απηk 2 (Lπ(M k 0 ) − L∗ π) + poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F )η2 k . One consequence of Proposition A.1.21 is that if the stepsize ηk is small enough, we can guarantee that the loss decreases from Lπ(M k i ) to Lπ(M k+1 i ). Next, from Proposition A.1.21, we can prove the other inductive hypothesis, namely L[0, k + 1]. Corollary A.1.22. Suppose L[j, k] and D[j, k] hold for all j < m and the stepsize satisfies (cid:40) ηk ≤ 1 kβ min 1 2 , απCL poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F ) (cid:41) , for some 1/2 < β < 1. Then L[0, k + 1] holds, i.e. Lπ(M k+1 0 ) ≤ CL. 37 Proof. Since ηk ≤ 1 Then, for the bound Lπ(M k+1 0 2kβ , we can apply Proposition A.1.21 to conclude that Equation (A.30) holds. ) ≤ CL to hold, it suffices to show that Equivalently, (cid:16) 1 − (cid:17) απηk 2 CL + poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F )η2 k ≤ CL. poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F )ηk ≤ απ 2 CL. Clearly this holds for the stated assumption on ηk. Finally, we show that by inductively unrolling the inequality in Proposition A.1.21, we can show that Lπ(M k i ) converges to L∗ π at a sublinear rate. Proposition A.1.23. Assume we are in the same setup as Proposition A.1.21. Suppose that the stepsize satisfies c kβ , (cid:111) ηk = (cid:110) 1 2 , 2 απ for some absolute constant c such that c ≤ min holds for every b ∈ [k + 1]. Then if β < 1 we have (cid:18) cαπ ) − L∗ π ≤ (Lπ(Θ1 0) − L∗ π) exp Lπ(Θk+1 0 and 1/2 < β < 1. Further suppose that R[0, b] (2 − k1−β) (cid:19) + c2 poly(m, Cw, CL, kβ (cid:13) (cid:13)X π (cid:13) (cid:13)F ) log k , 2(1 − β) Proof. Note that by inspecting the proof of Proposition A.1.21 and Proposition A.1.20, the term poly(m, Cw, CL, ) has no dependence on k. So for simplicity we will assume that this term is bounded by some absolute constant A. Since ηk ≤ 1 2kβ , Proposition A.1.21 implies that (cid:13) (cid:13)X π (cid:13) (cid:13)F Lπ(M k+1 0 ) − L∗ π ≤ (cid:16) 1 − (cid:17) απηk 2 We can unroll the recurrence to obtain (Lπ(M k 0 ) − L∗ π) + Aη2 k (A.31) Lπ(M k+1 0 ) − L∗ π ≤ (Lπ(M 1 0 ) − L∗ π) k ∏ t=1 (cid:16) 1 − (cid:17) απηt 2 + A k ∑ t=1 η2 t (cid:32) k ∏ j=t+1 (cid:18) 1 − απηj 2 (cid:19)(cid:33) . (A.32) We have for any ct ≤ 1 that b ∏ t=a (1 − ct) ≤ exp (cid:33) log(1 − ct) (cid:32) b ∑ t=a (cid:32) ≤ exp − (cid:33) ct , b ∑ t=a where we have used log(1 − x) ≤ −x for x ≤ 1. For 1/2 < β < 1 we have b ∑ t=a Hence, since we assumed ηk = c 1 tβ ≥ (cid:90) b a 1 tβ dt = b1−β − a1−β 1 − β . kβ , and απ c 2 ≤ 1, we have (cid:18) ≤ exp − cαπ 2(1 − β) (cid:16) 1 − b ∏ t=a (cid:17) απηt 2 (b1−β − a1−β) (cid:19) 38 Now we can bound A k ∑ t=1 η2 t (cid:32) k ∏ j=t+1 (cid:18) 1 − απηj 2 (cid:19)(cid:33) ≤ c2 A k2β + k−1 ∑ t=1 (cid:18) c2 A t2β exp − cαπ 2(1 − β) (k1−β − (t + 1)1−β) (cid:19) Define T ≜ k − Ckβ log k, where C > 0 is an absolute constant to be picked later. We can split up the sum into t < T and t ≥ T. For the terms t < T we can use concavity to deduce that k1−β − (t + 1)1−β ≥ (1 − β)(k − t − 1)k−β ≥ Θ(log k), where the constant hidden in Θ(log k) increases with C. Hence we pick C so that for t < T we have cαπ 2(1 − β) (k1−β − (t + 1)1−β) ≥ β log k. Then, (cid:18) c2 A t2β exp − cαπ 2(1 − β) ∑ t<T (k1−β − (t + 1)1−β) (cid:19) ≤ exp(−β log k) ∑ t<T c2 A t2β ≤ O (cid:18) c2 A kβ (cid:19) . On the other hand, for the terms t ≥ T we can naively bound the exponential term by 1 and obtain (cid:18) c2 A t2β exp − cαπ 2(1 − β) ∑ t≥T (k1−β − (t + 1)1−β) (cid:19) ≤ ∑ t≥T c2 A t2β ≤ Θ(kβ log k) (cid:18) c2 A log k kβ ≤ Θ c2 A T2β (cid:19) . Hence we have that Lπ(M k+1 0 ) − L∗ π ≤ (Lπ(M 1 0 ) − L∗ π) exp (cid:18) cαπ 2(1 − β) (2 − k1−β) (cid:19) + Θ (cid:18) c2 A log k kβ (cid:19) , and the inequality in the proposition statement holds by recalling that A = poly(m, Cw, CL, (A.33) (cid:13) (cid:13)X π (cid:13) (cid:13)F ). A.1.7 Bounding approximate invariances Armed with Corollaries A.1.8 and A.1.10, we slog through the arduous task of inductively bounding the approximate invariance. As a reminder, these corollaries tell us that assuming the inductive hypotheses L[j, k] and D[j, k] hold, all weight norms and losses for iterate (j, k) can be bounded by uniform constants. Lemma A.1.24. Suppose L[j, k] and D[j, k] hold for some j < m. We have (cid:13) (cid:13)Dk (cid:13) j+1 − Dk j (cid:13) (cid:13) (cid:13)2 ≤ 2C2 wCL (cid:13) (cid:13)BN(X j+1 (cid:13) π ) (cid:13) (cid:13) (cid:13) 2 2 η2 k . 39 Hence, if D[t, k] holds for all t ≤ j, we have (cid:13) (cid:13)Dk (cid:13) j+1 (cid:13) (cid:13) (cid:13)2 ≤ 2C2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F k ∑ t=1 η2 t . Proof. We have (W k j+1)⊤W k j+1 = (W k = (W k j − ηk∇W L(X j+1 j )⊤W k j − ηk k [∇W L(X j+1 + η2 π ; Θk ∇W L(X j+1 j − ηk∇W L(X j+1 j ))⊤(W k j )⊤W k π ; Θk j + (W k j )⊤∇W L(X j+1 π ; Θk π ; Θk j )] (cid:104) π ; Θk j )) j )⊤∇W L(X j+1 (cid:105) π ; Θk j ) Similarly, we have (Γk j+1)2 = (Γk = (Γk π ; Θk ∇ΓL(X j+1 j − ηk∇ΓL(X j+1 (cid:104) j )2 − ηk + η2 k [∇ΓL(X j+1 j − ηk∇W L(X j+1 j ))(Γk j ∇ΓL(X j+1 j )Γk j + Γk j )∇ΓL(X j+1 j )] π ; Θk π ; Θk π ; Θk π ; Θk π ; Θk j ) j )) (cid:105) j+1)2. Hence, if we take the operator norm of Dk The gradient invariance in Fact A.1.1 cancels out the ηk term in Dk j+1 − (Γk j and use Lemma A.1.5, we can ignore the diagonal operator. Then, since the inductive hypotheses hold, we can apply the inductive gradient bound (Corollary A.1.10) to obtain j+1 = I + diag((W k j+1 − Dk j+1)⊤W k (cid:13) (cid:13)Dk (cid:13) j+1 − Dk j (cid:13) (cid:13) (cid:13)2 ≤ η2 k π ; Θk j ) (cid:20)(cid:13) (cid:13)∇W L(X j+1 (cid:13) (cid:13) (cid:13)BN(X j+1 (cid:13) π ) wCL (cid:13) (cid:13) (cid:13) 2 2 η2 k . ≤ 2C2 (cid:13) (cid:13) (cid:13) 2 2 + (cid:13) (cid:13)∇ΓL(X j+1 (cid:13) π ; Θk j ) (cid:13) (cid:13) (cid:13) (cid:21) 2 2 To conclude, we apply triangle inequality and the inductive hypothesis on D[t, k], yielding (cid:13) (cid:13)Dk (cid:13) j+1 (cid:13) (cid:13) (cid:13)2 ≤ ≤ 0 (cid:13) (cid:13)Dk (cid:13) (cid:13) (cid:13)Dk (cid:13) 0 (cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13)2 + 2C2 wCLη2 k + 2C2 wCLη2 k k ∑ t=1 2 F (cid:13) (cid:13) η2 t . ≤ 2C2 wCL (cid:13) (cid:13)X π j ∑ t=0 (cid:13) (cid:13)X π (cid:13) (cid:13)BN(X t+1 (cid:13) π ) (cid:13) (cid:13) 2 F (cid:13) (cid:13) (cid:13) 2 2 As a corollary, we see that for stepsizes of the form ηk = c/kβ for 1/2 < β < 1, we can select c to guarantee that ≤ 1/2 for all (j, k). (cid:13) (cid:13) (cid:13)Dk j (cid:13) (cid:13) (cid:13)2 Corollary A.1.25. Assume that D[t, k] holds for all t ≤ j < m and ηk = c kβ for 1/2 < β < 1. If c2 ≤ 1 2β−1 )C2 wCL 4(1 + 1 , (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F 40 then (cid:13) (cid:13)Dk (cid:13) j+1 (cid:13) (cid:13) (cid:13)2 ≤ 2C2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F k ∑ t=1 η2 t ≤ 1 2 . In other words, D[j + 1, k] holds. Proof. Lemma A.1.24 implies that (cid:13) (cid:13)Dk (cid:13) j+1 (cid:13) (cid:13) (cid:13)2 ≤ 2C2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F k ∑ t=1 t ≤ 2C2 η2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F ∞ ∑ t=1 η2 t . For 1/2 < β < 1, we have ∞ ∑ k=1 1 k2β ≤ 1 + (cid:90) ∞ 1 1 t2β dt = 1 + 1 1 − 2β t1−2β (cid:12) (cid:12) (cid:12) (cid:12) ∞ 1 = 1 + 1 2β − 1 . Hence, if c2 ≤ 1 2β−1 )C2 wCL 4(1 + 1 , (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F then evidently (cid:13) (cid:13) (cid:13)Dk j+1 (cid:13) (cid:13) (cid:13)2 ≤ 1 2 , as desired. A.1.8 Completing the induction With all the pieces in place, we formally state the theorem for SS convergence. Theorem A.1.26 (Formal statement of convergence for SS). Let π ∈ Sn be such that Assumption 1(a) holds. Let f (*; Θ) = W ΓBN(*) be a 2-layer linear+BN network initialized at Θ1 0) = (0, I). Consider optimizing f using SS with permutation π and decreasing stepsize 0 = (W 1 0 , Γ1 (cid:40) ηk = 1 kβ * min 1 2 , 2 απ , απCL poly(m, Cw, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F ) (cid:118) (cid:117) (cid:117) (cid:116) , for any 1/2 < β < 1. Then the SS risk satisfies 1 2β−1 )C2 wCL 4(1 + 1 (cid:41) (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F Lπ(Θk+1 0 ) − L∗ π ≤ kβ In particular, the SS risk converges to the global optimal risk L∗ π. poly(m, d, CL, (cid:13) (cid:13)X π (cid:13) (cid:13)F, 1 σmin(X ⊤ π ) ) log k . Proof of Theorem A.1.26. We proceed by induction on the epoch. We restate the key inductive statements to prove:(with appropriate selection of ηk): • L[j, k]: Lπ(Θk j ) stays bounded above by some uniform constant CL ≥ ∥Yπ∥2 F - this is the content of Corollary A.1.22. • R[j, k]: Lπ(Θk tion A.1.21. j ) satisfies the per-epoch loss inequality - this is the content of Proposi- • D[j, k]: The approximate invariances stay bounded in norm away from 1. More precisely, (cid:13) (cid:13) (cid:13)Dk j (cid:13) (cid:13) (cid:13)2 ≤ 2C2 wCL (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F ∑∞ t=1 η2 t ≤ 1 2 - this is the content of Corollary A.1.25. 41 Notice that the assumptions on ηk exactly satisfy the hypotheses of Corollaries A.1.22 and A.1.25 and Proposition A.1.23. The base cases follows from the initialization. Recall that we set (cid:111) (cid:110) CL = max Lπ(Θ1 t ) : 0 ≤ t ≤ m − 1 . Since we only look at the loss values for the first epoch, CL is indeed an absolute constant depending on π. So L[j, 1], as defined in Hypothesis 1, holds for all j < m. Next, we have from the initialization that D1 0 = 0. Then, applying Lemma A.1.24, we can conclude D[j, 1] also holds for all j < m, so Hypothesis 3 holds. Finally, there is no need to check Hypothesis 2 because it is only defined for k > 1. Now our inductive hypotheses are that L[j, k], R[j, k], D[j, k] hold for all j < m. For the inductive step, we want to prove L[0, k + 1], R[0, k + 1], D[0, k + 1]. By construction of ηk, the hypotheses of Corollary A.1.22 is satisfied, so L[0, k + 1] holds. Moreover, the hypotheses of Proposition A.1.21 are satisfied, so R[0, k + 1] holds. Finally, the hypotheses of Lemma A.1.24 are satisfied, so that D[0, k + 1] holds. As asserted earlier, the above argument is robust up to reindexing if we want to prove the statement for i > 0. In particular, all of the results of the previous section go through, as we showed in Proposition A.1.20 that the stepsize noise is negligible. Hence the induction is completed for all (i, k) and so the unrolled update equation in Proposition A.1.23 holds for all k. This gives the formal rate of convergence for the stated stepsize. In particular, we see that the SS risk Lπ converges to its global minimum. Proof of Theorem 3.2.2. All we need to do is convert the stepsizes requirements. Examining the stepsize requirements in Theorem A.1.26, they depend on CL, Cw, and (cid:13) (cid:13)X π (cid:13) (cid:13)F. Now recall the definition of Cw in Corollary A.1.8: C2 w ≤ 3 2 + d2 (cid:32) 1 2 + C1/2 L + ∥Yπ∥F σmin(X ⊤ π ) (cid:33) . Hence Cw = poly(d, CL, ∥Yπ∥F, 1/σmin(X σmin(X F = dn, σmin(X πX ⊤ π )2, and CL is an absolute constant, we can convert the stepsize requirements into ⊤ π )). Finally, since ∥Xπ∥2 ⊤ π ) = (cid:40) ηk = 1 kβ * min 1 2 , 2 σmin(X πX , ⊤ π ) (cid:112) 2β − 1 poly(σmin(X poly(n, d, ∥Yπ∥F) (cid:41) ⊤ π )) , which directly implies the stepsize requirements in Theorem 3.2.2. A.2 Proof of convergence for RR In this section, we prove Theorem 3.2.3. With RR, we randomly resample permutation πk ∈ Sn on epoch k. Hence, it is natural to seek a convergence bound in expectation. We briefly comment on the complications that arise in this setting. Since we want to prove convergence an expectation, an inductive approach that controls the approximate invariances and loss evolution is complicated by the necessity for bounds on these quantities that are stronger than merely being in expectation. This is precisely why we need Assumption 3. 42 Additional notation. As introduced in Section 2, we can view RR as optimizing the risk LRR(Θ) ≜ 1 n! ∑ π∈Sn Lπ(Θ) via with-replacement SGD on an epoch level (i.e., Lπ is sampled uniformly with replacement at every epoch), albeit with noise terms due to the shuffling algorithm. Motivated by the setup in Section 2, we can also write LRR in an equivalent form to LGD as follows: LRR(Θ) ≜ 1 n! ∑ π∈Sn L( f (Xπ; Θ), Yπ) = 1 n! L(W ΓBNRR(X), YRR), where BNRR(X) ≜ (cid:2)X π1 ≜ (cid:2)Yπ1 YRR . . . * * * Yπn! * * * X πn! (cid:3) ∈ Rd×(n*n!), (cid:3) ∈ Rp×(n*n!). For notational convenience, we also write X RR the presence of batch normalization. ≜ BNRR(X), and reiterate that overlines indicate Just as in the SS case, we will abuse notation and refer to the RR risk function as a function of Lπ(M ). Similarly, we will often refer to the gradient of ∇M Lπ(M ). We will find it helpful to (cid:13) (cid:13)2. Similarly we will denote the maximum Frobenius (cid:13) (cid:13)F. Furthermore, it follows from (cid:13) (cid:13) (cid:13)2 (cid:13)F M = W Γ by writing LRR(M ) ≜ 1 n! the RR risk with respect to M as ∇M LRR(M ) ≜ 1 n! use the notation X max,2 ≜ arg maxπ∈Sn (cid:13) norm batch normalized dataset by X max,F ≜ arg maxπ∈Sn (cid:13)X π (cid:13) (cid:13)X max,2 the unit variance constraint in the definition of BN that (cid:13)X max,F ∑π∈Sn ∑π∈Sn (cid:13) (cid:13)X π ≤ (cid:13) dn. √ ≤ At a high level, the RR proof of convergence closely follows the SS proof of convergence. Indeed, most of the technical legwork has already been fleshed out in the SS case - most of the results port over immediately, taking care to replace π with πk. However, we will be careful in accounting for where we need to deviate from the SS logic. A.2.1 Checking optimization properties We first check the smoothness and strong convexity property with respected to the merged matrix M that we heavily relied on for the proof of convergence for SS. Fact A.2.1 (Smoothness of RR). Define Then LRR(M ) is GRR-smooth with respect to M . GRR ≜ 1 n! ∑ π∈Sn Gπ. Proof. The statement follows from combining Lemma A.1.2 with the fact that if fi are Gi-smooth, then ∑n i=1 Gi-smooth. i=1 fi is ∑n As before, we cannot directly use a PŁ inequality on W or Γ; we must instead bootstrap this from the strong convexity of the risk with respect to M = W Γ. Fact A.2.2 (Strong convexity). Suppose that Assumption 1(b) holds for some π ∈ Sn. Then the ≜ loss function LRR(M ) = 1 n! ∑π απ. 1 n! Lπ(M ) is αRR-strongly convex with respect to M with αRR ∑π σmin(X πX ⊤ π ) = 1 n! ∑π∈Sn 43 Proof. Take the Hessian of LRR with respect to vec(M ) to obtain ∇2 I. Hence we have ∇2 holds, the sum is strictly positive, so LRR is indeed strongly convex. vec(M )LRR(M ) ⪰ 1 ∑π σmin(X πX n! vec(M )LRR(M ) = 1 X πX ⊤ π ). Since we assumed Assumption 1(b) ∑π∈Sn n! ⊤ π ⊗ A.2.2 Proof sketch of RR convergence We first state the modified inductive hypothesis for the one-epoch risk update, which replaces R[j, k]. Hypothesis 4. For k > 1, the inductive hypothesis S[k] states that Eπk−1[LRR(M k 0 )|Fk−1] − L∗ RR ≤ (cid:16) 1 − (cid:17) αRRηk−1 2 0 k−1 poly(m, Aw, AL, (LRR(M k−1 (cid:13) (cid:13)X max,F ) − L∗ RR) (cid:13) (cid:13)F ), + η2 where Eπk−1 denotes the expectation over random draws of the permutation πk−1. Proof sketch of Theorem 3.2.3. As before, we start by writing out the smoothness inequality with respect to M : LRR(M k+1 0 ) ≤ LRR(M k 0 ) + (cid:68) ∇M LRR(M k 0 ), M k+1 0 − M k 0 (cid:69) + GRR 2 (cid:13) (cid:13)M k+1 (cid:13) 0 − M k 0 2 (cid:13) (cid:13) (cid:13) . (A.34) Next, we have the same gradient update M k+1 0 = M k 0 − ηk ̃gk + η2 k rk, but now all quantities involving π turn into πk. For example, we redefine ̃gk ≜ m−1 ∑ t=0 t = ∇W Lπk (M k ̃gk 0 )Γk 0 + W k 0 ∇ΓLπk (M k 0 ). Since we want to prove convergence in expectation, it is standard to consider the natural filtration Fk of which permutations we have picked up to (but not including) epoch k. Formally, Fk = σ(π1, . . . , πk−1), where σ(Z) denotes the σ-algebra generated by the random variable Z. Noting the identity Eπ[∇M Lπ(M k 0 )] = ∇M LRR(M k 0 ), it follows that if we can apply Corollary A.1.15, then (cid:104)(cid:68) Eπk ∇M LRR(M k 0 ), ̃gk(cid:69) (cid:68) (cid:105) = F ∇M LRR(M k 0 ), Eπk [ ̃gk] (cid:69) ≥ F (cid:13) (cid:13)∇M LRR(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F . 1 2 Hence, we can follow the same argument for upper bounding the smoothness inequality for SS and take a conditional expectation over πk conditioned on Fk. Assuming for now that the weight norms are bounded by some absolute constant Aw and the relevant losses are bounded by an absolute constant AL, this yields Eπk [LRR(M k+1 0 )|Fk] ≤ LRR(M k 0 ) − ηk 4 (cid:13) (cid:13)∇M LRR(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F + η2 k Eπk [poly(m, Aw, AL, ∥Xπk ∥F)]. 44 Noting that we can upper bound ∥Xπk ∥F uniformly by k, this shows that we have (cid:13) (cid:13)X max,F (cid:13) (cid:13)F, which does not depend on Eπk [LRR(M k+1 0 )|Fk] ≤ LRR(M k 0 ) − ηk 4 (cid:13) (cid:13)∇M LRR(M k (cid:13) 0 ) (cid:13) (cid:13) (cid:13) 2 F + η2 k poly(m, Aw, AL, (cid:13) (cid:13)X max,F (cid:13) (cid:13)F ). Next, αRR–strong convexity yields Eπk [LRR(M k+1 0 )|Fk] − L∗ RR ≤ (cid:16) 1 − (cid:17) αRRηk 2 (LRR(M k 0 ) − L∗ RR) + η2 k poly(m, Aw, AL, (cid:13) (cid:13)X max,F (cid:13) (cid:13)F ). This is exactly the statement of S[k + 1]. To proceed, we must fill in the following details. First, we must show that the relevant losses are bounded by AL - see Corollary A.2.6. Then, we show that the weight norms are bounded by Aw - this is shown in Corollary A.2.7. Finally, we must show that D[j, k] holds, i.e., bound the approximate invariances - this is the content of Corollary A.2.9. Once we address these technicalities, an inductive argument similar to the SS version proves the theorem. Note that the SS inductive hypotheses L[j, k] and R[j, k] are not active in this proof. A.2.3 Weight bounds In this section we elucidate the connection between weight norms and the loss evolution. In particular, we show that bounds on the weight norms confer a bound on the loss function value. First, we state the following inequality, which follows from a quick application of Cauchy-Schwarz. Fact A.2.3. We have 1 n! ∑π∈Sn (Lπ(M ))1/2 ≤ LRR(M )1/2. With this identity in hand, we derive the following corollaries about weight and gradient bounds. Proposition A.2.4. We have ∥∇M LRR(M )∥ ≤ (cid:13) (cid:13)X max,2 (cid:13) (cid:13)2 LRR(M )1/2. Proof. We have ∥∇M LRR(M )∥2 ≤ 1 n! individual gradient bounds in Lemma A.1.9 and uniformly bounding that ∑π ∥∇M Lπ(M )∥2 by the triangle inequality. Applying the (cid:13) (cid:13), we see (cid:13) (cid:13)X max,2 (cid:13) (cid:13)X π (cid:13) (cid:13) by ∥∇M LRR(M )∥2 ≤ (cid:13) (cid:13)X max,2 (cid:13) (cid:13)2 * 1 n! ∑ π L1/2 π (M ). Applying Fact A.2.3 yields the desired result. As promised, we quantify the relationship between LRR, Lπ, and ∥M ∥2 with the following proposition. Proposition A.2.5. Let σ0 ≜ 1 n! ∑π σmin(X LRR(M ) − 2∥Y ∥2 F (cid:13) (cid:13)X max,F Similarly, for any π ∈ Sn, we have (cid:13) (cid:13) 2 F 2 ⊤ π ). We have (cid:32) ≤ ∥M ∥2 2 ≤ ∥Y ∥F + LRR(M )1/2 σ0 (cid:33)2 . Lπ(M ) − 2∥Y ∥2 F (cid:13) (cid:13)X π (cid:13) (cid:13) 2 2 F ≤ ∥M ∥2 2 ≤ (cid:32) ∥Y ∥F + Lπ(M )1/2 σmin(X ⊤ π ) (cid:33)2 . 45 Proof. First, we have 1 n! ∑ π∈Sn (cid:13) (cid:13)M X π (cid:13) (cid:13)2 ≤ ∥Y ∥F + = ∥Y ∥F + 1 n! 1 n! ∑ π ∑ π (cid:13) (cid:13)Yπ − M X π (cid:13) (cid:13)F Lπ(M )1/2, where we have used in the first line the fact that ∥Yπ∥F = ∥Y ∥F for all π. Therefore by Fact A.2.3 and using ⊤ π )∥M ∥2, we find that (cid:13) (cid:13)M X π ≥ σmin(X (cid:13) (cid:13)2 It follows that 1 n! ∑ π σmin(X ⊤ π )∥M ∥2 ≤ ∥Y ∥F + LRR(M )1/2. ∥M ∥2 ≤ ∥Y ∥F + LRR(M )1/2 σ0 . For the other direction, note that Lπ(M ) = (cid:13) (cid:13)Yπ − M X π (cid:13) (cid:13) 2 F Averaging over all π ∈ Sn gives us ≤ 2∥Y ∥2 F + 2∥M ∥2 2 (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F. LRR(M ) ≤ 2∥Y ∥2 F + 2∥M ∥2 2 n! ∑ π (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F. Uniformly bounding (cid:13) (cid:13)X π (cid:13) (cid:13) 2 F by (cid:13) (cid:13)X max,F (cid:13) (cid:13) 2 F and rearranging yields the desired result. The set of inequalities for π also follow by a similar argument. As a corollary of Proposition A.2.5, it follows from Assumption 3 that each of the losses Lπ(M k i ) stay bounded by an absolute constant throughout training. Corollary A.2.6 (Uniform bound on SS losses). Under Assumption 3, for every π ∈ Sn we have where Lπ(M k i ) ≤ AL, AL ≜ 2∥Y ∥2 F + 2A2 RR (cid:13) (cid:13)X max,F (cid:13) (cid:13) 2 F. Here, ARR was previously defined in Assumption 3. Finally, Assumption 3 implies the following inductive statement about the weight norms. Corollary A.2.7 (Uniform bound on weight norms). Assume Assumption 3 and D[j, k] holds. Then for RR, we have max (cid:110)(cid:13) (cid:13)W k (cid:13) i (cid:13) (cid:13) (cid:13)2 , (cid:13) (cid:13) (cid:13) Γk i (cid:13) (cid:13) (cid:13)2 (cid:111) ≤ Aw, where A2 w ≜ 3 2 + d2 (cid:18) 1 2 (cid:19) . + ARR Here, ARR was previously defined in Assumption 3. 46 A.2.4 Bounding approximate invariances In this section we formally bound the approximate invariances throughout RR training under Assumption 3. In particular, as a consequence of Corollaries A.2.6 and A.2.7, the following two claims follow almost directly upon inspection of the proofs of Lemma A.1.24 and Corollary A.1.25. Lemma A.2.8. Suppose D[j, k] holds for some j < m. We have (cid:13) (cid:13)Dk (cid:13) j+1 − Dk j (cid:13) (cid:13) (cid:13)2 ≤ 2A2 w AL (cid:13) (cid:13)BN(X j+1 (cid:13) πk ) (cid:13) (cid:13) (cid:13) 2 2 η2 k . Hence, if D[t, k] holds for all t ≤ j, we also have (cid:13) (cid:13)Dk (cid:13) j+1 (cid:13) (cid:13) (cid:13)2 ≤ 2A2 w AL (cid:13) (cid:13)X max,F (cid:13) (cid:13) 2 F k ∑ t=1 η2 t . Corollary A.2.9. Assume that D[t, k] holds for all t ≤ j < m and ηk = c kβ for 1/2 < β < 1. If c2 ≤ 1 2β−1 )A2 w AL 4(1 + 1 , (cid:13) (cid:13)X max,F (cid:13) (cid:13) 2 F then (cid:13) (cid:13)Dk (cid:13) j+1 (cid:13) (cid:13) (cid:13)2 ≤ 2A2 w AL (cid:13) (cid:13)X max,F (cid:13) (cid:13) 2 F k ∑ t=1 η2 t ≤ 1 2 . In other words, D[j + 1, k] holds. A.2.5 Completing the proof With the connection between the RR loss function and weight bounds in hand, we can complete the proof of convergence for RR. Finally, we formally state the RR convergence result. Theorem A.2.10 (Formal statement of convergence for RR). Suppose Assumption 1(b) and Assump- tion 3 hold. Let f (*; Θ) = W ΓBN(*) be a 2-layer linear+BN network initialized at Θ1 0) = (0, I). Consider optimizing f using RR with decreasing stepsize 0 = (W 1 0 , Γ1 ηk = 1 kβ * min (cid:40) (cid:118) (cid:117) (cid:117) (cid:116) 1 2 , 2 αRR , for any 1/2 < β < 1. Then the RR risk satisfies 1 2β−1 )A2 w AL 4(1 + 1 (cid:41) (cid:13) (cid:13)X max,F (cid:13) (cid:13) 2 F poly(n, d, ARR, ∥Y ∥F) log k kβ In other words, the RR risk converges to the global optimal risk L∗ E[LRR(Θk+1 )] − L∗ RR ≤ 0 RR. . Proof of Theorem A.2.10. We inductively prove that D[j, k] and S[k] hold. There is no need to check S[1] because Hypothesis 4 is defined for k > 1. The proof that the base cases D[j, 0] all hold follows the same proof as that in the SS case. 47 Now suppose for the sake of induction that D[j, k] and S[k] hold. We will show that D[j + 1, k] holds. Once we show that D[j, k] holds for all j < m, we can then show that S[k + 1] holds. In particular, by the assumption on ηk, Corollary A.2.9 implies that D[j + 1, k] holds. Hence by induction D[j, k] holds for all j < m. We see that assuming Assumption 3 simplified the proof strategy significantly, as we did not have to go through the trouble of proving L[j, k]. Next, let's understand what happens to the per-epoch loss bound in S[k + 1]. Explicitly, kβ where we can follow the same steps as in the proof sketch - which only required ηk ≤ c c ≤ min - to see that (cid:110) 1 (cid:111) 2 , 2 αRR Eπk [Lπk (M k+1 0 )|Fk] − L∗ π ≤ (cid:16) 1 − (cid:17) απηk 2 (LRR(M k 0 ) − L∗ RR) + poly(m, Aw, AL, (cid:13) (cid:13)X max,F (cid:13) (cid:13)F )η2 k . Indeed, under Assumption 3 and D[j, k] for j < m, we can apply Corollaries A.2.6 and A.2.7 to rigorously bound all of the analogous noise terms a.s.. We can then follow the same argument as in Proposition A.1.23 to unroll the recurrence, using iterated expectation to obtain a total expectation in the end. We can thus conclude that with ηk = c kβ for 1/2 < β < 1 and the constant c chosen as the theorem statement that E[LRR(Θk+1 0 )] − L∗ RR ≤ (LRR(Θ1 0) − L∗ π) exp (2 − k1−β) poly(m, Aw, AL, ) log k (cid:18) cαRR 2(1 − β) (cid:13) (cid:13)F (cid:13) (cid:13)X max,F kβ (cid:18) cαRR (cid:19) (cid:19) ≤ (LRR(Θ1 0) − L∗ π) exp 2(1 − β) poly(n, d, ARR, ∥Y ∥F) log k kβ (2 − k1−β) . + + In the last line we used the fact that AL = poly(ARR, ∥Y ∥F, Aw = poly(d, ARR) from Corollary A.2.7, and follows. (cid:13) (cid:13)X max,F (cid:13) (cid:13) 2 F (cid:13) (cid:13)X max,F (cid:13) (cid:13)F ) from Corollary A.2.6, = dn. The desired claim immediately We can also immediately see how the stepsize requirements match that of Theorem 3.2.3. B Proofs for classification results In this section we lay out the groundwork for formally proving our main results Theorems B.2.1 and B.3.1 about the separability decomposition of SS+BN and RR+BN (cf. Theorems 4.1.3 and 4.1.4). At a high level, we show that the separability decomposition is closely linked to the presence of monochromatic batches (Lemma B.1.1) and the dimensionality of the batch normalized dataset (Lemma B.1.2). In Appendix B.4, we formally characterize the optimal directions of linear+BN classifiers. We defer the proofs of the more technical lemmas to Appendix C. Additional notation and setup We lay out some additional notation that will aid in our discussion of classification. Division of two vectors should be interpreted in a coordinatewise fashion, so μ σ ∈ Rd with kth coordinate μk/σk. For a matrix A ∈ Rd×n, we define ∥A∥2,∞ = maxi∈[n] ∥A:,i∥2, i.e., the maximum Euclidean norm of the columns. 48 We remind the reader of some notation introduced previously, with an important redefinition for X RR. For a dataset Z = (X, Y ), we write Z + = (X +, Y +) and Z − = (X −, Y −) to denote the positive and negative examples, respectively. Recall that we write the dataset batch normalized under a permutation π as Z π ≜ (X π, Yπ), where X π ≜ BNπ(X) ∈ Rd×n and Yπ = π ◦ Y . We − also use X π to denote the submatrices of X π containing its columns corresponding to the positive and negative examples, respectively. + π and X B ) denote the set of all (n For the sake of analyzing the rank of X RR, we will redefine it as follows by throwing out redundant batches. Let ([n] B) unique (up to permutation) batches of size B that can be created from choosing the columns of X ∈ Rd×n. Fix an arbitrary labelling of these B) batches, and let B j ∈ Rd×B refer to the jth such batch. Then (n ≜ BNRR(X) ≜ (cid:104) . . . BN(B(n ∈ Rd×B(n B) BN(B1) X RR B)) (cid:105) Note that the rank of X RR is the same as the rank of the original definition, since all we did was throw out redundant batches for the purposes of analyzing the rank. We now turn to laying down some of the background necessary to introduce our technical results. As a motivating step, recall Proposition 4.1.2. It states that SS with permutation π can cause divergence of the GD risk if Z π is PLS or LS, but not if it is SC. Hence, determining sufficient conditions for when Z π is SC is of primary interest. Intuitively, Z π being SC should be related to some notion of genericity - the convex hulls of positive and negative features should be full dimensional. To formalize this intuition, we take a quick detour and recall several standard notions in convex analysis, defined for example in Boyd et al. (2004). For S ⊆ Rd, its interior int(S) denotes the largest open set contained in S. We say that S is affine if for any x1, x2 ∈ S, the line λx1 + (1 − λ)x2 ⊆ S. An affine combination of k points x1, . . . , xk ∈ Rd is given by ∑k i=1 λi = 1.6 The affine hull of S is the set of all affine combinations of S, and is denoted by aff(S), and clearly aff(S) is an affine set. Similarly, the relative interior relint(S) denotes the largest open subset of aff(S) contained in S. For a matrix A, we slightly abuse notation and write aff(A) to denote the affine hull of its columns. Similarly, we use conv(A) to denote the convex hull of its columns. i=1 λixi where ∑k Let x0 ∈ aff(S) be any element of the affine hull of S. It is not hard to see that aff(S) = x0 + V, where V is a linear subspace of Rd. Furthermore, this V is uniquely determined by S. One can think of x0 as an offset and V as the space of valid directions to move in to stay in aff(S). We define dim(S) ≜ dim(V). Definition 3. A set S ⊆ Rd is called full dimensional if dim(S) = d. This definition is equivalent to saying that int(conv(S)) is nonempty. Similarly, for any matrix A ∈ Rd×n, we say A is full dimensional if the set of its columns is full dimensional. This formal definition of full dimensional allows us to identify sufficient conditions for a dataset Z = (X, Y ) to be SC. B.1 Preliminary results on separability decomposition In this section, we introduce the technical results that help us analyze the separation between shuffling SGD and GD. A unifying theme is to understand the effect of monochromatic batches 6Here, unlike the definition of a convex combination, the λi's are allowed to be negative. 49 and rank on the separability decomposition - and thus, divergence. In particular, we show that having monochromatic batches and being full-rank prevents divergence in the underparameterized regime. In a later section (Appendix B.4), we also show that these properties also significantly influence the optimal directions under the logistic loss. The following lemma formalizes how monochromatic batches affect the separability decompo- sition. Lemma B.1.1. Given a permutation π, suppose there are two batches Z1 entirely of positive examples and Z2 resulting Z π = (X π, Yπ), the submatrices X π consists π consists entirely of negative examples. Then, if we consider the π such that Z1 − π of X π satisfy + π and X π and Z2 relint(conv(X + π )) ∩ relint(conv(X − π )) ̸= ∅. Consequently, Z π is not LS. Proof. Batch normalization ensures that the batch normalized features X 1 But this implies that 0 is in the convex hulls of each batch, which implies that conv(X 1 conv(X 2 that the mean μ of a batch B = {x1, . . . , xB} lies in the relative interior of conv(B). π are mean-zero. π) intersects π). In fact, 0 is in the intersection of their relative interiors as well. To see this, we prove π and X 2 This can be shown via an inductive argument on the batch size. If B = 2, then μ is the midpoint between x1 and x2, which is in the relative interior of conv(B). Now assume it's true for all possible batches of size B. When we add xB+1, we get a new batch B′, with mean B+1 xB+1. Hence if xB+1 ∈ conv(B), clearly μ′ ∈ relint(conv(B)) by convexity. If μ′ = B xB+1 ̸∈ conv(B), then xB+1 is one of the vertices of conv(B′). Since μ ∈ relint(conv(B)) and convexity, the segment between μ and xB+1 must stay in the relative interior of conv(B′) except at the endpoints. Since μ′ is in the relative interior of this segment, the conclusion follows. B+1 μ + 1 X 2 Hence relint(conv(X 1 π, the relative interiors of the larger convex hulls intersect as well. Finally, suppose Z π was LS. By definition there must exist a strict separating hyperplane for π)) intersects relint(conv(X 2 π)). Since we have X π ⊇ X 1 π and X − π ⊇ + the two hulls. But the hulls intersect, so this is a contradiction. We conclude that Z π is not LS. As Lemma B.1.1 establishes, monochromatic batches lead to Z π being PLS or SC. The following lemma synthesizes nicely with the above result; it demonstrates that if X is full dimensional, and the relative interiors of the convex hulls of X + and X − intersect, then Z is SC. Lemma B.1.2. Let Z = (X, Y ) be such that (1) X is full dimensional. (2) relint(conv(X +)) intersects relint(conv(X −)). Then Z is SC. Proof. Consider any halfspace in Rd. First, since the relative interiors of the hull of positive points and negative points intersect, then so too do the hulls themselves. So there is no hyperplane that separates X + from X −, i.e. Z is either PLS or SC. Suppose that Z is PLS, i.e., there exists a hyperplane v such that yiv⊤xi ≥ 0 for every (xi, yi) ∈ Z. Since X is full dimensional, the hyperplane orthogonal to v cannot pass through 50 through every point of X - hyperplanes are affine subspaces of dimension at most d − 1. So yiv⊤xi > 0 for some i and also yjv⊤xj = 0 for some i ̸= j; otherwise, Z is LS, which is a contradiction. Hence conv(X +) and conv(X −) touch only at the hyperplane defined by v, which contradicts the assumption that the relative interiors intersect. Hence Z is SC. Lemmas B.1.1 and B.1.2 taken together show that to identify sufficient conditions for Z π to be SC, one should look for conditions under which X π is full dimensional and monochro- matic batches are present. We already answered the former question in the main text with Proposition 3.2.1, which we restate for reference. Its proof is deferred to Appendix C.3. Proposition B.1.3. Assume that the original features X ∈ Rd×n satisfies Assumption 2 and B > 2. Then if we batch normalize and remove one datapoint from each normalized batch, to form a d × (B − 1) n B matrix in the SS case and a d × (B − 1)(n B) matrix in the RR case, the dataset is full-rank almost surely, regardless of which datapoints we remove. In particular, we have rank(X π) = min (cid:8)d, (B − 1) n (cid:9) and rank(X RR) = min (cid:8)d, (B − 1)(n B)(cid:9) almost surely. B Let us now consider the other question about the presence of monochromatic batches. Intu- itively, under Assumption 4(a), there should be many monochromatic batches w.h.p. as long as B is small. The following lemma formalizes this intuition; its proof is contained in Appendix C.1. Lemma B.1.4. Assume Assumption 4(a). If B = o(log n) then there are Ω(n) monochromatic batches w.h.p.. If B = Ω(log n), then there are no monochromatic batches w.h.p.. The upshot of Lemmas B.1.1, B.1.2 and B.1.4 and Proposition B.1.3 is that small batch sizes naturally prevent divergence. However, there is a natural tradeoff here: small batch sizes also entail significant variance in the batch statistics, so they can lead to large (but non-diverging) values of the GD risk anyway when we train the network with SS. Remark B.1.5 (Multiclass classification). In the multiclass case with K > 2 different classes, one can directly generalize the above analysis to look at all (K 2) pairwise combinations of classes. Lemma B.1.1 generalizes by requiring the existence of a monochromatic batch for each class. Hence as K increases the batch size must shrink to ensure that Z π is SC w.h.p., opening up a wider range of batch sizes for SS divergence. Finally, we formally define a robust notion of the separability decomposition that will prove helpful for quantifying the effects of increasing the batch size. To do so, we rely on the notion of the margin of a linearly separably dataset and the so-called penetration depth of overlapping convex hulls. Definition 4 (Margin and penetration depth). Let Z = (X, Y ) be a dataset, and let X +, X − denote the positive and negative features, respectively. If Z is linearly separable, then the margin of Z is defined to be the l2 margin corresponding to the maximum margin classifier for Z. If Z is not linearly separable, then by definition conv(X +) intersects conv(X −). The penetration depth (Agarwal et al., 2000) of Z is defined as the smallest Euclidean distance of translation of conv(X +) such that the resulting convex body still intersects conv(X −). In words, this quantifies the smallest perturbation we need to make Z linearly separable. Definition 5 (γ-robust separability decomposition). Let Z = (X, Y ) be a dataset and SLS the separability decomposition of ZGD ≜ (X GD, Y ) ≜ (BN(X), Y ). GD ⊔ SSC GD be For γ > 0, we say that Z is γ-robust if the following conditions hold. 51 (1) One of the following: (a) ZGD is LS and SLS (b) ZGD is SC and SSC GD has margin at least γ; or, GD has penetration depth at least γ. (2) Let σk, ak, and bk denote the standard deviation, min, and max of the kth feature of X. Then mink∈[d] σk bk−ak = Ω(1). √ (3) (cid:13) (cid:13)X GD (cid:13) (cid:13)2,∞ = O( d), i.e., the maximum Euclidean norm of datapoints in BN(X) is O( √ d). Definition 5 formalizes the informal statement in Theorem 4.1.3 that "ZGD's separability decomposition can change with small perturbations." If a dataset is robust, its separability decomposition cannot change easily by small perturbations (e.g., due to batch normalization) on datapoints. Notice here that PLS datasets can never be robust; to see why, note that Z is PLS whenever ZGD is PLS. It follows that if Z is PLS then it is not γ-robust for any γ > 0. This definition of robustness is also natural from the perspective of concentration, since it provides an immediate link between concentration of batch statistics and the separability decom- position of Z π. In order to estimate X GD well, we need to estimate σ to within a multiplicative factor, which explains (2). Moreover, the degree to which the SS datapoints concentrate around the GD datapoints also depend multiplicatively on the size of GD datapoints, which explains (3). The following proposition provides a sufficient condition for the datapoints concentrating within a distance γ of the GD datapoints (cf. the definition of γ-robustness); its proof is deferred to Appendix C.2. Proposition B.1.6. Suppose Z is γ-robust and B = Ω(d log(nd)/γ2). Then with probability at least 1 − 1/ poly(n, d) over the choice of π, we have (cid:13) (cid:13)X π − π ◦ X GD (cid:13) (cid:13)2,∞ = O(γ). With this setup in hand, we are ready to present our main theorems characterizing the separability decompositions of SS+BN and RR+BN. B.2 Separability decomposition for SS Theorem B.2.1 (Separability decomposition for SS, formal). Throughout this theorem, assume that B > 2 and Assumption 4(a) and Assumption 2 hold. Suppose that d ≤ (B − 1) n B . Then the following hold. (1) Z π is SC w.h.p. for B = o(log n). If we relax Assumption 2, then Z π can be PLS as well. (2) Suppose further that Z is γ-robust. Then Z π has the same separability decomposition as ZGD w.h.p. for B = Ω(d log(nd)/γ2). Now suppose d > (B − 1) n B . Then the following hold. (3) Z π is PLS w.h.p. for B = o(log n). (4) Z π is LS w.h.p. for B = Ω(log n). Proof. We consider cases based on whether the batch size is large or small. Small batch size. By Lemma B.1.4, when B = o(log n), w.h.p. we get a batch comprised solely of positive examples and a batch comprised solely of negative examples. By Lemma B.1.1, this 52 implies that Z π is PLS or SC, and the relative interior of the positive features intersects the relative interior of the negative features. By Lemma B.1.2, if X π is full dimensional, then Z π is SC. Hence it suffices to analyze the rank of X π. The maximal rank of X π is min (cid:8)d, (B − 1) n (cid:9) because of the mean zero constraint enforced B in every batch. Because we assumed that Assumption 2 holds, Proposition 3.2.1 implies that X π achieves this upper bound almost surely. Putting it all together, we conclude that when d ≤ (B − 1) n B , X π is full-dimensional. It follows that Z π is SC w.h.p. over the choice of π, which proves (1). On the other hand, when d > (B − 1) n B , there always exists a hyperplane that passes through all of the monochromatic batches of Z π and perfectly classifies non-monochromatic batches (see Appendix B.4). It follows that Z π is PLS, which proves (3). Large batch size. Now consider when B = Ω(log n). In this regime, Lemma B.1.4 implies there are no monochromatic batches with high probability. Moreover, Proposition 3.2.1 implies that the features are full rank. It thus follows that when d > (B − 1) n B , Z π is LS, which proves (4). Let us now consider the case d ≤ (B − 1) n B . When Z is γ-robust, we can directly apply Proposition B.1.6 to prove (2). Indeed, for B = Ω(d log(nd)/γ2), each SS datapoint is within distance O(γ) of the corresponding GD datapoint with probability at least 1 − 1/ poly(n, d). By increasing the batch size by at most a constant factor, we can guarantee that each SS datapoint is in fact within distance γ/3 of the corresponding GD datapoint. If ZGD is LS, γ-robustness implies that the max-margin hyperplane for ZGD has margin at least γ. Since each SS datapoint moves at most γ/3 from the corresponding GD datapoint, this hyperplane still has margin at least 2γ/3, implying that Z π is LS. If ZGD is SC, then γ-robustness implies that we need to translate the convex hulls of positive and negative points by at least γ to separate them. But we can only translate them by a total of γ/3 + γ/3 = 2γ/3 < γ, so the hulls stay strictly overlapping. This implies Z π is also SC. This concludes the proof of (2). Remark B.2.2. If ZGD is not γ-robust for any γ > 0 (for example if ZGD is PLS), then it is not hard to construct examples where the separability decomposition of Z π is LS or PLS, and SS diverges. For a good example of this scenario, see Figures 4b and 4d. Even if ZGD is γ-robust, if B = o(d log(nd)/γ2), then concentration can fail to hold in the worst case, and we can find analogous constructions where SS diverges. B.3 Separability decomposition for RR Theorem B.3.1 (Separability decomposition for RR, formal). Suppose that B > 2 and Assumption 4(b) and Assumption 2 hold. If d ≤ (B − 1)(n decomposition of ZGD. B), then ZRR is SC and X RR is full-rank almost surely, regardless of the separability Otherwise, if d > (B − 1)(n B), then ZRR is deterministically PLS, regardless of the separability decomposition of ZGD. Proof. When there are at least B positive and B negative examples, there exists a batch of all positive and a batch of all negative examples. Hence by Lemma B.1.1, ZRR is PLS or SC. By Proposition B.1.3, under Assumption 2, X RR attains the maximal rank of min (cid:8)d, (B − 1)(n B)(cid:9) almost surely. So by Lemma B.1.2, if d ≤ (B − 1)(n B), ZRR will be SC and X RR is full-rank almost surely. On the other hand, if d > (B − 1)(n B), then ZRR is PLS deterministically because there 53 always exists a hyperplane that passes through all of the monochromatic batches of ZRR and perfectly classifies non-monochromatic batches. B.4 Characterizing the optimal direction of classifiers Thus far, we have primarily considered the separability decomposition of Z π and ZRR. In fact, we can say more about the direction of optimal classifiers under the logistic loss. First, we prove Lemma 4.1.1, which constrains optimal directions via the separability decomposition. Next, we leverage overparameterization and the rank properties shown in Proposition B.1.3 to characterize the optimal direction under the logistic loss for data drawn from a density. Using these insights, we can prove our main result of this section, Proposition B.4.3. We first restate and prove Lemma 4.1.1. Lemma B.4.1. Let Z = SLS ⊔ SSC be the separability decomposition of Z. If v is an optimal direction for L, then v⊤x = 0 for all x ∈ Span(X SC) and yiv⊤xi > 0 for every (xi, yi) ∈ SLS. Proof. By definition of SSC, there exists some (xi, yi) ∈ SSC such that yi ⟨v, xi⟩ ≤ 0. If ⟨v, xi⟩ ̸= 0, then yi ⟨tv, xi⟩ → −∞ as t → ∞, which contradicts the assumption that v is an optimal direction. Similarly, if yi ⟨v, xi⟩ ≤ 0 for some (xi, yi) ∈ SLS, then clearly u + tv cannot infimize L, as there exists a hyperplane which strictly separates SLS and is orthogonal to Span(SSC). Next, we restate and prove Proposition 4.1.2. Proposition B.4.2. Suppose Assumption 1(a) holds. Assume that the iterates vπ(t) infimize Lπ, and their projections onto Span(X SC π )⊥ converge in direction to some optimal direction v∗ π for Lπ. Then the GD risk LGD diverges if and only if Z π is PLS or LS and there exists some (xi, yi) ∈ ZGD such that yiv∗⊤ π xi < 0. The analogous statement holds true for ZRR under Assumption 1(b). Furthermore, the if part holds true for SS and RR without Assumption 1. π must be orthogonal to all of Rd, so v∗ Proof. First suppose Assumption 1(a) holds. Then if Z π is SC, Lemma B.4.1 implies that any optimal direction v∗ π = 0. Hence the iterates vπ(t) converge to a finite optimum, which implies the GD risk cannot diverge. Note that if Assumption 1(a) doesn't hold, then the only difference is that being orthogonal to X SC π = 0. Now suppose Z π is PLS or LS. Regardless of whether Assumption 1(a) holds, if vπ(t) infimizes Lπ, we necessarily have ∥vπ(t)∥2 → +∞. Hence any mistake on (xi, yi) ∈ ZGD implies divergence. And clearly, if there is no mistake on any (xi, yi) then the GD risk does not diverge. π does not imply that v∗ The same proof also goes through for ZRR, so this proves the theorem. At first glance, one might expect to be able to perfectly classify all the datapoints in the overparameterized regime. However, under the logistic risk, the optimal direction instead puts monochromatic batches on the decision boundary; the following proposition formalizes this notion. B . Almost surely, for any π ∈ Sn, Proposition B.4.3. Suppose Assumption 2, B > 2, and d > (B − 1) n there exists v ∈ Rd which satisfies (1) for any non-monochromatic batch Z j π) = Y j π and (2) for any monochromatic batch Z k π for the logistic risk Lπ necessarily satisfies both (1) and (2). The same conclusion holds for RR as well, with the requirement d > (B − 1)(n π = 0⊤. Furthermore, any optimal direction v∗ π we have sgn(v⊤X j π we have v⊤X k B). 54 More precisely, our analysis is motivated by the fact that if d ≥ n and X ∈ Rd×n is full-rank, then given any c ∈ Rn we can find some halfspace v ∈ Rd such that v⊤X = c⊤. In our binary classification setting, linear separability is implied by sgn(c⊤) = Y . However, we cannot directly apply this fact because BN actually prevents X π from being full-rank due to the mean zero constraint. However, it turns out that the following slightly weaker statement is true. We can always find a halfspace v ∈ Rd that perfectly separates all the non-monochromatic batches. The following lemma proves this half of the proposition. Lemma B.4.4. Suppose Assumption 2, B > 2, and d > (B − 1) n such that for every non-monochromatic batch Z j conclusion holds for RR as well, with the requirement d > (B − 1)(n π = (X j π, Y j B . Then almost surely there exists v ∈ Rd π. The same π), we have sgn(v⊤X j π) = Y j * * * xB (cid:3) and Y j π) = (cid:2)x1 π = BN(X j (cid:3). Since Assumption 2 Proof. We denote X j holds, it also follows that Proposition 3.2.1 holds. Hence, within each batch, any B − 1 of the datapoints are linearly independent almost surely. This implies that we can find v ∈ Rd such that for any batch X j π and c ∈ RB−1, we have v⊤xi = ci for all i ∈ [B − 1]. In particular, we can pick ci such that sgn(ci) = yi. Next, we show that v can be picked such that sgn(v⊤xB) = yB. The mean zero constraint enforces that v⊤xB = − ∑B−1 i=1 ci. But if the labels are not monochromatic, we can just increase the absolute value of one of the ci's so that sgn(− ∑B−1 i=1 ci) = yB, as desired. * * * yB B). π = (cid:2)y1 Hence, in the overparameterized regime minimizing the logistic risk will lead to a classifier which separates all the non-monochromatic batches. What happens to the monochromatic batches? It turns out that minimizing the logistic risk will lead to a classifier whose decision boundary contains all of the monochromatic batches. B , any optimal direction v∗ ∈ Rd for the logistic risk simultaneously Lemma B.4.5. Assuming d > (B − 1) n puts all of the monochromatic batches on the decision boundary. More precisely, for any monochromatic batch Z j π = (X j B), the same conclusion holds for the RR dataset. π = 0⊤. Similarly, if d > (B − 1)(n π) we have v⊤ π, Y j ∗ X j * * * yB Proof. Again, we denote the monochromatic batch by Z j π = (cid:3). The logistic loss on a single input xi for classifier v ∈ Rd is l(v⊤xi, yi) = (cid:2)y1 − log ρ(yiv⊤xi), where ρ(t) = 1/(1 + exp(−t)) is the sigmoid function. WLOG suppose that yi = 1 for all i ∈ [B]. Hence the minibatch risk is π by X j * * * xB π = (cid:2)x1 (cid:3) and Y j − B ∑ i=1 log ρ(v⊤xi) = − B−1 ∑ i=1 log ρ(v⊤xi) − log ρ −v⊤ (cid:32) (cid:33) xi . B−1 ∑ i=1 For each i we can look at the first order optimality condition for si = v⊤xi. This yields ρ(si) = ρ(− ∑B−1 i=1 si). Note that this is satisfied when si = 0 for all i ∈ [B], and by strict convexity this is the unique minimizer. And because of overparameterization, we can find a v∗ that will satisfy si = 0 for each monochromatic batch, i.e., the batch entirely lies on the decision boundary of the classifier defined by v∗. The proof carries over immediately to the RR setting, except in that setting, being overparame- terized means d > (B − 1)(n B). Hence the lemma is proved. 55 The geometric interpretation of Lemma B.4.5 is that in the overparameterized regime, if the dataset contains any monochromatic batches, then any optimal direction v∗ must be orthogonal to the subspace spanned by the monochromatic batches. Note, however, that the definition of overparameterized here depends on whether we look at Z π or ZRR. In the former case, overparameterized means d > (B − 1) n B , whereas in the latter case, overparameterized means d > (B − 1)(n B). This insight motivates the construction of the toy datasets in Section 4.2. We conclude our characterization of the optimal direction in the overparameterized regime by proving Proposition B.4.3. Proof of Proposition B.4.3. Proposition 3.2.1 implies that for d > (B − 1) n B and assuming assump- tion 2, almost surely we have rank(X π) = (B − 1) n B . We can lower bound the infimum of the SS logistic risk by the sum of the infima of the mini-batch SS logistic risks. Combining Lemmas B.4.4 and B.4.5, the claim follows. The same argument holds for ZRR assuming d > (B − 1)(n B). C Proofs of technical lemmas In this section we spell out the formal details of our guarantees for how permutations interact with BN. In Appendix C.1, we show that given a batch size B = o(log n) and a constant number of classes K, then w.h.p. over the choice of π there exists (many) monochromatic batches. In other words, for small batch sizes there are many batches consisting solely of positive or negative examples (in case of K = 2). Conversely, we show that above this threshold such monochromatic batches do not appear w.h.p.. In Appendix C.2, we show that there is a commensurate threshold above which the batch statistics themselves concentrate in the without-replacement setting. To do so we will appeal to the recent results of Bardenet and Maillard (2015) on the concentration of without-replacement estimators. Finally, in Appendix C.3, we prove that assuming the original features were drawn from a density, the batch normalized features have maximal rank almost surely. In other words, batch normalization preserves genericity of the original features modulo the mean zero constraint inside each batch. C.1 Presence of monochromatic batches In this section we formally prove Lemma B.1.4 via standard concentration arguments. One of the potential pitfalls of any mini-batch based algorithm is that its batches may not be representative of the entire dataset. More precisely, let's suppose we have a dataset Z with labels coming from K classes. Suppose furthermore that the dataset is balanced - each class contains n = Bm examples (here K is a constant). For any batch size B which is not sufficiently large, i.e. B = o(log n), then w.h.p. over the permutation π we will have Θ(n) batches which are monochromatic - batches which only consist of examples in the same class. This is closely related to the classic coupon collector problem, but we restate the guarantees here for the sake of completeness. To prove this claim, we appeal to standard martingale concentration inequalities. Consider the π is monochromatic], and set π for i ∈ [Km] and define the indicator variables Ti = 1[Z i batches Z i T ≜ ∑i Ti, the total number of monochromatic batches. Next, note that the sequence E[T], E[T|T1], E[T|T1, T2], . . . , E[T|T1, T2, . . . , TKm] 56 is a Doob martingale. Indeed the martingale property follows from the tower property: E[E[T|T1:k]| E[T|T1:(k−1)]] = E[T|T1:(k−1)]. Note that E[T|T1, . . . , TKm] = T and E[T1] = K(n B)/(Kn Let us now show that the martingale increments E[T|T1:k] − E[T|T1:(k−1)] are bounded a.s.. In the worst case, the kth batch can only decrease this conditional expectation by at most K, since for any fixed class we can only remove at most one monochromatic batch from it. Hence the total number of potential monochromatic batches left can decrease by at most K. This worst case B ). Hence by linearity E[T] = K2n B . (n B) (Kn B ) guarantee still holds under conditional expectation, so Azuma-Hoeffding then tells us that for any ε > 0 we have (cid:12) (cid:12) (cid:12) E[T|T1:k] − E[T|T1:(k−1)] (cid:12) (cid:12) (cid:12) ≤ K a.s.. P[|T − E[T]| ≥ ε] ≤ 2 exp (cid:18) − Bε2 2nK3 (cid:19) . This gives us the following fact which we use in both the regression and classification setting. Fact C.1.1. For any δ ∈ (0, 1), and a constant number of classes K with n datapoints each, we have with probability at least 1 − δ that the total number of monochromatic batches T satisfies (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) T − K2n B (n B) (Kn B ) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:114) ≤ 2nK3 log(2/δ) B . For K = O(1), we note that the above inequality guarantees that we can get within O((cid:112)n log n) of the true expectation with at most 1/ poly(n) failure probability. For the toy regression dataset in Section 3.3, we have K = 2 and B = 2, so we can use Fact C.1.1 to deduce that there will be Θ(n) monochromatic batches with high probability. We can also use Fact C.1.1 to prove Lemma B.1.4. Proof of Lemma B.1.4. In the classification setting, we have K = 2 classes (positive and negative). Using the folklore inequalities (cid:17)k (cid:16) n k ≤ (cid:19) (cid:18)n k ≤ (cid:17)k , (cid:16) en k we can deduce the lower bound on the expectation of T: E[T] ≥ 4n B(2e)B . The lower bound is Ω(n1−ε) for any ε > 0 whenever B = o(log n), so indeed when when B = o(log n) we have a positive number of monochromatic batches w.h.p. Let us now upper bound the probability of obtaining any monochromatic batches. We have P[T1 = 1] = 2 (n B) (2n B ) ≤ 2 ∏B−1 k=0 (n − k) ∏B−1 k=0 (2n − k) ≤ 2 ∏B−1 k=0 (n − k) ∏B−1 k=0 2(n − k) ≤ 2−B+1. Hence by union bound the probability that T > 0 is upper bounded by 4n B*2B . This is 1/ poly(n) for some B = Ω(log n), so indeed when B = Ω(log n) we have no monochromatic batches with probability at least 1 − 1/ poly(n). This concludes the proof. 57 C.2 Concentration of batch statistics for without-replacement sampling In the following, we are generating B samples of Xi ∈ R without replacement from a population of size n, contained in [a, b] a.s.. We let μ be the population mean and σ2 be the population variance. Lemma C.2.1 (Corollary 2.5 in (Bardenet and Maillard, 2015)). Let ˆμB denote the sample mean for a sample of size B drawn without replacement from the overall population. For all B ≤ n and δ ∈ (0, 1) we have with probability at least 1 − δ that | ˆμB − μ| ≤ (b − a) (cid:114) log(2/δ) B . Similarly, they prove the following result about concentration of the empirical variance Lemma C.2.2 (Lemma 4.1 in (Bardenet and Maillard, 2015)). Let ˆσ2 B (biased) empirical variance estimator and ˆσB ≜ least 1 − δ that i=1(Xi − ˆμB)2 be the ˆσ2 B. Then for all δ ∈ (0, 1) we have with probability at (cid:113) ≜ 1 B ∑B ˆσB ≥ σ − 3(b − a) (cid:114) log(3/δ) 2B . We now prove the other side of this concentration inequality with a quick application of (Maurer, 2006, Theorem 1), following the same notation as in Bardenet and Maillard (2015). Lemma C.2.3. For all δ ∈ (0, 1) we have with probability at least 1 − δ that ˆσB ≤ σ + (b − a) (cid:114) log(1/δ) 2B . Proof. We take the self bounded random variable Z = B (b−a)2 ̃VB, where ̃VB ≜ 1 B B ∑ i=1 (Xi − μ)2 is computed with the samples Xi sampled with replacement. On the other hand, VB ≜ 1 B B ∑ i=1 (X′ i − μ)2 is computed with the samples X′ i sampled without replacement. We can relate the concentration of VB to that of ̃VB; the latter quantity is possible to analyze with the entropy method. Indeed, a routine modification of the proof of Bardenet and Maillard (2015, Lemma 3.3) (which uses essentially the same definition of Z) implies that (cid:20) P VB − σ2 ≥ (cid:21) (b − a)2 B ε ≤ exp (cid:18) − (b − a)2ε2 2Bσ2 (cid:19) . Solving for ε in terms of δ yields ε = (cid:113) 2Bσ2 (b−a)2 log(1/δ), so we obtain (cid:34) P VB − σ2 ≥ (b − a)σ (cid:114) 2 log(1/δ) B (cid:35) ≤ δ. 58 Since VB = ( ˆμB − μ)2 + ˆσ2 B, we can complete the square to obtain B ≥ ˆσ2   ˆσ2 P B ≥ (cid:32) σ + (b − a) (cid:114) log(1/δ) 2B (cid:33)2  ≤ δ. So with probability at least 1 − δ, we have (cid:32) ˆσ2 B ≤ σ + (b − a) (cid:114) log(1/δ) 2B (cid:33)2 , and taking square roots implies the desired result. Now, let us return to the question of concentration for batch norm with a randomly selected permutation π. The following proposition shows that assuming the batch size is large enough, the features of corresponding SS and GD datapoints are close to each other. Proposition C.2.4. If (cid:32) B = Ω log(nd) mink∈[d]( σk bk−ak )2ε2 (cid:33) , then with probability at least 1 − 1/ poly(n, d) we have (cid:13) (cid:13)X π − π ◦ X GD (cid:13) (cid:13)2,∞ ≤ ε 1 − ε (cid:13) (cid:13)X GD (cid:13) (cid:13)2,∞ + √ d ε 1 − ε . Here, we remind the reader that for a matrix A ∈ Rd×n, we define ∥A∥2,∞ = maxi∈[n] ∥A:,i∥2, i.e. the maximum Euclidean norm of the columns. Proof. WLOG consider the unnormalized first batch X 1 π = {x1, . . . , xB}. We initially handle concentration along its first coordinate {x1, . . . , xB} for its first datapoint x1. Write ˆμ, ˆσ ∈ Rd to denote the mini-batch mean and standard deviation, respectively, and ˆμk, ˆσk ∈ R for the kth coordinate of these vectors. Similarly let μ, σ ∈ Rd denote the full-batch mean and standard deviation, and let μk, σk ∈ R to denote the kth coordinate of these vectors, respectively. Finally, let a, b ∈ Rd denote the coordinate-wise min and max of X, with ak, bk ∈ R denoting the min and max for the kth coordinate of X. Hence, the first feature of the first datapoint in the normalized first batch X 1 π is x1− ˆμ1 ˆσ1 , whereas the corresponding quantity in X GD is x1−μ1 σ1 Pick . (cid:32) B = Ω (cid:33) . (log(1/δ) ( σ1 )2ε2 b1−a1 Then from Lemmas C.2.1 to C.2.3, we see that | ˆμ1 − μ1| ≤ εσ1 and | ˆσ1 − σ1| ≤ εσ1 with probability at least 1 − δ for the first datapoint x1. 59 Now, we have (cid:12) (cid:12) (cid:12) (cid:12) x1 − ˆμ1 ˆσ1 − x1 − μ1 σ1 (cid:12) (cid:12) (cid:12) (cid:12) = ≤ ≤ ≤ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) − (cid:12) (cid:12) (cid:12) (cid:12) x1 − μ1 ˆσ1 σ1 − ˆσ1 ˆσ1 εσ1 (1 − ε)σ1 (cid:12) (cid:12) (cid:12) (cid:12) x1 − μ1 σ1 (cid:12) x1 − μ1 (cid:12) (cid:12) (cid:12) σ1 (cid:12) x1 − μ1 (cid:12) (cid:12) (cid:12) σ1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) x1 − μ1 σ1 ε 1 − ε + + + + (cid:12) μ1 − ˆμ1 (cid:12) (cid:12) ˆσ1 (cid:12) |μ1 − ˆμ1| ˆσ1 εσ1 (1 − ε)σ1 ε 1 − ε . To aggregate this bound across features, we need to pick B such that | ˆμk − μk| ≤ εσk and | ˆσk − σk| ≤ εσk for every feature k ∈ [d]. Indeed, this is achieved via the union bound by picking δ = 1/ poly(d) and B = Ω For this batch size, we see that (cid:32) log(1/δ) mink∈[d]( σk bk−ak (cid:33) . )2ε2 (cid:13) (cid:13) (cid:13) (cid:13) x1 − ˆμ ˆσ − x1 − μ σ (cid:13) (cid:13) (cid:13) (cid:13)2 ≤ ε 1 − ε (cid:13) (cid:13) (cid:13) (cid:13) x1 − μ σ (cid:13) (cid:13) (cid:13) (cid:13)2 + √ d ε 1 − ε . Note that a similar inequality holds for all of x1, . . . , xB. Now, recalling the definition of ∥*∥2,∞, by applying union bound on all the batches, we have (cid:13) (cid:13)X π − π ◦ X GD (cid:13) (cid:13)2,∞ ≤ ε 1 − ε (cid:13) (cid:13)X GD (cid:13) (cid:13)2,∞ + √ d ε 1 − ε , which occurs with probability at least 1 − 1/ poly(n, d) when we appropriately choose B = Ω (cid:18) (cid:19) log(nd) σk bk −ak mink∈[d]( )2ε2 . We now use the above proposition to prove Proposition B.1.6. Proof of Proposition B.1.6. Conditions (2) and (3) in the definition of γ-robustness ensures that √ mink∈[d]( σk ) as in Proposi- bk−ak ε2 tion C.2.4, we conclude that with probability at least 1 − 1/ poly(n, d) we have d). Hence taking B = Ω( log(nd) )2 = Ω(1) and (cid:13) (cid:13)2,∞ = O( (cid:13) (cid:13)X GD (cid:13) (cid:13)X π − π ◦ X GD (cid:13) (cid:13)2,∞ ≤ O (cid:32) √ d ε 1 − ε (cid:33) . Hence, by taking ε = O( γ√ d ), we see that (cid:13) (cid:13)X π − π ◦ X GD (cid:13) (cid:13)2,∞ ≤ O(γ). Plugging this choice of ε back into our definition of B, we conclude that when B = Ω( d log(nd) X π concentrates around π ◦ X GD within distance γ. γ2 ), 60 C.3 Rank of batch normalized features In this section we prove Proposition 3.2.1, which states that for batch sizes greater than 2, Assump- tion 2 implies that the batch normalized dataset will be full-rank (and hence full-dimensional) almost surely. One shift in perspective that is fruitful for proving linear independence is to view batch normalization as an operation that returns functions of the input dataset. Since BN operates independently on each of the d features, we first handle the case where the input is a batch of scalars. Let ([n] B ) denote the set of all (n B) batches of size B that can be created from n datapoints contained in X. Fix an arbitrary labelling of these (n B) batches, and let B j refer to the jth such batch. WLOG suppose that B1 = {x1, . . . , xB} ∈ RB. Formally, let F B ≜ (cid:8) f : RB \ (cid:8)x ∈ RB | x1 = x2 = * * * = xB valued functions on batches of size B where BN is defined. On batch B j = (cid:8)xj1, . . . , xjB operation that maps this batch to the set of B functions , where (cid:111)B (cid:110) (cid:9) → R(cid:9) denote the space of real (cid:9), BN is an gj i (B j) i=1 i (B j) ≜ xji − μj gj σj ∈ F B where μj and σj are the empirical mean and standard deviation, respectively of B j. If j is clear from context, we may drop the superscript j without chance of confusion. We also sometimes abuse notation and write gj i as a function of X, since X contains all datapoints in B j. From this perspective, BNπ maps a dataset of n datapoints to n functions. We first show that, within a batch, the functions have rank B − 1 over R. Lemma C.3.1. Viewed as functions, any subset of B − 1 functions of the batch normalized outputs (cid:8)g1 have rank B − 1 over R. (cid:110) x1−μ (cid:9) = (cid:111) σ , . . . , xB−μ σ i Proof. First, we note that the functions xi are linearly independent over R for i ∈ [n]. WLOG take the subset of B − 1 functions to be (cid:8)g1 (cid:9)B−1 i=1 . Suppose that there is a dependence relationship i B−1 ∑ i=1 ci xi − μ σ = 0. Rearranging, we see that B−1 ∑ i=1 (cid:32) B ∑ t=1 and because of linear independence of the xi's as functions over R and only the right-hand side contains xB, the only way this can happen is if ∑B−1 i=1 ci = 0. But then we have a dependence relationship between the xi's for i ≤ B − 1. Linear independence of the xi's thus implies that ci = 0 for each i. (cid:33)(cid:32)B−1 ∑ i=1 cixi = 1 B xt (cid:33) ci With the above lemma in hand, we can show that as functions, any collection of batch normalized outputs are essentially full rank. The caveat is we need to throw out one function in each batch, as each batch is trivially dependent because of the zero mean constraint. Proposition C.3.2. Let B > 2. Consider the B(n B) batches B j ∈ ([n] (n B ). If we take any subset of (B − 1)(n B) functions that are the batch normalized outputs of all B) of these functions obtained by removing one 61 function from each of the (n the rank of the functions corresponding to any π is (B − 1) n B . B) batches, then the rank of these functions over R is (B − 1)(n B). In particular, i (cid:111)B−1 (cid:9)B−1 i=1 (cid:110) xi−μ σ Proof. Consider the batch B1 = {x1, . . . , xB}. By Lemma C.3.1, we know that the functions (cid:8)g1 = i=1 subset of the (B − 1)(n formed by throwing out gj (B − 1)(n are linearly independent. Consider a dependence relation amongst any B) described in the theorem statement. WLOG we can suppose that this was B from each batch B j and consider a dependence relation between the B) remaining functions. The dependence relation reads B−1 ∑ i=1 xi − μ σ B−1 ∑ i=1 ci,jgj i. ∑ j>1 ci,1 = (C.1) We show that some setting of the input xi for i ∈ [n] yields a contradiction unless ci,1 = 0 for i ∈ [B]. The main insight is that BN has jump discontinuities at the points where it is undefined, i.e., where the entire batch is equal to the same thing. More formally, for i > B we set the other datapoints xi to be arbitrary pairwise distinct positive real numbers. Suppose for the sake of contradiction that ci,1 ̸= 0 for some i ∈ [B]; WLOG we can assume that i = 1. Since the functions on the LHS are linearly independent by Lemma C.3.1, the LHS is not identically zero. We show that the LHS of Eq. (C.1) exhibits discontinuous behavior in the punctured neighborhood around (x1, . . . , xB) = 0, whereas the RHS of Eq. (C.1) is continuous on the same neighborhood; this yields a contradiction. Indeed, set (x1, x2, x3, . . . , xB) = (ε, ε2, −ε − ε2, 0, . . . , 0), where ε ̸= 0. We have √ x1 − μ σ = (cid:112) Bε ε2 + ε4 + (ε + ε2)2 . If ε → 0+, then the the first normalized coordinate approaches + (cid:113) (cid:113) 2 . However, if ε → 0−, B 2 . This is a contradiction, since the RHS of B then the first normalized coordinate approaches − Eq. (C.1) is continuous as a function of ε. We conclude that ci,1 = 0 for all i ∈ [B − 1]. The same argument holds if we replace the LHS with any batch B j. Hence, ci,j = 0 for all i ∈ [B − 1] and j ∈ [(n B), as desired. Notice also that this argument also shows that the functions corresponding to the batches in π also have rank (B − 1) n B . B)]. We conclude the rank of these (B − 1)(n B) functions is (B − 1)(n Note that the assumption that B > 2 is critical for the construction in the proof. If B = 2, then σ ∈ {±1}, and the proof breaks down. The batch normalized dataset will be a Boolean actually xi−μ matrix; hence, its rank cannot be analyzed by using density arguments. The following lemma establishes that the zero set of any nontrivial linear combination of the gj i's is a measure zero subset of Rn. Lemma C.3.3. Suppose that ci,j are not identically zero. Then for B > 2, the zero set of ∑B−1 i=1 a measure zero subset of Rn. ∑(n B) j=1 ci,jgj i is Proof. Since B > 2, Proposition C.3.2 implies that f (X) ≜ ∑B−1 i is not identically zero. i=1 Furthermore, f (X) is real analytic on finitely many connected components of Rn, since each of the functions gj i are real analytic on finitely many connected components of Rn. The claim follows by applying Proposition 0 in Mityagin (2015). ∑(n B) j=1 ci,jgj 62 Having established these results, we can finally prove Proposition 3.2.1. Proof of Proposition 3.2.1. Denote and the (B − 1)(n B) functions X =   ∈ Rd×n,     X1 ... Xd gj i (X) =         gj i,1(X1) ... gj i,d(Xd) ∈ Rd We can assemble these vector valued functions into a matrix G(X) of size d × (B − 1)(n B) with i,k(X). Now consider the determinant of (cid:9) submatrix of these scalar functions, which is itself a the kth row consisting of the scalar valued functions gj any min (cid:8)d, (B − 1) n function of X. (cid:9) × min (cid:8)d, (B − 1) n B B To prove the claim, it suffices to show that this determinant - which is a function of X ∈ Rd×n - is analytic almost everywhere and not identically zero; then Lemma C.3.3 implies that it vanishes on a measure zero set of Rd×n. We prove the above claim by induction on d. For d = 1, note that for any i, j, the scalar function gj i,1(X) is not identically zero and is analytic on finitely connected components of Rd×n. Now suppose the claim is true for d, we prove the claim for d + 1. When we use cofactor expansion along the first row of G, which has functions gj i,1 which crucially only depend on the X1, we obtain B−1 ∑ i=1 (n B) ∑ j=1 (−1)i+jgj i,1(X1) det(cid:0)Mi,j(X)(cid:1), where Mi,j denotes the minor corresponding to the the ith function of batch j. Note that these minors are not functions of X1, so they can be treated as constants with respect to X1. By induction these constants are nonzero almost surely. Then Proposition C.3.2 implies that the determinant, which is a linear combination of the functions gj i,1 is itself is not zero identically. Also, the determinant is manifestly piecewise analytic on finitely connected components of R(d+1)×n, being a polynomial of such functions. Hence the induction is completed. We can now finish off the proof of the proposition. When Assumption 2 holds, the probability that the data falls in measure zero set is a probability zero event. In other words, almost surely any such d × (B − 1)(n B) matrix constructed by batch normalizing and throwing out one normalized point in each batch is full rank. The same argument holds for the (B − 1) n B functions that correspond to the batch normalized outputs for a permutation π. Hence the proposition is proved. D Additional experiments on real data In this section we provide detailed explanations of our experimental setup and present our additional experiments for regression and classification. All experiments were implemented in PyTorch 1.12. 63 D.1 Experiment details We first define the architectures used in our real data experiments outlined in Section 4.3. For the linear+BN networks, the 1-layer network is X (cid:55)→ W1 Γ 1BN(X), On the other hand, the 2-layer network is X (cid:55)→ W2Γ2BN(W1X) and the 3-layer network is X (cid:55)→ W3Γ3BN(W2Γ2BN(W1X)). Hence the difference between the 1-layer network and deeper network is that the deeper networks have tunable parameters inside of BN. For the MLP experiments, the 3-layer network is X (cid:55)→ W3 ReLU(Γ3BN(W2 ReLU(Γ2BN(W1X)))). For the ResNet18 experiments, we used the ResNet18 architecture available through PyTorch, using ResNet18_Weights.DEFAULT pretrained weights. The linear and BN layers were all initialized using the default PyTorch initialization. For the linear+BN networks, the linear layers were instantiated with a width of 512 and bias=False. For the 3 layer MLP, the linear layers were instantiated with a width of 512 and bias=True. The BN layers were instantiated with track_running_stats=False. As alluded to in Section 1.2, to evaluate the training GD risk LGD in the eval loop, we passed in the entire dataset as a single batch, thus avoiding EMA altogether. Except for the ResNet18 experiments, the images in the dataset were flattened into vectors. Except for in the respective batch size and momentum ablation study (Figures 11 and 12), we used batch size B = 128 and no momentum. Note that for all of the datasets, log2 n ≈ 16, which suggests that we are in the asymptotic regime where divergence can happen as stated in Theorem 4.1.3. We now explain the difference in divergence behavior between the 1-layer and deeper lin- ear+BN networks for SS. As suggested by Theorem 4.1.3, divergence can happen if the separability decomposition of ZGD is not robust to perturbation. In the 1-layer case, the data remains far from being linearly separable. Meanwhile, in the deeper case, the network is incentivized to train the parameters inside BN such that the final features (e.g., BNπ(W1X)) are closer to being LS. But the nonlinearity of BN is not enough to make BNπ(W1X) robustly LS. This also explains why introducing nonlinear activations prevents the divergence phenomenon. We also note that in reality RR is run for T epochs. Thus, if T < (n B) n B , the optimization routine only sees a proper subset of ZRR. However, there are other forces that help ensure that the subset of ZRR actually seen during optimization is SC and satisfies Assumption 1(b). For example, it is likely that the algorithm sees non-monochromatic batches that also cause the hulls to overlap. One way this can happen is if 0 is in the relative interiors of the convex hulls of the monochromatic portion of each batch. Moreover, with extremely high probability we never see a repeat batch, so (cid:9). For us, by Proposition B.1.3 the rank of the subset of ZRR is w.h.p. equal to T * min (cid:8)d, (B − 1) n B 64 d = 10 * 512, B = 128, and n ≥ 50000, so the rank of the subset of ZRR we see easily outstrips the dimensionality of the final linear layers. This ensures that Assumption 1(b) holds. In Figure 11, we see that divergence on 3 layer linear+BN networks generally occurs for large batch sizes, which corroborates Theorem 4.1.3. These batch sizes were picked because they are common choices for batch sizes in practice. For the largest batch size (B = 128), there does not appear to be divergence within 1000 epochs, which we address below. In Figure 12, we see that the presence of momentum preserves divergence for SS, and in some cases accelerates it. Note that for each stepsize we used the same permutation. For the η = 10−4 experiment, although the 0 momentum run did not start to diverge within 1000 epochs, the 0.9 and 0.99 momentum runs started to diverge. This further lends evidence to the claim that the apparent reason for no divergence for η = 10−4 without momentum is that the small learning rate leads to slower convergence to an optimal direction for Lπ. Figure 7: Loss evolution for lπk (M (k)) for experiment described in Section 3.4. Figure 8: Eventual separation between SS and RR for 3 layer linear+BN network for η = 10−4 after around epoch 1200 on CIFAR10. 65 020406080100Epoch1234567SS train riskConvergence of k(k0)RRSS*05001000150020002500Epoch1.51.61.71.81.9GD train riskLR0.0001ShufflingRRSS Figure 9: Evidence that the 2 layer and 3 layer linear+BN actually had diverging GD risks when trained with SS. Indeed, the SS risk for both 2 and 3 layer networks continues to decrease, whereas the 1 layer network seems to plateau. Figure 10: No divergence occurs for 1, 2, and 3 layer linear networks without BN trained with SS. Here η = 10−2. Figure 11: Batch size ablation. These experiments were done on 3 layer linear+BN networks; each subfigure shows the results of training with different stepsizes η ∈ (cid:8)10−2, 10−3, 10−4(cid:9). All experiments were performed on CIFAR10. All batch sizes are in the regime where divergence can happen according to Theorem 4.1.3. 66 050010001500200025003000Epoch0.00.51.01.52.02.5SS train riskDepth123ShufflingSS02004006008001000Epoch1.61.71.81.92.02.12.22.3GD train riskLinear networks without BNDepth123ShufflingRRSS02004006008001000Epoch234567GD train risk=10202004006008001000Epoch23456GD train risk=10302004006008001000Epoch1.52.02.53.03.54.04.5GD train risk=104Batch Size3264128ShufflingRRSS Figure 12: Momentum ablation. These experiments were done on 3 layer linear+BN networks; each subfigure shows the results of training with different stepsizes η ∈ (cid:8)10−2, 10−3, 10−4(cid:9). All experiments were performed on CIFAR10. For each subfigure, the experiment was run with the same random permutation. 67 02004006008001000Step1.52.02.53.03.54.04.55.05.5Value=10202004006008001000Step1.52.02.53.03.54.04.55.0Value=10302004006008001000Step1.501.752.002.252.502.753.003.25Value=104Momentum0.00.90.99ShufflingRRSS E Calculations for toy datasets In this section we do the detailed calculations and provide additional figures to understand the toy datasets we introduced in Sections 3.3 and 4.2. Since both constructions use B = 2, we remind the reader that the batch normalization of any two distinct real numbers is (−1, 1). It follows that if we batch normalize with B = 2, we obtain X π ∈ {−1, 1}d×n. Recall the distorted risk Lπ reflects the single-shuffle batch normalized dataset Z π. This Lπ is a random quantity, and it is over this source of randomness (the construction of the batches) that we show that there is a gap between SS, RR, and GD. E.1 Regression toy dataset Proposition E.1.1. There exists a regression dataset Z = (X, Y ) ∈ [−1, 1]1×16n × [−1, 1]1×16n such that the following statements hold with batch size B = 2: (1) M ∗ (2) M ∗ RR = 0. GD = M ∗ π ̸= 0 with probability at least 1 − O( 1√ n ). (3) |M ∗ π| = Ω( 1√ n ) with constant probability. We first describe the construction and then prove that the dataset satisfies the properties outlined above. Formal construction of regression dataset: Construct the dataset as follows. Take A ∈ R1×4n to be 4n equally spaced points in the interval ( 3 4 , 1). Define X 1 = A; 1 2 1⊤; X 3 = −A + X 2 = −A X 4 = A − 1⊤ 1 2 and Y 1 = 1⊤; Y 3 = −1⊤; Y 2 = 1⊤ Y 4 = −1⊤. Notice that the indices also match which quadrant the cluster of points are in. Visually, these four groups of points Z i ≜ (X i, Y i) are clusters with the ith cluster in the ith quadrant. For brevity, we also refer to these clusters by their index i only, so cluster 1 refers to the cluster Z1 = (X 1, Y 1), and so on. These definitions are consistent with the clusters depicted in Fig. 13a. Then take X = (cid:2)X 1 X 2 X 3 X 4(cid:3) ∈ R1×16n and Y = (cid:2)Y 1 Y 2 Y 3 Y 4(cid:3) ∈ R1×16n. After applying BN with permutation π and batch size 2, we obtain a dataset X π with every point being located in one of four SS clusters Z i π) for i ∈ [4] located at (±1, ±1) with the same π relative labelling: Z1 π is located at (1, 1) and then labelling counterclockwise (see Fig. 13b). ≜ (X i π, Y i In Fig. 13a, we visualize the construction with n = 3 (so the depicted dataset has 16n = 48 datapoints). We plot the slopes of the M ∗ RR (purple dash-dotted line), and typical values for M ∗ π (yellow dotted line). In Fig. 13b, we show what Z π looks like for a typical permutation π. The sizes of the points represent the number of points that end up in the corresponding cluster. GD (green solid line), M ∗ 68 (a) Unnormalized toy regression dataset Z demon- strating distortion of SS with constant probability. Notice how the GD and RR lines are aligned with slope 0, but the SS lines are distorted away from 0. E.1.1 Analyzing the regression toy dataset (b) Toy regression dataset after BN with permu- tation π. The size of the point corresponding to Zi π represents the number of normalized points in Zi π (not to scale), and here we picked π such that M ∗ π = 1 4 . In order to prove this proposition, we will need the following standard technical estimate on the asymptotics of binomial coefficients (see e.g. Thomas and Joy (2006)) Lemma E.1.2. For all n and k we have (cid:114) n 8k(n − k) 2H(k/n)n ≤ (cid:114) (cid:19) (cid:18)n k ≤ n πk(n − k) 2H(k/n)n, where H(p) ≜ −p log2 p − (1 − p) log2(1 − p) is the binary entropy function. Now let us prove the prove the proposition. Proof of Proposition E.1.1. First, it is clear from the symmetry of X that YGDX This proves the first half of (1). ⊤ GD = 0, so M ∗ GD = 0. π denote the number of points that end up in cluster Z i Setup: For i ∈ [4], let ki with permutation π. Since we have M ∗ In fact, more is true: we claim that M ∗ π = 1 π = 0 if and only if k1 To see why this is true, first note that the label Y is unaffected by BN. Hence, there are necessarily 8n points that end up with y coordinate 1. It follows that if there are k points in Z1 π, then there are 8n − k points in Z2 π. Similarly, if there are j in Z3 π. On the other hand, recall that BN with B = 2 and d = 1 always sends one point in each batch to π, then there are 8n − j in Z4 π after normalizing π completely determine M ∗ π. ⊤ π , evidently the ki 16n YπX π = 4n. 69 1.000.750.500.250.000.250.500.751.001.000.750.500.250.000.250.500.751.00Cluster 1Cluster 2Cluster 3Cluster 4ZZ1Z2Z3Z4M*GDM*M*RR1.000.750.500.250.000.250.500.751.001.000.750.500.250.000.250.500.751.00ZZ1Z2Z3Z4M*GDM*M*RR x = +1 and one point to x = −1. Hence, there are 8n points that end up with x coordinate 1, which means k + 8n − j = 8n, implying that k = j. Referring back to the formula for M ∗ π, we see that M ∗ π = 1 16n 4 ∑ i=1 π(X i Y i π)⊤ = = (k − (8n − k) + k − (8n − k)) 1 16n k − 4n 4n . Hence M ∗ clusters represent ki To analyze k1 π = 0 if and only if k1 π = 4n. Referring back to Fig. 13b, we see that the sizes of the π with slope 1 π, and the plotted M ∗ 4 corresponds to a π where k1 {i,j} π, for i, j ∈ [4] we introduce the random variables T π to denote the number of batches formed with one point from cluster i and cluster j with permutation π. Similarly let U ≜ {1, 2} denote the upper clusters and L ≜ {3, 4} denote the lower clusters. Define {i,L} T , which represents the total number of batches with one point in cluster π {2,L} {U,L} + T i and another point in L when using permutation π. Finally, define T , π π which represents the total number of batches with one point in cluster U and another in L with permutation π. {i,4} {i,3} π + T π {1,L} ≜ T π π = 5n. ≜ T With this notation in hand, let us prove the claim. Evidently, k1 . Because we established earlier that k1 {U,U} we have k2 π = T π {1,L} and only if T π batches is the same as the number of {2, L} batches. {2,L} + T π {2,L} . In words, this means that M ∗ = T π {U,U} {1,L} π = T + T π π π = 8n, then k1 π + k2 . Similarly π = 4n if π = 0 if and only if the number of {1, L} RR averages out distortion: For every π we can find π′ such that M ∗ {1,L} we can always find π′ that swap T π and vice versa. Then Proposition 3.3.1 implies that M ∗ π. This is because , by turning all {1, L} batches into {2, L} batches RR = 0, which proves the second half of (1). π′ = −M ∗ {2,L} and T π SS is distorted: Now, let us show that P[k1 π = 4n] = O( 1√ n {2,L} {1,L} = T = 2t, we can compute the probability that T π π {U,L} = t exactly. Indeed, of the 4n on T π points in cluster 1, we pick t of them to form batches with L, and similarly for cluster 2. This gives {2,L} (4n = T = t. In total, there are 8n points in U and we picked 2t of them to t ) π match with L, which gives a denominator of (8n ). The main idea is that conditioned {1,L} ways for T π 2 2t). Hence P[k1 {U,L} π = 4n|T π = 2t] = 2 (4n t ) (8n 2t) . In order to obtain the O( 1√ n ) bound we desire, we need to use the fact that T {U,L} π - the number of batches between U and L - concentrates tightly. In fact, if we color the 4 clusters corresponding to membership in U and L and slightly generalize the analysis leading to Fact C.1.1, (cid:12) (cid:12) ≤ 2C(cid:112)n log n with probability (cid:12) we obtain that for some absolute constant C, we have at least 1 − 1/n. (cid:12) {U,L} (cid:12) (cid:12)T π − 4n 70 Applying Lemma E.1.2, we obtain for all t such that |t − 2n| ≤ 2C(cid:112)n log n, we have P[k1 {U,L} π = 4n|T π = 2t] = O   4n )n n t(4n−t) 28H( t (cid:113) n t(4n−t) 28H( t (cid:19) 4n )n (cid:18)(cid:114) n = O = O t(4n − t) (cid:19) (cid:18) 1 √ n .   (E.1) (E.2) (E.3) Hence we have P[k1 π = 4n] = ≤ 4n ∑ t=0 1 n + P[k1 {U,L} π = 4n|T π {U,L} = 2t] P[T π = 2t] P[k1 {U,L} π = 4n|T π {U,L} = 2t] P[T π = 2t] n log n ∑ √ |t−2n|≤C (cid:18) 1 √ n (cid:19) + O (cid:18) 1 √ n (cid:19) , ≤ 1 n ≤ O {U,L} where in the second line we have used the union bound along with the fact that T π and in the third line we have used Eq. (E.3). This proves (2). concentrates, Quantitative SS distortion bounds with constant probability: Finally, we show (3). Suppose that k1 n). The above analysis for the case of d = 0 immediately generalizes to show that, if t − d > 0, π = 4n + d for |d| = O( √ P[k1 {U,L} π = 4n + d|T π = 2t − d] = t )( 4n (4n t−d) ( 8n 2t−d) . Notice that since 2t − d concentrates around 4n, it suffices to only consider the high probability regime where 2t − d = 4n + O((cid:112)n log n). In particular, since |d| = O( n), we have t − d = O(t). √ Thus, if we plug in Lemma E.1.2, we obtain in the regime where t − d = O(t) that t )( 4n (4n t−d) ( 8n 2t−d) (cid:18) 1 √ = O (cid:19) t 24n[H( t 4n )+H( t−d 4n )−2H( 2t−d 8n )]. Concavity of binary entropy implies that H( t 4n ) + H( t−d 8n ) ≤ 0. It follows that P[k1 {U,L} π = 4n + d|T π = 2t − d] = O 4n ) − 2H( 2t−d (cid:19) (cid:18) 1 √ . t 71 Following the same argument as in the d = 0 case, we have for |d| = O( √ n) that P[k1 {U,L} π = 4n|T π {U,L} = 2t − d] P[T π = 2t − d] P[k1 {U,L} π = 4n + d|T π {U,L} = 2t − d] P[T π = 2t − d] √ n log n P[k1 π = 4n + d] = ≤ 4n ∑ 2t−d=0 1 n + |t− d ∑ 2 −2n|≤C (cid:18) 1 (cid:19) √ n + O (cid:18) 1 √ n (cid:19) , ≤ 1 n ≤ O From here, it follows that there exists some positive constant c such that P[ (cid:12) (cid:12) (cid:12)k1 π − 4n √ (cid:12) (cid:12) (cid:12) > c n] = Ω(1), which proves (3). E.2 Classification toy dataset In this section, we motivate how we constructed our toy classification dataset parameterized by n. We then give a detailed construction and analysis of the dataset, parameterized by n. We plot the unnormalized Z in Fig. 14a and the normalized ZGD in Fig. 14b for n = 10. The main idea is that since d = 2 and the optimal direction is orthogonal to the SC portion of the separability decomposition (Lemma 4.1.1), we can fix the optimal directions of Z π and π ) and Span(X SC ZGD by carefully constraining Span(X SC GD), respectively. For, ZGD we carefully − select the boundary points Xbdr which define the boundary of conv(X GD) so that dim(Span(X SC GD)) = 1. For Z π, we need to ensure that Span(X SC π ) is a one dimensional subspace of R2 which is close to orthogonal with Span(X SC GD). Although we can guarantee dim(Span(X SC π )) ≥ 1 w.h.p., the main subtlety here is ensuring that equality holds with con- stant probability. Given the above, we are afforded the luxury of adding datapoints which are misclassified by v∗ + GD) and conv(X π, the optimal direction of Lπ. Proposition E.2.1. There exists a classification dataset Z = (X, Y ) ∈ [−3, 3]2×(2n+6) × {−1, 1}2n+6 such that the following statements hold with batch size B = 2: (1) ZGD is PLS and as n → ∞, v∗ (2) Z π is PLS with constant probability. If so, we have v∗ GD converges in direction to (cid:2) π = (cid:2) 1 2 (cid:3)⊤ . 1 −1 (cid:3)⊤ . (3) There exists points (xi, yi) ∈ ZGD such that yi⟨v∗ π, xi⟩ < 0, i.e., GD points that v∗ π misclassifies. Hence, the GD risk LGD diverges with constant probability if we train with SS. err, X + Proof. In our construction, we separate out Z = (X, Y ) into several groups of points: X + cor, X + bdr, and their negative variants. Let the overlined version of these matrices denote the ≜ BN(X)), and the overlined corresponding points after full-batch BN (i.e., after taking X GD version with an extra π subscript denoting the corresponding points after BN with permutation π 72 (i.e., X π ≜ BNπ(X)). For example, X that are to be classified correctly by v∗ batch normalization with π. + cor denotes the features for the positive examples in X GD + cor,π denotes those same datapoints in X π after π, whereas X Setup: Let us first explain the semantic meanings of the different groups of points in our construction. X + cor : Unnormalized positive examples correctly classified by v∗ X + err : Unnormalized positive example incorrectly classified by v∗ bdr : Unnormalized positive examples on the decision boundary of v∗ X + + cor : full-batch-normalized positive examples correctly classified by v∗ + err : full-batch-normalized positive example incorrectly classified by v∗ X + bdr : full-batch-normalized positive examples on the decision boundary of v∗ X π π X GD π with positive margin π with positive margin We construct X + The semantic meanings of the negative versions of these points are completely analogous. We also define Xbdr = X + bdr, and the normalized quantity analogously. err, and X + bdr as follows. Take X + (cid:3)⊤ n centered at (cid:2) cor to be n equally spaced points on . For the sake of visual clarity, we increase the bdr ∪ X − cor, X + the line segment of width 1 spacing of the points in the diagram Fig. 14a. Define X + (cid:20)−3 1.5 −0.5 , lying on the line y = −0.5x. Finally, define . Next, define X + bdr to be err to be (cid:2) 3 2.5 2 2 (cid:3)⊤ (cid:21) 1 cor cor = −X + X − err = −X + X − cor bdr = −X + X − bdr. In Fig. 14, we visualize this toy dataset. Note the visual similarity between Z in Fig. 14a and ZGD in Fig. 14b; this is a feature of the construction. Indeed, as we'll see shortly, as n → ∞, X GD approaches a uniform rescaling of X in all coordinates. We also plotted the decision boundaries − corresponding to v∗ GD and v∗ err are both on the wrong side of the decision boundary for v∗ π. π. We highlight the fact that in Fig. 14b, X + err and X GD is PLS: Evidently μ = 0 and one can compute that as n → ∞ that σ → (cid:2) we see that ZGD is PLS with Span(X SC by X bdr and v∗ Span(X bdr) = Span((cid:2)−2 1 . Regardless, GD) corresponding to the one-dimensional subspace spanned GD correctly classifies all of the other points. In the limit n → ∞, we have that GD is in the direction (cid:2) . This proves (1). ) and v∗ 2 2 1 2 (cid:3)⊤ (cid:3)⊤ (cid:3)⊤ SS is PLS with constant probability: Now, let us compute what happens to Z π. Because BN with B = 2 sends features to ±1, this implies that a normalized batch is either mapped to (1) (2) (cid:21) (cid:21) (cid:20)−1 +1 −1 +1 (cid:20)−1 +1 +1 −1 , i.e. the normalized batch lies in the direction (cid:2)+1 +1 (cid:3)⊤ ; or , i.e the normalized batch lies in the direction (cid:2)+1 −1 (cid:3)⊤ . 73 (a) Unnormalized toy classification dataset Z. (b) Normalized toy classification dataset Z π demon- strating divergence of SS with constant probability. Figure 14: Toy classification dataset (a) before full-batch BN, i.e. Z (b) after full-batch BN, i.e. ZGD. Note that due to Fact C.1.1, with high probability, there will be a batch drawn from X + cor and a cor. These batches necessarily land in situation (1), so (cid:2) ∈ Span(X SC batch drawn from X − π ) with high probability. On the other hand, with high probability there will be a batch with one point from X + ), this implies that Z π is PLS with optimal direction (cid:2)−1 +1 (cid:3)⊤ 1 1 cor, which lands in (2). Hence, as long as Span(X SC By inspection, to ensure that Span(X SC ), there are two bad events we need cor and one from X − π ) = Span((cid:2) π ) = Span((cid:2) 1 1 1 1 (cid:3)⊤ (cid:3)⊤ (cid:3)⊤ . to avoid: (a) We send a positive example to (cid:2)+1 −1 (cid:3)⊤ . (b) We send a negative example to (cid:2)−1 +1 (cid:3)⊤ . We will use P[avoid (a) and (b)] = P[avoid (a) | avoid (b)] P[avoid (b)]. Note that by symmetry, P[avoid (b)] = P[avoid (a)]. A little thought reveals that (a) can happen only if the positive boundary example (i.e. in X + located originally at (cid:2) occurs with probability at most 2 probability at least 1 both (a) and (b) is at least 1 3 This proves (2). (cid:3)⊤ 1 −0.5 bdr) cor. In turn, this event 3 . Also, notice avoiding (a) still happens with 3 even after conditioning on avoiding (b). Hence, the probability that we avoid (cid:3)⊤ ). is batched together with a point in Xbdr ∪ X + 3 . So P[avoid (b)] ≥ 1 9 . So with constant probability, Span(X SC π ) = Span((cid:2) 2 = 1 1 1 Putting it all together, we see that with constant probability, Span(X SC GD → (cid:2) and Z π is PLS with optimal direction v∗ π = (cid:2)+1 −1 . Recall that v∗ (cid:3)⊤ π ) = Span((cid:2) (cid:3)⊤ 1 2 ), 1 1 as n → ∞. So (cid:3)⊤ 74 321012321012Xerr+Xcor+XerrXcorXbdrXbdrZPosNeg(v*)x=01.51.00.50.00.51.01.51.00.50.00.51.0X+errX+corXerrXcorXbdrXbdrZGDPosNeg(v*GD)x=0(v*)x=0 asymptotically we have |⟨v∗ ∥v∗ π, v∗ π∥(cid:13) (cid:13)v∗ GD⟩| (cid:13) (cid:13) GD = 1 √ 10 . SS misclassifies GD points: On the constant probability event that Z π is PLS, we have v∗ + the direction (cid:2) err and X − err. So this proves (3). . This misclassifies X 1 −1 (cid:3)⊤ π is in Remark E.2.2. Note that at the cost of visual clarity, we can modify the construction to obtain optimal classifiers v∗ GD which are asymptotically orthogonal. In this alternate construction, we take X + bdr = , lying on the line y = −x, and X + π and v∗ (cid:20)−1 0.5 1 −0.5 (cid:21) cor to be n equally spaced GD → (cid:2) . Then v∗ , and 1 1 (cid:3)⊤ (cid:3)⊤ points on the line segment between (cid:2)−2 2 π = (cid:2) v∗ 1 −1 with constant probability, as desired. (cid:3)⊤ (cid:3)⊤ and (cid:2)−2 + 1 n 2 + 1 n 75
http://arxiv.org/abs/2302.12441v2
2023-05-22T20:29:28
2023-02-24T04:03:15
MUX-PLMs: Data Multiplexing for High-throughput Language Models
The widespread adoption of large language models such as ChatGPT and Bard has led to unprecedented demand for these technologies. The burgeoning cost of inference for ever-increasing model sizes coupled with hardware shortages has limited affordable access and poses a pressing need for efficiency approaches geared towards high throughput and performance. Multi-input multi-output (MIMO) algorithms such as data multiplexing, offer a promising solution with a many-fold increase in throughput by performing inference for multiple inputs at the cost of a single input. Yet these approaches are not currently performant enough to be deployed in modern systems. We change that by developing MUX-PLMs, a class of high throughput pre-trained language models (PLMs) trained with data multiplexing, that can be fine-tuned for any downstream task to yield high-throughput high-performance. Our novel multiplexing and demultiplexing modules proficiently entangle and disentangle inputs, and enable high-performance high throughput \muxplms{} that are competitive with vanilla PLMs while achieving 2x/5x inference speedup with only a $1-4\%$ drop on a broad suite of tasks.
[ "Vishvak Murahari", "Ameet Deshpande", "Carlos E. Jimenez", "Izhak Shafran", "Mingqiu Wang", "Yuan Cao", "Karthik Narasimhan" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12441v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12441v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CL" ]
MUX-PLMs: Data Multiplexing for High-throughput Language Models Vishvak Murahari1 Ameet Deshpande1 Carlos E. Jimenez1 Izhak Shafran2 Mingqiu Wang2 Yuan Cao2 Karthik Narasimhan1 1Princeton University 2 Google Brain [email protected] 3 2 0 2 y a M 2 2 ] G L . s c [ 2 v 1 4 4 2 1 . 2 0 3 2 : v i X r a Abstract The widespread adoption of large language models such as ChatGPT and Bard has led to unprecedented demand for these technolo- gies. The burgeoning cost of inference for ever- increasing model sizes coupled with hardware shortages has limited affordable access and poses a pressing need for efficiency approaches geared towards high throughput and perfor- mance. Multi-input multi-output (MIMO) al- gorithms such as data multiplexing, offer a promising solution with a many-fold increase in throughput by performing inference for mul- tiple inputs at the cost of a single input. Yet these approaches are not currently performant enough to be deployed in modern systems. We change that by developing MUX-PLMs, a class of high throughput pre-trained language models (PLMs) trained with data multiplexing, that can be fine-tuned for any downstream task to yield high-throughput high-performance. Our novel multiplexing and demultiplexing modules profi- ciently entangle and disentangle inputs, and en- able high-performance high throughput MUX- PLMs that are competitive with vanilla PLMs while achieving 2x/5x inference speedup with only a 1 − 4% drop on a broad suite of tasks. 1 1 Introduction Language models like ChatGPT (OpenAI, 2023), PaLM (Chowdhery et al., 2022), T5 (Raffel et al., 2020), and CM3 (Aghajanyan et al., 2022), have seen unprecedented adoption in diverse sectors ranging from education and healthcare to manu- facturing and marketing. The proficiency of these tools has led to unprecedented demand for these models, with users facing frequent outages and ca- pacity limits. Additionally, ever-increasing model sizes and hardware shortages have constrained models' ability to handle a very high load of re- quests, thus limiting large-scale affordable access 1Code + Models: https://github.com/ princeton-nlp/datamux-pretraining/. to these models. These trends bring into focus the need for high-throughput, high-performance, ef- ficient, and environmentally responsible models that can be deployed at scale to meet the quickly growing demand. Multi-input Multi-output architectures (MIMO) (Havasi et al., 2021; Ramé et al., 2021; Murahari et al., 2022) are a promising hardware-agnostic and architecture-agnostic paradigm that perform inference for multiple inputs simultaneously at the cost of a single input. This efficiency paradigm is natively geared towards yielding high-throughput models, in addition to being complementary in ap- proach and motivation to current efficiency meth- ods such as pruning, quantization, and distilla- tion. Interestingly, MIMO approaches are partly inspired by the human brain's extraordinary abil- ity to process multiple inputs and propagate in- formation at a high bandwidth with a few neural codes (Blumhagen et al., 2011; Akam and Kull- mann, 2014; Pirschel and Kretzberg, 2016; Hong et al., 2016; Friedrich et al., 2004). Murahari et al. (2022) introduced data multiplex- ing, a MIMO technique that can enable a many-fold increase in throughput. The method compresses N different instances into a single "multiplexed" hidden representation before decompressing it into N independent predictions. While they show the plausibility of MIMO training, their method leads to a significant drop in performance (20 − 30% points) compared to state-of-the-art models. In this work, we introduce MUX-PLMs, a class of high-throughput pre-trained language models trained in a MIMO fashion with data multiplex- ing to process multiple inputs (2-10) simultane- ously with a forward pass over a single instance. MUX-PLMs offer up to 400% improvement in throughput over baseline pre-trained models while only being ∼ 4 points and ∼ 2 points worse than baseline pre-trained language models for text clas- sification and token classification tasks, respec- Figure 1: Illustrating the training process for MUX-PLMs. MUX-PLMs are first primed for MIMO style training with a token-retrieval auto-encoding task, where the model is trained to output the tokens in the N inputs. MUX- PLMs are then pre-trained by adapting standard pre-training objectives (BERT in this example), to MIMO style training with data multiplexing. The resulting MUX-BERT model, similar to standard PLMs, provides a general model initialization that can be fine-tuned on any downstream task (NER in this example). Output predictions are shown above the system head with highlighted predictions contributing to the gradient update; violet indicates a correct prediction while orange indicates an incorrect prediction. Red highlighted tokens in the input indicate a position that has been masked. tively. MUX-PLMs, like other pre-trained lan- guage models, provide general model initializa- tion that can be fine-tuned for any downstream task. We demonstrate the effectiveness and gener- ality of our MUX-PLMs class of pre-trained mod- els by training MUX-BERT and MUX-ELECTRA models, which are trained with pre-trained objec- tives adapted from BERT (Devlin et al., 2019) and ELECTRA (Clark et al., 2020) respectively, al- though in a MIMO fashion with data multiplexing. Our work is the first to introduce MIMO archi- tectures to PLMs. To enable this, we first develop a new demultiplexing module, RSA-demux (Fig- ure 2), that randomly initializes and learns private key vectors to recover the multiple outputs from a multiplexed representation. Secondly, we intro- duce a new Contextual Multiplexer module (Fig- ure 3) that uses a cross-instance attention-based mechanism to aggregate context across the set of multiplexed instances, which seems to be particu- larly effective for token-level tasks. Thirdly, our three-stage training algorithm (Figure 1) enables stable and efficient training of MUX-PLMs. Importantly, MUX-PLMs are complementary to existing state-of-the-art model compression tech- niques. We hope our work validates MIMO archi- tectures as a promising complementary direction to existing efficiency techniques. Consequently, we hope future research develops MIMO architec- tures in tandem with other efficiency approaches, leveraging the best of both paradigms. We pub- licly release our models and code to promote open- source research on the next generation of MIMO architectures for large language models. 2 Related Work Efficient Inference with Transformers Recent methods in NLP rely heavily on transfer learning through Transformer-based (Vaswani et al., 2017) language models trained on large text corpora us- ing self-supervised objectives, such as autoregres- sive (Radford and Narasimhan, 2018) or masked language modeling (Devlin et al., 2019). Prior analysis on pre-training language models has ob- served power-law scaling of model performance with respect to model size (Kaplan et al., 2020), leading the community to develop ever-larger lan- guage models. It is also generally recognized that pre-trained language models are significantly over- parameterized; effectively learning a subnetwork that utilizes only a relatively small number of their total parameters (Voita et al., 2019; Michel et al., 2019; Gordon et al., 2020; Prasanna et al., 2020). The ubiquity of pre-trained language models, their growing size, and over-parameterization has inspired extensive research on improving inference efficiency. This includes methods such as struc- tured pruning (Liu et al., 2019; Wang et al., 2020; Lagunas et al., 2021; Xia et al., 2022; Yang et al., 2022), knowledge distillation (Hinton et al., 2015; <latexit sha1_base64="wV+UNzTFnY3Cv00/ZyAkdo4KVO8=">AAACB3icbVBNS8NAEN3Ur1q/qh4FWSyCp5JIUY9FL16ECqYtNKFsttt26W4SdidiCbl58a948aCIV/+CN/+N27QHbX0wzOO9GXbnBbHgGmz72yosLa+srhXXSxubW9s75d29po4SRZlLIxGpdkA0EzxkLnAQrB0rRmQgWCsYXU381j1TmkfhHYxj5ksyCHmfUwJG6pYPPWAPoGSad4A09bQkQuAbt51lWbdcsat2DrxInBmpoBka3fKX14toIlkIVBCtO44dg58SBZwKlpW8RLOY0BEZsI6hIZFM+2l+R4aPjdLD/UiZCgHn6u+NlEitxzIwk5LAUM97E/E/r5NA/8JPeRgnwEI6faifCAwRnoSCe1wxCmJsCKGKm79iOiSKUDDRlUwIzvzJi6R5WnXOqrXbWqV+OYujiA7QETpBDjpHdXSNGshFFD2iZ/SK3qwn68V6tz6mowVrtrOP/sD6/AGKIZpg</latexit>MUX<latexit sha1_base64="vzyM3NMeoxh+bJrCVyV/KiL7LXU=">AAACCXicbVDLSsNAFJ3UV62vqEs3g0VwVRIRdVl8gBuhgmkLbSmT6bQdOpOEmRuxhGzd+CtuXCji1j9w5984TbPQ1gOXezjnXmbu8SPBNTjOt1VYWFxaXimultbWNza37O2dug5jRZlHQxGqpk80EzxgHnAQrBkpRqQvWMMfXUz8xj1TmofBHYwj1pFkEPA+pwSM1LVxG9gDKJlkHSBJ2loSIfDl1Y3XTNO0a5edipMBzxM3J2WUo9a1v9q9kMaSBUAF0brlOhF0EqKAU8HSUjvWLCJ0RAasZWhAJNOdJLskxQdG6eF+qEwFgDP190ZCpNZj6ZtJSWCoZ72J+J/XiqF/1kl4EMXAAjp9qB8LDCGexIJ7XDEKYmwIoYqbv2I6JIpQMOGVTAju7MnzpH5UcU8qx7fH5ep5HkcR7aF9dIhcdIqq6BrVkIcoekTP6BW9WU/Wi/VufUxHC1a+s4v+wPr8Abvomv0=</latexit>DEMUX<latexit sha1_base64="UuqbFuRBLDbq3pSCx6RaGxOMbdw=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRbBU0lE1GPRi8cK/YI2lM120i7dbMLuRFpC/4oXD4p49Y9489+4bXPQ1gcDj/dmmJkXJIJrdN1vq7CxubW9U9wt7e0fHB7Zx+WWjlPFoMliEatOQDUILqGJHAV0EgU0CgS0g/H93G8/gdI8lg2cJuBHdCh5yBlFI/Xtcg9hgllDUanDWEWgZn274lbdBZx14uWkQnLU+/ZXbxCzNAKJTFCtu56boJ9RhZwJmJV6qYaEsjEdQtdQSSPQfra4feacG2XgmNWmJDoL9fdERiOtp1FgOiOKI73qzcX/vG6K4a2fcZmkCJItF4WpcDB25kE4A66AoZgaQpni5laHjaiiDE1cJROCt/ryOmldVr3r6tXjVaV2l8dRJKfkjFwQj9yQGnkgddIkjEzIM3klb9bMerHerY9la8HKZ07IH1ifPwGFlRQ=</latexit>Transformer<latexit sha1_base64="EwTfb49fSogakLCEst/4/mLa9wY=">AAACFHicbVDLSgMxFM3UV62vqks3wSIIQpmRoi6LbtwIFewDOrVk0kwbmswMyR1pGeYj3Pgrblwo4taFO//GTNuFth4IOZxzL8k5XiS4Btv+tnJLyyura/n1wsbm1vZOcXevocNYUVanoQhVyyOaCR6wOnAQrBUpRqQnWNMbXmV+84EpzcPgDsYR60jSD7jPKQEjdYsnriQw8PxklN4nLrARKDm9AZLE1ZIIgW/qrdSgWyzZZXsCvEicGSmhGWrd4pfbC2ksWQBUEK3bjh1BJyEKOBUsLbixZhGhQ9JnbUMDIpnuJJNQKT4ySg/7oTInADxRf28kRGo9lp6ZzCLoeS8T//PaMfgXnYQHUQwsoNOH/FhgCHHWEO5xxSiIsSGEKm7+iumAKELB9FgwJTjzkRdJ47TsnJUrt5VS9XJWRx4doEN0jBx0jqroGtVQHVH0iJ7RK3qznqwX6936mI7mrNnOPvoD6/MHqSGgdg==</latexit>xMUX<latexit sha1_base64="GxWUhvB93OAyNMZeloOoQrq5bFM=">AAACFHicbVDLSgMxFM34rPU16tJNsAiCUGakqMuiGzdCBactdMaSSTNtaDIzJHfEMvQj3Pgrblwo4taFO//G9LHQ1gMhh3PuJTknTAXX4Djf1sLi0vLKamGtuL6xubVt7+zWdZIpyjyaiEQ1Q6KZ4DHzgINgzVQxIkPBGmH/cuQ37pnSPIlvYZCyQJJuzCNOCRipbR/7kkAvjPLe8C73gT2AkpMbIM99LYkQ+NprDg3adskpO2PgeeJOSQlNUWvbX34noZlkMVBBtG65TgpBThRwKtiw6GeapYT2SZe1DI2JZDrIx6GG+NAoHRwlypwY8Fj9vZETqfVAhmZyFEHPeiPxP6+VQXQe5DxOM2AxnTwUZQJDgkcN4Q5XjIIYGEKo4uavmPaIIhRMj0VTgjsbeZ7UT8ruablyUylVL6Z1FNA+OkBHyEVnqIquUA15iKJH9Ixe0Zv1ZL1Y79bHZHTBmu7soT+wPn8AjsGgZg==</latexit>hMUXthechefatethemealMASKchefMASKthemeal<latexit sha1_base64="oLWedUKi3DSeLcbGgAPrLPdx07g=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRahp5JIUY8FLx4r2A9oQ9lsJ+3SzSbsTqQl9K948aCIV/+IN/+N2zYHbX0w8Hhvhpl5QSK4Rtf9tgpb2zu7e8X90sHh0fGJfVpu6zhVDFosFrHqBlSD4BJayFFAN1FAo0BAJ5jcLfzOEyjNY/mIswT8iI4kDzmjaKSBXe4jTDFrKkBFueRyNB/YFbfmLuFsEi8nFZKjObC/+sOYpRFIZIJq3fPcBP2MKuRMwLzUTzUklE3oCHqGShqB9rPl7XPn0ihDJ4yVKYnOUv09kdFI61kUmM6I4livewvxP6+XYnjrZ1wmKYJkq0VhKhyMnUUQzpArYChmhlCmuLnVYWOqKEMTV8mE4K2/vEnaVzXvulZ/qFca1TyOIjknF6RKPHJDGuSeNEmLMDIlz+SVvFlz68V6tz5WrQUrnzkjf2B9/gDhNJTq</latexit>Pretraining<latexit sha1_base64="YMsxORc1qROyZt/Sshecb25Lu40=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHYJUY9ELx4hkUcCGzI79MLI7OxmZtaEEL7AiweN8eonefNvHGAPClbSSaWqO91dQSK4Nq777eQ2Nre2d/K7hb39g8Oj4vFJS8epYthksYhVJ6AaBZfYNNwI7CQKaRQIbAfju7nffkKleSwfzCRBP6JDyUPOqLFSo9IvltyyuwBZJ15GSpCh3i9+9QYxSyOUhgmqdddzE+NPqTKcCZwVeqnGhLIxHWLXUkkj1P50ceiMXFhlQMJY2ZKGLNTfE1MaaT2JAtsZUTPSq95c/M/rpia88adcJqlByZaLwlQQE5P512TAFTIjJpZQpri9lbARVZQZm03BhuCtvrxOWpWyd1WuNqql2m0WRx7O4BwuwYNrqME91KEJDBCe4RXenEfnxXl3PpatOSebOYU/cD5/AH8PjL8=</latexit>2thechefcooksthemealthechefwalkthemeal<latexit sha1_base64="wV+UNzTFnY3Cv00/ZyAkdo4KVO8=">AAACB3icbVBNS8NAEN3Ur1q/qh4FWSyCp5JIUY9FL16ECqYtNKFsttt26W4SdidiCbl58a948aCIV/+CN/+N27QHbX0wzOO9GXbnBbHgGmz72yosLa+srhXXSxubW9s75d29po4SRZlLIxGpdkA0EzxkLnAQrB0rRmQgWCsYXU381j1TmkfhHYxj5ksyCHmfUwJG6pYPPWAPoGSad4A09bQkQuAbt51lWbdcsat2DrxInBmpoBka3fKX14toIlkIVBCtO44dg58SBZwKlpW8RLOY0BEZsI6hIZFM+2l+R4aPjdLD/UiZCgHn6u+NlEitxzIwk5LAUM97E/E/r5NA/8JPeRgnwEI6faifCAwRnoSCe1wxCmJsCKGKm79iOiSKUDDRlUwIzvzJi6R5WnXOqrXbWqV+OYujiA7QETpBDjpHdXSNGshFFD2iZ/SK3qwn68V6tz6mowVrtrOP/sD6/AGKIZpg</latexit>MUX<latexit sha1_base64="vzyM3NMeoxh+bJrCVyV/KiL7LXU=">AAACCXicbVDLSsNAFJ3UV62vqEs3g0VwVRIRdVl8gBuhgmkLbSmT6bQdOpOEmRuxhGzd+CtuXCji1j9w5984TbPQ1gOXezjnXmbu8SPBNTjOt1VYWFxaXimultbWNza37O2dug5jRZlHQxGqpk80EzxgHnAQrBkpRqQvWMMfXUz8xj1TmofBHYwj1pFkEPA+pwSM1LVxG9gDKJlkHSBJ2loSIfDl1Y3XTNO0a5edipMBzxM3J2WUo9a1v9q9kMaSBUAF0brlOhF0EqKAU8HSUjvWLCJ0RAasZWhAJNOdJLskxQdG6eF+qEwFgDP190ZCpNZj6ZtJSWCoZ72J+J/XiqF/1kl4EMXAAjp9qB8LDCGexIJ7XDEKYmwIoYqbv2I6JIpQMOGVTAju7MnzpH5UcU8qx7fH5ep5HkcR7aF9dIhcdIqq6BrVkIcoekTP6BW9WU/Wi/VufUxHC1a+s4v+wPr8Abvomv0=</latexit>DEMUX<latexit sha1_base64="UuqbFuRBLDbq3pSCx6RaGxOMbdw=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRbBU0lE1GPRi8cK/YI2lM120i7dbMLuRFpC/4oXD4p49Y9489+4bXPQ1gcDj/dmmJkXJIJrdN1vq7CxubW9U9wt7e0fHB7Zx+WWjlPFoMliEatOQDUILqGJHAV0EgU0CgS0g/H93G8/gdI8lg2cJuBHdCh5yBlFI/Xtcg9hgllDUanDWEWgZn274lbdBZx14uWkQnLU+/ZXbxCzNAKJTFCtu56boJ9RhZwJmJV6qYaEsjEdQtdQSSPQfra4feacG2XgmNWmJDoL9fdERiOtp1FgOiOKI73qzcX/vG6K4a2fcZmkCJItF4WpcDB25kE4A66AoZgaQpni5laHjaiiDE1cJROCt/ryOmldVr3r6tXjVaV2l8dRJKfkjFwQj9yQGnkgddIkjEzIM3klb9bMerHerY9la8HKZ07IH1ifPwGFlRQ=</latexit>Transformer<latexit sha1_base64="EwTfb49fSogakLCEst/4/mLa9wY=">AAACFHicbVDLSgMxFM3UV62vqks3wSIIQpmRoi6LbtwIFewDOrVk0kwbmswMyR1pGeYj3Pgrblwo4taFO//GTNuFth4IOZxzL8k5XiS4Btv+tnJLyyura/n1wsbm1vZOcXevocNYUVanoQhVyyOaCR6wOnAQrBUpRqQnWNMbXmV+84EpzcPgDsYR60jSD7jPKQEjdYsnriQw8PxklN4nLrARKDm9AZLE1ZIIgW/qrdSgWyzZZXsCvEicGSmhGWrd4pfbC2ksWQBUEK3bjh1BJyEKOBUsLbixZhGhQ9JnbUMDIpnuJJNQKT4ySg/7oTInADxRf28kRGo9lp6ZzCLoeS8T//PaMfgXnYQHUQwsoNOH/FhgCHHWEO5xxSiIsSGEKm7+iumAKELB9FgwJTjzkRdJ47TsnJUrt5VS9XJWRx4doEN0jBx0jqroGtVQHVH0iJ7RK3qznqwX6936mI7mrNnOPvoD6/MHqSGgdg==</latexit>xMUX<latexit sha1_base64="GxWUhvB93OAyNMZeloOoQrq5bFM=">AAACFHicbVDLSgMxFM34rPU16tJNsAiCUGakqMuiGzdCBactdMaSSTNtaDIzJHfEMvQj3Pgrblwo4taFO//G9LHQ1gMhh3PuJTknTAXX4Djf1sLi0vLKamGtuL6xubVt7+zWdZIpyjyaiEQ1Q6KZ4DHzgINgzVQxIkPBGmH/cuQ37pnSPIlvYZCyQJJuzCNOCRipbR/7kkAvjPLe8C73gT2AkpMbIM99LYkQ+NprDg3adskpO2PgeeJOSQlNUWvbX34noZlkMVBBtG65TgpBThRwKtiw6GeapYT2SZe1DI2JZDrIx6GG+NAoHRwlypwY8Fj9vZETqfVAhmZyFEHPeiPxP6+VQXQe5DxOM2AxnTwUZQJDgkcN4Q5XjIIYGEKo4uavmPaIIhRMj0VTgjsbeZ7UT8ruablyUylVL6Z1FNA+OkBHyEVnqIquUA15iKJH9Ixe0Zv1ZL1Y79bHZHTBmu7soT+wPn8AjsGgZg==</latexit>hMUX<latexit sha1_base64="82iJvDRh4RJsfWvspHMJy3OpPwY=">AAAB/3icbVDLSgNBEJyNrxhfUcGLl8Eg5BR2JajHgBePUfKCJITZSScZMju7zPQGw5qDv+LFgyJe/Q1v/o2Tx0ETCxqKqm66u/xICoOu++2k1tY3NrfS25md3b39g+zhUc2EseZQ5aEMdcNnBqRQUEWBEhqRBhb4Eur+8Gbq10egjQhVBccRtAPWV6InOEMrdbInLYQHTCrhEBS9B9QCRkxOOtmcW3BnoKvEW5AcWaDcyX61uiGPA1DIJTOm6bkRthOmUXAJk0wrNhAxPmR9aFqqWACmnczun9Bzq3RpL9S2FNKZ+nsiYYEx48C3nQHDgVn2puJ/XjPG3nU7ESqKERSfL+rFkmJIp2HQrtDAUY4tYVwLeyvlA6YZRxtZxobgLb+8SmoXBe+yULwr5kr5RRxpckrOSJ545IqUyC0pkyrh5JE8k1fy5jw5L8678zFvTTmLmWPyB87nD4ofll4=</latexit>TokenRetrieval<latexit sha1_base64="DSs/otLGM3tGcbw7Y+b2owP1uy4=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0mkqMeiF48t2FpoQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm//GbZuDtj4YeLw3w8y8IBFcG9f9dgpr6xubW8Xt0s7u3v5B+fCoreNUMWyxWMSqE1CNgktsGW4EdhKFNAoEPgTj25n/8IRK81jem0mCfkSHkoecUWOlptcvV9yqOwdZJV5OKpCj0S9/9QYxSyOUhgmqdddzE+NnVBnOBE5LvVRjQtmYDrFrqaQRaj+bHzolZ1YZkDBWtqQhc/X3REYjrSdRYDsjakZ62ZuJ/3nd1ITXfsZlkhqUbLEoTAUxMZl9TQZcITNiYgllittbCRtRRZmx2ZRsCN7yy6ukfVH1Lqu1Zq1Sv8njKMIJnMI5eHAFdbiDBrSAAcIzvMKb8+i8OO/Ox6K14OQzx/AHzucPfYuMvg==</latexit>1<latexit sha1_base64="wV+UNzTFnY3Cv00/ZyAkdo4KVO8=">AAACB3icbVBNS8NAEN3Ur1q/qh4FWSyCp5JIUY9FL16ECqYtNKFsttt26W4SdidiCbl58a948aCIV/+CN/+N27QHbX0wzOO9GXbnBbHgGmz72yosLa+srhXXSxubW9s75d29po4SRZlLIxGpdkA0EzxkLnAQrB0rRmQgWCsYXU381j1TmkfhHYxj5ksyCHmfUwJG6pYPPWAPoGSad4A09bQkQuAbt51lWbdcsat2DrxInBmpoBka3fKX14toIlkIVBCtO44dg58SBZwKlpW8RLOY0BEZsI6hIZFM+2l+R4aPjdLD/UiZCgHn6u+NlEitxzIwk5LAUM97E/E/r5NA/8JPeRgnwEI6faifCAwRnoSCe1wxCmJsCKGKm79iOiSKUDDRlUwIzvzJi6R5WnXOqrXbWqV+OYujiA7QETpBDjpHdXSNGshFFD2iZ/SK3qwn68V6tz6mowVrtrOP/sD6/AGKIZpg</latexit>MUX<latexit sha1_base64="vzyM3NMeoxh+bJrCVyV/KiL7LXU=">AAACCXicbVDLSsNAFJ3UV62vqEs3g0VwVRIRdVl8gBuhgmkLbSmT6bQdOpOEmRuxhGzd+CtuXCji1j9w5984TbPQ1gOXezjnXmbu8SPBNTjOt1VYWFxaXimultbWNza37O2dug5jRZlHQxGqpk80EzxgHnAQrBkpRqQvWMMfXUz8xj1TmofBHYwj1pFkEPA+pwSM1LVxG9gDKJlkHSBJ2loSIfDl1Y3XTNO0a5edipMBzxM3J2WUo9a1v9q9kMaSBUAF0brlOhF0EqKAU8HSUjvWLCJ0RAasZWhAJNOdJLskxQdG6eF+qEwFgDP190ZCpNZj6ZtJSWCoZ72J+J/XiqF/1kl4EMXAAjp9qB8LDCGexIJ7XDEKYmwIoYqbv2I6JIpQMOGVTAju7MnzpH5UcU8qx7fH5ep5HkcR7aF9dIhcdIqq6BrVkIcoekTP6BW9WU/Wi/VufUxHC1a+s4v+wPr8Abvomv0=</latexit>DEMUX<latexit sha1_base64="UuqbFuRBLDbq3pSCx6RaGxOMbdw=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRbBU0lE1GPRi8cK/YI2lM120i7dbMLuRFpC/4oXD4p49Y9489+4bXPQ1gcDj/dmmJkXJIJrdN1vq7CxubW9U9wt7e0fHB7Zx+WWjlPFoMliEatOQDUILqGJHAV0EgU0CgS0g/H93G8/gdI8lg2cJuBHdCh5yBlFI/Xtcg9hgllDUanDWEWgZn274lbdBZx14uWkQnLU+/ZXbxCzNAKJTFCtu56boJ9RhZwJmJV6qYaEsjEdQtdQSSPQfra4feacG2XgmNWmJDoL9fdERiOtp1FgOiOKI73qzcX/vG6K4a2fcZmkCJItF4WpcDB25kE4A66AoZgaQpni5laHjaiiDE1cJROCt/ryOmldVr3r6tXjVaV2l8dRJKfkjFwQj9yQGnkgddIkjEzIM3klb9bMerHerY9la8HKZ07IH1ifPwGFlRQ=</latexit>Transformer<latexit sha1_base64="EwTfb49fSogakLCEst/4/mLa9wY=">AAACFHicbVDLSgMxFM3UV62vqks3wSIIQpmRoi6LbtwIFewDOrVk0kwbmswMyR1pGeYj3Pgrblwo4taFO//GTNuFth4IOZxzL8k5XiS4Btv+tnJLyyura/n1wsbm1vZOcXevocNYUVanoQhVyyOaCR6wOnAQrBUpRqQnWNMbXmV+84EpzcPgDsYR60jSD7jPKQEjdYsnriQw8PxklN4nLrARKDm9AZLE1ZIIgW/qrdSgWyzZZXsCvEicGSmhGWrd4pfbC2ksWQBUEK3bjh1BJyEKOBUsLbixZhGhQ9JnbUMDIpnuJJNQKT4ySg/7oTInADxRf28kRGo9lp6ZzCLoeS8T//PaMfgXnYQHUQwsoNOH/FhgCHHWEO5xxSiIsSGEKm7+iumAKELB9FgwJTjzkRdJ47TsnJUrt5VS9XJWRx4doEN0jBx0jqroGtVQHVH0iJ7RK3qznqwX6936mI7mrNnOPvoD6/MHqSGgdg==</latexit>xMUX<latexit sha1_base64="GxWUhvB93OAyNMZeloOoQrq5bFM=">AAACFHicbVDLSgMxFM34rPU16tJNsAiCUGakqMuiGzdCBactdMaSSTNtaDIzJHfEMvQj3Pgrblwo4taFO//G9LHQ1gMhh3PuJTknTAXX4Djf1sLi0vLKamGtuL6xubVt7+zWdZIpyjyaiEQ1Q6KZ4DHzgINgzVQxIkPBGmH/cuQ37pnSPIlvYZCyQJJuzCNOCRipbR/7kkAvjPLe8C73gT2AkpMbIM99LYkQ+NprDg3adskpO2PgeeJOSQlNUWvbX34noZlkMVBBtG65TgpBThRwKtiw6GeapYT2SZe1DI2JZDrIx6GG+NAoHRwlypwY8Fj9vZETqfVAhmZyFEHPeiPxP6+VQXQe5DxOM2AxnTwUZQJDgkcN4Q5XjIIYGEKo4uavmPaIIhRMj0VTgjsbeZ7UT8ruablyUylVL6Z1FNA+OkBHyEVnqIquUA15iKJH9Ixe0Zv1ZL1Y79bHZHTBmu7soT+wPn8AjsGgZg==</latexit>hMUXB-LOCOOB-MISCOBeninwonthefirstleg<latexit sha1_base64="PvkqMPf0KQ2ZiRgX4QPbidqMLN8=">AAAB6HicbVDLTgJBEOzFF+IL9ehlIjHxRHaVqEeiF4+QyCOBDZkdemFkdnYzM2tCCF/gxYPGePWTvPk3DrAHBSvppFLVne6uIBFcG9f9dnJr6xubW/ntws7u3v5B8fCoqeNUMWywWMSqHVCNgktsGG4EthOFNAoEtoLR3cxvPaHSPJYPZpygH9GB5CFn1FipftkrltyyOwdZJV5GSpCh1it+dfsxSyOUhgmqdcdzE+NPqDKcCZwWuqnGhLIRHWDHUkkj1P5kfuiUnFmlT8JY2ZKGzNXfExMaaT2OAtsZUTPUy95M/M/rpCa88SdcJqlByRaLwlQQE5PZ16TPFTIjxpZQpri9lbAhVZQZm03BhuAtv7xKmhdl76pcqVdK1dssjjycwCmcgwfXUIV7qEEDGCA8wyu8OY/Oi/PufCxac042cwx/4Hz+AICTjMA=</latexit>3Finetuning(NER) Sanh et al., 2019; Sun et al., 2020; Jiao et al., 2020; Yin et al., 2021), quantization (Zafrir et al., 2019; Shen et al., 2020), and data multiplexing (Mura- hari et al., 2022). These approaches assume that PLMs are highly over-parametrized and attempt to approximate a large function by learning a smaller, compressed, version of the original model. Past work has also focused on unstructured pruning for both task finetuning (Chen et al., 2020; Sanh et al., 2020) and pre-trained (Zafrir et al., 2021; Jiang et al., 2022) language model settings, but don't increase model throughput due to hardware limits. Multi-input Multi-output Models While prun- ing, quantization, and distillation seek to reduce overparameterization by reducing models' repre- sentational capacity, other lines of work seek to exploit overparameterization in other ways. Multi- input Multi-output (MIMO) architectures (Havasi et al., 2021; Ramé et al., 2021; Murahari et al., 2022) train models using mixed-instance represen- tations, i.e. Zhang et al. (2018), in order to obtain predictions for multiple instances simultaneously. Unlike efficiency methods, Havasi et al. (2021) and Ramé et al. (2021) try to obtain better performance by inducing multiple subnetworks in a single con- volutional model to perform "ensembling for free" during inference. Data multiplexing, introduced in DataMUX (Murahari et al., 2022), aims to improve model efficiency by training Transformer models with mixed-instance representations to perform si- multaneous inference for language tasks, thereby improving inference throughput many-fold. Cur- rently, MIMO architectures have only been used in a limited setting, achieving middling performance. Our work training PLMs with data multiplexing, dramatically improves inference throughput while preserving high accuracy for downstream tasks. 3 Methodology We briefly introduce readers to the data multiplex- ing MIMO architecture (Murahari et al., 2022), which we denote T-MUX. We then detail our novel approach to train MUX-PLMs to yield high- throughput and performant language models. 3.1 T-MUX: Data multiplexing with Transformer Data multiplexing allows parallel processing of multiple sequences with a single forward or back- ward pass through the model (M ) and requires two crucial components, multiplexer, and demulti- plexer. Multiplexer The multiplexer module (MUX) combines an ordered set of multiple inputs – X 1:N = (cid:0)x1, . . . , xN (cid:1) into a single superimposed representation (xMUX). If xi ∈ Rd, the multiplexer is a transformation (MUX : RN ×d → Rd) such that xMUX = MUX (cid:0)X 1:N (cid:1). To ensure MUX is an order-preserving transformation,T-MUX samples a vector (vi ∈ Rd) from a standard multivariate Gaussian and applies the Hadamard product (element-wise multiplica- tion) with the corresponding input representation (xi) before summing up vectors for all positions. xMUX = MUX (cid:0)X 1:N (cid:1) = vi ∈ Rd ∼ N (0, I) 1 N N (cid:88) i=1 xi ⊙ vi (1) The model processes the multiplexed representa- tion and emits a multiplexed hidden state – hMUX = M (cid:0)xMUX(cid:1). To multiplex Transformers' sequenced inputs (cid:0)xi = (cid:0)xi (cid:1)(cid:1) of length L, T-MUX 1, . . . , xi L applies the same vi to all L positions of instance i. xMUX = MUX (cid:0)X 1:N (cid:1) = (cid:32) 1 N N (cid:88) i=1 1 ⊙ vi, . . . , xi (cid:33) L ⊙ vi xi 1 N N (cid:88) i=1 (2) Demultiplexer A prediction needs to be made for each instance in X 1:N , and T-MUX's demul- tiplexer module (DeMUX) achieves this by sep- arating the superimposed output (hMUX) into N output representations corresponding to the input (h1, . . . , hN ). hi = DeMUX (cid:0)hMUX, pi(cid:1) j = DeMUX (cid:0)hMUX j, pi(cid:1) hi (3) The vector pi ∈ Rd is dynamically generated for each instance (i) with the help of a prefix that is added to the input and re-used for all positions in the instance. They add a prefixi to xi, represented by the following pattern, where εi is a special token, and pi is set to be the output corresponding to token Figure 2: Illustrating our novel RSA-inspired demultiplexing module. The module is initialized with N key vectors which are used to demultiplex the transformed multiplexed representations (hM U X ). The keys are concatenated with hM U X and are processed with an MLP to generate the demultiplexed output representations (h1 * * * h4). and the generality of this class of models, we pre- train Transformer models with objectives based on BERT and ELECTRA, to get MUX-BERT and MUX-ELECTRA respectively. MUX-PLMs are trained with our three stage training algorithm (Fig- ure 1). Firstly, MUX-PLMs are trained with the token retrieval task in T-MUX, which is an auto- encoding setup to decode all the tokens in the mul- tiplexed input. This simple auto-encoding task is critical to prime the model for MIMO-style data multiplexing. The MUX-PLMs are then pre-trained with standard pre-training objectives but adapted to MIMO-fashioned training with data multiplex- ing. MUX-PLMs show significant throughput im- provement over standard pre-trained LMs while matching their downstream task accuracies. Fi- nally, MUX-PLMs, like other pre-trained language models, provide general model initialization that can be fine-tuned for any downstream task. Contextual multiplexer T-MUX's multiplexer multiplexes tokens independent of 1) tokens in the same position in other instances and 2) other to- kens in the instance, which could lead to subop- timal representations. We, therefore, explore a contextual multiplexing scheme that aggregates context both from tokens in the same instance and tokens in the same position of other instances (Figure 3). We first use a single transformer layer TRANSctx to get contextual representations (cid:1)) of length L. We 1, . . . , xi hi L apply a hadamard product with a multivariate gaus- sian vi to all L positions. ctx = hi gi (4) We generate multiplexed representations, xMUX, by applying another transformer layer TRANSinst across encoded representations from N instances ctx = TRANSctx ctx ⊙ vi (cid:0)xi Figure 3: Illustrating our attention-based multiplexing module. The module generates contextual representa- tions for instances x1 * * * x4 with a Transformer layer and then applies a hadamard product between the con- textual representations and the corresponding multivari- ate gaussian to generate instance-conditioned represen- tations. The final multiplexed representations are gener- ated by first applying another Transformer layer, which attends across the instances for all the positions in the sequence, and then averaging across the instances. i in the prefix. prefix1 = [ε1, εpad, . . . , εpad] prefix2 = [εpad, ε2, εpad, . . . , εpad] * * * prefixN = [εpad, . . . , εpad, εN ] 3.2 MUX-PLMs: Data multiplexing for high-throughput language models We propose MUX-PLMs, a class of high- throughput pre-trained Transformer-based lan- guage models trained in a MIMO fashion with data multiplexing. To demonstrate the viability <latexit sha1_base64="8/mZexLsMZmF+cd8DoFjIoRZMiE=">AAAB83icbVDLSgMxFL1TX7W+qm4EN8EiuCozUtRlwY3LCvYBnbFk0kwbmsmEJCOUob/hxoUibv0Zd/6NmXYW2nogcDjnXu7JCSVn2rjut1NaW9/Y3CpvV3Z29/YPqodHHZ2kitA2SXiieiHWlDNB24YZTntSURyHnHbDyW3ud5+o0iwRD2YqaRDjkWARI9hYyfdjbMZhlI1nj96gWnPr7hxolXgFqUGB1qD65Q8TksZUGMKx1n3PlSbIsDKMcDqr+KmmEpMJHtG+pQLHVAfZPPMMnVtliKJE2ScMmqu/NzIcaz2NQzuZZ9TLXi7+5/VTE90EGRMyNVSQxaEo5cgkKC8ADZmixPCpJZgoZrMiMsYKE2NrqtgSvOUvr5LOZd27qjfuG7XmSVFHGU7hDC7Ag2towh20oA0EJDzDK7w5qfPivDsfi9GSU+wcwx84nz8Gt5GO</latexit>h1<latexit sha1_base64="sR87z0EnzyCzWXKSbPlPwjoMRRI=">AAAB83icbVBNSwMxFHxbv2r9qnoRvASL4KnslqIeC148VrC10F1LNs22oUl2SbJCWfo3vHhQxKt/xpv/xmy7B20dCAwz7/EmEyacaeO6305pbX1jc6u8XdnZ3ds/qB4edXWcKkI7JOax6oVYU84k7RhmOO0limIRcvoQTm5y/+GJKs1ieW+mCQ0EHkkWMYKNlXxfYDMOo2w8e2wMqjW37s6BVolXkBoUaA+qX/4wJqmg0hCOte57bmKCDCvDCKezip9qmmAywSPat1RiQXWQzTPP0LlVhiiKlX3SoLn6eyPDQuupCO1knlEve7n4n9dPTXQdZEwmqaGSLA5FKUcmRnkBaMgUJYZPLcFEMZsVkTFWmBhbU8WW4C1/eZV0G3Xvst68a9ZaJ0UdZTiFM7gAD66gBbfQhg4QSOAZXuHNSZ0X5935WIyWnGLnGP7A+fwBCDuRjw==</latexit>h2<latexit sha1_base64="PuUaimZdG0KCoWA5fPt1PyXKLaQ=">AAAB83icbVDLSgMxFL3js9ZX1Y3gJlgEV2VGi7osuHFZwT6gM5ZMmmlDM5mQZIQy9DfcuFDErT/jzr8x085CWw8EDufcyz05oeRMG9f9dlZW19Y3Nktb5e2d3b39ysFhWyepIrRFEp6obog15UzQlmGG065UFMchp51wfJv7nSeqNEvEg5lIGsR4KFjECDZW8v0Ym1EYZaPp42W/UnVr7gxomXgFqUKBZr/y5Q8SksZUGMKx1j3PlSbIsDKMcDot+6mmEpMxHtKepQLHVAfZLPMUnVllgKJE2ScMmqm/NzIcaz2JQzuZZ9SLXi7+5/VSE90EGRMyNVSQ+aEo5cgkKC8ADZiixPCJJZgoZrMiMsIKE2NrKtsSvMUvL5P2Rc27qtXv69XGcVFHCU7gFM7Bg2towB00oQUEJDzDK7w5qfPivDsf89EVp9g5gj9wPn8ACb+RkA==</latexit>h3<latexit sha1_base64="gU6Y49A8Evooq3DfmtsTUEGKTcc=">AAAB83icbVDLSgMxFL2pr1pfVTeCm2ARXJUZKeqy4MZlBfuAzlgyaaYNzWSGJCOUob/hxoUibv0Zd/6NmXYW2nogcDjnXu7JCRLBtXGcb1RaW9/Y3CpvV3Z29/YPqodHHR2nirI2jUWsegHRTHDJ2oYbwXqJYiQKBOsGk9vc7z4xpXksH8w0YX5ERpKHnBJjJc+LiBkHYTaePTYG1ZpTd+bAq8QtSA0KtAbVL28Y0zRi0lBBtO67TmL8jCjDqWCzipdqlhA6ISPWt1SSiGk/m2ee4XOrDHEYK/ukwXP190ZGIq2nUWAn84x62cvF/7x+asIbP+MySQ2TdHEoTAU2Mc4LwEOuGDViagmhitusmI6JItTYmiq2BHf5y6ukc1l3r+qN+0ateVLUUYZTOIMLcOEamnAHLWgDhQSe4RXeUIpe0Dv6WIyWULFzDH+APn8AC0ORkQ==</latexit>h4<latexit sha1_base64="jpTjQ68RnuomyCwnnw2wsyL+DLA=">AAAB+XicbVDLSgNBEJyNrxhfq14EL4NB8BR2JajHgBdPEsE8ILuE2UknGTL7YKY3GJb8iRcPinj1T7z5N06SPWhiQUNR1U13V5BIodFxvq3C2vrG5lZxu7Szu7d/YB8eNXWcKg4NHstYtQOmQYoIGihQQjtRwMJAQisY3c781hiUFnH0iJME/JANItEXnKGRurZ971EP4QkzHicC9LRrl52KMwddJW5OyiRHvWt/eb2YpyFEyCXTuuM6CfoZUyi4hGnJSzUkjI/YADqGRiwE7Wfzy6f03Cg92o+VqQjpXP09kbFQ60kYmM6Q4VAvezPxP6+TYv/Gz0SUpAgRXyzqp5JiTGcx0J5QwFFODGFcCXMr5UOmGEcTVsmE4C6/vEqalxX3qlJ9qJZrJ3kcRXJKzsgFcck1qZE7UicNwsmYPJNX8mZl1ov1bn0sWgtWPnNM/sD6/AGoVZOQ</latexit>Ncopies<latexit sha1_base64="n7wVP41N0un63hCbP+3IRg563bU=">AAAB9XicbVDJSgNBEO1xjXGLehG8NAbBU5iRoB4DXjxJBLNAZgw9nZqkSc9Cd406DPkPLx4U8eq/ePNv7CwHTXxQ8Hiviqp6fiKFRtv+tpaWV1bX1gsbxc2t7Z3d0t5+U8ep4tDgsYxV22capIiggQIltBMFLPQltPzh1dhvPYDSIo7uMEvAC1k/EoHgDI10f+NSF+EJ8yFketQtle2KPQFdJM6MlMkM9W7py+3FPA0hQi6Z1h3HTtDLmULBJYyKbqohYXzI+tAxNGIhaC+fXD2iJ0bp0SBWpiKkE/X3RM5CrbPQN50hw4Ge98bif14nxeDSy0WUpAgRny4KUkkxpuMIaE8o4CgzQxhXwtxK+YApxtEEVTQhOPMvL5LmWcU5r1Rvq+Xa4SyOAjkix+SUOOSC1Mg1qZMG4USRZ/JK3qxH68V6tz6mrUvWbOaA/IH1+QOtiJKE</latexit>Nkeys<latexit sha1_base64="sHjTX1Z4jRBAa/fsMzsifaDPyvo=">AAAB8XicbVDLSgNBEJyNrxhfUY9eBoPgKeyKqMegFw8KEcwDkyXMTjrJkNnZZaZXDEv+wosHRbz6N978GyfJHjSxoKGo6qa7K4ilMOi6305uaXlldS2/XtjY3NreKe7u1U2UaA41HslINwNmQAoFNRQooRlrYGEgoREMryZ+4xG0EZG6x1EMfsj6SvQEZ2ilhzbCE6a3N9Vxp1hyy+4UdJF4GSmRDNVO8avdjXgSgkIumTEtz43RT5lGwSWMC+3EQMz4kPWhZaliIRg/nV48pkdW6dJepG0ppFP190TKQmNGYWA7Q4YDM+9NxP+8VoK9Cz8VKk4QFJ8t6iWSYkQn79Ou0MBRjixhXAt7K+UDphlHG1LBhuDNv7xI6idl76x8endaqlxmceTJATkkx8Qj56RCrkmV1AgnijyTV/LmGOfFeXc+Zq05J5vZJ3/gfP4ApXKQ6Q==</latexit>MLP<latexit sha1_base64="GxWUhvB93OAyNMZeloOoQrq5bFM=">AAACFHicbVDLSgMxFM34rPU16tJNsAiCUGakqMuiGzdCBactdMaSSTNtaDIzJHfEMvQj3Pgrblwo4taFO//G9LHQ1gMhh3PuJTknTAXX4Djf1sLi0vLKamGtuL6xubVt7+zWdZIpyjyaiEQ1Q6KZ4DHzgINgzVQxIkPBGmH/cuQ37pnSPIlvYZCyQJJuzCNOCRipbR/7kkAvjPLe8C73gT2AkpMbIM99LYkQ+NprDg3adskpO2PgeeJOSQlNUWvbX34noZlkMVBBtG65TgpBThRwKtiw6GeapYT2SZe1DI2JZDrIx6GG+NAoHRwlypwY8Fj9vZETqfVAhmZyFEHPeiPxP6+VQXQe5DxOM2AxnTwUZQJDgkcN4Q5XjIIYGEKo4uavmPaIIhRMj0VTgjsbeZ7UT8ruablyUylVL6Z1FNA+OkBHyEVnqIquUA15iKJH9Ixe0Zv1ZL1Y79bHZHTBmu7soT+wPn8AjsGgZg==</latexit>hMUX<latexit sha1_base64="vzyM3NMeoxh+bJrCVyV/KiL7LXU=">AAACCXicbVDLSsNAFJ3UV62vqEs3g0VwVRIRdVl8gBuhgmkLbSmT6bQdOpOEmRuxhGzd+CtuXCji1j9w5984TbPQ1gOXezjnXmbu8SPBNTjOt1VYWFxaXimultbWNza37O2dug5jRZlHQxGqpk80EzxgHnAQrBkpRqQvWMMfXUz8xj1TmofBHYwj1pFkEPA+pwSM1LVxG9gDKJlkHSBJ2loSIfDl1Y3XTNO0a5edipMBzxM3J2WUo9a1v9q9kMaSBUAF0brlOhF0EqKAU8HSUjvWLCJ0RAasZWhAJNOdJLskxQdG6eF+qEwFgDP190ZCpNZj6ZtJSWCoZ72J+J/XiqF/1kl4EMXAAjp9qB8LDCGexIJ7XDEKYmwIoYqbv2I6JIpQMOGVTAju7MnzpH5UcU8qx7fH5ep5HkcR7aF9dIhcdIqq6BrVkIcoekTP6BW9WU/Wi/VufUxHC1a+s4v+wPr8Abvomv0=</latexit>DEMUX<latexit sha1_base64="2OR/xMMcJSQ1UuIIc3xPTEiOATU=">AAAB83icbVDLSgMxFL2pr1pfVZdugkVwVWZE1GXRjcsK9gGdsWTSTBuayQxJRixDf8ONC0Xc+jPu/Bsz7Sy09UDgcM693JMTJIJr4zjfqLSyura+Ud6sbG3v7O5V9w/aOk4VZS0ai1h1A6KZ4JK1DDeCdRPFSBQI1gnGN7nfeWRK81jem0nC/IgMJQ85JcZKnhcRMwrC7Gn64ParNafuzICXiVuQGhRo9qtf3iCmacSkoYJo3XOdxPgZUYZTwaYVL9UsIXRMhqxnqSQR0342yzzFJ1YZ4DBW9kmDZ+rvjYxEWk+iwE7mGfWil4v/eb3UhFd+xmWSGibp/FCYCmxinBeAB1wxasTEEkIVt1kxHRFFqLE1VWwJ7uKXl0n7rO5e1M/vzmuN66KOMhzBMZyCC5fQgFtoQgsoJPAMr/CGUvSC3tHHfLSEip1D+AP0+QMryZHI</latexit>x1<latexit sha1_base64="Uf5LR7Ekg+9UGx+jPS9Ch+Y1g8k=">AAAB83icbVDLSsNAFL2pr1pfVZduBovgqiSlqMuiG5cV7AOaWCbTSTt0MgkzE7GE/oYbF4q49Wfc+TdO0iy09cDA4Zx7uWeOH3OmtG1/W6W19Y3NrfJ2ZWd3b/+genjUVVEiCe2QiEey72NFORO0o5nmtB9LikOf054/vcn83iOVikXiXs9i6oV4LFjACNZGct0Q64kfpE/zh8awWrPrdg60SpyC1KBAe1j9ckcRSUIqNOFYqYFjx9pLsdSMcDqvuImiMSZTPKYDQwUOqfLSPPMcnRllhIJImic0ytXfGykOlZqFvpnMMqplLxP/8waJDq68lIk40VSQxaEg4UhHKCsAjZikRPOZIZhIZrIiMsESE21qqpgSnOUvr5Juo+5c1Jt3zVrruqijDCdwCufgwCW04Bba0AECMTzDK7xZifVivVsfi9GSVewcwx9Ynz8tTZHJ</latexit>x2<latexit sha1_base64="90ZTaAQfpSKuRJdG+WwJ8Zz76kQ=">AAAB83icbVDLSsNAFL2pr1pfVZduBovgqiRa1GXRjcsK9gFNLJPppB06mYSZiVhCfsONC0Xc+jPu/BsnbRbaemDgcM693DPHjzlT2ra/rdLK6tr6RnmzsrW9s7tX3T/oqCiRhLZJxCPZ87GinAna1kxz2oslxaHPadef3OR+95FKxSJxr6cx9UI8EixgBGsjuW6I9dgP0qfs4XxQrdl1ewa0TJyC1KBAa1D9cocRSUIqNOFYqb5jx9pLsdSMcJpV3ETRGJMJHtG+oQKHVHnpLHOGTowyREEkzRMazdTfGykOlZqGvpnMM6pFLxf/8/qJDq68lIk40VSQ+aEg4UhHKC8ADZmkRPOpIZhIZrIiMsYSE21qqpgSnMUvL5POWd25qDfuGrXmdVFHGY7gGE7BgUtowi20oA0EYniGV3izEuvFerc+5qMlq9g5hD+wPn8ALtGRyg==</latexit>x3<latexit sha1_base64="m/Q9xdoxzWrS8KcoWwMrVxZEooY=">AAAB83icbVDLSgMxFL3js9ZX1aWbYBFclRkp6rLoxmUF+4DOWDJppg1NMkOSEcvQ33DjQhG3/ow7/8ZMOwttPRA4nHMv9+SECWfauO63s7K6tr6xWdoqb+/s7u1XDg7bOk4VoS0S81h1Q6wpZ5K2DDOcdhNFsQg57YTjm9zvPFKlWSzvzSShgcBDySJGsLGS7wtsRmGUPU0f6v1K1a25M6Bl4hWkCgWa/cqXP4hJKqg0hGOte56bmCDDyjDC6bTsp5ommIzxkPYslVhQHWSzzFN0apUBimJlnzRopv7eyLDQeiJCO5ln1IteLv7n9VITXQUZk0lqqCTzQ1HKkYlRXgAaMEWJ4RNLMFHMZkVkhBUmxtZUtiV4i19eJu3zmndRq9/Vq43roo4SHMMJnIEHl9CAW2hCCwgk8Ayv8Oakzovz7nzMR1ecYucI/sD5/AEwVZHL</latexit>x4<latexit sha1_base64="EwTfb49fSogakLCEst/4/mLa9wY=">AAACFHicbVDLSgMxFM3UV62vqks3wSIIQpmRoi6LbtwIFewDOrVk0kwbmswMyR1pGeYj3Pgrblwo4taFO//GTNuFth4IOZxzL8k5XiS4Btv+tnJLyyura/n1wsbm1vZOcXevocNYUVanoQhVyyOaCR6wOnAQrBUpRqQnWNMbXmV+84EpzcPgDsYR60jSD7jPKQEjdYsnriQw8PxklN4nLrARKDm9AZLE1ZIIgW/qrdSgWyzZZXsCvEicGSmhGWrd4pfbC2ksWQBUEK3bjh1BJyEKOBUsLbixZhGhQ9JnbUMDIpnuJJNQKT4ySg/7oTInADxRf28kRGo9lp6ZzCLoeS8T//PaMfgXnYQHUQwsoNOH/FhgCHHWEO5xxSiIsSGEKm7+iumAKELB9FgwJTjzkRdJ47TsnJUrt5VS9XJWRx4doEN0jBx0jqroGtVQHVH0iJ7RK3qznqwX6936mI7mrNnOPvoD6/MHqSGgdg==</latexit>xMUX<latexit sha1_base64="wV+UNzTFnY3Cv00/ZyAkdo4KVO8=">AAACB3icbVBNS8NAEN3Ur1q/qh4FWSyCp5JIUY9FL16ECqYtNKFsttt26W4SdidiCbl58a948aCIV/+CN/+N27QHbX0wzOO9GXbnBbHgGmz72yosLa+srhXXSxubW9s75d29po4SRZlLIxGpdkA0EzxkLnAQrB0rRmQgWCsYXU381j1TmkfhHYxj5ksyCHmfUwJG6pYPPWAPoGSad4A09bQkQuAbt51lWbdcsat2DrxInBmpoBka3fKX14toIlkIVBCtO44dg58SBZwKlpW8RLOY0BEZsI6hIZFM+2l+R4aPjdLD/UiZCgHn6u+NlEitxzIwk5LAUM97E/E/r5NA/8JPeRgnwEI6faifCAwRnoSCe1wxCmJsCKGKm79iOiSKUDDRlUwIzvzJi6R5WnXOqrXbWqV+OYujiA7QETpBDjpHdXSNGshFFD2iZ/SK3qwn68V6tz6mowVrtrOP/sD6/AGKIZpg</latexit>MUXthechefcooksthemeal<latexit sha1_base64="oVPk618V8E12zzvLW03Ectn2edA=">AAACDHicbVDLSsNAFJ3UV62vqks3g0VwVRIRdVl0YZcV7APaUG4mk3bsZBJmJmIJ/QA3/oobF4q49QPc+TdO2iy09cDA4ZxzuXOPF3OmtG1/W4Wl5ZXVteJ6aWNza3unvLvXUlEiCW2SiEey44GinAna1Exz2oklhdDjtO2NrjK/fU+lYpG41eOYuiEMBAsYAW2kfrnS0/RBp9eQKMVA4Dr4EIL0cUNGd5RkoYlJ2VV7CrxInJxUUI5Gv/zV8yOShFRowkGprmPH2k1BakY4nZR6iaIxkBEMaNdQASFVbjo9ZoKPjOLjIJLmCY2n6u+JFEKlxqFnkiHooZr3MvE/r5vo4MJNmYgTTQWZLQoSjnWEs2awz6Q5mI8NASKZ+SsmQ5BAtOmvZEpw5k9eJK2TqnNWPb05rdQu8zqK6AAdomPkoHNUQ3XUQE1E0CN6Rq/ozXqyXqx362MWLVj5zD76A+vzB17Km9U=</latexit>GaussianHadamardProjection<latexit sha1_base64="UuqbFuRBLDbq3pSCx6RaGxOMbdw=">AAAB+3icbVBNS8NAEN3Ur1q/Yj16CRbBU0lE1GPRi8cK/YI2lM120i7dbMLuRFpC/4oXD4p49Y9489+4bXPQ1gcDj/dmmJkXJIJrdN1vq7CxubW9U9wt7e0fHB7Zx+WWjlPFoMliEatOQDUILqGJHAV0EgU0CgS0g/H93G8/gdI8lg2cJuBHdCh5yBlFI/Xtcg9hgllDUanDWEWgZn274lbdBZx14uWkQnLU+/ZXbxCzNAKJTFCtu56boJ9RhZwJmJV6qYaEsjEdQtdQSSPQfra4feacG2XgmNWmJDoL9fdERiOtp1FgOiOKI73qzcX/vG6K4a2fcZmkCJItF4WpcDB25kE4A66AoZgaQpni5laHjaiiDE1cJROCt/ryOmldVr3r6tXjVaV2l8dRJKfkjFwQj9yQGnkgddIkjEzIM3klb9bMerHerY9la8HKZ07IH1ifPwGFlRQ=</latexit>Transformer<latexit sha1_base64="AaeU8bMtT64k4CKOutQt8NVK4vo=">AAACCnicbVA9SwNBEN3zM8avqKXNahBsDHcS1DKYRrsI+YIkhL3NJFmyt3fszonhSG3jX7GxUMTWX2Dnv3HzUWjig4HHezPMzPMjKQy67reztLyyurae2khvbm3v7Gb29qsmjDWHCg9lqOs+MyCFggoKlFCPNLDAl1DzB8WxX7sHbUSoyjiMoBWwnhJdwRlaqZ05aiI8YFLUoTFnt8ogUxxoWTNluqEOQI/amaybcyegi8SbkSyZodTOfDU7IY8DUMglM6bhuRG2EqZRcAmjdDM2EDE+YD1oWKpYAKaVTF4Z0ROrdKhdbUshnai/JxIWGDMMfNsZMOybeW8s/uc1YuxetRKhohhB8emibiwphnScC+0IDRzl0BLGtbC3Ut5nmnG06aVtCN78y4ukep7zLnL5u3y2cD2LI0UOyTE5JR65JAVyQ0qkQjh5JM/klbw5T86L8+58TFuXnNnMAfkD5/MHKfCbNg==</latexit>Cross-InstanceTransformer<latexit sha1_base64="seLnnuR19kMlrdHK2xKwAzeZCLg=">AAACBnicbVDLSgMxFM34rPVVdSlCsAhuLDNS1GW1G91VsA9oS8mkt21oJjMkd8QydOXGX3HjQhG3foM7/8b0sdDWA4HDOfckucePpDDout/OwuLS8spqai29vrG5tZ3Z2a2YMNYcyjyUoa75zIAUCsooUEIt0sACX0LV7xdHfvUetBGhusNBBM2AdZXoCM7QSq3MQQPhAZOiDo05uVEGmeJAL22EdWHYymTdnDsGnSfelGTJFKVW5qvRDnkcgEIumTF1z42wmTCNgksYphuxgYjxvr28bqliAZhmMl5jSI+s0qadUNujkI7V34mEBcYMAt9OBgx7ZtYbif959Rg7F81EqChGUHzyUCeWFEM66oS2hQaOcmAJ41rYv1LeY5pxtM2lbQne7MrzpHKa885y+dt8tnA1rSNF9skhOSYeOScFck1KpEw4eSTP5JW8OU/Oi/PufExGF5xpZo/8gfP5A5h2mTY=</latexit>Cross-InstanceAverage at each position from 1 to L. This is done by trans- posing gctx and applying TRANSinst. (cid:17) (cid:16) xMUX = TRANSinst g⊤ ctx (5) RSA demultiplexer The demultiplexer in T- MUX requires a prefix whose length scales lin- early with the number of instances (N ), thus reduc- ing the effective context length during pre-training, which degrades performance (Ainslie et al., 2020; Zaheer et al., 2020; Beltagy et al., 2020). Further- more, it decreases throughput during inference for large N because the model must process an ex- tra prefix of length N for each of the N instances. To address these issues, we draw inspiration from the RSA cryptosystem (Rivest et al., 1978) to ran- domly initialize and learn N (private) key vectors (k1, . . . , kN , ki ∈ Rd) which are keys that can be used to demultiplex the output representation (Figure 2). hi = DeMUX (cid:0)hMUX, ki(cid:1) j, ki(cid:1) j = DeMUX (cid:0)hMUX hi (6) Akin to RSA, vi and ki can be treated as the keys for multiplexing (encryption) and demulti- plexing (decryption) while ensuring that, unlike T-MUX, the input sequence length does not change and thereby leading to an improvement in through- put. Importantly, this architecture ensures that the keys better transfer across the different stages of training as they are no longer conditioned on the input instances. 4 Experimental Setup pre-train all models Datasets We on Wikipedia (Foundation) and Bookscorpus (Zhu et al., 2015). We evaluate on all datasets from the GLUE benchmark (Wang et al., 2018), which are CoLA (Warstadt et al., 2019), SST-2 (Socher et al., 2013), MRPC (Dolan and Brockett, 2005), QQP (qqp), STS-B (Cer et al., 2017), MNLI (Williams et al., 2018), QNLI (Wang et al., 2018), RTE (Wang et al., 2018), and WNLI (Levesque et al., 2012). We also evaluate on token classification tasks – named entity recognition (Sang and Meulder, 2003) and POS tagging (Grünewald et al., 2021). We don't report average over the two smallest tasks in GLUE, WNLI and CoLA, as we observe high variance across seeds. All numbers are reported on the dev split. We report scores for all tasks in Appendix E. Model N GLUE Token Mean (std) Max Mean (std) Max BERT ELECTRA T-MUX MUX-BERT‡ MUX-ELEC‡ T-MUX MUX-BERT‡ MUX-ELEC‡ T-MUX MUX-BERT‡ MUX-ELEC‡ 1 2 5 10 85.4 (0.0) 82.1 (0.0) 60.4 (0.6) 82.5 (0.6) 82.5 (0.4) 59.7 (0.6) 80.3 (0.4) 79.8 (0.6) 58.1 (0.5) 77.8 (0.6) 78.2 (0.6) 85.4 82.1 61.8 83.4 83.1 60.6 80.9 80.5 59.1 78.8 79.0 95.8 (0.0) 95.3 (0.0) 81.4 (0.1) 95.2 (0.1) 95.0 (0.0) 81.3 (0.2) 93.6 (0.1) 93.4 (0.0) 79.7 (0.2) 91.6 (0.1) 91.7 (0.1) 95.8 95.3 81.5 95.4 95.1 81.5 93.6 93.5 80.0 91.8 91.8 ↗ 1.0× 1.0× 1.9× 2.0× 2.0× 4.4× 4.9× 4.9× 8.4× 9.8× 9.7× Table 1: Average GLUE and token-level classifica- tion scores for the BASE (L=12, H=768) configura- tion, across ELECTRA, BERT, and MUX-PLMs for N ∈ {1, 2, 5, 10}. ‡ indicates our models and ↗ indi- cates throughput increase w.r.t. to a vanilla BERTBASE model. All models are evaluated on 5 seeds with mean and max scores reported. Models We experiment with ELECTRA and BERT pre-training objectives and present the pre-trained multiplexed models MUX-BERT and MUX-ELECTRA for N = 2, 5 and 10. To sim- plify training, we use a random generator to train MUX-ELECTRA models, presented as an ablation in Clark et al. (2020), instead of using a smaller masked LM. Except where otherwise noted, we do not use the contextual MUX module, but in- stead, use the RSA demultiplexing module. Refer to Appendix B and C for implementation details. Baselines We run experiments to compare our models against T-MUX, from Murahari et al. (2022) and baseline PLMs - ELECTRA and BERT, across three different model configurations (SMALL, BASE, and LARGE). We also provide a comparison to results reported in recent PLM prun- ing and distillation papers in Table 2. Multi-run evaluation We evaluate all models across 5 random seeds to reduce variance for smaller datasets which is caused by the random- ized order in which we multiplex instances in the batch. We report both the average and maximum scores across seeds in Table 1 to understand the importance of ordering the multiplexed instances and report average across seeds for all other results. 5 Results 5.1 Comparing MUX-PLMs with PLMs and T-MUX Table 1 shows that both MUX-BERT and MUX- ELECTRA outperform T-MUX at all levels of multiplexing (N ), with improvements between 12 and 20 points on GLUE and token-classification tasks respectively. Furthermore, MUX-PLMs' effi- cient RSA-inspired demultiplexing method allows it to achieve faster throughput than T-MUX, in- creasing it by over 16% for N = 10. Moreover, MUX-PLMs provide a significant boost in throughput (N times faster) when com- pared to PLMs, without a significant loss in performance. For example, MUX-ELECTRA (N = 2) is 0.4 points better and only 0.3 points worse than ELECTRA for GLUE and TOKEN tasks respectively, while being 2× faster. Similarly, MUX-BERT (N = 2) is within 3 and 0.6 points of BERT for GLUE and TOKEN tasks respectively, while being significantly faster. We also observe that as N increases, MUX-PLMs' throughput is significantly better, though performance compared to PLMs can degrade. This is because a large N implies that MUX-PLMs must parallelly process more instances, thus having to share network pa- rameters and activations with a larger number of instances, thus improving throughput and degrad- ing performance. For example, the gap between ELECTRA and MUX-ELECTRA on TOKEN for N = 2 is 0.2 points and increases to 3.5 points for N = 10, which shows that N serves as a parame- ter to control the performance-throughput trade-off. We explore this further in Section 5.3 and Figure 4. 5.2 Comparing MUX-PLMs with recent model compression methods We compare our MUX-PLM models with other efficient learning methods, such as pruning and dis- tillation, in Table 2. Contrary to other methods, our vanilla MUX-PLMs achieve competitive per- formance and significant throughput improvement without additional unlabeled and task-specific data, and can be easily fine-tuned to any downstream task without any architectural modifications. For instance, when compared to DistilBERT, MUX- BERT (N = 2) does 1 point worse on QNLI and 2 points better on QQP while being equally fast and not requiring any additional unlabeled data. More broadly, methods like CoFi, AutoTiny- BERT, and MobileBERT show that combining a Model ↗ QNLI QQP SST2 BERT MUX-BERT (N=2) MUX-BERT (N=5) 1.0× 2.0× 4.9× 90.5 88.2 85.6 91.2 90.4 88.8 91.7 90.6 86.9 Use additional unlabelled or task-specific data DistilBERT6 Block Pruning Prune OFA Hybrid Approaches TinyBERT6 CoFi AutoTinyBERT MobileBERT 2.0× 2.7× 1.0× 2.0× 2.7× 4.3× 2.3× 89.2 89.7 90.3 91.1 91.3 89.7 91.0 88.5 - 91.2 91.1 - 89.9 - 91.3 91.2 91.5 93.0 93.0 91.4 92.1 Table 2: MUX-PLMs are complementary to existing efficiency methods, while being competitive standalone. Contrary to existing methods, MUX-PLMs do not use additional unlabelled and task-specific data and can be easily fine-tuned for any downstream task without architectural modifications. The inference speedups (↗) are reported against BERTBASE. Config Model GLUE Token ↗ SMALL BASE LARGE BERT T-MUX MUX-BERT‡ BERT T-MUX MUX-BERT‡ BERT T-MUX MUX-BERT‡ 80.6 59.5 79.0 85.4 60.4 82.5 85.8 61.7 84.1 94.0 81.8 93.3 95.8 81.4 95.2 95.6 80.9 95.2 5.9× 8.7× 11.5× 1.0× 1.9× 2.0× 0.3× 0.6× 0.6× Table 3: Changing the model size for MUX-BERT (N = 2) models. Across different model sizes, MUX- BERT outperforms T-MUX and achieve higher through- put (indicated under ↗ column). ‡ = our models. wide range of paradigms (for example, CoFi com- bines structured pruning and knowledge distillation, AutoTinyBERT combines knowledge distillation and neural architecture search, and MobileBERT combines knowledge distillation with novel archi- tectural innovations) is a promising approach to- wards efficient high-performance models. Towards this end, MUX-PLMs are complemen- tary in both approach and motivation to these meth- ods, and can evolve in tandem with existing effi- ciency methods. MUX-PLMs demonstrate the via- bility of MIMO architectures for PLMs, in addition to being complementary to existing approaches, and we hope that MIMO architectures develop and evolve with other efficiency approaches while lever- aging the best of all efficiency methods. 5.3 Effect of varying model size In this section, we show that our multiplexing techniques work on a host of model sizes and report results for MUX-BERT on three models sizes, SMALL, BASE, and LARGE for N = 2 (Ta- ble 3). We report results for other values of N in the appendix. MUX-BERT's performance is close to that of BERT for all model sizes while having a significantly better throughput (the gap is less than 0.7 points for TOKEN tasks and 2.9 points for GLUE for close to twice the throughput). Multiplexing works effectively on all model sizes, with the drops with respect to BERT being 1.6 and 1.7 points on GLUE for SMALL and LARGE re- spectively. MUX-BERT's throughput is always ≈ 2× that of BERT, which shows that a spectrum of MUX-PLM model sizes can be multiplexed dur- ing pre-training with competitive performance and with significantly higher throughput. Figure 4: (Top) BERT GLUE performance and through- put and (Bottom) BERT Token task performance and throughput, for N ∈ {1, 2, 5, 10} with the SMALL, BASE, and LARGE configurations (illustrated as S/B/L). All multiplexed models lie either on or very close to the Pareto frontier (shown in grey). Pre-trained models typically have a performance- computational efficiency trade-off, with larger mod- els having better performance but worse compu- Model Mux (N ) MUX-BERT MUX-ELEC 2 5 10 2 5 10 MNLI QQP No Ens Ens ∆ No Ens Ens ∆ 80.6 77.2 73.6 80.3 77.0 74.6 81.2 + 0.6 78.8 + 1.6 74.8 + 1.2 80.8 + 0.5 78.4 + 1.4 76.0 + 1.4 90.4 88.8 86.9 90.6 89.1 87.6 90.8 + 0.4 89.7 + 0.9 87.7 + 0.8 90.9 + 0.3 89.9 + 0.8 88.3 + 0.7 Table 4: Ensembling results for MUX-BERT and MUX- ELECTRA models for N ∈ {2, 5, 10}. Ens denotes Ensembling. Ensembling improves performance for all the models, with the gains increasing with increasing N. This suggests that the multiplexing approach can be nat- urally adapted to load-balancing applications, where the ensembling strategy can be changed based on demand. tational efficiency. MUX-PLMs offers a similar trade-off, with large N leading to better through- put but lower performance. To understand this trade-off, we plot the performance and through- put of BERT and MUX-BERT for different model sizes and draw the pareto-optimal envelope (Fig- ure 4). For any model on the envelope, no model has both better accuracy and throughput. Users would only choose models on the envelope be- cause for every model within the envelope, there always exists a model on the envelope which has both better performance and throughput. We note that all multiplexed models lie either on or very close to the Pareto frontier, for both TOKEN and GLUE tasks. This suggests that given an accuracy threshold, MUX-PLM models will usually be faster than PLMs. For instance, if we wanted the highest throughput model with a performance ≥ 77% on GLUE, the optimal BERT model is the SMALL con- figuration with a throughput of 2815 (in/s), but for the MUX-BERT model would be the N = 2 with the SMALL configuration, achieving a significantly higher throughput of 5539 (in/s). 5.4 Ensembling MUX-PLMs As opposed to feeding N different instances to MUX-PLMs to improve throughput, we consider an alternate setting where we feed the same in- stance N times and build an ensemble by averag- ing the N class logits to make a single prediction. We randomly permute the batch, after duplicating the instance N times, to prevent distribution shift. We use the BASE size models for N ∈ {2, 5, 10} for both MUX-BERT and MUX-ELECTRA (Ta- ble 4). The ensemble model does significantly better than the non-ensemble variant on both MNLI and QQP for all values of N (e.g., 1.6 and 15040011003000810022000Throughput(instances/sec.)7477818487Accuracy(%)SSSBBBLLLN=1N=2N=515040011003000810022000Throughput(instances/sec.)8588929598F1(%)SSSBBBLLLN=1N=2N=5 Mux (N) Model Mux Demux GLUE Token 2 5 10 MUX-BERT Non-contextual RSA-DeMUX Non-contextual Ablation 1 Contextual Ablation 2 Prefix RSA-DeMUX MUX-BERT Non-contextual RSA-DeMUX Non-contextual Ablation 1 Contextual Ablation 2 Prefix RSA-DeMUX MUX-BERT Non-contextual RSA-DeMUX Non-contextual Ablation 1 Contextual Ablation 2 Prefix RSA-DeMUX 82.5 83.2 82.3 80.3 78.6 76.8 77.8 76.6 76.0 95.2 95.3 95.3 93.6 38.9 94.2 91.6 25.6 93.3 Table 5: Ablation analysis for MUX-BERT (base con- figuration) for N ∈ {2, 5, 10}. Across most configura- tions, the prefix demultiplexing variant performs worse than our proposed approach and fails to converge for token-level tasks for N ∈ {5, 10} (underlined numbers). The new contextual multiplexing variant (Contextual) outperforms Non-contextual on token-level tasks. 0.9 points on N = 5 MUX-BERT for the two tasks). We note that the improvement over the non- ensemble variant (∆) is better for higher N , due to the larger ensemble size. This result shows that non- ensemble variants are faster but perform slightly worse, while the ensemble variant performs better but is slower. A spectrum of models lie between these two extremes, where only a fraction of the N multiplexed representations can be ensembled, allowing users to trade off performance and speed. 6 Analysis 6.1 Ablation study We analyze multiplexing and demultiplexing com- ponents of MUX-PLMs and report the results in Table 5. We consider two variants, one which uses the prefix demultiplexing proposed in T-MUX in- stead of our proposed RSA-DeMUX and another which uses Contextual multiplexing instead of Non- contextual. We note that Variant 1, which uses pre- fix demultiplexing, performs worse than our MUX- BERT, other than for N = 2. In fact, Variant 1 does not converge for TOKEN tasks for N = 5 and N = 10 and performs 1.7 and 1.2 points worse on GLUE when compared to MUX-BERT. Variant 2 uses Contextual multiplexing which takes into account other tokens present in the in- stance and also tokens present in the same position of other instances. This variant performs better than Non-contextual for TOKEN tasks (almost over 1.7 points on TOKEN for N = 10) but performs worse for GLUE tasks. We believe that Contextual multi- plexing's better performance in TOKEN is because the model needs to make a prediction for every single position in the instance, which requires it to efficiently multiplex all token positions in the output. However, for GLUE tasks, the model needs to make a prediction only for the [CLS] token, for which Non-contextual multiplexing suffices. 6.2 Muxology: Analyzing hidden representations of multiplexed models To understand the nature of representations being learned by MUX-BERT models, we analyze the absolute value of activations and entropy of the attention distribution across all the layers of the Transformer encoder, averaged over the evaluation split of WikiText-103 (Merity et al., 2016) (Fig- ure 5). We report this analysis for different values of N and for different model sizes. 1. Activation norms spike for MUX-BERT in the last layer. Figure 5 (top) shows that activation norms spike in the last layer for multiplexed models. We believe this is because the model is preparing for demultiplexing and is packing information from all N instances, which makes the activations denser. We believe MUX-BERT has learned to efficiently encode multiple instances until the last layer where it needs to make independent predictions for them. 2. Entropy of the attention weights of MUX- BERT is lower than BERT for higher layers. Figure 5 (bottom) suggests that MUX-BERT tends to have lower entropy attention distributions on av- erage as opposed to BERT for higher layers. This could be related to Deshpande and Narasimhan (2020)'s observation of pre-trained models having peaky attention distributions in the higher layers, with small irregularities. Since the model implicitly has to use the same attention distribution for all the multiplexed instances, the peaky distribution gets reinforced and is further corroborated by higher N having lower entropy in the final layer. We, therefore, believe that MUX-BERT has learned to create shared representations for multiple instances to effectively use the instance-independent atten- tion distribution. 6.3 Effect of data sampling strategies during inference During inference, our MUX-PLMs sample N in- stances uniformly at random from the evaluation set. However, other data-sampling strategies such as clustering similar instances based on word- overlap could improve performance. We explore the effect of composition of N instances on the performance of MUX-PLMs in Table 6. For each model variant, we consider 5 random seeds Figure 5: Comparing (Top) Layer-wise activation and (Bottom) attention entropy of MUX-BERT and BERT, for N ∈ {2, 5, 10} across different configurations. Activation norms tend to spike for MUX-BERT in the last layer and entropy of MUX-BERT is lower than BERT for higher layers. N 2 5 10 MUX-ELECTRA MUX-BERT Best ticket Worst ticket ∆ Best ticket Worst ticket ∆ 83.1 80.5 79.0 82.0 78.9 77.3 1.1 1.6 1.7 83.4 80.9 78.8 81.8 79.7 77.0 1.6 1.2 1.8 Table 6: We consider 5 random seeds for every model variant, which can be viewed as lottery tickets as the seeds control the composition of N instances. We present the difference between the worst and the best- performing ticket across GLUE tasks and regularly see a ≥ 1 point difference. which can be viewed as lottery tickets (Frankle and Carbin, 2018). Since the random seed controls the composition of N instances, we measure the differ- ence (∆) between the best-performing ticket and the worst-performing ticket and average the perfor- mance for all the GLUE tasks. ∆ is consistently greater than 1 point for all values of N for both MUX-ELECTRA and MUX-BERT, and illustrates the importance of the composition of N instances. An improved data sampling strategy could lead to improvements and we leave this to future work. 7 Conclusion We introduce MUX-PLMs, a class of high- throughput pre-trained language models trained with data multiplexing, a multi-input multi-output (MIMO) architecture. Our MUX-PLMs models, trained with novel MIMO modules, are competitive with state-of-the-art PLMs on several downstream tasks while achieving a many-fold increase in infer- ence throughput. MUX-PLMs, similar to standard PLMs, can be fine-tuned on any downstream task to yield high-throughput, high-performance mod- els. We hope our work inspires future research in MIMO architectures for PLMs as a complementary efficiency paradigm to existing approaches. Acknowledgements We gratefully acknowledge support from Google AI Princeton, where Vishvak Murahari was a stu- dent researcher for part of this work, and the Sam- sung GRO program. We thank Mengzhou Xia, Jens Tuyls, and Tianyu Gao, with special thanks to our espresso machine. References data.quora.com/First-Quora- Quora. Dataset-Release-Question-Pairs. Ac- cessed: 2022-10-15. Armen Aghajanyan, Bernie Huang, Candace Ross, Vladimir Karpukhin, Hu Xu, Naman Goyal, Dmytro Okhonko, Mandar Joshi, Gargi Ghosh, Mike Lewis, Cm3: A causal masked multi- et al. 2022. arXiv preprint modal model of the internet. arXiv:2201.07520. Joshua Ainslie, Santiago Ontañón, Chris Alberti, Philip Pham, Anirudh Ravula, and Sumit Sanghai. 2020. 0.40.60.81.0NormSmallBaseLarge1234Layer0246Entropy14812Layer14812162024LayerN=1N=2N=5N=10 ETC: encoding long and structured data in transform- ers. CoRR, abs/2004.08483. Thomas Akam and Dimitri M Kullmann. 2014. Os- cillatory multiplexing of population codes for selec- tive communication in the mammalian brain. Nature Reviews Neuroscience, 15(2):111–122. Iz Beltagy, Matthew E Peters, and Arman Cohan. 2020. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150. Francisca Blumhagen, Peixin Zhu, Jennifer Shum, Yan- Ping Zhang Schärer, Emre Yaksi, Karl Deisseroth, and Rainer W Friedrich. 2011. Neuronal filter- ing of multiplexed odour representations. Nature, 479(7374):493–498. Daniel Cer, Mona Diab, Eneko Agirre, Iñigo Lopez- Gazpio, and Lucia Specia. 2017. Semeval-2017 task 1: Semantic textual similarity multilingual and crosslingual focused evaluation. In Proceedings of the 11th International Workshop on Semantic Evaluation (SemEval-2017), pages 1–14. Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Zhangyang Wang, and Michael Carbin. 2020. The lottery ticket hypothesis for In Advances in Neural pre-trained bert networks. Information Processing Systems, volume 33, pages 15834–15846. Curran Associates, Inc. Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. 2022. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311. Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. 2020. Electra: Pre-training text encoders as discriminators rather than gener- In International Conference on Learning ators. Representations. Ameet Deshpande and Karthik Narasimhan. 2020. Guiding attention for self-supervised learning with In Findings of the Association for transformers. Computational Linguistics: EMNLP 2020, pages 4676–4686. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language under- standing. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota. Asso- ciation for Computational Linguistics. Wikimedia Foundation. Wikipedia. Jonathan Frankle and Michael Carbin. 2018. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations. Rainer W Friedrich, Christopher J Habermann, and Gilles Laurent. 2004. Multiplexing using synchrony in the zebrafish olfactory bulb. Nature neuroscience, 7(8):862–871. Mitchell Gordon, Kevin Duh, and Nicholas Andrews. 2020. Compressing BERT: Studying the effects of weight pruning on transfer learning. In Proceedings of the 5th Workshop on Representation Learning for NLP, pages 143–155, Online. Association for Com- putational Linguistics. Stefan Grünewald, Prisca Piccirilli, and Annemarie Friedrich. 2021. Coordinate constructions in en- glish enhanced universal dependencies: Analysis and computational modeling. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 795–809. Marton Havasi, Rodolphe Jenatton, Stanislav Fort, Jeremiah Zhe Liu, Jasper Snoek, Balaji Lakshmi- narayanan, Andrew Mingbo Dai, and Dustin Tran. 2021. Training independent subnetworks for robust prediction. In International Conference on Learning Representations. Geoffrey E. Hinton, Oriol Vinyals, and Jeffrey Dean. 2015. Distilling the knowledge in a neural network. ArXiv, abs/1503.02531. Sungho Hong, Mario Negrello, Marc Junker, Aleksan- dra Smilgin, Peter Thier, and Erik De Schutter. 2016. Multiplexed coding by cerebellar purkinje neurons. Elife, 5:e13810. Ting Jiang, Deqing Wang, and Fuzhen Zhuang. 2022. Pruning pre-trained language models without fine- tuning. Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. 2020. TinyBERT: Distilling BERT for natural language un- derstanding. pages 4163–4174. Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. 2020. Scaling laws for neural language models. François Lagunas, Ella Charlaix, Victor Sanh, and Alexander M Rush. 2021. Block pruning for faster transformers. arXiv preprint arXiv:2109.04838. William B Dolan and Chris Brockett. 2005. Automati- cally constructing a corpus of sentential paraphrases. In Proceedings of the Third International Workshop on Paraphrasing (IWP2005). Hector Levesque, Ernest Davis, and Leora Morgen- stern. 2012. The winograd schema challenge. In Thirteenth international conference on the principles of knowledge representation and reasoning. Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. 2019. Rethinking the value of network pruning. In International Conference on Learning Representations. Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2016. Pointer sentinel mixture mod- els. Paul Michel, Omer Levy, and Graham Neubig. 2019. Are sixteen heads really better than one? In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. Vishvak Murahari, Carlos E Jimenez, Runzhe Yang, and Karthik R Narasimhan. 2022. DataMUX: Data multiplexing for neural networks. In Thirty-Sixth Conference on Neural Information Processing Systems. OpenAI. 2023. Introducing chatgpt. Friederice Pirschel and Jutta Kretzberg. 2016. Mul- tiplexed population coding of stimulus proper- ties by leech mechanosensory cells. Journal of Neuroscience, 36(13):3636–3647. Sai Prasanna, Anna Rogers, and Anna Rumshisky. 2020. When BERT Plays the Lottery, All Tickets Are Win- ning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3208–3229, Online. Association for Computational Linguistics. Alec Radford and Karthik Narasimhan. 2018. Im- proving language understanding by generative pre- training. Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the lim- its of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:1–67. Alexandre Ramé, Rémy Sun, and Matthieu Cord. 2021. Mixmo: Mixing multiple inputs for multiple out- puts via deep subnetworks. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 823–833. Ronald L Rivest, Adi Shamir, and Leonard Adleman. 1978. A method for obtaining digital signatures and public-key cryptosystems. Communications of the ACM, 21(2):120–126. Erik Tjong Kim Sang and Fien De Meulder. 2003. In- troduction to the conll-2003 shared task: Language- independent named entity recognition. In CoNLL. Victor Sanh, Thomas Wolf, and Alexander Rush. 2020. Movement pruning: Adaptive sparsity by fine-tuning. In Advances in Neural Information Processing Systems, volume 33, pages 20378–20389. Curran Associates, Inc. Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao, Amir Gholami, Michael W. Mahoney, and Kurt Keutzer. 2020. Q-bert: Hessian based ultra low pre- cision quantization of bert. In AAAI. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pages 1631– 1642. Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. 2020. MobileBERT: a compact task-agnostic bert for resource-limited de- vices. pages 2158–2170. Ashish Vaswani, Noam M. Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NIPS. Elena Voita, David Talbot, Fedor Moiseev, Rico Sen- nrich, and Ivan Titov. 2019. Analyzing multi-head self-attention: Specialized heads do the heavy lift- In Proceedings of ing, the rest can be pruned. the 57th Annual Meeting of the Association for Computational Linguistics, pages 5797–5808, Flo- rence, Italy. Association for Computational Linguis- tics. Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. 2018. Glue: A multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations. Ziheng Wang, Jeremy Wohlwend, and Tao Lei. 2020. Structured pruning of large language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). Association for Computational Linguistics. Alex Warstadt, Amanpreet Singh, and Samuel Bow- man. 2019. Neural network acceptability judgments. Transactions of the Association for Computational Linguistics, 7:625–641. Adina Williams, Nikita Nangia, and Samuel R Bow- man. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In NAACL-HLT. Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2019. DistilBERT, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108. Mengzhou Xia, Zexuan Zhong, and Danqi Chen. 2022. Structured pruning learns compact and accurate mod- els. In Association for Computational Linguistics (ACL). Ziqing Yang, Yiming Cui, and Zhigang Chen. 2022. TextPruner: A model pruning toolkit for pre- trained language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 35–43, Dublin, Ireland. Association for Com- putational Linguistics. Yichun Yin, Cheng Chen, Lifeng Shang, Xin Jiang, Xiao Chen, and Qun Liu. 2021. AutoTinyBERT: Automatic hyper-parameter optimization for efficient pre-trained language models. pages 5146–5157. Ofir Zafrir, Guy Boudoukh, Peter Izsak, and Moshe Wasserblat. 2019. Q8bert: Quantized 8bit bert. 2019 Fifth Workshop on Energy Efficient Machine Learning and Cognitive Computing - NeurIPS Edition (EMC2-NIPS), pages 36–39. Ofir Zafrir, Ariel Larey, Guy Boudoukh, Haihao Shen, and Moshe Wasserblat. 2021. Prune once for all: Sparse pre-trained language models. arXiv preprint arXiv:2111.05754. Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago On- tanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. 2020. Big bird: Transformers for longer sequences. Advances in Neural Information Processing Systems, 33:17283–17297. Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. 2018. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations. Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhut- dinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In The IEEE International Conference on Computer Vision (ICCV). Hyperparameter MUX-BERT MUX-ELECTRA SMALL BASE LARGE BASE Number of layers Hidden Size FFN intermediate hidden size Attention heads Attention head size Mask percent Learning Rate Decay Warmup steps Learning Rate Adam ε Adam β1 Adam β2 Attention Dropout Dropout Batch Size Sequence Length Train Steps 4 512 2048 8 64 15 Linear 10000 [1e-4, 5e-5] 1e-6 0.9 0.999 0.1 0.1 256 512 1M 12 768 3072 12 64 15 Linear 10000 [1e-4, 5e-5] 1e-6 0.9 0.999 0.1 0.1 256 512 1M 24 1024 4096 16 64 15 Linear 10000 [1e-4, 5e-5] 1e-6 0.9 0.999 0.1 0.1 256 512 1M 12 768 3072 12 64 N/A Linear 10000 [1e-4, 5e-5] 1e-6 0.9 0.999 0.1 0.1 256 512 1M Table 7: Pre-train hyper-parameters for MUX-BERT and MUX-ELECTRA models. We only report results for the Base configuration for MUX-ELECTRA models. A Appendices B Pre-training Details We report all pre-training related hyper-parameters in Table 7. We primarily use the HuggingFace Transformers implementations for BERT and ELECTRA based models. All pre-training experiments were run on 8 A100 GPUs with distributed training. We run a small hyper-parameter search over over two learning rates. All pre-trained models are primed with the token retrieval task introduced in Murahari et al. (2022). We train on the Wikipedia and Bookscorpus datasets for up to 10000 training steps with a learning rate of 1e − 4, and with a sequence length of 512. For MUX-ELECTRA models, we don't train a generator as in the original ELECTRA work, but only use uniform-random token replacement. This is similar to what was used in ablations in ELECTRA (Clark et al., 2020). The generator randomly replaces 15% of tokens in the input with other tokens in the vocabulary. C Fine-tuning Details We report all the fine-tuning related hyper-parameters in Table 8. We run a small hyper-parameter search on the learning rate, batch size and number of training steps for different tasks. All models were trained with half-precision. We report numbers on the validation split. For GLUE tasks, we use the default metrics in Wang et al. (2018) and use F1 for the token-level tasks. All fine-tuning experiments were trained on 1 V100 GPU. Speedup calculation For all models, we calculate throughput (samples/second) on a single V100 GPU and report throughput gains with respect to the BERTBASE model. We calculate throughput by averaging across 3 different trials (1 trial = 200 mini-batches) and use a batch size of 128 and a sequence length of 128 following prior work (Xia et al., 2022). We measure throughput for sequence-classification tasks on QQP and measure throughput for token-level classification tasks on named entity recognition. Hyperparameter Value [2e-5, 5e-5] Learning Rate Adam ε 1e-8 Adam β1 0.9 Adam β2 0.999 Learning rate decay Linear Warmup fraction Attention Dropout Dropout Weight Decay Batch Size Train Steps 0.1 0.1 0.1 0 [32, 128] for SMALL/ BASE, [16, 64] for LARGE 2000 for RTE and WNLI 10000 for MRPC, COLA and STSB 20000 for NER, SST2, QNLI and POS [20000, 100000] for MNLI and QQP 128 Table 8: Fine-tune hyperparameters Sequence Length D Analysis details D.1 Ensembling results setup We find that multiplexing the same instance by duplicating the instance N times leads to worse performance. This is likely because this input configuration is very out of distribution from what the multiplexed models are trained on. To address this, we randomly permute the instances in the batch after duplicating the instances N times. This ensures that the input to the multiplexer lies in a similar distribution to what the model was trained on. D.2 Muxology setup To analyze the hidden states of pre-trained MUX-BERT models at different layers, we take the average absolute value of hidden states and every layer for both multiplexed and baseline models, across different configurations. To analyze the entropies of the attention distributions at different layers, we calculate the attention distribution across different attention heads for each position in the sequence length. To measure how peaky the attention distribution is likely to be, we calculate the entropies of the attention distributions at all positions and average across all the positions and across all the attention heads to get the average entropy for all layers. We conduct this analysis on WikiText-103 and average across all the samples in the evaluation split. E Task performance breakdown for all variants Model Size N MNLI QQP QNLI MRPC WNLI STSB RTE SST2 COLA GLUE GLUE−WNLI, COLA SMALL BASE LARGE 1 2 5 10 1 2 5 10 1 2 5 10 77.86±0.0 75.09±0.1 70.50±0.1 61.98±0.1 84.24±0.0 80.59±0.1 77.18±0.2 73.62±0.3 85.79±0.0 83.23±0.2 79.55±0.2 35.45±0.0 88.99±0.0 88.88±0.1 86.39±0.1 80.85±0.1 91.19±0.0 90.36±0.1 88.79±0.1 86.94±0.1 91.46±0.0 90.85±0.1 89.37±0.1 63.18±0.0 84.00±0.0 84.31±0.2 81.23±0.2 63.47±0.3 90.54±0.0 88.17±0.1 85.58±0.1 82.08±0.3 92.29±0.0 90.66±0.2 87.41±0.2 50.54±0.0 77.70±0.0 79.75±0.7 74.26±1.0 70.69±0.9 87.75±0.0 83.77±1.4 80.10±0.6 78.63±0.6 83.82±0.0 84.90±0.8 83.77±1.1 68.38±0.0 56.34±0.0 50.99±8.1 54.65±3.3 56.62±4.3 56.34±0.0 50.70±7.0 53.52±2.5 52.68±6.0 56.34±0.0 56.34±0.0 54.93±0.0 56.90±5.2 84.25±0.0 82.65±0.3 79.90±0.2 36.93±1.0 89.18±0.0 85.84±0.1 84.28±0.2 81.62±0.2 89.53±0.0 88.22±0.2 85.86±0.3 82.81±0.2 62.45±0.0 55.52±1.5 58.56±1.9 53.57±1.8 63.18±0.0 58.19±1.6 59.13±1.2 58.27±2.4 66.06±0.0 59.21±0.9 57.26±2.0 52.13±1.9 88.88±0.0 87.04±0.7 82.57±0.3 80.39±0.4 91.74±0.0 90.62±0.6 86.88±0.4 83.44±0.6 91.40±0.0 91.38±0.4 88.65±0.7 50.92±0.0 43.48±0.0 30.64±1.7 12.78±1.6 1.10±2.2 58.79±0.0 55.61±1.6 12.33±2.4 0.00±0.0 57.79±0.0 57.89±1.5 46.66±0.9 1.87±4.6 73.77 70.54 66.76 56.18 79.22 75.98 69.75 66.36 79.39 78.08 74.83 51.35 80.59 79.03 76.20 63.98 85.40 82.51 80.28 77.80 85.76 84.06 81.70 57.63 Table 9: We show the full GLUE results for MUX-BERT. We report the mean accuracy and standard deviation over 5 seeds. Extrema and values within their standard deviation are emphasized for each model size. Model Size N MNLI QQP QNLI MRPC WNLI STSB RTE SST2 COLA GLUE GLUE−WNLI, COLA SMALL BASE LARGE 1 2 5 10 1 2 5 10 1 2 5 10 77.86 75.21 70.66 62.17 84.24 80.82 77.66 74.04 85.79 83.40 79.69 35.46 88.99 89.01 86.46 80.93 91.19 90.47 88.89 87.03 91.46 90.94 89.43 63.18 84.00 84.61 81.60 63.85 90.54 88.28 85.70 82.45 92.29 90.96 87.81 50.89 77.70 80.64 75.74 71.81 87.75 86.03 81.13 79.41 83.82 86.27 84.80 68.38 56.34 61.97 61.97 63.38 56.34 66.20 59.15 63.38 56.34 56.34 57.75 61.97 84.25 82.97 80.24 38.20 89.18 86.06 84.47 81.89 89.53 88.50 86.49 83.04 62.45 58.12 60.65 55.96 63.18 60.65 60.65 62.45 66.06 60.29 60.65 55.60 88.88 87.84 83.49 80.96 91.74 91.51 87.50 84.29 91.40 91.86 89.45 50.92 43.48 33.08 15.57 2.63 58.79 56.93 15.79 0.00 57.79 60.50 47.56 7.55 73.77 72.61 68.49 57.77 79.22 78.55 71.22 68.33 79.39 78.78 75.96 53.00 80.59 79.77 76.98 64.84 85.40 83.40 80.86 78.79 85.76 84.60 82.62 58.21 Table 10: We show the full GLUE results for MUX-BERT. We report the maximum accuracy over 5 seeds. Extrema are emphasized. N 1 2 5 10 MNLI QQP QNLI MRPC WNLI STSB RTE SST2 COLA GLUE GLUE−WNLI, COLA 81.49±0.0 80.29±0.2 76.99±0.2 74.62±0.2 90.73±0.0 90.58±0.1 89.08±0.0 87.63±0.1 89.73±0.0 88.39±0.2 85.40±0.3 82.70±0.2 75.98±0.0 83.73±0.7 80.25±1.6 77.89±0.7 56.34±0.0 57.18±2.1 56.90±4.5 50.99±4.9 87.73±0.0 86.80±0.1 84.27±0.2 81.96±0.5 57.76±0.0 58.77±1.1 57.26±1.0 59.86±2.1 91.51±0.0 88.65±0.4 85.09±1.0 82.71±0.5 56.79±0.0 51.92±1.7 26.89±1.2 27.76±2.3 76.45 76.26 71.35 69.57 82.13 82.46 79.76 78.20 Table 11: We show the full GLUE results for MUX-ELECTRABASE. We report the mean accuracy and standard deviation over 5 seeds. Extrema and values within their standard deviation are emphasized for each model size. N Retreival Rate MNLI QQP QNLI MRPC WNLI STSB RTE SST2 COLA GLUE GLUE−WNLI, COLA 2 5 10 0.0 0.1 0.2 0.5 0.0 0.1 0.2 0.5 0.0 0.1 0.2 0.5 83.23±0.2 83.55±0.3 83.50±0.1 83.41±0.2 79.55±0.2 79.49±0.1 79.37±0.1 79.24±0.1 35.45±0.0 35.45±0.0 35.45±0.0 35.45±0.0 90.85±0.1 90.90±0.1 90.96±0.1 90.91±0.0 89.37±0.1 89.34±0.1 89.42±0.1 89.30±0.1 63.18±0.0 63.18±0.0 63.18±0.0 63.18±0.0 90.66±0.2 90.58±0.2 90.69±0.2 90.47±0.1 87.41±0.2 87.25±0.3 87.23±0.3 87.21±0.3 50.54±0.0 50.65±0.2 50.21±0.5 50.43±0.4 84.90±0.8 85.49±1.1 84.95±0.5 85.25±0.5 83.77±1.1 81.81±1.3 82.40±1.1 82.06±1.7 68.38±0.0 68.38±0.0 68.43±0.8 68.38±0.0 56.34±0.0 56.34±0.0 56.34±0.0 56.34±0.0 54.93±0.0 53.24±1.6 54.93±0.0 56.34±0.0 56.90±5.2 54.93±5.0 54.65±4.2 56.06±0.6 88.22±0.2 88.28±0.2 88.28±0.2 88.02±0.1 85.86±0.3 85.80±0.2 85.85±0.2 85.97±0.2 82.81±0.2 4.45±1.5 0.23±1.5 82.01±0.6 59.21±0.9 57.76±1.4 58.34±1.6 59.35±1.6 57.26±2.0 55.60±2.4 55.38±2.6 52.27±4.0 52.13±1.9 51.48±2.4 52.35±2.0 52.71±0.0 91.38±0.4 90.69±0.8 90.69±0.5 89.52±0.6 88.65±0.7 88.19±0.7 87.84±0.8 88.58±0.6 50.92±0.0 50.92±0.0 51.72±0.4 50.92±0.0 57.89±1.5 59.36±1.4 59.17±1.5 59.41±2.0 46.66±0.9 47.60±1.0 43.58±1.2 47.01±2.3 1.87±4.6 1.34±1.8 0.29±2.7 1.51±1.7 78.08 78.11 78.10 78.08 74.83 74.26 74.00 74.22 51.35 42.31 41.83 51.18 84.06 83.89 83.92 83.85 81.70 81.07 81.07 80.66 57.63 46.36 45.94 57.58 Table 12: GLUE results for MUX-BERTLARGE when using a retrieval auxiliary objective during MLM pretraining with different trade-off rates to the MLM objective. We report the average accuracy over 5 seeds. Extrema and values within their standard deviation are emphasized for each value of N. N Mux Strategy MNLI QQP QNLI MRPC WNLI STSB RTE SST2 COLA GLUE GLUE−WNLI, COLA 2 5 10 MUX-BERT DataMUX Attention MUX-BERT DataMUX Attention MUX-BERT DataMUX Attention 80.59±0.1 81.64±0.2 81.32±0.2 77.18±0.2 76.32±0.1 77.16±0.1 73.62±0.3 72.74±0.1 71.83±0.2 90.36±0.1 90.67±0.1 90.65±0.0 88.79±0.1 89.13±0.1 88.71±0.0 86.94±0.1 87.88±0.1 88.00±0.0 88.17±0.1 88.39±0.2 88.77±0.1 85.58±0.1 84.22±0.3 84.33±0.1 82.08±0.3 82.28±0.2 81.46±0.2 83.77±1.4 84.17±0.4 80.88±0.6 80.10±0.6 78.38±0.9 70.49±0.6 78.63±0.6 77.30±0.5 73.53±0.5 50.70±7.0 56.34±0.0 56.34±0.0 53.52±2.5 59.44±3.5 54.08±3.2 52.68±6.0 56.34±0.0 53.24±5.4 85.84±0.1 86.36±0.2 86.25±0.1 84.28±0.2 81.78±0.4 80.37±0.3 81.62±0.2 78.07±0.4 82.95±0.2 58.19±1.6 60.87±0.7 56.90±1.2 59.13±1.2 54.15±1.3 54.44±2.5 58.27±2.4 55.31±1.2 52.71±0.0 90.62±0.6 90.50±0.4 91.06±0.2 86.88±0.4 86.17±0.4 81.95±0.3 83.44±0.6 82.36±0.3 81.28±0.4 55.61±1.6 53.74±1.0 47.15±1.1 12.33±2.4 28.32±0.8 34.67±1.2 0.00±0.0 13.56±3.0 32.84±0.6 75.98 76.96 75.48 69.75 70.88 69.58 66.36 67.32 68.65 82.51 83.23 82.26 80.28 78.59 76.78 77.80 76.56 75.97 Table 13: GLUE results for MUX-BERTBASE using alternative multiplexing-demultiplexing strategies. We report the average accuracy over 5 seeds. Extrema and values within their standard deviation are emphasized for each value of N. Model Size N MNLI QQP QNLI MRPC WNLI STSB RTE SST2 COLA GLUE GLUE−WNLI, COLA SMALL BASE LARGE 2 5 10 2 5 10 2 5 10 61.48±0.2 58.35±0.2 53.63±0.2 63.29±0.3 60.67±0.2 59.07±0.2 64.64±0.2 60.78±0.3 48.79±0.6 80.33±0.0 77.50±0.1 77.03±0.1 81.42±0.1 79.42±0.1 78.22±0.1 82.10±0.1 78.56±0.1 68.41±0.1 60.05±0.2 57.17±0.3 51.22±0.3 60.35±0.4 59.77±0.2 57.99±0.5 60.21±0.2 60.19±0.3 55.76±0.8 68.43±0.5 68.38±0.0 68.38±0.0 68.38±0.2 69.61±0.8 68.38±0.0 69.95±0.9 69.51±0.5 68.58±0.6 56.34±0.0 56.34±0.0 57.46±6.3 56.90±5.8 53.80±7.3 60.28±3.0 56.34±0.0 56.34±0.0 58.59±3.3 15.02±0.4 11.31±0.3 12.40±1.3 17.65±1.0 14.92±1.8 11.83±0.6 21.62±0.4 17.33±1.1 8.38±1.1 51.12±0.6 51.70±1.3 52.35±2.7 51.19±1.7 52.71±0.8 53.07±1.1 52.71±0.0 52.71±0.0 54.95±0.9 79.75±0.3 77.78±0.3 50.92±0.0 80.78±0.5 81.15±0.6 78.35±1.1 80.34±0.9 78.28±0.8 64.82±1.0 8.22±0.7 6.02±0.7 0.00±0.0 9.62±1.5 10.35±1.7 7.40±1.7 8.72±2.1 10.63±2.7 3.48±3.9 53.42 51.62 47.04 54.40 53.60 52.73 55.18 53.81 47.97 59.45 57.46 52.28 60.44 59.75 58.13 61.65 59.62 52.81 Table 14: GLUE results for T-MUX with the original training recipe and implementation from Murahari et al. (2022). We report the average accuracy and standard deviation over 5 seeds. Extrema and values within their standard deviation are emphasized for each model size.
http://arxiv.org/abs/2302.12432v2
2023-07-01T03:09:13
2023-02-24T03:24:04
Graph Neural Networks with Learnable and Optimal Polynomial Bases
Polynomial filters, a kind of Graph Neural Networks, typically use a predetermined polynomial basis and learn the coefficients from the training data. It has been observed that the effectiveness of the model is highly dependent on the property of the polynomial basis. Consequently, two natural and fundamental questions arise: Can we learn a suitable polynomial basis from the training data? Can we determine the optimal polynomial basis for a given graph and node features? In this paper, we propose two spectral GNN models that provide positive answers to the questions posed above. First, inspired by Favard's Theorem, we propose the FavardGNN model, which learns a polynomial basis from the space of all possible orthonormal bases. Second, we examine the supposedly unsolvable definition of optimal polynomial basis from Wang & Zhang (2022) and propose a simple model, OptBasisGNN, which computes the optimal basis for a given graph structure and graph signal. Extensive experiments are conducted to demonstrate the effectiveness of our proposed models. Our code is available at https://github.com/yuziGuo/FarOptBasis.
[ "Yuhe Guo", "Zhewei Wei" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12432v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12432v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
3 2 0 2 l u J 1 ] G L . s c [ 2 v 2 3 4 2 1 . 2 0 3 2 : v i X r a Graph Neural Networks with Learnable and Optimal Polynomial Bases Yuhe Guo 1 Zhewei Wei 1 2 3 4 Abstract Polynomial filters, a kind of Graph Neural Net- works, typically use a predetermined polynomial basis and learn the coefficients from the training data. It has been observed that the effectiveness of the model is highly dependent on the property of the polynomial basis. Consequently, two natural and fundamental questions arise: Can we learn a suitable polynomial basis from the training data? Can we determine the optimal polynomial basis for a given graph and node features? In this paper, we propose two spectral GNN mod- els that provide positive answers to the questions posed above. First, inspired by Favard's Theo- rem, we propose the FavardGNN model, which learns a polynomial basis from the space of all possible orthonormal bases. Second, we examine the supposedly unsolvable definition of optimal polynomial basis from Wang & Zhang (2022) and propose a simple model, OptBasisGNN, which computes the optimal basis for a given graph struc- ture and graph signal. Extensive experiments are conducted to demonstrate the effectiveness of our proposed models. Our code is available at https://github.com/yuziGuo/FarOptBasis. 1. Introduction Spectral Graph Neural Networks are a type of Graph Neu- ral Networks that comprise the majority of filter-based GNNs (Shuman et al., 2013; Isufi et al., 2021; 2022). They are designed to create graph signal filters in the spectral domain. To avoid eigendecomposition, spectral GNNs ap- proximate the desired filtering operations by polynomials of laplacian eigenvalues. 1Gaoling School of Articial Intelligence, Renmin University of China 2Peng Cheng Laboratory 3Beijing Key Laboratory of Big Data Management and Analysis Methods 4MOE Key Lab of Data Engineering and Knowledge Engineering. Correspondence to: Zhewei Wei <[email protected]>. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 there are mainly As categorized in He et al. (2022), two kinds of spectral GNNs. In some works, the de- sired polynomial filters are predefined. For example, ˆL, and GCN (Kipf & Welling, 2017) fixes the filter to be I APPNP (Klicpera et al., 2019) restricts the filtering function within the Personalized Pagerank. − Another line of research approximates arbitrary filters with learnable polynomials. These models typically fix a prede- termined polynomial basis and learn the coefficients from the training data. ChebNet (Defferrard et al., 2016) uses Chebyshev basis following the tradition of Graph Signal Pro- cessing (Hammond et al., 2009). GPR-GNN (Chien et al., 2021) uses Monomial basis, which is straightforward. Bern- Net (He et al., 2021) uses the non-negative Bernstein basis for regularization and interpretation. JacobiConv (Wang & Zhang, 2022) chooses among the family of Jacobi polyno- mial bases, with the exact basis determined by two extra hyperparameters. ChebNetII (He et al., 2022) revisits the Chebyshev basis, and incorporates the power of Chebyshev interpolation by reparameterizing learnable coefficients by chebynodes. Please refer to Section 2.1 for more concrete backgrounds about polynomial filtering. However, there are still two fundamental challenges on the choice of basis. Challenge 1: It is well known and checked by ablation studies (Wang & Zhang, 2022) that the choice of basis has a significant impact on practical performance. However, the proportion of known polynomial bases is small and may not include the best-fitting basis for a given graph and signal. Therefore, we pose the following question: Can we learn a polynomial basis from the training data out of all possible orthonormal polynomials? 1 Challenge 2: On the other hand, although these bases dif- fer in empirical performances, their expressiveness should be the same: any target polynomial of order K can be rep- resented by any complete polynomial basis with truncated order K (See Figure 1 for an example). Therefore, Wang & Zhang (2022) raised a definition of optimal basis from an optimization perspective, which promises an optimal conver- gence rate. However, this basis is believed to be unsolvable using existing techniques. Consequently, a natural question 1For the concrete definition of orthonormal polynomial bases, please check the preliminaries in Section 2.2. Graph Neural Networks with Learnable and Optimal Polynomial Bases Figure 1. Representation of h(λ) = λ2 + 1 by different bases. is: can we compute this optimal basis for a given graph and signal using innovative techniques? In this paper, we provide positive answers to the questions posed above. We summarize our contributions in three folds. Firstly, we propose FavardGNN with learnable orthonor- mal basis to tackle the first challenge. The theoretical basis of FavardGNN is two Theorems in orthogonal polynomials: the Three-term recurrences and its converse, Favard's Theo- rem. FavardGNN learns from the whole space of possible orthonormal basis with 2(K+1) extra parameters. Secondly, we propose OptBasisGNN with solvable optimal basis. We solve the optimal basis raised by Wang & Zhang (2022) by avoiding the explicit solving of the weight function , which invites the need for eigendecomposition. Note that although we write out the implicitly defined/solved polynomial series in the methodology section, we never need to solve it explic- itly. Last but not least, we conduct extensive experiments to demonstrate the effectiveness of our proposed models. 2. Background and Preliminaries 2.1. Background of Spectral GNNs In this section, we provide some necessary backgrounds of spectral graph neural networks, and show how the choice of polynomial bases emerges as a problem. Notations used are summarized in Table 6 in Appendix A. − Graph Fourier Transform. Consider an undirected and connected graph G = (V, E) with N nodes, its symmetric normalized adjacency matrix and laplacian matrix are de- noted as ˆP and ˆL, respectively, ˆL = I ˆP . Graph Fourier Transform, as defined in the spatial/spectral domain of graph signal processing, is analogous to the time/frequency do- main Fourier Transform (Hammond et al., 2009; Shuman et al., 2013) . One column in the representations of N nodes, RN ×d, is considered a graph signal, denoted as x. The X complete set of N eigenvectors of ˆL, denoted as U , who show varying structural frequency characteristics (Shuman et al., 2013), are used as frequency components. Graph Fourier Transform is defined as ˆx := U Tx , where signal x is projected to the frequency responses of all compo- nents. It is then followed by modulation, which suppresses or strengthens certain frequency components, denoted as ˆx∗ := diag ˆx . After modulation, inverse ∈ θ0, { * * * , θN −1} Fourier Transform: x∗ := U ˆx∗ transforms ˆx∗ back to the spatial domain. The three operations form the process of spectral filtering: U diag U Tx (1) . θ0, θ1, . . . , θN −1} { Polynomial Approximated Filtering. In order to avoid time-consuming eigendecomposition, a line of work ap- proximate θi by some polynomial function of λi, which is the i-th eigenvalue of ˆL, i.e. θi ≈ h(λi). Equation (1) then becomes a form that is easy for fast localized calcula- U Tx = h( ˆL)x. tion: U diag h(λ0), h(λ1), . . . , h(λN −1) } { As listed in Introduction, various polynomial bases have been utilized, denoted as h(λ) = (cid:80)K k=0 αkgk(λ). For fur- ther simplicity, we equivalently use b( ˆP ) instead of h( ˆL) ˆP ). Note that b( in this paper, where b( ˆP ) := h(I ) is * defined on the spectrum of ˆP , and the i-th eigenvalue of ˆP , denoted as μi, equals 1 λi. − − → z = (cid:80)K The filtering process on the input signal x is then expressed k=0 αkgk( ˆP )x . When consider indepen- as x dent filtering on each of the d channels in X simulta- neously, the multichannel filtering can be denoted as: X k=0 αk,lgk,l( ˆP )X:,l (2). Z = (cid:80)K → ∥l∈[1,h] 2.2. Orthogonal and Orthonormal Polynomials In this section, we give a formal definition of orthogonal and orthonormal polynomials, which plays a central role in the choosing of polynomial bases (Simon, 2014). Inner Products. The inner product of polynomials is de- := (cid:82) b ⟩ f, g ⟨ fined as a f (x)g(x)w(x)dx , where f , g and w are functions of x on interval (a, b), and the weight func- tion w should be non-negative to guarantee the positive- definiteness of inner-product space. The definition of the inner products induces the definitions of norm and orthogonality. The norm of polynomial f is f ∥ defined as: = f, f , and f and g are orthogonal ∥ ⟩ to each other when = 0 . Notice that the concept of inner product, norm, and orthogonality are all defined with respect to some weight function. ⟩ (cid:112) ⟨ f, g ⟨ Orthogonal Polynomials. A sequence of polynomi- ∞ als is n=0 where pn(x) is of exact degree n, } called orthogonal w.r.t. the positive weight function pn(x) { 2 k=0k=1k=2Representationofh()=2+1MonomialBasisM0()=1M1()=M2()=2h()=M0+M2()ChebyshevBasisT0()=1T1()=T2()=2¡1h()=2T0()+T2()BernsternBasisBk;2()=2kk(1¡)2¡k(k=0;1;2)h()=B0;2()+B1;2()+2B2;2()JacobiBasis( = =1)P0( ; )()=1P1( ; )()=2P2( ; )()=338+154+1582h()=¡1815P0( ; )¡P1( ; )+815P2( ; ) Graph Neural Networks with Learnable and Optimal Polynomial Bases Algorithm 1: FAVARDFILTERING Input: Input signals X with d channels; Normalized graph adjacency ˆP ; Truncated polynomial order K 3 0 Learnable Parameters :β, γ, α Output: Filtered Signals Z 1 x−1 ← 2 for l = 0 to d 1 do − X:,l , x0 ← x ← for k = 0 to K do xk+1 ← ( ˆP xk − z ← z Z:,l ← 7 8 return Z γk,lxk − z + αk+1,lxk+1 x/(cid:112)β0,l , z 6 5 4 α0,lx0 ← (cid:112)βk,lxk−1)/(cid:112)βk+1,l 2 ∥ = is , * * * pn∥ , there exists = 0), where the inner product w(x) if, for m, n = 0, 1, 2, 2( pn∥ pn∥ δmn∥ ∥ defined w.r.t. w(x). When pn(x) pn, pm⟩ ⟨ f, g ⟩ ⟨ 2 = 1 for n = 0, 1, 2, * * * ∞ n=0 is known as orthonormal polynomial series. } { When a weight function is given, the orthogonal or orthonor- mal series with respect to the weight function can be solved by Gram-Schmidt process. Remark 2.1. In this paper, the orthogonal/orthonormal poly- nomial bases we consider are truncated polynomial series, i.e. the polynomials that form a basis are of increasing order. 3. Learnable Basis via Favard's Theorem Empirically, spectral GNNs with different polynomial bases vary in performance on different datasets, which leads to two observations: (1) the choice of bases matters; (2) whether a basis is preferred might be related to the input, i.e. different signals on their accompanying underlying graphs. For the first observation, we notice that up to now, polyno- mial filters pick polynomial bases from well-studied polyno- mials, e.g. Chebyshev polynomials, Bernstein polynomials, etc, which narrows down the range of choice. For the sec- ond observation, we question the reasonableness of fixing a basis during training. A related effort is made by Jacobi- Conv (Wang et al., 2019), who adapt to a Jacobi polynomial series from the family of Jacobi polynomials via hyperpa- rameter tuning. However, the range they choose from is discrete. Therefore, we aim at dynamically learn polyno- mial basis from the input from a vast range. 3.1. Recurrence Formula for Orthonormal Bases Luckily, the Three-term recurrences and Favard's theorem of orthonormal polynomials provide a continuous param- eter space to learn basis. Generally speaking, three-term 3 Algorithm 2: FAVARDGNN (For Classification) Input: Raw features Xraw; Normalized graph adjacency ˆP ; Truncated polynomial order K Learnable Parameters :W0, b0, W1, b1, β, γ, α Output: Label predictions ˆY 1 2 3 X Z ˆY XrawW0 + b0 FAVARDFILTERING(X, ˆP , K, β, γ, α) Softmax(ZW1 + b1) ← ← ← recurrences states that every orthonormal polynomial series satisfies a very characteristic form of recurrence relation, and Favard's theorem states the converse. Theorem 3.1 (Three Term Recurrences for Orthonormal Polynomials). (Gautschi, 2004, p. 12) For orthonormal ∞ polynomials k=0 w.r.t. weight function w, suppose that the leading coefficients of all polynomials are positive, there exists the three-term recurrence relation: pk} { (cid:112)βk+1 pk+1(x) = (x γk)pk(x) − − √βk pk−1(x), p−1(x) := 0, p0(x) = 1/ βk ∈ γk ∈ R+, k R, (cid:112) ≥ (cid:112) β0, 0 (3) with β0 = (cid:82) w(x)dx. Theorem 3.2 (Favard's Theorem; Orthonormal Case). (Favard, 1935), (Simon, 2005, p. 14) A polynomial se- ∞ k=0 who satisfies the recurrence relation in Equa- ries pk} { tion (3) is orthonormal w.r.t. a weight function w that β0 = (cid:82) w(x)dx. By Theorem 3.2, any possible recurrences with the form (3) defines an orthonormal basis. By Theorem 3.1, such a formula covers the whole space of orthonormal polynomials. √βk} If we set to be learnable parameters with { √βk > 0(k 0), any orthonormal basis can be obtained. ≥ γk} { and We put the more general orthogonal form of Theorem 3.1 and Theorem 3.2 in Appendix B.1 to B.5. In fact, the prop- erty of three-term recurrences for orthogonal polynomials has been used multiple times in the context of current spec- tral GNNs to reuse gk( ˆP )x and gk−1( ˆP )x for the calcula- tion of gk+1( ˆP )x. Defferrard et al. (2016) owe the fast filter- ing of ChebNet to employing the three-term recurrences of Chebyshev polynomials (the first kind, which is orthogonal w.r.t. Tk−1(x). Similarly, JacobiConv (Wang & Zhang, 2022) employs the three-term recurrences for Jacobi polynomials (orthogonal w.r.t. to x)a(1 + x)b). In this paper, however, we focus on (1 orthonormal bases because they minimize the mutual influ- ence of basis polynomials and the influence of the unequal norms of different basis polynomials. ): Tk+1(x) = 2xTk(x) x2−1 1√ − − ̸ Graph Neural Networks with Learnable and Optimal Polynomial Bases 3.2. FavardGNN Formulation of FavardGNN. We formally write the ar- chitecture of FAVARDGNN (Algorithm 2), with the filtering process illustrated in FAVARDFILTERING (Algorithm 1). Note that the iterative process of Algorithm 1 (lines 3-5) follows exactly from Equation (3) in Favard's Theorem. The key insight is to treat the coefficients β, γ, α in Equa- tion (3) as learnable parameters. Since Theorem 3.1 and Theorem 3.2 state that the orthonormal basis must satisfy the employed iteration and vice versa, it follows that the model can learn a suitable orthonormal polynomial basis from among all possible orthonormal bases. Following convention, before FAVARDFILTERING, an MLP is used to map the raw features onto the signal channels (often much less than the dimension of raw features). In regression problems, the filtered signals are directly used as predictions; for classification problems, they are combined by another MLP followed by a softmax layer. Parallel Execution. Note that for convenience of presen- tation, we write the FAVARDFILTERING Algorithm in a form of nested loops. In fact, the computation on different channels (the inner loop k) is conducted simultaneously. We put more concrete implementation in PyTorch-styled the pseudocode in Appendix C.1. 3.3. Weaknesses of FavardGNN there are still However, two main weaknesses of FavardGNN. Firstly, the orthogonality lacks interpretability. The weight function w can only be solved analytically in a number of cases (Geronimo & Van Assche, 1991). Even if the weight function is solved, the form of w might be too complicated to understand. Secondly, FAVARDFILTERING is not good in convergence properties: consider a simplified optimization problem 2 F which has been examined in the context min ∥ of GNN (Xu et al., 2021; Wang & Zhang, 2022), even this problem is non-convex w.r.t the learnable parameters in Z. We will re-examine this problem in the experiment section. Z ∥ − Y 4. Achieving Optimal Basis Although FavardGNN potentially reaches the whole space of orthonormal polynomial series, on the other hand, we still want to know: whether there is an optimal and accessible basis in this vast space. this optimal basis to our polynomial filter with O(K time complexity. | E ) | Wang & Zhang (2022) make an essential step towards this question: they derive and define an optimal basis from the angle of optimization. However, they do not exhaust their own finding in their model, since based on a habitual process, they believe that the optimal basis they find is inaccessible. In this section, we show how we can exactly apply this ) time optimal basis to our polynomial filter in O(K | complexity. E | 4.1. A Review: A Definition for Optimal Basis We start this section with a quick review of the related part from Wang & Zhang (2022), with a more complete review put in Appendix E. z y Y − − 2 ∥ 2 ∥ k=0 αkgk( ˆP )x. Definition of Optimal Basis. Wang & Zhang (2022) considers the squared loss R = 1 2 F, where Y is Z ∥ the target signal. Since each signal channel contributes independently to the loss, the authors then consider the loss function channelwisely and ignore the index l, that is, r = 1 F, where z = (cid:80)K 2 ∥ K The task at hand is to seek a polynomial series k=0 which is optimal for the convergence of coefficients α. Since r is convex w.r.t. α, the gradient descent's convergence rate reaches optimal when the Hessian matrix is identity. The [0, K]) of the Hessian matrix is: (k1, k2) element (k1, k2 ∈ ∂2r ∂αk1∂αk2 = xTgk2( ˆP )gk1 ( ˆP )x. Hk1k2 = gk} { (4) Definition 4.1 (Optimal basis for signal x). For a K k=0 is given graph signal x, polynomial basis optimal in convergence rate when H given in (4) is an identity matrix. gk} { Wang & Zhang (2022) further reveal the orthonormality inherent in the optimal basis by rephrasing Equation (4) into Hk1k2 = (cid:82) 1 μ=−1 gk1(μ)gk2(μ)f (μ)dμ, where the form of f is given in Proposition 4.2 and and derivation is delayed in Appendix E. Combining Definition 4.1, we soonly get: Proposition 4.2 (Exact weight function of optimal basis). The optimal polynomial basis in Definition 4.1 is orthonormal w.r.t. weight function f , where f (μ) = △F (μ) △μ , with F (μ) := (cid:80) μi≤μ(U Tx)2 i . Recently, Wang & Zhang (2022) raises a criterion for opti- mal basis. Since different bases are the same in expressive- ness, this criterion is induced from an angle of optimization. However, Wang & Zhang (2022) believe that this optimal basis is unreachable. In this section, we follow this defini- tion of optimal basis, and show how we can exactly apply Unachievable Algorithm Towards Optimal Basis. Now we illustrate why Wang & Zhang (2022) believe that though properly defined, this optimal basis is unachievable, and how they took a step back to get their final model. We sum- marize the process they thought of in Algorithm 3. This process is quite habitual: with the weight function in Propo- 4 Graph Neural Networks with Learnable and Optimal Polynomial Bases Algorithm 3: (An Unreachable Algorithm for Utilizing Optimal Basis) Input: Graph signal x; Normalized graph adjacency ˆP ; Truncated polynomial order K Output: Optimal basis μi} { N i=1 ← gk( * { K ) k=0 } Eigendecomposition of ˆP U, Calculate f (μ) as descripted in Proposition 4.2 Use Gram-Schmidt process and weight function f (μ) to contruct an orthonormal basis K k=0 in polynomial filtering Apply gk} { K k=0 gk} { 1 2 3 4 sition 4.2 solved, it is natural to use it to determine the first K polynomials by the Gram-Schmidt process and then use the solved polynomials in filtering as other bases, e.g. Chebyshev polynomials. This process is unreachable due to the eigendecomposition step, which is essential for the calculation of f (see Proposition 4.2), but prohibitively ex- pensive for larger graphs. As a result, Wang & Zhang (2022) came up with a com- promise. They allow their model, namely JacoviConv, to choose from the family of orthogonal Jacobi bases, who μ)a(1 + have "flexible enough weight functions", i.e., (1 μ)b ( (0, 1)). In their implementation, a and b are ∀ discretized and chosen via hyperparameter tuning. Obvi- ously, the fraction of possible weight functions JacoviConv can cover is still small, very possibly missing the optimal weight function in Proposition 4.2. a, b − ∈ 4.2. OptBasisGNN | | E In this section, we show how the polynomial filter can em- ploy the optimal basis in Definition 4.1 efficiently via an ) methodology. Our method does not innovative O(K follow the convention in Algorithm 3 where four progressive steps are included to solve the optimal polynomial bases out and utilize them. Instead, our solution to the optimal bases is implicit, accompanying the process of solving a related vector series. Thus, our method bypasses the untractable eigendecomposition step. z = (cid:80)K Optimal Vector Basis with Accompanying Polynomials. Still, we consider graph signal filtering on one channel, k=0 αkgk( ˆP )x. Instead of taking the that is, x matrix polynomial b( ˆP ) = (cid:80)K k=0 αkgk( ˆP ) as a whole, we vk := gk( ˆP )x K k=0 as a vector basis. Then now regard vk| } the filtered signal z is a linear combination of the vector → { z = (cid:80)K basis, namely x → meets Definition 4.1, for all k1, k2 ∈ satisfies: k=0 αkvk (5) . When K k=0 [0, K], the vector basis gk} { Algorithm 4: OPTBASISFILTERING 1. In the comment, we write the implicitly undergoing process of obtaining the accompanying optimal polynomial basis. 2. Steps 1-3 will be further substituted by Algorithm 5 after the derivative of Proposition 4.4. Input: Input signals X with d channels; Normalized graph adjacency ˆP ; Order K Learnable Parameters :α Output: Filtered signals Z 6 4 5 3 ; − 1 do 1 for l = 0 to d X:,l x 2 ← x/ x v0 ← ∥ ∥ α0,lv0 z ← for k = 0 to K do Step 1: v∗ Step 2: v⊥ // g⊥ k+1 ← k+1 ← k+1(μ) := g∗ Step 3: vk+1 ← // gk+1(μ) := g⊥ z ← z Z:,l ← 10 11 return Z 9 8 7 // g0(μ) = 1/ x ∥ ∥ (cid:80)k ˆP vk ; v∗ k+1 − k+1(μ) v⊥ k+1/ (cid:80) ∥ v⊥ k+1(μ)/ k+1∥ ∥ z + αk+1,lvk+1 − k i=0⟨ v⊥ k+1∥ // g∗ k+1(μ) := μgk(μ) v∗ k+1, vi⟩ i=0⟨ v∗ k+1, vi⟩ ; vi ; gi(μ) Given ( ˆP , x), we term gk the accompanying polynomial of a vector vk if vk = gk( ˆP )x. Note that an accompanying polynomial does not always exists for any vector. Follow- ing Equation (6), finding the optimal polynomial basis for K filtering is equivalent to finding a vector basis k=0 that satisfies two conditions: Condition 1: Orthonormal- ity; Condition 2: Accompanied by the optimal polynomial gk( ˆP )x establishes for each k, where basis, that is, vk ≡ gk follows Definition 4.1. We term such the optimal vector basis. vk} { vk} { When focusing solely on Condition 1, one can readily think of the fundamental Gram-Schmidt process, which generates a sequence of orthonormal vectors through a series of iter- ative steps: each subsequent basis vector is derived by 1) orthogonalization with respect to all the previously obtained vectors, and 2) normalization. Moreover, with a slight generalization, Condition 2 can also be met. As illustrated in our OPTBASISFILTERING algorithm (Algorithm 11), besides Steps 2-3 taken directly from the Gram-Schmidt process to ensure orthonormality, there is an additional Step 1 that guarantees the existence of the subsequent accompanying polynomial. To show this, we can write out the accompanying polynomial in each step. Inductively, assuming that the accompanying polynomials for the formerly obtained basis vectors are g0, , gk, we can observe immediately from the algorithmic flow that the * * * k2vk1 = xTgk2 ( ˆP )gk1( ˆP )x = δk1k2. vT (6) 5 Graph Neural Networks with Learnable and Optimal Polynomial Bases Algorithm 5: OBTAINNEXTBASISVECTOR Input: Normalized graph adjacency ˆP ; Two solved channels are conducted in parallel. Please check the Pytorch- style pseudo-code in Appendix C.2. basis vectors vk−1, vk (k 0) ≥ ˆP vk k+1 ← Output: vk+1 Step 1: v∗ Step 2: v⊥ k+1 ← Step 3: vk+1 ← return vk+1 1 2 3 4 v∗ v∗ k+1, vk⟩ k+1 − ⟨ v⊥ v⊥ k+1/ k+1∥ ∥ vk − ⟨ 4.3. More on the Implicitly Solved Polynomial Basis This section is a more in-depth discussion about the nature of our method, that is, we implicitly determine the optimal polynomials by three-term recurrence relations rather than the weight function. v∗ k+1, vk−1⟩ vk−1 (k + 1)-th accompanying polynomial is gk+1(μ) := (cid:0)μgk(μ) − k (cid:88) v∗ k, vi⟩ ⟨ i=0 gi(μ)(cid:1)/ ∥ v⊥ , k+1∥ (7) ∥ * * * x ∥ as the initial step. Since for each with g0(μ) = 1/ (k1, k2), xTgk2 ( ˆP )gk1( ˆP )x = vT k1 vk2 = δk1k2 establishes, the sequence g0, , gK is exactly the optimal basis in Defi- nition 4.1. Thus, by solving the vectors in the optimal vector basis in order and at the same time apply them in filtering by Equation (5), we can make implicit yet exact use of the optimal polynomial basis. Thus, we can make implicit and exact use of the optimal polynomial basis via solving the optimal vector basis and applying them by Equation (5). The cost, due to the recursive conducting over Step 2 until vK is obtained, is in total O(K Remark 4.3. It is revealed by Equation (7) that we have in fact provided an alternative solution to the optimal basis. However, notice that we never need to explicitly compute the polynomial series. + K 2 E | ). | V | | V | +K | ) Time Complexity. We can Achieving O(K E | ) by Proposi- further reduce the cost to O(K V | | tion 4.4, which shows that in Step 2, instead of subtracting all the former vectors, we just need to subtract vk and vk−1 from v∗ + K E | | | k+1. Proposition 4.4. In Algorithm 11, v∗ pendent with vk and vk−1. k+1 is only den- Proof. Please check Appendix B.6. Remark 4.5. The proof is hugely inspired by the core proof part of the Theorem B.1 (Appendix B.1, the three-term recurrences theorem for orthogonal polynomials), which shows that xpk(x)is only relevant to pk+1(x), pk(x) and pk−1(x). The difference is just a shift of consideration of the inner-product space from polynomials to vectors. By Proposition 4.4, we substitute Steps 1-3 in Algorithm 11 by Algorithm 5. Note that we define v−1 := ⃗0, g−1(μ) := 0 for consistency and simplicity of presentation. The im- proved OPTBASISFILTERING algorithm serves as the core part of the complete OptBasisGNN. The processes on all We begin with a lemma. The proof can be found in Ap- pendix B.7. Lemma 4.6. In Algorithm 5, v∗ k+1, vk−1⟩ ⟨ This lemma soonly leads to the following theorem.2 v⊥ k ∥ = ∥ . Theorem 4.7 (Three-term Recurrences of Accom- panying Polynomials (Informal)). The process for deriving the vector basis correspondingly defines the optimal polynomial basis through the following three-term relation: v⊥ k+1∥ ∥ gk+1(μ) = (μ − ⟨ − ∥ g−1(μ) := 0, g0(μ) = 1/ ∥ , K k = 0, 1. * * * − )gk(μ) gk−1(μ), v∗ k+1, vk⟩ v⊥ k ∥ x , ∥ Proof. Combining Proposition 4.4, the accompanyingly de- rived basis polynomial in Equation (7) comes to v⊥ k+1∥ ∥ gk+1(μ) = μgk(μ) k (cid:88) − i=k−1 v∗ k+1, vi⟩ ⟨ gk(μ). By employing Lemma 4.6 on the right-hand side and staking the steps, the proof is completed. v⊥ k ∥ ∥ v∗ k+1, vk⟩ ⟨ This implicit recurring relation revealed in Theorem 4.7 perfectly matches the three-term formula in Equation (3) by √βk, and by γk. This if we substitute is guaranteed by the orthonormality of the optimal basis (Proposition 4.2) and the three-term recurrence formula that constrains any orthonormal polynomial series (Theo- rem 3.2). From this perspective, OptBasisGNN is a particu- lar case of FavardGNN. FavardGNN is possible to reach the whole space of orthonormal bases, among which OptBasis- GNN employs the ones that promise optimal convergence property. Let us recall the Favard's theorem (Theorem 3.1) and three- term recurrence theorem (Theorem 3.2) from a different per- spective: An orthonormal polynomial series can be defined either through a weight function or a recurrence relation of a specific formula. We adopt the latter definition, bypassing 2Here, x is the input signal. 6 Graph Neural Networks with Learnable and Optimal Polynomial Bases the need for eigendecomposition as a prerequisite for the weight function. Moreover, our adoption of such a way of definition is hidden behind the calculation of vector basis. Algorithm 6: OPTBASISFILTERING Input: Input signals X with d channels; Normalized graph adjacency ˆP ; Order K 0 Learnable Parameters :α Output: Filtered signals Z 1 v−1 ← 2 for l = 0 to d 1 do − X:,l , v0 ← x 3 ← for k = 0 to K do vk+1 ← vk−1) z ← z Z:,l ← 7 8 return Z x ∥ x/ 4 5 6 z + αk+1,lvk+1 , z α0,lv0 ∥ ← OBTAINNEXTBASISVECTOR( ˆP ,vk, 4.4. Scale Up OptBasisGNN By slightly generalizing OptBasisGNN, it becomes feasible to scale it up for significantly larger graphs, such as ogbn- papers100M(Hu et al., 2020). This follows the approach of previous works that achieve scalability in GNNs by de- coupling feature propagation from transformation (Chen et al., 2020a; Wu et al., 2019; He et al., 2022). We make several modifications to OptBasisGNN. First, we remove the MLP layer before OPTBASISFILTERING, resulting in the optimal basis vectors for all channels being computed in just one pass. Second, we preprocess the entire set of Rd×(K+1)×N ) on CPU. Third, we adopt basis vectors (V , the corre- batch training, where for each batch of nodes sponding segment of basis vectors V [:, :, ] is transferred to the GPU. ∈ B B 5. Experiments In this section, we conduct a series of comprehensive ex- periments to demonstrate the effectiveness of the proposed methods. Experiments consist of node classification tasks on small and large graphs, the learning of multi-channel filters, and a comparison of FavardGNN and OptBasisGNN. 5.1. Node Classification Experimental Setup. We include medium-sized graph datasets conventionally used in preceding graph filtering works, including three heterophilic datasets (Chameleon, Squirrel, Actor) provided by Pei et al. (2020) and two ci- tation datasets (PubMed, Citeseer) provided by Yang et al. (2016) and Sen et al. (2008) . For all these graphs, we take 7 a 60%/20%/20% train/validation/test split proportion fol- lowing former works, e.g. Chien et al. (2021). We report our results of twenty runs over random splits with random initialization seeds. For baselines, we choose sota spec- tral GNNs. For other experimental settings, please refer to Appendix D.1. Besides, for evaluation of OptBasisGNN, please also check the results in the scalability experimental section (Section 5.2). Results. As shown in Table 1, FavardGNN and OptBa- sisGNN outperform most strong baselines. Especially, in Chameleon, Squirrel and Actor, we see a big lift. The vast selection range and learnable nature of FavardGNN and the optimality of convergence provided by OptBasisGNN both enhance the performance of polynomial filters, and their performances hold flat. 5.2. Node Classification on Large Datasets Experimental Setup. We perform node classification tasks on two large citation networks: ogbn-arxiv and ogbn- papers100M (Hu et al., 2020), and five large non-homophilic networks from the LINKX datasets (Lim et al., 2021) . Ex- cept for Penn94, Genius and Twitch-Gamers, all other men- tioned datasets use the scaled version of OptBasisGNN. For ogbn datasets, we run repeating experiments on the given split with ten random model seeds, and choose base- lines following the scalability experiments in ChebNetII (He et al., 2022). For LINKX datasets, we use the five given splits to align with other reported experiment results for Penn94, Genius, Twitch-Gamer and Pokec. For Wiki dataset, since the splits are not provided, we use five random splits. For baselines, we choose spectral GNNs as well as top-performing spatial models reported by Lim et al. (2021), including LINK, LINKX, GCNII (Chen et al., 2020b) and MixHop (Abu-El-Haija et al., 2019). For more detailed experimental settings, please refer to Appendix D.1. Results. As shown in Table 2 and Table 3, On Penn94, Genius and Twitch-gamer, our two models achieve compa- rable results to those of the state-of-the-art spectral methods. On ogbn datasets as well as Pokec and Wiki with tens or hundreds of millions of edges, we use the scaled version of OptBasisGNN with batch training. We do not conduct FavardGNN on these datasets, since the basis vectors of FavardGNN cannot be precomputed. Notably, on Wiki dataset, the largest non-homophilous dataset, our method surpasses the second top method by nearly one percent, this demonstrates the effectiveness of our scaled-up version of OptBasisGNN. 5.3. Learning Multi-Channel Filters from Signals Experimental Setup. We extend the experiment of learn- ing filters conducted by He et al. (2021) and Balcilar et al. Graph Neural Networks with Learnable and Optimal Polynomial Bases Table 1. Experimental results. Accuracies ± 95% confidence intervals are displayed for each model on each dataset. The best-performing two results are highlighted. The results of GPRGNN are taken from He et al. (2021). The results of BernNet, ChebNetII and JacobiConv are taken from original papers. The results of FavardGNN and OptBasisGNN are the average of repeating experiments over 20 cross-validation splits. Dataset V ∥ (G) ∥ H MLP GCN (Kipf & Welling, 2017) ChebNet (Defferrard et al., 2016) ARMA (Bianchi et al., 2021) APPNP (Klicpera et al., 2019) GPR-GNN (Chien et al., 2021) BernNet (He et al., 2021) ChebNetII (He et al., 2022) JacobiConv (Wang & Zhang, 2022) FavardGNN OptBasisGNN Chameleon 2,277 .23 Squirrel 5,201 .22 46.59 60.81 59.51 60.21 52.15 67.49 68.53 71.37 74.20 72.32 74.26 1.84 2.95 1.25 1.00 1.79 1.38 1.68 1.01 1.03 1.90 0.74 ± ± ± ± ± ± ± ± ± ± ± 31.01 45.87 40.81 36.27 35.71 50.43 51.39 57.72 57.38 63.49 63.62 1.18 0.8 0.42 0.62 0.78 1.89 0.92 0.59 1.25 1.47 0.76 ± ± ± ± ± ± ± ± ± ± ± Actor 7,600 .22 40.18 33.26 37.42 37.67 39.76 39.91 41.71 41.75 41.17 43.05 42.39 0.55 1.15 0.58 0.54 0.49 0.62 1.12 1.07 0.64 0.53 0.52 ± ± ± ± ± ± ± ± ± ± ± Citeseer 3,327 .74 76.52 79.85 79.33 80.04 80.47 80.13 80.08 80.53 80.78 81.89 80.58 0.89 0.78 0.57 0.55 0.73 0.84 0.75 0.79 0.79 0.63 0.82 ± ± ± ± ± ± ± ± ± ± ± Pubmed 19,717 .80 86.14 86.79 87.82 86.93 88.13 88.46 88.51 88.93 89.62 90.90 90.30 0.25 0.31 0.24 0.24 0.33 0.31 0.39 0.29 0.41 0.27 0.19 ± ± ± ± ± ± ± ± ± ± ± Table 2. Experimental results of large-scale datasets (non-homophilous). Accuracies ± standard errors are displayed for each model on each dataset. The best-performing two results are highlighted. Results of BernNet and ChebNet are taken from He et al. (2022). Other results are from Lim et al. (2021). Note that for the large Pokec and Wiki datasets, we use the scaled-up version of OptBasisGNN, which is introduced in Section 4.4. Dataset V ∥ E ∥ (G) ∥ ∥ H MLP GCN (Kipf & Welling, 2017) GCNII (Chen et al., 2020b) MixHop (Abu-El-Haija et al., 2019) LINK (Lim et al., 2021) LINKX (Lim et al., 2021) GPR-GNN (Chien et al., 2021) BernNet (He et al., 2021) ChebNetII (He et al., 2022) FavardGNN OptBasisGNN Penn94 41,554 1,362,229 .470 73.61 82.47 82.92 83.47 80.79 84.71 83.54 83.26 84.86 84.92 84.85 0.40 0.27 0.59 0.71 0.49 0.52 0.32 0.29 0.33 0.41 0.39 ± ± ± ± ± ± ± ± ± ± ± Genius 421,961 984,979 .618 86.68 87.42 90.24 90.58 73.56 90.77 90.15 90.47 90.85 90.29 90.83 0.09 0.31 0.09 0.16 0.14 0.27 0.30 0.33 0.32 0.14 0.11 ± ± ± ± ± ± ± ± ± ± ± Twitch-Gamers 168,114 6,797,557 .545 60.92 62.18 63.39 65.64 64.85 66.06 62.59 64.27 65.03 64.26 65.17 0.07 0.26 0.61 0.27 0.21 0.19 0.38 0.31 0.27 0.12 0.16 ± ± ± ± ± ± ± ± ± ± ± Pokec 1,632,803 30,622,564 .445 62.37 75.45 78.94 81.07 80.54 82.04 80.74 81.67 82.33 - 82.83 0.02 0.17 0.11 0.16 0.03 0.07 0.22 0.17 0.28 0.04 ± ± ± ± ± ± ± ± ± ± Wiki 1,925,342 303,434,860 .389 37.38 OOM OOM 49.15 57.11 59.80 58.73 59.02 60.95 - 61.85 0.21 0.26 0.26 0.41 0.34 0.29 0.39 0.03 ± ± ± ± ± ± ± ± (2021). The differences are twofold: First, we consider the case of multi-channel input signals and learn filters chan- nelwisely. Second, the only learnable parameters are the coefficients α. Note that the optimization target of this ex- periment is identical to how the optimal basis was derived by Wang & Zhang (2022) (See Section 4.1). We put the practical background of our multichannel ex- 100 image is periment in YCbCr color space. Each 100 considered as a grid graph with input node signals on three channels: Y, Cb and Cr. Each signal might be filtered by complex filtering operations defined in (He et al., 2021). As shown in Table 4, using different filters on each channel re- sults in different combination effects. We create a synthetic dataset with 60 samples from 15 original images. More about the synthetic dataset are in Appendix D.2. × Following He et al. (2021), we use input signals X and the true filtered signals Y to supervise the learning process of α. The optimization goal is to minimize 1 2 2, where ∥ Z is the output multi-channel signal defined in Equation (2). During training, we use an Adam optimizer with a learning rate of 0.1 and a weight decay of 5e 4. We allow a maxi- mum of 500 epochs, and stop iteration when the difference 2 ∥ − − Z Y of losses between two epochs is less than 1e 4. − For baselines, we choose the Monomial basis, Bernstein basis, Chebyshev basis (with Chebyshev interpolation) cor- responding to GPR-GNN, BernNet and ChebNetII, respec- tively. We also include arbitrary orthonormal basis learned by Favard for comparison. Note that, we learn different filters on each channel for all baseline basis for fairness. Results. We exhibit the mean MSE losses with standard er- rors of the 60 samples achieved by different bases in Table 5. Optbasis, which promises the best convergence property, demonstrates an overwhelming advantage. A special note is needed that, the Monomial basis has not finished converging at the maximum allowed 500th epoch. In Section 5.4, we extend the maximum allowed epochs to 10,000, and use the slowly-converging Monomial basis curve as a counterpoint to the non-converging Favard curve. Particularly, in Figure 2, we visualize the converging pro- cess on one sample. Obviously, OptBasis show best con- vergence property in terms of both the fastest speed and smallest MSE error. Check Appendix D.2 for more samples. 8 Graph Neural Networks with Learnable and Optimal Polynomial Bases Table 3. Experimental results of large-scale datasets (ogbn- citation datasets). Accuracies ± 95% standard errors are dis- played. Besides OptBasisGNN, all the reported results are taken from ChebNetII. The dash line in BernNet means failing in prepro- cessing basis vectors in 24 hrs. Fixed splits of train/validation/test sets are used. 10 random model seeds are used for repeating exper- iments. Dataset V ∥ E ∥ (G) ∥ ∥ H GCN (Kipf & Welling, 2017) ChebNet (Defferrard et al., 2016) ARMA (Bianchi et al., 2021) GPR-GNN (Chien et al., 2021) BernNet (He et al., 2021) SIGN (Frasca et al., 2020) GBP (Chen et al., 2020a) NDLS* (Zhang et al., 2021) ChebNetII (He et al., 2022) OptBasisGNN ogbn-arxiv 169,343 1,166,243 0.66 ogbn-papers100M 111,059,956 1,615,685,872 - 71.74 71.12 71.47 71.78 71.96 71.95 71.21 72.24 72.32 72.27 ± ± ± ± ± ± ± ± ± ± 0.29 0.22 0.25 0.18 0.27 0.12 0.17 0.21 0.23 OOM OOM OOM 65.89 − 65.68 65.23 65.61 67.18 0.35 ± 0.16 0.31 0.29 0.32 ± ± ± ± 0.15 67.22 0.15 ± Table 4. Illustration of our multichannel filter learning experiment. Original Image Y: Band Reject Cb: :Low pass Cr: High Pass Y: Low Pass Cb: Band Reject Cr: Band Reject 5.4. Non-Convergence of FavardGNN Notably, in Figure 2, an obvious bump appeared near the 130th epoch. We now re-examine the non-convergence problem of FavardGNN (Section 3.3). We rerun the multi- channel filter learning task by canceling early stopping and stretching the epoch number to 10,000. As shown in Fig- ure 3 (left), the curve of Favard bump several times. In contrast with Favard is the Monomial basis, though showing an inferior performance in Table 5, it converges slowly but stably. We observe a similar phenomenon with a node clas- sification setup in Figure 3 (right) (See Appendix D.3 for details). Still, very large bumps appear. Such a phenomenon might seem contradictory to the outstanding performance of FavardGNN in node classification tasks. We owe the good performances in Table 1 and 2 to the early stop mechanism. 6. Conclusion In this paper, we tackle the fundamental challenges of basis learning and computation in polynomial filters. We propose two models: FavardGNN and OptBasisGNN. FavardGNN Table 5. Experimental results of the multichannel filtering learning task. MSE loss ± standard errors of the 60 samples achieved by different bases are exhibited. OptBasis ChebII Monomial Bernstein BASIS Favard MSE 0.0058 0.1501 0.4231 0.3175 3.9076 STDV ± ± 0.0157 ± 0.2433 ± 0.4918 0.2840 ± ± 2.9263 9 2 ∥Z − Y ∥2 Figure 2. Convergence rate of minimizing 1 2 on one sample. Sample message: The true filters for this sample are low-pass(Y) / band-reject(Cb) / band-reject(Cr). Legends: ChebII means using Chebyshev polynomials combined with interpolation on chebynodes as in ChebNetII (He et al., 2022). Favard means the bases are learned as FavardGNN. In 500 epochs, the experimental groups of the Monomial basis and Bernstein basis did not converge. OptBasis achieves the smallest MSE error in the shortest time. Figure 3. Drop of loss in 10,000 epochs. Left: MSE loss of re- gression task on one sample. Right: Cross entropy loss of clas- sification problem on the Chameleon dataset. Models based on Monomial basis converge slowly, but stably. while FavardGNNs don't converge. For the convergence curve for OptBasis, please check Figure 2. It converges much faster than Monomial Basis. learns arbitrary basis from the whole space of orthonor- mal polynomials, which is rooted in classical theorems in orthonormal polynomials. OptBasisGNN leverages the op- timal basis defined by Wang & Zhang (2022) efficiently, which was thought unsolvable. Extensive experiments are conducted to demonstrate the effectiveness of our proposed models. An interesting future direction is to derive a convex and easier-to-optimize algorithm for FavardGNN. Acknowledgements This research was supported in part by the major key project of PCL (PCL2021A12), by National Natural Science Foun- dation of China (No. U2241212, No. 61972401, No. 61932001, No. 61832017), by Beijing Natural Science Foundation (No. 4222028), by Beijing Outstanding Young Scientist Program No.BJJWZYJH012019100020098, by Alibaba Group through Alibaba Innovative Research Pro- gram, and by Huawei-Renmin University joint program on Information Retrieval. We also wish to acknowledge the support provided by Engineering Research Center of Next-Generation Intelligent Search and Recommendation, 6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(&RQYHUJHQFHUDWH0RQRPLDO%HUQVWHLQ&KHE,,2SW%DVLV)DYDUG6WHS06(/RVV0RQRPLDO)DYDUG6WHS&URVV(QWURS\/RVV0RQRPLDO)DYDUG Graph Neural Networks with Learnable and Optimal Polynomial Bases Ministry of Education. Additionally, we acknowledge the support from Intelligent Social Governance Interdisciplinary Platform, Major Innovation & Planning Interdisciplinary Platform for the "Double-First Class" Initiative, Public Pol- icy and Decision-making Research Lab, Public Computing Cloud, Renmin University of China. Chien, E., Peng, J., Li, P., and Milenkovic, O. Adaptive universal generalized pagerank graph neural network. In 9th International Conference on Learning Representa- tions, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. URL https://openreview. net/forum?id=n6jl7fLxrP. References Abu-El-Haija, S., Perozzi, B., Kapoor, A., Alipourfard, N., Lerman, K., Harutyunyan, H., Steeg, G. V., and Gal- styan, A. Mixhop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceed- ings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 21–29. PMLR, 2019. URL http://proceedings.mlr.press/v97/abu- el-haija19a.html. Akiba, T., Sano, S., Yanase, T., Ohta, T., and Koyama, M. Optuna: A next-generation hyperparameter optimization framework. In Teredesai, A., Kumar, V., Li, Y., Rosales, R., Terzi, E., and Karypis, G. (eds.), Proceedings of the 25th ACM SIGKDD International Conference on Knowl- edge Discovery & Data Mining, KDD 2019, Anchor- age, AK, USA, August 4-8, 2019, pp. 2623–2631. ACM, 2019. doi: 10.1145/3292500.3330701. URL https: //doi.org/10.1145/3292500.3330701. Balcilar, M., Renton, G., H ́eroux, P., Ga ̈uz`ere, B., Adam, S., and Honeine, P. Analyzing the expressive power of graph neural networks in a spectral perspective. In 9th Inter- national Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenRe- view.net, 2021. URL https://openreview.net/ forum?id=-qh0M9XWxnv. Bianchi, F. M., Grattarola, D., Livi, L., and Alippi, C. Graph neural networks with convolutional arma filters. IEEE transactions on pattern analysis and machine intelligence, 44(7):3496–3507, 2021. Chen, M., Wei, Z., Ding, B., Li, Y., Yuan, Y., Du, X., and Wen, J. Scalable graph neural networks via bidirec- tional propagation. CoRR, abs/2010.15421, 2020a. URL https://arxiv.org/abs/2010.15421. Chen, M., Wei, Z., Huang, Z., Ding, B., and Li, Y. Simple and deep graph convolutional networks. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pp. 1725– 1735. PMLR, 2020b. URL http://proceedings. mlr.press/v119/chen20v.html. 10 Defferrard, M., Bresson, X., and Vandergheynst, P. Convo- lutional neural networks on graphs with fast localized In Lee, D. D., Sugiyama, M., von spectral filtering. Luxburg, U., Guyon, I., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pp. 3837– URL https : / / proceedings . 3845, 2016. neurips . cc / paper / 2016 / hash / 04df4d434d481c5bb723be1b6df1ee65 - Abstract.html. Favard, J. Sur les polynomes de tchebicheff. CR Acad. Sci. Paris, 200(2052-2055):11, 1935. Frasca, F., Rossi, E., Eynard, D., Chamberlain, B., Bron- stein, M., and Monti, F. Sign: Scalable inception graph In ICML 2020 Workshop on Graph neural networks. Representation Learning and Beyond, 2020. Gautschi, W. Orthogonal polynomials: computation and approximation. OUP Oxford, 2004. Geronimo, intervals. J. and Van Assche, W. Approximat- ing the weight function for orthogonal polynomi- Journal of Approxima- als on several tion Theory, 65(3):341–371, 1991. ISSN 0021-9045. doi: https://doi.org/10.1016/0021- 9045(91)90096- S. URL https://www.sciencedirect.com/ science/article/pii/002190459190096S. Hammond, D. K., Vandergheynst, P., and Gribonval, R. Wavelets on graphs via spectral graph theory. CoRR, abs/0912.3848, 2009. URL http://arxiv.org/ abs/0912.3848. He, M., Wei, Z., Huang, Z., and Xu, H. Bernnet: Learning arbitrary graph spectral filters via bernstein approxima- tion. In Ranzato, M., Beygelzimer, A., Dauphin, Y. N., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 14239– URL https : / / proceedings . 14251, 2021. neurips . cc / paper / 2021 / hash / 76f1cfd7754a6e4fc3281bcccb3d0902 - Abstract.html. He, M., Wei, Z., and Wen, J.-R. Convolutional neural net- works on graphs with chebyshev approximation, revisited. arXiv preprint arXiv:2202.03580, 2022. Graph Neural Networks with Learnable and Optimal Polynomial Bases Hu, W., Fey, M., Zitnik, M., Dong, Y., Ren, H., Liu, B., Catasta, M., and Leskovec, J. Open graph benchmark: Datasets for machine learning on graphs. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings. neurips . cc / paper / 2020 / hash / - fb60d411a5c5b72b2e7d3527cfc84fd0 Abstract.html. Isufi, E., Gama, F., and Ribeiro, A. Edgenets: Edge varying graph neural networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(11):7457–7473, 2021. Isufi, E., Gama, F., Shuman, D. I., and Segarra, S. Graph fil- ters for signal processing and machine learning on graphs. arXiv preprint arXiv:2211.08854, 2022. Kingma, D. P. and Ba, J. Adam: A method for stochas- tic optimization. In Bengio, Y. and LeCun, Y. (eds.), 3rd International Conference on Learning Representa- tions, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http: //arxiv.org/abs/1412.6980. Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https:// openreview.net/forum?id=SJU4ayYgl. Klicpera, J., Bojchevski, A., and G ̈unnemann, S. Predict then propagate: Graph neural networks meet personalized pagerank. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https: //openreview.net/forum?id=H1gL-2A9Ym. Lim, D., Hohne, F., Li, X., Huang, S. L., Gupta, V., Bhalerao, O., and Lim, S. Large scale learning on non- homophilous graphs: New benchmarks and strong simple In Ranzato, M., Beygelzimer, A., Dauphin, methods. Y. N., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems 34: Annual Con- ference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 20887– URL https : / / proceedings . 20902, 2021. neurips . cc / paper / 2021 / hash / ae816a80e4c1c56caa2eb4e1819cbb2f - Abstract.html. Pei, H., Wei, B., Chang, K. C., Lei, Y., and Yang, B. Geom- gcn: Geometric graph convolutional networks. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview. net/forum?id=S1e2agrFvS. Sen, P., Namata, G., Bilgic, M., Getoor, L., Galligher, B., and Eliassi-Rad, T. Collective classification in network data. AI magazine, 29(3):93–93, 2008. Shaik, K. B., Ganesan, P., Kalist, V., Sathish, B., and Jenitha, J. M. M. Comparative study of skin color detection and segmentation in hsv and ycbcr color space. Procedia Computer Science, 57:41–48, 2015. Shuman, D. I., Ricaud, B., and Vandergheynst, P. Vertex- frequency analysis on graphs. CoRR, abs/1307.5708, 2013. URL http : / / arxiv . org / abs / 1307 . 5708. Simon, B. Orthogonal polynomials on the unit circle, part 1: Classical theory, ams colloq, 2005. Simon, B. Spectral theory of orthogonal polynomials. In XVIIth International Congress on Mathematical Physics, pp. 217–228. World Scientific, 2014. Wang, G., Ying, R., Huang, J., and Leskovec, J. Im- proving graph attention networks with large margin- based constraints. CoRR, abs/1910.11945, 2019. URL http://arxiv.org/abs/1910.11945. Wang, X. and Zhang, M. How powerful are spectral graph neural networks. In Chaudhuri, K., Jegelka, S., Song, L., Szepesv ́ari, C., Niu, G., and Sabato, S. (eds.), Interna- tional Conference on Machine Learning, ICML 2022, 17- 23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pp. 23341– 23362. PMLR, 2022. URL https://proceedings. mlr.press/v162/wang22am.html. Wu, F., Zhang, T., Jr., A. H. S., Fifty, C., Yu, T., and Weinberger, K. Q. Simplifying graph convolutional net- works. CoRR, abs/1902.07153, 2019. URL http: //arxiv.org/abs/1902.07153. Xu, K., Zhang, M., Jegelka, S., and Kawaguchi, K. Op- timization of graph neural networks: Implicit accelera- tion by skip connections and more depth. In Meila, M. and Zhang, T. (eds.), Proceedings of the 38th Interna- tional Conference on Machine Learning, volume 139, pp. 11592–11602, 2021. Yang, Z., Cohen, W. W., and Salakhutdinov, R. Re- visiting semi-supervised learning with graph embed- dings. In Balcan, M. and Weinberger, K. Q. (eds.), Pro- ceedings of the 33nd International Conference on Ma- chine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, volume 48 of JMLR Workshop and 11 Graph Neural Networks with Learnable and Optimal Polynomial Bases Conference Proceedings, pp. 40–48. JMLR.org, 2016. URL http://proceedings.mlr.press/v48/ yanga16.html. Zhang, W., Yang, M., Sheng, Z., Li, Y., Ouyang, W., Tao, Y., Yang, Z., and Cui, B. Node dependent local smoothing for scalable graph learning. Advances in Neural Information Processing Systems, 34:20321–20332, 2021. 12 Graph Neural Networks with Learnable and Optimal Polynomial Bases Table 6. Summation of notations in this paper. Description Undirected, connected graph Number of nodes in G Symmetric-normalized adjacency matrix of G. Normalized Laplacian matrix of G. ˆL = I ˆP . The i-th eigenvalue of ˆL. The i-th eigenvalue of ˆP . μi = 1 Eigen vectors of ˆL and ˆP . λi. − − Input signal on 1 channel. Input features / Input signals on d channels. Filtered signals. Filtering function defined on ˆL and ˆP , respectively. h(λ) Filtering function on the ith signal channel. Xi,: = hi( ˆL)Zi,:. Filtering operation on signal x. h( ˆL) b( ˆP ). ≡ b(1 λ). − A polynomial basis of truncated order K. Coefficients above a basis. i.e. h(λ) (cid:80)K k=0 αkgk(λ). ≡ ≈ A. Notations Notation G = (V, E) N ˆP ˆL λi μi U RN ×d RN ×d x X ∈ Z ∈ ), b( h( ) * * ), bi( ) hi( * * h( ˆL)x, b( ˆP )x K ) gk( k=0 * { } K αk} k=0 { B. Proofs Most subsections here are for the convenience of interested readers. We provided our proofs about the theorems (except for the original form of Favard's Theorem) and their relations used across our paper, although the theorems can be found in early chapters of monographs about orthogonal polynomials (Gautschi, 2004; Simon, 2014). We assume a relatively minimal prior background in orthogonal polynomials. B.1. Three-term Recurrences for Orthogonal Polynomials (With Proof) Theorem B.1 (Three-term Recurrences for Orthogonal Polynomials). (Simon, 2005, p. 12) For any orthogonal ∞ polynomial series k=0, suppose that the leading coefficients of all polynomial are positive, the series satisfies the { recurrence relation: pk(x) } pk+1(x) = (Akx + Bk)pk(x) + Ckpk−1(x), 0. p−1(x) := 0, Ak, Ck ∈ R+, Bk ∈ R, k ≥ Proof. The core part of this proof is that xpk is orthogonal to pi for i xpk, pi⟩ ⟨ = 0, i ≤ 2, i.e. k − ≤ k − 2. Since xpk(x) is of order k + 1, we can rewrite xpk(x) into the combination of first k + 1 polynomials of the basis: xpk(x) = αk,k+1pk+1(x) + αk,kpk(x) + ak,k−1pk−1(x) + + αk,0p0(x) * * * (8) or in short, Project each term onto pi(x), xpk(x) = xpk(x), pi(x) ⟨ ⟩ = 0 (cid:88) j=k+1 0 (cid:88) j=k+1 13 αk,jpj(x). αk,j⟨ . pj(x), pi(x) ⟩ Graph Neural Networks with Learnable and Optimal Polynomial Bases Using the orthogonality among ∞ k=0, we have pk(x) } { xpk(x), pi(x) ⟨ ⟩ = ⟨ αk,ipi(x), pi(x) ⟩ ⇒ xpk(x), pi(x) αk,i = ⟨ ⟩ pi(x), pi(x) ⟩ ⟨ . (9) Next, we show xpk(x), pi(x) ⟨ ⟩ = 0. pk(x), xpi(x) ⟩ 2, applying xpi(x) = (cid:80)i+1 ⟨ When i = 0 when i k ≤ − k − ≤ 2. Since xpk(x), pi(x) ⟨ ⟩ ≡ ⟨ pk(x), xpi(x) ⟩ , it is equivalent to show j=0 αi,jpj(x) and the orthogonality between pj(x) and pk(x) when j = k, we get pk, xpi(x) ⟩ ⟨ = i+1 (cid:88) j=0 αi,j⟨ pk, pj(x) ⟩ j≤k−1 = 0 xpk, pi(x) ⟩ ⇒ ⟨ = 0. Therefore, xpk(x)is only relevant to pk+1(x), pk(x) and pk−1(x). By shifting items, we soonly get that: pk+1(x)is only relevant to xpk(x), pk(x) and pk−1(x). At last, we show that, by regularizing the leading coefficients Ak to be positive, Ck > 0. Firstly, since the leading coefficients are positive, ∞ k=0 defined in Equation (8) are positive. Then, notice from Equation (9), we get αk} { Ck Ak − = αk,k−1 = ⟨ ⟨ xpk(x), pk−1(x) ⟩ pk−1(x), pk−1(x) ⟩ pk(x), xpk−1(x) = ⟨ ⟩ pk−1(x), pk−1(x) ⟩ ⟨ = αk−1,k pk−1(x), pk−1(x) ⟩ ⟨ . We have finished our proof. B.2. Favard's Theorem (Monomial Case) Theorem B.2 (Favard's Theorem). (Favard, 1935) If a sequence of monic polynomials recurrence relation Pn} { ∞ n=0 satisfies a three-term R, βn > 0, then with γn, βn ∈ B.3. Favard's Theorem (General Case) (With Proof) Pn} { Pn+1(x) = (x γn) Pn(x) βnPn−1(x), − ∞ n=0 is orthogonal with respect to some positive weight function. − Corollary B.3 (Favard's Theorem; general case). If a sequence of polynomials relation Pn} { ∞ n statisfies a three-term recurrence Pn+1(x) = (ςnx γn) Pn(x) − − βnPn−1(x), with γn, βn, ςn ∈ with respect to the inner product R, ςn ̸ = (cid:82) p, q ⟨ ⟩ R p(x)q(x)w(x)dx. = 0, βn/ςn > 0, then there exists a positive weight function w such that ∞ n=0 is orthogonal Pn} { Proof. Set γ∗ n = αn ςn , β∗ n = βn ςn . Then we can construct a sequence of polynomials P ∗ n } ∞ n . { Case 1: For n = 0 and n = 1, set P ∗ Case 2: For n ≥ 2, define P ∗ n := Pn(x)/ ˆPn(x) . n (x) by the three-term recurrences: P ∗ n+1(x) := (x n) P ∗ γ∗ n (x) nP ∗ β∗ n−1(x). − n }n is an orthogonal basis. Since Pn is scaled P ∗ P ∗ { − n by some constant, so Pn}n is also { According to Theorem B.2, orthogonal. B.4. Proof of Theorem 3.1 We restate the Theorem of three-term recurrences for orthonormal polynomials (Theorem 3.1) as below, and give a proof. 14 ̸ Graph Neural Networks with Learnable and Optimal Polynomial Bases (Three Term Recurrences for Orthonormal Polynomials) For orthonormal polynomials w, suppose that the leading coefficients of all polynomial are positive, there exists the three-term recurrence relation: pk} { ∞ k=0 w.r.t. weight function (cid:112) βk+1pk+1(x) = (x − p−1(x) := 0, p0(x) = 1/ (cid:112) γk)pk(x) (cid:112) − β0, γk ∈ βkpk−1(x), R, βk ∈ (cid:112) R+, k 0 ≥ with β0 = (cid:82) w(x)dx. Proof. Case 1: k = 0. pk(x) is a constant. Suppose it to be t, then p0(x), p0(x) ⟩ ⟨ = t2 (cid:90) b dα ⇒ a (cid:112) t = 1/ β0. Case 2: k ≥ 1. By Theorem B.1, since pk} { K k=0 is orthogonal, there exist three term recurrences as such: pk+1(x) = (Akx + Bk)pk(x) + Ckpk−1(x), k = 1, 2, 3, . . . . By setting c∗ k = 1 Ak , a∗ k = Bk Ak − , b∗ k = Ck Ak − , it can be rewritten into c∗ kpk+1(x) = (x a∗ k)pk(x) − − b∗ kpk−1(x), k = 1, 2, 3, . . . . Apply dot products with pk−1(x) to Equation (10), we get xpk(x), pk−1(x) ⟨ ⟩ = ⇒ b∗ kpk−1(x), pk−1(x) ⟨ ⟩ b∗ k = xpk(x), pk−1(x) ⟩ ⟨ (k = 1, 2, 3, . . .). Similarly, apply dot products with pk+1(x), we get: c∗ kpk+1(x), pk+1(x) ⟩ ⟨ = ⇒ ⇒ xpk(x), pk+1(x) ⟨ ⟩ c∗ k = c∗ k = (k = 1, 2, 3, . . .). xpk(x), pk+1(x) ⟩ ⟨ xpk+1(x), pk(x) ⟩ ⟨ xpk(x), pk+1(x) ⟨ ⟩ = pk(x), xpk+1(x) ⟨ ⟩ (11) = b∗ k+1. c∗ k = b∗ k+1. Notice that in Equation (12) We get: So we can write Equation (10) into the form below: b∗ k+1pk+1(x) = (x a∗ k)pk(x) − − b∗ kpk−1(x), k = 1, 2, 3, . . . . (10) (11) (12) At last, we show b∗ Firstly, recall that b∗ the combination of k > 0. k = xpk(x), pk−1(x) ⟨ k j=0 which the leading coefficients to be non-zero, i.e. pj} { pk(x), xpk−1(x) ⟩ = ⟨ ⟩ . Since xpk−1(x), which is of order k, can be written into xpk−1(x) = ak,kpk(x) + ak,k−1pk−1(x) + + ak,0p0(x) * * * (ak,k ̸ = 0) Secondly, since ⟨ g(x), g(x) g(x), ⟩ ≡ ⟨− − g(x) , we can restrict all the leading coefficients to be positive. ⟩ b∗ n = = ak,k > 0. pk(x), xpk−1(x) ⟩ ⟨ Thus we have proved b∗ k > 0 holds. Furthermore, we can rewrite b∗ k into √βk. The proof is finished. 15 Graph Neural Networks with Learnable and Optimal Polynomial Bases B.5. Proof of Theorem 3.2 We restate Favard's Theorem for orthonormal polynomials (Theorem 3.2) as below, and give a proof based on the general case B.3. (Favard Theorem; Orthonormal case) A polynomial series (cid:112) βk+1pk+1(x) = (x − p−1(x) := 0, p0(x) = 1/ pk} { γk)pk(x) (cid:112) − β0, γk ∈ ∞ k=0 who satisfies the recurrence relation (cid:112) βkpk−1(x), βk ∈ (cid:112) R, R+, k 0 ≥ is orthonormal w.r.t. a weight function w that β0 = (cid:82) w(x)dx. Proof. First of all, according to Theorem 3.2, the series ∞ k=0 is orthogonal. pk} { Apply dot products with pk−1(x), we get ⟨ xpk(x), pk−1(x) ⟩ xpk(x), pk−1(x) ⟩ ⇒ ⟨ = = (cid:68)(cid:112) βkpk−1(x), pk−1(x) (cid:69) (cid:112) βk⟨ pk−1(x), pk−1(x) ⟩ (k = 0, 1, . . .). Similarily, apply dot products with pk+1(x), we get: (cid:68)(cid:112) βk+1pk+1(x), pk+1(x) (cid:69) ⇒ which can be rewritten as: Notice that We get: (cid:112) βk+1⟨ pk+1(x), pk+1(x) ⟩ = = ⟨ xpk(x), pk+1(x) ⟩ xpk(x), pk+1(x) ⟨ ⟩ (k = 0, 1, . . .), √βk⟨ pk(x), pk(x) = ⟩ xpk−1(x), pk(x) ⟨ (k = 1, 2, . . .), ⟩ xpk−1(x), pk(x) ⟩ ⟨ = . xpk(x), pk−1(x) ⟩ ⟨ (cid:112) βk⟨ pk(x), pk(x) ⟩ pk(x), pk(x) ⟩ ⇒ ⟨ = = = pk−1(x), pk−1(x) xpk−1(x), pk(x) ⟨ ⟩ (cid:112) βk⟨ pk−1(x), pk−1(x) ⟨ ⟩ (k = 1, 2, . . .), ⟩ which indicates that the polynomials pk} { K k=0 are same in their norm. 1/√β0 and β0 = (cid:82) w(x)dx, p0(x), p0(x) ⟨ = ⟩ 1 β0 (cid:82) w(x)dx =1. Thus the norm of every polynomial in ≡ Since p0(x) ∞ k=0 equals 1. pk} { Combining that ∞ k=0 is orthogonal and pk} { pk(x), pk(x) ⟨ ⟩ = 1 for all k, we arrive that ∞ k=0 is an orthonormal basis. pk} { 16 Graph Neural Networks with Learnable and Optimal Polynomial Bases B.6. Proof of Proposition 4.4 Proof. First, from the construction of each vi+1 (Algorithm 11, k = i), we know that vi+1 is composed of ˆP vi. Therefore, ˆP vi can be expressed as a weighted sum of Second, notice that can rephrase j=0, denoted as ˆP vi = ti+1vi+1 + tivi + (14). Thus, for Step 2 in Algorithm 11, for each i vk, ˆP vi⟩ ⟨ ˆP vi = = vT k vj} i+1 ∈ { * * * [0, 1, j=i j and vj} { + t0v0 (13). , k] we * * * ˆP vk, vi⟩ ⟨ v∗ by: k+1, vi⟩ ⟨ v∗ k+1, vi⟩ ⟨ def = (13) = ˆP vk, vi⟩ ⟨ (cid:42) i+1 (cid:88) vk, j=0 (14) = vk, ˆP vi⟩ ⟨ (cid:43) tjvj = i+1 (cid:88) j=0 tj⟨ vk, vj⟩ , which equals 0 when i < k 1. − B.7. Proof of Lemma 4.6 Proof. First, notice that On the other hand, So, we get v∗ k+1, vk−1⟩ ⟨ = ˆP vk, vk−1⟩ ⟨ = vk, ˆP vk−1⟩ ⟨ . v⊥ k+1∥ ∥ = vk+1, v⊥ ⟨ k+1⟩ = vk+1, v∗ ⟨ k+1⟩ = vk+1, ˆP vk⟩ . ⟨ v⊥ k ∥ ∥ = vk, ˆP vk−1⟩ ⟨ = ˆP vk, vk−1⟩ ⟨ = v∗ k+1, vk−1⟩ ⟨ . Thus, we have finished our proof. 17 Graph Neural Networks with Learnable and Optimal Polynomial Bases C. Pseudo-codes C.1. Pseudo-code for FavardGNN. Algorithm 7: FavardGNN.Pytorch style. # f: raw feature dimension # d: hidden dimension, or number of channels # N: number of nodes # K: order of polynomial basis # X(Nxd): Input features # P(NxN): Sym-normalized adjacency matrix # Coef(dx(K+1)): coefficient matrix # SqrtBeta(dx(K+1)): Coefficients for three-term recurrences # Gamma(dx(K+1)): Coefficients for three-term recurrences # Transfer raw input in signals X = ReLU(MLP(X.dropout())).dropout() # (Nxd) SqrtBeta = torch.clamp(norm, 1e-2) # Process H_0 H_0 = X / SqrtBeta[:,0] # (Nxd) Z = torch.zeros_like(X) # Add to the final representation Z = Z + torch.einsum('Nd,d->Nd', H_0, Coef[:,0]) last_H = H_0 second_last_H = torch.zeros_like(H_0) for k in range(1, K): # Three-term Recurrence Formula for Orthonormal Polynomials H_k = P @ last_H # (Nxd) H_k = H_k - Gamma[k,:].unsqueeze(0)*last_H - SqrtBeta[k,:].unsqueeze(0)*second_last_H H_k = H_k / SqrtBeta[k+1,:].unsqueeze(0) # Add to the final representation Z = Z + torch.einsum('Nd,d->Nd', H_k, Coef[:,k]) # Update variables second_last_H = last_H last_H = H_k # Transform the final representation into predictions Y = MLP(ReLU(Z).dropout()) Pred = Softmax(Y) return Pred 18 Graph Neural Networks with Learnable and Optimal Polynomial Bases C.2. Pseudo-code for OptBasisGNN. Algorithm 8: OptBasisGNN.Pytorch style. # f: raw feature dimension # d: hidden dimension, or number of channels # N: number of nodes # K: order of polynomial basis # X(Nxd): Input features # P(NxN): Sym-normalized adjacency matrix # Coef(dxK): coefficient matrix # Transfer raw input in signals X = ReLU(MLP(X.dropout())).dropout() # (Nxd) # Normalize H_0 norm = torch.norm(X, dim=0).view(1, d) norm = torch.clamp(norm, 1e-8) H_0 = X / norm # (Nxd) Z = torch.zeros_like(X) # Add to the final representation Z = Z + torch.einsum('Nd,d->Nd', H_0, Coef[:,0]) last_H = H_0 second_last_H = torch.zeros_like(H_0) for k in range(1, K): H_k = P @ last_H # (Nxd) # Orthogonalize H_k to all the former vectors # To achieve this, only 2 substractions are required project_1 = torch.einsum('Nd,Nd->1d', H_k, last_H) # (1xd) project_2 = torch.einsum('Nd,Nd->1d', H_k, second_last_H) # (1xd) H_k = H_k - project_1 * last_H - project_2 * second_last_H # (Nxd) # Normalize H_k norm = torch.norm(H_k, dim=0).view(1, d) norm = torch.clamp(norm, 1e-8) H_k = H_k / norm # (Nxd) # Add to the final representation Z = Z + torch.einsum('Nd,d->Nd', H_k, Coef[:,k]) # Update variables second_last_H = last_H last_H = H_k # Transform the final representation to predictions Y = MLP(ReLU(Z).dropout()) Pred = Softmax(Y) return Pred D. Experimental Settings. D.1. Node Classification Tasks on Large and Small Datasets. Model setup. The structure of FavardGNN and OptBasisGNN follow Algorithm 2. The hidden size of the first MLP layers h is set to be 64, which is also the number of filter channels. For the scaled-up OptBasisGNN, we drop the first MLP layer to fix the basis vectors needed for precomputing, and following the scaled-up version of ChebNetII (He et al., 2022), we add a three-layer MLP with weight matrices of shape F × For both models, the initialization of α is set as follows: for each channel l, the coefficients of the g0,l are set to be 1, while the other coefficients are set as zeros, which corresponds to initializing the polynomial filter on each channel to be λ. For the initialization of three-term parameters that determine the initial polynomial bases on each channel, h(λ) = 1 we simply set c after the filtering process. to be ones, and to be zeros. h and h h, h × × − √β { } γ { } Hyperparameter tunning. For the optimization process on the training sets, we tune all the parameters with Adam (Kingma & Ba, 2015) optimizer. We use early stopping with a patience of 300 epochs. We choose hyperparameters on the validation sets. To accelerate hyperparameter choosing, we use Optuna(Akiba et al., 19 Graph Neural Networks with Learnable and Optimal Polynomial Bases 2019) to select hyperparameters from the range below with a maximum of 100 complete trials3: 1. Truncated Order polynomial series: K 2. Learning rates: 3. Weight decays: 4. Dropout rates: ; 2, 4, 8, 12, 16, 20 } ; 0.0005, 0.001, 0.005, 0.1, 0.2, 0.3, 0.4, 0.5 { } 8, 1e { − 0., 0.1, { , 1e − , 0.9 } ; 3 } ; * * * * * * ∈ { There are two extra hyperparameters for scaled-up OptBasisGNN: 1. Batch size: 2. Hidden size (for the post-filtering MLP): 10, 000, 50, 000 { ; } 512, 1024, 2048 } { . D.2. Multi-Channel Filter Learning Task. YCbCr Channels. We put the practical background of our multichannel experiment in the YCbCr color space, a useful color space in computer vision and multi-media (Shaik et al., 2015). Our Synthetic Dataset. When creating our datasets with 60 samples, we use 4 filter combinations on 15 images in He et al. (2021)'s single filter learning datasets. The 4 combinations on the three channels are: 1. Band-reject(Y) / low-pass(Cb) / high-pass(Cr); 2. High-pass(Y) / High-pass(Cb) / low-pass(Cr); 3. High-pass(Y) / low-pass(Cb) / High-pass(Cr); 4. Low-pass(Y) / band-reject(Cb) / band-reject(Cr). The concrete definitions of the signals, i.e. band-reject are aligned with those given in He et al. (2022). Visualization on more samples. We visualize more samples as Figure 2 in Figure 4. In all the samples, the tendencies of different curves are alike. D.3. Examining of FavardGNN's bump. Figure 3 (right), we observe bump with a node classification setup. To show this clearer, we let FavardGNN and GPR-GNN (which uses the Monomial basis for classification) to fit the whole set of nodes, and move dropout and Relu layers. As in the regression re-examine task, we cancel the earlystop mechanism, stretch the epoch number to 10,000, and record cross entropy loss on each epoch. E. Summary of Wang's work This section is a restate for a part of Wang & Zhang (2022). For the convenience of the reader's reference, we write this section here. More interested readers are encouraged to refer to the original paper. Wang & Zhang (2022) raise a criterion for best basis, but states that it cannot be reached. E.1. The Criterion for Optimal Basis Following Xu et al. (2021), Wang & Zhang (2022) considers the squared loss R = 1 Z = k=0 αk,lgk,l( ˆP )X:,l . 4 (cid:80)K 2 ∥ Z Y ∥ − 2 F, where Y is the target , and ∥l∈[1,h] Since each signal channel is independent and contributes independently to the loss, i.e. R = (cid:80) then consider the loss function channelwisely and ignore l. Loss on one signal channel x is: l 1 2 ∥ Z:,l − 2 F, we can Y:,l∥ r = 1 2 ∥ z 2 F, y ∥ − 3We use Optuna's Pruner to drop some hyperparameter choice in an early stay of training. This is called an incomplete/pruned trial. 4Here, X is not necessarily the raw feature (Xraw) but often some thing like XrawW . W is irrelevant to the choice of polynomial basis, and merges W into X. 20 Graph Neural Networks with Learnable and Optimal Polynomial Bases Figure 4. Visualization with more samples in the multi-channel filter learning task. 21 6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(&RQYHUJHQFHUDWH0RQRPLDO%HUQVWHLQ&KHELL2SW%DVLV)DYDUG6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(&RQYHUJHQFHUDWH0RQRPLDO%HUQVWHLQ&KHELL2SW%DVLV)DYDUG6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(&RQYHUJHQFHUDWH0RQRPLDO%HUQVWHLQ&KHELL2SW%DVLV)DYDUG6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(6WHS06(&RQYHUJHQFHUDWH0RQRPLDO%HUQVWHLQ&KHE,,2SW%DVLV)DYDUG Graph Neural Networks with Learnable and Optimal Polynomial Bases where z = (cid:80)K k=0 αkgk( ˆP )x. This loss is a convex function w.r.t. α. Therefore, the gradient descents's convergence rate depends on the Hessian matrix's condition number, denoted as κ(H). When H is an identity matrix, κ(H) reaches a minimum and leads to the best convergence rate (Boyd & Vandenberghe, 2009). The Hessian matrix H looks like5: Hk1k2 = ∂2r ∂αk1∂αk2 = xTgk2( ˆP )gk1 ( ˆP )x. Wang & Zhang (2022) further write Hk1k2 in the following form: Hk1k2 = xT gk2( ˆP )gk1( ˆP )x = n (cid:88) i=1 gk1 (μi)gk2 (μi)(U Tx)2 i , which can be equivalently expressed as a Riemann sum: N (cid:88) i=1 gk1 (μi)gk2 (μi) F (μi) − μi − F (μi−1) μi−1 (μi − μi−1), where F (μ) := (cid:80) μi≤μ(U Tx)2 i . Define f (μ) = △F (μ) △μ , Hk1k2 comes to Hk1k2 = (cid:90) 1 μ=−1 gk1(μ)gk2(μ)f (μ)dμ. This suggests that, orthonormal basis, see Section 2.2.) gk} { K k=0 is an optimal basis when it is orthonormal w.r.t. weight function f ( * ). (For more about E.2. Wang's Method Having write out the weight function f (μ), the optimal basis is determined. Wang & Zhang (2022) think of a regular process for getting this optimal basis, which is unreachable since eigendecomposition is unaffordable for large graphs. We summarize this process in Algorithm 3. According to Wang & Zhang (2022), the optimal basis would be an orthonormal basis, but unfortunately, this basis and the exact form of its weight function is unattainable. As a result, they come up with a compromise by allowing the model to μ)a(1 + μ)b. The Jacobi choose from the orthogonal Jacobi bases, which have "flexible enough weight functions", i.e. (1 bases are a family of polynomial bases. A specific form Jacobi basis is determined by two parameters (a, b). Similar to the well-known Chebyshev basis, the Jacobi bases have a recursive formulation, making them efficient for calculation. − 5Note that, Wang & Zhang (2022) define gk2 on ˆL (or {λi}) while we define it on ˆP (or {μi}). They are equivalent. 22
http://arxiv.org/abs/2302.12431v2
2023-08-30T23:13:13
2023-02-24T03:18:45
Flexible Phase Dynamics for Bio-Plausible Contrastive Learning
Many learning algorithms used as normative models in neuroscience or as candidate approaches for learning on neuromorphic chips learn by contrasting one set of network states with another. These Contrastive Learning (CL) algorithms are traditionally implemented with rigid, temporally non-local, and periodic learning dynamics that could limit the range of physical systems capable of harnessing CL. In this study, we build on recent work exploring how CL might be implemented by biological or neurmorphic systems and show that this form of learning can be made temporally local, and can still function even if many of the dynamical requirements of standard training procedures are relaxed. Thanks to a set of general theorems corroborated by numerical experiments across several CL models, our results provide theoretical foundations for the study and development of CL methods for biological and neuromorphic neural networks.
[ "Ezekiel Williams", "Colin Bredenberg", "Guillaume Lajoie" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12431v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12431v2", "@rel": "related", "@type": "application/pdf" } ]
[ "PMLR 202:37042-37065, 2023" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.NE" ]
Flexible Phase Dynamics for Bio-Plausible Contrastive Learning Ezekiel Williams 1 2 Colin Bredenberg 1 2 Guillaume Lajoie 1 2 3 2 0 2 g u A 0 3 ] G L . s c [ 2 v 1 3 4 2 1 . 2 0 3 2 : v i X r a Abstract Many learning algorithms used as normative mod- els in neuroscience or as candidate approaches for learning on neuromorphic chips learn by con- trasting one set of network states with another. These Contrastive Learning (CL) algorithms are traditionally implemented with rigid, temporally non-local, and periodic learning dynamics that could limit the range of physical systems capa- ble of harnessing CL. In this study, we build on recent work exploring how CL might be imple- mented by biological or neurmorphic systems and show that this form of learning can be made tem- porally local, and can still function even if many of the dynamical requirements of standard train- ing procedures are relaxed. Thanks to a set of general theorems corroborated by numerical ex- periments across several CL models, our results provide theoretical foundations for the study and development of CL methods for biological and neuromorphic neural networks. 1. Introduction Contrastive learning (CL) represents a powerful family of algorithms for learning representations, spanning a broad range of machine learning methodologies including gener- ative and discriminative modelling, as well as supervised and unsupervised learning. Broadly, CL can be divided into equilibrium-based methods, that use a (stochastic) dynam- ical process to calculate internal network states, and non- equilibrium methods, that calculate internal states directly in a single pass through the network. CL has been proposed as a normative model for biological learning (Baldi & Pineda, 1991; Illing et al., 2021; Hinton et al., 1984; Scellier & Ben- gio, 2017; Cao et al., 2020), but requires highly structured 1Department of Mathematics and Statistics, Univer- site de Montreal, Quebec, Canada 2Mila, Quebec AI In- stitute, Quebec, Canada. Ezekiel Williams <[email protected]>, Guillaume Lajoie <[email protected]>. Correspondence to: training dynamics that restrict the kinds of biological sys- tems that could implement this form of learning. Here, we investigate alternative training dynamics for CL, to better understand the breadth of systems capable of implementing it. CL learns representations by leveraging the statistical differ- ences between positive samples (samples from the training set) and negative samples (artificially or internally gener- ated data). We restrict our study to the subclass of CL algo- rithms with a two-term gradient, where one term depends on positive but not negative samples, and the other term on negative but not positive. This two-term CL class comprises a wide range of algorithms, including most algorithms of interest to the neuroscience community. For example, the Boltzmann machine (Ackley et al., 1985), equilibrium prop- agation (Scellier & Bengio, 2017), and energy based models optimizing the negative log-likelihood (LeCun et al., 2006) all fall within this subclass. Conversely, SimCLR (Chen et al., 2020) is an example of a non-two-term CL method. Two-term CL algorithms have a periodic, biphasic time course of learning. First, during the positive phase, the model calculates internal states given a positive sample. This is followed by a negative phase where neural responses to a negative sample are computed. For example, in a Boltz- mann machine (Ackley et al., 1985) the positive phase calcu- lates network states conditioned on data while the negative phase calculates internally generated states free from data conditioning; in noise contrastive estimation, the positive phase calculates network states in response to real data while the negative phase calculates responses to noise (Gutmann & Hyv ̈arinen, 2010). Finally, network responses from each phase are used to calculate the gradient and a single step of gradient descent is taken before repeating the whole process for the next learning iteration (Ackley et al., 1985; Scellier & Bengio, 2017; Hinton, 2022) (Fig.1.A). As such, CL suffers from constraints on training dynamics that restrict the set of physical neural networks capable of running the algorithm. In this work, we address four of these constraints and show they can be considerably relaxed: Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1. Temporal non-locality: the use of information from past network states that is too old to be available to the network without auxiliary memory mechanisms 1 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning 2. Strict phasic periodicity: oscillation between two dis- tinct phases 3. Rapidly tuneable learning rates: precise modulation of network plasticity during training 4. Deterministic phase length: keeping the same phase length for all phases during training Contributions: In this paper we address temporal non- locality and periodicity for all two-term CL methods, and investigate how variability of phase length and limited learn- ing rate modulation affect equilibrium-based CL. We pro- pose an importance sampling-inspired approach to estimat- ing the gradient that makes two-term CL methods tempo- rally local and show it is unbiased (see Appendix §A.1). It does so by stochastically selecting either a single positive or single negative sample to learn from at each gradient step, thus also eliminating the strict periodicity seen in past algorithms. The proposed approach provides a principled way to tune the amount of time spent taking gradient steps with respect to positive versus negative samples. Interest- ingly, we find that it is not always optimal to spend an equal amount of training time learning from positive compared to negative samples. Next, we demonstrate quite generally that equilibrium-based methods, and thus equilibrium-based CL, can still learn effectively–with asymptotically unbiased gradient estimates–even with no learning rate modulation (i.e. avoiding the wait until the end of phases to update parameters) and with a significant amount of noise in the length of each phase. Taken together, our results formally relax the previous requirements on the learning dynamics of many CL algorithms, thereby demonstrating that a broader set of systems might be capable of implementing this form of learning. 2. Background Bio-Plausible Learning: How the brain learns is a fun- damental scientific question driving research not only in neuroscience but also in AI. In particular, AI algorithms are being used more and more as normative models of learning in biological neural networks, a line of study that has already yielded exciting results (Richards et al., 2019; Sorscher et al., 2022; Hennequin et al., 2018; Payeur et al., 2021). However, many AI algorithms exhibit properties that go beyond gross abstractions of neural processing to be computationally in- compatible with neural hardware. This means that an impor- tant component of AI-inspired modelling in neuroscience is teasing out which aspects of a candidate learning model cannot be implemented by the brain and whether the model might be modified so as to make it more plausibly imple- mentable by biological circuits (bio-plausible). For example, backpropagation computes using biologically implausible mechanisms such as spatial non-locality (Diederich & Op- per, 1987) and weight-transport (Lillicrap et al., 2016). The study of bio-plausible learning is not solely applicable to neuroscience but also has relevance to AI in itself, as algorithms that function like the brain often have computa- tional benefits (Lake et al., 2017). An especially important example of this synergy between bio-plausible learning and AI development is neuromorphic computing: neuromor- phic hardware represents a potential solution to AI energy efficiency problems (Strubell et al., 2020), but often puts similar constraints on algorithms that biological systems do, for example utilizing local storage of memory (Schuman et al., 2022; Frenkel et al., 2021). Contrastive Learning and Bio-Plausibility: Often the positive and negative phases of CL are thought of, from a psychological modelling perspective, as being implemented during wakeful processing of stimuli and periods of sleep, respectively (Hinton, 2022; Crick & Mitchison, 1983), just as in the Wake-Sleep algorithm (another classic learning model) (Dayan et al., 1995). Other studies have related these phases to oscillations in cortical circuits (Baldi & Pineda, 1991) or have suggested that the difference between phases could be delineated by saccades in the visual system (Illing et al., 2021). Given a lack of hard evidence in favour of these hypotheses, we will refer to these phases solely as positive and negative in what follows. A subset of CL algorithms do not require backpropaga- tion for neural network-based learning (Ackley et al., 1985; Scellier & Bengio, 2017; Hinton, 2022); it is this feature in particular that has brought attention to CL methods as bio-plausible learning models. However, the learning dy- namics for CL methods exhibit properties that have not been observed in the brain. To begin with, the majority of CL methods are temporally non-local. This refers to when an algorithm uses informa- tion that is not available within some short distance of the present timestep to update the parameters of the network at the current timestep (Illing et al., 2021). For CL methods, temporal non-locality appears because network responses to positive and negative samples must be calculated before performing a parameter update (e.g. Fig.1.A). Notably, this also introduces a precise positive-negative phase period dur- ing the learning time course. The problem with temporal non-locality is that it would require a neural network to save its neuron states in a memory buffer for a non-negligible amount of time before recalling them. Memory storage could be solved in theory by synaptic weight consolida- tion (introduce a candidate modification in phase 1, and consolidate the change in phase 2), but there's no known relationship between this phenomenon and biphasic network dynamics in the brain. 2 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning Equilibrium-Based Contrastive Learning: Beyond the problems of temporal non-locality and periodicity, two additional complications exist for equilibrium-based CL methods used to train (stochastic) dynamical system neural networks. For each data point observed during training, equilibrium-based CL must run internal dynamics on the space of the given model's hidden unit activations until the dynamics have converged to the vicinity of a fixed point. This means that, for each positive and negative sample pair, learning rates must be set to zero and dynamics run two times before learning rates are turned-on for a single pa- rameter update (Ackley et al., 1985; Scellier & Bengio, 2017; Hinton, 2022) (Fig.1.A). Such a specific pattern of learning rate scheduling and periodic stimulus/sample pre- sentation is as yet unsupported empirically in biological systems: this begs the question whether aspects of these training dynamics can be relaxed. Lastly, because of the convergence requirements on the dynamics of equilibrium- based learning, when training AI methods one usually fixes a particular length of time to run dynamics for each sample. Comparatively, regardless of the proposed implementation of biphasic learning (sleep/wake, neural oscillations, sac- cades, active/quiescent) animals usually spend a variable amount of time in each state. This motivates the question of how much variability equilibrium-based CL algorithms might tolerate in the length of phases. Example CL system-The Boltzmann Machine: To ground this discussion of biphasic learning, we will provide a brief example of a classic equilibrium-based CL method: the Boltzmann machine (Ackley et al., 1985). The Boltz- mann machine is a generative Recurrent Neural Network (RNN) model that learns a probability distribution over a d dimensional binary support from a dataset {x(i)}N i=1, x(i) ∈ {0, 1}d. The RNN units z ∈ {0, 1}n are partitioned into visible units, vj j ∈ {0, . . . d}, whose learned activity represents samples from the d dimensional support, and hidden units hi, i ∈ {0, . . . , nh}, that encode higher order interactions between the visible units. Then z ∈ {0, 1}d+nh with z = [v, h]. The units are connected via a synaptic weight matrix θ ∈ Rn×n that learns to encode the correla- tion structure between units via the following contrastive Hebbian learning rule: ∆θkl = ηzk,+zl,+ − ηzk,−zl,−, (1) where the '+' subscript denotes an activation generated from K ∈ N steps of dynamics with the visible units clamped to a data point (a positive phase) and the '−' sub- script denotes an activation generated from K steps of recur- rent dynamics with the visible units unclamped (a negative phase). The weight update finally occurs after both phases have been run and requires the temporally non-local saving of activations from the first phase. Learning rates are set to zero while the phase dynamics are run and only turned on for the weight update. These periodic learning dynamics are referred to as K-step Contrastive Divergence (CDK) (Hinton, 2002), and are visualized in Fig.1.A. While CDK is not the only algorithm for training a Boltzmann machine, it is typical of the training dynamics used by other methods (Fischer & Igel, 2014). Related Work: Here, we non-exhaustively review ap- proaches to learning that are equilibrium-based but not contrastive, then contrastive non-equilibrium methods, and finally the intersection of these. The majority of bio-plausbile, non-contrastive equilibrium- based methods find their roots in Predictive Coding (PC) (Srinivasan et al., 1982; Rao & Ballard, 1999), which was retrospectively shown to be a variational method (Bishop & Nasrabadi, 2006) for learning a hierarchical Gaussian model (Friston, 2005). Given the prescribed generative model, these works are more narrow in scope than ours, which explores equilibrium learning quite broadly in the context of stochastic gradient descent and fixed point latent dynamics. There are two non-equilibrium-based CL classes of particu- lar relevance to this study, both inspired by noise contrastive estimation (Gutmann & Hyv ̈arinen, 2010). The first class originates from Contrastive Predictive Coding (CPC) (Oord et al., 2018), which contrasts positive samples of the future conditioned on the present with negative samples taken at random from the analyzed time series. A bio-plausible ver- sion of CPC (Illing et al., 2021) uses the same approach taken in this study to arrive at temporally local and ape- riodic learning, but focuses on the specific case of CPC and does not make the link with unbiased gradients and importance sampling. The second class encompasses the Forward-Forward algorithm, and related works, that do bi- nary classification of positive from negative samples at each layer to achieve learning without backpropagation (Hinton, 2022; Ororbia & Mali, 2023). To our knowledge, temporally local and aperiodic training of these algorithms has not been studied. Equilibrium-based CL was first researched in the late 80s and early 90s, with the Boltzmann machine (Ackley et al., 1985) and its deterministic variants (Baldi & Pineda, 1991; Movellan, 1991). Baldi & Pineda (Baldi & Pineda, 1991) explored temporally local learning in this context and, as in our work, achieve temporal locality by breaking up the two-term gradient into single positive and negative-phase terms. Unlike our work, they consider solely periodic updating-associating the learning process with cortical oscillations-and explain that learning follows gradients only in the small-learning rate limit. Temporally local learn- ing was investigated more recently with two modifications 3 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning to Equilibrium Propagation (EP) (Scellier & Bengio, 2017; Ernoult et al., 2020; Laborieux & Zenke, 2022). In the first (Ernoult et al., 2020), the proposed solution still requires two network passes and, like Baldi & Pineda, relies on an infinitesimally small learning rate. This is necessary be- cause Ernoult et al.'s solution to temporal non-locality uses continual weight updates during the positive phase. We use a similar argument, but to achieve concurrent learning and latent dynamics, rather than locality. The second study (Laborieux & Zenke, 2022) uses oscillatory clamping for training, similar to the oscillatory teacher signal used his- torically (Baldi & Pineda, 1991). It does so by leveraging activity in the complex plane, which provides an elegant solution for phase management but requires complex neu- ron activiations. This complicates the mapping to standard neuroscience and AI models which usually represent neural activity in real spaces. The second study shares another similarity with ours, in that it uses a separation of timescales argument to achieve concurrent learning and latent-space dynamics. However, the separation of timescales is left as an assumption, in contrast to our derivation of error bounds that explicitly account for the two timescales. 3. Theoretical Results We first describe our results on generalizing CL to tem- porally local learning dynamics, followed by results on learning rate and phase length in equilibrium-based CL sys- tems. We begin by considering the set of CL methods that employ Stochastic Gradient Descent (SGD) to optimize a two-term objective function such that a single SGD step uses the following gradient estimate: g(θ) = g+(θ, z+) − g−(θ, z−). (2) Here, z+ ∈ Z+, where Z+ is the set of positive-phase net- work states, and z− ∈ Z−, where Z− is the set of negative- phase states, θ is the parameters, and g+ and g− are the functions that map parameters and network states to posi- tive and negative phase gradient terms. Temporal locality and periodicity are inherent in this gradient estimate, as it requires two different sets of network states to compute: separate passes through the neural network must be used to estimate each term of the gradient. We remark that, in a similar vein, batch learning is temporally non-local, as it requires a running sum of network weights to be held in memory during each learning phase. As such, in what follows, we study SGD (batch size of 1). Many classic CL algorithms seen in the machine learning and computational neuroscience literature have this form of gradient, includ- ing contrastive Hebbian learning (Movellan, 1991), equi- librium propagation (Scellier & Bengio, 2017), maximum likelihood learning of energy based models (LeCun et al., 2006), and forms of noise contrastive estimation (Gutmann Figure 1. Comparison of learning dynamics for two algorithms. Equilibrium-based CL dynamics are shown, but the pattern of phases and temporal (non-)locality generalizes to non-equilibrium CL methods. A. Traditional CL using the gradient given by Equa- tion 2. Network states, a, at the end of a positive phase (light grey) must be transported through the negative phase (dark grey) to the learning step (red arrow), introducing temporal non-locality. Learning (blue) only occurs after both phases have been completed, and phase lengths, T , are fixed. The plotted trajectories are tempo- ral dynamics corresponding to the activation (orange) and network weight (purple) highlighted in the first frame of the diagram. Grey arrows denote dynamics in activation space. B. Equilibrium-based CL using the gradient given by Equation 3, and constant learning rate with stochastic phase lengths. It is temporally local because no network states must be saved in memory to enable learning, and the phase type is chosen randomly at each phase, eliminating periodicity (e.g. two negative phases in a row). There is no high- lighted learning step because learning is always on, denoted by the blue weights and apparent in the constantly evolving purple weight dynamics in the bottom plot. Phase lengths are stochastic (e.g. the positive phase is 3x as long as the first negative phase). Data in the two plots is fabricated for the purpose of illustration. & Hyv ̈arinen, 2010). The first contribution of this work is to construct a temporally local estimate of the gradient in Equation 2. 3.1. Gradient Sampling to Avoid Non-Locality We can begin to resolve the temporal non-locality of Equa- tion 2 by considering the situation where each term g+ and g− are used separately to do parameter updates. This means that at the end of a positive phase g+ is used for an update, and g− is used similarly for the negative phase, avoiding the need for a "memory buffer" to combine these terms. This might not be a good idea in the case of periodic phases, but it turns out that introducing stochasticity into the phase distribution proves very useful. We therefore propose a 4 Negative phase t0+2T... t0+Tatw at0+TPositive phaseLearningProposedTraditionalatwatwatwatwNegativeTime...atwtPositiveatwtatwtatwtatwtNegativeatwatwtA.B. Flexible Phase Dynamics for Bio-Plausible Constrastive Learning probabilistic phase selection process, where the next phase type (positive or negative) to be performed during learning is chosen by a Bernouilli random variable B. In this setting, the sum in Equation 2 can be replaced by the following ˆg(θ) = B b g+(θ, z+) − 1 − B 1 − b g−(θ, z−), (3) where B ∼ Bernoulli(b) so that b is the probability of selecting a positive phase for the current SGD step. A realization of such a single, stochastically sampled term becomes a form of importance sampling (Robert et al., 1999) that estimates the true gradient from Equation 2. We refer to this gradient estimator as ISD (Importance Sampling- Discrete, given the discrete nature of the Bernoulli variable) which is subject to the following proposition (see Appendix §A.1 for proof). Proposition 3.1. For b ∈ (0, 1), the ISD gradient estimate of Equation 3 is an unbiased estimate of the gradient given in Equation 2. This implies that the mean of ˆg(θ) is still the same as that of the original gradient. Furthermore, Equation (3) has the advantage of allowing flexibility in the frequency of each CL phase without sacrificing the unbiased quality. Indeed, in the case where the gradient is that of a scalar-valued loss or energy function, the guaranties of convergence to a fixed point of the loss that SGD relies on still apply (Shamir & Zhang, 2013; Davis & Drusvyatskiy, 2019; Ghadimi et al., 2016). Crucially, we note that this gradient estimator remains unbi- ased for any b ∈ (0, 1). However, not surprisingly, this new gradient will have higher variance in many cases, resulting in noisier estimates. The following lemmas provide some details about this variance (see Appendix §A.1 for proofs). Lemma 3.2. Assume g+(θ, z+) and g−(θ, z−) are statis- tically independent and the inner product of their means is non-negative. If b ∈ (0, 1), the ISD gradient estimate of Equation 3 has strictly greater variance (quantified by the trace of the covariance of the gradient vector) than the estimate given by Equation 2. Furthermore, the variance, quantified by the trace of the covariance of the gradients, depends non-trivially on the parameter b, making the parameter a target for optimization. To this end: Lemma 3.3. The variance of the gradient estimator given by Equation 3 is a convex function of b. Notably, this minimum can be determined analytically, given estimates of the first and second moments of g+(θ, z+), g−(θ, z−). We explore these properties empir- ically in numerical experiments outlined in §4, and find that (i) networks can still learn effectively with this higher- variance estimator, and (ii) that analytically derived esti- mator variance effects outlined in the Lemmas 3.2 and 3.3 appear to predict observed variance. Finally, we highlight that the variance, quantified by the trace of the covariance matrix, of the ISD estimator scales linearly w.r.t. the covariances and the square magnitudes of the means of the gradients of the two gradient terms. 3.2. Bias of Always-On-Learning and Variable Phase Length in Equilibrium-Based CL The second contribution of this study is to investigate less restrictive learning dynamics for equilibrium-based CL. We drop the subscripts + or − on the network states, z, when the equations discussed apply to either phase. Assume that learning occurs via gradient estimate ˆg. Applying Equa- tion 3 to a standard equilibrium-based CL paradigm would require the following learning dynamics: bt+1 = 1t̸=kT bt + 1t=kT B xt+1 = 1t̸=kT xt + 1t=kT X(bt) zt+1 ∼ p(zt+1|θt, zt, xt+1, bt+1) θt+1 = θt − η(t)ˆg(θt, zt, bt+1), (4) where p is a Markov transition kernel, B is sampled accord- ing to its role in Equation 3, and X is sampled randomly from the set of positive samples if B = 1 or negative sam- ples if B = 0. To indicate that parameter updates only take place at the end of a phase, we set η(t) = η if t = kT and set η(t) = 0 otherwise. Here, T represents phase length and T and k are both in N. While these dynamics are tem- porally local in the sense that it is no longer necessary to hold distinct positive and negative gradient terms in memory, they still require precise manipulation of η and use a fixed phase length. That is to say, we still require the explicit identification of the end of a phase to toggle a parameter update. We now relax these requirements by investigating two novel situations: one where the learning rate is fixed to η(t) = η τ ∀t, and another where the learning rate is fixed to the same value and T is chosen randomly (τ is the phase length or the mean length respectively). We label these two situations Always-On-Learning (AoL) and AoL Random T respectively. The learning dynamics of AoL Random T results in Equation 4 being updated as follows: bt+1 = 1ωt=0bt + 1ωt=1B xt+1 = 1ωt=0xt + 1ωt=1X(bt) zt+1 ∼ p(zt+1|θt, zt, xt+1, bt+1) θt+1 = θt − η τ ˆg(θt, zt, bt+1), (5) where ωt ∼ Bernoulli(μ) ∀t and μ << 1. We remark that this form of continuous updating is only possible with the 5 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning ISD gradient estimator (Equation 3); the standard estimator (Equation 2) requires both phases to have been run before the next gradient estimate can be calculated. As with the gradient estimates presented earlier, we would like to show that the learning dynamics with constant learn- ing rate and variable phase length will, at least within some error bound, follow unbiased gradient steps. The following theorem provides a bound on the bias introduced by training with constant learning rate and stochastic phase lengths. We prove and comment on the assumptions of the theorem in §B of the Appendix. Theorem 3.4. Consider a single phase of equilibrium-based learning where (i) an update is performed at every time-step of the network dynamics with learning rate η τ , and (ii) the phase is either fixed to value τ or ends stochastically at each step with small probability 1 τ . Assume that equilibrium dy- namics evolve for fixed θ according to the Markov transition kernel p(zt|zt−1, θ), and that these equilibrium dynamics weakly converge to a stationary distribution at a rate at least as fast as O( 1 t2 ). Then with mild regularity conditions on ˆg(θ), and integrability conditions on the transition kernel, the bias of the learning updates are of the following order O (cid:17) (cid:16) ηs τ + O(η2τ ), (6) where s = τ m for 0 < m < 1. Remark: For asymptotic unbiasedness, and for learning to occur, we need the error to go to zero with a rate faster than the learning rate, O(η). If we set τ = 1√ η = s2, then the error rate is O(η 5 4 ), satisfying this constraint. If one assumes that the equilibrium dynamics follow a de- terministic dynamical system, zt+1 = F (zt, θt), instead of stochastic Markov dynamics, one can prove the following theorem, which relies on slightly milder assumptions and yields an improved convergence rate (see Appendix §C for proof): Theorem 3.5. Assume the same equilibrium learning paradigm of Theorem 3.4, but with dynamics that evolve for fixed θ according to the homogeneous discrete time dynam- ical system given by the map F (z, θ). Assume that ˆg(θ) is differentiable and bounded with bounded partial derivatives for all network state values, and that F is differentiable w.r.t. z and θ, also with bounded partial derivatives. Finally, assume that the equilibrium dynamics converge to a fixed point at a rate at least as fast as O( 1 t2 ). Then the bias of the learning updates are of the following order: O (cid:17) (cid:16) ηs τ + O(η2), where s = τ m for 0 < m < 1. (7) 6 Importantly, both Theorems 3.4 and 3.5 apply not only to equilibrium-based CL methods, but to any method satisfy- ing the theorem assumptions that uses equilibrium-based gradient updates. Taken together, these results define (mild) conditions for which CL can still converge if parameters are updated at each time step of network dynamics, both with a set phase length and with phases having variable length and switching times. In the next section, we illustrate how these relaxed CL conditions maintain successful learning at a limited cost compared to standard CL. 4. Experimental Findings While the unbiased (and asymptotically unbiased, in the case of equilibrium CL) property of the proposed algorithms pro- vides theoretical evidence for their utility, we wished to test whether the algorithms would work in practice. We em- pirically evaluated the proposed algorithms by using them to modify two different CL methods: maximum likelihood learning in energy based models (LeCun et al., 2006) and the recently proposed, noise contrastive estimation-inspired (Gutmann & Hyv ̈arinen, 2010) Forward-Forward (FF) algo- rithm (Hinton, 2022). For the former paradigm we trained a Restricted Boltzmann Machine (RBM) (Fischer & Igel, 2014), which we selected given its history as a classic model in the computational neuroscience community. For the for- mer, we trained a feed-forward neural network with two hid- den layers. We note that the RBM is an equilibrium-based generative model, while the FF algorithm is non-equilbrium- based and is used to train a discriminative model. Testing was performed on the binarized MNIST (bMNIST) and the Bars And Stripes (BAS) (Fischer & Igel, 2014) datasets for the RBM, and MNIST for the FF-trained network. We chose these datasets because the log-likelihood is tractable for BAS, and because both datasets have been used to bench- mark related models. Because of the issues of temporal non-locality inherent in batch learning we use batch sizes of 1 throughout. For simplicity, we tested only vanilla SGD (Robbins & Monro, 1951), without averaging, momentum, or adaptation, for the RBM; we used ADAM (Kingma & Ba, 2014) to train the forward-forward network. We stress that we are not comparing performance of FF and RBM; rather, we are using them as two different tests of the bio-plausible algorithms proposed in this paper. Implementation details can be found in appendix E. 4.1. Estimators Learn Comparably to Classic Methods We first compared ISD with the gradient estimator given by Equation 3 to the traditional two-term CL estimator (Equation 2) for training a feed-forward neural network (Fig.2.A,C) and a RBM (Fig.2.B,D). In all cases, Fig.2 shows the loss v.s. training time, measured either over gra- Flexible Phase Dynamics for Bio-Plausible Constrastive Learning Figure 2. Comparison of ISD, AoL ISD, and AoL random T ISD variants (ours) with standard temporally non-local methods. A. CL on MNIST: comparison of test and train data learning curves for the temporally non-local Forward-Forward algorithm versus the ISD version. Y-axis is mean classification error; x-axis is gradient steps divided by 1000. B. Equilibrium-based CL on BAS: comparison of 1-step and 100-step CDK algorithm to ISD, AoL ISD, and AoL random T ISD for training an RBM on the BAS dataset. Y-axis is negative log-likelihood; x-axis is gradient steps (phase counts) divided by 1000 for CDK and regular ISD (ISD AoL and ISD AoL Random T ). C. & D. Same plots as A. and B. but with the x-axis rescaled to show the number of 'time' steps used in network dynamics for each algorithm, rather than number of gradient steps or phases (recall that certain algorithms require more or fewer time steps for a single phase). Dotted lines in A. and B. show a step count that corresponds to the number of steps marked by stars in C. and D for each method. In all cases, ISD methods perform only slightly worse than the temporally non-local, learning rate modulated and fixed phase CDK methods, but with greater variance and some reduction in learning speed over phase counts. This speed distinction shrinks when measuring learning over network dynamics time steps rather than gradient steps (phase counts). All plotted quantities are means ±1 standard deviation. For ISD AoL random T the x-axis of D is mean time steps. dient steps-or phase counts for the two AoL algorithm versions-(top row) or number of time steps in network dynamics (bottom row). We highlight the importance of contrasting these distinct temporal units, as standard CL up- dates parameters only at the end of positive/negative phase pairs, each containing several network dynamics iterates (time-steps). In contrast, ISD performs updates more often (either at the end of each phase or at each time step), and the ISD AoL random T version also has a variable phase length. As such, comparing learning curves based on the number of network iterates-the main compute requirement for biological systems-reveals how close ISD methods are to standard CL. As expected, ISD exhibited higher variance learning curves- a result of using a higher variance gradient estimate-but was still able to learn quite robustly and to a degree of ac- curacy only slightly worse than standard two-term gradient estimates. In the case of equilibrium learning, the extra bias introduced by the constant learning paradigm led, again, to a further slight reduction in training accuracy and higher noise, which was further accentuated by introducing ran- dom phase lengths. While we did not perform an extensive hyper-parameter optimization, we noted that the ISD esti- mators tended to require a slightly lower learning rate, and converged slightly slower than the two-term estimators. 4.2. Robustness to Changes in Positive Phase Proportion Next, we wished to explore the effect of parameter b, the proportion of time spent in positive phases during training, for algorithms making use of the gradient in Equation 3. We investigated this property for the RBM model (Fig.3.A). Interestingly, we found that learning is robust to changes in b, and that the optimal value is not always for equal time spent in positive versus negative phases. In fact, we saw better results for a higher b on the bMNIST dataset (see §D 7 A.B.C.D. Flexible Phase Dynamics for Bio-Plausible Constrastive Learning 4.3. Variance of the Gradient Estimate To further interrogate the effect of b on learning, we explored how b affects the variance of the ISD gradient estimator (see Fig.3.B). The gradient estimate is generally a multivariate random variable and thus one uses a covariance matrix to quantify variance. To generalize the variance to higher di- mensions we consider the expected Euclidean distance of the random variable from the mean, which is the trace of the covariance matrix and is equal to the variance in one dimension. Given the means and covariances of g+(θ, z+) and g−(θ, z−), one can derive the trace of the covariance matrix of ˆg(θ) as a function of b (see §A.1). It is this func- tion that is plotted for different assumed values of the means and traces of the covariances of g+(θ, z+) and g−(θ, z−) in Fig.3.B. We observe that higher (lower) values of b lead to less variance when g+(θ, z+) has lower (higher) vari- ance than g−(θ, z−). We hypothesize that the effect of b on estimator variance may underlie b's effect on learning. Specifically, the variance of the ISD estimator is, for ap- propriately chosen gradient step-sizes, a convex function of b with rather low curvature around the local minimum (Fig.3.B). Because the variance of the ISD estimator, as a function of b, does not increase quickly near the minimum, there is a range of values with sufficiently low variance to allow for robust learning. Lastly, we know from the theory section that the trace of the covariance of ˆg(θ) is a convex function of the positive phase parameter b ∈ (0, 1), so the value of b leading to minimal estimator variance is unique. If the effect of b on learning is primarily via its effect on the variance of the ISD estimator, the convexity of this function could be used to simplify hyper-parameter initialization. Specifically, one can estimate means and covariances of the positive and negative phase gradient terms and then use our theoretical results (§A.1 Equation 11) to solve for the value of b that produces the minimal estimator variance analytically. 5. Discussion This work has implications for experimental and theoreti- cal neuroscience, and neuromorphic computing. For neu- roscience, it indicates that a lack of periodicity or sharp learning rate modulation in a neural circuit is not a basis for discounting CL as a potential algorithm implemented by that circuit. Our results add to a body of literature (Illing et al., 2021; Laborieux & Zenke, 2022; Pogodin & Latham, 2020) motivating an experimental search for global state variables, e.g. b, that should be broadcast to all neurons in a network– perhaps via neuromodulatory signals–to enable learning. In particular, we demonstrate that biological systems im- plementing CL need not necessarily rely on an oscillatory global signal, as has been previously proposed (Baldi & Pineda, 1991; Laborieux & Zenke, 2022), but could instead Figure 3. Algorithm performance as function of positive phase probability, b. Performance is robust to changes in this param- eter, and the optimal value is not always at b = 0.5. We ex- pect this relationship to be due to the variance of the estima- tor. A. Performance on BARS dataset for RBM trained using ISD and ISD with constant learning rate. Error bars are ±1 standard deviation. B. Gradient estimator covariance matrix trace as function of positive-phase probability, calculated ana- lytically. Different scenarios depict distinct values of the nega- tive phase's gradient estimator covariance trace, holding the pos- itive phase covariance trace constant at 0.5; e.g. solid line is for TR(cid:2)cov(cid:0)g+(θ, z+)(cid:1)(cid:3) = Tr(cid:2)cov(cid:0)g−(θ, z−)(cid:1)(cid:3) = 0.5. These quantities are a measure of variance of the estimators. Blue lines are the traces of the covariance matrix of the gradient estimate in Equation 3, grey are for that of Equation 2. To simplify the plot we have assumed that the means of g+(θ, z+) and g−(θ, z−) are both the zero vector. of the Appendix), and better results for lower values of b on the BAS dataset. Robustness to parameter changes was substantial, with values as high as 0.8 and as low as 0.2 not performing drastically worse than the best-performing b. The mean of the ISD estimator is the same regardless of the ratio of positive to negative phases, so ISD will remain an unbiased estimator as b changes. Conversely, the variance of the ISD estimator depends on b, a phenomenon that we conjecture to underlie the observed robustness of learning to changes in this parameter. High variance detrimentally affects learning by requiring lower learning rates for an ac- curate gradient estimate-essentially averaging over more learning steps-and, in absence of this, can result in insta- bility. We investigate ISD estimator variance in the next section. 8 A.B.B. Flexible Phase Dynamics for Bio-Plausible Constrastive Learning implement phase switching through a more stochastic form of gating. This could correspond behaviourally to saccades (Illing et al., 2021) or periods of rest associated with hip- pocampal replay events (Davidson et al., 2009), for example. Furthermore, our research exhibits two opportunities for syn- ergy with other recent neuroscience literature. First, it has been hypothesized that neural activation dynamics encode probabilities by sampling (Echeveste et al., 2020). Our work provides a potential path to learning bio-plausible probabilis- tic sampling networks: probabilistic models can be framed as energy based models with a negative log-likelihood en- ergy function (Ackley et al., 1985; LeCun et al., 2006), and the gradient of such a model is of the two-term CL style dis- cussed herein. Second, several recent studies of equilibrium learning provide powerful new learning models, but lack theoretical guarantees for concurrent, online, latent space and learning dynamics (Laborieux & Zenke, 2022; Meule- mans et al., 2022). Our study provides guarantees that may be of use, with Theorems 3.4 and 3.5. For neuromorphic computing, this work provides theoreti- cal and empirical motivation for CL algorithms with more relaxed memory requirements than those of traditional, tem- porally non-local approaches. Thus, it provides a potential path towards simplifying CL and equilibrium CL algorithms to be more easily implemented on neuromorphic hardware, analogous to past work on Equilibrium Propagation (Ernoult et al., 2020) but for a much broader algorithm class. It is our hope that this will aid in the development of more energy- efficient deep learning. The lesser memory requirements of the proposed gradient es- timator come at the cost of higher estimator variance. In our study this manifested in a need for reduced learning rates, effectively averaging over more gradient steps to combat this variance increase, and further resulted in slight reduc- tions in algorithm performance. This is a clear example of an (at least approximately) unbiased algorithm that trades lower variance for locality. Interestingly, such a trade-off has been noted before for spatial locality (Richards et al., 2019), as opposed to the temporal locality explored in this study. Further work is warranted to determine whether such a locality-variance trade-off is a general phenomenon for unbiased gradient estimators. It bears mentioning that the added noise in our learning rule is not a priori effected by the curse of dimensionality, as is the case for certain classic computational neuroscience algorithms (Werfel et al., 2003). The additional variance introduced by ISD is caused by the variation of a single, scalar Bernoulli variable, b; therefore, as shown in Equation 10, ISD inherits much of its variance from the behaviour of the positive and negative phase terms of the CL learning rule it is based upon. This work is, to our knowledge, the first to provide a prin- cipled method of manipulating the amount of time spent in the positive versus negative phase for CL, via the impor- tance sampling positive-phase probability b. Further work is warranted to determine how this might be generalized to other biphasic algorithms, like Wake-Sleep (Dayan et al., 1995), and how this parameter might be leveraged for com- putational benefits. In particular one might be able to trade compute for data in sparse data regimes. In the case of a very low b an algorithm might still perform well using few positive phases-and thus few data points-compared with the equal number of positive and negative phases re- quired by a traditional CL approach. Ultimately, our results provide a compelling example where a gradient estimator with markedly more variance still enables effective learning, while providing important benefits for memory storage and temporal locality. 6. Conclusion In this study we proposed an alternative, temporally local gradient estimate for CL, which can be applied to any CL algorithm that uses a two-term gradient to learn from posi- tive and negative phases. We further proved two theorems applying to algorithms that require equilibrium dynamics to be run to obtain the gradient estimate used at each step of gradient descent. This theorem shows that equilibrium- based algorithms that allow learning to continue during the dynamic phases and, moreover, have stochastic phase lengths, will still exhibit asymptotically unbiased gradients in the small learning rate long mean phase-length limit. No- tably, this theorem applies, with some basic assumptions, to all equilibrium-based algorithms, contrastive or otherwise. This theory work was supported by the experiments pre- sented above. In summary, this work suggests that CL does not require the precisely regulated, periodic learning dynam- ics that are classically used to train this form of AI, thus extending the set of systems capable of implementing CL beyond what might have been previously thought possible. Acknowledgements The authors acknowledge support from Samsung Electron- ics Co., Ldt. and the Simons Foundation Collaboration for the Global Brain. GL acknowledges the support from Canada CIFAR AI Chair Program, as well as NSERC Dis- covery Grant [RGPIN-2018-04821] and the Canada Re- search Chair in Neural Computations and Interfacing (CIHR, tier 2). EW acknowledges support from three scholarships: a NSERC CGS-D, a FRQNT B2X, and a UNIQUE Excel- lence Scholarship. Authors wish to thank the other members of the Lajoie lab for their support; in particular, Maximilian Puelma Touzel and Alexandre Payeur for the helpful con- versations, and Mohammad Pezeshki for inspiration in the coding of the forward-forward algorithm. 9 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning References Ackley, D. H., Hinton, G. E., and Sejnowski, T. J. A learning algorithm for boltzmann machines. Cognitive science, 9 (1):147–169, 1985. Baldi, P. and Pineda, F. Contrastive learning and neural oscillations. Neural computation, 3(4):526–545, 1991. Bishop, C. M. and Nasrabadi, N. M. Pattern recognition and machine learning, volume 4. Springer, 2006. Cao, Y., Summerfield, C., and Saxe, A. Characterizing emergent representations in a space of candidate learning rules for deep networks. Advances in Neural Information Processing Systems, 33:8660–8670, 2020. Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A simple framework for contrastive learning of visual rep- In International conference on machine resentations. learning, pp. 1597–1607. PMLR, 2020. Crick, F. and Mitchison, G. The function of dream sleep. Nature, 304(5922):111–114, 1983. Davidson, T. J., Kloosterman, F., and Wilson, M. A. Hip- pocampal replay of extended experience. Neuron, 63(4): 497–507, 2009. Davis, D. and Drusvyatskiy, D. Stochastic model-based minimization of weakly convex functions. SIAM Journal on Optimization, 29(1):207–239, 2019. Dayan, P., Hinton, G. E., Neal, R. M., and Zemel, R. S. The helmholtz machine. Neural computation, 7(5):889–904, 1995. Diederich, S. and Opper, M. Learning of correlated patterns in spin-glass networks by local learning rules. Physical review letters, 58(9):949, 1987. Echeveste, R., Aitchison, L., Hennequin, G., and Lengyel, M. Cortical-like dynamics in recurrent circuits optimized for sampling-based probabilistic inference. Nature neuro- science, 23(9):1138–1149, 2020. Ernoult, M., Grollier, J., Querlioz, D., Bengio, Y., and Scel- lier, B. Equilibrium propagation with continual weight updates. arXiv preprint arXiv:2005.04168, 2020. Fischer, A. and Igel, C. Training restricted boltzmann ma- chines: An introduction. Pattern Recognition, 47(1): 25–39, 2014. Frenkel, C., Bol, D., and Indiveri, G. Bottom-up and top- down neural processing systems design: Neuromorphic intelligence as the convergence of natural and artificial intelligence. arXiv preprint arXiv:2106.01288, 2021. Friston, K. A theory of cortical responses. Philosophical transactions of the Royal Society B: Biological sciences, 360(1456):815–836, 2005. Ghadimi, S., Lan, G., and Zhang, H. Mini-batch stochastic approximation methods for nonconvex stochastic com- posite optimization. Mathematical Programming, 155(1): 267–305, 2016. Gutmann, M. and Hyv ̈arinen, A. Noise-contrastive estima- tion: A new estimation principle for unnormalized statisti- cal models. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 297–304. JMLR Workshop and Conference Proceedings, 2010. Hennequin, G., Ahmadian, Y., Rubin, D. B., Lengyel, M., and Miller, K. D. The dynamical regime of sensory cortex: stable dynamics around a single stimulus-tuned attractor account for patterns of noise variability. Neuron, 98(4): 846–860, 2018. Hinton, G. The forward-forward algorithm: Some prelim- inary investigations. arXiv preprint arXiv:2212.13345, 2022. Hinton, G. E. Training products of experts by minimizing contrastive divergence. Neural computation, 14(8):1771– 1800, 2002. Hinton, G. E., Sejnowski, T. J., and Ackley, D. H. Boltzmann machines: Constraint satisfaction networks that learn. Carnegie-Mellon University, Department of Computer Science Pittsburgh, PA, 1984. Illing, B., Ventura, J., Bellec, G., and Gerstner, W. Local plasticity rules can learn deep representations using self- supervised contrastive predictions. Advances in Neural Information Processing Systems, 34:30365–30379, 2021. Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Laborieux, A. and Zenke, F. Holomorphic equilibrium propagation computes exact gradients through finite size oscillations. arXiv preprint arXiv:2209.00530, 2022. Lake, B. M., Ullman, T. D., Tenenbaum, J. B., and Gersh- man, S. J. Building machines that learn and think like people. Behavioral and brain sciences, 40, 2017. Lasota, A. and Mackey, M. C. Chaos, fractals, and noise: stochastic aspects of dynamics, volume 97. Springer Science & Business Media, 1998. LeCun, Y., Chopra, S., Hadsell, R., Ranzato, M., and Huang, F. A tutorial on energy-based learning. Predicting struc- tured data, 1(0), 2006. 10 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning Lillicrap, T. P., Cownden, D., Tweed, D. B., and Akerman, C. J. Random synaptic feedback weights support error backpropagation for deep learning. Nature communica- tions, 7(1):1–10, 2016. Schuman, C. D., Kulkarni, S. R., Parsa, M., Mitchell, J. P., Date, P., and Kay, B. Opportunities for neuromorphic computing algorithms and applications. Nature Compu- tational Science, 2(1):10–19, 2022. Meulemans, A., Zucchet, N., Kobayashi, S., Von Oswald, J., and Sacramento, J. The least-control principle for local learning at equilibrium. Advances in Neural Information Processing Systems, 35:33603–33617, 2022. Shamir, O. and Zhang, T. Stochastic gradient descent for non-smooth optimization: Convergence results and opti- mal averaging schemes. In International conference on machine learning, pp. 71–79. PMLR, 2013. Sorscher, B., Mel, G. C., Ocko, S. A., Giocomo, L. M., and Ganguli, S. A unified theory for the computational and mechanistic origins of grid cells. Neuron, 2022. Srinivasan, M. V., Laughlin, S. B., and Dubs, A. Predictive coding: a fresh view of inhibition in the retina. Proceed- ings of the Royal Society of London. Series B. Biological Sciences, 216(1205):427–459, 1982. Strubell, E., Ganesh, A., and McCallum, A. Energy and policy considerations for modern deep learning research. In Proceedings of the AAAI Conference on Artificial In- telligence, volume 34, pp. 13693–13696, 2020. Werfel, J., Xie, X., and Seung, H. Learning curves for stochastic gradient descent in linear feedforward net- works. Advances in neural information processing sys- tems, 16, 2003. Yin, G. and Zhang, Q. Discrete-time Markov chains: two-time-scale methods and applications, volume 55. Springer Science & Business Media, 2005. Movellan, J. R. Contrastive hebbian learning in the continu- ous hopfield model. In Connectionist models, pp. 10–17. Elsevier, 1991. Oord, A. v. d., Li, Y., and Vinyals, O. Representation learn- ing with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. Ororbia, A. and Mali, A. The predictive forward-forward algorithm. arXiv preprint arXiv:2301.01452, 2023. Payeur, A., Guerguiev, J., Zenke, F., Richards, B. A., and Naud, R. Burst-dependent synaptic plasticity can coordi- nate learning in hierarchical circuits. Nature neuroscience, 24(7):1010–1019, 2021. Pogodin, R. and Latham, P. Kernelized information bot- tleneck leads to biologically plausible 3-factor hebbian learning in deep networks. Advances in Neural Informa- tion Processing Systems, 33:7296–7307, 2020. Rao, R. P. and Ballard, D. H. Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nature neuroscience, 2(1):79–87, 1999. Richards, B. A., Lillicrap, T. P., Beaudoin, P., Bengio, Y., Bogacz, R., Christensen, A., Clopath, C., Costa, R. P., de Berker, A., Ganguli, S., et al. A deep learning frame- work for neuroscience. Nature neuroscience, 22(11): 1761–1770, 2019. Robbins, H. and Monro, S. A stochastic approximation method. The annals of mathematical statistics, pp. 400– 407, 1951. Robert, C. P., Casella, G., and Casella, G. Monte Carlo statistical methods, volume 2. Springer, 1999. Rosenthal, J. S. Convergence rates for markov chains. Siam Review, 37(3):387–405, 1995. Scellier, B. and Bengio, Y. Equilibrium propagation: Bridg- ing the gap between energy-based models and backprop- agation. Frontiers in computational neuroscience, 11:24, 2017. 11 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning A. Importance Sampling - Discrete (ISD) Gradient Estimate A.1. Bias and Variance of ISD In this section we investigate the bias and variance of the ISD estimator. First, we restate the standard CL gradient estimator and the ISD estimator, along with Proposition 3.1 and Lemmas 3.2 and 3.3 for ease of reference. The standard two term estimate, Equation 2 in the main paper, is ˆg(θ) = g+(θ, z+) − g−(θ, z−), and the ISD gradient estimate, Equation 3 in the main paper, is ˆg(θ) = B b g+(θ, z+) − 1 − B 1 − b g−(θ, z−). (8) (9) Proposition A.1. For b ∈ (0, 1), the ISD gradient estimate of Equation 3 is an unbiased estimate of the gradient given in Equation 2. Proof. Follows trivially by taking expectations w.r.t. B and observing that, for a Bernoulli random variable, the expectation is equal to the parameter b so that the b and 1 − b fraction denominators disappear. Remark 1: We further note that this is, by definition, a single-sample importance sampling approach to evaluating the expected value E(cid:0)f (B)(cid:1), this being the two-term sum of Equation 8, if f (1) = g+(θ, z+) and f (0) = g−(θ, z−). Remark 2: In the case where b = 0.5, an alternative perspective on this estimate is that it is a version of stochastic gradient descent style uniform sampling from an augmented dataset. This augmented set is composed of all positive and negative samples, each sample augmented with an extra variable indicating whether the sample is positive or negative. This extra variable is then used to determine whether the gradient is added or subtracted to the current parameter value. Lemma A.2. Assume g+(θ, z+) and g−(θ, z−) are statistically independent and the inner product of their means is non-negative. If b ∈ (0, 1), the ISD gradient estimate of Equation 3 has strictly greater variance (quantified by the trace of the covariance of the gradient vector) than the estimate given by Equation 2. Lemma A.3. The variance of the gradient estimator given by Equation 3 is a convex function of b on (0, 1). Let us define Σ+ = cov(cid:0)g+(θ, z+)(cid:1), Σ− = cov(cid:0)g−(θ, z−)(cid:1), Σ+− = cov(cid:0)g+(θ, z+), g−(θ, z−)(cid:1), μ+ = E(cid:0)g+(θ, z+)(cid:1), and μ− = E(cid:0)g−(θ, z−)(cid:1) To prove the first Lemma, we first note that the covariance matrix of the standard CL gradient estimate given by Equation 8 is Σ+ + Σ− − 2Σ+−. We now prove the following proposition, which provides the bulk of the proof of the two lemmas: Proposition A.4. Assume b ∈ (0, 1). The covariance matrix for the ISD gradient estimate vector defined by Equation 9 is Σ = 1 b Σ+ + 1 1 − b Σ− + 1 − b b μ+μ⊤ + + b 1 − b μ−μ⊤ − + μ+μ⊤ − + μ−μ⊤ +. (10) Moreover, the trace of this matrix is a convex function of b, with minimum at bmin = (cid:113) Tr[Σ+ + μ+μ⊤ +] − Tr[Σ+ + μ+μ⊤ Tr[Σ+ + μ+μ⊤ +]Tr[Σ− + μ−μ⊤ −] +] − Tr[Σ− + μ−μ⊤ −] , (11) Proof. We wish to calculate the covariance of the gradient estimate, as a function of b, to compare with the covariance of the original gradient estimate, and to see when the trace of this covariance is minimized w.r.t. b. Note that we use the trace of the covariance instead of the variance since we are working in a multi-dimensional space. We begin by deriving the matrix of second moments of the gradient vector, which we denote by corr. We also define f+(θ, z+) = B b g+(θ, z+) and f−(θ, z−) = − 1−B 1−b g−(θ, z−) to simplify notation. Now, note that under this notation, the ith element of the ISD gradient 12 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning vector estimate is f+(θ, z+)i + f−(θ, z−)i. Thus corr(cid:0)f+(θ, z+)i + f−(θ, z−)i, f+(θ, z+)j + f−(θ, z−)j (cid:1) (cid:20) = E f+(θ, z+)if+(θ, z+)j + f+(θ, z+)if−(θ, z−)j + f+(θ, z+)jf−(θ, z−)i + f−(θ, z−)if−(θ, z−)j (cid:21) (cid:20) = E f+(θ, z+)if+(θ, z+)j + f−(θ, z−)if−(θ, z−)j (cid:21) = 1 b [Σ+ij + μ+iμ+j] + 1 1 − b [Σ−ij + μ−iμ−j], (12) where in the second line we used linearity of expectation and the fact that B(1 − B) = 0, and the in third line we used the form of the second moments of a Bernoulli random variable and the relationship between covariance and the second moment. Subtracting the means to arrive at the covariance and rearranging, we get Equation 10. Observe that this function has vertical asymptotes at b = 0 and b = 1. We are interested in finding the minimum of the trace of the matrix w.r.t. b on the interval α ∈ (0, 1). Differentiating gives ∂Tr[Σ] ∂b = − = − 1 1 b2 Tr[Σ+] + 1 b2 Tr[Σ+ + μ+μ⊤ (1 − b)2 Tr[Σ−] − 1 b2 Tr[μ+μ⊤ +] + 1 (1 − b)2 Tr[μ−μ⊤ −] +] + 1 (1 − b)2 Tr[Σ− + μ−μ⊤ −] Setting this equal to zero and solving for b using the quadratic formula gives: (cid:113) Tr[Σ+ + μ+μ⊤ +] ± Tr[Σ+ + μ+μ⊤ Tr[Σ+ + μ+μ⊤ +]Tr[Σ− + μ−μ⊤ −] +] − Tr[Σ− + μ−μ⊤ −] b = (13) (14) . Some simple algebra shows that only the difference and not the sum in the above equation yields a critical point on the interval (0, 1), so the difference is the minimum we desire. Finally, differentiating one more time gives: ∂2Tr[Σ] ∂b2 = 2 b3 Tr[Σ+ + μ+μ⊤ +] + 2 (1 − b)3 Tr[Σ− + μ−μ⊤ −]. (15) The trace of the sum of a covariance matrix and a vector outer product is positive, so this expression is positive on (0, 1), thus we get a convex function of b on this interval. Lemma A.3 is proven by the proof of the above proposition. For Lemma A.2, it suffices to note that if g+(θ, z+) is statistically independent of g−(θ, z−) then their covariance is given by Σ+ + Σ−. The proof of Lemma A.2 follows by the −) = Tr(μ−μ⊤ linearity of the trace and the assumption that Tr(μ+μ⊤ +μ− ≥ 0. +) = μ⊤ B. Bias of Constant Learning Rate for Equilibrium Learning Gradient Estimates We investigate an equilibrium learning system where, to estimate the gradient needed for one parameter update, ˆg(θ), one must run internal dynamics, following a Markov chain, on some activation space Z until these dynamics are sufficiently close to an equilibrium. We investigate the question of how much bias is introduced into the SGD dynamics of this equilibrium-learning system when, instead of fixing θ during each phase of dynamics before each gradient step, one allows gradient steps to be taken at every step of the dynamics. Specifically, we are interested in proving Theorem 3.4. In an abuse of notation we allow p to represent any probability density (or mass function) appearing in the proof, with each distribution being discerned by the arguments-e.g. p(zt|z0, θ) = (cid:82) k=1 p(zk|zk−1, θ)dz1 . . . dzt−1 is a t step transition kernel and p(zk|zk−1, θ) is a single step transition. We adopt a discrete time framework with t ∈ N given that SGD is typically implemented in discrete time, though we expect similar results for continuous time. The proposed Z×***×Z (cid:81)t 13 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning algorithm views each stimulus, or samples from its internal model, for T time-steps and the learning rate at each time-step is scaled by a factor of 1 τ , which is the mean of T . We use θt ∈ Θ ∀ t to denote the parameter value at time t, and zt to denote the network state at this time. η denotes the learning rate before scaling by the inverse of τ . Theorem B.1. Consider a single phase of equilibrium-based learning where the phase is either fixed to value τ or ends stochastically at each step with small probability 1 τ and, instead of waiting until the end of the phase to do an update with learning rate η, an update is performed at every step of the equilibrium dynamics with learning rate η τ . Assume that equilibrium dynamics evolve for fixed θ according to the Markov transition kernel p(zt|zt−1, θ). Further assume that ˆg(θ) is differentiable and bounded, with a bounded derivative, for all network state values, the Markov kernel for the equilibrium dynamics is continuously differentiable w.r.t. θ for all network state values, the k-step kernel p(zt|zt−k, θ) is bounded w.r.t. (cid:12) (cid:12) zt−1 for all parameter values, and the function Γ(x) = (cid:82) (cid:12) (cid:12) (cid:12)p(y|z0, θ0)dy is integrable for the given initial (cid:12) conditions and all values of ξmax. Finally, assume that the equilibrium dynamics converge to a stationary distribution weakly with a rate as least as fast as O( 1 t2 ). Then the bias of the learning updates are of the following order: ∂p(x|y,ξmax) ∂θ Z O (cid:17) (cid:16) ηs τ + O(η2τ ), (16) where s = τ m for 0 < m < 1 and O is big-O notation. Remark on dimension of parameters: The following proof relies very heavily on the multivariate corollary of the mean value theorem, which we state in section B.3 for completeness. B.1. Proof of Theorem 3.4 Proof. In what follows we restrict t to the interval [0, T )-that is, one period of learning. T can either be chosen deterministically or stochastically, as we will discuss below. The full dynamics of network state and parameter updates are given by the following equations: zt+1 ∼ p(zt+1|zt, θt) θt+1 = θt − η τ ˆg(zt, θt), (17) where ˆg is the gradient estimate for the model, p(zt+1|zt, θ) is, for fixed θ, the transition function of a homogeneous Markov chain that we assume converges uniquely to the stationary distribution of the model. Thus, if we set θt = θ for all t, {zt}T t=0 would be a Markov chain performing MCMC sampling from our probability model with parameter θ. However, given the dependence on θt, {zt}T t=0 is not performing exact MCMC sampling and is, in fact, not even a Markov chain, due to the sequence of temporal dependencies induced by θt. Lastly, we note that, conditioned on zt, θt+1 is a deterministic variable since the input stimulus is not changing over the period [0, T ) and the only source of randomness is via z. Our goal is to prove that the sum of parameter changes over the phase t ∈ [0, T ), which we denote by the random variable G(z0, θ0), is asymptotically unbiased in the limit of small learning rate, η, and long mean stimulus presentation time, τ . That is, we will prove the following: E(cid:2)G(z0, θ)(cid:3) = ηˆg(θ) + O (cid:17) (cid:16) ηs τ + O(η2τ ). (18) To this end, we simply linearize about θ0 so as to remove the temporal dependence brought about by the continued learning. This allows us to make use of the convergence properties of the homogeneous Markov chain. We now proceed in three steps: (1) expand ˆg to remove the dependence of the gradient, via θt, on the slow learning timescale; (2) expand p(zt|z0, θ0) to remove the rest of the expectation's dependence-via the system's internal dynamics-on the slow timescale; (3) leverage the convergence of the homogeneous Markov chain to the stationary distribution to obtain samples to approximate the desired expectations. Steps (1) and (2) jointly lead to the error term that is quadratic in η, in Equation 18, and step (3) results in the other error term. Before embarking on the three main steps of the proof, we must first engage in a preliminary analysis to account for stochastic phase lengths. 14 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning Preliminary for Stochastic Phase Length: Using the law of total expectation (tower property), and defining the random variable Ts = 1T ≥s E(cid:2)G(z0, θ)(cid:3) = E(cid:2)E[G(z0, θ)|Ts](cid:3) = E[G(z0, θ)|Ts = 1]p(Ts = 1) + E[G(z0, θ)|Ts = 0]p(Ts = 0) = E[G(z0, θ)|Ts = 1] + (cid:0)E[G(z0, θ)|Ts = 0] − E[G(z0, θ)|Ts = 1](cid:1)p(Ts = 0). (19) Observe that, by the assumption that the gradient updates are bounded, G(z0, θ0) ≤ K1ηT /τ for some constant K1. Furthermore, it can be shown that p(Ts = 0) = O(s/τ ) (as we demonstrate in §B.4). Thus E(cid:2)G(z0, θ)(cid:3) = E[G(z0, θ)|Ts = 1] + O (cid:16) ηsE(T ) τ 2 (cid:17) = E[G(z0, θ)|Ts = 1] + O (cid:17) , (cid:16) ηs τ (20) where we have used E(T ) = τ (see §B.5). What Equation 20 means is that, for a large enough average phase length, we can assume that we are dealing with a value of T that is larger than some deterministic value, s, even in the case of stochastic phase lengths–albeit with the above error term. Moreover, if we apply the tower property again, we get: E[G(z0, θ)|Ts = 1] = ET (cid:2)E[G(z0, θ)|T ]|Ts = 1(cid:3). (21) For the three main steps of the proof we will thus analyze the inner expectation, E[G(z0, θ)|T ] (in an abuse of notation we will refrain from explicitly writing the condition that T ≥ s), the analysis of which is equivalent to the case of a deterministic phase length. At the end of the proof we will take into account the stochasticity in T . We now proceed to the three main steps of the proof. Step 1: This section is a straightforward application of Lemma B.3. Observe that one can write the parameter dynamics as: and thus, θt = θ0 + η τ t−1 (cid:88) k=0 ˆg(zk, θk), G(z0, θ0) = η τ T −1 (cid:88) t=0 ˆg(zt, θt). (22) (23) Let us focus on the jth element of ˆg. Assuming that ˆg ∈ C0(θ) (differentiable w.r.t. θ), we can expand it to first order about θ0: ˆgj(zt, θt) = ˆgj (cid:16) zt, θ0 + η τ t−1 (cid:88) k=0 (cid:17) ˆg(zk, θk) = ˆgj(zt, θ0) + O (cid:16) η τ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) t−1 (cid:88) k=0 ˆg(zk, θk) (cid:17) . (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)1 (24) If we assume that the gradient is bounded (e.g. we clip the gradient above some sufficiently large value), and that the partial derivatives of the gradient w.r.t. θ are bounded, then the second term on the RHS is O(cid:0)t η (cid:1). Thus, τ G(z0, θ0) = η τ T −1 (cid:88) t=0 ˆg(zt, θ0) + O (cid:16) η2 τ 2 (cid:17) T −1 (cid:88) t. t=0 The last factor in the final sum is order T 2 by the quadratic nature of the triangular summation. Step 2: By linearity of expectation, and using the results of step 1, E(cid:2)G(z0, θ0)|T (cid:3) = η τ T −1 (cid:88) t=0 E(cid:2)ˆg(zt, θ0)(cid:3) + O (cid:16) η2 T 2 τ 2 (cid:17) . 15 (25) (26) Flexible Phase Dynamics for Bio-Plausible Constrastive Learning Focusing on the tth expectation on the RHS: E(cid:2)ˆg(zt, θ0)|T (cid:3) = (cid:90) Z ˆg(zt, θ0)p(zt|z0, θ0)dzt, (27) Focusing specifically on the probability, we get: p(zt|z0, θ0) = = = (cid:90) (cid:90) Z (cid:90) Θ (cid:90) Z (cid:90) Θ (cid:90) Z Θ p(zt, zt−1, θt−1|z0, θ0)dθt−1dzt−1 p(zt|zt−1, θt−1, z0, θ0)p(zt−1, θt−1|z0, θ0)dθt−1dzt−1 (28) p(zt|zt−1, θt−1)p(zt−1, θt−1|z0, θ0)dθt−1dzt−1, where, in the final line, we used the dependence structure of the MCMC dynamics. Let us define ∆θt = η k=0 ˆg(zk, θk) and use again our assumption that the gradient is bounded, so that in t steps τ ||∆θt||1 ≤ ∆maxθt, a deterministic quantity. Assume further that the transition function is differentiable w.r.t. θ (in most cases this follows from our assumption that ˆg is differentiable). Then, the mean value theorem (see Lemma B.3), we have: (cid:80)t−1 (cid:90) (cid:90) = (cid:20) p(zt|zt−1, θ0) + ∆θt−1 * Z Θ ∂p(zt|zt−1, ξt−1) ∂θ (cid:21) p(zt−1, θt−1|z0, θ0)dθt−1dzt−1 (29) where ξt−1 is in a cube of edge length ||∆θt−1||1 centered at θ0, and is a random variable on account of the variability in ∆θt. We now proceed as follows (cid:90) (cid:90) Θ Z (cid:90) (cid:90) Θ Z (cid:90) = + = + p(zt|zt−1, θ0)p(zt−1, θt−1|z0, θ0)dθt−1dzt−1 ∆θt−1 * ∂p(zt|zt−1, ξt−1) ∂θ p(zt−1, θt−1|z0, θ0)dθt−1dzt−1 p(zt|zt−1, θ0)p(zt−1|z0, θ0)dzt−1 Z (cid:90) (cid:90) Z Θ ∆θt−1 * ∂p(zt|zt−1, ξt−1) ∂θ p(zt−1, θt−1|z0, θ0)dθt−1dzt−1 The second term on the RHS of the final line is a bias term, which we will now bound. Observe: (cid:90) (cid:90) ∆θt−1 * (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∂p(zt|zt−1, ξt) ∂θ p(zt−1, θt−1|z0, θ0)dθt−1dzt−1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∆maxθt−1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∂p(zt|zt−1, ξt−1) ∂θ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)1 p(zt−1, θt−1|z0, θ0)dθt−1dzt−1, Z (cid:90) Θ (cid:90) Z Θ ≤ (30) (31) where the inequality follows from Jensen's inequality, to bring the absolute values inside the integral, and the use of ∆maxθt−1. Integrating out the parameters at time t − 1 and applying ∆maxθt−1 ≤ ∆maxθT , = ∆maxθT (cid:90) Z (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∂p(zt|zt−1, ξmax) ∂θ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)1 p(zt−1|z0, θ0)dzt−1 = O (cid:17) (cid:16) η T τ Γ(zt), 16 (32) Flexible Phase Dynamics for Bio-Plausible Constrastive Learning where we have used the fact that O(∆maxθT ) = O(cid:0)η T C1(θ), so that by continuity on the compact cube of edge length ∆maxθT centered at θ0 we get (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:82) (cid:1). We have further assumed that the transition function is ≤ for some value of ξmax. Lastly, we have simplified the expression with the function Γ(x) = ∂p(zt|zt−1,ξmax) ∂θ ∂p(zt|zt−1,ξt−1) ∂θ p(y|z0, θ0)dy defined in the theorem statement. We now have: (cid:12) (cid:12) (cid:12)1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) τ ∂p(x|y,ξmax) ∂θ (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Y (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12)1 (cid:12) p(zt|z0, θ0) = (cid:90) Z p(zt|zt−1, θ0)p(zt−1|z0, θ0)dzt−1 + O (cid:17) (cid:16) η T τ Γ(zt). (33) If t = 2 we stop here. For t > 2, observe that the second factor in the integrand is simply the original transition function moved one time-step back in time, and that the steps we have gone through to arrive at this point work for an arbitrary time-step. That is, for k ∈ {2, . . . , T }, we have: p(zk|z0, θ0) = (cid:90) Z p(zk|zk−1, θ0)p(zk−1|z0, θ0)dzk−1 + O (cid:17) (cid:16) η T τ Γ(zk), (34) This suggests taking a recursive approach to expanding p(zt|z0, θ0), which is what we do now. Applying Equation 34 to expand Equation 33, and writing p(zt|zt−1, θ0) = p(zt|zt−1), we get: (cid:90) p(zt|z0, θ0) = p(zt|zt−1)p(zt−1|zt−2)p(zt−2|z0)dzt−2 × dzt−1 Z×Z (cid:90) + Z p(zt|zt−1)O (cid:17) (cid:16) η T τ Γ(zt−1)dzt−1 + O (cid:17) (cid:16) η T τ Γ(zt). Applying the recursive Equation 34 t − 3 more times yields the following (cid:90) = * * * (cid:90) t−1 (cid:89) Z Z k=0 p(zt−k|zt−k−1, θ0)dz1 . . . dzt−1 t−1 (cid:88) (cid:90) + k=1 Z p(zt|zt−k)O (cid:17) (cid:16) η T τ Γ(zt−k)dzt−k + O (cid:17) (cid:16) η T τ Γ(zt). We now insert Equation 36 into Equation 27: E(cid:2)ˆg(zt, θ0)|T (cid:3) = + + = (cid:90) Z (cid:90) Z (cid:90) Z (cid:90) Z ˆg(zt, θ0) (cid:90) * * * (cid:90) t−1 (cid:89) Z Z k=0 p(zt−k|zt−k−1, θ0)dz1 . . . dzt t−1 (cid:88) (cid:90) ˆg(zt, θ0) k=1 (cid:16) ˆg(zt, θ0)O η Z T τ ˆg(zt, θ0) (cid:90) * * * p(zt|zt−k)O (cid:16) η T τ (cid:17) Γ(zt−k)dzt−kdzt (cid:17) (cid:90) Γ(zt)dzt t−1 (cid:89) p(zt−k|zt−k−1, θ0)dz1 . . . dzt + O Z Z k=0 (35) (36) (cid:16) η (cid:17) , T 2 τ (37) where for the last equality we used our previous assumption that ˆg(zt, θ0) is bounded, along with the assumption that p(zt|zt−k) is bounded w.r.t. zt−k and that Γ(zt−k) is integrable, for k ∈ {0, . . . , t − 1}. 17 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning Now inserting this in Equation 26 we get: T −1 (cid:88) (cid:90) ˆg(zt, θ0)pt(zt)dzt + O (cid:17) (cid:16) η2 T 3 τ 2 E(cid:2)G(z0, θ0)|T (cid:3) = = η τ η τ Z t=0 T −1 (cid:88) t=0 Ez∼pt (cid:0)ˆg(z, θ)(cid:1) + O η2 T 3 (cid:16) τ 2 (cid:17) , (38) (cid:81)t−1 Z * * * (cid:82) where we have defined pt(zt) = (cid:82) Step 3: We now use the assumption that pt converges weakly to our desired distribution p, with a convergence rate that is O( 1 Weak convergence, with the assumed rate, implies that for all bounded, measurable functions f , |Ept(f ) − Ep(f )| ≤ M ∗ t2 , where M ∗ is some positive constant. By assumption, the gradients are measurable and bounded, so we have: k=0 p(zt−k|zt−k−1, θ0)dz1 . . . dzt−1. t2 ), to complete the proof. Z η τ T −1 (cid:88) t=0 Ez∼pt (cid:0)ˆg(z, θ)(cid:1) = η τ T −1 (cid:88) t=s T −1 (cid:88) η τ = = t=s T − s τ Ez∼pt (cid:0)ˆg(z, θ)(cid:1) + η τ s−1 (cid:88) t=0 Ez∼pt (cid:0)ˆg(z, θ)(cid:1) Ez∼p (cid:0)ˆg(z, θ)(cid:1) + η τ T −1 (cid:88) t=s (cid:17) O (cid:16) M ∗ t2 + η τ s−1 (cid:88) t=0 Ez∼pt (cid:0)ˆg(z, θ)(cid:1) ηEz∼p (cid:0)ˆg(z, θ)(cid:1) + ε(T, s, η), (39) (cid:80)T −1 (cid:0)ˆg(z, θ)(cid:1) is the bias term. When T is stochastic we can split up the sum in where ε = η τ this way, using the deterministic variable s, because we originally conditioned on the fact that T ≥ s at the start of the proof. We now bound the bias. Observe that: (cid:80)s−1 t=0 t=s O Ez∼pt + η τ (cid:17) (cid:16) M ∗ t2 |ε(T, s, η)| ≤ O (cid:17) (cid:16) η τ s + O (cid:17) (cid:16) ηs τ = O (cid:17) , (cid:16) ηs τ (40) where, for the inequality, we have used the fact that (cid:80)∞ t=s τ − s simply note that s > 1. Lastly, observe that T −s τ = T Putting this together with the previous steps, we get: 1 t2 ≤ 1 τ , so the second term of this bias gets absorbed in the O(cid:0) ηs s , and that ˆg is bounded. For the last equality one need (cid:1) term. T E(cid:2)G(z0, θ0)(cid:12) (cid:12)T ] = η T τ Ez∼p (cid:0)ˆg(z, θ)(cid:1) + O (cid:17) (cid:16) ηs τ + O (cid:16) η2 T 3 τ 2 (cid:17) . And, finally, taking the expected value w.r.t. phase length yields E(cid:2)G(z0, θ0)(cid:12) (cid:12)Ts = 1] = η E(T |Ts = 1) τ (cid:0)ˆg(z, θ)(cid:1) + O Ez∼p = ηEz∼p (cid:0)ˆg(z, θ)(cid:1) + O (cid:16) (cid:17) (cid:16) ηs τ + O (cid:17) (cid:16) ηs τ (cid:17) η2τ , (cid:16) η2 + O E(T 3|Ts = 1) τ 2 (cid:17) (41) (42) where we have used the results on the moments of T from §B.5. We note there that the O(ηs/τ ) term from the preliminary on stochastic phase length gets absorbed in the first bias term, for the stochastic phase length, yielding a convergence rate that is of the same order as with deterministic phase lengths. If we choose 1 η to be very large, τ to be less large, and s to be less, but still sufficiently, large, we find that we can make the sum of the gradient steps during each phase arbitrarily close to being unbiased. For example, the scaling proposed in the theorem would be sufficient to achieve this. 18 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning B.2. Assumptions of Proof of Theorem 3.4 Finally, we comment on the validity of the assumption that Γ(x) is integrable, and that the Markov chain exhibits weak convergence that is order 1 t2 . The other assumptions we believe to be fairly mild restrictions on the regularity of the system. For the assumptions on Γ(x), we simply note that these will hold in cases where the functions involved are well-defined and Z is finite. While we cannot prove that convergence to the stationary distribution is O( 1 t2 ) for every possible Markov chain we believe this holds for many Markov chains of interest. In particular, it holds for every finite state-space (finite Z) Markov chain that is both irreducible and aperiodic. Every Markov chain satisfying these three desiderata (irreducible, aperiodic, finite state-space) also satisfies the following convergence rate result (Rosenthal, 1995): ||pt − p∞||tv ≤ Ctl−1λt−l+1 (43) where || * ||tv is the total variation distance for probability measures, λ is the second largest eigenvalue of the transition matrix for the Markov chain, and satisfies λ < 1, C is a positive constant, and l is the size of the largest Jordan block of the transition matrix. First, observe that convergence in total variation distance implies weak convergence. Second, this rate of convergence, which we define to be r1(t), is easily shown to be faster than O( 1 t2 ) = r2(t). To do so, it suffices to show that r1(t) r2(t) → 0. The ratio can be arranged as follows: r1(t) r2(t) = C0tl+1λt−l+1 = C0 tl+1 λl−t−1 . (44) Both numerator and denominator converge to ∞ as t → ∞, and both are continuously differentiable l + 1 times, so we can apply L'Hopital's rule. Applying this rule and differentiating the top and bottom expressions l + 1 times gives: lim t→∞ r1(t) r2(t) = lim t→∞ C0 (l + 1)! λl−t−1(cid:0) − ln(λ)(cid:1)l+1 = 0, (45) where the last equality follows because λ < 1. Remark: We note that we have used the rather unsophisticated approach of simply Taylor expanding the parameter values during a wake/sleep phase around θ0, the value at the start of that phase, yielding a slowly converging error term. We expect that with more sophisticated methods, for example those outlined in (Yin & Zhang, 2005), one might be able to establish a faster converging error rate. Remark 1: The covariance requires an intractable integral to evaluate, so we once again appeal to MC sampling w.r.t v and h to evaluate it. Remark 2: A minor complication with the above is that one requires more than one MC sample, w.r.t v and h, to approximate the covariance function and, as such, one cannot use single sample MC sampling to estimate this gradient approximation. B.3. Multivariate Mean Value Theorem In this section we include the multivariate mean value theorem as it features heavily in the proof of Theorem 3.4. Theorem B.2. Assume f : Rd (cid:55)→ R is a differentiable function. Then f (x + h) = f (x) + ∇f (ξ) * h (46) where x, h ∈ Rd, and ξ is a point on the line between x and x + h. We omit the proof as it can be found in any standard textbook. The following lemma follows from the above, and is used throughout the proof of Theorem 3.4. 19 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning Lemma B.3. Assume that f is L-Lipschitz (gradients of f are bounded by L), and that h ≤ M ∀ i. Then it follows from the Mean Value Theorem that f (x + ηh) = f (x) + O(η) B.4. Convergence Rate of Error Induced by Stochastic Phase Lengths We wish to derive the rate at which this term converges to zero: (cid:0)E[G(z0, θ)|Ts = 0] − E[G(z0, θ)|Ts = 1](cid:1)p(Ts = 0). (47) (48) We first consider the expression inside the brackets. Using the assumption that the gradients are bounded we get the following (cid:0)E[G(z0, θ)|Ts = 0] − E[G(z0, θ)|Ts = 1](cid:1) ≤ A1sη τ + A2E(T |Ts = 1)η τ = O(η), (49) where A1 and A2 are constants. For the second term, we note that p(Ts = 0) = 1 − p(Ts = 1) = 1 − p(ω = 0)s = 1 − (1 − μ)s. By the definitions s = τ m and μ = 1 τ , we get p(Ts = 0) = 1 − (cid:16) 1 − (cid:17)τ m . 1 τ (50) Because 1 is a constant, p(Ts = 0) goes to zero at the same rate that (1 − 1 τ )τ m goes to 1. We will now derive this rate. (cid:16) 1 − (cid:17)s 1 τ = exp = exp = 1 − (cid:16) (cid:16) s τ + K0(s, τ ). (cid:104) 1 − s log − (cid:17) s τ exp 1 τ (cid:16) (cid:105)(cid:17) = exp (cid:16) − s (cid:104) 1 τ + O (cid:16) 1 τ 2 (cid:17)(cid:105)(cid:17) − O (cid:16) s τ 2 (cid:17)(cid:17) (cid:104) 1 − = s τ + O (cid:16) s2 τ 2 (cid:17)(cid:105)(cid:104) 1 − s τ 2 + O (cid:16) s2 τ 4 (cid:17)(cid:105) (51) goes to zero (because s = τ m by definition). K0 is thus a function purely of higher order terms than s τ goes to 1, and the exponential about 0, given that τ . Thus, (cid:105) (cid:104) 1 − 1 τ Here, we have expanded the inner logarithm about 1, given that 1 − 1 s log with leading order, p(Ts = 0) goes to zero with rate s τ . Combining this result with the previous one gives that Equation 48 is order O(cid:0) ηs (cid:1). τ B.5. Moments of T Assume that for every time step on a discrete timeline one evaluates the Bernoulli random variable ω with parameter μ << 1. Assuming that, at time t0, ω = 1, one can define the random variable T that is the number of time steps until the next observance of ω = 1. This is precisely the way that the stochastic phases are defined in the theorem. One can solve recursively for the moments of this random variable, using the law of total expectation and conditioning on the event that T = 1. Define τ = 1 μ . Then the first three moments are found to be: E(T ) = τ E(T 2) = 2τ 2 − τ E(T 3) = 6τ 3 − 6τ 2 − τ. 20 (52) Flexible Phase Dynamics for Bio-Plausible Constrastive Learning In the proof of Theorem 3.4, and it's deterministic analog (see §C), we are particularly interested in the moments conditioned on Ts = 1. Because the Bernoulli random variable that decides whether the phase ends is sampled independently at each step, we get the following relations: E(T |Ts = 1) = E(T + s) = τ + s E(T 2|Ts = 1) = E[(T + s)2] = τ 2 + 2τ s + s2 E(T 3|Ts = 1) = E[(T + s)3] = τ 3 + 3τ 2s + 3τ s2 + s (53) (54) (55) Importantly, these first and third moments are of leading order 1, 2 and 3 w.r.t τ . These observations are used in the proof of Theorem 3.4 and Theorem C.1. C. Analog of Theorem 3.4 for Deterministic Equilibrium Dynamics Theorem C.1. Consider a single phase of equilibrium-based learning where the phase is either fixed to value τ or ends stochastically at each step with small probability 1 τ and, instead of waiting until the end of the phase to do an update with learning rate η, an update is performed at every step of the equilibrium dynamics with learning rate η τ . Assume that equilibrium dynamics evolve for fixed θ according to the homogeneous discrete time dynamical system given by the map F (z, θ). Further assume that ˆg(θ) is differentiable and bounded with bounded partial derivatives for all network state values, and that F is differentiable w.r.t. z and θ, also with bounded partial derivatives. Finally, assume that the equilibrium dynamics converge to a fixed point at a rate at least as fast as O( 1 t2 ). Then the bias of the learning updates are of the following order: O (cid:17) (cid:16) ηs τ + O(η2), (56) where s = τ m for 0 < m < 1 and O is big-O notation. Proof. The proof has the same structure as that of Theorem 3.4 and, accordingly, proceeds in three steps preceded by a preliminary comment on stochastic phase length. Comment on Stochastic Phase Length Exactly the same as the comment in the proof of Theorem 3.4. Step 1: Exactly the same as "step 1" from the proof of Theorem 3.4. Step 2: This step uses a proof by induction. Following step 1, we have E(cid:2)G(z0, θ0)|T (cid:3) = η τ T −1 (cid:88) t=0 ˆg( ̃zt, θ0) + O (cid:16) η2 T 2 τ 2 (cid:17) , (57) t=0 where { ̃zt}t=T −1 merely a negligible perturbation of the homogeneous dynamics {zt}t=T −1 w.r.t. z and θ and that all partial derivatives are bounded by L (thus, that it is L-Lipschitz). Then we have are the dynamics perturbed by the always learning updates to θ. We wish to demonstrate that this represents . Let us assume that F (z, θ) is differentiable t=0 ̃z0 = z0 ̃z1 = F ( ̃z0, θ0) = F (z0, θ0) = z1 η τ ̃z2 = F ( ̃z1, θ1) = F z1, θ0 + (cid:16) ˆg(z0, θ0) (cid:17) = F (z1, θ0) + O (cid:17) (cid:16) η τ = z2 + O (cid:17) , (cid:16) η τ (58) where we used the multivariate mean value theorem corollary Lemma B.3 and the assumption that ˆg is bounded for the third equality in the final line. The final line of Equation 58 will be the "base case" in our proof by induction. We make the following induction hypothesis: 21 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning ̃zt = zt + O (cid:18) (t − 1)η τ (cid:19) . (59) We now complete the proof by induction-via the "induction step" (proof of the t + 1 case)-to show that the equality given in Equation 59 holds for arbitrary t: ̃zt+1 = F ( ̃zt, θt) = F zt + O (cid:32) (cid:18) (t − 1)η τ (cid:19) , θ0 + η τ t−1 (cid:88) k=0 (cid:33) ˆg( ̃zk, θk) = F (zt, θ0) + O (cid:19) . (cid:18) tη τ (60) In the second equality of the first line we used the induction hypothesis to relate ̃zt to zt; we also used the definition of the parameter dynamics. For the final line we again used the assumption that F is differentiable and Lipschitz, and the assumption that ˆg is bounded. We also used the fact that the O term is also O (cid:17) (cid:17) . (cid:16) (t−1)η τ (cid:16) tη τ Assuming ˆg has bounded partial derivatives w.r.t. z and applying Lemma B.3 we get: ˆg( ̃zt, θ0) = ˆg(zt, θ0) + O (cid:19) , (cid:18) tη τ so that, applying these results to Equation 57, we get: E(cid:2)G(z0, θ0)|T (cid:3) = = η τ η τ T −1 (cid:88) t=0 T −1 (cid:88) t=0 ˆg(zt, θ0) + η τ T −1 (cid:88) t=0 (cid:19) (cid:18) tη τ O + O (cid:17) (cid:16) η2 T 2 τ 2 ˆg(zt, θ0) + O (cid:16) η2 T 2 τ 2 (cid:17) . (61) (62) Step 3: This step proceeds in essentially the same way as step 3 of the proof of the Markov dynamics version. We leverage the assumption that zt converges to a fixed point of z∞ with a convergence rate that is O( 1 t2 ): η τ T −1 (cid:88) t=0 ˆg(zt, θ) = η τ T −1 (cid:88) t=s T −1 (cid:88) η τ = = t=s T − s τ ˆg(zt, θ) + η τ s−1 (cid:88) t=0 ˆg(zt, θ) ˆg(z∞, θ) + η τ T −1 (cid:88) t=s (cid:17) O (cid:16) 1 t2 + η τ s−1 (cid:88) t=0 ˆg(zt, θ) ηˆg(z∞, θ) + ε(T, s, η). (63) On line two of the above, we used our assumptions on the differentiability and boundedness of the partial derivatives of ˆg w.r.t. z, to apply Lemma B.3 yet again. We also used the variable s defined in the theorem, and defined ε = η t=0 ˆg(z, θ) as the bias term. Importantly, we have also taken s large enough so that, for t ≥ s, zt is τ sufficiently close to z∞ to allow us to expand ˆg around z∞. We now bound the bias term. t=s O (cid:16) 1 t2 (cid:80)T −1 (cid:80)s−1 + η τ (cid:17) Observe that: |ε(T, s, η)| ≤ O (cid:17) (cid:16) η τ s + O (cid:17) (cid:16) ηs τ = O (cid:17) , (cid:16) ηs τ (64) where, for the inequality, we have used the fact that (cid:80)∞ t=s τ − s simply note that s > 1. Lastly, observe that T −s τ = T 1 t2 ≤ 1 τ , so the second term of this bias gets absorbed in the O(cid:0) ηs s , and that ˆg is bounded. For the last equality one need (cid:1) term. T 22 Flexible Phase Dynamics for Bio-Plausible Constrastive Learning Putting this together with the previous steps, we get: E(cid:2)G(z0, θ0)(cid:12) (cid:12)T ] = η T τ ˆg(z∞, θ) + O (cid:17) (cid:16) ηs τ + O (cid:16) η2 T 2 τ 2 (cid:17) . And, finally, taking the expected value w.r.t. phase length yields E(cid:2)G(z0, θ0)(cid:12) (cid:12)Ts = 1] = η E(T |Ts = 1) τ = ηˆg(z∞, θ) + O (cid:16) ηs τ + O(η2), ˆg(z∞, θ) + O (cid:16) ηs τ (cid:17) (cid:17) (cid:16) η2 + O E(T 2|Ts = 1) τ 2 (cid:17) (65) (66) where we have used the results on the moments of T from §B.5. If we choose η to be large, τ to be large, and s to be less large than τ , but still sufficiently large for convergence of the dynamics, we find that we can make the sum of the gradient steps during each phase arbitrarily close to being unbiased. For example, the scaling proposed in the remark after Theorem 3.4 would be sufficient to achieve this. Remark on Difference Between Stochastic and Deterministic Dynamics Interestingly, we find that the bias for determin- istic dynamics is lower than the bias for stochastic dynamics. Furthermore, for deterministic dynamics we don't need the learning rate to be of lower order than τ or s. The reason for these phenomena is the change from a second bias term of O(η2T ) for stochastic dynamics to O(η2) for deterministic dynamics. Mathematically, this change occurs because of the difference in how one removes the inhomogeneity in the dynamics for the stochastic versus the deterministic case: one has to expand a product of functions (inside an integral) in the stochastic case, compared to expanding within a composition of functions in the deterministic case. It is an open question whether this difference in bias between deterministic and stochastic dynamics is a fundamental property or is purely a consequence of the techniques used in the proof. In particular, we wonder whether the stochastic bias could be reduced to that of the deterministic dynamics if one were to use techniques from operator theory (Lasota & Mackey, 1998; Yin & Zhang, 2005). We leave this to future work. D. Algorithm Performance as a Function of Positive Phase Probability for MNIST Figure 4. Same as Fig.3.B except only the AoL values are shown, and the model is an RBM trained on binarized MNIST. Observe that the minimal value of b is higher than 0.5. For this experiment, the RBM was trained on the concatenation of the images and their labels and the error plotted is classification error calculated, for a given image, by presenting the image without the label and selecting the predicted image label as the one with highest mean over a set of samples from the RBM. The RBM had 794 visible units and 128 hidden, and was trained with a learning rate of 0.005. 23 0.00.20.40.60.81.0Wake Phase Probability0.100.120.140.160.18MC Accuracy Flexible Phase Dynamics for Bio-Plausible Constrastive Learning E. Experimental Details General: For the experiments in Fig.2, and all distinct models, learning rates were selected by performing a line search over ten values, equally spaced on a log10 scale, to find the learning rate with lowest end-of-training training error. The learning rates in Fig.3 were simply set to 0.05 and 0.0025, for ISD AoL and ISD respectively, as the goal of this figure was not to compare algorithms and these learning rates were found to yield robust learning on a reasonable time frame. Network sizes were fixed to provide easy comparison across models. Data was divided into segregated train and test sets for the MNIST experiments, but the test set was only used with the forward-forward algorithm. The BAS dataset is small and the entire, ground-truth data was trained on; therefore there was no test/training split in this case. The code used for the experiments can be found at the following Github repository: https://github.com/zek3r/ICML2023. RBM Parameters: For all experiments on the BAS dataset we trained a RBM with 16 hidden units and 16 visible units. The max and min values for the learning rate line search for Fig.2 were 0.04 and 0.001. Phase length was defined T = 100 for ISD, 100 for ISD AoL with fixed phase length, and was assigned a mean of 150 for the random phase length version. All networks were trained using vanilla SGD with no regularization. Initialization of all parameters was to white noise with standard deviation of 0.01. All training runs in Fig.2 were 105 steps long, except for CD1 which was 107 gradient steps long (and failed to converge). Here, a step is defined as a gradient step for CDK and regular ISD, and a phase for ISD AoL and ISD AoL Random T . The reason that phase was used instead of gradient step for these latter two algorithms is that these algorithms performed a gradient step at every step of MCMC sampling but, as mentioned in Section 3.2, learning rates were scaled by the mean phase length so that the sum of gradient steps taken during a phase was approximately equal to the single gradient step taken in regular ISD. FF Parameters: With the forward-forward algorithm, we trained a network with two hidden layers of 500 units each. ADAM was used for both the standard algorithm and the ISD algorithm. The max and min values for the learning rate line search were 0.05 and 0.002. All training runs in Fig.2, for all algorithms, were 120000 gradient steps long. F. Ethics Energy Consumption: Given the scale of the experiments, we believe the energy consumption of this project was negligible. Moreover, the experiment was performed on an electrical grid that primarily uses hydro-electricity from long-established generating stations, meaning that the greenhouse gas emissions were likely close to zero. Other Considerations: The main application of this work is to build basic scientific knowledge to aid computational neu- roscience modelling and neuromorphic hardware development. As such, societal implications could eventually encompass clinical neuroscientific interventions or reductions in the energy consumption of deep learning methods, which we believe are largely positive. However, the commodification and weaponization of AI technology is already having negative impacts on society (e.g. use of facial recognition for discrimination, or the accentuating of wealth inequality and job losses). The authors are doing their best to stay abreast of these problems, and take steps to help combat them. For example, to combat commodification and centralization of wealth by making work publicly available. 24
http://arxiv.org/abs/2302.12426v3
2023-03-21T01:49:46
2023-02-24T03:13:12
Statistical Analysis of Karcher Means for Random Restricted PSD Matrices
Non-asymptotic statistical analysis is often missing for modern geometry-aware machine learning algorithms due to the possibly intricate non-linear manifold structure. This paper studies an intrinsic mean model on the manifold of restricted positive semi-definite matrices and provides a non-asymptotic statistical analysis of the Karcher mean. We also consider a general extrinsic signal-plus-noise model, under which a deterministic error bound of the Karcher mean is provided. As an application, we show that the distributed principal component analysis algorithm, LRC-dPCA, achieves the same performance as the full sample PCA algorithm. Numerical experiments lend strong support to our theories.
[ "Hengchao Chen", "Xiang Li", "Qiang Sun" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12426v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12426v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG" ]
Statistical Analysis of Karcher Means for Random Restricted PSD Matrices 3 2 0 2 r a M 1 2 ] L M . t a t s [ 3 v 6 2 4 2 1 . 2 0 3 2 : v i X r a Hengchao Chen Department of Statistical Sciences University of Toronto Xiang Li School of Mathematical Sciences Peking University Qiang Sun Department of Statistical Sciences University of Toronto Abstract Non-asymptotic statistical analysis is often miss- ing for modern geometry-aware machine learn- ing algorithms due to the possibly intricate non- linear manifold structure. This paper studies an intrinsic mean model on the manifold of re- stricted positive semi-definite matrices and pro- vides a non-asymptotic statistical analysis of the Karcher mean. We also consider a general extrin- sic signal-plus-noise model, under which a deter- ministic error bound of the Karcher mean is pro- vided. As an application, we show that the dis- tributed principal component analysis algorithm, LRC-dPCA, achieves the same performance as the full sample PCA algorithm. Numerical ex- periments lend strong support to our theories. 1 Introduction Positive semi-definite (PSD) matrices arise in a wide range of applications, such as covariance matrices in statistics (Wainwright, 2019), kernel matrices in machine learning (Hastie et al., 2009), diffusion tensor images in medical imaging (Dryden et al., 2009), semi-definite programming (Journ ́ee et al., 2010), and covariance descriptors in image set classification (Wang et al., 2012), to name a few. From a geometric perspective, the cone of PSD matrices is not a vector space, since linear combinations of multiple PSD Instead, the matrices are not necessarily PSD matrices. set of (restricted) PSD matrices of fixed rank has been en- dowed with different metrics such that it forms a Rieman- nian manifold (Bonnabel and Sepulchre, 2010; Vanderey- cken et al., 2013; Massart and Absil, 2020; Neuman et al., 2021). By utilizing the geometric structures, researchers have developed many powerful statistical or computational methods (Faraki et al., 2016; Cornea et al., 2017; Patrange- naru and Ellingson, 2016). Proceedings of the 26th International Conference on Artificial Intelligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). One important concept in Riemannian geometry or more generally metric spaces is the Karcher mean (Karcher, 1977). The Karcher mean is often referred to as the Fr ́echet mean or the barycenter of mass. Given M points {zm}M m=1 on a metric space (M, d) with distance function d(*, *), the Karcher mean (cid:101)z of these points is given by (cid:101)z = argmin z∈M (cid:88) m d2(z, zm). (1.1) When the underlying space is Euclidean, the Karcher mean is reducesd to the arithmetic mean. In general, the exis- tence and computation of the Karcher mean is already com- plicated due to the possibly intricate non-Euclidean struc- ture (Karcher, 1977; Bini and Iannazzo, 2013). As a re- sult, most works focus on the computation and applications of the Karcher mean, while few provide statistical guaran- tees. Statistically, Bhattacharya and Patrangenaru (2003, 2005) establish a large sample theory of the Karcher mean on manifolds with applications to spheres and projective spaces. Bigot and Gendre (2013) shows the minimax op- timality of the Karcher mean of discretely sampled curves. In this paper, we consider the manifold of restricted PSD matrices by Neuman et al. (2021). In particular, we first study an intrinsic mean model, inspired by the geometric structure of the restricted PSD manifold. A non-asymptotic statistical analysis of the Karcher mean is provided under this intrinsic model. We further consider a general extrinsic signal-plus-noise model, which does not necessarily coin- cide with the manifold geometry by Neuman et al. (2021). For this general model, we give a deterministic error bound for the Karcher mean, which is then used to provide an er- ror bound for a distributed principal component analysis algorithm. The Karcher mean is closely related to distributed learning problems, especially the divide-and-conquer (DC) frame- work (Mackey et al., 2011). In distributed learning prob- lems, massive datasets are scattered across distant servers and directly fusing these datasets is challenging due to con- cerns on communication cost, privacy, data security, and ownership, among others. A commonly used distributed framework is the DC framework which first computes lo- cal estimators locally and then aggregate them on the cen- tral server, where the last step is often equivalent to com- Statistical Analysis of Karcher Means for Random Restricted PSD Matrices puting the Karcher mean on certain manifolds. For ex- ample, the divide-and-conquer principal component anal- ysis (PCA) algorithms (Fan et al., 2019; Bhaskara and Wi- jewardena, 2019; Neuman et al., 2021) essentially com- pute the Karcher means on the Grasssmann manifold, Eu- clidean space, or the manifold of restricted PSD matrices, respectively. Motivated by this observation, we give theo- retical guarantees of the DC PCA algorithm, LRC-dPCA, proposed in Neuman et al. (2021) by applying our non- asymptotic statistical analysis of the Karcher mean on the restricted PSD manifold. Specifically, we show that given sufficienly large local sample size, LRC-dPCA achieves the same performance as the full sample PCA algorithm, which outputs the top eigenvectors of the covariance matrix based on full data. Our contributions are three-fold. First, we provide a non- asymptotic statistical analysis of the Karcher mean on the restricted PSD manifold under an intrinsic model. Second, for a generic signal-plus-noise model, we give a determin- istic characterization of the Karcher mean and then obtain a deterministic error bound. Third, as an application, we show that LRC-dPCA and full sample PCA share the same performance given sufficiently large local sample size. Nu- merical experiments are carried out to support our theories. The rest of this paper proceeds as follows. We conclude this section with a discussion on related works. Section 2 reviews the geometry for restricted PSD matrices proposed in Neuman et al. (2021). Then in Section 3, we provide the theoretical analysis of the Karcher mean on the re- stricted PSD manifolds. Applications to distributed PCA algorithms are given in Section 4. Numerical experiments are carried out in Section 5 and we give concluding remarks in Section 6. Proofs are left to the Appendix. 1.1 Related work Manifolds of PSD matrices The cone of symmetric pos- itive definite (SPD) matrices is not a vector space. It can be viewed as different Riemannian manifolds when en- dowed with different metrics, such as the affine-invariant metric (Moakher, 2005) and the Log-Euclidean metric (Ar- signy et al., 2007). It is, however, non-trivial to generalize these metrics to the rank-deficient (PSD) case. To this end, Bonnabel and Sepulchre (2010) treated a PSD matrix of rank K in a quotient space as a K-dimensional subspace coupled with a K-by-K SPD matrix and then endowed the manifold of PSD matrices with a weighted product met- ric. Using this geometry, Bonnabel et al. (2013) devel- oped a rank-preserving geometric mean of PSD matrices. Later, Vandereycken et al. (2013) viewed a PSD manifold as a homogeneous space and Massart and Absil (2020) an- alyzed a quotient geometry on the manifold of PSD matri- ces. However, it is hard to give a statistical model on these manifolds. More recently, Neuman et al. (2021) proposed a geometry for restricted PSD matrices which has closed- form solutions for many geometric concepts including the Karcher mean. Our paper provides statistical analysis of the Karcher mean corresponding to this geometry. Distributed PCA To estimate the leading eigenvector, Gar- ber et al. (2017) proposed a sign-fixing averaging approach. To estimate the top K eigenspace, Fan et al. (2019) pro- posed a projector averaging approach and Charisopoulos et al. (2021) proposed to average local eigenvector matrices after carefully rotating them. Disregarding the information of eigenvalues, both Fan et al. (2019)'s and Charisopou- los et al. (2021)'s methods require the knowledge of the precise location K of a large eigen gap. To alleviate this issue, Bhaskara and Wijewardena (2019) proposed to aver- age the local rank-K approximation matrices and then con- duct PCA on the aggregated matrix. Neuman et al. (2021) utilized the same methods as Bhaskara and Wijewardena (2019) except that the average of local rank-K approxima- tion matrices is taken on the manifold of restricted PSD ma- trices. Neuman et al. (2021) did not provide statistical anal- ysis for their proposed method, while our paper fixes this gap as an application of the main results. Another branch of research turns PCA into the problem of solving a linear sys- tem and then solves distributed PCA by some multi-round algorithms. Among them, some make use of the shift-and- invert framework (Garber et al., 2017; Chen et al., 2021), while some use incremental update schemes (Gang et al., 2019; Grammenos et al., 2020; Li et al., 2021). Notation. By convention, we use regular letters for scalars and bold letters for both vectors and matrices. Given a vector u ∈ Rp, denote by (cid:107)u(cid:107)2 its (cid:96)2 norm. Given a matrix A ∈ Rn×p, we use (cid:107)A(cid:107)F, (cid:107)A(cid:107)2 and (cid:107)A(cid:107)max = maxi,j |Aij| to denote its Frobenius norm, (cid:96)2 norm and max norm, respectively. We use span(A) to represent the subspace spanned by the columns of A. For a sym- metric matrix A, denote by λj(A) its jth largest eigen- value. For two sequences of real numbers {an}n≥1 and {bn}n≥1, we write an (cid:46) bn (or an (cid:38) bn) if an ≤ Cbn (or an ≥ Cbn) for some constant C > 0 independent of n. For an infinitesimal number (cid:15), we denote a matrix whose Frobenius norm or max norm is O((cid:15)) (i.e., (cid:46) (cid:15)) by OF((cid:15)) or Omax((cid:15)), respectively. Given a random vari- √ able x ∈ R, we define (cid:107)x(cid:107)ψ2 = supp≥1(E|x|p)1/p/ p and (cid:107)x(cid:107)ψ1 = supp≥1(E|x|p)1/p/p. Given two integers p ≥ K > 0, we denote by Op×K the set of matri- ces in Rp×K whose columns are orthonormal. Denote by S(p, K) the set of all p×p PSD matrices of rank K. Denote by a ∨ b = max{a, b}. 2 The Manifold of Restricted PSD Matrices In this section, we briefly recap the geometry for restricted PSD matrices (Neuman et al., 2021). To start with, any PSD matrix A ∈ S(p, K) has a unique Cholesky decom- Hengchao Chen, Xiang Li, Qiang Sun position A = LL(cid:62) such that L ∈ Rp×p is a lower triangu- lar matrix and has precisely K positive diagonal elements and p − K zero columns. The jth column of L is zero if and only if the jth column of A is linearly dependent on the previous j − 1 columns of A. Thus, we can rewrite A = N N (cid:62), where N ∈ Rp×K consists of K non-zero columns of L without changing the order. Note that N is mock lower triangular, i.e., Nij = 0 if i < j. We refer to N as the reduced Cholesky factor of A. To further develop a geometric structure, Neuman et al. (2021) consider the restricted subset S∗(p, K) of S(p, K) such that the first K columns of A ∈ S∗(p, K) are linearly independent. The set of all reduced Cholesky factors of matrices in S∗(p, K) is denoted by L∗(p, K), which is equivalent to the set of all mock lower triangular matrices in Rp×K with positive diagonal elements. Neuman et al. (2021) impose a Rie- mannian structure on S∗(p, K) and L∗(p, K) such that the following mappings are isometric, h : S∗(p, K) (cid:55)→ L∗(p, K), A (cid:55)→ N , g : L∗(p, K) (cid:55)→ L(p, K), N (cid:55)→ N (cid:48), (2.1) (2.2) where N = h(A) is the reduced Cholesky factor of A, L(p, K) = {N (cid:48) ∈ Rp×K : N (cid:48) ij = 0, i < j} is endowed with a Euclidean structure, and N (cid:48) = g(N ) ∈ L(p, K) is defined by N (cid:48) ij = Nij, ∀ i > j. We refer to N (cid:48) = g ◦ h(A) as the reduced log-Cholesky factor of A. The Karcher mean (cid:101)A of M restricted PSD ma- trices {Am}M m=1 ⊂ S∗(p, K) has a closed-form solution, which is given by ii = log(Nii), ∀ i and N (cid:48) (cid:101)A = h−1 ◦ g−1( 1 M M (cid:88) m=1 g ◦ h(Am)). (2.3) The algorithm computing (cid:101)A is referred to as the Low Rank Cholesky (LRC) algorithm (Neuman et al., 2021). 3 Statistical Analysis of the Karcher Mean In this section, we provide the first statistical analysis of the Karcher mean under an intrinsic model on the restricted PSD manifold. Then we consider a general signal-plus- noise model under which a deterministic error bound of the Karcher mean is given. 3.1 An intrinsic model Inspired by the isometry stated in equations (2.1) and (2.2) between the manifold S∗(p, K) of restricted PSD matrices and the Euclidean space L(p, K), we propose the following intrinsic model. Suppose A ∈ S∗(p, K) is the signal ma- trix and denote by N (cid:48) = g◦h(A) its reduced log-Cholesky factor. The observations {Am}M m=1 are generated as fol- lows: Am = h−1 ◦ g−1(N (cid:48) + Em), m = 1, . . . , M, (3.1) where {Em}M m=1 ⊂ L(p, K) are independent and the lower triangular entries of Em are independent normal variables with mean zero and variance σ2. Under this intrinsic model, the Karcher mean of {Am}M m=1 can be rewritten as (cid:101)A = h−1 ◦ g−1(N (cid:48) + 1 M M (cid:88) m=1 Em). (3.2) Using measure concentration, we can obtain a non- asymptotic error bound for the Karcher mean (cid:101)A. Theorem 3.1 (Intrinsic Model). Suppose A ∈ S∗(p, K) is the signal matrix and assume (cid:107)A(cid:107)2 ≤ C for some constant C > 0. Assume samples {Am}M m=1 are generated from the intrinsic model (3.1) and denote by (cid:101)A the Karcher mean of {Am}M m=1. Then there exist some constants c1, c2 > 0 such that the following inequality (cid:107) (cid:101)A − A(cid:107)F ≤ (cid:114) c2pKσ2 M (3.3) holds with probability at least 1 − e−c1pK. Remark 3.2. It is worth noting that (3.3) achieves the opti- mal rate M −1/2. In addition, it only depends on the intrin- sic dimension O(pK) of the manifold, which can be much smaller than the ambient dimension p2. 3.2 A general signal-plus-noise model The intrinsic model may be too restricted, so this subsec- tion introduces a general signal-plus-noise model and then provides a deterministic characterization of the Karcher mean. An application of this deterministic error bound to the distributed PCA problem will be given in Section 4. Similar to the intrinsic model, we denote by A ∈ S∗(p, K) the signal matrix and N = h(A) its reduced Cholesky fac- m=1 ⊂ S∗(p, K) are given by tor. The observations {Am}M Am = (N + Em)(N + Em)(cid:62), (3.4) where Em ∈ Rp×K represents the m-th noise matrix. Here Em is not necessarily a mock lower triangular matrix, so the model is quite general. Also, the reduced Cholesky factor of Am is not necessarily N + Em, but rather (N + Em)Qm for some orthogonal matrix Qm ∈ OK×K. Denote by N m the reduced Cholesky factor of Am. To characterize the Karcher mean (2.3) of {Am}M m=1, we first establish a linear perturbation expansion of QR decom- position below. Lemma 3.3 (Linear Perturbation Expansion). Suppose Q ∈ OK×K and R ∈ RK×K is a lower triangular ma- trix with positive diagonal elements. Given a noise matrix E ∈ RK×K, there exist a unique orthogonal matrix qQ ∈ OK×K and a lower triangular matrix qR ∈ RK×K with Statistical Analysis of Karcher Means for Random Restricted PSD Matrices non-negative diagonal elements such that qR qQ = RQ+E. When (cid:15)0 = (cid:107)E(cid:107)max is sufficiently small, we have qQ = Q + fR(EQ(cid:62))Q + Omax((cid:15)2 0), qR = R + EQ(cid:62) − RfR(EQ(cid:62)) + Omax((cid:15)2 0), where fR : RK×K (cid:55)→ RK×K is given by fR(E) = U(R−1E) − (U(R−1E))(cid:62), U(P )ij = Pij, i < j, U(P )ij = 0, otherwise. √ It is worth emphasizing the following properties of fR. First, fR is linear in its argument, i.e., fR(aE + bF ) = afR(E) + bfR(F ) for any a, b ∈ R and E, F ∈ RK×K. Second, fR(E) is a skew-symmetric matrix, i.e., (fR(E))(cid:62) = −fR(E). Last, fR is bounded in the sense 2(cid:107)R−1(cid:107)2(cid:107) * (cid:107)F. Similar first-order per- that (cid:107)fR(*)(cid:107)F ≤ turbation theories exist in the literature for QR, Cholesky, and LU factorization (Chang et al., 1996; Stewart, 1997, 1977; Chang et al., 1997), but none of them provides a lin- ear perturbation expansion with a max-norm control on the remainder term, which is necessary for our development of the error bound on the Karcher mean and the subsequent applications in distributed PCA. E2,m(cid:62) Now we are ready to present a deterministic characteri- zation of the Karcher mean. For convenience, we write N = (R(cid:62) B(cid:62))(cid:62) and Em = (E1,m(cid:62) )(cid:62) such that R, E1,m ∈ RK×K and B, E2,m ∈ R(p−K)×K. Note that R is a lower triangular matrix with positive diagonal ele- ments since N ∈ L∗(p, K). In the following theorem, we will show that when (cid:15)0 = maxm (cid:107)Em(cid:107)max is sufficiently small, the reduced Cholesky factor (cid:102)N of (cid:101)A differs from (cid:80)M N by a term linear in 1 m=1 Em and an extra term of M 0). Recall that S∗(p, K) is the manifold of order Omax((cid:15)2 restricted PSD matrices. Theorem 3.4 (Karcher Mean on S∗(p, K)). When (cid:15)0 = maxm (cid:107)Em(cid:107)max is sufficiently small, the reduced Cholesky factor (cid:102)N of the Karcher mean (cid:101)A of {Am = (N + Em)(N + Em)(cid:62)}M m=1 on S∗(p, K) is (cid:102)N = N + 1 M M (cid:88) Em − N fR( + Omax((cid:15)2 m=1 0), 1 M M (cid:88) m=1 E1,m) where fR(*) is given in Lemma 3.3. From Theorem 3.4, one may easily derive a deterministic upper bound on (cid:107) (cid:101)N − N (cid:107)F using the triangular inequality, which depends on (cid:107) 1 M Corollary 3.5. Under the same conditions of Theorem 3.4, if (cid:107)N (cid:107)2 ≤ C and (cid:107)R−1(cid:107) ≤ C for some constant C > 0, then we have m=1 Em(cid:107)F and pK(cid:15)2 0. (cid:80)M (cid:107) (cid:102)N − N (cid:107)F ≤ O((cid:107) 1 M M (cid:88) m=1 Em(cid:107)F) + O(pK(cid:15)2 0). Algorithm 1: LRC-dPCA (cid:80) i xm i xm(cid:62) i }M m=1, K; Input: { (cid:98)Σm = 1 n Output: (cid:101)V ; Compute (cid:98)V m and (cid:98)Λm of (cid:98)Σm and communicate them to a central server; Compute the Karcher mean (cid:101)A of (cid:98)V m( (cid:98)Λm)2 (cid:98)V m(cid:62) on the manifold of restricted PSD matrices; Compute the top K eigenspace (cid:101)V of (cid:101)A. (cid:80)M In applications such as distributed PCA, the Frobenius norm of the average 1 m=1 Em is much smaller than M that of Em. Thus, by Corollary 3.5, the Karcher mean (cid:102)N is a better approximation of N than any N m (the reduced Cholesky factor of Am). 4 Applications to Distributed PCA This section applies Theorem 3.4 to show that the dis- tributed PCA algorithm, LRC-dPCA proposed by Neu- man et al. (2021), achieves the same performance as the full sample PCA when the local sample size is sufficiently large. 4.1 Distributed PCA and LRC-dPCA We start with the distributed PCA setting as well as the LRC-dPCA algorithm. For simplicity, we consider a bal- anced setting, in which we have M machines and the m- i=1 ⊂ Rp. Denote by th machine has n samples {xm N = M n the total number of samples. Assume all samples are i.i.d. sub-Gaussian with mean 0 and covariance Σ. i }n Definition 4.1 (sub-Gaussian). We say a random vector x ∈ Rp is sub-Gaussian with mean 0 and covariance Σ if z = Σ−1/2x is sub-Gaussian with mean 0 and covari- ance Ip, i.e., there exists a constant σ > 0 such that the following inequality holds, E[eλ(cid:104)u,z(cid:105)] ≤ e λ2σ2 2 , ∀λ ∈ R, ∀u ∈ Rp, (cid:107)u(cid:107)2 = 1. Remark 4.2. Fan et al. (2019) and Bhaskara and Wijew- ardena (2019) use the following equivalent definition of a sub-Gaussian vector: x ∈ Rd is sub-Gaussian with mean 0 and covariance Σ if there exists a constant C > 0 such that (cid:107)u(cid:62)x(cid:107)ψ2 ≤ C(cid:112)E(u(cid:62)x)2, ∀u ∈ Rd. For more informa- tion on the equivalent definitions of sub-Gaussian vectors, one may refer to Vershynin (2012). Given a positive integer K, the goal is to compute the top K eigenspace of Σ using all data on M machines with small communication cost. We consider the LRC-dPCA algorithm proposed by Neuman et al. (2021), collected in Algorithm 1. Following this algorithm, we first compute Hengchao Chen, Xiang Li, Qiang Sun (cid:80)n i=1 xm (cid:98)Σm = 1 i xm(cid:62) on each local machine and then i n compute the top K eigenvectors (cid:98)V m = ((cid:98)vm 1 , . . . , (cid:98)vm K ) ∈ Op×K and eigenvalues (cid:98)Λm = diag(λm 1 , . . . , λm) of (cid:98)Σm. After communicating these local estimators (cid:98)V m, (cid:98)Λm to a central server, we compute the Karcher mean (cid:101)A of { (cid:98)V m(Λm)2 (cid:98)V m(cid:62)}M m=1 on the manifold of restricted PSD matrices1. Finally, the top K eigenvectors (cid:101)V ∈ Op×K of (cid:101)A is returned. 4.2 Theoretical analysis A statistical analysis of the LRC-dPCA algorithm is miss- ing in its original paper (Neuman et al., 2021). In this sub- section, we will utilize our deterministic characterization of the Karcher mean on S∗(p, K), i.e., Theorem 3.4, to show that given sufficiently large sub-sample size, LRC- dPCA matches the performance of the full sample PCA. Denote by V = (v1, . . . , vK) ∈ Op×K and Λ = diag(λ1, . . . , λK) the top K eigenvectors and eigenvalues of Σ, respectively. To ensure the uniqueness of span(V ), we assume ∆K = λK(Σ) − λK+1(Σ) > 0. Write A = V Λ2A(cid:62) and assume the first K columns of A are linearly independent, i.e., A ∈ S∗(p, K). When the subsample size n is sufficiently large, we will show that (cid:98)Am = (cid:98)V m( (cid:98)Λm)2 (cid:98)V m(cid:62) also belongs to S∗(p, K) with high probability. Here (cid:98)V m and (cid:98)Λm denote the top K eigenvectors and eigenvalues of (cid:98)Σm respectively. Denote by (cid:101)A the Karcher mean of { (cid:98)Am}M m=1 on S∗(p, K). We further denote by N , (cid:99)N m, (cid:102)N the reduced Cholesky fac- tors of A, (cid:98)Am, (cid:101)A. In addition, we define Q∗ ∈ OK×K by the equality N = V ΛQ∗. In the rest of this subsection, we will apply Theorem 3.4 to study the properties of (cid:101)A. First, we show that { (cid:98)Am}M follow the general signal-plus-noise model (3.4). m=1 Lemma 4.3. Let (cid:98)Em = (cid:98)Σm (cid:98)V m (cid:99)H mQ∗ − ΣV Q∗, where H m = (cid:98)V m(cid:62)V and (cid:99)H m = sgn(H m) def= U1U (cid:62) 2 with U1, U2 given by the singular value decomposition H m = U1ΓU (cid:62) 2 of H m. Then (cid:98)Am = (N + (cid:98)Em)(N + (cid:98)Em)(cid:62). Let us make several remarks on (cid:98)Em. It is well-known that (cid:99)H m = argmin O∈OK×K (cid:107) (cid:98)V mO − V (cid:107)F and thus (cid:98)V m (cid:99)H m is a good estimator of V (Chen et al., 2020). Furthermore, by Lemma H.2, when (cid:15) = maxm (cid:107)E m(cid:107)2/∆K ≤ 1/10 with E m = (cid:98)Σm − Σ, (cid:98)V m (cid:99)H m has the following first-order expansion around V , (cid:98)V m (cid:99)H m = V + g(E mV ) + OF((cid:15)2), (4.1) 1Here we choose ( (cid:98)Λm)2 rather than (cid:98)Λm only for technical reasons in the theoretical proofs. where g is a linear function defined in Lemma H.2. Sub- stituting (4.1) into the definition of (cid:98)Em, we obtain the fol- lowing linear expansion of (cid:98)Em in terms of E m, (cid:98)Em = E mV Q∗ + Σg(E mV )Q∗ + OF ((cid:15)2). (4.2) (cid:80)M (cid:80)M (cid:80)M the leading term of m=1 E m. This enables an m=1 (cid:98)Em(cid:107)F, provided by the fol- Since g is linear in its argument, m=1 (cid:98)Em is linear in 1 1 M M upper bound for (cid:107) 1 M lowing lemma. Lemma 4.4 (Bounding (cid:107)M −1 (cid:80)M m=1 (cid:98)Em(cid:107)F). Suppose ∆K > 0 and (cid:107)Σ(cid:107)2 is bounded. Let E m = (cid:98)Σm − Σ and (cid:15) = maxm (cid:107)E m(cid:107)2/∆K. When (cid:15) ≤ 1/10, the following bound (cid:107) 1 M M (cid:88) m=1 (cid:98)Em(cid:107)F ≤ C(cid:107) 1 M M (cid:88) m=1 E m(cid:107)2 + O((cid:15)2) holds for some constant C > 0. To apply Theorem 3.4, we also need to upper bound the max norm (cid:15)0 = maxm (cid:107) (cid:98)Em(cid:107)max. Again, this is based on the first-order expansion (4.2) of Em. Lemma 4.5 (Bounding maxm (cid:107) (cid:98)Em(cid:107)max). Assume ∆K > 0 and (cid:107)Σ(cid:107)2 is bounded. When (cid:15) = maxm (cid:107)E m(cid:107)2/∆K ≤ 1/10, we have with probability at least 1 − 2M e−C1nδ2 1 − M e−C2 δ2n/r that √ max m (cid:107) (cid:98)Em(cid:107)max ≤ C3 (cid:114) log(p) n + δ1 + δ2, for some constants C1, C2, C3 > 0 and r = Tr(Σ)/λ1(Σ). In addition, when n (cid:38) log3(pM )r2, we have with proba- bility at least 1 − 2p−1 that max m (cid:107) (cid:98)Em(cid:107)max ≤ C (cid:114) log(pM ) n , for some constant C > 0. In Lemma 4.5, we show that (cid:107) (cid:98)Em(cid:107)max (cid:46) (cid:112)log(p)/n with high probability when n (cid:38) log3(p)r2. By (4.2) and Lemma H.1, we can show that (cid:107) (cid:98)Em(cid:107)F (cid:46) (cid:112)p/n with high probability. The upper bound on (cid:107) (cid:98)Em(cid:107)max is thus smaller by a factor of (cid:112)p/ log(p) than the upper bound on (cid:107) (cid:98)Em(cid:107)F . This implies that (cid:98)Em is delocalized across the entries. Moreover, Lemma 4.5 implies that when we apply Theorem 3.4 to the LRC-dPCA algorithm, the re- mainder term Omax((cid:15)2 0) is negligible compared to the lead- (cid:80)M ing term 1 m=1 (cid:98)E1,m). This M provides the last key ingredient to the following theorem, which gives an upper bound for (cid:107) (cid:102)N − N (cid:107)F . Here (cid:102)N is the reduced Cholesky factor of the Karcher mean (cid:101)A. Theorem 4.6 (Bounding (cid:107) (cid:102)N − N (cid:107)F). Assume ∆K > 0 and (cid:107)Σ(cid:107)2 is bounded. Partition N = (R(cid:62) B(cid:62))(cid:62) such m=1 (cid:98)Em − N fR( 1 M (cid:80)M Statistical Analysis of Karcher Means for Random Restricted PSD Matrices that R ∈ RK×K and B ∈ R(p−K)×K and assume (cid:107)R−1(cid:107)2 ≤ C for some constant C > 0. When (cid:15) = maxm (cid:107)E m(cid:107)2/∆K ≤ 1/10 and (cid:15)0 = maxm (cid:107) (cid:98)Em(cid:107)max is sufficiently small, the following bound (cid:107) (cid:102)N − N (cid:107)F ≤ O (cid:32) (cid:107) 1 M M (cid:88) m=1 (cid:33) E m(cid:107)2 + O((cid:15)2) + O( √ p(cid:15)2 0) holds. Define r = Tr(Σ)/λ1(Σ), (cid:101)r1 = (log2(pM )r) ∨ p log4(pM )r2. Then we have p) and (cid:101)r2 = (log(pM ) with probability at least 1 − 4p−1 that √ √ (cid:107) (cid:102)N − N (cid:107)F ≤ O √ (cid:18) log(p) √ M n (cid:19) r + O (cid:19) (cid:18) (cid:101)r1 n + O (cid:18) (cid:19) . (cid:101)r2 n2 When n (cid:38) further assume n (cid:38) M (cid:101)r2 duces to (cid:101)r2/(cid:101)r1, the third term is negligible. When we 1/(log2(p)r), the upper bound re- (cid:107) (cid:102)N − N (cid:107)F ≤ O √ (cid:18) log(p) √ M n (cid:19) r . Theorem 4.6 shows that given sufficiently large local sam- 1/(log2(p)r), (cid:102)N is as good as ple size, i.e., n (cid:38) M (cid:101)r2 the full sample estimator of N in terms of the Frobenius norm. Moreover, (cid:107) (cid:102)N − N (cid:107)F is of the same order as (cid:107)M −1 (cid:80)M m=1 E m(cid:107)2 (see Lemma H.1). Note that the sin- gular vectors of N are equal to V , the singular values of N are equal to Λ, and LRC-dPCA uses the singular vectors of (cid:102)N as an estimator of V . Then it follows from Wedin's sin(Θ) theorem (Chen et al., 2020) that LRC-dPCA and full sample PCA share the same performance in eigenvec- tor estimation. Remark 4.7. Similar to Lemma 4.5, we can show that (cid:107) (cid:98)V m (cid:99)H m − V (cid:107)max (cid:46) (cid:112)log(p)/n with high probabil- ity when n (cid:38) log3(p)r2. Compared to the upper bound (cid:107) (cid:98)V m (cid:99)H m − V (cid:107)F (cid:46) (cid:112)p/n, the max norm bound again implies that the residual matrix (cid:98)V m (cid:99)H m − V does not concentrate on a few coordinates. This has connections to the infinity norm eigenvector perturbation theory (Fan et al., 2018; Chen et al., 2020; Abbe et al., 2020; Damle and Sun, 2020; Cape et al., 2019). However, most applica- tions in their works require incoherence conditions on the eigenvectors. In contrast, we do not require such condi- tions. 4.3 Manifold selection i.e., As one may notice, A = V Λ2V (cid:62) may not belong to S∗(p, K), the first K columns of A may be lin- early dependent. If we decompose A = F F (cid:62) for some F ∈ Rp×K and write F = (F (cid:62) 2 )(cid:62) with F1 ∈ RK×K and F2 ∈ R(p−K)×K. Then the smallest singular value σmin(F1) of F1 may be zero or very small depending on p. In these cases, the condition (cid:107)R−1(cid:107)2 ≤ C for some 1 F (cid:62) Algorithm 2: find index in LRC-dPCA Input: V , Λ, K Output: I ⊂ [p] Compute T = V Λ and initialize I = [0, . . . , 0] ∈ ZK. for k = 1 to K do for i = 1 to p do Set Tk = T [c(I[1 : (k − 1)], i), c(1 : k)]. Compute score[i] = σk(Tk). end for Set I[k] = argmaxi score[i]. end for constant C > 0 in Theorem 4.6 may not hold, and it is not suitable to directly use the manifold S∗(p, K) in the LRC-dPCA algorithm. p! To fix this issue, we will utilize (p−K)! cousins of the man- ifold S∗(p, K), or equivalently L∗(p, K). Let us intro- duce these cousin manifolds first. Recall that L∗(p, K) consists of N ∈ Rp×K such that N1:K,1:K is a lower triangular matrix with positive diagonal elements. Here N1:K,1:K ∈ RK×K represents the sub-matrix of N with row index [1, . . . , K] and column index [1, . . . , K]. Let I = [i1, . . . , iK] be an ordered index set of size K. A I(p, K) of L∗(p, K) consists of N ∈ Rp×K such cousin L∗ that NI,1:K is a lower triangular matrix with positive di- agonal elements. Similarly, we define S∗ I(p, K) as the set of all matrices in S(p, K) with the I-th rows linearly in- dependent. Similar to the relationship between S∗(p, K) and L∗(p, K), for any A ∈ S∗ I(p, K), there exists a unique I(p, K) such that A = N N (cid:62). Also, we element N ∈ L∗ define the Riemannian structure on S∗ I(p, K) in a way similar to (2.1) and (2.2). In addition, all theory established in Section 3 and 4 can be rephrased in the lan- guage of S∗ I(p, K). The only difference is that the row index set [1, . . . , K] is replaced by I. I(p, K) and L∗ Now we are in a position to solve the challenge raised at the beginning of this subsection. If A = V Λ2V (cid:62) does not belong to S∗(p, K), then we should choose a suitable ordered index set I rather than [1, . . . , K], and then apply the LRC-dPCA algorithm on the manifold S∗ I(p, K). Mo- tivated by the condition (cid:107)R−1(cid:107) ≤ C in Theorem 4.6, we propose the find index method in Algorithm 2. Given V , Λ, and K, the algorithm outputs an ordered index set I of size K. To avoid exhaustive search, the algorithm determines I in a sequential manner. In the kth step, we choose an index i ∈ [p] such that the k-by-k matrix Tk = T [c(I[1 : (k−1)], i), c(1 : k)] has the largest σk(Tk) among all p candidates, where c(*) indicates the index set. In practice when V and Λ is unknown, we can use (cid:98)V 1 and (cid:98)Λ1 to find a suitable index set and this index set is then shared by all machines. Hengchao Chen, Xiang Li, Qiang Sun Figure 1: Averaging PSD matrices under the intrinsic model. Top figure: errors (cid:107) (cid:101)A − A(cid:107)F against different M and p with four colored lines labeled by p. Bottom figure: comparisons between LRC and the Euclidean method in terms of (cid:107) (cid:101)A − A(cid:107)F or (cid:107) (cid:101)Aeu − A(cid:107)F against different M . Figure 2: Comparisons of four distributed PCA algo- rithms, LRC-dPCA, dPCA-Fan, dPCA-BW, fPCA. Top fig- ure: M = 50 and log(error) ∼ log(n) is reported. Bottom figure: n = 1000 and log(error) ∼ log(M) is displayed. 5 Numerical Experiments In this section, we present numerical experiments on three synthetic examples: averaging PSD matrices under the in- trinsic model, the distributed PCA problems, and averaging PSD matrices under an extrinsic model. 5.1 Averaging PSD matrices Our first experiment is to illustrate the concentration of the Karcher mean (2.3) under the intrinsic model (3.1), i.e., Theorem 3.1. We set K = 5, σ2 = 1 and let p vary across [100, 200, 300, 400] and let M range from 30 to 270 with an increment of 30. For each p, we gener- ate a p × p matrix Σ with elements i.i.d. N (0, 1), and then take A = V ΛV (cid:62), where V = (v1, . . . , vK) and Λ = (λ1, . . . , λK) are the top K left singular vectors and singular values of Σ, respectively. Given M , we gener- ate {Am}M m=1 from the intrinsic model (3.1). Then the Karcher mean (cid:101)A of {Am}M m=1 is computed and the error (cid:107) (cid:101)A − A(cid:107)F is reported in the top figure in Figure 1. As our theory shows, the estimation error turns smaller as M increases or p decreases. In addition, we compare the Karcher mean (cid:101)A, re- ferred to as LRC, with the usual Euclidean method (cid:101)Aeu, which is defined as the best rank-K approximation of M −1 (cid:80)M m=1 Am. We take p = 100 and repeat the above data generation processing. The errors (cid:107) (cid:101)A − A(cid:107)F and (cid:107) (cid:101)Aeu − A(cid:107)F are reported in the bottom figure in Figure 1. As displayed in the figure, under the intrinsic model, the geometry-aware method, LRC, outperforms the Euclidean method. This justifies the intuition that for models with specific geometric structures, it is better to take that geo- metric information into account. 5.2 Distributed PCA Our second experiment studies the Karcher mean under a general signal-plus-noise model. Specifically, we consider the distributed PCA problems and numerically verify The- orem 4.6, which shows that LRC-dPCA achieves the same Statistical Analysis of Karcher Means for Random Restricted PSD Matrices i xm(cid:62) i i=1 xm performance as full sample PCA (fPCA). In our setting, p = 100, K = 5, the population covariance Σ is gen- erated by Σ = V V (cid:62) + 0.3Ip, where V ∈ Rp×K with elements i.i.d. N (0, 1). We first fix the number of ma- chines M = 50 and let the sub-sample size n vary across [500, 1000, . . . , 2500]. On the m-th machine, we generate n i.i.d. samples {xm i }n i=1 from N (0, Σ) and compute the local sample covariance matrix (cid:98)Σm = (cid:80)n /n. Then we apply four methods , namely fPCA, LRC-dPCA, dPCA-Fan (Fan et al., 2019), and dPCA-BW (Bhaskara and Wijewardena, 2019), to compute the top K eigenvectors of Σ. Let (cid:98)V ∈ Op×K be the estimated top K eigenvec- tors. The error is defined as (cid:107) (cid:98)V (cid:98)V (cid:62) − V (V (cid:62)V )−1V (cid:62)(cid:107)F , which is the distance between the population projection matrix V (V (cid:62)V )−1V (cid:62) and the estimated projection ma- trix (cid:98)V (cid:98)V (cid:62). For each n and each method, the experiment is repeated 100 times and the average of error is recorded. The top figure in Figure 2 displays the relationship between log(error) and log(n) for all methods. It turns out that all methods share similar performance and there is a linear re- lationship between log(error) and log(n) with slope −1/2, which verifies the relationship error ∼ n−1/2. Next, we fix the sub-sample size n = 1000 and let M vary across [50, 100, . . . , 200] and repeat the above procedures. The relationship between log(error) and log(M ) is reported in the bottom figure of Figure 2. As it displayed, all four methods are almost the same and there is also a linear rela- tionship between log(error) and log(M ) with slope −1/2, which indicates error ∼ M−1/2. Since there is no spe- cific geometric information in the setting, it is expected that LRC-dPCA only matches (rather than surpasses) the performance of the state-of-the-art methods, dPCA-Fan, dPCA-BW, and the optimal method, fPCA. 5.3 Averaging PSD matrices (extrinsic) Our third experiment considers another signal-plus-noise model, which adds extrinsic noises to the intrinsic model. Specifically, we set p = 100, K = 5, and we gener- ate a p × p matrix Σ with elements i.i.d. N (0, 1), and then take A = V ΛV (cid:62), where V = (v1, . . . , vK) and Λ = (λ1, . . . , λK) are the top K left singular vectors and singular values of Σ, respectively. Given M and σ2, we generate {Am}M m=1 from the intrinsic model (3.1). Then we add extrinsic noises to Am as follows. For each m, we i=1 i.i.d. from N (0, Am + 0.01Ip), com- generate {xm i }2000 pute (cid:98)Σm = (cid:80)2000 /2000, and set A(cid:48)m as the best i=1 xm rank-K approximation of (cid:98)Σm. We compute the Karcher mean (cid:101)A of {A(cid:48)m}M m=1, which is referred to as LRC, and report the error (cid:107) (cid:101)A − A(cid:107)F. In contrast, we also apply the Euclidean method, which computes the best rank-K ap- proximation (cid:101)Aeu of (cid:80)M m=1 A(cid:48)m/M , and report the error (cid:107) (cid:101)Aeu − A(cid:107)F. First, we set σ2 = 0.5 and let M vary across [100, 200, . . . , 1000]. The errors of both methods are dis- played in the top figure of Figure 3. As shown in the fig- i xm(cid:62) i Figure 3: Comparisons of LRC and the Euclidean method in averaging PSD matrices under an extrinsic model. Top figure: σ2 = 0.5 and the error against M is reported. Bot- tom figure: M = 400 and the error versus σ2 is displayed. ure, the geometry-aware method, LRC, still outperforms the Euclidean method even if extrinsic noises are added to the intrinsic model. Next, we fix M = 400 and let σ2 range from [0, 0.1 . . . , 0.7]. The errors of both methods are shown in the bottom figure of Figure 3. Recall that σ2 denotes the strength of intrinsic noises. The bottom fig- ure indicates that when the intrinsic noises are small, then the geometry-aware method and the Euclidean method are comparable, but when the intrinsic noises becomes large, the geometry-aware method tends to outperform the Eu- clidean method. Overall, this experiment shows that, in a general signal-plus-noise model, if there exist large intrin- sic noises, then it is better to utilize the geometry-aware method. 6 Concluding Remarks This paper considers the geometry of restricted PSD ma- trices proposed by Neuman et al. (2021). In particular, we provide a non-asymptotic statistical analysis of the Karcher mean of restricted PSD matrices under an intrinsic model. Hengchao Chen, Xiang Li, Qiang Sun Moreover, for general signal-plus-noise models, we estab- lish a deterministic error bound concerning the Karcher mean. This is based on a linear perturbation expansion of the QR decomposition, which may be of independent inter- est. As an application, we use the deterministic error anal- ysis of the Karcher mean to prove that the distributed PCA algorithm, LRC-dPCA, achieves the same performance as the full sample PCA. Motivated by the established theory, we propose a manifold selection procedure for the LRC- dPCA algorithm. Finally, we carry out three synthetic nu- merical experiments to verify our theories. One observa- tion in the experiment is that if data model has certain ge- ometric structure, then it is better to utilize the geometry- aware method. Several interesting topics are worth of future studies. In manifold-valued data analysis (Patrangenaru and Elling- son, 2016), it remains to determine which statistical model is more suitable for the given data. For example, the highly anisotropic diffusion tensor images are modelled as PSD matrices (Bonnabel et al., 2013), so it is interesting to in- vestigate the performances of the proposed intrinsic model for such data. Second, it is interesting to extend our study to regression, classification, and clustering problems. References Abbe, E., Fan, J., Wang, K., and Zhong, Y. (2020). Entry- wise eigenvector analysis of random matrices with low expected rank. Annals of statistics, 48(3):1452. Arsigny, V., Fillard, P., Pennec, X., and Ayache, N. (2007). Geometric means in a novel vector space structure on symmetric positive-definite matrices. SIAM journal on matrix analysis and applications, 29(1):328–347. Bhaskara, A. and Wijewardena, P. M. (2019). On dis- tributed averaging for stochastic k-pca. In Advances in Neural Information Processing Systems, volume 32. Bhattacharya, R. and Patrangenaru, V. (2003). Large sam- ple theory of intrinsic and extrinsic sample means on manifolds. The Annals of Statistics, 31(1):1–29. Bhattacharya, R. and Patrangenaru, V. (2005). Large sam- ple theory of intrinsic and extrinsic sample means on manifolds-ii. The Annals of Statistics, 33(3):1225– 1259. Bigot, J. and Gendre, X. (2013). Minimax properties of fr ́echet means of discretely sampled curves. The Annals of Statistics, 41(2):923–956. Bini, D. A. and Iannazzo, B. (2013). Computing the karcher mean of symmetric positive definite matrices. Linear Algebra and its Applications, 438(4):1700–1710. Bonnabel, S., Collard, A., and Sepulchre, R. (2013). Rank-preserving geometric means of positive semi- definite matrices. Linear Algebra and its Applications, 438(8):3202–3216. Bonnabel, S. and Sepulchre, R. (2010). Riemannian metric and geometric mean for positive semidefinite matrices of fixed rank. SIAM Journal on Matrix Analysis and Appli- cations, 31(3):1055–1070. Cape, J., Tang, M., and Priebe, C. E. (2019). The two-to- infinity norm and singular subspace geometry with ap- plications to high-dimensional statistics. The Annals of Statistics, 47(5):2405–2439. Chang, X.-W., Paige, C. C., and Stewart, G. (1996). New perturbation analyses for the cholesky factorization. IMA journal of numerical analysis, 16(4):457–484. Chang, X.-W., Paige, C. C., and Stewart, G. (1997). Per- turbation analyses for the qr factorization. SIAM Journal on Matrix Analysis and Applications, 18(3):775–791. Charisopoulos, V., Benson, A. R., and Damle, A. (2021). Communication-efficient distributed eigenspace estima- tion. SIAM Journal on Mathematics of Data Science, 3(4):1067–1092. Chen, X., Lee, J. D., Li, H., and Yang, Y. (2021). Dis- tributed estimation for principal component analysis: An enlarged eigenspace analysis. Journal of the American Statistical Association, pages 1–12. Chen, Y., Chi, Y., Fan, J., and Ma, C. (2020). Spectral methods for data science: A statistical perspective. arXiv preprint arXiv:2012.08496. Cornea, E., Zhu, H., Kim, P., Ibrahim, J. G., and Initiative, A. D. N. (2017). Regression models on riemannian sym- metric spaces. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(2):463–482. Damle, A. and Sun, Y. (2020). Uniform bounds for in- variant subspace perturbations. SIAM Journal on Matrix Analysis and Applications, 41(3):1208–1236. Dryden, I. L., Koloydenko, A., and Zhou, D. (2009). Non- euclidean statistics for covariance matrices, with appli- cations to diffusion tensor imaging. The Annals of Ap- plied Statistics, 3(3):1102–1123. Fan, J., Wang, D., Wang, K., and Zhu, Z. (2019). Dis- tributed estimation of principal eigenspaces. Annals of statistics, 47(6):3009. Fan, J., Wang, W., and Zhong, Y. (2018). An (cid:96)∞ eigen- vector perturbation bound and its application to robust covariance estimation. Journal of Machine Learning Re- search, 18(207):1–42. Faraki, M., Harandi, M. T., and Porikli, F. (2016). Im- age set classification by symmetric positive semi-definite matrices. In 2016 IEEE Winter conference on applica- tions of computer vision (WACV), pages 1–8. IEEE. Gang, A., Raja, H., and Bajwa, W. U. (2019). Fast and In ICASSP communication-efficient distributed pca. 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 7450– 7454. IEEE. Statistical Analysis of Karcher Means for Random Restricted PSD Matrices Garber, D., Shamir, O., Communication-efficient stochastic principal component analysis. algorithms and Srebro, N. (2017). for distributed Grammenos, A., Mendoza Smith, R., Crowcroft, J., and Mascolo, C. (2020). Federated principal component analysis. Advances in Neural Information Processing Systems, 33. Vandereycken, B., Absil, P.-A., and Vandewalle, S. (2013). A riemannian geometry with complete geodesics for the set of positive semidefinite matrices of fixed rank. IMA Journal of Numerical Analysis, 33(2):481–514. Vershynin, R. (2012). Introduction to the non-asymptotic analysis of random matrices, page 210–268. Cambridge University Press. Hastie, T., Tibshirani, R., Friedman, J. H., and Friedman, J. H. (2009). The elements of statistical learning: data mining, inference, and prediction, volume 2. Springer. Wainwright, M. J. (2019). High-dimensional statistics: A non-asymptotic viewpoint, volume 48. Cambridge Uni- versity Press. Wang, R., Guo, H., Davis, L. S., and Dai, Q. (2012). Covariance discriminative learning: A natural and effi- cient approach to image set classification. In 2012 IEEE conference on computer vision and pattern recognition, pages 2496–2503. IEEE. Journ ́ee, M., Bach, F., Absil, P.-A., and Sepulchre, R. (2010). Low-rank optimization on the cone of positive semidefinite matrices. SIAM Journal on Optimization, 20(5):2327–2351. Karcher, H. (1977). Riemannian center of mass and mol- lifier smoothing. Communications on Pure and Applied Mathematics, 30(5):509–541. Li, X., Wang, S., Chen, K., and Zhang, Z. (2021). Communication-efficient distributed svd via local power In International Conference on Machine iterations. Learning, pages 6504–6514. PMLR. Mackey, L., Talwalkar, A., and Jordan, M. I. (2011). In Proceed- Divide-and-conquer matrix factorization. ings of the 24th International Conference on Neural In- formation Processing Systems, pages 1134–1142. Massart, E. and Absil, P.-A. (2020). Quotient geometry with simple geodesics for the manifold of fixed-rank positive-semidefinite matrices. SIAM Journal on Matrix Analysis and Applications, 41(1):171–198. Moakher, M. (2005). A differential geometric approach to the geometric mean of symmetric positive-definite matri- ces. SIAM Journal on Matrix Analysis and Applications, 26(3):735–747. Mohri, M., Rostamizadeh, A., and Talwalkar, A. (2018). Foundations of machine learning. MIT press. Neuman, A. M., Xie, Y., and Sun, Q. (2021). Restricted riemannian geometry for positive semidefinite matrices. arXiv preprint arXiv:2105.14691. Patrangenaru, V. and Ellingson, L. (2016). Nonparametric statistics on manifolds and their applications to object data analysis. CRC Press, Taylor & Francis Group Boca Raton. Pilanci, M. and Wainwright, M. J. (2015). Random- ized sketches of convex programs with sharp guarantees. IEEE Transactions on Information Theory, 61(9):5096– 5115. Stewart, G. (1977). Perturbation bounds for the qr factor- ization of a matrix. SIAM Journal on Numerical Analy- sis, 14(3):509–518. Stewart, G. (1997). On the perturbation of lu and cholesky factors. IMA Journal of Numerical Analysis, 17(1):1–6. Hengchao Chen, Xiang Li, Qiang Sun APPENDIX A Proof of Theorem 3.1 Proof of Theorem 3.1. Recall that the Karcher mean (cid:101)A of {Am}M m=1 under the intrinsic model is given by (3.1). First, we give an upper bound on the Frobenius norm of 1 m=1 Em is a mock M lower triangular matrix with lower triangular elements i.i.d. N (0, σ2/M ). Therefore, by the concentration of χ2 ((2.19) in Wainwright (2019)), for all t ∈ (0, 1), we have m=1 Em. By the intrinsic model, we know 1 M (cid:80)M (cid:80)M (cid:107) 1 M M (cid:88) m=1 Em(cid:107)2 F ≤ pKσ2 M (1 + t), with probability at least 1 − e−pKt2/8. In a similar spirit, using union bound, we have for t ∈ (0, 1), max i=1,...,K | 1 M M (cid:88) m=1 Em ii |2 ≤ σ2 M (1 + t) (A.1) (A.2) with probability at least 1 − Ke−t2/8. Here Em ii maxi=1,...,K | 1 M ii |2 ≤ 1/2 and m=1 Em (cid:80)M is the (i, i)-th element of Em. Thus with high probability, | exp( 1 M M (cid:88) m=1 Em ii ) − 1| ≤ 2| 1 M M (cid:88) m=1 Em ii |, (A.3) where we use the inequality | exp(x) − 1| ≤ 2|x| for x ≤ 1/2. Denote by N the reduced Cholesky factor of A. Then it holds that (cid:107)N (cid:107)2 = (cid:107)A(cid:107)1/2 2 ≤ C 1/2 for some constant C > 0. Furthermore, by (3.1), we have for some constants c1, c2 > 0 that (cid:107) (cid:101)A − A(cid:107)F ≤ (cid:114) c2pKσ2 M , (A.4) with probability at least 1 − e−c1pK. B Proof of Lemma 3.3 Proof of Lemma 3.3. The proof of this lemma is split up into three steps. First, we assume Q = IK and show that qQ 0), where qP ∈ RK×K is a skew-symmetric matrix of order Omax((cid:15)0). Second, by has the form of IK + qP + Omax((cid:15)2 taking upper triangular off-diagonal elements of (R + E) qQ(cid:62) as zero, we derive a closed-form expression of qP (up to a higher-order term). Motivated by this closed-form expression, we define a function fR : RK×K (cid:55)→ RK×K satisfying several desired conditions. For example, we have qQ = IK + fR(E) + Omax((cid:15)2 0) and fR is linear in its argument. Third, we extend the results to the general case when Q ∈ OK×K may differ from IK. In this step, we will show that qQ has a form of IK + qP + Omax((cid:15)2 Step 1. When (cid:15)0 = (cid:107)E(cid:107)max is sufficiently small, the matrix R + E is still non-singular and by QR decomposition there exists a unique orthogonal matrix qQ ∈ OK×K such that qR = (R + E) qQ(cid:62) is a lower triangular matrix with positive 0), where qP ∈ RK×K is a diagonal elements. skew-symmetric matrix of order Omax((cid:15)0). To that end, we construct qQ as a product of K(K − 1)/2 rotation matrices { qQij, 1 ≤ i < j ≤ K}, which set the upper triangular off-diagonal elements as zero in a sequential fashion. In specific, we arrange these K(K − 1)/2 rotation matrices in a prescribed order, i.e., {(1, 2), . . . , (1, K), (2, 3), . . . , (K − 1, K)}. In this way, we may relabel { qQij, 1 ≤ i < j ≤ K} as { qQ(s), 1 ≤ s ≤ K(K − 1)/2} and write qQ = qQ(K(K−1)/2) * * * qQ(1). In the remainder of this proof, we will use s(i, j) to represent the s-index of the (i, j)th rotation matrix qQij. For each (i, j), we set the rotation matrix qQij as qQij ii = qQij jj = cos(θij), qQij ij = − qQij ji = sin(θij), qQij kk = 1, ∀k (cid:54)= i, j, qQij kl = 0, otherwise, Statistical Analysis of Karcher Means for Random Restricted PSD Matrices where θij is chosen in a sequential fashion such that the (i, j)th element of qR(s(i,j)) := (R + E) qQ(1)(cid:62) is zero and the diagonal elements of qR(s(i,j)) keep positive. Note that qQij is by definition an orthogonal matrix. A simple calculation gives that θij = θ(s(i,j)) = arctan( qR(s(i,j)−1) ii Next, we show that θij is a small quantity of order O((cid:15)0) via an deductive argument. First, when (cid:15)0 = (cid:107)E(cid:107)max is sufficiently small, θ(1) = θ12 = arctan(E12/(R11 + E11)) is a small quantity of order O((cid:15)0). Thus, by definition of qQ12, we have qQ(1) = qQ12 = IK + Omax((cid:15)0) and * * * qQ(s(i,j))(cid:62) / qR(s(i,j)−1) ). ij qR(1) = (R + E)(IK + qQ(1)(cid:62) − IK) = R + E + R( qQ(1)(cid:62) − IK) + Omax((cid:15)2 0). := qR(1) − R is again of order Omax((cid:15)0). This implies that θ(2) = θ13 = 11 )) is also a small quantity of order O((cid:15)0). Applying this deductive argument K(K − 1)/2 Note that the error matrix E(1) arctan(E(1) 13 /(R11 + E(1) times, we conclude that all θ(s), 1 ≤ s ≤ K(K − 1)/2, are small quantities of order O((cid:15)0). Now we are able to show that qQ has a form of IK + qP +Omax((cid:15)2 Omax((cid:15)0). Since θij is of order O((cid:15)0), by Taylor expansion, we have sin(θij) = θij + O((cid:15)3 Thus, we can rewrite qQij as 0), where qP ∈ RK×K is a skew-symmetric matrix of order 0) and 1 − cos(θij) = O((cid:15)2 0). qQij = IK + qP ij + Omax((cid:15)2 0), where qP ij ij = − qP ij ij = θij and qP ij kl = 0 otherwise. Since qP ij is of order Omax((cid:15)0), we have qQ = qQ(K(K−1)/2) * * * qQ(1) = (IK + qP (K(K−1)/2) + Omax((cid:15)2 0)) * * * (IK + qP (1) + Omax((cid:15)2 0)) = IK + K(K−1)/2 (cid:88) s=1 qP (s) + Omax((cid:15)2 0) = IK + qP + Omax((cid:15)2 0), (B.1) where qP (s(i,j)) = qP ij and qP = (cid:80)K(K−1)/2 also a skew-symmetric matrix of order Omax((cid:15)0), which concludes the proof of step 1. Step 2. Now we are ready to derive a closed-form expression of qP (maybe up to a higher-order term) by taking upper triangular off-diagonal elements of (R + E) qQ(cid:62) as zero. Substituting (B.1) into (R + E) qQ(cid:62), we obtain qP (s). Since qP (s) is skew-symmetric and of order Omax((cid:15)0) for all s, qP is s=1 (R + E) qQ(cid:62) = R + E + R qP (cid:62) + Omax((cid:15)2 0) = R + E − R qP + Omax((cid:15)2 0), (B.2) where the second equality follows from the skew-symmetry of qP . Since R is a lower triangular matrix with positive diagonal elements, R is invertible and R−1 is also a lower triangular matrix. As a result, the matrix R−1(R + E) qQ(cid:62) is also a lower triangular matrix. Multiplying LHS and RHS of (B.2) by R−1 simultaneously, we obtain R−1(R + E) qQ(cid:62) = IK + R−1E − qP + Omax((cid:15)2 0). (B.3) For convenience, we define a function U(*) : RK×K (cid:55)→ RK×K, P (cid:55)→ U(P ), where U(P ) takes the upper triangular off-diagonal elements of P , i.e., Since R−1(R + E) qQ(cid:62) is a lower triangular matrix, we have by (B.3) that U(P )ij = Pij, i < j, U(P )ij = 0, otherwise. U( qP ) = U(R−1E) + Omax((cid:15)2 0). Since qP is skew-symmetric, we get the following closed-form solution of qP (up to a higher-order term), qP = U(R−1E) − (U(R−1E))(cid:62) + Omax((cid:15)2 0). Motivated by the linear expansion of qP , we define the following function, Hengchao Chen, Xiang Li, Qiang Sun fR : RK×K (cid:55)→ RK×K, E (cid:55)→ fR(E) := U(R−1E) − (U(R−1E))(cid:62). Note that fR is linear in the sense that fR(aE + bF ) = afR(E) + bfR(F ) for all a, b ∈ R and E, F ∈ RK×K. Also, the image fR(E) is a skew-symmetric matrix, i.e., (fR(E))(cid:62) = −fR(E). Moreover, we have (cid:107)fR(E)(cid:107)F ≤ √ 2(cid:107)R−1(cid:107)2(cid:107)E(cid:107)F. By (B.1), we can rewrite qQ as follows, qQ = IK + fR(E) + Omax((cid:15)2 0). (B.4) Moreover, by definition of qR, we have qR = (R + E) qQ(cid:62) = R + E − RfR(E) + Omax((cid:15)2 0). Step 3. In general, when Q ∈ OK×K may differ from IK, we can transform the QR decomposition qR qQ = RQ + E suitably and apply the results in the previous two steps to prove the lemma. In specific, we have When (cid:15)0 = (cid:107)E(cid:107)max is sufficiently small, (cid:107)EQ(cid:62)(cid:107)max ≤ an orthogonal matrix that appears in the QR decomposition of R + EQ(cid:62). Therefore, by (B.4), we have K(cid:15)0 can also be sufficiently small. In addition, qQQ(cid:62) is still qR qQQ(cid:62) = R + EQ(cid:62). √ qQQ(cid:62) = IK + fR(EQ(cid:62)) + Omax(K(cid:15)2 0). By multiplying both LHS and RHS of this equation by Q, we obtain that qQ = Q + fR(EQ(cid:62))Q + Omax(K 3/2(cid:15)2 0). In addition, by definition of qR, we have qR = (RQ + E) qQ(cid:62) = (R + EQ(cid:62))Q qQ(cid:62) = R + EQ(cid:62) − RfR(EQ(cid:62)) + Omax((cid:15)2 0), which concludes the proof. C Proof of Theorem 3.4 Proof of Theorem 3.4. First, we use Lemma 3.3 to give a first-order perturbation expansion for the reduced Cholesky factor N m of Am = (N + Em)(N + Em)(cid:62). Define Qm ∈ OK×K as an orthogonal matrix such that N m = (N + Em)Qm(cid:62), or equivalently, (R + E1,m)Qm(cid:62) is a lower triangular matrix with positive diagonal elements. By Lemma 3.3, when (cid:107)E1,m(cid:107)max ≤ (cid:15)0 is sufficiently small, we have where fR is defined in Lemma 3.3. By definition of Qm, we have Qm = IK + fR(E1,m) + Omax((cid:15)2 0), N m = (N + Em)Qm(cid:62) = N + Em − N fR(E1,m) + Omax((cid:15)2 0), where we use the property fR(E1,m)(cid:62) = −fR(E1,m). Using this linear perturbation expansion, we are now able to characterize the Karcher mean (cid:101)A = (cid:102)N (cid:102)N (cid:62) (or (cid:102)N ) of {Am}M m=1) on the manifold S∗(p, K) (or L∗(p, K)). By the LRC algorithm, i.e., (2.3), we have (cid:102)N is equal to 1 m=1 N m except that the diagonal elements of (cid:102)N are given M by m=1 (or {N m}M (cid:80)M M (cid:89) (cid:102)Nii = ( m=1 N m ii )1/M , ∀1 ≤ i ≤ K. Statistical Analysis of Karcher Means for Random Restricted PSD Matrices However, when (cid:15)0 is sufficiently small, |N m ii − Nii| is of order O((cid:15)0) and thus (cid:102)Nii − 1 M M (cid:88) m=1 Nii = O((cid:15)2 0), ∀1 ≤ i ≤ K. Therefore, we have (cid:102)N = 1 M M (cid:88) m=1 N m + Omax((cid:15)2 0) = N + = N + 1 M 1 M M (cid:88) m=1 M (cid:88) m=1 (cid:0)Em − N fR(E1,m)(cid:1) + Omax((cid:15)2 0) Em − N fR( 1 M M (cid:88) m=1 E1,m) + Omax((cid:15)2 0), where the last equality follows from the linear property of fR(*). D Proof of Lemma 4.3 Proof of Lemma 4.3. Since V , Λ denote the top K eigenvectors and eigenvalues of Σ, respectively, we have ΣV = V Λ and thus N = V ΛQ∗ = ΣV Q∗. Similarly, we have (cid:98)Σm (cid:98)V m = (cid:98)V m (cid:98)Λm. Since (cid:99)H m and Q∗ are both orthogonal matrices, we have (N + (cid:98)Em)(N + (cid:98)Em)(cid:62) = ( (cid:98)V m (cid:98)Λm (cid:99)H mQ∗)( (cid:98)V m (cid:98)Λm (cid:99)H mQ∗)(cid:62) = ( (cid:98)V m (cid:98)Λm)( (cid:98)V m (cid:98)Λm)(cid:62) = (cid:98)Am, which concludes our proof. E Proof of Lemma 4.4 Proof of Lemma 4.4. The proof of this lemma is based on a first-order expansion of (cid:98)Em. Define E m = (cid:98)Σm − Σ and (cid:15) = maxm (cid:107)E m(cid:107)2/∆K. When (cid:15) ≤ 1/10, by Lemma H.2, we have (cid:107) (cid:98)V m (cid:99)H m − V − g(E mV )(cid:107)F ≤ 9 √ K(cid:15)2, where g : Rp×K (cid:55)→ Rp×K, (w1, . . . , wK) (cid:55)→ (−G1w1, . . . , −GKwK), with Gj = (cid:80) (cid:98)Em, we have i>K(λi − λj)−1viv(cid:62) i for j ∈ [K] and λi/vi being the ith eigenvalue/eigenvector of Σ. By definition of (cid:98)Em = ((Σ + E m)(V + ( (cid:98)V m (cid:99)H m − V )) − ΣV )Q∗ = E mV Q∗ + Σ( (cid:98)V m (cid:99)H m − V )Q∗ + E m( (cid:98)V m (cid:99)H m − V )Q∗ = E mV Q∗ + Σg(E mV )Q∗ + OF((cid:15)2). Since vec ◦ g ◦ vec−1 is a linear mapping from RpK to RpK, where vec : Rp×K (cid:55)→ RpK is the vectorization mapping, the average of (cid:98)Em can be expressed as 1 M M (cid:88) m=1 (cid:98)Em = 1 M M (cid:88) m=1 E mV Q∗ + Σg( 1 M M (cid:88) m=1 E mV )Q∗ + OF((cid:15)2). Hengchao Chen, Xiang Li, Qiang Sun Thus, by the triangular inequality, we have (cid:107) 1 M M (cid:88) m=1 (cid:98)Em(cid:107)F ≤ (cid:107) 1 M M (cid:88) m=1 E mV Q∗(cid:107)F + (cid:107)Σg( 1 M M (cid:88) m=1 E mV )Q∗(cid:107)F + O((cid:15)2). Since (cid:107)Q∗(cid:107)2 = 1 and (cid:107)V (cid:107)F = √ K, we have (cid:107) 1 M M (cid:88) m=1 E mV Q∗(cid:107)F ≤ √ K(cid:107) 1 M M (cid:88) m=1 E m(cid:107)2. In addition, since (cid:107)ΣGj(cid:107)2 ≤ ∆−1 K λK for all j ∈ [K], we have (cid:107)Σg( 1 M M (cid:88) m=1 E mV )Q∗(cid:107)F ≤ ∆−1 K λK(cid:107) 1 M M (cid:88) m=1 E mV (cid:107)F ≤ ∆−1 K λK √ K(cid:107) 1 M M (cid:88) m=1 E m(cid:107)2. (cid:107) 1 M M (cid:88) m=1 Em(cid:107)F ≤ C(cid:107) 1 M M (cid:88) m=1 E m(cid:107)2 + O((cid:15)2) Thus, we have for some constant C > 0. F Proof of Lemma 4.5 Proof of Lemma 4.5. Similar to Lemma 4.4, the proof of this lemma is also based on the first-order expansion of (cid:98)Em. Define E m = (cid:98)Σm − Σ and (cid:15) = maxm (cid:107)E m(cid:107)2/∆K. When (cid:15) ≤ 1/10, by Lemma H.2, we have (cid:107) (cid:98)V m (cid:99)H m − V − g(E mV )(cid:107)F ≤ 9 √ K(cid:15)2, where g : Rp×K (cid:55)→ Rp×K, (w1, . . . , wK) (cid:55)→ (−G1w1, . . . , −GKwK), with Gj = (cid:80) (cid:98)Em, we have i>K(λi − λj)−1viv(cid:62) i for j ∈ [K] and λi/vi being the ith eigenvalue/eigenvector of Σ. By definition of By the triangular inequality and the fact that (cid:107) * (cid:107)max ≤ (cid:107) * (cid:107)F, we have (cid:98)Em = E mV Q∗ + Σg(E mV )Q∗ + OF((cid:15)2). (cid:107) (cid:98)Em(cid:107)max ≤ (cid:107)E mV Q∗(cid:107)max + (cid:107)Σg(E mV )Q∗(cid:107)max + O((cid:15)2) √ √ ≤ K(cid:107)E mV (cid:107)max + K(cid:107)Σg(E mV )(cid:107)max + O((cid:15)2), where the second inequality follows from the inequality (cid:107)*Q∗(cid:107)max ≤ K(cid:107)*(cid:107)max. Thus, to bound (cid:107) (cid:98)Em(cid:107)max, it suffices to bound (cid:107)E mV (cid:107)max, (cid:107)Σg(E mV )(cid:107)max, and (cid:15)2 = (maxm (cid:107)E m(cid:107)2/∆K)2 separately. To give an upper bound on the first two terms, we will need Proposition 1 in Pilanci and Wainwright (2015), which is presented below for reader's convenience. Proposition F.1 (Proposition 1 in Pilanci and Wainwright (2015)). Let {zi}n i=1 ⊂ Rp be i.i.d. samples generated from a zero-mean sub-Gaussian distribution with Cov(zi) = Ip. Then there exist some universal constants C1, C2 > 0 such that for any subset Y ⊂ Sp−1, we have with probability at least 1 − e−C2nδ2 , √ (cid:12) (cid:12) (cid:12) (cid:12) η(cid:62) (cid:18) Z(cid:62)Z n sup η∈Y (cid:19) − Ip η (cid:12) (cid:12) (cid:12) (cid:12) ≤ C1 W(Y) √ n + δ, Statistical Analysis of Karcher Means for Random Restricted PSD Matrices where Z(cid:62) = (z1, . . . , zn) ∈ Rp×n and W(Y) is the Gaussian width of the subset Y. Specifically, W(Y) is defined by W(Y) = E[sup η∈Y |(cid:104)h, η(cid:105)|], where the expectation is taken on h ∈ Rp, which is a standard normal random vector. 1: bound (cid:107)E mV (cid:107)max. Denote by el ∈ Rp the basis vector with value 1 at the lth entry and 0 at other entries. Then the max norm has the following expression, (cid:107)E mV (cid:107)max = max l∈[p],k∈[K] |e(cid:62) l E mvk|. Let zm i }n {zm i = Σ−1/2xm i=1 are i.i.d. sub-Gaussian with mean 0 and covariance Ip. By definition of E m, we have i and Zm = (zm n )(cid:62). Since {xm 1 , . . . , zm i }n i=1 are i.i.d. sub-Gaussian with mean 0 and covariance Σ, |e(cid:62) l E mvk| = |(Σ1/2el)(cid:62)( Zm(cid:62)Zm n − Ip)Σ1/2vk|. By the polarization equality, we have (Σ1/2el)(cid:62)( Zm(cid:62)Zm n − Ip)Σ1/2vk = (cid:110) (Σ1/2el + Σ1/2vk)(cid:62)( 1 2 Zm(cid:62)Zm n − Ip)(Σ1/2el + Σ1/2vk) − (Σ1/2el)(cid:62)( − (Σ1/2vk)(cid:62)( Zm(cid:62)Zm n Zm(cid:62)Zm n − Ip)(Σ1/2el) − Ip)(Σ1/2vk) (cid:111) . Then by the triangular inequality, we have (cid:107)E mV (cid:107)max ≤ max l∈[p],k∈[K] (cid:110) |(Σ1/2el + Σ1/2vk)(cid:62)( 1 2 Zm(cid:62)Zm n − Ip)(Σ1/2el + Σ1/2vk)| + |(Σ1/2el)(cid:62)( + |(Σ1/2vk)(cid:62)( Zm(cid:62)Zm n Zm(cid:62)Zm n − Ip)(Σ1/2el)| − Ip)(Σ1/2vk)| (cid:111) . Since (cid:107)el(cid:107)2 = (cid:107)vk(cid:107)2 = 1, we have (cid:107)Σ1/2(el + vk)(cid:107)2 ≤ 2(cid:107)Σ1/2(cid:107)2 = 2(cid:107)Σ(cid:107)1/2 2 for all l ∈ [p] and k ∈ [K]. Define Y1 ⊂ Sp−1 as follows, , (cid:107)Σ1/2el(cid:107)2 ≤ (cid:107)Σ(cid:107)1/2 2 , (cid:107)Σ1/2vk(cid:107)2 ≤ (cid:107)Σ(cid:107)1/2 2 , Y1 = (cid:26) Σ1/2(el + vk) (cid:107)Σ1/2(el + vk)(cid:107)2 (cid:27) ∪ (cid:26) Σ1/2el (cid:27) (cid:107)Σ1/2el(cid:107)2 l∈[p] ∪ (cid:26) Σ1/2vk (cid:27) (cid:107)Σ1/2vk(cid:107)2 k∈[K] , l∈[p],k∈[K] then we have (cid:107)E mV (cid:107)max ≤ C1 * sup η∈Y1 (cid:12) (cid:12) (cid:12) (cid:12) η(cid:62) (cid:18) Zm(cid:62)Zm n (cid:19) − Ip η (cid:12) (cid:12) (cid:12) (cid:12) , where C1 > 0 is a constant dependent on (cid:107)Σ(cid:107)2. We remark here that in the proof notations C, C1, C2 represent some universal constants, which may vary according to the context. By Proposition F.1, there exist some universal constants C1, C2 > 0 such that the following inequality holds (cid:107)E mV (cid:107)max ≤ C1 W(Y1) √ n + δ, with probability at least 1 − e−C2nδ2 maximal inequality (Mohri et al., 2018), the following inquality . Since Y1 is a finite set with cardinality |Y1| ≤ Cp for some constant C > 0, by the W(Y1) ≤ C1 (cid:112)log(p) holds for some constant C1 > 0. Thus with probability at least 1 − e−C2nδ2 , we have Hengchao Chen, Xiang Li, Qiang Sun (cid:107)E mV (cid:107)max ≤ C1 (cid:114) log(p) n + δ. 2: bound (cid:107)Σg(E mV )(cid:107)max. The proof of this step is similar to that of step one. By definition of g, we have g(E mV ) = (−G1E mv1, . . . , −GKE mvK). Then we may write the max norm as (cid:107)Σg(E mV )(cid:107)max = max l∈[p],k∈[K] |e(cid:62) l ΣGkE mvk| = max l∈[p],k∈[K] |e(cid:62) l ΣGkΣ1/2( Zm(cid:62)Zm n − Ip)Σ1/2vk|. Similar to step one, by the polarization equality, the triangular inequality, and the fact Gk = G(cid:62) k , we have (cid:107)g(E mV )(cid:107)max ≤ max l∈[p],k∈[K] 1 2 (cid:110) |(Σ1/2GkΣel + Σ1/2vk)(cid:62)( Zm(cid:62)Zm n − Ip)(Σ1/2GkΣel + Σ1/2vk)| By definition of Gk, we have + |(Σ1/2vk)(cid:62)( + |(Σ1/2GkΣel)(cid:62)( − Ip)(Σ1/2GkΣel)| Zm(cid:62)Zm n Zm(cid:62)Zm n − Ip)(Σ1/2vk)| (cid:111) . Σ1/2GkΣ = (cid:88) i>K (λi − λk)−1λ3/2 i viv(cid:62) i , and thus (cid:107)Σ1/2GkΣ(cid:107)2 ≤ λ3/2 K ∆−1 K . Since (cid:107)el(cid:107)2 = (cid:107)vk(cid:107)2 = 1, we have (cid:107)Σ1/2GkΣel + Σ1/2vk(cid:107)2 ≤ (cid:107)Σ1/2GkΣ(cid:107)2 + (cid:107)Σ1/2(cid:107)2 ≤ λ3/2 K ∆−1 K + λ1/2 1 , (cid:107)Σ1/2GkΣel(cid:107)2 ≤ λ3/2 K ∆−1 K . Define the following set Y2 ⊂ Sp−1, Y2 = (cid:110) Σ1/2GkΣel + Σ1/2vk (cid:111) (cid:107)Σ1/2GkΣel + Σ1/2vk(cid:107)2 l∈[p],k∈[K] ∪ (cid:110) Σ1/2GkΣel (cid:111) (cid:107)Σ1/2GkΣel(cid:107)2 l∈[p],k∈[K] ∪ (cid:110) Σ1/2vk (cid:111) (cid:107)Σ1/2vk(cid:107)2 k∈[K] . Then we have (cid:107)Σg(E mV )(cid:107)max ≤ C1 * sup η∈Y2 (cid:12) (cid:12) (cid:12) (cid:12) η(cid:62) (cid:18) Zm(cid:62)Zm n (cid:19) − Ip η (cid:12) (cid:12) (cid:12) (cid:12) for some constant C1 > 0 dependent on (cid:107)Σ(cid:107)2 and ∆K. Again by Proposition F.1, we have with probability at least 1 − e−C2nδ2 that (cid:107)Σg(E mV )(cid:107)max ≤ C1 W(Y2) √ n + δ for some universal constants C1, C2 > 0. Since Y2 is a finite set with cardinality |Y2| ≤ Cp for some constant C > 0, by the maximal inequality (Mohri et al., 2018), we have for some constant C1 > 0. Thus with probability at least 1 − e−C2nδ2 , we have W(Y2) ≤ C1 (cid:112)log(p) (cid:107)Σg(E mV )(cid:107)max ≤ C1 (cid:114) log(p) n + δ. Statistical Analysis of Karcher Means for Random Restricted PSD Matrices 3: bound (cid:15)2. We will use the tail bound of (cid:107)E m(cid:107)2 in Lemma H.1 to bound (cid:15)2. By Lemma H.1, we have with probability at least 1 − e−C δn r that √ for some constant C > 0 and r = Tr(Σ)/λ1 ≤ p. Then by union bound, we have with probability at least 1 − M e−C that √ δn r (cid:107)E m(cid:107)2 2 ≤ δ for some constant C > 0. (cid:15)2 = max m (cid:107)E m(cid:107)2 2/∆2 K ≤ δ, Last: bound maxm (cid:107) (cid:98)Em(cid:107)max. We will combine the results from 1 to 3 and apply a union bound to obtain the upper bound on maxm (cid:107) (cid:98)Em(cid:107)max. In specific, by union bound, we have with probability at least 1 − 2M e−C1nδ2 δ2n/r that 1 − M e−C2 √ max m (cid:107) (cid:98)Em(cid:107)max ≤ C3 (cid:114) log(p) n + δ1 + δ2, for some constants C1, C2, C3 > 0. Take δ1 = 1 − 2p−1 that, (cid:113) log(2M p) C1n and δ2 = log(M p)2r C2 2 n , then we have with probability at least max m (cid:107) (cid:98)Em(cid:107)max ≤ C1 (cid:114) log(pM ) n + C2 log2(pM )r n , for some constants C1, C2 > 0. When n (cid:38) log3(pM )r2, with probability at least 1 − 2p−1 the following bound max m (cid:107) (cid:98)Em(cid:107)max ≤ C (cid:114) log(pM ) n holds for some constant C > 0. G Proof of Theorem 4.6 Proof of Theorem 4.6. We will combine the results in Theorem 3.4, Lemma 4.3, Lemma 4.4, and Lemma 4.5 to prove this theorem. Recall that (cid:98)Em = (cid:98)Σm (cid:98)V m (cid:99)H mQ∗ − ΣV Q∗, E m = (cid:98)Σm − Σ, (cid:15) = maxm (cid:107)E m(cid:107)2/∆K, and (cid:15)0 = maxm (cid:107) (cid:98)Em(cid:107)max. In addition, we partition N = (R(cid:62) B(cid:62))(cid:62) and (cid:98)Em = ( (cid:98)E1,m(cid:62) )(cid:62) such that R, (cid:98)E1,m ∈ RK×K and B, (cid:98)E2,m ∈ R(p−K)×K. By Lemma 4.3, we have (cid:98)Am = (N + (cid:98)Em)(N + (cid:98)Em)(cid:62) for all m ∈ [M ], where N is the reduced Cholesky factor of A = V Λ2V (cid:62). By Lemma 4.5, (cid:15)0 = maxm (cid:107) (cid:98)Em(cid:107)max is sufficiently small with high probability when n is sufficiently large. Thus, we can apply Theorem 3.4 to the LRC-dPCA algorithm to obtain the desired result. In specific, by Theorem 3.4, we have (cid:98)E2,m(cid:62) (cid:102)N = N + 1 M M (cid:88) m=1 (cid:98)Em − N fR( 1 M M (cid:88) m=1 (cid:98)E1,m) + Omax((cid:15)2 0), where fR is defined in Lemma 3.3. By the triangular inequality, we have (cid:107) (cid:102)N − N (cid:107)F ≤ (cid:107) ≤ (cid:107) 1 M 1 M M (cid:88) m=1 M (cid:88) m=1 (cid:98)Em(cid:107)F + (cid:107)N fR( 1 M M (cid:88) m=1 (cid:98)E1,m)(cid:107)F + O((cid:112)pK(cid:15)2 0) √ (cid:98)Em(cid:107)F + 2(cid:107)N (cid:107)2(cid:107)R−1(cid:107)2(cid:107) 1 M M (cid:88) m=1 (cid:98)E1,m(cid:107)F + O((cid:112)pK(cid:15)2 0), where the second inequality is due to the property (cid:107)fR(*)(cid:107)F ≤ √ 2(cid:107)R−1(cid:107)2(cid:107) * (cid:107)F. By Lemma 4.4, we have (cid:107) (cid:102)N − N (cid:107)F ≤ C(cid:107) 1 M M (cid:88) m=1 E m(cid:107)2 + O((cid:15)2) + O( √ p(cid:15)2 0), (G.1) for some constant C > 0. Hengchao Chen, Xiang Li, Qiang Sun Next, we give a high probability bound on (cid:107) (cid:102)N − N (cid:107)F in three steps. First, by Lemma H.1, we have with probability at least 1 − e − C1λ1 δ1 √ r/(M n) that (cid:107) 1 M M (cid:88) m=1 E m(cid:107)2 ≤ δ1, for some constant C1 > 0 and r = Tr(Σ)/λ1(Σ). Second, by Lemma H.1 and the union bound, we have with probability at least 1 − M e − δ2 √ C2λ1 r/n that for some constant C2 > 0. Third, by Lemma 4.5, we have with probability at least 1 − 2M e−C3nδ2 3 − M e−C4 √ δ4n/r that (cid:15) ≤ δ2/∆K, (cid:15)0 = max m (cid:107) (cid:98)Em(cid:107)max ≤ C5 (cid:114) log(p) n + δ3 + δ4, for some constants C3, C4, C5 > 0. By the union bound, we combine these three high probability bounds with (G.1) to obtain the desired result. In specific, with probability at least 1 − e M e−C4 δ4n/r, the following inequality √ − C1λ1 δ1 √ r/(M n) − M e − δ2 √ C2λ1 r/n − 2M e−C3nδ2 3 − (cid:107) (cid:102)N − N (cid:107)F ≤ O(δ1) + O(δ2 2) + O( √ p log(p) n √ ) + O( pδ2 3) + O( √ pδ2 4), holds for some constants C1, C2, C3, C4 > 0. Take δ1 = C1λ1 log(p)(cid:112)r/(M n), δ2 = C2λ1 log(pM )(cid:112)r/n, δ3 = (cid:113) log(2pM ) C3n , then we have with probability at least 1 − 4p−1 that , and δ4 = log2(pM )r C2 4 n (cid:107) (cid:102)N − N (cid:107)F ≤ O( ≤ O( √ log(p) √ M n √ log(p) √ M n r r ) + O( ) + O( √ log2(pM )r n p log(pM ) n (log2(pM )r) ∨ (log(pM ) ) + O( p) √ ) + O( √ ) + O( √ ) p log4(pM )r2 n2 p log4(pM )r2 n2 ). n When n (cid:38) (log2(pM ) √ pr) ∨ (log3(pM )r2), we have with probability at least 1 − 4p−1 that (cid:107) (cid:102)N − N (cid:107)F ≤ O( √ log(p) √ M n r ) + O( (log2(pM )r) ∨ (log(pM ) √ n p) ). In addition, when n (cid:38) M ((log4(pM )r2)∨(log2(pM )p)) log2(p)r , we have with probability at least 1 − 4p−1 that (cid:107) (cid:102)N − N (cid:107)F ≤ O( which concludes the proof. H Auxiliary Lemmas √ log(p) √ r ), M n The following lemma gives a tail bound of (cid:107) (cid:98)Σ − Σ(cid:107)2 in the sub-Gaussian case. Lemma H.1 (Lemma 3 in Fan et al. (2019)). Suppose {xi}n i be the sample covariance matrix, {λj}p Σ. Let (cid:98)Σ = 1 n and r = Tr(Σ)/λ1. There exist constants C1 ≥ 1 and C2 ≥ 0 such that when n ≥ r, we have i=1 ⊂ Rp are i.i.d. sub-Gaussian with mean 0 and covariance j=1 be the eigenvalues of Σ sorted in descending order, i=1 xix(cid:62) (cid:80)n P((cid:107) (cid:98)Σ − Σ(cid:107)2 ≥ s) ≤ exp − (cid:32) (cid:33) s (cid:112)r/n C1λ1 , ∀s ≥ 0, and (cid:107)(cid:107) (cid:98)Σ − Σ(cid:107)2(cid:107)ψ1 ≤ C2λ1 (cid:112)r/n. Statistical Analysis of Karcher Means for Random Restricted PSD Matrices The following lemma provides a first-order expansion of (cid:98)V (cid:99)H around V , where (cid:99)H = argminO∈OK×K (cid:107) (cid:98)V O − V (cid:107)F. Lemma H.2 (Lemma 8 in Fan et al. (2019)). Let Σ, (cid:98)Σ ∈ Rp×p be symmetric matrices with eigenvalues {λi}p {(cid:98)λi}p j=1, {(cid:98)vj}p Define E = (cid:98)Σ − Σ, S = {s + 1, . . . , s + K} for some fixed s ∈ {0, 1, . . . , p − K}, Gj = (cid:80) j ∈ [K], and i=1 and j=1 such that Σvj = λjvj and (cid:98)Σ(cid:98)vj = (cid:98)λj (cid:98)vj for j ∈ [p]. for i=1 (in descending order) and eigenvectors {vj}p i /∈S(λi − λj)−1viv(cid:62) i g : Rp×K (cid:55)→ Rp×K, (w1, . . . , wK) (cid:55)→ (−G1w1, . . . , −GKwK). Let V = (vs+1, . . . , vs+K), (cid:98)V = ((cid:98)vs+1, . . . , (cid:98)vs+K), H = (cid:98)V (cid:62)V , and (cid:99)H = sgn(H) := U1U (cid:62) 2 is the unique singular value decomposition of H. If ∆ = min{λs − λs+1, λs+K − λs+K+1} > 0 and (cid:15) = (cid:107)E(cid:107)2/∆ ≤ 1/10, where λ0 = ∞ and λp+1 = −∞, we have 2 , where H = U1ΓU (cid:62) (cid:107) (cid:98)V (cid:99)H − V − g(EV )(cid:107)F ≤ 9(cid:15)(cid:107)g(EV )(cid:107)F. It is worth noting that since (cid:107)g(*)(cid:107)F ≤ ∆−1(cid:107) * (cid:107)F, the Frobenius norm of the remainder term (cid:98)V (cid:99)H − V − g(EV ) is of order 9(cid:15)(cid:107)g(EV )(cid:107)F ≤ 9(cid:15)∆−1(cid:107)EV (cid:107)F ≤ 9 √ K(cid:15)∆−1(cid:107)EV (cid:107)2 ≤ 9 √ K(cid:15)2.
http://arxiv.org/abs/2302.12419v1
2023-02-24T02:50:18
2023-02-24T02:50:18
A Targeted Accuracy Diagnostic for Variational Approximations
Variational Inference (VI) is an attractive alternative to Markov Chain Monte Carlo (MCMC) due to its computational efficiency in the case of large datasets and/or complex models with high-dimensional parameters. However, evaluating the accuracy of variational approximations remains a challenge. Existing methods characterize the quality of the whole variational distribution, which is almost always poor in realistic applications, even if specific posterior functionals such as the component-wise means or variances are accurate. Hence, these diagnostics are of practical value only in limited circumstances. To address this issue, we propose the TArgeted Diagnostic for Distribution Approximation Accuracy (TADDAA), which uses many short parallel MCMC chains to obtain lower bounds on the error of each posterior functional of interest. We also develop a reliability check for TADDAA to determine when the lower bounds should not be trusted. Numerical experiments validate the practical utility and computational efficiency of our approach on a range of synthetic distributions and real-data examples, including sparse logistic regression and Bayesian neural network models.
[ "Yu Wang", "Mikołaj Kasprzak", "Jonathan H. Huggins" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12419v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12419v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Proceedings of the 26th International Conference on Artificial\n Intelligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG", "stat.CO", "stat.ME" ]
A Targeted Accuracy Diagnostic for Variational Approximations 3 2 0 2 b e F 4 2 ] L M . t a t s [ 1 v 9 1 4 2 1 . 2 0 3 2 : v i X r a Yu Wang Boston University Mikołaj Kasprzak MIT and University of Luxembourg Jonathan H. Huggins Boston University Abstract Variational Inference (VI) is an attractive alter- native to Markov Chain Monte Carlo (MCMC) due to its computational efficiency in the case of large datasets and/or complex models with high- dimensional parameters. However, evaluating the accuracy of variational approximations remains a challenge. Existing methods characterize the qual- ity of the whole variational distribution, which is almost always poor in realistic applications, even if specific posterior functionals such as the component-wise means or variances are accurate. Hence, these diagnostics are of practical value only in limited circumstances. To address this is- sue, we propose the TArgeted Diagnostic for Dis- tribution Approximation Accuracy (TADDAA), which uses many short parallel MCMC chains to obtain lower bounds on the error of each posterior functional of interest. We also develop a reliabil- ity check for TADDAA to determine when the lower bounds should not be trusted. Numerical experiments validate the practical utility and com- putational efficiency of our approach on a range of synthetic distributions and real-data examples, including sparse logistic regression and Bayesian neural network models. 1 INTRODUCTION Bayesian inference is widely used due to its flexibility to handle arbitrary models, the desirable decision-theoretic properties of the provided point estimates, and its coherent uncertainty quantification (Robert et al., 2007). However, posterior point estimates and uncertainties usually cannot be calculated analytically, so in practice users of Bayesian methods rely on approximation algorithms. Variational in- ference (VI) has become an increasingly popular alternative Proceedings of the 26th International Conference on Artificial Intel- ligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). to Markov chain Monte Carlo (MCMC) due to its computa- tional efficiency and the availability of black-box versions that can be applied to nearly arbitrary models (Jordan et al., 1999; Wainwright et al., 2008; Hoffman et al., 2013; Kingma and Welling, 2013; Blei et al., 2017; Kucukelbir et al., 2017; Agrawal et al., 2020). The computational efficiency of variational inference arises from optimizing a divergence between the exact posterior and a distribution constrained to a tractable approximating family. The trade-off is that even the optimal distribution within this family may be a poor approximation to the poste- rior, so in general there is no guarantee that variational point estimates and uncertainties will be accurate. Therefore, it is important to develop diagnostic methods that quantify the error introduced by using a variational approximation. How- ever, existing diagnostic methods either lack interpretabil- ity (Gorham and Mackey, 2017, 2015; Wada and Fujisaki, 2015; Chee and Toulis, 2018; Burda et al., 2015; Domke and Sheldon, 2018), or do not provide useful information when the parameter space is high-dimensional (Yao et al., 2018; Xing et al., 2020; Huggins et al., 2020). For example, Yao et al. (2018) propose using Pareto smoothed impor- tance sampling (PSIS) ˆk, which essentially quantifies how effective the approximation is as a proposal distribution for importance sampling – not whether it will provide good approximations to specific quantities of interest. The ker- nel Stein discrepancy (KSD; Gorham and Mackey, 2017, 2015) can be used to evaluate the discrepancy between the approximate and the true distribution but its value is not readily interpretable and depends on a distant dissipativ- ity condition that is not always easy to verify in practice. VI quality can also be accessed by monitoring the running average of changes in the estimated objective, which is usu- ally the evidence lower bound (ELBO) (Wada and Fujisaki, 2015; Chee and Toulis, 2018; Burda et al., 2015; Domke and Sheldon, 2018). However, like the KSD, the ELBO lacks interpretability because it includes an unknown constant offset (the marginal likelihood), which is hard to estimate well unless the approximation is very accurate. Moreover, all these methods attempt to characterize the accuracy of the full variational distribution, which in practice is usually poor even if specific summaries such as posterior means, variances, or credible intervals are accurate. Therefore, in practice, they provide limited useful diagnostic information A Targeted Accuracy Diagnostic for Variational Approximations in the types of complex models where variational methods offer the greatest computational savings. The Metropolis–Hastings Markov transition kernel is there- fore given by In this paper, we propose a diagnostic that is applicable to high-dimensional parameter spaces and can provide lower bounds on the error of specific posterior summaries, includ- ing marginal means and covariances. Our approach is to run many short MCMC chains with stationary distribution equal to the posterior π. These chains are initialized with independent samples from a posterior approximation ˆπ(0), which, after T iterations, results in an improved empiri- cal distribution ˆπ(T ) that is closer to π. If ˆπ(0) is a poor approximation to π, then the improved distribution ˆπ(T ) obtained using MCMC can be significantly different from ˆπ(0); otherwise, the distribution will not shift. Thus, we can obtain lower bounds on the error of a posterior summary by computing confidence intervals for how much that sum- mary differs under ˆπ(0) and ˆπ(T ). Our approach might fail to provide meaningful results, however, if the Markov ker- nel used mixes poorly. To ameliorate this issue, we jointly adapt the Markov chains at each iteration. We show that if the number of chains is large, they remain essentially independent despite the joint adaptation procedure; hence, our confidence intervals remain valid. We also propose a simple correlation-based check that can detect poorly mix- ing chains, and hence warn the user against trusting the diagnostic. Numerical experiments validate the practical utility and computational efficiency of our approach on a range of synthetic distributions and real-data examples.1 2 PRELIMINARIES Modern Bayesian statistics relies heavily on models with difficult-to-compute posterior distributions, and hence re- quires general-purpose algorithms to approximate expec- tations with respect to those distributions. Throughout we abuse notation and use π to denote the posterior distribution and the corresponding density. Markov Chain Monte Carlo. Markov chain Monte Carlo (MCMC) sampling methods provide a general- purpose framework for obtaining samples that are asymptot- ically exact (in runtime). To construct a Markov kernel with the desired stationary distribution, a standard approach is to correct an arbitrary proposal kernel using the Metropolis– Hastings (MH) accept-reject procedure (Metropolis et al., 1953). For x ∈ Rd, let Qψ(x, dy) denote the proposal kernel parameterized by ψ with current state x and corre- sponding density qψ(x, y). A proposed state Y ∼ Qψ(x, *) is accepted with probability α(x, Y ) = min 1, (cid:26) π(Y )qψ(Y, x) π(x)qψ(x, Y ) (cid:27) . 1A Python implementation of TADDAA and code to repro- duce all of our experiments is available at https://github.com/ TARPS-group/TADDAA. Pψ(x, dy) := α(x, y)Qψ(x, dy) + rψ(x)δx(dy), where rψ(x) := 1 − (cid:82) α(x, y)Qψ(x, dy) is the rejection probability and δx is a Dirac measure at x. Variational Inference. Variational inference (VI) pro- vides a potentially faster alternative to MCMC when models are complex and/or the dataset size is large (Blei et al., 2017). Variational inference aims to minimize some measure of discrepancy Dπ(*) over a tractable family Q of potential approximating distributions (Wainwright et al., 2008), re- sulting in a posterior approximation given by ˆπ = arg min ξ∈Q Dπ(ξ). We will focus on the Kullback–Leibler (KL) divergence Dπ(ξ) = KL(ξ | π) := (cid:90) log (cid:19) (cid:18) dξ dπ dξ as the discrepancy since it is the most widely used: the un- known marginal likelihood does not affect the optimization, computing gradients requires estimating expectations only with respect to distribution within a tractable family Q, and optimization is relatively stable (Blei et al., 2017). Alternative Non-exact Approximation Methods. While our experiments focus on variational inference, numerous other non-exact posterior approximation methods are widely used in practice such as expectation-propagation (Minka, 2001; Bishop, 2006), the Laplace approximation (Gelman et al., 1995; Bishop, 2006), and the iterated nested Laplace approximation (Rue et al., 2009; Gomez-Rubio, 2020). Our diagnostic applies equally well to all of these methods. 3 AN MCMC-BASED ACCURACY DIAGNOSTIC Suppose we have an approximation ˆπ(0) to the posterior density π. Given a sample X (0) ∼ ˆπ(0), we could improve it by applying a Markov kernel Pψ(x, dy) with invariant distribution π, resulting in a sample X (1) ∼ Pψ(X (0), *) with a distribution ˆπ(1) that is typically closer to π than ˆπ(0) if ˆπ(0) (cid:54)= π. Continuing to run the Markov chain for T total steps results in a sample X (T ) with distribution ˆπ(T ) that, when ˆπ(0) is a poor approximation to π, can be substantially closer to π; see Fig. 1 for an illustration. More specifically, consider some posterior functional of interest such as a mean or variance, which we generically denote by F. For example, F(π) = (cid:82) xiπ(dx) would be the mean of the ith component. If the initial approximation error ε(0)(F) := F(ˆπ(0)) − F(π) is large, then a well-chosen Markov kernel Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins Algorithm 1 TADDAA Input: log density of the target π, approximating distribution ˆπ(0), functional of interest F, proposal kernel Qψ(x, dy) [Section 3.1], initial proposal parameter ψ(0) [Section 3.1], number of Markov chains N [Eq. (6)], number of iterations T [Eq. (7) or (8)] j ∼ ˆπ(0) for j = 1, . . . , N 1: X (0) 2: for t = 0 to T − 1 do for j = 1 to N do 3: 4: 5: 6: Y (t+1) j j = α(X (t) α(t) , *) ∼ Qψ(t) (X (t) j , Y (t) ) j , with probability α(t) j , with probability 1 − α(t) j j (cid:40) Y (t) j X (t) j = X (t+1) j , Y (1:t+1) 1:N ) [Eq. (5)] end for ψ(t+1) = H(ψ(1:t), X (1:t+1) 7: 8: 9: end for 10: Use ˆπ(0) (or X (1) 1:N 1:N ) and X (T ) 1:N to compute a (1 − α)- confidence interval ((cid:96)F , uF ) for F(ˆπ(0)) − F(ˆπ(T )) 11: Compute correlation check ρ2 of the diagnostic [Section 3.4] max(T ) to verify reliability 12: return BF as defined in Eq. (1) and ρ2 max(T ) the sign of ε(t)(F) does not depend on t. Under Condition 1, with probability 1 − α, ε(0)(F) ≥ |F(ˆπ(0)) − F(ˆπ(T ))| (cid:40) ≥ if (cid:96)F ≤ 0 ≤ uF 0 min(|(cid:96)F |, |uF |) otherwise = 1 {0 /∈ ((cid:96)F , uF )} × min(|(cid:96)F |, |uF |) =: BF . (1) Algorithm 1 summarizes the key steps of our proposed TAr- geted Diagnostic for Distribution Approximation Accuracy (TADDAA) for computing the error lower bound BF . Ref- erences to specific implementation recommendations (all described and justified in detail below) are in magenta. Remark 3.1. While in general we expect Condition 1 to hold, it is possible that it could be violated for target distribu- tions with complex geometries. Although we only consider reversible Markov kernels, it is plausible that non-reversible Markov kernels could also lead to violations. (cid:47) We will construct confidence intervals under the following condition. Condition 2. The elements of X (T ) 1:N are identically dis- tributed, have finite second moments, and are pairwise inde- pendent. We will focus on diagnosing the accuracy of means, vari- ances, and quantiles. But TADDAA can be straight- Figure 1: A cartoon plot for MCMC-based accuracy diag- nostic. Even if the Markov chains do not reach the stationary distribution, they can provide a lower bound on error in the posterior approximation. will result in the improved approximation error ε(T )(F) := F(ˆπ(T )) − F(π) being substantially smaller. In this case, |F(ˆπ(0)) − F(ˆπ(T ))| measures the decrease in the initial approximation error, and hence provides a lower bound on |ε(0)(F)|. If, on the other hand, the initial approximation error is small, then |F(ˆπ(0)) − F(ˆπ(T ))| should remain small as well. While in principle the just-described approach is appeal- ing, there are two immediate problems. First, we do not have direct access to ˆπ(T ). Second, Pψ(x, dy) may not be particularly efficient unless the proposal parameter ψ is well-chosen – which is nearly impossible to do a pri- ori. To address both of these problems, we propose to run N Markov chains in parallel and, following standard MCMC practice, adapt the proposal parameter at each iteration (Andrieu and Thoms, 2008). Denote the state of the jth chain after iteration t by X (t) and the pro- posal parameter used at iteration t by ψ(t−1). We write j=1 and similarly for X (1:t) X (t) 1:N , and other quantities. In the case of a Metropolis–Hastings ker- nel, at iteration t, for each j ∈ {1, . . . , N }, we generate proposals Y (t+1) , *), then accept or reject the j proposal to obtain X (t+1) . Next, we can use inter-chain adaptation (INCA; Craiu et al., 2009), which uses all the samples available up to the current time to update the pro- posal parameter to ψ(t+1) = H(ψ(1:t), X (1:t+1) ). We call H the adaptation function. 1:N = (X (t) ∼ Qψ(t) (X (t) , Y (1:t+1) 1:N , X (1:t) j )N 1:N j j j j Finally, we can use the N samples from iteration T to construct a (1 − α)-confidence interval ((cid:96)F , uF ) for F(ˆπ(0)) − F(ˆπ(T )), and hence a high-confidence lower bound on |F(ˆπ(0))−F(π)|, if the following condition holds: Condition 1. The map t (cid:55)→ |ε(t)(F)| is non-increasing and Samples from (0)Samples from (T)Target distribution Approximating distribution (0)Improved distribution (T) A Targeted Accuracy Diagnostic for Variational Approximations forwardly applied to other functionals of interest. For t ∈ {0, . . . , T }, define the mean vector μ(t) = (μ(t) 1 , . . . , μ(t) X∼ˆπ(t)(X), and marginal standard deviations σ(t) := stdevX∼ˆπ(t) (Xi) for i = 1, . . . , d. d )(cid:62) := E i Marginal mean. For the mean functional F i mean(π) := μi(π) := (cid:82) xi π(dx), under Condition 2, a (1 − α) confi- dence interval for μ(T ) is given by (Mendenhall et al., 2012) i − μ(0) i i − μ(0) x(T ) i ± s(T ) i√ N tN −1(1 − α/2), (2) j=1 x(T ) where x(T ) (cid:8) (cid:80)N (cid:80)N j,i − x(T ) is the sample mean, s(T ) i = 1 N j=1(x(T ) i = )2(cid:9)1/2 1 is the sample standard de- N −1 viation, and tN −1(q) is the q quantile of a t distribution with N − 1 degrees of freedom. j,i i variance. For var(π) := σ2 i Marginal F i (1 − α) confidence interval for 2 log(σ(T ) by (Mendenhall et al., 2012) functional := VarX∼π(Xi), under Condition 2, a ) is given variance /σ(0) i the i (cid:20) (cid:18) log (σ(0) i (N −1)s(T ) )2χ2 i N −1(1−α/2) (cid:19) (cid:18) , log (N −1)s(T ) )2χ2 i N −1(α/2) (σ(0) i (cid:19)(cid:21) , (3) where χ2 N − 1 degrees of freedom. N −1(q) is the q quantile of a χ2 distribution with Marginal quantile. For the p-quantile functional F i p(π) = Qi p(π) := inf{q ∈ R : PX∼π(Xi ≤ q) ≥ p}, (4) under Condition 2, a (1 − α) confidence interval for p(ˆπ(0)) is given by (Hahn and Meeker, 2011) Qi p(ˆπ(T )) − Qi (cid:104) X (T ) (l),i − Qi p(ˆπ(0)), X (T ) (u),i − Qi (cid:105) p(ˆπ(0)) , (2),i ≤ * * * ≤ X (T ) where X (T ) (1),i ≤ X (T ) (N ),i are the order statistics of the samples X (T ) 1:N , l = B(α/2, N, p), u = B(1 − α/2, N, p) + 1, and B(q, N, p) is the q quantile of a binomial distribution with parameters N and p. While we have now described the key components of TAD- DAA, a practical and reliable implementation requires ad- dressing a number of issues: 1. Proposal kernel and adaptation scheme. The choice of MCMC proposal kernel and adaptation function H can have a dramatic effect on sampling efficiency and thus the accuracy of TADDAA. We propose to use gradient-based proposals that scale well to high- dimensional problems and focus on adapting the step size parameter of these algorithms. (Section 3.1) 2. Inter-chain dependence. INCA introduces depen- dence between the Markov chains, which could in- validate the confidence intervals. However, we show that the samples from the Markov chains at any fixed it- eration satisfy a propagation-of-chaos property, which implies that the chains are asymptotically independent (in the limit N → ∞), so an asymptotic version of Condition 2 still holds. (Section 3.2) 3. Choice of T and N . The length of each Markov chain T and the number of Markov chains N must be cho- sen such that the diagnostic is computationally effi- cient while still (i) having T large enough that the improved approximation ˆπ(T ) becomes sufficiently dif- ferent from the initial approximation ˆπ(0) and (ii) hav- ing N large enough that the confidence intervals are sufficiently small to provide meaningful diagnostic in- formation. (Section 3.3) 4. Checking the reliability of the diagnostic. Since it is possible the proposal kernel will be inefficient despite adaptation, we propose a correlation-based reliability check for our diagnostic. (Section 3.4) 3.1 Markov Kernels and Adaptation random We consider four possible Markov kernels: walk Metropolis–Hastings (RWMH), Metropolis-adjusted Langevin algorithm (MALA), the Barker algorithm (Barker), and Hamiltonian Monte Carlo (HMC), which we describe in detail in Appendix A. All four kernels rely on a step-size parameter h. The latter three algorithms exploit gradient information about log π, and thus have superior efficiency when d is large. High-dimensional sampling efficiency can be formalized using the theory of optimal scaling (Roberts and Rosenthal, 2001). To guarantee sam- pling efficiency and obtain well-behaved limiting behavior, optimal scaling results show that step size h needs to scale as Θ(d−γ), which results in a mixing time (i.e., number of iterations to obtain an effectively independent sample) of Θ(dγ). Hence, the smaller γ is the more efficient the kernel. The values of γ for the kernels we consider are 1 for RWMH (Gelman et al., 1997), 1/3 for MALA (Roberts and Rosenthal, 1998), 1/3 for Barker (Livingstone and Zanella, 2022), and 1/4 for HMC (Beskos et al., 2013). Optimal scal- ing theory also provides the optimal asymptotic acceptance rates ( ̄α∗) for each kernel, which are 0.234 for RWMH, 0.4 for Barker, 0.574 for MALA, and 0.651 for HMC. While HMC has the best scaling with γ = 1/4, the efficiency of Barker is more robust to the precise step size (and hence precise acceptance rate) (Livingstone and Zanella, 2022), which makes it attractive for our use-case where it may not be possible to obtain the optimal step size since adaptation occurs over a relatively small number of iterations T . We adapt the step size so that the acceptance rate approaches the optimal asymptotic acceptance rate ̄α∗ (Andrieu and Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins Thoms, 2008). Let ̄α(t) := N −1 (cid:80)N denote the average acceptance probability at iteration t. Letting ψ(t) = log h(t) be the log of the step size, the adaptation function is given by j=1 α(t) j H(ψ(1:t), X (1:t+1) 1:N , Y (1:t+1) 1:N ) (5) = ψ(t) + √ 1 t + 1 ( ̄α(t) − ̄α∗). Compared with running many parallel chains independent of each other, using a joint adaptation scheme improves adap- tion speed and ensures the samples at each iteration follow the same distribution (Rosenthal, 2000; Solonen et al., 2012). The sequence of proposal parameters (ψ(t))∞ t=0 converge under the standard Robbins–Monro conditions (see Andrieu and Thoms (2008, Section 4) for a related discussion). In order to prove convergence to the stationary distribution of the resulting Markov chain, one needs to verify an addi- tional assumption, such as uniform ergodicity Roberts and Rosenthal (2007, Theorem 1) or one of the weaker sufficient conditions proposed, for instance in Atchad ́e and Rosenthal (2005, Assumption 3.1) or Green et al. (2015, Section 2.4). Following Roberts and Rosenthal (1998), we initialize the step sizes to h(0) = 2.42/d for RWMH, and h(0) = 2.42/d1/3 for MALA and Barker, and h(0) = 2.42/d1/4 for HMC. All of the Markov kernels we consider can make use of a pre-conditioning matrix, which is beneficial when components have different scales (Roy and Zhang, 2022; Stramer and Roberts, 2007). While it is possible to adapt the pre-conditioning matrix in addition to the step size in practice we found it sufficed to keep the pre-conditioning matrix fixed and equal to the covariance of ˆπ(0). If the co- variance is not available in closed form we use the sample covariance of the samples X (0) 1:N . 3.2 Asymptotic Independence of Adapted Markov Chains Due to the use of adaptation, the Markov chains X (t) 1:N are not independent once t > 1, so the final samples X (T ) 1:N vio- late the independence requirement of Condition 2. However, we can instead ensure that the Markov chains are asymptoti- cally independent in the following sense: Definition 3.2. Let XN,1:N = (XN,1, . . . , XN,N ) de- note a random vector. The sequence of random vectors N =1 is ̄ν-chaotic if, for any r ∈ N and any {XN,1:N }∞ bounded continuous real-valued functions g1, g2, . . . , gr, lim N→∞ EXN,1:N (cid:41) gi (XN,i) = (cid:40) r (cid:89) i=1 r (cid:89) (cid:90) i=1 gi(x) ̄ν(dx). Theorem 3.3. Under Assumption 3.4 (given below), for any t ∈ N, there exists a probability distribution ̄ν(t) such that the sequence {X (t) N =1 is ̄ν(t)-chaotic. 1:N }∞ The proof can be found in Appendix B. Crucially, the asymp- totics we require for Theorem 3.3 are in the number of Markov chains N , not the number of iterations T . Thus, for any fixed T , Condition 2 holds asymptotically in N . To write our assumptions, note that if we treat the proposed states Y (t) 1:N as additional random variables, we can write the MCMC update as (X (t+1) j , Y (t+1) j ) ∼ T (X (t) j , Y (t) j , h(t) N , *, *) for an appropriate Markov kernel T (x, y, h, dx(cid:48), dy(cid:48)), where h is the step size. Assumption 3.4. (a) The proposal probability density qh(y, x) is continuous with respect to (x, y, h). (b) The target distribution has a continuous probability density function π(*). (c) Samples generated from the Markov transition ker- j (cid:107)2 < ∞ and nel T (x, y, h, *, *) satisfy E(cid:107)X (t) E(cid:107)Y (t) j (cid:107)2 < ∞ for any t ∈ N. These conditions are all quite mild. All of the proposals used in our experiments satisfy Assumption 3.4.(a). As- sumption 3.4.(b) is required to use all three gradient-based proposals (MALA, Barker, and HMC). Assumption 3.4.(c) just requires that for any fixed time t ∈ N, the generated samples have finite second moment. Remark 3.5. Theorem 3.3 could be generalized to targets with discrete components if the proposal distribution is ab- solutely continuous with respect to an appropriate reference measure and the topology of the space on which the target is defined respects the discrete and continuous components of the target. (For example, if the target distribution is defined on R and has an atom at zero, then {0} should be an open set.) In that case, Definition 3.2 would need to be adapted in order to account for the change in the underlying topology, and so will the details of the proof of Theorem 3.3. (cid:47) 3.3 Length and Number of Markov Chains Having established the validity of Algorithm 1, we now turn to the question of how to ensure the computational cost is not prohibitive and the diagnostic is accurate. Given a target distribution and Markov kernel, the computational cost is determined by the number of Markov chains N and iterations T . We address each in turn. In particular, we show that the Markov chains are chaotic after any fixed number of iterations. Number of Markov Chains. The number of Markov chains must be sufficiently large that the confidence in- tervals are small enough to detect meaningful errors. Our A Targeted Accuracy Diagnostic for Variational Approximations is given by tN −1(α/2) s(T ) i / approach is to choose N to be the smallest value that sat- isfies the user's tolerance level for the margin of error. In the case of mean estimation, it follows from Eq. (2) that the error for estimating μ(T ) N . Similarly, the log variance error can also be determined by Eq. (3). For the mean we use the relative error normalized by the standard deviation, as this accounts for the relevant scale of the error. Hence, if the user's tolerance is δmean for relative mean error and δvar for log variance error2, then the required sample size (number of Markov chains) is √ i N = max (Nmean, Nvariance) , (6) Remark 3.6. TADDAA is essentially running MCMC only for a burn-in period. Crucially, the diagnostic remains valid and useful even if the chains remain far from stationarity as long as ˆπ(T ) is closer to stationarity (i.e., it improves the approximating distribution ˆπ(0) somewhat). In challenging scenarios where moving closer to stationarity is hard even with best practices (e.g., INCA and preconditioning), the TADDAA error lower bounds can be close to zero, leading to uninformative diagnostic results. See Section 4.3 for a concrete example. We note also that there is a large litera- ture studying the convergence rates of MCMC algorithms (Brooks et al., 2011; Roberts and Rosenthal, 2004). (cid:47) where Nmean := min (cid:110) n ∈ N : tn−1(α/2) √ (cid:111) , 3.4 A Reliability Check for the Diagnostic Nvariance := min (cid:110) n ∈ N : log (cid:17) (cid:111) . ≤ δvar The reliability of TADDAA depends on the mixing behavior of the Markov chains: ≤ δmean n (cid:16) χ2 n−1(1−α/2) χ2 n−1(α/2) Number of Iterations. The number of iterations has to be large enough that the improved distribution ˆπ(T ) is suf- ficiently different from a poor approximating distribution ˆπ(0). As discussed earlier, the theory of optimal scaling shows that the Markov chain requires Θ(dγ) iterations to mix. Thus, we propose to scale T with respect to dimension d in the same manner. For RWMH3, MALA, and Barker, we take T = (cid:4)cd1/3(cid:5), while for HMC we take T = (cid:4)cd1/4/L(cid:5), (7) (8) where L is the number of leapfrog steps in HMC. Scaling by L is necessary for HMC to ensure T accounts for the L gradient evaluations required per iteration. All other meth- ods require 0 or 1 gradient evaluation per iteration. Based on numerical results we suggest c = 50. In Appendix C.1, we also run ablation studies on how the diagnostic result (several types of lower bound) would change with T , which shows that Eq. (7) and Eq. (8) are reasonable. The results of Bhatia et al. (2022) suggest our choice of T will ensure the cost of TADDAA will not be too large com- pared to the cost of using black-box variational inference algorithms. Specifically, Bhatia et al. (2022, Theorem 1) shows that the number of gradient evaluations of stochas- tic optimization needed to obtain a constant optimization error scales as d1/3. Hence, the computational cost (as mea- sured by number of gradient evaluations) is Θ(d1/3) for VI, Θ(d1/3) for MALA and Barker, and Θ(d1/4) for HMC. We verify the cost of TADDAA is not prohibitive in practice in our numerical experiments. 2The width of the quantile confidence interval is sample depen- dent, so we do not set a tolerance level for the quantile error. 3Based on optimal scaling behavior of RWMH, Eq. (7) may not be large enough to guarantee significant change in the distribution. So, we do not recommend RWMH. • If the Markov chains are mixing well, we expect the diagnostic results can be trusted. • If the Markov chains are not mixing well, diagnosis of a poor approximation can still be trusted but diagnosis of a good approximation may not be reliable. In the latter case, we should consider increasing the length of Markov chains or otherwise improving the Markov kernel. The usual approach to checking MCMC mixing is some version of the (cid:98)R diagnostic (Gelman and Rubin, 1992; Vats and Knudson, 2021; Vehtari et al., 2021). However, using (cid:98)R requires a sufficiently large effective sample size for each Markov chain, which is not satisfied for the short Markov chains used in TADDAA. Instead, we propose to leverage the fact that we have many nearly independent chains to compute the correlation between the initial and final values of each chain. If the chains are mixing, then this correlation will be close to zero. Specifically we propose to use the worst-case correlation coefficient ρ2 i (T ), where max(T ) := maxi ρ2 ρ2 i (T ) := (cid:80)N j=1(X (0) j,i −ˆμ(0) j,i −ˆμ(0) i (cid:113) )2 i )(X (T ) ((cid:80)N j,i −ˆμ(T ) j=1 X (T ) ) j,i −ˆμ(T ) i i . )2 j=1(X (0) (cid:113)(cid:80)N If ρ2 max(T ) is close to 0 (we use a cutoff of 0.1), then the check passes; otherwise, the check fails. In addition to examining the value of ρ2 max(T ), we can also examine plots of t versus ρ2 i (t) to gain insight into, how quickly mixing is occurring, respectively, overall and for specific coordinates. max(t) and t versus ρ2 4 EXPERIMENTS We now validate the efficacy and computational efficiency of TADDAA and the correlation-based reliability check. In our experiments, the number of Markov chains is N = 386, Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins Figure 2: Diagnostics for mean-field VI approximation to correlated Gaussian targets, where TADDAA uses the Barker proposal. Here μi and σ2 i denote, respectively, the mean and variance of Xi. Figure 4: Diagnostics for Neal-funnel shape model, where TADDAA uses the Barker proposal. Here μi and σ2 i denote, respectively, the mean and variance of Xi. Fig. 2 shows that the lower bounds Bmean and Bvariance re- main valid and useful even when d and ˆk are large: TAD- DAA correctly captures that the mean estimates are accurate but the variance estimates are inaccurate. From Fig. 3, we can see that the Barker chains mix well in all cases. Figure 2 also provides a comparison to ˆk and the Wasserstein-based upper bounds proposed in Huggins et al. (2020, Theorem 3.4). The ˆk result suggests that the VI approximation is not reliable for almost any dimension (since ˆk > 0.7). But if the functional of interest is the mean, VI should be considered reliable. Similarly, the Wasserstein upper bounds are too conservative by a factor of 10–1,000, incorrectly suggesting the VI approximation is extremely inaccurate. Moreover, the upper bounds are unavailable once ˆk > 0.7 (Huggins et al., 2020). Overall, TADDAA provides much more pre- cise and actionable information about the approximation quality than the other diagnostics. 4.2 Neal-Funnel Shape Model Next, we consider a more challenging target with a more complex geometry: Neal's funnel distribution (Neal, 2003), which is similar to the geometries encountered in hierar- chical models. For x = (x1, . . . , xd) ∈ Rd, let σ := exp(x1). The funnel distribution is given by π(x) = N (x1 | 0, 1) (cid:81)d−1 | 0, σ). Hence, if X ∼ π, then Var(Xi) = exp(1/2) for i ∈ {2, . . . , d}. Since X2, . . . , Xd are identically distributed, we focus on the accu- racy of the mean-field VI approximations to the distributions of X1 and X2. i=2 N (xi Figure 4 shows that the lower bounds constructed using Barker are quite precise and do not degrade as the dimension (See Appendix C.2 for results for quantiles.) increases. Moreover the reliability check passes for all d (Fig. 13 in Appendix C.2). The ˆk diagnostic, however, is noisy and provides little insight. The Wasserstein-based mean and covariance upper bounds are orders-of-magnitude too large and unavailable for most d > 10 because ˆk > 0.7. Figure 3: Reliability checks for TADDAA using Barker applied to the mean-field VI approximation to correlated Gaussian targets. which corresponds to the tolerance level δmean = 0.1 and δvar = 0.15. While we often present results for all four kernels discussed in Section 3.1 (RWMH, MALA, Barker, and HMC), we generally recommend using Barker because it has the efficiency of gradient-based kernels but is less sensitive to parameter tuning than MALA and HMC. For variational inference, we use the default settings of the bbvi function in the VIABEL package (Welandawe et al., 2022), which used a mean-field Gaussian approximation family. We set the maximum number of iterations to 200,000 but the optimization can terminate early if convergence is reached. We compare TADDAA to the ˆk diagnostic proposed in Yao et al. (2018) and the Wasserstein-based mean and variance upper bounds proposed in Huggins et al. (2020). 4.1 Gaussian Model With Correlated Coordinates We first investigate the performance of TADDAA in a high- dimensional setting where the variational mean-field approx- imation has correct mean but incorrect variance estimates, which is a common situation in practice. Specifically, we use a correlated Gaussian target π = N (μ, Σ), where μ ∈ Rd, Σii = σ2 i , and Σij = ρσiσj for i (cid:54)= j. We introduce cor- relation by setting ρ = 0.7 and variance heterogeneity by setting σ2 i = 1 for i = 2, 3, ..., d. 1 = 10 and σ2 51015202530Dimension0100101102103BoundDiagnostics on X1BmeanBvariance|(0)11|2|log(0)1log1|W2 mean upper boundW2 Cov upper bound51015202530Dimension0100101102103BoundDiagnostics on X2BmeanBvariance|(0)22|2|log(0)2log2|W2 mean upper boundW2 Cov upper bound51015202530Dimension0.00.20.40.60.81.02max51015202530Dimension0.60.81.0k020406080Iteration0.00.51.02maxd = 2d = 10d = 20d = 3051015202530Dimension0100101102103BoundDiagnostics on X1BmeanBvariance|(0)11|2|log(0)1log1|W2 mean upper boundW2 Cov upper bound51015202530Dimension0100101102103BoundDiagnostics on X2BmeanBvariance|(0)22|2|log(0)2log2|W2 mean upper boundW2 Cov upper bound51015202530Dimension0.00.20.40.60.81.02max51015202530Dimension0.60.81.0k A Targeted Accuracy Diagnostic for Variational Approximations Figure 6: Reliability checks on TADDAA using different kernels applied to the mean-field VI approximation to logis- tic regression for candy classification. iterations), while the chains for other kernels mix well. 4.4 Cancer Classification Using a Horseshoe Prior We now consider a more challenging, higher-dimensional application to predicting leukemia using microarray data with n = 71 observations and using 100 features chosen according to their χ2 scores (Ray et al., 2020). We use a logistic regression model with a sparsity-inducing horseshoe prior (Piironen and Vehtari, 2017): y | β ∼ Bern(logit−1(Xβ)), βj | τ, λ, c ∼ N (0, τ 2 ̃λ2 λj ∼ C+(0, 1), c2 ∼ InvGam(2, 8), j ), τ ∼ C+ (0, τ0) , j = c2λ2 j /(c2 + τ 2λ2 where y denotes the binary outcomes, X ∈ R71×100 is the features matrix, τ > 0 and λ > 0 are global and local shrinkage parameters, and ̃λ2 j ). Hence, for our data the parameter dimensionality is d = 203. We would expect the VI approximation to be poor due to mul- timodality of the model. Focusing on two representative parameters, Fig. 7 shows that TADDAA using Barker cor- rectly captures that the mean estimate for λ61 and variance estimate for β0 are inaccurate. On the other hand, for the accurate mean estimate for β0 and variance estimate for λ61, the lower bounds are zero or close to zero. TADDAA uses about 28% as many gradient evaluations as the VI optimiza- tion (1.1 × 105 versus 4 × 105). In addition, the reliability checks shown in Fig. 8 correctly reflect the worse perfor- mance of RWMH (due to d being larger) and HMC (due to a smaller number of iterations). 4.5 Bayesian Neural Network on Candy Power Ranking Dataset Finally, we validate TADDAA on a Bayesian neural network model, which is difficult for mean-field VI to approximate accurately (Izmailov et al., 2021). We use the same dataset described in Section 4.3, but now it is fitted with a two-layer Figure 5: Diagnostics for logistic regression model on candy power ranking dataset for component β5 and β11. Here μi and σi denote, respectively, the mean and variance of βi. To improve interpretability, we show the relative mean error (μ(t) i ) − 2 log10(σi). (Recall that μi and σi are the ith component mean and standard deviation of the target π.) The lengths of the gold lines give the corresponding relative mean and log variance error lower bounds. i − μi)/σi and log variance error 2 log10(σ(t) 4.3 Logistic Regression Model on Candy Power Ranking Dataset Next, we validate TADDAA on a real-world dataset4: each observation (zn, yn) represents a different kind of candy, where zn ∈ R11 are the features, and yn = 1 if the candy is chocolate and 0 otherwise. We use a logistic regression model with yn ∼ Bern(logit−1(β(cid:62)zn)) and βi ∼ N (0, I). Focusing on Barker, Fig. 5 shows that for β5, the lower bound of the mean error is small but non-zero due to the fact that the variance is dramatically underestimated, leading to inefficient preconditioning (adaptive preconditioning did not significantly improve the lower bound). On the other hand, the variance error lower bound, while not tight, shows that the variance estimate is orders-of-magnitude too small. For β11, where the variance is not so poorly estimated, both mean and variance lower bounds are very accurate. TAD- DAA uses about 2% as many gradient evaluations as the VI optimization (4.3 × 104 versus 2 × 106), validating the com- putational efficiency of our approach. Figure 6 demonstrates the usefulness of the reliability checks, which correctly show that HMC chains fail to mix (due to a smaller number of 4https://www.kaggle.com/datasets/fivethirtyeight/ the-ultimate-halloween-candy-power-ranking RWMHMALABarkerHMC2.001.751.501.251.000.750.500.250.00Relative Mean ErrorDiagnostics on 55(0)5(T)5RWMHMALABarkerHMC1012345Relative Mean ErrorDiagnostics on 1111(0)11(T)11RWMHMALABarkerHMC1086420Log Variance ErrorDiagnostics on 55(0)5(T)5RWMHMALABarkerHMC1086420Log Variance ErrorDiagnostics on 1111(0)11(T)110100200300400Iteration0.00.51.02maxRWMHMALABarkerHMC Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins Figure 9: Diagnostics of for Bayesian neural network model on candy power ranking dataset for component. μ and Q(0.5) denote the mean and median for the cross-entropy loss. 5 CONCLUSION AND LIMITATIONS Overall, our theory and experimental results show that TAD- DAA provides an efficient evaluation tool for variational inference, while also being applicable to other inexact poste- rior approximation methods like (integrated nested) Laplace approximations. TADDAA provides precise information about specific functionals of interest such as means and standard deviations, rather than a check on just the overall quality of an approximation – which in practice is often quite poor. However, there are a number of important limitations that users must keep in mind when employing TADDAA. While we have developed the correlation check to guard against a poor diagnostic, the check can fail due to, e.g., multimodality. On the other hand, such failures are not unique to our diagnostic and can affect, e.g., diagnostics for MCMC too. One approach to guard against this possibility is to run the VI optimization multiple times with diverse ini- tializations, as is usually recommended for MCMC. Another limitation is that TADDAA is not appropriate in settings where it is only feasible to make a small number of passes over the entire dataset, so a method like stochastic varia- tional inference (Hoffman et al., 2013) is used. Finally, it is possible that Condition 1 could be violated. Developing checks against this failure mode is an important direction for future work. Acknowledgments M. Kasprzak was support by the European Union's Hori- zon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 101024264. J. H. Huggins was partially supported by the National Insti- tute of General Medical Sciences of the National Institutes of Health under grant number R01GM144963 as part of the Joint NSF/NIGMS Mathematical Biology Program. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health. Figure 7: Diagnostics for β0 and λ61 for cancer classifi- cation using the horseshoe prior. See Fig. 5 for further explanations. Figure 8: Reliability checks for TADDAA using different kernels applied to horseshoes prior applied to mean-field approximation for cancer classification. Bayesian neural network with 5 units in each hidden layer: yn ∼ Bern (cid:0)logit−1 (cid:0)tanh (cid:0)tanh(α(cid:62)zn) * β(cid:1) * γ(cid:1)(cid:1) , (cid:80)N where α ∈ R5×11, β ∈ R5×5, γ ∈ R5, αi,j ∼ N (0, 2), βi,j ∼ N (0, 2) and γi ∼ N (0, 2). Hence, x = (α, β, γ) and d = 85. To quantify the classification quality for the Bayesian neural network, we can use the log loss (a.k.a., the cross-entropy loss) L(x) = − 1 n=1 log p(yn | x). N Similar to the definitions for the marginal mean and median, we can also use the mean and median of the log loss as the evaluation functional F. Figure 9 shows that TADDAA cor- rectly captures that the inaccuracy of the VI approximation: error lower bounds show that both the mean and median of the log loss are overestimated by mean-field VI. TAD- DAA uses about 12% as many gradient evaluations as the VI optimization (8.4 × 104 versus 6.8 × 105). The reliabil- ity check in Fig. 15 confirms the superiority of Barker in high-dimensional problems. RWMHMALABarkerHMC1.000.750.500.250.000.250.500.751.00Relative Mean ErrorDiagnostics on 0(0)(T)RWMHMALABarkerHMC1.000.750.500.250.000.250.500.751.00Relative Mean ErrorDiagnostics on 61(0)(T)RWMHMALABarkerHMC2.01.51.00.50.00.51.0Log Variance ErrorDiagnostics on 0(0)(T)RWMHMALABarkerHMC2.01.51.00.50.00.51.0Log Variance ErrorDiagnostics on 61(0)(T)050100150200250300Iteration0.00.51.02maxRWMHMALABarkerHMCRWMHMALABarkerHMC10.07.55.02.50.02.55.07.510.0Relative Mean ErrorMean diagnostic on cross-entropy loss(0)(T)RWMHMALABarkerHMC1.000.750.500.250.000.250.500.751.00Relative Median ErrorMedian diagnostic on cross-entropy lossQ(0.5)Q(0)(0.5)Q(T)(0.5) A Targeted Accuracy Diagnostic for Variational Approximations References Gomez-Rubio, V. (2020). Bayesian inference with INLA. Agrawal, A., Sheldon, D. R., and Domke, J. (2020). Ad- vances in black-box VI: Normalizing flows, importance weighting, and optimization. Advances in Neural Infor- mation Processing Systems, 33:17358–17369. Andrieu, C. and Thoms, J. (2008). A tutorial on adaptive MCMC. Statistics and Computing, 18(4):343–373. Atchad ́e, Y. F. and Rosenthal, J. S. (2005). On adap- tive Markov chain Monte Carlo algorithms. Bernoulli, 11(5):815 – 828. Beskos, A., Pillai, N., Roberts, G., Sanz-Serna, J.-M., and Stuart, A. (2013). Optimal tuning of the hybrid Monte Carlo algorithm. Bernoulli, 19(5A):1501–1534. Bhatia, K., Kuang, N. L., Ma, Y.-A., and Wang, Y. (2022). Statistical and Computational Trade-offs in Variational Inference: A Case Study in Inferential Model Selection. arXiv preprint arXiv:2207.11208. Billingsley, P. (2013). Convergence of probability measures. John Wiley & Sons. Bishop, C. M. (2006). Pattern recognition and machine learning, volume 4. Springer. Blei, D. M., Kucukelbir, A., and McAuliffe, J. D. (2017). Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859– 877. Brooks, S., Gelman, A., Jones, G., and Meng, X.-L. (2011). Handbook of Markov chain Monte Carlo. CRC press. Burda, Y., Grosse, R., and Salakhutdinov, R. (2015). arXiv preprint Importance weighted autoencoders. arXiv:1509.00519. Chee, J. and Toulis, P. (2018). Convergence diagnostics for stochastic gradient descent with constant learning rate. In International Conference on Artificial Intelligence and Statistics, pages 1476–1485. PMLR. Craiu, R. V., Rosenthal, J., and Yang, C. (2009). Learn from thy neighbor: Parallel-chain and regional adaptive MCMC. Journal of the American Statistical Association, 104(488):1454–1466. Domke, J. and Sheldon, D. R. (2018). Importance weighting and variational inference. Advances in Neural Informa- tion Processing Systems, 31. Gelman, A., Carlin, J. B., Stern, H. S., and Rubin, D. B. (1995). Bayesian data analysis. Chapman and Hall/CRC. CRC Press. Gorham, J. and Mackey, L. (2015). Measuring sample qual- ity with Stein's method. Advances in Neural Information Processing Systems, 28. Gorham, J. and Mackey, L. (2017). Measuring sample In International Conference on quality with kernels. Machine Learning, pages 1292–1301. PMLR. Green, P. J., Łatuszy ́nski, K., Pereyra, M., and Robert, C. P. (2015). Bayesian computation: a summary of the current state, and samples backwards and forwards. Statistics and Computing, 25(4):835–862. Hahn, G. J. and Meeker, W. Q. (2011). Statistical intervals: a guide for practitioners, volume 92. John Wiley & Sons. Hoffman, M. D., Blei, D. M., Wang, C., and Paisley, J. (2013). Stochastic Variational Inference. Journal of Machine Learning Research, 14:1303–1347. Huggins, J., Kasprzak, M., Campbell, T., and Broderick, T. (2020). Validated variational inference via practical posterior error bounds. In International Conference on Artificial Intelligence and Statistics, pages 1792–1802. PMLR. Izmailov, P., Vikram, S., Hoffman, M. D., and Wilson, A. G. G. (2021). What Are Bayesian Neural Network Pos- teriors Really Like? In Proceedings of the 38th Inter- national Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 4629–4640. PMLR. Jordan, M. I., Ghahramani, Z., Jaakkola, T. S., and Saul, L. K. (1999). An introduction to variational methods for graphical models. Machine Learning, 37(2):183–233. Kingma, D. P. and Welling, M. (2013). Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114. Kucukelbir, A., Tran, D., Ranganath, R., Gelman, A., and Blei, D. M. (2017). Automatic differentiation variational inference. Journal of Machine Learning Research. Livingstone, S. and Zanella, G. (2022). The Barker proposal: Combining robustness and efficiency in gradient-based MCMC. Journal of the Royal Statistical Society. Series B, Statistical Methodology, 84(2):496. Mendenhall, W., Beaver, R. J., and Beaver, B. M. (2012). Introduction to probability and statistics. Cengage Learn- ing. Gelman, A., Gilks, W. R., and Roberts, G. O. (1997). Weak convergence and optimal scaling of random walk Metropolis algorithms. The Annals of Applied Probabil- ity, 7(1):110–120. Metropolis, N., Rosenbluth, A. W., Rosenbluth, M. N., Teller, A. H., and Teller, E. (1953). Equation of state calculations by fast computing machines. The Journal of Chemical Physics, 21(6):1087–1092. Gelman, A. and Rubin, D. B. (1992). Inference from it- erative simulation using multiple sequences. Statistical Science, pages 457–472. Minka, T. P. (2001). Expectation propagation for approx- imate Bayesian inference. In Uncertainty in Artificial Intelligence. Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins Neal, R. (2011). MCMC using Hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, pages 113– 162. Stramer, O. and Roberts, G. O. (2007). On Bayesian analy- sis of nonlinear continuous-time autoregression models. Journal of Time Series Analysis, 28(5):744–762. Neal, R. M. (2003). Slice sampling. The Annals of Statistics, Sznitman, A.-S. (1991). Topics in propagation of chaos. 31(3):705–767. Springer. Vats, D. and Knudson, C. (2021). Revisiting the gelman– rubin diagnostic. Statistical Science, 36(4):518–529. Vehtari, A., Gelman, A., Simpson, D., Carpenter, B., and B ̈urkner, P.-C. (2021). Rank-normalization, folding, and localization: an improved ˆR for assessing convergence of MCMC (with discussion). Bayesian Analysis, 16(2):667– 718. Wada, T. and Fujisaki, Y. (2015). A stopping rule for stochas- tic approximation. Automatica, 60:1–6. Wainwright, M. J., Jordan, M. I., et al. (2008). Graphical models, exponential families, and variational inference. Foundations and Trends® in Machine Learning, 1(1–2):1– 305. Welandawe, M., Andersen, M. R., Vehtari, A., and Huggins, J. H. (2022). Robust, Automated, and Accurate Black- box Variational Inference. arXiv, arXiv:2203.15945 [stat.ML]. Xing, H., Nicholls, G., and Lee, J. K. (2020). Distortion estimates for approximate Bayesian inference. In Con- ference on Uncertainty in Artificial Intelligence, pages 1208–1217. PMLR. Yao, Y., Vehtari, A., Simpson, D., and Gelman, A. (2018). Yes, but did it work?: Evaluating variational inference. In International Conference on Machine Learning, pages 5581–5590. PMLR. Piironen, J. and Vehtari, A. (2017). Sparsity information and regularization in the horseshoe and other shrinkage priors. Electronic Journal of Statistics, 11(2):5018–5051. Ray, S., Alshouiliy, K., Roy, A., AlGhamdi, A., and Agrawal, D. P. (2020). Chi-Squared Based Feature Se- lection for Stroke Prediction using AzureML. In 2020 Intermountain Engineering, Technology and Computing (IETC), pages 1–6. IEEE. Robert, C. P. et al. (2007). The Bayesian choice: from decision-theoretic foundations to computational imple- mentation, volume 2. Springer. Roberts, G. O. and Rosenthal, J. S. (1998). Optimal scaling of discrete approximations to Langevin diffusions. Jour- nal of the Royal Statistical Society: Series B (Statistical Methodology), 60(1):255–268. Roberts, G. O. and Rosenthal, J. S. (2001). Optimal scaling for various Metropolis-Hastings algorithms. Statistical Science, 16(4):351 – 367. Roberts, G. O. and Rosenthal, J. S. (2004). General state space Markov chains and MCMC algorithms. Probability Surveys, 1:20–71. Roberts, G. O. and Rosenthal, J. S. (2007). Coupling and Ergodicity of Adaptive Markov Chain Monte Carlo Algo- rithms. Journal of Applied Probability, 44(2):458–475. Roberts, G. O. and Tweedie, R. L. (1996). Exponential convergence of Langevin distributions and their discrete approximations. Bernoulli, pages 341–363. Rosenthal, J. S. (2000). Parallel computing and Monte Carlo algorithms. Far East Journal of Theoretical Statistics, 4(2):207–236. Roy, V. and Zhang, L. (2022). Convergence of position- dependent MALA with application to conditional simula- tion in GLMMs. Journal of Computational and Graphical Statistics, (just-accepted):1–31. Rue, H., Martino, S., and Chopin, N. (2009). Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. Journal of the Royal Statistical Society: Series B (Statistical Methodol- ogy), 71(2):319 – 392. Sirignano, J. and Spiliopoulos, K. (2020). Mean field anal- ysis of neural networks: A law of large numbers. SIAM Journal on Applied Mathematics, 80(2):725–752. Solonen, A., Ollinaho, P., Laine, M., Haario, H., Tamminen, J., and J ̈arvinen, H. (2012). Efficient MCMC for climate model parameter estimation: Parallel adaptive chains and early rejection. Bayesian Analysis, 7(3):715–736. A Targeted Accuracy Diagnostic for Variational Approximations Supplementary Materials for A Targeted Accuracy Diagnostic for Variational Approximations A METROPOLIS-HASTING KERNELS We briefly summarize the kernels used in our experiments. Throughout this section let x ∈ Rd denote the current state, h ∈ R+ the step size, and G ∈ Rd×d a positive semi-definition preconditioning matrix. Random Walk Metropolis The (pre-conditioned) random walk Metropolis (RWMH) Metropolis et al. (1953) with and step size h has proposal kernel QRW (x, dy) = N (dy | x, hG). Metropolis-adjusted Langevin Algorithm In the (pre-conditioned) Metropolis-adjusted Langevin algorithm (MALA) (Roberts and Tweedie, 1996; Stramer and Roberts, 2007) has proposal kernel QL(x, dy) = N (cid:18) dy (cid:12) (cid:12) (cid:12) (cid:12) x + h 2 G∇ log π(x), hG . (cid:19) Barker Proposal Let C denote the Cholesky factor of G, set τ 2 of N (0, τ 2 (pre-conditioned) Barker proposal Livingstone and Zanella (2022) for the ith coordinate is i = hGii, let μ(*)τi be the probability density function i ), and let ci(x) = (∇ log π(x) * C T )i. For a proposal state y ∈ Rd, let zi = ((C (cid:62))−1(y − x))i. The and the full Barker kernel QB is QB i (x, dyi) = 2 μτi(yi − xi) 1 + e−zici(x) dyi, QB(x, dy) = d (cid:89) i=1 QB i (x, dyi) . Hamiltonian Monte Carlo Hamiltonian Monte Carlo (HMC) (Neal, 2011) is defined on an extended state space with the random momentum vector η indep∼ N (0, G), yielding the joint density (cid:26) ̄π(x, η) ∝ exp log(π(x)) − η(cid:62)Gη (cid:27) . 1 2 HMC updates a new state using the leapfrog integrator, which proceeds according to the updates η(t + h/2) = η(t) + (h/2)∇x log π (x(t)) x(t + h) = x(t) + hGη(t + h/2) η(t + h) = η(t + h/2) + (h/2)∇x log π (x(t + h)) . Taking x(0) = x, the new proposal state is y = x(Lh) with η(0) ∼ N (0, G). Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins B PROOFS For readability, we write the proposal kernel as K(x, h, dy) = Klog h(x, dy), so X (t+1) j ∼ K (cid:16) X (t) j , h(t) (cid:17) N , * . Or, equivalently, X (t+1) j = (cid:40) Y (t) , j X (t) , j with probability α(t) j with probability 1 − α(t) j , with Y (t) j being the proposal state based on the proposal distribution Qh(t) N (X (t) j , *) and α(t) j := g(X (t) j   := min  , h(t) , Y (t) N ) j (cid:17) (cid:16) Y (t) j X (t) j (cid:16) π π 1, (cid:17) (cid:16) X (t) j (cid:16) Y (t) j , Y (t) j , X (t) j (cid:17) (cid:17)    , qh(t) N qh(t) N where qh(x, *) is the probability density of Qh(x, *) and h(t) additional random variables, we can write N is the step size at time t. If we treat the proposed states Y (t) 1:N as (cid:16) X (t+1) j , Y (t+1) j (cid:17) ∼ T (X (t) j , Y (t) j , h(t) N , *, *) for an appropriate Markov kernel T (x, y, h, dx(cid:48), dy(cid:48)). Now define the empirical distribution of N particles X (t) iteration as j at tth ν(t) N := 1 N N (cid:88) j=1 δX (t) j . Similarly, we can define the empirical distribution of N particles (X (t) j , Y (t) j ) at the tth iteration as ξ(t) N := 1 N N (cid:88) i=1 δ(X (t) i ,Y (t) i ). Taking the initial step size h(0) N as fixed, we can rewrite the tth step size h(t) N update equation given in Eq. (5)) as N = h(t−1) h(t) N exp    1 t   1 N N (cid:88) j=1 α(t−1) j − ̄α∗      . Letting ̄h(0) = h(0) ̄ξ(t) by N , ̄ν(0) = ˆπ(0) and ̄ξ(0)(dx, dy) = Qh(0) N (x, dy)ˆπ(0)(dx), then we can recursively define ̄h(t), ̄ν(t) and ̄h(t) := ̄h(t−1) exp (cid:18) 1 √ t (cid:104)g(*, *, ̄h(t−1)), ̄ξ(t−1)(cid:105) − ̄α∗ (cid:19) , (cid:90) (cid:90) ̄ν(t) := ̄ξ(t) := where K(x, ̄h(t−1), *) ̄ν(t−1)(dx), T (x, y, ̄h(t−1), *, *) ̄ξ(t−1)(dx, dy), (cid:104)g(*, *, ̄h(t−1)), ̄ξ(t−1)(cid:105) := E (cid:90) (X,Y )∼ ̄ξ(t−1) (cid:104) g (cid:16) X, Y, ̄h(t−1)(cid:17)(cid:105) x, y, ̄h(t−1)(cid:17) ̄ξ(t−1) (dx, dy) . (cid:16) g := A Targeted Accuracy Diagnostic for Variational Approximations Let P(S) denote the set of probability measures on the measurable space (S, B). Let Ξ(t) N ∈ P(P(Rd)) and Π(t) distributions of the respective empirical measures ξ(t) N and ν(t) N , so ξ(t) N and Π(t) N denote the probability N ∈ P(P(Rd ×Rd)) respectively. We will make use of the following two results. Theorem B.1. (Sznitman, 1991) {P (t) N } is ̄ν(t)-chaotic if and only if N ◦ (ν(t) P (t) N )−1 d−→ δ( ̄ν(t)) in P(P(S)). Theorem B.2. If X, Xn : Ω → Rd are random variables such that Xn B.1 Proof of Theorem 3.3 p −→ X, then f (Xn) L1 −→ f (X) for all f ∈ Cb(Rd). Theorem 3.3 will follow from a series of propositions and lemmas, which we prove in the subsequent subsections. Proposition B.3. Under Assumption 3.4, if (X (t−1) ̄ξ(t)-chaotic. Proposition B.4. Under Assumptions 3.4.(a) and 3.4.(b), if (X (t−1) h(t) N 1:N ) is ̄ξ(t−1)-chaotic and h(t−1) 1:N ) is ̄ξ(t−1)-chaotic and h(t−1) p → ̄h(t−1), then (X (t) 1:N , Y (t−1) 1:N , Y (t−1) p → ̄h(t). N N 1:N , Y (t) 1:N ) is p → ̄h(t−1), then Note that (cid:8)(X (0) from Proposition B.3 and Proposition B.4 that for any t ∈ N, (cid:8)(X (t) i=1 is ̄ξ(0)-chaotic since the samples are i.i.d. and h(0) , Y (0) j )(cid:9)N )(cid:9)N j , Y (t) j j N = ̄h(0) is fixed. By induction, it follows i=1 is ̄ξ(t)-chaotic and hN p → ̄h(t). k The following lemma implies that there is subsequence {Π(t) Nl }l that weakly converges. Lemma B.5. Under Assumption 3.4.(c), for any fixed t ∈ N, {Π(t) Lemma B.6. Under Assumption 3.4, if X (t−1) of {Π(t) Lemma B.7. Under assumptions and conditions of Lemma B.6, X (t) 1:N is ̄νt−1-chaotic, h(t−1) N }N with limit Π(t), then Π(t) is a Dirac measure concentrated on ̄ν(t). N 1:N is ̄ν(t)-chaotic. N }N is tight and relatively compact. p → ̄h(t−1), and {Π(t) Nl }l is a convergent subsequence We also know that X (0) recursively using Lemma B.7, we conclude that X (t) 1:N is ̄ν(0)-chaotic (due to the fact that the X (0) 1:N is ̄ν(t)-chaotic for any t ∈ N. 1:N are i.i.d.), and hN k p → ̄h(t) for any t ∈ N. Hence, by B.2 Proof of Proposition B.3 To prove Proposition B.3, we will first show that the probability distribution {Ξ(t) and relatively compact, which guarantees that there exists convergent subsequence {Ξ(t) Nl convergent subsequence {Ξ(t) Nl }l has the same limit Ξ(t) that is a Dirac measure concentrated on ̄ξ(t). N }N of empirical measure {ξ(t) N }N is tight }l. Then we will prove that every Lemma B.8. Under Assumption 3.4.(c), for any fixed t ∈ N, {Ξ(t) Lemma B.9. Under Assumption 3.4, suppose (X (t−1) convergent subsequence of {Ξ(t) 1:N , Y (t−1) N }N is tight and relatively compact. 1:N ) is ̄ξ(t−1)-chaotic and h(t−1) N p → ̄h(t−1). Let {Ξ(t) Nl }l be a N }N with limit Ξ(t). Then Ξ(t) is a Dirac measure concentrated on ̄ξ(t). The proofs of Lemma B.8 and B.9 are deferred to Appendix B.2.1 and B.2.2. Relative compactness of {Ξ(t) that there is subsequence {Ξ(t) Nl represent the convergent subsequence {Ξ(t) Nl }l which weakly converges. In this proof, with a slight abuse of notation, we use {Ξ(t) }l. By Lemma B.8 and Lemma B.9, we have N }N implies N }N to ξ(t) N d→ ̄ξ(t). Theorem B.1 guarantees that (X (t) 1:N , Y (t) 1:N ) is ̄ξ(t)-chaotic. Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins B.2.1 Proof of Lemma B.8 The proof is similar to that of Lemma 2.2 in Sirignano and Spiliopoulos (2020). For a fixed t ∈ N, ∀(cid:15) > 0, we want to show that there is a compact subset K of P(Rd × Rd) such that (cid:104) ξ(t) N /∈ K < (cid:15). P (cid:105) sup N ∈N For each L > 0, define KL = [−L, L]2d, and by Assumption 3.4.(c), there exists C such that (cid:104) E ξ(t) N (cid:0)R2d\KL (cid:1)(cid:105) ≤ 1 N P (cid:16) (cid:104)(cid:13) (cid:13) (cid:13) X (t) j , Y (t) j (cid:17)(cid:13) (cid:105) (cid:13) (cid:13) ≥ L N (cid:88) j=1 (cid:16) = P (cid:104)(cid:13) (cid:13) (cid:13) (cid:104)(cid:13) (cid:13) (cid:13) X (t) j (cid:16) X (t) j , Y (t) j , Y (t) j (cid:17)(cid:13) (cid:105) (cid:13) (cid:13) ≥ L (cid:17)(cid:13) (cid:105) (cid:13) (cid:13) E ≤ ≤ = E (cid:104)(cid:13) (cid:13)X (t) (cid:13) j L (cid:13) (cid:13) (cid:13) + L (cid:13) (cid:13)Y (t) (cid:13) j (cid:13) (cid:105) (cid:13) (cid:13) C L . For L > 0, define the compact set (cid:26) ˆKL = ν : ν (cid:0)R2d\K(L+j)2 (cid:1) < √ for all j ∈ N (cid:27) . 1 L + j Observe that (cid:104) P ξ(t) N /∈ ˆKL (cid:105) ≤ ≤ ∞ (cid:88) j=1 ∞ (cid:88) j=1 (cid:20) ξ(t) N P (cid:0)R2d\K(L+j)2 (cid:1) > √ 1 L + j (cid:21) ≤ ∞ (cid:88) j=1 E (cid:104) ξ(t) N (cid:1)(cid:105) (cid:0)R2d\K((L+j)2) L + j 1/ √ C (L + j)2/ √ L + j ≤ ∞ (cid:88) j=1 C (L + j)3/2 , so limL→∞ P[ξ(t) N /∈ ˆKL] = 0. Thus, the sequence (ξ(t) N )N ∈N is tight, which implies it is relatively compact. B.2.2 Proof of Lemma B.9 For each f ∈ Cb(Rd × Rd), define the map F : P(Rd × Rd) → R+ by F (ξ) = (cid:12) (cid:12) (cid:12)(cid:104)f, ξ(cid:105) − f, ̄ξ(t)(cid:69)(cid:12) (cid:68) (cid:12) (cid:12) . [F (ξ)] = 0. Together with the fact that subsequence {Ξ(t) ξ∼Ξ(t) N N }N converges in ξ∼Ξ(t)[F (ξ)] = 0. Then we can conclude that Ξ(t) is a Dirac measure concentrated on We would like to show that limN→∞ E distribution to Ξ(t), we would have E ̄ξ(t). Letting (cid:104)f, ̃ξ(t) (cid:80)N N (cid:105) = 1 N , Y (t−1) j=1(cid:104)f, T (X (t−1) j (cid:16) (cid:104) j , ̄h(t−1), *, *)(cid:105), we have (cid:17)(cid:105) E ξ∼Ξ(t) N [F (ξ)] = E ξ(t) N F (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) = E = E ≤ E (cid:68) f, ξ(t) N (cid:68) f, ξ(t) N (cid:68) f, ξ(t) N (cid:69) (cid:69) (cid:69) − − − (cid:68) f, ̄ξ(t)(cid:69) (cid:12) (cid:21) (cid:12) (cid:12) (cid:12) (cid:68) (cid:68) f, ̃ξ(t) N (cid:69) (cid:68) f, ̃ξ(t) N (cid:69) + − (cid:68) f, ̄ξ(t)(cid:69) (cid:12) (cid:21) (cid:12) (cid:12) (cid:12) f, ̃ξ(t) N (cid:21) (cid:69) (cid:12) (cid:12) (cid:12) (cid:12) + E (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:68) f, ̃ξ(t) N (cid:69) − (cid:68) f, ̄ξ(t)(cid:69) (cid:12) (cid:21) , (cid:12) (cid:12) (cid:12) We will prove that limN→∞ E ξ∼Ξ(t) N [F (ξ)] = 0 by the following two lemmas: A Targeted Accuracy Diagnostic for Variational Approximations Lemma B.10. Under the assumptions of Lemma B.9, we have E lim N→∞ (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:68) f, ξ(t) N (cid:69) (cid:68) f, ̃ξ(t) N − (cid:21) (cid:69) (cid:12) (cid:12) (cid:12) (cid:12) = 0. Lemma B.11. Under the assumptions of Lemma B.9, we have E lim N→∞ (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:68) f, ̃ξ(t) N (cid:69) − By Lemma B.10 and B.11, we have (cid:68) f, ̄ξ(t)(cid:69) (cid:12) (cid:21) = 0. (cid:12) (cid:12) (cid:12) Since F is uniformly bounded, we have lim N→∞ E Ξ(t) N [F (ξ)] = 0. lim N→∞ E Ξ(t) N [F (ξ)] = E Ξ(t) [F (ξ)] = 0. Since this holds true for any f ∈ Cb(Rd × Rd), using the fact that F is nonnegative and by Theorem 5.1 from Billingsley (2013), we have that Ξ(t) N has a limit point that is a Dirac measure concentrated on ̄ξ(t). B.2.3 Proof of Lemma B.10 N be the σ-algebra generated by X (1:m) 1:N and Y (1:m) 1:N , for i = 1, 2, ..., N and m = 1, 2, ..., t. Let F (t) Note that E (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:68) f, ξ(t) N (cid:69) (cid:68) f, ̃ξ(t) N − (cid:21) | F (t−1) N (cid:69) (cid:12) (cid:12) (cid:12) (cid:12)  (cid:12) (cid:12) (cid:12)  (cid:12)  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N 1 N  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N = E ≤ E + E = E N (cid:88) j=1 N (cid:88) j=1 (cid:16) f X (t) j , Y (t) j (cid:17) − (cid:16) f X (t) j , Y (t) j (cid:17) − 1 N 1 N (cid:16) (cid:104)f, T X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), *, * (cid:105)  | F (t−1) N  (cid:12) (cid:12) (cid:12) (cid:12) N (cid:88) (cid:104)f, T (cid:16) i=1 X (t−1) j , Y (t−1) j , h(t−1) N  | F (t−1) N  (cid:17) , *, * (cid:12) (cid:12) (cid:12) (cid:12) (cid:105) (cid:16) (cid:104)f, T N (cid:88) j=1 X (t−1) j , Y (t−1) j , h(t−1) N , *, * (cid:17) (cid:105) − 1 N N (cid:88) (cid:104)f, T (cid:16) i=1 X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), *, *  | F (t−1) N  (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) N (cid:88) j=1 (cid:16) f X (t) j , Y (t) j (cid:17) − 1 N N (cid:88) (cid:104)f, T (cid:16) i=1 X (t−1) j , Y (t−1) j , h(t−1) N  | F (t−1) N  (cid:17) , *, * (cid:12) (cid:12) (cid:12) (cid:12) (cid:105) + (cid:12) (cid:12) (cid:12) (cid:12) 1 N N (cid:88) j=1 (cid:16) (cid:104)f, T X (t−1) j , Y (t−1) j , h(t−1) N , *, * (cid:17) (cid:105) − 1 N N (cid:88) (cid:104)f, T (cid:16) j=1 X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), *, * (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) . Since f ∈ Cb(Rd × Rd), there exists M such that for any i = 1, 2, . . . N , we have Var (cid:104) f (X (t) j , Y (t) j ) | F (t−1) N (cid:105) ≤ M < ∞. Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins It follows that  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N E N (cid:88) j=1 (cid:16) f X (t) j , Y (t) j (cid:17) − 1 N N (cid:88) j=1 (cid:16) (cid:104)f, T X (t−1) j , Y (t−1) j , h(t−1) N , *, *  | F (t−1) N  (cid:17) (cid:105) (cid:12) (cid:12) (cid:12) (cid:12) (cid:16) f X (t) j , Y (t) j (cid:17) − 1 N N (cid:88) E[ (cid:16) f j=1 X (t) j , Y (t) j (cid:17) |F (t−1) N ] (cid:16) f X (t) j , Y (t) j (cid:17) − 1 N N (cid:88) E[ (cid:16) f X (t) j , Y (t) j (cid:17) j=1  (cid:16) f X (t) j , Y (t) j (cid:17) | F (t−1) N   | F (t−1) N  (cid:12) (cid:12) (cid:12) (cid:12)  2 | F (t−1) N ]  |F (t−1) N    = E  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N N (cid:88) j=1 ≤ E1/2      1 N = Var1/2   1 N ≤ (cid:18) M N (cid:19)1/2 . N (cid:88) j=1 N (cid:88) j=1 The last inequality holds true because (X (t) j , Y (t) j ) are independent given F (t−1) N . Therefore, we have E lim N→∞  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N N (cid:88) j=1 (cid:16) f X (t) j , Y (t) j (cid:17) − 1 N N (cid:88) (cid:104)f, T (cid:16) j=1 X (t−1) j , Y (t−1) j , h(t−1) N  | F (t−1) N  = 0. (cid:17) , *, * (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) And E 1 N (cid:80)N i=1 f (cid:16) X (t) j , Y (t) j (cid:17) − 1 N (cid:80)N i=1(cid:104)f, T (cid:16) X (t−1) j , Y (t−1) j , h(t−1) N f ∈ Cb(Rd × Rd), then by dominated convergence theorem, we have (cid:17) , *, * (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) (cid:21) | F (t−1) N is bounded due to the fact that E lim N→∞ (cid:34)(cid:12) (cid:12) (cid:12) (cid:12) 1 N N (cid:88) i=1 (cid:16) f X (t) j , Y (t) j (cid:17) − 1 N N (cid:88) (cid:104)f, T (cid:16) i=1 X (t−1) j , Y (t−1) j , h(t−1) N , * (cid:35) (cid:17) (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) = 0. Note that  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N E N (cid:88) j=1 (cid:16) (cid:104)f, T X (t−1) j , Y (t−1) j , h(t−1) N (cid:17) , *, * (cid:105) − 1 N N (cid:88) (cid:104)f, T (cid:16) j=1 X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), *, *   (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) ≤ 1 N = E N (cid:88) E j=1 (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:104)f, T (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:104)f, T (cid:16) X (t−1) j , Y (t−1) j , h(t−1) N , *, * (cid:17) (cid:105) − (cid:104)f, T (cid:16) X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), *, * (cid:105) (cid:12) (cid:21) (cid:12) (cid:12) (cid:12) (cid:16) X (t−1) 1 , Y (t−1) 1 , h(t−1) N (cid:17) , *, * (cid:105) − (cid:104)f, T (cid:16) X (t−1) 1 , Y (t−1) 1 (cid:17) , ̄h(t−1), *, * (cid:21) (cid:12) (cid:12) (cid:105) (cid:12) (cid:12) . Since we know (X (t−1) , Y (t−1) , Y (t−1) 1 1 with respect to (x, y, h), thanks to Theorem B.2, we have p → (X (t−1) 1 , h(t−1) N ) 1 , ̄h(t−1)) and (cid:104)f, T (x, y, h, *, *)(cid:105) is bounded and continuous E lim N→∞  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N N (cid:88) j=1 (cid:16) (cid:104)f, T X (t−1) j , Y (t−1) j , h(t−1) N (cid:17) , * (cid:105) − 1 N N (cid:88) j=1 (cid:104)f, T (cid:16) X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), * (cid:105)   = 0. (cid:12) (cid:12) (cid:12) (cid:12) A Targeted Accuracy Diagnostic for Variational Approximations B.2.4 Proof of Lemma B.11 Note that  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N E N (cid:88) (cid:16) (cid:104)f, T X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), *, * (cid:105) − (cid:68) f, ̄ξ(t)(cid:69) (cid:12) j=1 (cid:34)(cid:12) (cid:12) (cid:12) (cid:12) (cid:104)f, T (cid:16) X (t−1) j , Y (t−1) j , ̄h(t−1), *, * (cid:17) (cid:105) − (cid:68) E 1 N f, ̄ξ(t)(cid:69) (cid:12) 2  (cid:12) (cid:12) (cid:12) 2(cid:35) N 2 − N N 2 (cid:104)(cid:16) E (cid:104)f, T (cid:16) X (t−1) i , Y (t−1) i , ̄h(t−1), *, * (cid:17) (cid:105) − (cid:68) The above expectation is taken with respect to (X (t−1) j = + (cid:12) (cid:12) (cid:12) f, ̄ξ(t)(cid:69)(cid:17) (cid:16) (cid:16) (cid:104)f, T X (t−1) j , Y1,t−1, ̄h(t−1), * (cid:17) (cid:105) = , Yi,t−1). For any fixed (X (t−1) (cid:90) j (cid:16) , Yi,t−1) f (s1, s2) T X (t−1) j , Y1,t−1, ̄h(t−1), ds1, ds2 (cid:17) (cid:90) (cid:90) = + f f (cid:16) X (t−1) j , s2 (cid:17) (cid:16) 1 − g (cid:16) X (t−1) j , Y (t−1) j , ̄h(t−1)(cid:17)(cid:17) Q ̄h(t−1)(X (t−1) j , ds2) (cid:16) Y (t−1) j , s2 (cid:16) (cid:17) g X (t−1) j , Y (t−1) j , ̄h(t−1)(cid:17) Q ̄h(t−1) (Y (t−1) j , ds2). (cid:104)f, T (cid:16) X (t−1) j , Y (t−1) j , ̄h(t−1), *, * (cid:17) (cid:105) − (cid:68) f, ̄ξ(t)(cid:69)(cid:17)(cid:105) . By Assumption 3.4.(a) and 3.4.(b), it is bounded and continuous with respect to (X (t−1) that (X (t−1) j , Y (t−1) j ). Then thanks to that fact 1:N , Y (t−1) (cid:16) (cid:104)(cid:16) 1:N ) is ̄ξ(t−1)-chaotic, we have (cid:17) , ̄h(t−1), * (cid:104)f, T , Y (t−1) i X (t−1) i E lim N→∞ (cid:18)(cid:90) = (cid:104)f, T (cid:16) (cid:17) s1, s2, ̄h(t−1), *, * (cid:105) − (cid:68) f, ̄ξ(t)(cid:69) d ̄ξ(t−1)(ds1, ds2) (cid:19)2 = 0. (cid:105) − f, ̄ξ(t)(cid:69)(cid:17) (cid:16) (cid:68) (cid:104)f, T (cid:16) X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), *, * (cid:105) − f, ̄ξ(t)(cid:69)(cid:17)(cid:105) (cid:68) Since f ∈ Cb(Rd × Rd), we have E (cid:34)(cid:12) (cid:12) (cid:12) (cid:12) (cid:16) (cid:104)f, T X (t−1) j , Y (t−1) j (cid:17) , ̄h(t−1), *, * (cid:105) − (cid:10)f, ̄ξ(t)(cid:11) 2(cid:35) (cid:12) (cid:12) (cid:12) (cid:12) < ∞. Therefore, we have E lim N→∞ (cid:20)(cid:12) (cid:12) (cid:12) (cid:12) (cid:68) f, ̃ξ(t) N (cid:69) − B.3 Proof of Proposition B.4 Recall that the step size update is (cid:68) f, ̄ξ(t)(cid:69) (cid:12) (cid:21) = 0. (cid:12) (cid:12) (cid:12)  N = h(t−1) h(t) N exp   = h(t−1) N exp        1 N 1 t 1 t    α(t−1) j  − ̄α∗   1 N N (cid:88) j=1 X (t−1) j , Y (t−1) j , h(t−1) N (cid:17)   − ̄α∗   . (cid:16) g N (cid:88) j=1 Note that 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j , h(t−1) N ) − (cid:104)g(*, *, ̄h(t−1)), ̄ξ(t−1)(cid:105) = 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j , h(t−1) N ) − 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j , ̄h(t−1)) (9) + 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j , ̄h(t−1)) − (cid:104)g(*, *, ̄h(t−1)), ̄ξ(t−1)(cid:105). Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins The first term in Eq. (9) can be rewritten as   1 N E (cid:16) g N (cid:88) j=1 X (t−1) j , Y (t−1) j , h(t−1) N (cid:17) − 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j , ̄h(t−1))   = E (cid:104) g(X (t−1) j , Y (t−1) j , h(t−1) N ) − g(X (t−1) j , Y (t−1) j (cid:105) , ̄h(t−1)) . Since (X (t−1) that j , Y (t−1) j , h(t−1) N ) p → (X (t−1) j , Y (t−1) j , ̄h(t−1)) and g is bounded and continuous, it follows from Theorem B.2 E lim N→∞  (cid:12) (cid:12) (cid:12)  (cid:12) 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j , h(t−1) N ) − 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j (cid:12) (cid:12) , ̄h(t−1)) (cid:12) (cid:12)   = 0. (10) The second term of Eq. (9) can be rewritten as 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j , ̄h(t−1)) − (cid:104)g(*, *, ̄h(t−1)), ̄ξ(t−1)(cid:105) = (cid:104)g(*, *, ̄h(t−1)), ξ(t−1) N (cid:105) − (cid:104)g(*, *, ̄h(t−1)), ̄ξ(t−1)(cid:105). Since (X (t−1) 1:N , Y (t−1) 1:N ) is ̄ξ(t−1)-chaotic, by Theorem B.1 we have ξ(t−1) N d→ ̄ξ(t−1). By Assumptions 3.4.(a) and 3.4.(b), we have g(x, y, ̄h(t−1)) is continuous with respect to (x, y), thus (cid:104)g(*, *, ̄h(t−1)), ξ(t−1) N p −→ (cid:104)g(*, *, ̄h(t−1)), ̄ξ(t−1)(cid:105). (cid:105) (11) It follows from Eq. (10) and Eq. (11) that 1 N N (cid:88) j=1 g(X (t−1) j , Y (t−1) j , h(t−1) N ) p −→ (cid:104)g(*, *, ̄h(t−1)), ̄ξ(t−1)(cid:105) and therefore h(t) N p → ̄h(t). B.4 Proofs of Lemmas B.5 to B.7. The proof of Lemma B.5 is similar to that of Lemma B.8; the proof of Lemma B.6 is similar to that of Lemma B.9; the proof of Lemma B.7 is similar to that of Proposition B.3. C ADDITIONAL RESULTS AND EXPERIMENTS C.1 Ablation Study On T In Section 3.3, we discussed how to choose length of Markov chains properly: Eq. (7) and Eq. (8) guarantee that we can obtain efficient samples under different dimension d without too large computation cost. Now, we would like to explore how the lower bounds would change under different number of iterations T . Figures 10 to 12 display the evolution of several lower bounds for X1 of Gaussian model (Section 4.1), X1 of Neal-funnel shape model (Section 4.2) and λ61 of cancer classification using horseshoe prior (Section 4.4) respectively, which shows that when ρ is large (greater than 0.1), the proposed lower bounds are quite underestimated. These results also confirm the lowers bounds become nearly stationary at our proposed number of iterations T . C.2 Additional Results for Neal-Funnel Shape Model In Section 4.2, we validate TADDAA on Neal's funnel distribution approximated by mean-field Gaussian VI. Fig. 13 provides reliability checks for the Neal's funnel experiment Fig. 4. A Targeted Accuracy Diagnostic for Variational Approximations Figure 10: Ablation study for T on X1 of Gaussian model with correlated coordinates, d = 30. Figure 11: Ablation study for T on X1 of Neal-funnel shape model, d = 30. Figure 12: Ablation study for T on λ61 of Neal-funnel shape model, d = 100. ,WHUDWLRQ/RZHUERXQGVRQX1BmeanBvarianceBmedianBtail7,WHUDWLRQ5HOLDELOLW\FKHFNRQX17,WHUDWLRQ/RZHUERXQGVRQX1BmeanBvarianceBmedianBtail7,WHUDWLRQ5HOLDELOLW\FKHFNRQX17,WHUDWLRQ/RZHUERXQGVRQX1BmeanBvarianceBmedianBtail7,WHUDWLRQ5HOLDELOLW\FKHFNRQX17 Yu Wang, Mikołaj Kasprzak, Jonathan H. Huggins Figure 13: Reliability checks on TADDAA using Barker applied to the mean-field VI approximation to Neal's funnel distribution of varying dimensionality. Next, we will validate the TADDAA on Neal's funnel distribution approximated by mean-field t-distribution VI. The lower bounds Bmean and Btail are computed according to Eq. (1) using functionals of interest F0.5 and F0.9 defined based on Eq. (4). Fig. 14 shows that the median and tail quantile lower bounds constructed using Barker are quite precise and remain valid when d and hatk are large. As we can see, ˆk is large (ˆk > 0.7) for almost any dimension, indicating VI approximation is not reliable. But if we are only interested in whether median of X2, mean field t-distribution VI should be considered as reliable. C.3 Reliability Check for Bayesian Neural Network In Section 4.5, we validate TADDAA on Bayesian neural network approximated by mean-field Gaussian VI. The reliability check is shown in Fig. 15: due to the fact that the variance is dramatically underestimated, only Barker chains pass the reliability check, which is also consistent with the fact that Barker kernel provides the best lower bounds as displayed in Fig. 9. 020406080Iteration0.00.51.02maxd = 2d = 10d = 20d = 30 A Targeted Accuracy Diagnostic for Variational Approximations Figure 14: Diagnostics for Neal-funnel shape model, where TADDAA uses the Barker proposal. Q1(0.5) and Q1(0.9) denote the median and 90%-quantile of X1, Q2(0.5) and Q2(0.9) denote the median and 90%-quantile of X2. Figure 15: Reliability checks for TADDAA using different kernels applied to Bayesian neural network approximated by mean-field Gaussian VI for candy power ranking dataset. 51015202530Dimension0100101102BoundDiagnostics on X1BmedianBtail|Q(0)1(0.5)Q1(0.5)||Q(0)1(0.9)Q1(0.9)|W2 mean upper boundW2 Cov upper bound51015202530Dimension0100101102BoundDiagnostics on X2BmedianBtail|Q(0)2(0.5)Q2(0.5)||Q(0)2(0.9)Q2(0.9)|W2 mean upper boundW2 Cov upper bound51015202530Dimension0.00.20.40.60.81.02max51015202530Dimension0.60.81.0k050100150200Iteration0.51.02maxRWMHMALABarkerHMC
http://arxiv.org/abs/2302.12416v1
2023-02-24T02:44:39
2023-02-24T02:44:39
A Convolutional Vision Transformer for Semantic Segmentation of Side-Scan Sonar Data
Distinguishing among different marine benthic habitat characteristics is of key importance in a wide set of seabed operations ranging from installations of oil rigs to laying networks of cables and monitoring the impact of humans on marine ecosystems. The Side-Scan Sonar (SSS) is a widely used imaging sensor in this regard. It produces high-resolution seafloor maps by logging the intensities of sound waves reflected back from the seafloor. In this work, we leverage these acoustic intensity maps to produce pixel-wise categorization of different seafloor types. We propose a novel architecture adapted from the Vision Transformer (ViT) in an encoder-decoder framework. Further, in doing so, the applicability of ViTs is evaluated on smaller datasets. To overcome the lack of CNN-like inductive biases, thereby making ViTs more conducive to applications in low data regimes, we propose a novel feature extraction module to replace the Multi-layer Perceptron (MLP) block within transformer layers and a novel module to extract multiscale patch embeddings. A lightweight decoder is also proposed to complement this design in order to further boost multiscale feature extraction. With the modified architecture, we achieve state-of-the-art results and also meet real-time computational requirements. We make our code available at ~\url{https://github.com/hayatrajani/s3seg-vit
[ "Hayat Rajani", "Nuno Gracias", "Rafael Garcia" ]
10.1016/j.oceaneng.2023.115647
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1016/j.oceaneng.2023.115647", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.12416v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12416v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Ocean Engineering Volume 286, Part 2, 15 October 2023, 115647" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG", "I.2.6; I.4.6; I.5.1; I.5.4" ]
3 2 0 2 b e F 4 2 ] V C . s c [ 1 v 6 1 4 2 1 . 2 0 3 2 : v i X r a A Convolutional Vision Transformer for Semantic Segmentation of Side-Scan Sonar Data Hayat Rajania,∗, Nuno Graciasa and Rafael Garciaa aComputer Vision and Robotics Research Institute (VICOROB), University of Girona, Campus Montilivi, Edifici P4, Girona 17003, Catalonia, Spain A R T I C L E I N F O A B S T R A C T Keywords: seafloor segmentation side-scan sonar vision transformer convolutional transformer real-time Distinguishing among different marine benthic habitat characteristics is of key importance in a wide set of seabed operations ranging from installations of oil rigs to laying networks of cables and monitoring the impact of humans on marine ecosystems. The Side-Scan Sonar (SSS) is a widely used imaging sensor in this regard. It produces high-resolution seafloor maps by logging the intensities of sound waves reflected back from the seafloor. In this work, we leverage these acoustic intensity maps to produce pixel-wise categorization of different seafloor types. We propose a novel architecture adapted from the Vision Transformer (ViT) in an encoder-decoder framework. Further, in doing so, the applicability of ViTs is evaluated on smaller datasets. To overcome the lack of CNN-like inductive biases, thereby making ViTs more conducive to applications in low data regimes, we propose a novel feature extraction module to replace the Multi-layer Perceptron (MLP) block within transformer layers and a novel module to extract multiscale patch embeddings. A lightweight decoder is also proposed to complement this design in order to further boost multiscale feature extraction. With the modified architecture, we achieve state-of-the-art results and also meet real-time computational requirements. We make our code available at https://github.com/hayatrajani/s3seg-vit 1. Introduction High-resolution maps of the seafloor are a central tool for environmental monitoring. If these maps include topographical features and bottom types correctly identified and classified, they would become fundamental for the scientific and economic exploration of the oceans. The surveys for creating such maps are typically conducted from oceanographic vessels, using different types of acoustic sensors. Although the use of optical sensors for autonomous underwater exploration has seen several advances, they are severely affected by light attenuation and color shift caused by the variability in water conditions. This imposes limitations on the range of operation, restricting samples to be acquired only over small areas. The use of acoustic sensors, on the other hand, makes it possible to perceive the underwater environment even in zero-visibility conditions regardless of the depth, also allowing them to cover a much wider area in a single pass. The Side Scan Sonar (SSS) is one such acoustic sensor that is very widely used in marine surveys. It is very easily adaptable to numerous types of sea vessels without the need for specific configurations and consumes low power, making it very economical and easy to deploy. As such, this work is aimed at semantic segmentation of acoustic images acquired from a SSS. Specifically, we deal with the problem of large-scale survey and exploration using an Autonomous Underwater Vehicle (AUV) to automate the process of mission planning and sensing, where online processing of such data is crucial. Much of the prior work carried out in this area makes use of traditional image processing and pattern recognition approaches such as clustering strategies (Celik and Tjahjadi, 2011; Yao et al., 2000), Markov Random Field (MRF) (Mignotte et al., 1999, 2000) or active contouring (Lianantonakis and Petillot, 2007). These methods are based on hand-crafted features and either lack the efficiency to be used online or the capacity for generalization, among other issues. In this paper, we propose to leverage the capabilities that Deep Neural Networks (DNNs) have showcased in pixel- wise labeling in recent years. In particular, we adopt Vision Transformers (ViTs) for the abovementioned task due to their ability to draw long-range associations among different regions of an image. The motivation behind using ∗Corresponding author [email protected] (H. Rajani); [email protected] (N. Gracias); [email protected] (R. Garcia) ORCID(s): H. Rajani et al.: Preprint submitted to Elsevier Page 1 of 14 Convolutional ViTs for SSS Segmentation Figure 1: The original ViT architecture as proposed by Dosovitskiy et al. (2021) long-range associations comes from the fact that expert geophysicists often use global context to disambiguate among similarly looking classes. We believe that ViTs would enable the model to efficiently capture enough global context so as to make more informed decisions. This study, thus, also serves as a proof-of-concept of the feasibility of ViTs for tasks such as SSS segmentation. Given sufficient speed of computation, we can then use larger images (512x512) to capture more global information and further boost results. The Transformer was originally developed as a sequence transduction model, for tasks such as machine translation, where it is essential for the model to formulate a thorough understanding of the language by capturing how the different components in a text interact with each other, the different semantics they might adopt in different contexts and the various syntactical patterns that might arise. Vaswani et al. (2017) designed a computationally efficient mechanism, called the multi-head self-attention, to capture such global dependencies, which eventually led Transformer-based models to become the state-of-the-art in many Natural Language Processing (NLP) tasks. Later, Dosovitskiy et al. (2021) transferred these principles to computer vision, giving rise to an architectural paradigm called the Vision Transformer, as depicted in Figure 1. Since the original Transformer was designed to operate on a sequence of 1D word embeddings, as opposed to the 2D or 3D images that vision models usually deal with, ViT breaks down the input image into a sequence of patches and linearly projects the flattened patches into an embedding space. This is essentially what allows the multi-head self-attention mechanism to ingest the n-D input and draw associations between different regions of the image, thereby capturing global context. However, in doing so, the spatial correlations between patches are lost and the structure of the image is no longer preserved. This requires the use of positional encodings as a way to embed this structural information within the architecture. Unfortunately, positional encodings must be learnt from scratch as the model has no knowledge about the relative location of the patches to begin with. This increases the dependence of ViTs on large datasets, resulting in poor generalization otherwise. However, for domains such as marine robotics, where the data is typically very scarce, employing such architectures becomes infeasible, especially without any pre-training. Convolutional Neural Networks (CNNs), on the other hand, have the grid-structure of the image built into their architectural design. This acts as a strong prior for the model resulting in properties such as shift invariance and equivariance. Moreover, although ViTs posses a global receptive field, convolutions tend to be more effective in extracting local features. We, therefore, propose two architectural modifications in an attempt to inject these characteristics into ViTs and to make them more suitable for applications that lack sufficiently large datasets. • We replace the linear patch embeddings at the beginning of each transformer stage with multiscale patch embeddings inspired in part by the design choices of Inception-v2 (Szegedy et al., 2016). • We replace the non-linear projections of the Multi-layer Perceptron (MLP) block within each transformer layer with a feature extraction block inspired by Ghost convolutions (Han et al., 2020). H. Rajani et al.: Preprint submitted to Elsevier Page 2 of 14 Convolutional ViTs for SSS Segmentation The benefits are multifold. Not only does the use of convolutions within these modules introduce the notion of a grid-like structure, but posing them as stacked separable convolutions also reduces the number of parameters that the model needs to optimize. This further relaxes the need for position encodings while also enabling multiscale feature extraction. Consequently, this improves the capabilities of our modified architecture in capturing high-frequency details and generalizing well in the absence of huge datasets for training. Furthermore, (hierarchical) ViT-based encoders, due to their ability to draw associations between different regions of an image, especially at multiple scales, tend to produce strong latent representations, which are readily suitable for the task of semantic segmentation. This permits the use of simple decoder designs without the need for computationally expensive modules. We model our decoder after the lightweight design proposed by Xie et al. (2021), by supplementing it with auxiliary output blocks inspired by DeepLab's Atrous Spatial Pyramid Pooling (ASPP) (Chen et al., 2018). With our modified design, we surpass the results of previous state-of-the-art by a significant margin while also meeting the computational considerations for real-time implementation. Consequently, we demonstrate the applicability of ViTs for tasks such as semantic segmentation of the seafloor using SSS waterfalls, for which large datasets are seldom available. We believe that such hybrid ViT-based architectures have a large potential in underwater applications. To encourage further exploration of these approaches and to ease the reproducibility of our results, our code will be made available online at https://github.com/hayatrajani/s3seg-vit. The remainder of this paper is organized as follows. Section 2 presents a brief review of previous works on SSS segmentation using DNNs and related literature in the context of semantic segmentation using ViTs. Then, Section 3 provides thorough details of our proposed architecture. Next, Section 4 presents an overview of the dataset and the experimental setup. Section 5 reports and visualizes our results. And finally, Section 6 concludes this study by outlining the planned efforts. 2. Related Work 2.1. CNNs for SSS segmentation The approach in this paper is, to the best of our knowledge, the first to demonstrate the applicability of ViTs to SSS segmentation. Nonetheless, a number of previous studies have adopted CNNs and attention-based mechanisms for this task. Wang et al. (2019) propose a U-Net (Ronneberger et al., 2015) like encoder-decoder architecture for real- time SSS segmentation. They employ a two-way branching structure exploiting depth-wise separable convolutions in their encoder for efficiency and a combination of pooling indices and direct skip connections to feed the lost spatial information back into the decoder. Wu et al. (2019), on the other hand, focus on dealing with different sources of noise in SSS imagery and the issue of class imbalance. They employ residual blocks in their encoder and propose the use of side-output blocks, in addition to the typical encoder-decoder design, to leverage multi-level information from each encoder. Similarly, Zhao et al. (2021) focus on dealing with different sources of noise in SSS imagery for real- time segmentation. Apart from carefully designing the encoder and decoder modules, they propose a novel DCblock employing dilated convolutions that sits between the encoder and the decoder to attain more context. Whereas, Burguera and Bonin-Font (2020) target the problem of building a semantic map of the seafloor, specifically to search for loop candidates in a SLAM context. They propose an end to end framework in this regard while employing a lightweight encoder-decoder architecture for online multi-class SSS segmentation. However, Wang et al. (2022b) argue that such simple encoder-decoder designs are vulnerable to noise interference and only work well for SSS images with simple backgrounds. They propose an adaptive receptive field mechanism on the skip connections between the encoder and decoder branches to improve target shape fit. They further supplement the encoder branch with dynamic multiscale dilated convolution blocks to extract multiscale target features, and supplement the decoder branch with attention- based feature fusion blocks to better fuse global and local features while suppressing background noise. Furthermore, they propose a tree structure optimization module to refine the produced segmentation masks, thus, reducing the rate of misclassifications. Wang et al. (2022b) also propose a boundary loss based on structural similarity and weighted binary cross-entropy to improve classification along the contour of the target. However, we believe these enhancements to be specifically directed towards the problem of target segmentation, which is the main purpose of their work, as opposed to our objective of seafloor segmentation. Moreover, from the reported results, the architecture seems to have a very large number of parameters, and consequently a much lower inference speed. Therefore, we do not draw direct comparisons with this approach. Yu et al. (2021), on the contrary, propose a novel approach for SSS segmentation by employing recurrent residual convolutions to capture global context followed by a self-guidance block for further refinement of results. The self-guidance block takes inspiration from the discriminator component of Generative Adversarial H. Rajani et al.: Preprint submitted to Elsevier Page 3 of 14 Convolutional ViTs for SSS Segmentation Networks (GANs) and serves to distinguish the generated segmentation mask from the ground truth. Although the authors claim a boost in segmentation results with their approach, the inference speed is significantly slow. Moreover, they mainly draw comparisons with models such as the U-Net (Ronneberger et al., 2015) and SegNet (Badrinarayanan et al., 2017), which are over 15 times larger than our proposed architecture. We, therefore, do not include this approach in our comparative study either. Yu et al. (2022), take this approach further in another publication directed towards target segmentation. They propose a dual-branch framework comprising a segmentation branch and a refinement branch. The segmentation branch adopts a MobileNetv2 (Sandler et al., 2018) backbone, additionally consisting of local attention and recurrent residual modules to dampen the effect of irrelevant features, thereby facilitating better emphasis on the target. This also addresses the overfitting caused by unbalanced datasets. The refinement branch further tunes this output with the help of holistic attention blocks for multi-level feature fusion. Both branches are further complemented by ASPP modules (Chen et al., 2018) for enlarged receptive fields and better contextual understanding. However, this results in an architecture that is parameter-heavy, being almost 6 times larger than ours. Further, since this work is also intended for target segmentation, as opposed to our objective of seafloor segmentation, we do not draw direct comparisons with it. 2.2. ViTs for Semantic Segmentation The vanilla ViT, as proposed by Dosovitskiy et al. (2021), yields low resolution feature maps of uniform scale, making it less desirable for dense prediction tasks such as semantic segmentation. To address this, Wang et al. (2021) proposed as an alternative a hierarchical structure composed of a progressively shrinking pyramid capable of extracting features at multiple scales. This readily allowed ViTs to be plugged into standard dense prediction frameworks. They further apply spatial reduction to key and value embeddings before attention computation to handle the quadratic complexity associated with the traditional self-attention operation. Based on this hierarchical design, Ren et al. (2022) and Yao et al. (2022) propose different flavours of spatially-reduced attention to preserve image details. Where the former downsamples the key and value embeddings with different rates for different attention heads, the latter employs discrete wavelet transforms. Liu et al. (2021), on the other hand, proposed a window-based self-attention scheme to reduce memory and computational costs. Attention is computed among tokens within non-overlapping local windows and the windows are shifted by a certain amount between consecutive layers to facilitate cross-window connections. This approach to self-attention computation was followed up by several other works (Huang et al., 2021; Wang et al., 2022a; Dong et al., 2022; Wu et al., 2022) proposing different schemes of windowing and cross-flow of information among windows. However, these approaches are still restricted by the number of input tokens. To increase efficiency in processing high-resolution images, Ali et al. (2021) propose cross-covariance attention which computes self-attention among feature channels thereby making the computation linear in the number of tokens. Koohpayegani and Pirsiavash (2022) take this a step forward by replacing the softmax in self-attention with L1-normalization of key and value embeddings to further boost computational efficiency. In our proposed architecture, we use an adaptation of this approach, and draw comparisons with notable window-based and spatially-reduced self-attention mechanisms. A related but independent line of work addresses the lack of CNN-like inductive biases in ViTs in order to improve their efficiency in capturing high-frequency details. There have been several studies (D'Ascoli et al., 2021; Srinivas et al., 2021; Wu et al., 2021; Guo et al., 2022; Li et al., 2022; Ma et al., 2022; Mehta and Rastegari, 2022; Si et al., 2022; Zhang et al., 2022) in this regard, which adopt one or a combination of diverse strategies such as introducing convolutions within the transformer blocks of ViTs, modifying the self-attention computation using convolutions, replacing the MLP blocks of ViTs with convolutions, or introducing transformer blocks within CNNs. The approach by Guo et al. (2022) is the closest to ours in that they also use a convolutional stem and adapt the MLP block of ViTs by introducing convolutions, apart from adopting convolutions inside their self-attention mechanism. However, in addition to inducing CNN-like inductive biases in the architecture, one of our primary objectives is to enhance the representability of objects of different scales, driving us to adopt distinct designs. While the aforementioned studies focus on modifying the design of the ViT-based encoder counterpart of the framework, there have been a handful of efforts directed towards an efficient decoder design. For instance, Cao et al. (2021), taking inspiration from U-Net (Ronneberger et al., 2015), propose a Swin Transformer (Liu et al., 2021) based symmetric upsampling decoder, and Strudel et al. (2021) propose as a decoder a mask transformer that jointly processes patch and class embeddings. Bousselham et al. (2021), on the other hand, propose an end-to-end trainable self-ensembling approach to leverage multi-scale features that are produced by different stages of the encoder, without the need of expensive feature fusion operations. However, Xie et al. (2021) propose a much simpler design, solely H. Rajani et al.: Preprint submitted to Elsevier Page 4 of 14 Convolutional ViTs for SSS Segmentation Figure 2: Overview of the proposed architecture. H ′ and W ′ refer to the spatial dimensions of the input. C denotes the initial embedding dimension. N denotes the number of classes. consisting of feature aggregating MLP blocks, that is capable of producing powerful representations while being computationally inexpensive. We model our decoder after an adaptation of this approach as detailed in Section 3.2. 3. Proposed Architecture Figure 2 depicts an overview of the proposed architecture. It follows the general scheme of an encoder-decoder structure for semantic segmentation consisting of downsampling encoder blocks and upsampling decoder blocks with skip connections from the corresponding encoders. However, instead of building the decoder as a symmetric counterpart of the encoder, a much lighter-weight approach is adopted that is not only computationally more efficient but also yields better segmentation results, as discussed later in Section 5. The following two subsections describe the encoder and decoder modules in further detail. 3.1. A Multiscale Convolutional ViT Encoder The encoder adopts a modified version of a conventional 4-stage hierarchical ViT that begins with an initial patch size of 4 × 4 pixels, projected onto a C-dimensional embedding space. We set the initial length of embeddings to 24. For an input of size H × W pixels, this results in a sequence of (H ⋅ W ) ⁄ 16 24-dimensional patch embeddings. Between two successive transformer stages, patches in non-overlapping 2×2 neighborhoods are merged together while the length of their embeddings is doubled. This essentially downsamples each patch by a factor of 2 and, consequently, reduces the sequence length by a factor of 4. As a result, each transformer stage operates on a different scale, thereby making it possible for the encoder to construct a feature pyramid comparable to that of traditional CNN backbones. Traditionally, the patch embedding and merging modules are composed of reshaping, flattening and linear projec- tion operations. Our approach, on the other hand, leverages the local feature extraction capabilities of convolutions. We begin by applying a 7 × 7 convolution with a stride of 2 to the input image, resulting in a feature representation of size H × 12. Before each transformer stage, we then place a patch merging module that downsamples the input by a 2 factor of 2 and doubles the number of feature channels. The produced feature representation is subsequently flattened along the spatial dimensions to make it suitable to be processed by the corresponding transformer stage. Thus, each transformer stage, i ∈ {1, 2, 3, 4}, operates on an input of size H⋅W × W 2 2i+1 × 12⋅2i. H. Rajani et al.: Preprint submitted to Elsevier Page 5 of 14 Convolutional ViTs for SSS Segmentation Figure 3: Overview of a transformer stage together with illustrations of the patch merging module, the proposed FFN and ghost convolutions. H ′ and W ′ refer to the spatial dimensions of the input. C ′ denotes the number of input channels. DW denotes a depthwise convolution. The patch merging module, as illustrated in Figure 3, was in part inspired by the design of Inception-v2 (Szegedy et al., 2016). It consists of four parallel branches of stacked depthwise convolutions of different receptive fields with appropriate padding to maintain spatial dimensions. Apart from introducing convolutional priors, the main rationale behind the patch merging module was to be able to adequately represent objects of different scales such as small pebbles to large boulders. The parallel convolutional branches enable feature extraction over various spatial footprints to generate multi-scale patch embeddings. Such a design further complements self-attention to draw finer global associations. Further, employing depthwise convolutions instead of full convolutions and factorizing convolutions with larger kernels by a stack of 3 × 3 convolutions, significantly saves on parameters while maintaining the effective receptive field. Each depthwise convolution operation is also followed by group normalization (Wu and He, 2018) with the number of groups set to 1. We then apply average pooling, preceded by a Hard Swish non-linearity (Howard et al., 2019), to downsample the generated feature representations by a factor of 2 followed by a pointwise convolution to project the aggregated multi-scale representations to twice the length of the input embeddings. Moreover, we introduce a residual connection, composed of a pointwise convolution and average pooling, for stability. The overall parameter count still remains lower as compared to employing a single full 3 × 3 convolution with a stride of 2 for patch merging, as proposed by Wu et al. (2021) and Dong et al. (2022), in lieu of linear projections. Figure 3 also illustrates the transformer stage in more detail. Each transformer stage consists of L ∈ {3, 6, 12, 3} transformer layers. Each transformer layer, as in the original ViT design (Dosovitskiy et al., 2021), is composed of H. Rajani et al.: Preprint submitted to Elsevier Page 6 of 14 Convolutional ViTs for SSS Segmentation a self-attention module and an MLP block, each preceded by layer normalization (Ba et al., 2016) and accompanied by a residual connection (He et al., 2016). Traditionally, the MLP block comprises two linear projections separated by a GELU non-linearity. Since naïvely replacing the linear projections by 3 × 3 convolutions increases the overall parameter count 9-fold, we instead adopted ghost convolutions as conceived by Han et al. (2020). They try to replicate the redundancy in feature maps generated by full convolutions through cheap linear operations. Specifically, a full convolution is split into two parts: a pointwise convolution in order to generate the primary feature maps followed by a 3 × 3 depthwise convolution (portrayed as a cheap linear operation) in order to generate secondary "ghost" features that add redundancy. We later extended this design by applying an additional 5 × 5 depthwise convolution, implemented as a stack of two 3 × 3 depthwise convolutions, to the primary features before concatenating them with the ghost features. We use this extended ghost convolution to replace the first linear projection in the original MLP. Again, after each convolution operation, we employ group normalization with a group size of 1. We also employ a Hard Swish non-linearity before the final linear projection. The resultant module not only introduces image-specific priors into the design but also reduces the parameter count when compared to a corresponding MLP block with an expansion ratio of 2. Finally, due to the linear complexity in the number of patches, we use the attention mechanism as proposed by Ali et al. (2021). To further reduce computational cost, we remove the expensive softmax-based normalization of the attention matrix and, instead, L1-normalize the key and query embeddings before computing the attention scores as proposed by Koohpayegani and Pirsiavash (2022). To avoid ambiguity in comparison, we term this modified attention mechanism SimXCA, a contraction of the names of the two referenced approaches. We set the number of attention heads to {2, 4, 8, 16} for the four transformer stages respectively, and we do not use any kind of positional encoding. 3.2. A SegFormer-ASSPP Decoder Classical CNN-based approaches to semantic segmentation, such as U-Net (Ronneberger et al., 2015) and SegNet (Badrinarayanan et al., 2017), design the decoder as a symmetric counterpart to the encoder together with skip connections in order to add the lost spatial information back from the multi-resolution feature pyramid of the encoder. However, we observed that adopting such a symmetric design for ViT-based encoder-decoder frameworks yields quite poor results. This can be particularly attributed to the dependence of ViTs on large datasets to overcome their inherent lack of CNN-like inductive biases, which is further amplified by the symmetric decoder. Despite our modifications to induce CNN-like inductive biases in the design, we postulate that such complex architectures are not really necessary for the decoder. The encoder, due to its ability to draw associations between different regions of the input image and extract multi-scale local features, already tends to produce strong latent representations that are readily suitable for the task of semantic segmentation. This permits the use of simpler designs for the decoder, which also drastically reduces the number of trainable parameters. As such, we base our decoder after the design proposed by Xie et al. (2021). First, feature representations from each encoder stage are linearly projected to the initial embedding dimension, C, and are bilinearly upsampled to match the size of the initial patch embedding, H . The projected representations 4 are then fused together by addition, instead of concatenation as proposed by Xie et al. (2021). This is followed by another linear projection to the initial embedding dimension. This fused representation then undergoes a final linear projection to an N-dimensional space, where N is the number of classes, in order to predict the segmentation mask, which is subsequently upsampled by a factor of 4 to match the input image resolution. × W 4 However, we postulate that such a simple feature aggregating decoder is unable to completely leverage the multi- scale representations generated by the encoder, especially for small-scale objects. Therefore, contrary to Xie et al. (2021), we also employ two auxiliary blocks, based on the ASPP module (Chen et al., 2018), that operate on the feature representations from the second and the third encoder stages. The ASPP module can effectively enlarge the receptive field and incorporate multi-scale context, which also compensates for the lack of explicit modeling of global associations in the decoder, thereby further reducing the rate of misclassification. Since the bulk of the transformer blocks lie within the third stage of the encoder, the so produced feature representations are rich-enough for ASPP- decoding. Also, the spatial resolution is adequately high to not suffer significantly from the loss of information caused by downsampling. To further sharpen the results, we also adopt the feature representations from the second encoder stage for ASPP-decoding due to the relatively higher spatial resolution. Our modified version of the ASPP module is illustrated in Figure 4. First, we project the input feature representa- tions onto the initial embedding dimension, C. The projected representation is then passed through the four parallel atrous convolution branches with dilation rates r ∈ {1, 2, 4, 8}, and a kernel size of 3. Each atrous convolution is implemented as a depthwise convolution and is followed by group normalization (Wu and He, 2018) with the number H. Rajani et al.: Preprint submitted to Elsevier Page 7 of 14 Convolutional ViTs for SSS Segmentation Figure 4: Overview of the modified ASPP module. H ′ and W ′ refer to the spatial dimensions of the input. C ′ denotes the number of input channels. C denotes the initial embedding dimension. DW denotes a depthwise convolution. of groups set to 1. The feature representations from each atrous branch are then concatenated together and projected to the initial embedding dimension. This projection is preceded by a Hard Swish non-linearity (Howard et al., 2019). Finally, the aggregated representation from the two auxiliary blocks is upsampled to match the size of the initial patch embeddings. These upsampled representations are then concatenated with the previously fused representation from all four encoder stages, before predicting the final segmentation mask. 4. Experimental Setup 4.1. Dataset The datasets used in the course of this work were acquired with a Klein 3000 Side Scan Sonar during various surveys in the Balearic Sea. Approximately 52 km of coastal area was surveyed at an altitude varying from 4 to 21 meters. Four categories of sediments were identified, namely Sand Ripples, Rocks, Maerl and Fine Sediments (such as silt and mud) covering approximately 50.60 %, 13.90 %, 12.06 % and 23.44 % of the total area respectively. The raw SSS waterfalls were recorded in the eXtended Triton Format (XTF) and subsequently processed using SonarWiz for mosaicing. The mosaiced SSS waterfalls were then georeferenced and annotated by two expert geophysicists using ArcGIS. Figure 5 depicts an example of a portion of the SSS mosaic and the corresponding annotation. We further processed the raw SSS waterfalls for blind zone removal and slat range correction. The available navigation data was then used to geocode each bin of the waterfall. This allowed us to fetch the corresponding annotations from the ArcGIS interpretations and automatically generate the ground truth for the SSS waterfalls. However, since the annotations were fetched from SSS mosaics while the ground truth was being generated for SSS waterfalls, misalignments in the mosaic may result in slight pixel-wise errors in the ground truth. Moreover, the annotations were made on a much coarser resolution than the SSS waterfalls and also suffered from human error resulting in ambiguous inter-class boundaries, missing labels and skewed or misaligned annotations for certain areas. However, despite the noisy ground truth, our model is able to generalize quite well, as discussed in Section 5. The waterfalls and the corresponding ground truth were then partitioned in batches of 256 lines to generate images of size 256×256 with a 128 pixel-overlap along-track and across-track. This resulted in a total of 47,420 images, divided by an 80-20 % split to form the training and validation sets respectively. Further, another set of images, equivalent to about 5 % of the training set, was generated from a separate non-overlapping transect with similar class distribution as the training set to form a test set of 1800 additional images. The noisy ground truth of these test images was then manually corrected so as to be able to produce accurate metrics for evaluation. Figure 6 illustrates some examples of the images and the different seabed types contained in the dataset. 4.2. Training and Evaluation All our models were trained on an NVIDIA A100 Tensor Core GPU for 100 epochs with a batch size of 64. We utilized the AdamW optimizer with a weight decay of 1e−2 and learning rate of 6e−5, decayed using a polynomial learning rate scheduler with a warm-up of 3 epochs. Weighted Cross Entropy was set as the loss function. We also adopted standard data augmentation techniques such as random rotation, random resized crop, random horizontal and vertical flip, random variations in contrast and/or sharpening and Gaussian blur. The models were implemented in H. Rajani et al.: Preprint submitted to Elsevier Page 8 of 14 Convolutional ViTs for SSS Segmentation Figure 5: SSS mosaic (left) and the corresponding interpretation (right). Note that in some areas the annotations are not accurate (as marked in blue) and may also be missing for certain areas (as marked in green). Table 1 Comparison between our proposed architecture and different state-of-the-art CNNs for SSS Segmentation. Best results are indicated in red. Second best results are indicated in blue. Method mIoU (%) Parameters (M) ECNet DCNet RTSeg Ours† Ours†† Ours‡ Ours 62.68 78.02 77.75 81.24 84.65 88.58 89.54 4.67 0.09 0.74 0.08 0.26 0.97 1.91 FPS 70 260 190 525 311 188 112 Model Size (MB) 18.8 0.4 3.1 0.47 1.2 4.1 7.9 PyTorch 1.11.0 and Python 3.8.10. The source code with all hyper-parameter configurations and pre-trained models will be made available at https://github.com/hayatrajani/s3seg-vit. All trained models were then evaluated on a standard laptop equipped with an NVIDIA GeForce GTX 1650 Mobile GPU and an Intel Core i5-9300H CPU operating at 2.40 GHz running Ubuntu 20.04.5, Python 3.8.10 and PyTorch 1.9.0+cu111. We report model performance in terms of mean Intersection over Union (mIoU) and inference speed in number of images processed per second (FPS). 5. Experiments and Results 5.1. Comparisons with state-of-the-art CNNs The CNN-based frameworks RTSeg (Wang et al., 2019), ECNet (Wu et al., 2019) and DCNet (Zhao et al., 2021) were adopted as baselines for primary comparison. We use our own implementation of these architectures since the authors' code was not made publicly available. All the architectural configurations were maintained as suggested in the original publications. However, we noticed certain inconsistencies in the architectures for RTSeg and DCNet. The former had a deviation of about 0.24 M between the number of parameters computed from the description of the architecture and that reported by Wang et al. (2019). Whereas in the latter, Zhao et al. (2021) do not specify the output feature dimensions for convolutions in their DCblock. We tried to set the parameters that we considered best to replicate the architectures as closely as possible. However, the results might deviate from the original implementations of the respective authors. Table 1 presents a comparison of our proposed architecture with the above-mentioned approaches. Although our architecture has a significantly larger number of parameters than DCNet and RTSeg, the gain in mIoU is also H. Rajani et al.: Preprint submitted to Elsevier Page 9 of 14 Convolutional ViTs for SSS Segmentation (a) (b) (c) (d) (e) (f) (g) (h) (j) (k) (i) (l) Figure 6: Dataset overview: (a,b) gravel; (c) fine sediment with a chunk of rock; (d, e) rippled sand; (f) fine sediment with a strip of rippled sand; (g) fine sediment with rippled sand; (h) rocks, fine sediment and rippled sand; (i) rocks and gavel; (j, k) rocks and rippled sand; (l) rocks significantly higher. Further, given that the ping rate of our SSS is 20 per second, it takes about 12.8 s to collect 256 swaths. Since each swath has about 1024 bins per side (port and starboard) and we generate images of size 256 × 256 with a 128 pixel-overlap, the minimum processing speed required for real-time segmentation is 14 images per 12.8 s, which equates to 1.01 frames per second. This is including the bins corresponding to the water column which we however do not take into account for segmentation. Even considering the overhead for I/O operations, pre-processing and stitching the segmented images back together into a coherent waterfall, our architecture is readily suitable for real-time segmentation. In order to ensure a more fair comparison with the aforementioned approaches, Table 1 also presents the results of three variants of our proposed architecture with a significant reduction in parameters to match those of RTSeg and DCNet. These variants are indicated as Ours†, Ours†† and Ours‡. We reduce the lengths of the initial embeddings for the first two variants down to 8 and 12 respectively. We also reduce the number of attention heads down to H. Rajani et al.: Preprint submitted to Elsevier Page 10 of 14 Convolutional ViTs for SSS Segmentation Table 2 Comparison among different self-attention mechanisms for SSS Segmentation. Best results are indicated in bold. Method Swin CSWin LSDA LMHSA Wavelet SimXCA SimXCA† mIoU (%) Parameters (M) 84.94 84.95 84.96 81.31 85.33 85.97 86.23 2.35 2.12 2.12 2.15 4.37 2.10 2.14 FPS 160 146 186 176 152 204 186 Model Size (MB) 10.3 8.7 8.7 8.3 17.3 8.5 8.7 {1, 2, 4, 8} for each of their respective transformer stages. Furthermore, for the first variant, we set the number of layers in each transformer stage to {1, 1, 3, 1}, whereas for the second and third variants, we set the number of layers in each transformer stage to {1, 3, 7, 1}. All other configurations remain the same. Despite the significant reduction in parameters, our architectures perform substantially better. With this, we establish a new state-of-the-art for SSS segmentation. 5.2. Feasibility of ViTs for SSS Segmentation The secondary objective of our study is to evaluate the feasibility of ViTs for applications such as SSS segmentation, which typically lack sufficiently large datasets. We therefore draw comparisons of our modified architecture with certain notable self-attention mechanisms in the vanilla hierarchical ViT setting, as presented in Table 2. Specifically, to switch back to a vanilla hierarchical ViT, we discard all our architectural modifications and simply employ the original MLP block within each transformer layer and use 3 × 3 convolutions with a stride of 2 for patch merging. Furthermore, we adopt the decoder as proposed by Xie et al. (2021) in its original form, without our modified ASPP module. We then train different architectures by replacing the self-attention modules in each transformer layer with the self-attention mechanism proposed by Liu et al. (2021) (Swin), Dong et al. (2022) (CSWin), Wang et al. (2022a) (LSDA), Yao et al. (2022) (Wavelets block) and Guo et al. (2022) (LMHSA block). Since, the approach to self-attention proposed by Wang et al. (2022a) works by alternately applying long-distance attention and short-distance attention in different layers, it suggests the use of an even number of transformer layers for each transformer stage. Therefore, in order to ensure a fair comparison, we set the number of transformer layers L to {2, 4, 16, 2} for the four encoder stages for all flavours of attention mechanisms, unless stated otherwise. Also, we do not include positional encodings when employing the Wavelets block, the LMHSA block or SimXCA as the attention mechanism, as suggested by the respective works. All other architectural configurations remain the same. Additional hyper-parameter configurations specific to each self-attention mechanism, are as given below: • LSDA: Group size, G = 8 • SWin: Window size, M = 8 • CSWin: Stripe Width for each encoder stage, sw = {1, 2, 8, 8} • LMHSA block: Spatial reduction scale of key and value embeddings for each encoder stage, s = {8, 4, 2, 1} • Wavelet block: Spatial reduction scale of key and value embeddings for each encoder stage, s = {4, 2, 1, 1} The LMHSA block generates quite poor segmentation masks due to the loss of information that results from spatial downsampling of key and query embeddings. The Wavelet block significantly recovers this drop in quality by leveraging wavelet transforms that allow invertible downsampling. However, this approach turns out to be too parameter-heavy and also quite computationally expensive. Although with a slightly lower mIoU, the window-based self-attention mechanisms are quite efficient. The variability in their performance stems from the adopted windowing mechanism, where LSDA performs the best due to the alternating structure of local and global attention that results in self-attention H. Rajani et al.: Preprint submitted to Elsevier Page 11 of 14 Convolutional ViTs for SSS Segmentation Table 3 Ablations of our proposed architecture. Method SimXCA − MLP + Multimerge + ASSPP mIoU (%) Parameters (M) 86.23 88.18 89.28 89.54 2.14 1.98 1.90 1.91 FPS 186 136 116 112 Model Size (MB) 8.7 8.1 7.9 7.9 computation between fewer tokens than Swin or CSWin. However, window-based self-attention mechanisms are still a compromise to global self-attention. SimXCA, on the other hand, gives the best results owing to its transposed self- attention computation and absence of Softmax-based normalization. We also observed that redistributing the number of transformer layers L to {3, 6, 12, 3} for SimXCA produces slightly better segmentation masks, while keeping the total number of transformer layers the same. We indicate this as SimXCA† in Table 2. In Table 3, on the other hand, we ablate our modified architecture to present the individual performance gains from each of our architectural modifications. The top row represents SimXCA in the vanilla hierarchical ViT setting with the number of transformer layers L to {3, 6, 12, 3}. We then replace the MLP block within each transformer layer with our modified feature extraction block, denoted as "- MLP". Next, we replace the patch merging module in the resultant architecture with our proposed multiscale patch merging module, denoted as "+ Multimerge". Finally, we add the proposed ASSPP block to the decoder design, completing our modified architecture. Furthermore, Figure 7 and Figure 8 illustrate the segmentation masks generated by our modified architecture as compared to those generated by SimXCA in the hierarchical ViT setting. Despite the noisy groundtruth, our modified architecture is able to generalize quite well as depicted in the top row of the figure. Moreover, our model is also effective in representing classes such as fine sand ripples and small pebbles of rocks, which the vanilla ViT misses in most cases. 6. Conclusion and Future Work In this work we demonstrate the applicability of ViTs for semantic segmentation of the seafloor in SSS waterfalls. To the best of our knowledge, we are the first to employ ViTs for this task. Despite having a small dataset, through our modified design, we achieve results that surpass previous state-of-the-arts by a significant margin while also meeting the computational considerations for real-time implementation. However, we are still constrained by the lack of precise ground truth to supervise model training. To overcome this weak supervision, we are currently investigating Self-Supervised pre-training followed by Weakly Supervised fine-tuning on image-level labels while also leveraging our noisy ground truth as pseudo masks to regularize training. Moreover, with the help of the geophysical surveys being conducted by Tecnoambiente SL, we are in the midst of expanding our dataset with additional classes, pixel- and image-level annotations, navigation information and auxiliary metadata. We plan for an eventual release of a large-scale SSS dataset for seafloor segmentation to facilitate further research in this direction. CRediT authorship contribution statement Hayat Rajani: Conceptualization of this study, Methodology, Software, Data Curation, Writing - Original Draft. Nuno Gracias: Conceptualization of this study, Project Administration, Supervision, Writing - Review and Editing. Rafael Garcia: Conceptualization of this study, Supervision, Validation, Writing - Review and Editing. Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. H. Rajani et al.: Preprint submitted to Elsevier Page 12 of 14 Convolutional ViTs for SSS Segmentation Acknowledgements This study was supported by the DeeperSense project funded by the European Union's Horizon 2020 Research and Innovation programme under grant agreement no. 101016958. We would also like to acknowledge the contribution of Tecnoambiente SL in the dataset generation effort and are grateful for the insightful discussions with Borja Martinez- Clavel on SSS imagery. References Ali, A., Touvron, H., Caron, M., Bojanowski, P., Douze, M., Joulin, A., Laptev, I., Neverova, N., Synnaeve, G., Verbeek, J., et al., 2021. Xcit: Cross-covariance image transformers. Advances in neural information processing systems 34, 20014–20027. Ba, J.L., Kiros, J.R., Hinton, G.E., 2016. Layer normalization. arXiv preprint arXiv:1607.06450 . Badrinarayanan, V., Kendall, A., Cipolla, R., 2017. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE transactions on pattern analysis and machine intelligence 39, 2481–2495. Bousselham, W., Thibault, G., Pagano, L., Machireddy, A., Gray, J., Chang, Y.H., Song, X., 2021. Efficient self-ensemble for semantic segmentation. arXiv preprint arXiv:2111.13280 . Burguera, A., Bonin-Font, F., 2020. On-line multi-class segmentation of side-scan sonar imagery using an autonomous underwater vehicle. Journal of Marine Science and Engineering 8, 557. Cao, H., Wang, Y., Chen, J., Jiang, D., Zhang, X., Tian, Q., Wang, M., 2021. Swin-unet: Unet-like pure transformer for medical image segmentation. arXiv preprint arXiv:2105.05537 . Celik, T., Tjahjadi, T., 2011. A novel method for sidescan sonar image segmentation. IEEE Journal of Oceanic Engineering 36, 186–194. Chen, L.C., Zhu, Y., Papandreou, G., Schroff, F., Adam, H., 2018. Encoder-decoder with atrous separable convolution for semantic image segmentation, in: Proceedings of the European conference on computer vision (ECCV), pp. 801–818. D'Ascoli, S., Touvron, H., Leavitt, M.L., Morcos, A.S., Biroli, G., Sagun, L., 2021. Convit: Improving vision transformers with soft convolutional inductive biases, in: Proceedings of the 38th International Conference on Machine Learning, pp. 2286–2296. URL: https://proceedings. mlr.press/v139/d-ascoli21a.html. Dong, X., Bao, J., Chen, D., Zhang, W., Yu, N., Yuan, L., Chen, D., Guo, B., 2022. Cswin transformer: A general vision transformer backbone with cross-shaped windows, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12124–12134. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., Houlsby, N., 2021. An image is worth 16x16 words: Transformers for image recognition at scale, in: International Conference on Learning Representations. URL: https://openreview.net/forum?id=YicbFdNTTy. Guo, J., Han, K., Wu, H., Tang, Y., Chen, X., Wang, Y., Xu, C., 2022. Cmt: Convolutional neural networks meet vision transformers, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12175–12185. Han, K., Wang, Y., Tian, Q., Guo, J., Xu, C., Xu, C., 2020. Ghostnet: More features from cheap operations, in: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 1580–1589. He, K., Zhang, X., Ren, S., Sun, J., 2016. Deep residual learning for image recognition, in: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778. Howard, A., Sandler, M., Chu, G., Chen, L.C., Chen, B., Tan, M., Wang, W., Zhu, Y., Pang, R., Vasudevan, V., et al., 2019. Searching for mobilenetv3, in: Proceedings of the IEEE/CVF international conference on computer vision, pp. 1314–1324. Huang, Z., Ben, Y., Luo, G., Cheng, P., Yu, G., Fu, B., 2021. Shuffle transformer: Rethinking spatial shuffle for vision transformer. arXiv preprint arXiv:2106.03650 . Koohpayegani, S.A., Pirsiavash, H., 2022. Sima: Simple softmax-free attention for vision transformers. arXiv preprint arXiv:2206.08898 . Li, Y., Yao, T., Pan, Y., Mei, T., 2022. Contextual transformer networks for visual recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence . Lianantonakis, M., Petillot, Y.R., 2007. Sidescan sonar segmentation using texture descriptors and active contours. IEEE Journal of Oceanic Engineering 32, 744–752. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B., 2021. Swin transformer: Hierarchical vision transformer using shifted windows, in: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 10012–10022. Ma, H., Xia, X., Wang, X., Xiao, X., Li, J., Zheng, M., 2022. Mocovit: Mobile convolutional vision transformer. arXiv preprint arXiv:2205.12635 . Mehta, S., Rastegari, M., 2022. Mobilevit: Light-weight, general-purpose, and mobile-friendly vision transformer, in: International Conference on Learning Representations. URL: https://openreview.net/forum?id=vh-0sUt8HlG. Mignotte, M., Collet, C., Pérez, P., Bouthemy, P., 1999. Three-class markovian segmentation of high-resolution sonar images. Computer Vision and Image Understanding 76, 191–204. Mignotte, M., Collet, C., Perez, P., Bouthemy, P., 2000. Sonar image segmentation using an unsupervised hierarchical mrf model. IEEE transactions on image processing 9, 1216–1231. Ren, S., Zhou, D., He, S., Feng, J., Wang, X., 2022. Shunted self-attention via multi-scale token aggregation, in: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10853–10862. Ronneberger, O., Fischer, P., Brox, T., 2015. U-net: Convolutional networks for biomedical image segmentation, in: International Conference on Medical image computing and computer-assisted intervention, Springer. pp. 234–241. Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.C., 2018. Mobilenetv2: Inverted residuals and linear bottlenecks, in: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. Si, C., Yu, W., Zhou, P., Zhou, Y., Wang, X., Yan, S., 2022. Inception transformer. arXiv preprint arXiv:2205.12956 . H. Rajani et al.: Preprint submitted to Elsevier Page 13 of 14 Convolutional ViTs for SSS Segmentation Srinivas, A., Lin, T.Y., Parmar, N., Shlens, J., Abbeel, P., Vaswani, A., 2021. Bottleneck transformers for visual recognition, in: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16519–16529. Strudel, R., Garcia, R., Laptev, I., Schmid, C., 2021. Segmenter: Transformer for semantic segmentation, in: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 7262–7272. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., Wojna, Z., 2016. Rethinking the inception architecture for computer vision, in: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2818–2826. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł., Polosukhin, I., 2017. Attention is all you need. Advances in neural information processing systems 30. Wang, Q., Wu, M., Yu, F., Feng, C., Li, K., Zhu, Y., Rigall, E., He, B., 2019. Rt-seg: A real-time semantic segmentation network for side-scan sonar images. Sensors 19, 1985. Wang, W., Xie, E., Li, X., Fan, D.P., Song, K., Liang, D., Lu, T., Luo, P., Shao, L., 2021. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions, in: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 568–578. Wang, W., Yao, L., Chen, L., Lin, B., Cai, D., He, X., Liu, W., 2022a. Crossformer: A versatile vision transformer hinging on cross-scale attention, in: International Conference on Learning Representations. URL: https://openreview.net/forum?id=_PHymLIxuI. Wang, Z., Zhang, S., Gross, L., Zhang, C., Wang, B., 2022b. Fused adaptive receptive field mechanism and dynamic multiscale dilated convolution for side-scan sonar image segmentation. IEEE Transactions on Geoscience and Remote Sensing 60, 1–17. Wu, H., Xiao, B., Codella, N., Liu, M., Dai, X., Yuan, L., Zhang, L., 2021. Cvt: Introducing convolutions to vision transformers, in: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 22–31. Wu, M., Wang, Q., Rigall, E., Li, K., Zhu, W., He, B., Yan, T., 2019. Ecnet: Efficient convolutional networks for side scan sonar image segmentation. Sensors 19, 2009. Wu, S., Wu, T., Tan, H., Guo, G., 2022. Pale transformer: A general vision transformer backbone with pale-shaped attention, in: Proceedings of the AAAI Conference on Artificial Intelligence, pp. 2731–2739. Wu, Y., He, K., 2018. Group normalization, in: Proceedings of the European conference on computer vision (ECCV), pp. 3–19. Xie, E., Wang, W., Yu, Z., Anandkumar, A., Alvarez, J.M., Luo, P., 2021. Segformer: Simple and efficient design for semantic segmentation with transformers, in: Advances in Neural Information Processing Systems, pp. 12077–12090. URL: https://proceedings.neurips.cc/ paper/2021/file/64f1f27bf1b4ec22924fd0acb550c235-Paper.pdf. Yao, K., Mignotte, M., Collet, C., Galerne, P., Burel, G., 2000. Unsupervised segmentation using a self-organizing map and a noise model estimation in sonar imagery. Pattern Recognition 33, 1575–1584. Yao, T., Pan, Y., Li, Y., Ngo, C.W., Mei, T., 2022. Wave-vit: Unifying wavelet and transformers for visual representation learning, in: European Conference on Computer Vision, Springer. pp. 328–345. Yu, F., He, B., Li, K., Yan, T., Shen, Y., Wang, Q., Wu, M., 2021. Side-scan sonar images segmentation for auv with recurrent residual convolutional neural network module and self-guidance module. Applied Ocean Research 113, 102608. Yu, F., He, B., Liu, J., Wang, Q., 2022. Dual-branch framework: Auv-based target recognition method for marine survey. Engineering Applications of Artificial Intelligence 115, 105291. Zhang, Q., Xu, Y., Zhang, J., Tao, D., 2022. Vitaev2: Vision transformer advanced by exploring inductive bias for image recognition and beyond. arXiv preprint arXiv:2202.10108 . Zhao, X., Qin, R., Zhang, Q., Yu, F., Wang, Q., He, B., 2021. Dcnet: Dilated convolutional neural networks for side-scan sonar image semantic segmentation. Journal of Ocean University of China 20, 1089–1096. H. Rajani et al.: Preprint submitted to Elsevier Page 14 of 14 Convolutional ViTs for SSS Segmentation Input Ground Truth (noisy) Vanilla Ours Figure 7: Visualization of segmentation masks. H. Rajani et al.: Preprint submitted to Elsevier Page 15 of 14 Convolutional ViTs for SSS Segmentation Input Ground Truth (noisy) Vanilla Ours Figure 8: Visualization of segmentation masks (continued). H. Rajani et al.: Preprint submitted to Elsevier Page 16 of 14
http://arxiv.org/abs/2302.12407v1
2023-02-24T02:15:42
2023-02-24T02:15:42
HyperAttack: Multi-Gradient-Guided White-box Adversarial Structure Attack of Hypergraph Neural Networks
Hypergraph neural networks (HGNN) have shown superior performance in various deep learning tasks, leveraging the high-order representation ability to formulate complex correlations among data by connecting two or more nodes through hyperedge modeling. Despite the well-studied adversarial attacks on Graph Neural Networks (GNN), there is few study on adversarial attacks against HGNN, which leads to a threat to the safety of HGNN applications. In this paper, we introduce HyperAttack, the first white-box adversarial attack framework against hypergraph neural networks. HyperAttack conducts a white-box structure attack by perturbing hyperedge link status towards the target node with the guidance of both gradients and integrated gradients. We evaluate HyperAttack on the widely-used Cora and PubMed datasets and three hypergraph neural networks with typical hypergraph modeling techniques. Compared to state-of-the-art white-box structural attack methods for GNN, HyperAttack achieves a 10-20X improvement in time efficiency while also increasing attack success rates by 1.3%-3.7%. The results show that HyperAttack can achieve efficient adversarial attacks that balance effectiveness and time costs.
[ "Chao Hu", "Ruishi Yu", "Binqi Zeng", "Yu Zhan", "Ying Fu", "Quan Zhang", "Rongkai Liu", "Heyuan Shi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12407v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12407v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.CR" ]
3 2 0 2 b e F 4 2 ] G L . s c [ 1 v 7 0 4 2 1 . 2 0 3 2 : v i X r a HyperAttack: Multi-Gradient-Guided White-box Adversarial Structure Attack of Hypergraph Neural Networks Chao Hu Central South University Hunan, China Yu Zhan Central South University Hunan, China Ruishi Yu Central South University Hunan, China Ying Fu National University of Defence Technology Hunan, China Binqi Zeng Central South University Hunan, China Quan Zhang Tsinghua University Beijing, China Rongkai Liu Central South University Hunan, China Heyuan Shi∗ Central South University Hunan, China ABSTRACT Hypergraph neural networks (HGNN) have shown superior per- formance in various deep learning tasks, leveraging the high-order representation ability to formulate complex correlations among data by connecting two or more nodes through hyperedge model- ing. Despite the well-studied adversarial attacks on Graph Neural Networks (GNN), there is few study on adversarial attacks against HGNN, which leads to a threat to the safety of HGNN applications. In this paper, we introduce HyperAttack, the first white-box ad- versarial attack framework against hypergraph neural networks. HyperAttack conducts a white-box structure attack by perturbing hyperedge link status towards the target node with the guidance of both gradients and integrated gradients. We evaluate Hyper- Attack on the widely-used Cora and PubMed datasets and three hypergraph neural networks with typical hypergraph modeling techniques. Compared to state-of-the-art white-box structural at- tack methods for GNN, HyperAttack achieves a 10–20X improve- ment in time efficiency while also increasing attack success rates by 1.3%-3.7%. The results show that HyperAttack can achieve efficient adversarial attacks that balance effectiveness and time costs. KEYWORDS Adversarial attack, hypergraph neural network, white-box testing 1 INTRODUCTION As a unique non-Euclidean data structure for machine learning, graph modeling and hypergraph modeling are widely used to for- mulate the relationships between data, and graph neural networks (GNN) and hypergraph neural networks (HGNNs) are designed to derive knowledge embedding and learn the low-dimensional repre- sentation of nodes and links in many deep learning tasks. Various types of GNN have been proposed, e.g., GraphSAGE [13], Graph Convolutional Networks (GCN) [20] and Graph Attention Net- work (GAT) [37], for many graph-based analysis tasks, such as link prediction [27, 39], node classification [34, 40], community detec- tion [2, 35], and social network analysis [21]. Though the network structure of GNNs is different, they all aggregate information based ∗Corresponding author on graph modeling, where one edge can only have two nodes in a graph. Hypergraph Neural Networks (HGNNs) have become a hot topic in recent years, and various HGNNs have been proposed, such as HyperGCN [44], HGNN+ [8] and Dynamic Hypergraph Neural Networks (DHGNN) [17]. HGNNs take advantage of the stronger relational representation ability of hypergraph modeling, i.e., one hyperedge can connect two or more number of nodes, which is more practical to formulate the numerous complex relationships in the real-world scenario, compared to the graph. A number of studies have shown that HGNNs outperform GNNs in many deep learn- ing tasks, such as graph visualization [15, 46], bio-informatics and medical image analysis [10, 36] and recommendation system [6]. However, there is little research on adversarial attacks against HGNNs, although similar work on GNNs has been extensively studied. GNNs are easily fooled by malicious adver- sarial examples (AEs) and output incorrect results [33]. Recent stud- ies show that HGNNs outperform GNNs in many deep-learning tasks, but they neglect the safety of HGNNs. Moreover, the ef- ficiency of adversarial attacks is severely limited though ex- isting adversarial attack methods of GNNs can be adapted to HGNNs. For example, when we exploit the integrated gradi- ent [42], which is used for structure attack on GNN, the time cost of a successful attack on a single node is 40 seconds on average (more detail of our motivation is given in Section 2). Since the Cora dataset has 2000 nodes in the hypergraph, the time cost of attacking all the hypergraph nodes is unacceptable. Even worse, The prob- lem of limited attack performance is more severe for hypergraphs built on real-world data that have more nodes on them . Therefore, despite the superior performance of HGNN, it is still challenging to guarantee its safety. In this paper, we propose the first adversarial attack framework against HGNNs, called HyperAttack, which focuses on white-box structure attacks against HGNNs. The goal of HyperAttack is to mislead HGNN and output incorrect node classification results by modifying the hypergraph structure. For each attacked node in the hypergraph, HyperAttack disturbs the connectivity state of its hyperedges, i.e., adds or removes certain hyperedges of the target node. The perturbation priority of hyperedges is determined by the guidance of calculated gradients and integrated gradients to ISSTA 2023, 17-21 July, 2023, Seattle, USA xxx et al. improve attack efficiency. To evaluate the efficiency and effective- ness of HyperAttack, we first consider three different approaches to generating hypergraphs and pre-training HGNN models using pop- ular datasets, i.e., Cora and PubMed, respectively. We then perform white-box structure attacks on these HGNN models and evaluate the performance of the attacks. Compared to white-box structural attack methods for GNNs, which use the fast-gradient algorithm (FGA) [4] and the integrated-gradient algorithm (IGA) [42], Hy- perAttack achieves a 10–13X improvement in time efficiency for successful attacks while also increasing attack success rates by 1.3%-1.7%. Our main contributions are: • We present HyperAttack, a framework for white-box struc- tural attacks designed for hypergraph neural networks. To the best of our knowledge, this is the first work on adversar- ial attacks against HGNNs. • We clarify the differences between GNN and HGNN struc- ture attacks, analyze the difficulties of simply applying GNN structure attack methods to HGNNs, and present the main challenges of HGNN structure attacks. • We propose a multi-gradient guided hyperedge selection al- gorithm to determine hyperedge perturbation priorities, and the experimental results demonstrate that the method can improve the performance of structure attacks for HGNNs. 2 BACKGROUND AND MOTIVATION In this section, we first briefly introduce the network structures of GNN and HGNN. Then, we show the existing structure attack methods of GNN and clarify the difficulties of applying them to HGNNs. Finally, we conclude the main challenges of HGNN struc- ture attacks. 2.1 Structure of GNN and HGNN Though Graph Neural Networks (GNN) and Hypergraph Neural Networks (HGNN) are designed to derive knowledge embedding by aggregating the relationship among data, their network structure and required inputs are different. We first introduce the structure of GNN and HGNN, respectively. Then, we introduce the main difference between GNN and HGNN applications. GNN and graph modeling. All GNNs use data features and relationships between data as inputs, and the relationships are formulated by graph modeling. The graph modeling is introduced as follows. Given a graph as G = (V, E), where V is the nodes sets and E is the edges sets. X ∈ R |V |×|D | is the feature of each node. D represents the dimension of the node feature. A ∈ R |V |×|V | is the adjacency matrix, which represents the relationship between each node. If the pair of nodes vi and vj are connected, we set the corresponding element Aij in A to 1, otherwise set it to 0. After we model the graph structure by using the node feature matrix X and the adjacency matrix A, we input X and A into the propagation module [20], and each layer can be formulated as follows: X l+1 = σ ( (cid:101)D−1/2 ̃(A) (cid:101)D−1/2HlW l ) where X l and X l+1 represent the input and the output of the layer, respectively. W is the weight matrix of the l − th layer, σ indicates the nonlinear activation function. ̃(A) represents the adjacency (1) Figure 1: Schematic representation of the difference be- tween GNN and HGNN. matrix with self connection, and widetildeD is the degree matrix of the self connected matrix. The aggregated information can be captured through the convo- lution operator to propagate information between nodes. HGNN and hypergraph modeling. Hypergraph is a kind of graph type with more complex modeling. It could provide more information on nodes and their connections via a hyperedge. Generally, the HGNN model can be divided into hypergraph modeling and hypergraph learning [11]. Here, we introduce the hypergraph modeling and lay the relevant contents of hypergraph learning later in Section 7. A hypergraph can be denoted as G, which consists of a set of nodes V and a set of hyperedges E. We concatenate the hyperedge groups to generate the incidence matrix H ∈ R |V |× ∥ E |, which rep- resents the relationship between each node and hyperedges. Each entry H (⊑, ⌉) indicates whether the node ⊑ is in the hyperedge ⌉. Hve = (cid:26)1, 0, i f i f v ∈ e, v ∉ e. (2) After constructing the hypergraph, H and the node feature matrix X are fed into the pre-trained HGNN to predict the labels for the unlabelled nodes. Hyperedge convolution [7] can be formulated as follows: v X (l) Θ(l) )) e HT D−1/2 X l+1 = σ (D−1/2 v HW D−1 (3) where X (l) is the signal of hypergraph at l layer, W represents the weight of each hyperedge, and De, Dv represent the diagonal matrices of the hyperedge degrees and the node degrees, respec- tively. H T represents the transposed matrix of H , X (0) = X and σ () denotes the nonlinear activation function, and Θrepresents the parameter to be learned during the training process. Main differences between HGNN and GNN. Figure 1 de- scribes the schematic representation of getting the classification results through GNN and HGNN. As shown in the figure, the GNN and HGNN include two main stages: graph modeling and graph learning. In the upper part of the figure, GNN keeps the pairwise relevance of nodes from the original graph data into the adjacency matrix A. In the lower part, HGNN keeps the relationship of nodes and hyperedges and constructs the incidence matrix H , which in- volves an uncertain number of hyperedges connecting the nodes of the same class. Together with the feature matrix X , both A and H make up the input of the forward propagation in graph and hyper- graph learning stages, respectively. The classification performance v1:[4]v2:[0]v3:[0]v4:[2]v5:[3]v6:[1]E2E3v2v1v3v4v5E1E4v6v2v1v3v4v5v6v1:[4]v2:[0]v3:[0]v4:[2]v5:[3]v6:[1]v1v5v4v2v3v6Hypergraph ModelingGraph ModelingData Feature & RelationshipFeature XAdjacent Matrix AIncidence Matrix HGraphHypergraphModel OutputsYGNN (GCN)=(,)HGNN=(,)__ HyperAttack: Multi-Gradient-Guided White-box Adversarial Structure Attack of Hypergraph Neural Networks ISSTA 2023, 17-21 July, 2023, Seattle, USA can be determined by comparing the output with the real node label. There is a huge difference in terms of dimension and the internal correlation meaning. To be specific, H concentrates on which nodes should be included in each hyperedge, while A focuses on the node relationships. We believe that a major difference between HGNN and GNN remains in the graph modeling process with the different construction strategies between the adjacency matrix and the incidence matrix. 2.2 Structure Attack of GNN and HGNN Although both structure attacks are used to mislead the model by changing the edge connectivity relationships, the difference in relationship modeling, network structure, and inputs between GNN and HGNN lead to differences in the idea of structure attacks on the two models. Here, we introduce the structure attack of GNN and HGNN, respectively. Then, we analyze the difference between structure Attacks on GNN and HGNN and the Difficulties of Applying GNNs Structure Attack Methods to HGNNs. Structure Attack of GNN. One of the most common strategies of the GNN structure attack is deleting or adding specific edges on the original graph. It is a key problem to know which edges have the greatest impact on the classification ability of the target model. In white-box settings, gradient information is often used as the basis for judging the priority of each edge. For example, some works use gradients as indicators. They select the pair of nodes with maximum absolute gradient [4] or reflect a better effect on perturbing certain edges indicated from the integrated gradient [42]. Some other works, such as [30, 31], attempt to inject fake nodes and link them with some benign nodes in the original graph, which increases the classification error rate without changing the primary structure between existing nodes. However, they focus too much attention on the attack success rate, which has the potential to be time-consuming. Structure Attack of HGNN. In view of the inherent attribute of preserving the data relevance of hypergraphs, we can still learn from existing attack methods to address structure disturbance. One of the simplest strategies is to randomly perturb the inherent struc- ture of the hypergraph. For example, inspired by [41], we ran- domly connect nodes with different labels with newly generated hyperedges, or discard specific existing hyperedges between nodes sharing the same label. Besides, using gradients as information to guide structure attacks can produce more effective changes on a hypergraph. We can use two typical algorithms, Fast Gradient Sign Method (FGSM) [12] and Jacobian-based Saliency Map Approach (JSMA) [26], which shows the success for image data and be studied firstly by [42] for graph models. Difficulties of Applying GNNs Structure Attack Methods to HGNNs. • The structure attack on HGNN is realized by modifying the internal information of the incidence matrix. Different from modifying the adjacency matrix of GNN, this unique modification is currently in the blank, which brings the first difficulty. Figure 2: Difference of structure attack against hypergraph and graph. (a) Given a node set (v1, ...v6), we attack the target node v2 in the pre-trained GNN and HGNN models. (b) In the upper part, by adding a specific edge connecting the target node v2 with v1, the adjacency matrix structure is modified. The attack ends when the classification of target node v2 changes. (c) In the lower part, we modify the relationship be- tween v2 and the hyperedge E1 in H , which means we have added the target node to a new hyperedge. At last, we input the modified H into the forward propagation of HGNN to judge the classification of the target node. • Because the construction of HGNN is more complex in pre- serving data correlations compared with GNN, directly mi- grating existing graph attack methods has been proven in experiments for causing unsatisfactory performance, espe- cially in terms of time complexity. Through some direct migration experiments (e.g., integrated- gradient-based attack [42]). For example, it takes 40 seconds at least to fully implement the attack on one single target node When we set 2 ∗ Tesla V100S GPU as our computation resources. Imagine the implementation against the entire dataset (e.g., the Cora dataset contains 2708 scientific publications as nodes), the time cost will be more than 30 hours. Worse still, this is only the cost when we assume that all the attacks succeed. Nevertheless, in the case of worse computing resources, the time burden will be more serious. As a result, a large gap between the increasing-mature GNN testing and deficient HGNN testing methods still exists. 2.3 Challenges of HGNN structure attacks Based on the clarified difference between HGNN and GNN, as well as the difficulties of Applying GNNs Structure, we introduce the main challenges of HGNN structure attacks. Lack of modification on hypergraph structure. Compared with graphs, the dimension of hypergraph structure is even larger in many cases. The dimension is directly proportional to the com- plexity in the face of some complex origin data, such as multi-modal data or data with a high-order association. It will spend more over- head to obtain the internal information and address structure attack on the HGNN rather than GNN. For example, when determining a specific node, traversing and computing on the incidence matrix H may cause more burden, which leads to the existing methods of modifying the structure matrix can not be well applied. The modi- fication of the hypergraph structure still lacks practice strategies. Balance between attack success rate and time consump- tion. A superior attack algorithm should balance the time cost and Structure Attack on graphE4E2E3v2v1v3v4v5E1v6v2v1v3v4v5v6Structure Attackon hypergraphTargetnodev1v5v4v2v3v6Data Feature & Relationship(∗,)NoNoYesv2v1v3v4v5v6Add edgeE2E3v2v1v3v4v5E1v6Adjacency Matrix AHypergraph ModificationAdd hyperedgev2(∗,)IncorrectLabel?IncorrectLabel?Yesv1:[4]v2:[1]v3:[0]v4:[2]v5:[3]v6:[1]v1:[4]v2:[1]v3:[0]v4:[2]v5:[3]v6:[1]__Graph ModificationIncidence Matrix HHypergraphmodelingGraphmodeling ISSTA 2023, 17-21 July, 2023, Seattle, USA xxx et al. Table 1: Notation And Definition Symbol G = (V , E ) G = (V, E) G∗ Dv De W A H X D ̄H F Yl vt M N H∗ γ η Definition input graph G with nodes V and edges E input hypergraph G with nodes V and hyperedges E output hypergraph G∗ the diagonal matrices of the node degrees the diagonal matrices of the edge degrees the diagonal matrix of the hyperedge weights the adjacency matrix of GNN the incidence matrix of HGNN the node feature matrix the dimension of the node feature the convolved signal matrix of H the forward propagation output of the HGNN the real label confidence list the target node the size of fast-gradient-based hyperedge filter the size of integrated-gradient-based hyperedge selection modified incidence matrix number of disturbance limit of ASR number of disturbance limit of AML elements in H have the maximum impact on the classification re- sults after being attacked. We further clarify our attack actions as deleting (or adding) the target node on the selected hyperedges, which modifies the incidence matrix H indeed. As a highly di- rectional attack, modifying the relevant relationship of the target node has little tiny impact on other nodes. This makes HyperAttack only change the classification ability of the target node, which well shortens the attacking burden on a small budget. It is worth mentioning that we abandon another attack action in the experiment: creating a new hyperedge with the target node. Because the newly created hyperedge will change the dimension of the original matrix H , which may be a huge burden to HyperAttack. Worse still, other nodes placed in the new hyperedge will also bring potential damages to the global classification ability of hypergraph. 4 METHODOLOGY In this section, we introduce the framework and algorithm of Hy- perAttack. For convenience, we briefly summarize some important symbols and corresponding definitions in table1 1. attack success rate. However, graph attack algorithms in the past paid too much attention to the attack success rate in a long term. In the premise of a successful attack, reducing the running time of generating adversarial samples should not be ignored. Therefore, it is another challenge for us to realize HyperAttack with both a high attack success rate and low time cost. 3 THREAT MODEL The goal of our structure attack is to reduce the classification abil- ity of the target node. We expect to attack the target node of a hypergraph by changing the structure within the threshold of a constraint. In this section, we clarify the structure attack scenario of HyperAttack by introducing the setting target model, target objects, and specific attack actions. 3.1 Target Model We consider a two-layer HGNN model [7] which is a general frame- work for hypergraph representation learning as our target model. Based on Section 2, the description of the target model can be stated as: Given G = (H, X ) with a set of labeled nodes vt where Yl is the ground truth of each node. H and X represent the incidence matrix and node feature matrix, respectively. Our target model focuses on the node classification task to categorize nodes without labels into different classes by using a large number of labeled nodes. After the training process as mentioned in Eq 4, the target model can complete the semi-supervised learning task and predict the classification result. We set the target node as vt , and attack vt . In the classification results, the target model will be misled only when facing the target node. 3.2 Structure Attack Objectives Because the HGNN model first constructs hypergraph from original data, the strategies of generating hypergraph directly affect both the quality of the prediction ability and the stability under adversarial attack. The hypergraph generation methods vary a lot and we introduce the details in Section 7. Here, we consider the incidence matrix of the hypergraph as the objective in our structure attack and introduce three classic strategies to verify the different results of different construction strategies under the same attack algorithm. Based on K nearest neighbors (KNN) methods, we follow [15] and construct hyperedges by connecting each node with their near- est K nodes, called Hypergraph_KNN. Based on ε-ball, we use another distance-based method to construct hyperedges by con- necting nodes whose distances are less than the preset threshold, called Hypergraph_ε. Based on the L1 reconstruction method, we followed [38] to generate each hyperedge via modeling the re- lationship between nodes through feature reconstruction, called Hypergraph_L1. We also show the different robustness of the above three modeling strategies under attacks in Section 7. 3.3 Structure Attack Operations In this subsection, in order to make our experiments more inter- pretable, we introduce some attack actions behind the implementa- tion of our proposed structure attack. Our goal is to find out which Figure 3: The framework of HyperAttack. 4.1 Overview As shown in Figure 3, there are three main parts in HyperAttack, the Fast-Gradient based algorithm part, the Integrated-Gradient HyperAttack: Multi-Gradient-Guided White-box Adversarial Structure Attack of Hypergraph Neural Networks ISSTA 2023, 17-21 July, 2023, Seattle, USA based algorithm part, and the modified hypergraph part, out of which the selection process is made up of the first two parts, and the modification process is the third part. In comprehensive consideration of the factors with the lowest time cost and high attack success rate, HyperAttack is well-designed through a fast-gradient-based hyperedge filter using gradients and integrated-gradient-based hyperedge selection using integrated gradients. Both gradients and integrated gradients are the indicators to evaluate the priority of each hyperedge to the target node. To be specific, we first obtain the gradient of the whole H by calculating a designed loss function. Then we keep the hyperedges with the maximum absolute value of gradient as the result of a fast-gradient-based hyperedge filter. Secondly, by further setting another loss function, the integrated gradients of each hyperedge from the fast-gradient-based hyperedge filter are obtained. The hyperedges with maximum value will be selected as the result of fine-grained screening. In the third step, we regard the hyperedges from fine-grained screening as the final selection. We remove or add the target node on these hyperedges via modifying the incidence matrix H . The details are as follows. 4.2 Fast-gradient-based hyperedge filter As mentioned in the target model, we use a two-layer HGNN model [7] for the node classification task with an incidence matrix H and a node feature matrix X as the input of the forward propaga- tion. As mentioned in Eq 4, we use H as the variable of the output prediction F (H ). The HGNN model forward propagation obtains the output F of the last layer, which can be simply described as F = f orward (H, X ) and its simple form are as followed: F (H ) = f ( (cid:0) ̄Hσ (cid:0) ̄HXW′ (4) where ̄H is formulated as shown in Eq 5. W0 and W1 are the input- to-hidden and hidden-to-output weight matrices,respectively. f represents the so f tmax function and σ is the Relu active function. It should be noted that H is the only variable of forward propaga- tion. HyperAttack does not add disturbance on X , thus X remains unchangeable and can be regarded as a constant as the same as W0 and W∞. (cid:1) W∞ (cid:1) ̄H = D−1/2 v HW D−1 e HT D−1/2 v (5) We take the difference between the output prediction F and the real result Yl and use a simple cross-entropy to express the dis- crepancy. Aiming at the target node vt , we formulate our designed function Lt as: Lt = − | E |−1 ∑︁ k=0 Yltkln (Ftk (H )) (6) We calculate the partial derivatives in Eq 6 with respect to H and get gtk as the kth gradient of the target node ⊑⊔ ∥. gtk = ∂Ltk ∂Htk (7) We set a hyper parameter M (0 < M < |E|). The hyperedges within top-M largest gradients will be recorded as the results of the Fast-gradient-based hyperedge filter. The pseudo-code for the fast- gradient-based hyperedge filter is given in lines 3 to 4 of Algorithm 1. 4.3 Integrated-gradient-based hyperedge selection The results of preliminary filtering using fast gradient-based meth- ods have been saved. Limited by the number of perturbations, we are inspired by [32, 42] and we choose the integrated gradient-based method to realize hyperedges selection. The integrated gradients- based method combines direct gradient and back-propagation- based approaches. Let x be the input value and x ′ be the base- line value. The function mapping is expressed as F . The Integrated gradient of the ith input can be expressed as follows: IntergratedGradsi (x) ::= (cid:16) xi − x ′ i (cid:17) × ∂F (cid:16) x ′ + α × (cid:16) xi − x ′ i (cid:17) (cid:17) ∫ 1 α=0 ∂xi dα (8) Since the gradient of all points on the whole path is considered, it is no longer limited by the gradient of a specific point. For target node vt ,we set the matrix H ′ r to all-zero matrix respectively. The matrix H ′ r represent the target note vt with all hyperedges connected and fully unconnected, respectively. a to all-one and the matrix H ′ a and matrix H ′ H ′ = (cid:40)H ′ a : H [t] [i] = 1, 0 ≤ i < |E| H ′ r : H [t] [i] = 0, 0 ≤ i < |E| (9) For target node vt , when there is no connection between the target node vt and the hyperedge i, we set the H ′ a matrix as a baseline since we want to describe the overall change pattern of the target function F while gradually disconnect the target node vt from the hyperedges to the current state of H . On the contrary, when the target node vt is already connected to the hyperedge i, we use the H ′ r matrix as a baseline to calculate the changing pattern by gradually adding the connection between vt and the hyperedges. IG (F (H, t)) [t, i] = (Hti − 0) × (cid:0)H − Hi r (cid:16) r + k H ′ m ∂Hti ∂F m ∑︁ k=1 (1 − Hti ) × ∂F m ∑︁ k=1 (cid:16) H ′ a − H (cid:16) a − k H ′ m ∂Hti    (cid:1) (cid:17) (cid:17)(cid:17) × 1 m × 1 m , H [t] [ß] ≠ 0, , H [t] [ß] = 0. (10) Lines 5 to 11 of Algorithm 1 show the pseudo-code for the Integrated-gradient-based hyperedge selection of HyperAttack. We calculate the integrated gradient of the hyperedges and then save N hyperedges with the largest gradient, where N is the size of perturbations. 4.4 Matrix-modified operation The result of HyperAttack is an adversarial hypergraph network with a modified matrix H ∗ which can ensure the original HGNN model produces the wrong classification for the target node in forward propagation. In consideration of the notion of 'unnoticeable changes' in hypergraph, we set a strict upper limit on the number of perturbations. We use the selected index of the hyperedges from the ISSTA 2023, 17-21 July, 2023, Seattle, USA xxx et al. Figure 4: The flowchart of HyperAttack. fine-grained screening to modify the links of the original incidence matrix H which is defined as: H ∗ = H + θ (gi) , where θ (gi ) represent the sign of adding/removing the ithrelationship of the target node and links. The overall HyperAttack algorithm is summarized by Algorithm 1. (11) 5 EVALUATION 5.1 Evaluation Design 5.1.1 Research questions. We conduct experiments and try to an- swer the questions as follows. RQ1. How is the performance of HyperAttack in attack success rate compared to other state-of-the-art methods? In this RQ, we compare the attack success rate of HyperAttack with some state-of-the-art attack methods on graph. We wonder whether these graph attack methods can be adopted on HGNN with a high attack success rate. RQ2. How is the performance of HyperAttack in time cost when completing a successful attack compared to other state- of-the-art methods? In this RQ, we wonder about the efficiency of HyperAttack and the others. We use running time to record the time consumption required for a successful attack using Hyper- Attack and other methods. We consider the attack method which has higher efficiency and is able to spend less running time while achieving the same attack effect. RQ3. How does the classification margin perform under HyperAttack compared to other state-of-the-art methods? In this RQ, we calculate the classification margin for all methods and analyze the characteristics of HyperAttack. Algorithm 1: Multi-Gradient-Guided Structure Attack of HGNN Input: Original incidence matrix H , number of coarse-grained screening M, the maximum number of perturbations N , target node vt ; Output: Modified incidence matrix H ∗; 1 Initialize κ = 0, i = 0; 2 Train the HGNN model on the original network H . 3 // Obtain the gradient of the whole H via Eq 6, Eq 7 . 4 coarse-grained screening ← Index of the top-M hyperedges with the largest gradient; 5 while κ < M do 6 //Obtain the κth hyperedges as the coarse-grained screening. i ← coarse-grained screening[κ]; // Obtain the integrated gradient of the hyperedge i via Eq 9. gi ← IG [vt , i]; κ + +; 7 8 9 10 11 end 12 fine-grained screening ← Select the Index of the N hyperedges with the the largest integrated gradient 13 // Modify the matrix H according to the fine-grained screening. 14 H ∗ ← H + θ (gi ); 15 return H ∗; 5.1.2 Evaluation environment. Our experimental environment con- sists of 2∗Intel(R) Xeon Gold 6248 CPU @2.50GHz×40, 2∗Tesla V100S GPU, 384 memory, and CentOS 7. The max number of per- turbations N is 10. We use three different hypergraph generation approaches to formulate the data correlation from the original data, which consists of the K-Nearest Neighbor-based (KNN) method, ε-ball-based method, and l1-hypergraph-based method. The reason for using different hypergraph modeling is that the sensitivity of HyperAttack: Multi-Gradient-Guided White-box Adversarial Structure Attack of Hypergraph Neural Networks ISSTA 2023, 17-21 July, 2023, Seattle, USA HGNNs to adversarial attacks is different, and the robustness of the attack performance needs to be evaluated. 5.1.3 Evaluation metrics. As we mentioned in Section 2, we stated that a successful structure attack must have two key characteristics: (1) achieving the desired attack performance; (2) balancing the attack time consumption. Therefore, we use the Attack Success Rate (ASR) and Average Number of Modified Links (AML) to evaluate structure attack performance. Then, Running Time (RT) is used to evaluate the time cost of the structure attack. • Attack Success Rate (ASR). Given a hyper-parameter γ (0 < γ ≤ 10). Each target node changes no more than γ links. ASR represents the success rate of each target node under a certain number of attacks. The formal expression is as follows: ASR = Success f ulattacks Allattacks (12) • Average Number of Modified Links (AML). AML calculates the average counts of modifying links for a successful attack. η is used to represent the upper bound of the number of per- turbations. AML describes the average number of modified links the attacker needed to meet the attack objective: AML = Modi f iedlinks Allattacks (13) • Running Time(RT). RT records the time consumption re- quired for each successful attack. It takes the original matrix H input as the starting time, and the modified matrix H ∗ after the successful attack as the ending time, we formulate it as follows: RT = Timeend − Timestart (14) 5.1.4 Parameter settings. We give some parameter settings here which will be used in the experiment. γ: We set the limit number of ASR γ to 10 in our experiments, which means the successful attack should be limited to 10 perturbation times, otherwise the attack is considered failed. In the experiment of calculating the running time, γ is set to increase continuously from 1 to 10. η: We set the upper bound of the number of perturbations η to 10 in our experiments. We only consider the successful attack in 10 times and calculate the average number of perturbations. K: KNN is a traditional method of constructing hyperedges. In the experiment part, we fixed the value of k as 10, which means each hyperedge will contain 10 nodes. In addition, we conduct experiments to verify how K affects the robustness of HGNN in the Discussion part. 5.1.5 Datasets. The target models in our experiments are focused on the node classification task. The node classification task is a semi-supervised learning task that aims to accurately predict the category of each node. We have selected two widely-used datasets and some basic statistics for these datasets are provided below. • Cora: The Cora dataset consists of 2708 scientific publica- tions classified into one of seven classes. The citation net- work consists of 5429 links, which represent the citation relationships. • PubMed: The PubMed dataset consists of 19717 scientific publications from the PubMed database pertaining to dia- betes classified into one of three classes. The citation network contains 88676 links, which represent the citation relation- ships. 5.1.6 Compared Methods. Here, we compare HyperAttack with five baseline methods. In general, we divide the five existing baseline methods into two categories: random-based attack methods and gradient-based attack methods. We briefly describe them as follows. Random-based Attack. In view of the fact that the robustness of graph and hypergraph lack of stability mechanism, the classifica- tion performance of the target node will be influenced to a certain extent when the inherent attribute of the structure are changed via random-based methods (i.e. connect or disconnect edges via modifying original incidence matrix). In our work, we introduce three random-based methods, including Random Delete (RanD), Random Modified (RanA), and Disconnect Internally, Connect Ex- ternally (DiceA) [41]. Particularly, given c and C as the actual disturbance times and the maximum limit of disturbance times, RanD randomly selects c (c < C) hyperedges from the hyperedges connected to the target node and then disconnect the target node from the selected hyperedges. RanA randomly selects c (c < C) hy- peredges and can disconnect or connect the relationship between the target node and the selected hyperedges. DiceA first randomly c 2 (c < C) hyperedges of the target node, then randomly disconnects connect the target node on |E| − c non-selected hyperedges. Gradient-based Attack. The gradient-based attack is widely used as an efficient algorithm in many types of research, especially in methods based on white-box settings. When the internal infor- mation of the target model is available for attackers, the simplest approach is to use the gradient of the training process as indicators to evaluate the priority of each component between nodes and hyperedges. Attackers can then modify the matrix according to the priority. In our work, we introduce two gradient-base methods, including FGA [4] and IGA [42], which use gradient and integrated gradient, respectively. 5.2 Structure Attack Effectiveness As shown in Table 2, we use HyperAttack and five other baseline methods on the Cora and PubMed datasets. Take the Cora dataset as an example, HyperAttack has great advantages over all Random- based Attack methods where the average ASR has increased from 41% to more than 92% when we use the KNN-based method to generate hyperedges. Compared with the 95% attack success rate achieved by IGA, which is the state-of-the-art attack method on graph, HyperAttack increased to 96 %. When we use the ε − ball, ASR has increased from 91% of IGA to 96% of HyperAttack. As for the PubMed dataset, ASR has decreased to different degrees under each attack algorithm, but HyperAttack is still far superior to all Random-based methods and shows slightly better than the ASR of IGA. Answer to RQ1: We can preliminarily conclude that HyperAttack has outstanding advantages over the existing Random- based methods, and is slightly superior to IGA by 1.3% - 3.7% of ASR. We use classification margin to evaluate the attack performance. For the target node v, its classification margin is X = Zv,c −maxc′≠cZv,c′, ISSTA 2023, 17-21 July, 2023, Seattle, USA xxx et al. Table 2: Structure attack performance (ASR, AML, and RT) of five structure attack methods: RanD, RanA, DiceA, FGA, IGA, and HyperAttack with different hypergraph models. The performance of HyperAttack shows the best results in both attack success rate and time cost. Dataset Method Hypergraph_ε Hypergraph_KNN ASR(%) AML RT(s) ASR(%) AML RT(s) ASR(%) AML RT(s) Hypergraph_L1 Cora PubMed Random-based Attack Gradient-based Attack Random-based Attack Gradient-based Attack RanD RanA DiceA FGA IGA HyperAttack (OURS) RanD RanA DiceA FGA IGA HyperAttack (OURS) 15 48 37 85 88 89 11 29 17 48 69 74 0.02 4.20 0.02 4.78 0.02 5.49 3.00 0.03 2.49 42.23 3.65 2.84 0.08 6.45 0.08 6.36 0.08 5.43 0.16 5.22 5.16 187.13 5.11 19.38 12 52 34 91 95 96 3 30 14 72 82 83 0.02 4.39 0.02 4.34 0.02 4.88 1.37 0.04 1.43 42.18 3.64 1.39 0.08 8.74 0.08 6.49 0.08 7.33 0.15 3.79 3.60 187.33 3.68 19.50 80 45 69 89 91 96 / 40 / 96 97 97 0.02 1.96 0.02 4.27 0.02 3.2 1.75 0.03 1.85 44.44 3.74 2.02 / / 0.08 3.92 / / 0.10 1.47 1.32 186.13 1.26 19.48 where c is the ground truth label, Zv,c is the probability that the target node v is given label c by HGNN model. Lower X are better. X smaller than 0 means the target node is misclassified. Figure5 shows the classification margin of different attack methods on the Cora dataset and PubMed dataset. Obviously, the classification margin of IGA and HyperAttack is significantly better than other attack methods. IGA is relatively stable, but HyperAttack has a slightly higher success rate than IGA. Answer to RQ3: HyperAttack has the highest attack success rate with a guaranteed classification mar- gin better than other attack methods except for IGA. We believe HyperAttack is accurate and relatively stable. 5.3 Structure Attack Performance In addition, we can get the running time of a successful attack pro- cess from Table 2. We find the running time of all Random-based methods is only 0.02 seconds, because this kind of method only needs the operation time of disturbance, and does not need time to filter from the incidence matrix. In contrast, the Gradient-based methods take longer for they spend most of the time doing the selection. IGA and HyperAttack both show superior ASR. However, the time cost of HyperAttack is much shorter than that of IGA. To be specific, when we implement a successful attack via IGA and HyperAttack respectively, IGA takes 42-45 seconds, while HyperAt- tack only takes 2-4 seconds, which reduces the time by 10-20 times. Answer to RQ2: We believe that the running time of HyperAt- tack is 10-20 times shorter than that of similar the-state-of-the-art methods under the condition of ensuring a high success rate of the attack. on the Cora dataset as the example, and the perturbation size is set to 2. After the original hypergraph is trained by HGNN, the connection relationship of the target node V 1 is shown in Figure 6 (a). V 1 is connected with six hyperedges and belongs to the cate- gory represented by purple. In HyperAttack, we choose hyperedges E1 and E2 to attack by Fast-gradient-based filter and Integrated- gradient-based selection. Then, we modify the incidence matrix and test it in the trained HGNN, the result is shown in Figure 6 (b). After HyperAttack, the target node V 1 adds the connection to the hyperedges E1 and E2. Its label changes to the category represented by orange which proves the attack is successful. (a) Cora (b) Pubmed Figure 5: The classification margin of different attack meth- ods on the Cora dataset. 5.4 Visualization and case study In order to make HyperAttack easier to understand, Figure 6 shows the visualization of HyperAttack. We visualize the connection re- lationship of the target node and compare the changes before and after HyperAttack. We take a HyperAttack of Hypergraph_KNN 6 DISCUSSION In this section, we discuss the robustness of different methods of constructing hyperedges under HyperAttack. Especially, we focus on the modeling method based on KNN and we set experiments to investigate different robustness of parameter K . HyperAttack: Multi-Gradient-Guided White-box Adversarial Structure Attack of Hypergraph Neural Networks ISSTA 2023, 17-21 July, 2023, Seattle, USA when the K is smaller. Therefore, we believe that the stability of the hypergraph is related to the number of nodes connected by the hyperedges, The hypergraph structure is more stable and robust when the number of nodes connected by the hyperedges is higher. Meanwhile, when K = 2, i.e., each hyperedge connects 2 nodes, the constructed hypergraph is a graph structure, indicating that our method is applicable to graph, and has generalization ability. 7 RELATED WORK In this section, we introduce the related work of hypergraph learn- ing application and the adversarial attack against graph data. 7.1 Hypergraph learning A hypergraph denoted as G, is composed of a set of nodes V, a set of hyperedges E, and a weight matrix W, which represents the connection strengths between the nodes in the hypergraph. To preserve the high-order associations within the hypergraph and perform downstream tasks effectively, two main steps are in- volved. The first step is to construct the hypergraph from the origi- nal graph-based data. Previous studies on hypergraph generation methods have been reviewed in [11], which categorize these meth- ods into four types: distance-based [9, 16], representation-based [18, 22, 38], attribute-based [14, 19], and network-based [6, 47]. These methods can be further classified into implicit and explicit methods. Implicit methods, such as distance-based and representation-based methods, do not directly obtain the hyperedges from the original data and require reconstruction through specific measurement and representation algorithms. Explicit methods, including attribute- based and network-based methods, can directly construct the hy- peredges based on the attributes or network connections of the original data, preserving the correlations within the data. The second step is to design learning methods for the constructed hypergraph. Hypergraph learning can be divided into spectral- analysis methods, neural-network methods, and other methods based on their implementation. Spectral-analysis methods are the mainstream in hypergraph learning, utilizing matrix analysis and spectral theory. For instance, Yadati et al. [43] employed group expansion to convert the hypergraph into an ordinary graph and used trainable hyperedge perception and hyperedge scoring layers to retain the high-order associativity between nodes and hyper- edges. With the advancement of GNN research, some researchers have introduced neural networks into hypergraphs. Inspired by graph neural networks, Feng et al. [7] introduced the Laplace matrix into hypergraphs and proposed the Hypergraph Neural Network (HGNN) framework, which generalizes the star expansion process of hypergraphs to neural networks. Other hypergraph learning methods focus on specific applications, such as video images and other fields. For example, Su et al. [29] introduced weighted hy- pergraphs into the 3D target classification task, allowing for the re-evaluation of node correlations through the weight matrix and obtaining the potential correlations between nodes. 7.2 Adversarial attack on graph data In recent years, a large number of researchers have tried to gener- ate adversarial examples to make the graph-based deep learning systems have the ability to resist the input of adversarial test [4, 5, (a) Before attack (b) After attack Figure 6: The visualization of HyperAttack. (a) is the con- nection relationship of the nodes before the attack. (b) is the connection relationship of the nodes after the attack. 6.1 Impact on perturbation Figure 7 show the results on ASR of different attack methods as functions of perturbation size γ on various hypergraph model for the Cora dataset and PubMed dataset. In the Random-based attack, ASR is not proportional to the number of perturbations due to the high-level randomness in the methods. For example, as shown in Figure 7 (c), the ASR of DiceA is fluctuating as γ increases. In the Gradient-based attack, ASR shows an overall growing tendency as the number of perturbations rises. When γ increases to a cer- tain value, ASR may reach an upper limit and no longer change significantly, as shown in Figure 7 (f). Figure 8 shows the Running Time of the attack with an increasing number of perturbations. The running time of the attack consists of the time to modify the incidence matrix and the time to calculate the gradient. The time consumption for modifying the incidence is very small, so the number of perturbations has little effect on the Random-based attack methods. As the number of perturbations increases, FGA and Hyperattack calculate more gradients, so RT will increase. For IGA, it needs to calculate the gradient of all hy- peredges associated with the target node regardless of the number of perturbations, therefore, the size of perturbations barely affects it. 6.2 Impact of hypergraph modeling We study the impact of different hypergraph generation methods on the attack. As shown in Figure 7, we find that the Hypergraph_KNN has the lowest ASR and the Hypergraph_L1 has the highest ASR on both datasets, which we believe is also related to the number of nodes connected by the hyperedges. The Hypergraph_KNN has the largest number of nodes connected to each hyperedge on average, and it is the most stable. The number of nodes connected by each hyperedge of Hypergraph_L1 is the lowest, it is the most likely to be attacked successfully. But in terms of classification accuracy, the performance of the Hypergraph_L1 is optimal. The topic of how to balance hypergraph performance and stability is important. In particular, we study the effect of hyperedges connected to different numbers of nodes on Hypergraph robustness. We set experiments and give the results in Figure 9, which clearly shows the ASR of HyperAttack when the incidence matrix H is constructed based on KNN with different K. We find that the ASR is higher ISSTA 2023, 17-21 July, 2023, Seattle, USA xxx et al. (a) Hypergraph_KNN (Cora) (b) Hypergraph_ε (Cora) (c) Hypergraph_L1 (Cora) (d) Hypergraph_KNN (Pubmed) (e) Hypergraph_ε (Pubmed) (f) Hypergraph_L1 (Pubmed) Figure 7: ASR of different attack methods as functions of perturbation size γ on various hypergraph generation methods. performance by modifying graph structures. The structure attack manipulates the adjacent matrix of the target node in directions and leads to large classification loss. Many methods try to apply the traditional software testing technology to graph-based deep learn- ing systems testing via white-box testing and black-box testing. In white-box settings, attackers are able to acquire internal parame- ters and modify the graph structure using specific algorithms via these available parameters. Some gradient-based strategies are pro- posed to realize effective structure attacks. Nettack [48] is regarded as the first work to exploit the ideas. It obtains the approximate optimal attack of a disturbance based on a greedy algorithm by calculating scores for structural attacks and feature attacks. Some works [4] use a gradient of pairwise nodes based on the target model and select the pair of nodes with a maximum absolute gradient to update the modified adjacency matrix. Topology attack [25] uses randomization sampling to select sub-optimal binary perturbations. Meta-gradient is introduced for the first time [1] on graph adjacency matrix to solve a bi-level optimization problem for the poisoning attack. Mettack greedily adds perturbations via the selected largest meta-gradient. In black-box settings, the attacker is restricted to propose adver- sarial samples without any access to the target model. This kind of attack is the most dangerous attack among the attack methods. Because some evil attacks can attack the model in the reality with very limited acknowledgment. Some strategies [3, 5, 24, 28] were proposed to learn the generalized attack policy while only requiring prediction labels from the target classifier. The attackers regard the attack as a Markov decision process. The current decision is only based on the current state and has nothing to do with the previous decision. The reward function is designed according to the Figure 8: Time cost of attack methods with different pertur- bation size γ on Cora dataset. Figure 9: ASR of HyperAttack on attacking HGNN and KNN- based hypergraph construction with different K value. 23, 25, 45, 48]. The vast majority of attack methods realize effective HyperAttack: Multi-Gradient-Guided White-box Adversarial Structure Attack of Hypergraph Neural Networks ISSTA 2023, 17-21 July, 2023, Seattle, USA feedback of the victim model after the attack, and then it is solved by reinforcement learning. 8 CONCLUSION In this paper, we propose HyperAttack, the first white-box structure attack framework against hypergraph neural networks. HyperAt- tack can modify the incidence matrix of the hypergraph by adding or deleting the target node on specific hyperedges. To measure the priority of each hyperedge, we use both gradient and the integrated gradient as indicators. We conduct a large number of experiments by using five different baseline methods. In two widely-used datasets Cora and PubMed, HyperAttack can greatly shorten the time of structure attack when the attack effect still achieves state-of-the-art performance at the same time. We also implement HyperAttack on the hypergraph of three different modeling methods to evaluate the different robustness. We expect to study other attacks with different levels of knowledge(i.e. black-box attack) on HGNNs, and try to influence the classification result by modifying the node feature matrix in the future. REFERENCES [1] 2019. Adversarial Attacks on Graph Neural Networks via Meta Learning. OpenRe- view.net. https://openreview.net/forum?id=Bylnx209YX [2] Kais Allab, Lazhar Labiod, and Mohamed Nadif. 2016. A semi-NMF-PCA uni- fied framework for data clustering. IEEE Transactions on Knowledge and Data Engineering 29, 1 (2016), 2–16. [3] Heng Chang, Yu Rong, Tingyang Xu, Wenbing Huang, Honglei Zhang, Peng Cui, Wenwu Zhu, and Junzhou Huang. 2020. A Restricted Black-Box Ad- versarial Framework Towards Attacking Graph Embedding Models. In The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty- Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020. AAAI Press, 3389–3396. https://ojs.aaai.org/index.php/AAAI/article/view/5741 [4] Jinyin Chen, Yangyang Wu, Xuanheng Xu, Yixian Chen, Haibin Zheng, and Qi Xuan. 2018. Fast Gradient Attack on Network Embedding. CoRR abs/1809.02797 (2018). arXiv:1809.02797 http://arxiv.org/abs/1809.02797 [5] Hanjun Dai, Hui Li, Tian Tian, Xin Huang, Lin Wang, Jun Zhu, and Le Song. 2018. Adversarial Attack on Graph Structured Data. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018 (Proceedings of Machine Learning Research), Jennifer G. Dy and Andreas Krause (Eds.), Vol. 80. PMLR, 1123–1132. http: //proceedings.mlr.press/v80/dai18b.html [6] Quan Fang, Jitao Sang, Changsheng Xu, and Yong Rui. 2014. Topic-sensitive in- fluencer mining in interest-based social media networks via hypergraph learning. IEEE Transactions on Multimedia 16, 3 (2014), 796–812. [7] Yifan Feng, Haoxuan You, Zizhao Zhang, Rongrong Ji, and Yue Gao. 2019. Hy- pergraph neural networks. In Proceedings of the AAAI conference on artificial intelligence, Vol. 33. 3558–3565. [8] Yue Gao, Yifan Feng, Shuyi Ji, and Rongrong Ji. 2023. HGNN+: General Hy- pergraph Neural Networks. IEEE Transactions on Pattern Analysis and Machine Intelligence 45, 3 (2023), 3181–3199. https://doi.org/10.1109/TPAMI.2022.3182052 [9] Yue Gao, Meng Wang, Dacheng Tao, Rongrong Ji, and Qionghai Dai. 2012. 3-D Object Retrieval and Recognition With Hypergraph Analysis. IEEE Trans. Image Process. 21, 9 (2012), 4290–4303. https://doi.org/10.1109/TIP.2012.2199502 [10] Yue Gao, Chong-Yaw Wee, Minjeong Kim, Panteleimon Giannakopoulos, Marie- Louise Montandon, Sven Haller, and Dinggang Shen. 2015. MCI identification by joint learning on multiple MRI data. In International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer, 78–85. [11] Yue Gao, Zizhao Zhang, Haojie Lin, Xibin Zhao, Shaoyi Du, and Changqing Zou. 2020. Hypergraph learning: Methods and practices. IEEE Transactions on Pattern Analysis and Machine Intelligence (2020). [12] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. 2014. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572 (2014). [13] Will Hamilton, Zhitao Ying, and Jure Leskovec. 2017. Inductive representation learning on large graphs. Advances in neural information processing systems 30 (2017). [14] Sheng Huang, Mohamed Elhoseiny, Ahmed M. Elgammal, and Dan Yang. 2015. Learning Hypergraph-regularized Attribute Predictors. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2015, Boston, MA, USA, June 7- 12, 2015. IEEE Computer Society, 409–417. https://doi.org/10.1109/CVPR.2015. 7298638 [15] Yuchi Huang, Qingshan Liu, and Dimitris Metaxas. 2009. ] Video object segmen- tation by hypergraph cut. In 2009 IEEE conference on computer vision and pattern recognition. IEEE, 1738–1745. [16] Yuchi Huang, Qingshan Liu, and Dimitris N. Metaxas. 2009. Video object segmen- tation by hypergraph cut. In 2009 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2009), 20-25 June 2009, Miami, Florida, USA. IEEE Computer Society, 1738–1745. https://doi.org/10.1109/CVPR.2009.5206795 [17] Jianwen Jiang, Yuxuan Wei, Yifan Feng, Jingxuan Cao, and Yue Gao. 2019. Dy- namic Hypergraph Neural Networks. In Proceedings of the Twenty-Eighth Interna- tional Joint Conference on Artificial Intelligence, IJCAI 2019, Macao, China, August 10-16, 2019, Sarit Kraus (Ed.). ijcai.org, 2635–2641. https://doi.org/10.24963/ijcai. 2019/366 [18] Taisong Jin, Zhengtao Yu, Yue Gao, Shengxiang Gao, Xiaoshuai Sun, and Cuihua Li. 2019. Robust Hypergraph and its applications. Information Sciences 501 (2019), 708–723. [19] Cliff Joslyn, Sinan Aksoy, Dustin Arendt, Louis Jenkins, Brenda Praggastis, Emilie Purvine, and Marcin Zalewski. 2019. High performance hypergraph analytics of domain name system relationships. In HICSS 2019 symposium on cybersecurity big data analytics. [20] Thomas N. Kipf and Max Welling. 2016. Semi-Supervised Classification with Graph Convolutional Networks. CoRR abs/1609.02907 (2016). arXiv:1609.02907 http://arxiv.org/abs/1609.02907 [21] Li Liu, William K Cheung, Xin Li, and Lejian Liao. 2016. Aligning Users across Social Networks Using Network Embedding.. In Ijcai, Vol. 16. 1774–80. [22] Qingshan Liu, Yubao Sun, Cantian Wang, Tongliang Liu, and Dacheng Tao. 2016. Elastic net hypergraph learning for image clustering and semi-supervised classification. IEEE Transactions on Image Processing 26, 1 (2016), 452–463. [23] Zhengyang Liu, Xiaoyu Zhang, Chenyang Chen, Shen Lin, and Jingjin Li. 2022. Membership Inference Attacks Against Robust Graph Neural Network. In Cy- berspace Safety and Security - 14th International Symposium, CSS 2022, Xi'an, China, October 16-18, 2022, Proceedings (Lecture Notes in Computer Science), Xi- aofeng Chen, Jian Shen, and Willy Susilo (Eds.), Vol. 13547. Springer, 259–273. https://doi.org/10.1007/978-3-031-18067-5_19 [24] Yao Ma, Suhang Wang, Tyler Derr, Lingfei Wu, and Jiliang Tang. 2021. Graph Adversarial Attack via Rewiring. In KDD '21: The 27th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, Singapore, August 14-18, 2021, Feida Zhu, Beng Chin Ooi, and Chunyan Miao (Eds.). ACM, 1161–1169. https://doi.org/10.1145/3447548.3467416 [25] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. 2018. Towards Deep Learning Models Resistant to Adversarial Attacks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. https://openreview.net/forum?id=rJzIBfZAb [26] Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. 2016. The limitations of deep learning in adversarial settings. In 2016 IEEE European symposium on security and privacy (EuroS&P). IEEE, 372–387. [27] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. 2014. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining. 701–710. [28] Mrigank Raman, Aaron Chan, Siddhant Agarwal, Peifeng Wang, Hansen Wang, Sungchul Kim, Ryan A. Rossi, Handong Zhao, Nedim Lipka, and Xiang Ren. 2021. Learning to Deceive Knowledge Graph Augmented Models via Targeted Perturbation. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net. https://openreview. net/forum?id=b7g3_ZMHnT0 [29] Lifan Su, Yue Gao, Xibin Zhao, Hai Wan, Ming Gu, and Jiaguang Sun. 2017. Vertex-Weighted Hypergraph Learning for Multi-View Object Classification.. In IJCAI. 2779–2785. [30] Yiwei Sun, Suhang Wang, Xianfeng Tang, Tsung-Yu Hsieh, and Vasant G. Honavar. 2019. Node Injection Attacks on Graphs via Reinforcement Learning. CoRR abs/1909.06543 (2019). arXiv:1909.06543 http://arxiv.org/abs/1909.06543 [31] Yiwei Sun, Suhang Wang, Xianfeng Tang, Tsung-Yu Hsieh, and Vasant Honavar. 2020. Non-target-specific node injection attacks on graph neural networks: A hierarchical reinforcement learning approach. In Proc. WWW, Vol. 3. [32] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017. Axiomatic attribution for deep networks. In International conference on machine learning. PMLR, 3319– 3328. [33] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. 2013. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199 (2013). [34] Jian Tang, Meng Qu, and Qiaozhu Mei. 2015. Pte: Predictive text embedding through large-scale heterogeneous text networks. In Proceedings of the 21th ACM SIGKDD international conference on knowledge discovery and data mining. 1165–1174. ISSTA 2023, 17-21 July, 2023, Seattle, USA xxx et al. [35] Fei Tian, Bin Gao, Qing Cui, Enhong Chen, and Tie-Yan Liu. 2014. Learning deep representations for graph clustering. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 28. [36] Ze Tian, TaeHyun Hwang, and Rui Kuang. 2009. A hypergraph-based learn- ing algorithm for classifying gene expression and arrayCGH data with prior knowledge. Bioinformatics 25, 21 (2009), 2831–2838. [37] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. 2018. Graph Attention Networks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net. https://openreview. net/forum?id=rJXMpikCZ [38] Meng Wang, Xueliang Liu, and Xindong Wu. 2015. Visual Classification by Hypergraph Modeling. IEEE Trans. Knowl. Data Eng. 27, 9 (2015), 2564–2574. https://doi.org/10.1109/TKDE.2015.2415497 [39] Suhang Wang, Jiliang Tang, Charu Aggarwal, Yi Chang, and Huan Liu. 2017. Signed network embedding in social media. In Proceedings of the 2017 SIAM international conference on data mining. SIAM, 327–335. [40] Suhang Wang, Jiliang Tang, Charu Aggarwal, and Huan Liu. 2016. Linked docu- ment embedding for classification. In Proceedings of the 25th ACM international on conference on information and knowledge management. 115–124. [41] Marcin Waniek, Tomasz P Michalak, Michael J Wooldridge, and Talal Rahwan. 2018. Hiding individuals and communities in a social network. Nature Human Behaviour 2, 2 (2018), 139–147. [42] Huijun Wu, Chen Wang, Yuriy Tyshetskiy, Andrew Docherty, Kai Lu, and Liming Zhu. 2019. Adversarial examples on graph data: Deep insights into attack and defense. arXiv preprint arXiv:1903.01610 (2019). [43] Naganand Yadati, Madhav Nimishakavi, Prateek Yadav, Vikram Nitin, Anand Louis, and Partha Talukdar. 2019. Hypergcn: A new method for training graph convolutional networks on hypergraphs. Advances in neural information process- ing systems 32 (2019). [44] Naganand Yadati, Madhav Nimishakavi, Prateek Yadav, Vikram Nitin, Anand Louis, and Partha P. Talukdar. 2019. HyperGCN: A New Method For Training Graph Convolutional Networks on Hypergraphs. In Advances in Neural Informa- tion Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett (Eds.). 1509–1520. https://proceedings.neurips.cc/paper/ 2019/hash/1efa39bcaec6f3900149160693694536-Abstract.html [45] Xiaoyan Yin, Wanyu Lin, Kexin Sun, Chun Wei, and Yanjiao Chen. 2023. A2S2- GNN: Rigging GNN-Based Social Status by Adversarial Attacks in Signed Social Networks. IEEE Trans. Inf. Forensics Secur. 18 (2023), 206–220. https://doi.org/10. 1109/TIFS.2022.3219342 [46] Wei Zhao, Shulong Tan, Ziyu Guan, Boxuan Zhang, Maoguo Gong, Zhengwen Cao, and Quan Wang. 2018. Learning to map social network users by unified manifold alignment on hypergraph. IEEE transactions on neural networks and learning systems 29, 12 (2018), 5834–5846. [47] Chen Zu, Yue Gao, Brent Munsell, Minjeong Kim, Ziwen Peng, Yingying Zhu, Wei Gao, Daoqiang Zhang, Dinggang Shen, and Guorong Wu. 2016. Identifying high order brain connectome biomarkers via learning on hypergraph. In International Workshop on Machine Learning in Medical Imaging. Springer, 1–9. [48] Daniel Zügner, Amir Akbarnejad, and Stephan Günnemann. 2018. Adversarial attacks on neural networks for graph data. In Proceedings of the 24th ACM SIGKDD international conference on knowledge discovery & data mining. 2847–2856.
http://arxiv.org/abs/2302.12403v1
2023-02-24T02:09:33
2023-02-24T02:09:33
Prioritized Trace Selection: Towards High-Performance DRL-based Network Controllers
Deep Reinforcement Learning (DRL) based controllers offer high performance in a variety of network environments. However, simulator-based training of DRL controllers using highly skewed datasets of real-world traces often results in poor performance in the wild. In this paper, we put forward a generalizable solution for training high-performance DRL controllers in simulators -- Prioritized Trace Selection (PTS). PTS employs an automated three-stage process. First, we identify critical features that determine trace behavior. Second, we classify the traces into clusters. Finally, we dynamically identify and prioritize the salient clusters during training. PTS does not require any changes to the DRL workflow. It can work across both on-policy and off-policy DRL algorithms. We use Adaptive Bit Rate selection and Congestion Control as representative applications to show that PTS offers better performance in simulation and real-world, across multiple controllers and DRL algorithms. Our novel ABR controller, Gelato, trained with PTS outperforms state-of-the-art controllers on the real-world live-streaming platform, Puffer, reducing stalls by 59% and significantly improving average video quality.
[ "Sagar Patel", "Junyang Zhang", "Sangeetha Abdu Jyothi", "Nina Narodytska" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12403v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12403v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.NI" ]
Prioritized Trace Selection: Towards High-Performance DRL-based Network Controllers Sagar Patel1, Junyang Zhang1, Sangeetha Abdu Jyothi1, 2, Nina Narodytska2 1University of Califoria, Irvine, 2VMware Research 3 2 0 2 b e F 4 2 ] G L . s c [ 1 v 3 0 4 2 1 . 2 0 3 2 : v i X r a ABSTRACT Deep Reinforcement Learning (DRL) based controllers of- fer high performance in a variety of network environments. However, simulator-based training of DRL controllers using highly skewed datasets of real-world traces often results in poor performance in the wild. In this paper, we put forward a generalizable solution for training high-performance DRL controllers in simulators-Prioritized Trace Selection (PTS). PTS employs an automated three-stage process. First, we identify critical features that determine trace behavior. Sec- ond, we classify the traces into clusters. Finally, we dynami- cally identify and prioritize the salient clusters during train- ing. PTS does not require any changes to the DRL workflow. It can work across both on-policy and off-policy DRL algo- rithms. We use Adaptive Bit Rate selection and Congestion Control as representative applications to show that PTS of- fers better performance in simulation and real-world, across multiple controllers and DRL algorithms. Our novel ABR controller, Gelato, trained with PTS outperforms state-of- the-art controllers on the real-world live-streaming platform, Puffer, reducing stalls by 59% and significantly improving average video quality. 1 INTRODUCTION Control in real-world networks is a hard-to-tackle problem. Today, learning-based solutions outperform manually de- signed heuristics in a broad range of network environments. Deep Reinforcement Learning (DRL) based controllers offer high performance in congestion control (CC) [5, 23], Adap- tive Bit Rate (ABR) selection in video streaming [31, 33], cluster scheduling [34], network traffic optimization [12] and network planning [58], to name a few. DRL network controllers are typically trained using simu- lators that capture the behavior of the environment by replay- ing a set of real-world network traces. The trace-driven DRL training introduces several challenges that contribute toward the poor performance of controllers in the real world [31, 55]. First, since DRL is sample inefficient, we need the agent to gather experience over a large number of iterations to achieve sufficient learning. Second, real-world datasets are skewed. Over an eight-month period, low-bandwidth traces 1 constituted less than 20% of traces collected by the video streaming platform, Puffer [55], with just 4% of them having any stalls. These challenges coupled with the high variation in real-world network conditions imply that a large dataset with broad coverage of network conditions is necessary for the training and evaluation of DRL controllers. For exam- ple, Yan et.al. [55] observed that at least two years' worth of streaming data was required for just distinguishing the performance of ABR controllers, and significantly more is required for determining the absolute performance with con- fidence. Several past work [17, 24, 39, 45, 51] have studied the im- pact of data skew in learning environments. A standard solu- tion for tackling the skew in datasets is prioritized sampling. Prior work employed prioritization within the RL algorithm using Prioritized Experience Replay (PER) [21, 45], which involves buffering and sampling over a finite set of previ- ously visited states (§ 3.2). However, our experiments show that PER is not well-suited to network environments, and can even hurt performance (§ 3.2). This raises the question: where should prioritization be implemented in the train- ing workflow of DRL network controllers? We look beyond the commonly-used strategy of prioritization of states and instead focus on traces. Note that real-world traces are a distinctive component of networking and systems DRL en- vironments, and are typically not found in standard DRL environments.Hence, input traces present an unexplored avenue for prioritization in network settings. Trace-driven network environments hitherto employed the simple strategy of random sampling over skewed trace datasets. With random sampling, the agent has limited ex- posure to the tail end of the distribution during training which, in turn, leads to poor performance of the controller in scenarios that were scarcely encountered during train- ing. Even if the controller is trained for a longer duration, the relative skew in the dataset that it learns over remains. In addition, controllers trained with random sampling over skewed datasets may also require frequent retraining when the input dataset distribution shifts. In a nutshell, the lack of distribution awareness of the trace dataset significantly impacts the performance of DRL network controllers today. In this paper, we put forward Prioritized Trace Selection (PTS) as a generalizable framework for developing robust and high-performance DRL controllers in trace-driven envi- ronments that typically train on skewed real-world datasets. Prioritized Trace Selection dynamically changes the selec- tion probability of input traces based on the agent's potential to learn from them. The key idea is that exposing the agent to traces that it can learn the most from can improve the train- ing efficiency and final performance of the DRL controller significantly. PTS employs a three-stage process to effectively identify and correct for the skew in trace-driven RL environments. Critical Feature Identification: We automatically determine the critical trace features that will enable us to identify the trace. Clustering: We employ clustering to partition traces into groups that share similar characteristics. Clustering reduces the decision-making complexity from a per-trace scale to a per-cluster scale. Prioritization: In this stage, we dynamically prioritize the clusters with low performance and high potential for learning by continuously monitoring the agent during training (§ 4). PTS is an easy-to-use, plug-and-play solution that can be employed without any operator intervention across all trace- driven DRL settings. PTS does not require any changes to the DRL workflow of the trace-driven simulators or the DRL algorithms. PTS works across both on-policy and off-policy DRL algorithms without any modifications. PTS has three key advantages of PTS: (i) PTS offers higher performance compared to random sampling across all trace distributions (§ 6, 7), (ii) controllers trained with PTS are robust under distribution shifts as prioritization improves the exposure of the controller to a wider range of trace classes (§ 6), and consequently, (iii) controllers trained using PTS require sig- nificantly less retraining, leading to compute and energy savings (§ 7). Using Adaptive Bit Rate selection and Congestion Control as representative network applications, we show that PTS offers consistently high performance across a wide range of controllers-across different environments, diverse trace distributions, and multiple DRL algorithms. We also intro- duce Gelato, a novel DRL-based ABR controller that, when trained with PTS, offers state-of-the-art performance on the real-world Puffer live-streaming platform [55]. Without any retraining over a period of 8 months, Gelato achieves 59% reduction in stalls over Fugu [55] which is retrained daily. To enable easy and fair comparison of prioritization strate- gies, we also introduce a controlled environment, TraceBench. TraceBench is a simplified Adaptive Bit Rate environment that supports (i) parameterized trace generation and (ii) eval- uation of sampling techniques. Parameterized trace genera- tion enables users to generate a wide range of trace distribu- tions in a controlled and accurate manner, which can then Figure 1: RL Training Loop: The training loop of DRL algo- rithms in trace-driven environments. be used to evaluate sampling strategies. We will open-source TraceBench to serve as a benchmark suite for the design of future prioritization techniques. In summary, we make the following contributions: • We propose Prioritize Trace Selection (PTS) as a generaliz- able solution for handling skewed datasets and improving the performance of trace-driven DRL controllers. • We demonstrate the superior performance and robustness of PTS in Congestion Control and Adaptive Bitrate Se- lection, across multiple RL algorithms in simulation and real-world settings. • We introduce Gelato, a new ABR controller. PTS-trained Gelato deployed on the real-world Puffer platform [55] for 8 months achieves the lowest stalling (a 59% reduction) and significant improvement in video quality over Fugu [55] which is retrained daily. • We present a new benchmarking tool, TraceBench, and evaluate a wide range of trace distributions and our prior- itization techniques using TraceBench. 2 BACKGROUND In this section, we give a brief overview of reinforcement learning training and our representative applications, adap- tive video streaming and congestion control. 2.1 Reinforcement Learning Background In Reinforcement learning (RL), an agent interacts with an environment. At each timestep, based on the current environ- ment state, st , the agent takes an action, at , drawn from the agent's policy, π (A|st ). The environment plays the action out and transitions to state, st +1, and gives to the agent a reward, rt , that captures the "goodness" of taking the action at [6, 49, 50]. Formally, the environment is represented by a Markov Decision Process (MDP) given by (S, A, R, P, p0, γ), where S is the set of states, A is the set of available actions, P is the transition function that maps a given state and ac- tion to a probability distribution over the next state, R is the 2 reward function, p0 is the distribution over initial states, and γ is the discount for future rewards (0 ≤ γ < 1). The goal of the agent is to learn a policy that maximizes the expected cumulative return, usually defined as the infinite horizon discounted sum G = (cid:205)∞ t =0 γ trt . The learning process guides the policy π towards higher expected cumulative return, denoted as a function of any given state by the value function v π (s) = Eπ [G |s0 = s]. The overall learning process can be viewed as an infinite loop of a policy evaluation step that estimates vπ and a policy improvement step that adjusts the policy π to maximize v π (Figure 1). Recently, deep model-free RL algorithms have shown suc- cess in environments with very high-dimensional state and action spaces [20, 36, 37, 48]. DRL uses deep neural networks to directly approximate some variation of the value func- tion and optionally an explicit policy alongside it. In this paradigm, the policy evaluation step can be broken down into an acting step, in which the agent interacts with the environment to gather experience, and a function learning step, in which the agent uses the gathered experience to train its neural network to learn to predict the value of the states visited [21]. On-policy and Off-policy DRL. DRL algorithms are broadly divided into two based on their policy evaluation step. On- policy RL algorithms start policy evaluation afresh in every iteration. They only use the data gathered using the latest version of the policy in the current step during function learning [50]. Off-policy RL algorithms, on the other hand, continue to learn over data gathered from older versions of the policy in addition to recent data, in order to improve sam- ple efficiency. Off-policy algorithms maintain a window of environment transitions, defined by the tuple (ot, at, rt, ot +1), in a FIFO buffer called an Experience Replay [37]. However, as the difference between the current policy and the older policy grows, the older data may become stale and reduce the stability and eventual performance of learning [16]. Trace-driven DRL Environments. In DRL-based network- ing environments, true environment dynamics depend on unobserved network conditions and external factors [23, 30, 33, 34]. These time-dependent network conditions and exter- nal factors are represented by traces. A common technique used in this setting is frame-stacking, i.e., using a history of observations, actions, and rewards [25, 46] as inputs. 2.2 Environments In this paper, we use adaptive bit rate streaming and conges- tion control as representative networking environments to demonstrate the shortcomings of DRL-based controllers and the effectiveness of our solution. 3 Adaptive Bitrate Streaming. In HTTP-based video stream- ing, the video is divided into chunks and encoded, in advance, at various discrete bit rates. During streaming, the most ap- propriate bit rate is chosen per chunk based on network conditions. The client also has a short buffer that can hold received chunks that have not been viewed yet. The ABR algorithm is responsible for sequentially selecting the video bitrate on a chunk level to maximize the viewer's Quality of Experience (QoE). Typically, the QoE is measured with a numerical function that awards higher quality, and penalizes both quality fluctuations and rebuffering. The quality of a chunk may be denoted by its encoded bitrate or using more complex measures such as Structural Similarity Index Mea- sure (SSIM) [52]. ABR is a vast research area with a broad range of prior work. BBA [22] is a buffer-based algorithm that uses the client's buffer as a heuristic to decide the bi- trate, Pensieve [33] is a DRL based solution that optimizes QoE, and Fugu [55] is an in-situ continuously learning ABR controller. Congestion Control. Congestion Control (CC) algorithms are responsible for determining the most suitable sending rate for data transfer over a shared network. Based on net- work signals such as round trip time between the sender and receiver and the loss rate of packets, a CC algorithm estimates sending rate that maximizes throughput and minimizes loss and delay. Recently, several ML-based approaches for Con- gestion Control have emerged. For example, Indigo [56] em- ployed Imitation Learning to train a CC algorithm to robustly imitate an optimal policy. Aurora [23] applied DRL to CC by training an agent to optimize Quality-Of-Experience signals such as throughput, latency, and loss. Orca [5] improved the stability and generalizability of this approach and combined DRL with classical TCP control. 3 MOTIVATION In this section, we discuss the challenges associated with training DRL controllers using real-world datasets, particu- larly skew in trace distribution. Then, we give a brief overview of current techniques used to handle skew and motivate the need for prioritized trace selection. 3.1 Challenges with DRL Training Trace-driven DRL training environments used in networking settings suffer from two overarching challenges. Challenge 1: Sample Inefficiency. Network environments are partially observable with a high level of uncertainty. In such environments, DRL requires extensive training to achieve good performance [8, 9, 21, 25]. Typically, this trans- lates to millions of iterations in the simulation environment and a large number of traces required to achieve good cover- age of all environment conditions. In the networking domain, Figure 2: Puffer Trace distribution: Distribution of effective throughput of Puffer traces collected during the two-month period, April '21 - May '21. Less than 6.5% of traces have average effective throughput below the average bitrate of the highest quality video. Each Puffer stream is a trace. Figure 3: Comparing Prioritization Techniques: Performance of sampling tran- sitions (PER enabled/disabled) compared with sampling traces (Random vs. 2- Class Equal Weighted Trace Selection) on a DQN-variant of Gelato ABR con- troller trained using the off-policy algorithm, Ape-X DQN [21]. 2-Class Equal Weighted Trace Selection offers superior controller performance and training efficiency, while PER does not. 95% confidence interval shown as error bands. Yan et.al. [55] observed that at least two stream-years of data was required for distinguishing the performance of two ABR controllers. Challenge 2: Skewed Real-World Datasets. Different net- work conditions are not equally represented in real-world datasets. Our analysis of real-world datasets shows that low bandwidth traces appear less frequently in commonly used datasets. For example, Figure 2 shows the distribution of mean throughput in over 75,000 traces collected over a two- month period (Apr'21-May'21) on the Puffer platform [55]. We observe that a vast majority of traces (over 90%) have high average bandwidth, well above the requirements of the highest quality video. Meanwhile, only a tiny percentage of traces represent poor network conditions: low throughput, high throughput variation, or high network latency. The commonly-employed trace selection strategy, random sampling, when coupled with the inherent sample ineffi- ciency of DRL algorithms and high skew in trace distribution, negatively impacts the performance of the controller under classes that are poorly represented. Note that even when a controller is trained for a longer duration, the relative skew in the representation of classes remains. 3.2 Handling Skew During Learning Past work had identified the impact of skew on learning. Next, we discuss commonly used ML techniques for handling skew and establish the need for prioritized trace selection in DRL-based networking environments. Prioritized Experience Replay (PER). Off-policy DRL al- gorithms store past state transitions in a buffer and sample them during function learning using a technique called Prior- itized Experience Replay (PER) [45]. PER employs prioritized 4 sampling, often referred to as importance sampling, over state transitions already in the buffer. The key intuition is that during the function learning step, sampling the past ex- periences randomly is not optimal; the agent should give less importance to transitions that it is already good at predicting and instead focus on learning over transitions where it has the most room for improvement. The standard approach is to sample the transitions according to their Temporal Differ- ence (TD) error: transitions with higher error, or "unexpect- edness", are sampled more frequently than transitions with lower error. However, in trace-driven environments, this workflow of PER leads to one notable limitation. PER can only priori- tize over transitions already in the replay buffer. This set of transitions is determined by the traces that were recently played to the agent. The trace distribution may be highly skewed with fewer traces in classes with important transi- tions. For example, consider the Puffer dataset with very few traces with stalls. In this case, random trace selection results in fewer traces with stalls played to the agent, and in turn, hardly any stall transitions in the replay buffer. In this case, PER does not allow us to prioritize classes of traces at the outset. Thus, importance sampling employed by PER can only address skew of transitions within recently-visited traces and not across all traces in the dataset. 3.3 Towards Prioritizing Trace Selection We reexamine the DRL workflow and identify a more suit- able location for prioritization. We put forward a simple alternative to PER in trace-driven environments: prioritizing trace selection during the acting step rather than prioritizing transitions at the function learning step. Instead of eval- uating traces based on skewed distributions of real-world Figure 4: PTS System Diagram: An overview of Prioritized Trace Selection (PTS). The PTS Workflow involves three key stages: (1) Critical Feature Identification, where we characterize the traces and their skew, (2) Clustering, where we try to simplify the prioritization problem by grouping traces, (3) Prioritization, where we observe the performance of the agent and attempt to prioritize important trace clusters. datasets, we argue that we can achieve high state-action space exploration and feature learning on all kinds of traces by prioritizing how often we select various traces. To test our hypothesis we conduct an experiment by en- abling prioritization at two points in the DRL workflow: sam- pling transitions (PER enabled vs. disabled) and sampling traces (Random sampling vs. 2-Class Equal Weighted). 2- Class Equal Weighted is a simple trace prioritization scheme that divides the traces from the Puffer Platform into two classes, those with mean throughput higher/lower than the highest quality bitrate, 0.98 Mbps (Figure 2), and equally sam- ples both classes. We evaluate the impact of each technique on a DQN variation of Gelato controller for ABR trained us- ing the state-of-the-art algorithm Ape-X DQN [21] (training settings detailed in § 7.2). In Figure 3, we observe that the simple 2-Class Equal Weighted gives the highest controller performance and train- ing efficiency. Enabling PER does not significantly improve controller performance and even hurts the performance. Even though the replay buffer can store 2 million transitions (over 5000 traces), the controller performance falls short of the naive trace prioritization scheme. This highlights that the skew in the trace distribution cannot be easily overcome at the function learning step. 4 DESIGN Toward improving the performance of DRL training by bal- ancing skew, we put forward the idea that trace selection is the aptest location for prioritization. We introduce Pri- oritized Trace Selection (PTS) to control the distribution of traces and balance the impact of skew on DRL controllers. PTS allows the agent to focus on information-rich or poorly 5 represented traces to ensure higher exploration and better feature extraction on them. Figure 4 gives an overview of the PTS workflow. PTS is implemented in the trace selection module which is respon- sible for supplying traces to the simulation environment. This module sits outside of the DRL training loop and is queried by the environment to get traces to replay. PTS has three key stages: critical feature identification, clustering, and prioritization. Before the training begins, PTS completes its first two stages, the critical feature identification stage (§ 4.1) where it identifies the traces, and the clustering stage (§ 4.2) where it groups the traces together. When DRL train- ing begins, PTS moves on to Prioritization (§ 4.3). During this stage, PTS monitors the DRL controller's training and dynamically prioritizes the clusters with low reward and room for improvement. 4.1 Critical Feature Identification Traces, which are time-dependent series of values defining complex external conditions, can be incredibly difficult to characterize and prioritize directly. Hence, the first step to- wards automated prioritization of traces is identifying critical features that represent the trace characteristics effectively. To extract all the features associated with the time-series trace data, we rely on the popular feature extraction tool for time-series data, tsfresh [13]. We extract a large set of features broadly applicable to all trace-driven DRL environ- ments. Then, with this large set, we automatically identify the critical features in an iterative three-step process. Inspired by the idea of recursive feature elimination tech- niques employed in supervised learning [3], we introduce a novel technique for selecting critical features without having access to ground-truth labels. First, we take the large set of features and cluster the traces into a fixed small number of clusters to obtain cluster labels. Second, we take the cluster labels and train decision trees to classify the traces from their features to their cluster labels. Third, we extract the impor- tance of each feature to the decision tree classifiers, identify a small number of irrelevant features, and eliminate them. We repeat this clustering-classification-feature-elimination procedure (Fig. 4) until we eliminate all the features with low information gain. Each time we eliminate some irrelevant features, we also increase the number of clusters, in order to ensure that the final set of features is expressive enough to capture the intricacies of the trace distribution. Note that the clustering used in this stage is only used to identify critical features, and has no bearing on the clustering stage (§ 4.2). 4.2 Clustering The second stage involves clustering traces using the critical features identified in the previous stage. In this stage, we attempt to reduce the complexity of prioritizing the tens of thousands of traces found in real-world datasets by grouping similar traces together. To cluster the traces, we employ Gaussian Mixture Models (GMM) with Kmeans++ initialization [41]. Gaussian Mix- ture Models use a generalized Expectation Maximization algorithm [1] and can effectively deal with the large vari- ations found in input data. Thus, GMMs are a good fit for our real-world trace datasets. However, GMMs can often converge to local optima and require us to know the number of clusters a priori. Hence, to produce an effective clustering automatically, we perform a two-stage search for random initializations used in GMMs and the number of clusters. First, for different cluster counts, we evaluate the GMM's log-likelihood score for the trace features across a range of random initializations and identify the initialization that maximizes the log-likelihood score for each cluster count. Second, we determine the optimal number of clusters from the output of the previous stage based on the highest nor- malized Silhouette score [4]. 4.3 Prioritization While critical feature identification and clustering are com- pleted before the training begins, prioritization is activated during training. The prioritization stage is responsible for dynamically prioritizing suitable clusters in each iteration as the agent trains. The goal of this stage is to prioritize those clusters where the agent can learn maximally without sacrificing overall controller performance. Ideally, we want to prioritize each trace with its "reward- to-go", the additional reward the agent can obtain on a trace while learning on it. However, the computation of reward- to-go is extremely hard in most real-world scenarios. In this 6 work, we introduce two estimates that capture it: Trace-Error and Low-Reward. Trace-Error measures the "unexpectedness" of the traces within a cluster. Low-Reward refers to the mean reward of traces within a cluster being low. The key intuition is that traces with high unexpectedness and low reward constitute the traces which the agent can learn the most from, and hence, are the ones we need to prioritize. Formally, this scheme can be defined as: P (C) ∝ PT race_Error (C) + PLow_Reward (C) (1) Where P (C) is the probability of selecting the cluster C, PT race_Error (C) is the probability based on trace error and PLow_Reward (C) is the probability based on mean rewards of traces within the cluster. Trace-error: Trace error is defined as the gap between the rewards the agent expected to earn from a trace and what it received. A high trace error signifies that the agent's per- formance was unexpected to it, and hints that the agent has the potential to learn more in the trace. Formally, probabil- ity based on trace error can be defined as PT race_Error (C) ∝ Etrace ∈C [E[G] − G ′]. E[G] is the discounted return (sum of rewards) that the agent expected to earn in the trace, and G ′ is a true sample of it. Note that this discounted return is bounded by a fixed horizon tmax in order to prevent the lengths of traces from affecting their error. Low-Reward: We measure the average reward in each clus- ter, and boost the priority of selecting the clusters with low rewards. With this, we aim to balance the benefit of opti- mizing for potential gaps in learning with the benefit of optimizing the tail-ended performance. Formally, this term can be defined as PLow_Reward (C) ∝ −Etrace ∈C [G ′], where the probability of sampling a cluster is inversely proportional to the mean reward of the traces within it. Note that our prioritization stage is outside of the DRL al- gorithm's training loop in the Trace Selection module (Fig. 4). To estimate the expected return from a trace, we train a neu- ral network to map the critical features of a trace to the return in that trace parallel to the training. We maintain a short bounded history of the trace-return pairs for each clus- ter and use this history to compute the two components of our prioritization function. To calculate the trace error-based weights, we take the ground-truth samples of trace feature- return pairs, measure the mean absolute error of the neural network for these samples, and average them across each cluster. To calculate the low-reward weights, we take the negative of the mean return found in each cluster. We do this prioritization process continuously, adjusting the weights to the controller's current needs. Neural Architecture. We design the deep neural network of Gelato to be efficient. We reduce the total number of pa- rameters by using an additional convolutional layer to down- sample the inputs, thereby reducing the input size to the Fully Connected (FC) layer. Gelato's deeper neural network allows for more expressive feature extraction while reducing the number of trainable parameters and Mult-Add operations by 76% and 68% respectively compared to Pensieve. For the off-policy DQN variant of Gelato (used for com- parison with PER in Figure 3), we use the same architecture, swapping the policy and value networks with a single duel- ing Q-network[53]. For details, see Appendix C. 6 PTS BENCHMARKING Before moving on to real-world controllers and experiments in Section 7, in this section, we thoroughly microbenchmark PTS in order to study its impact in isolation. We demon- strate PTS' ability to dynamically offer high performance and robustness across various trace distributions. 6.1 Settings To evaluate PTS and various prioritization strategies, we introduce a controlled ABR environment for microbench- marking prioritization: TraceBench. TraceBench makes two key changes to the standard ABR environment. First, it sim- plifies the Quality-of-experience measurement to include only two terms, Quality and Stalling. Second, it parameter- izes the traces by key characteristics of real-world traces: mean and variance of network throughput. With these mod- ifications, we can reliably and thoroughly evaluate the con- troller across various network conditions. While this design is a simplification of the real-world environment, it gives a good approximation of a wide range of realistic settings. We believe that the development of such a framework is important for the community as real-world datasets do not allow microbenchmarking of DRL controllers or prioritiza- tion strategies. We envision that it can be used by other controller designers. In generating Traces for TraceBench, we focus on traces with two levels of mean throughput, slow and fast, and two levels of variance of the throughput, high variance and low variance. In this benchmark, we generate three sets of datasets with different proportions of these traces: Major- ity Fast, Balanced, and Majority Slow. See Figure 6 for a visualization of the trace distributions, and see Figure 13 in Appendix B for a visualization of example traces. Note that the training and testing datasets remain disjoint: a controller trained on the Majority Fast dataset does not have access to the testing version of it. We use the off-policy RL algorithm Ape-X DQN [21]. To evaluate prioritization in isolation, we use the same DRL Figure 5: Architecture of Gelato: Gelato takes as input com- plex features of the video stream. 5 GELATO We present a new controller architecture for ABR, Gelato. Our design is inspired by Pensieve [33] but with a number of critical improvements that we describe below. We will demonstrate in Section 7 that by combining Gelato and PTS framework we obtain a state-of-the-art controller that sur- passes all existing ABR controllers in both real-world and simulated scenarios. For an overview, see Figure 5. Rewards. We use SSIM as the optimization goal with the re- ward coefficients used in Fugu [55] (+SSIM, −stalls, −ΔSSIM). We use the video chunk sizes and SSIM values from the logged data publicly released by the Puffer platform. We also normalize rewards by scaling [42] and clipping. The normal- ization reduces the magnitude and variance of the reward signal, preventing extremely large positive or negative val- ues of reward (e.g for an unusually high SSIM, a long stall, etc) from dramatically affecting the controller. Features. We use rich application-level features, keeping a history of the client buffer, past rewards, and stalls. This history allows the controller to get a deep understanding of the client's quality of experience and automatically correct itself when the network conditions become poor. Note that Gelato does not use low-level TCP statistics as Fugu does. However, similar to Fugu, it uses transmit time instead of throughput, and the values of chunk sizes and SSIMs at all encoded bit rates over the next five chunks. These values are often available to ABR controllers because the chunks to be sent are encoded more than 10 seconds before being sent. 7 Figure 6: Trace Datasets of TraceBench: Distribu- tions of traces present in each dataset employed in TraceBench. The broad range of trace distribu- tions allows us to thoroughly benchmark priori- tization techniques. Figure 7: Comparing Prioritization Techniques: Performance of Random Selection, Prioritized Experience Replay (PER), Trace-Error Weighted Se- lection and PTS on the Majority Fast dataset of TraceBench. PTS, which balances both Trace-Error and Low-reward weights, offers the highest per- formance. 95% confidence interval shown as error bands. hyper-parameters for all agents and present results averaged over 4 instances (4 controllers trained using the same scheme with different initial random seeds). This is consistent with the standard reporting practice in the RL community [21, 25, 36]. For details of our training parameters, see Appendix B. 6.2 Results Our experiments investigate two important questions. First, we evaluate how PTS compares to random trace selection, the standard trace selection technique. We additionally evaluate the impact of combing both of the trace selection techniques with PER [45], the state prioritization technique described in Section 3.2. Second, we investigate how sensitive these methods are to network conditions distribution shifts. We would like to emphasize here that these experiments are possible in real-world settings. Focusing on tail-ended performance is important. We start our evaluation with an ablation study on the impact of Trace-error and Low-reward terms in Eq. 1. We use Majority Fast dataset for this evaluation as it models real-world work- loads closely. In Figure 7, we present the results of Random Trace Selection, PER, Trace-error weighted selection, and PTS on the Majority Fast dataset. We observe that Trace- error can be worse than Random selection, particularly in Slow traces, where it not only converges to a low reward but has high variance over the training interval. Meanwhile, PTS, which balances both Trace-error and Low-reward (Eq. 1), of- fers significantly better performance in both Fast and Slow traces. This result highlights the fact that focusing on the low performing traces can be vital to generalizable performance. In Figure 8, we analyze the performance of PTS across various training and testing trace distributions. Particularly, we analyze the following scenarios: • Scenario 1: The training distribution is similar to the real world but the testing is adversarially different, i.e., we train on the Majority Fast but test on the Majority Slow dataset. • Scenario 2: Both training and testing have a balanced set of traces, i.e., we train and test on the Balanced dataset. • Scenario 3: The training distribution largely consists of the tail end of the testing distribution, i.e., we train on the Majority Slow but test on the Majority Fast dataset. PTS outperforms Random Selection regardless of trace distribution. As we observe in Figures 8a and 8b for the test reward for scenarios (1) and (2), PTS provides a significant performance improvement over Random selection. More- over, even in Figure 8b for scenario (3), where we may least expect PTS to help, PTS is similar or better than Random selection. In all three scenarios, the benefit of PTS is more pronounced in the Slow Traces, where the benefit from the higher exposure can be particularly meaningful. Interest- ingly, PER does not meaningfully improve performance in all three of the scenarios. To better understand how PTS so effectively generalizes across all of these trace distributions, we visualize the selection weight of different traces during training in Figure 12 in Appendix A.3. Controllers trained with PTS are robust to trace distri- bution shifts. In the second row of plots in Figures 8a, 8b and 8, we visualize the Slow-Traces performance of different prioritization schemes. We observe that Random trace selec- tion's performance in slow traces is largely dependent on its training dataset. If the training dataset had few Slow traces, as in scenario (1), the performance is significantly worse than it is in scenario (3), where it had many. However, PTS's performance is robust to the training trace distribution: the controllers all converge to a similar reward in all three sce- narios. In the ever-changing landscape of users, devices, and infrastructure inherent to the network domain, this added robustness can be particularly important. It reduces the need 8 (a) Scenario 1: Training on the Major- ity Fast, Testing on the Majority Slow dataset. (b) Scenario 2: Training and Testing on the Balanced dataset. (c) Scenario 3: Training on the Major- ity Slow, Testing on the Majority Fast dataset. Figure 8: Benchmarking PTS across Trace Distributions: We benchmark prioritization techniques across different training and testing trace distributions. PTS provides generalizable performance improvement, beating Random selection in scenarios (1), (2) and (3). PER does not provide meaningful improvement. 95% confidence interval shown as error bands. for retraining and ultimately reduces the compute require- ments and energy consumption of the entire system. Model and Silhouette scoring implementation. To implement the prioritization stage, we employ Pytorch [40]. 7 REAL WORLD EXPERIMENTS In this section, we present the findings of testing the impact of PTS across multiple agent architectures and networking environments, and across simulation and real-world trials. 7.1 Implementation We now turn to detail our implementation of all of the ex- periments done in this paper. Altogether, the experiments involve well over 4,000 written lines of code. Training environments and algorithms. We implement the standard ABR simulation environment by extending the code of the Park Project [32] and interfacing with Puffer traces [55]. We implement the CC simulation environment by extending the source code provided by Aurora [23]. We use the standard OpenAI Gym [10] interface and the RL libraries Stable-Baselines 3 [43] and RLlib [28]. PTS. We implement PTS completely outside of the DRL work- flow in the Trace Selection Module. To implement the critical feature identification stage we use tsfresh [13] for its feature- extraction tools and Scikit-Learn [41] for its decision tree and clustering implementation. To implement the clustering stage, we again use Scikit-Learn for its Gaussian Mixture 9 A straightforward implementation of PTS can directly interfere with the various distributed training paradigms em- ployed in many DRL algorithms [21, 36]. To this degree, we implement our prioritization strategy using the distributed shared object-store paradigm Ray [38]. This allows us to share the selection weights across distributed RL processes without interfering with any DRL workflows. With our implementation, the overhead for PTS is minimal. The Critical Feature Identification and clustering stages are completed once before training, with runtimes in the order of minutes. The prioritization calculation adds a computational overhead in the order of milliseconds per iteration. This added prioritization computation is handled in parallel to the DRL training and does not slow it down. 7.2 Settings In this section, we present the settings used in our experi- ments. For simulation, we present our results as averages over 4 random seeds. For real-world testing, we select the best of these four seeds for benchmarking. For more details about these settings, see Appendix C and D. ABR-Simulation. For simulation, we use the network traces logged by the Puffer platform over the two-month period of (a) ABR Simulation: All traces (b) ABR Simulation: Slow traces (< 0.75 Mbps) (c) CC Simulation (d) ABR Real-World: All traces (e) ABR Real-World: Slow traces (< 0.75 Mbps) (f) CC Real-World Figure 9: PTS performance over ABR and CC: PTS outperforms Random Selection in simulation and real-world environment for both ABR and CC. The plots on ABR-real-world deployment visualize data from the Puffer platform over the period 07 Mar '22-05 Oct '22, comprising of over 25.5 stream-years of video. We re-plot the data from the Puffer website [2] to aggregate the different experiment periods together. The plot on CC real-world visualizes the results of our experiment on the Pantheon platform. 95% confidence intervals are shown as error bars and bands. April 2021 - May 2021. The traces are system logs of the video streams. Each trace is a time series of tuples over all chunks sent during the session that includes (i) the chunk sizes and SSIMs at various bitrates, (ii) the bitrate chosen by the ABR algorithm for that chunk, and (iii) the time taken to trans- mit that chunk. We calculate the effective throughput over time using this data and use it alongside the chunk sizes and SSIMs for simulation. We enforce a minimum trace length requirement of 3 stream-minutes to reduce I/O overhead. Moreover, during training, we randomly split long traces into lengths of 500 chunks in order to prevent them from dominating training. This results in over 75, 000 traces, of which we randomly select about 55, 000, representing over 4.25 stream-years, for our analysis. Of these, we use 40, 000 for training and about 15, 000 for testing. We evaluate every controller using the same train and test set. ABR-Real World. We test Gelato with both Random selec- tion and PTS on the Puffer platform from 06 March 2022 - 05 October 2022. We report the performance as SSIM vs. stall ratio, following the convention used by the Puffer plat- form [55]. We compare Gelato-Random and Gelato-PTS with the per- formance of the Buffer-based controller BBA [22], the in-situ continuous training controller Fugu [55], and its February 2019 trained variant Fugu-Feb. We note that on the Puffer platform, Gelato-Random is called by its code name "unagi", Gelato-PTS is called "maguro". We further note that unlike all experiments, this experiment involves an older version of PTS, Gelato-PTS-v1. Gelato-PTS-v1 was trained on an earlier version of the PTS framework where feature extrac- tion and clustering were only partially automated, and the prioritization was static with equal weights on all clusters. The latest version, Gelato-PTS, trained on the framework with fully automated feature extraction and clustering, and dynamic prioritization offers slightly better performance in simulation (Figures 9a and 9b). Since at least 20 stream-years 10 of data is needed on the Puffer platform to reliably estimated the performance of a controller, we present Puffer results for Gelato-PTS-v1 due to time constraints. Based on our simula- tions, we expect Gelato-PTS performance to be better than Gelato-PTS-v1 in the real world as well. CC-Simulation. For simulation, we use the synthetic net- work traces employed by the DRL CC algorithm Aurora [23]. Here, each trace is represented by 4 key simulation param- eters: throughput, latency, maximum queue size and loss. For training, we sample throughput from range [100, 500] packets per second, latency from range [50, 300] millisec- onds, maximum queue size from range [2, 50] packets, and loss rate from [0, 2] percent. For testing, we broaden the ranges and sample throughput from [50, 1000], latency from [25, 500], maximum queue size from [2, 75], and loss from [0, 3]. We sample throughput, maximum queue size and loss rate spaced evenly in the range on a geometric progression, while sampling latency uniformly evenly. We note that we do this sampling only once and fix it for both training and testing for all controllers. CC-Real World. To broadly analyze the performance of our Congestion Control agents, we deploy them in a local client-server communication environment using the Pan- theon project [56], and analyze their performance over 5 runs of 60 seconds each in a calibrated emulation environment of a lossy Nepal-AWS India link. Alongside our controllers, we benchmark the standard congestion control algorithm TCP Cubic [19], and the state-of-the-art algorithms TCP BBR [11], Copa [7] and PCC-Vivace [14]. We present our results as Throughput vs. Latency, following the convention used by the Pantheon project. 7.3 Results In this section, we present the results of our experiments evaluating PTS in ABR and CC. We aim to answer the follow- ing questions: How does the performance of PTS compare with Random selection? How do controllers trained with PTS perform in the real world? In Figure 9, we present our results comparing PTS with Random selection and other controllers. We present our ob- servations below. PTS outperforms Random Trace Selection across all benchmarks. With Adaptive Bitrate Streaming and Con- gestion Control, in both simulation and the real world, PTS achieves higher performance than Random trace selection. In Figures 9a, 9b, 9d and 9e, we analyze the performance of PTS in ABR. We observe that PTS converges to a higher test reward, particularly in the Slow traces. We see that Pensieve- PTS significantly improves upon Pensieve-Random, but that the improvement is not enough to match the performance 11 of Gelato. We also observe that Gelato-PTS-v1, which em- ployed a simpler prioritization strategy, closely tracks the performance of PTS. In the real world, Gelato-PTS-v1 signif- icantly improves upon Gelato-Random in both stalling and quality. In Figure 9c and 9f, we focus on the performance of PTS in CC. We find that PTS improves the simulation test reward and the real-world latency-throughput performance. However, this improvement to Aurora is not enough to make it competitive with other state-of-the-art CC algorithms. Gelato trained with PTS outperforms state-of-the-art controllers in the real world over an 8-month period. To further understand the benefit of PTS, we run Gelato with PTS-v1 and Random selection on the Real-world Live- streaming Puffer platform [55]. In Figures 9d and 9e, we see that Gelato-PTS-v1 outperforms the current state-of-the- art in-situ trained and heuristic-based ABR controllers in both SSIM and stalling. Gelato achieves this performance improvement without relying on TCP metrics and without retraining on new data. Over this 8-month period, the algorithms we analyze streamed over 25.5 stream-years of videos to over 60, 000 viewers across the Internet [55]. Over this duration, Gelato- PTS-v1 achieves 59% and 75% stall reduction compared to Fugu and BBA respectively (Figure 9d). Gelato-PTS-v1 ad- ditionally achieves SSIM improvements of 0.14 dB and 0.23 dB over Fugu and BBA respectively. Note that this quality improvement over BBA is more than 2.5× the one provided by Fugu, which attained 0.09 dB improvement over BBA. Gelato-PTS-v1 has an average SSIM variation of 0.75 dB (compared to Fugu's 0.53 dB and BBA's 0.77 dB). Moreover, we find that Gelato-Random is a strong baseline, achieving 0.09 dB SSIM improvement over Fugu while maintaining a similar stall ratio . Summary: The study on learning in-situ [55] suggested that fundamental environmental and algorithmic changes were needed before DRL could achieve competitive real-world performance. We show that this can be achieved in trace- based environments with our simple and generalizable PTS framework. Our results corroborate the findings of studies on Atari 2600 [21, 45] games, highlighting that feature learning and state-action space exploration are vital parts of practical RL performance, and that small but systematic improvements in the simulation environment and training procedures can dramatically change how DRL solutions perform. Below, we summarize the findings of our experiments with ABR and CC presented in this section, and the analysis of our extensive PTS benchmarking presented in Section 6. • PTS is a generalized solution for DRL training in trace- driven environments that automatically balances the trace distribution, and offers significant improvement in per- formance over random selection in ABR and in CC, in simulation and in real-world testing, over both on-policy and off-policy algorithms. • PTS's dynamic prioritization strategy can successfully adapt to a variety of trace distributions, providing con- trollers with greater performance and robustness in all. • Gelato trained with PTS-v1 offers the best performance when compared to prior ABR controllers on the real-world Puffer platform. It achieves a 59% reduction in stalls and 0.14 dB improvement in SSIM over Fugu [55]. 8 DISCUSSION AND LIMITATIONS We envision Prioritized Trace Selection (PTS) to open a new avenue of research in the context of DRL training. Rather than evolve into another hyperparameter that needs tuning in complex RL settings, the problem of trace selection lends itself well to principled analysis, and in turn a generalized and broadly applicable solution. However, PTS still leaves a gap for future work to build upon. Future direction for PTS. In addition to networking envi- ronments, PTS can also be beneficial in other trace-driven DRL settings such as drone control, autonomous driving, etc. PTS, as we presented it, cannot be directly employed in such environments with more complex input processes. However, extensions to the PTS scheme presented in this paper may be an interesting future direction. Sim2Real Gap. PTS changes which traces get selected and not how they are simulated. PTS does not address the prob- lem related to the gap between the simulation environment and the real-world setting (Sim2Real Gap). Solutions that bring simulation closer to reality while still maintaining training efficiency can be combined with PTS. Large-Scale Training. It is possible that the benefits of higher state-action exploration and feature learning offered by PTS diminish with a very deep neural network over a large number of training steps and parallel trace environments. Our experimental evidence suggests that PTS is highly rele- vant for practical DRL environments and training settings. However, we cannot ascertain the effectiveness of PTS at the scale of state-of-the-art Go agents [46], which requires training capabilities only available to large companies. 9 RELATED WORK Prioritization in Supervised learning. Class imbalance is a challenge in supervised data-driven networking problems, where samples of some classes of network conditions or scenarios occur rarely [15, 27, 29, 57]. A popular technique to address this problem is to oversample/undersample certain 12 classes to ensure that the model does not drown out the error in the minority classes [26]. Prioritization in DRL. While we present the first system- atic methodology of prioritization of traces in DRL, prioriti- zation/importance sampling has been applied at other points in the DRL workflow. PER is used to prioritize transitions in the replay buffer in actor-critic algorithms [51], in the multi- agent setting [17], and in text-based DRL environments [39] to improve sample efficiency. Horgan et.al [21] used PER in conjunction with distributed acting to improve feature learn- ing. Schulman et.al [47, 48] employed importance sampling with on-policy experience in on-policy training. However, as shown in our experiment (Figure 3), these prior solutions cannot address the skew in input distribution that PTS tar- gets. In trace-based environments, PTS can be combined with any of these prior techniques for further optimization. DRL for Networking and Systems applications. While PTS focuses on improving training over a given input dataset, Gilad et.al. [18] employed RL to find additional training traces that can help the DRL agent generalize to unseen network conditions. Building on this idea, Xia et al. [54] introduced a systematic Curriculum Learning based approach to generate additional environment configurations. Both of techniques generate additional training material for performance in un- seen conditions and do not address the skew in the trace selec- tion process. PTS is complementary to these techniques and can be employed in conjunction. Mao et.al. [35] introduced the algorithm-side optimization of using input-dependent baselines to reduce the variance of on-policy algorithms at the policy optimization step. Since PTS works outside the DRL training loop, it can also be used in conjunction with any such algorithm-side optimizations. Doubly Robust estima- tion [24] helps in estimating performance variations during trace-driven evaluation but does not address the skew in the dataset directly. 10 CONCLUSION Practical adoption of DRL-based network controllers is lim- ited because the research community does not fully know how to produce high performant controllers. With Priori- tized Trace Selection (PTS), we put forward a systematic methodology for improving the performance and robustness of DRL controllers by addressing skew in input datasets dur- ing training. We thoroughly study the impact of PTS, and show that PTS provides generalizable performance improve- ment across multiple trace distributions, DRL environments and algorithms. Our novel DRL-based ABR controller, Gelato, trained with PTS offers state-of-the-art performance on the real-world Puffer platform. PTS opens a new avenue of re- search for methodical control over DRL training in trace- driven networking environments and beyond. REFERENCES [1] [n. d.]. Expectation–maximization algorithm - Wikipedia. https://en. wikipedia.org/wiki/Expectation%E2%80%93maximization_algorithm. ([n. d.]). (Accessed on 01/16/2023). [2] [n. d.]. Puffer. https://puffer.stanford.edu/results/. ([n. d.]). (Accessed on 04/20/2022). [3] [n. d.]. Scikit-Learn Recursive Feature Elimiation. https: //scikit-learn.org/stable/modules/generated/sklearn.feature_ selection.RFE.html#sklearn.feature_selection.RFE. ([n. d.]). (Accessed on 01/15/2023). [4] [n. d.]. Silhouette (clustering) - Wikipedia. https://en.wikipedia.org/ wiki/Silhouette_(clustering). ([n. d.]). (Accessed on 01/16/2023). [5] Soheil Abbasloo, Chen-Yu Yen, and H Jonathan Chao. 2020. Classic meets modern: A pragmatic learning-based congestion control for the Internet. In Proceedings of the Annual conference of the ACM Special Interest Group on Data Communication on the applications, technologies, architectures, and protocols for computer communication. 632–647. [6] Joshua Achiam. 2018. Spinning Up in Deep Reinforcement Learning. (2018). [7] Venkat Arun and Hari Balakrishnan. 2018. Copa: Practical delay-based congestion control for the internet. In 15th {USENIX} Symposium on Networked Systems Design and Implementation ({NSDI} 18). 329–342. [8] Adrià Puigdomènech Badia, Bilal Piot, Steven Kapturowski, Pablo Sprechmann, Alex Vitvitskyi, Zhaohan Daniel Guo, and Charles Blun- dell. 2020. Agent57: Outperforming the atari human benchmark. In International Conference on Machine Learning. PMLR, 507–517. [9] Adrià Puigdomènech Badia, Pablo Sprechmann, Alex Vitvitskyi, Daniel Guo, Bilal Piot, Steven Kapturowski, Olivier Tieleman, Martín Ar- jovsky, Alexander Pritzel, Andew Bolt, et al. 2020. Never give up: Learn- ing directed exploration strategies. arXiv preprint arXiv:2002.06038 (2020). [10] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. 2016. Openai gym. arXiv preprint arXiv:1606.01540 (2016). [11] Neal Cardwell, Yuchung Cheng, C Stephen Gunn, Soheil Hassas Yeganeh, and Van Jacobson. 2017. BBR: congestion-based congestion control. Commun. ACM 60, 2 (2017), 58–66. [12] Li Chen, Justinas Lingys, Kai Chen, and Feng Liu. 2018. Auto: Scaling deep reinforcement learning for datacenter-scale automatic traffic optimization. In Proceedings of the 2018 conference of the ACM special interest group on data communication. 191–205. [13] Maximilian Christ, Nils Braun, Julius Neuffer, and Andreas W Kempa- Liehr. 2018. Time series feature extraction on basis of scalable hy- pothesis tests (tsfresh–a python package). Neurocomputing 307 (2018), 72–77. [14] Mo Dong, Tong Meng, Doron Zarchy, Engin Arslan, Yossi Gilad, Brighten Godfrey, and Michael Schapira. 2018. {PCC} vivace: Online- learning congestion control. In 15th {USENIX} Symposium on Net- worked Systems Design and Implementation ({NSDI} 18). 343–356. [15] Shi Dong. 2021. Multi class SVM algorithm with active learning for network traffic classification. Expert Systems with Applications 176 (2021), 114885. [16] William Fedus, Prajit Ramachandran, Rishabh Agarwal, Yoshua Bengio, Hugo Larochelle, Mark Rowland, and Will Dabney. 2020. Revisiting fundamentals of experience replay. In International conference on ma- chine learning. PMLR, 3061–3071. [17] Jakob Foerster, Nantas Nardelli, Gregory Farquhar, Triantafyllos Afouras, Philip HS Torr, Pushmeet Kohli, and Shimon Whiteson. 2017. Stabilising experience replay for deep multi-agent reinforcement learn- ing. In International conference on machine learning. PMLR, 1146–1155. [18] Tomer Gilad, Nathan H Jay, Michael Shnaiderman, Brighten Godfrey, and Michael Schapira. 2019. Robustifying network protocols with adversarial examples. In Proceedings of the 18th ACM Workshop on Hot Topics in Networks. 85–92. [19] Sangtae Ha, Injong Rhee, and Lisong Xu. 2008. CUBIC: a new TCP- friendly high-speed TCP variant. ACM SIGOPS operating systems review 42, 5 (2008), 64–74. [20] Matthew Hausknecht and Peter Stone. 2015. Deep recurrent Q-learning for partially observable MDPs. In 2015 aaai fall symposium series. [21] Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Mat- teo Hessel, Hado Van Hasselt, and David Silver. 2018. Distributed prioritized experience replay. arXiv preprint arXiv:1803.00933 (2018). [22] Te-Yuan Huang, Ramesh Johari, Nick McKeown, Matthew Trunnell, and Mark Watson. 2014. A buffer-based approach to rate adaptation: Evidence from a large video streaming service. In Proceedings of the 2014 ACM conference on SIGCOMM. 187–198. [23] Nathan Jay, Noga Rotman, Brighten Godfrey, Michael Schapira, and Aviv Tamar. 2019. A deep reinforcement learning perspective on internet congestion control. In International conference on machine learning. PMLR, 3050–3059. [24] Junchen Jiang, Vyas Sekar, Ion Stoica, and Hui Zhang. 2017. Unleashing the potential of data-driven networking. In International Conference on Communication Systems and Networks. Springer, 110–126. [25] Steven Kapturowski, Georg Ostrovski, John Quan, Remi Munos, and Will Dabney. 2018. Recurrent experience replay in distributed rein- forcement learning. In International conference on learning representa- tions. [26] Harsurinder Kaur, Husanbir Singh Pannu, and Avleen Kaur Malhi. 2019. A systematic review on imbalanced data challenges in machine learning: Applications and solutions. ACM Computing Surveys (CSUR) 52, 4 (2019), 1–36. [27] Joffrey L Leevy, Taghi M Khoshgoftaar, and Jared M Peterson. 2021. Mit- igating class imbalance for iot network intrusion detection: a survey. In 2021 IEEE Seventh International Conference on Big Data Computing Service and Applications (BigDataService). IEEE, 143–148. [28] Eric Liang, Richard Liaw, Robert Nishihara, Philipp Moritz, Roy Fox, Ken Goldberg, Joseph E. Gonzalez, Michael I. Jordan, and Ion Stoica. 2018. RLlib: Abstractions for Distributed Reinforcement Learning. In International Conference on Machine Learning (ICML). [29] Xiaoyu Liang and Taieb Znati. 2019. An empirical study of intelligent approaches to DDoS detection in large scale networks. In 2019 Inter- national Conference on Computing, Networking and Communications (ICNC). IEEE, 821–827. [30] Hongzi Mao, Mohammad Alizadeh, Ishai Menache, and Srikanth Kan- dula. 2016. Resource management with deep reinforcement learning. In Proceedings of the 15th ACM workshop on hot topics in networks. 50–56. [31] Hongzi Mao, Shannon Chen, Drew Dimmery, Shaun Singh, Drew Blaisdell, Yuandong Tian, Mohammad Alizadeh, and Eytan Bakshy. 2020. Real-world video adaptation with reinforcement learning. arXiv preprint arXiv:2008.12858 (2020). [32] Hongzi Mao, Parimarjan Negi, Akshay Narayan, Hanrui Wang, Ji- acheng Yang, Haonan Wang, Ryan Marcus, Mehrdad Khani Shirkoohi, Songtao He, Vikram Nathan, et al. 2019. Park: An open platform for learning-augmented computer systems. Advances in Neural Informa- tion Processing Systems 32 (2019). [33] Hongzi Mao, Ravi Netravali, and Mohammad Alizadeh. 2017. Neural adaptive video streaming with pensieve. In Proceedings of the Con- ference of the ACM Special Interest Group on Data Communication. 197–210. 13 [50] Richard S Sutton and Andrew G Barto. 2018. Reinforcement learning: An introduction. MIT press. [51] Ziyu Wang, Victor Bapst, Nicolas Heess, Volodymyr Mnih, Remi Sam- Munos, Koray Kavukcuoglu, and Nando de Freitas. 2016. ple efficient actor-critic with experience replay. arXiv preprint arXiv:1611.01224 (2016). [52] Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. 2004. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing 13, 4 (2004), 600–612. [53] Ziyu Wang, Tom Schaul, Matteo Hessel, Hado Hasselt, Marc Lanctot, and Nando Freitas. 2016. Dueling network architectures for deep reinforcement learning. In International conference on machine learning. PMLR, 1995–2003. [54] Zhengxu Xia, Yajie Zhou, Francis Y Yan, and Junchen Jiang. 2022. Genet: automatic curriculum generation for learning adaptation in networking. In Proceedings of the ACM SIGCOMM 2022 Conference. 397–413. [55] Francis Y Yan, Hudson Ayers, Chenzhi Zhu, Sadjad Fouladi, James Hong, Keyi Zhang, Philip Levis, and Keith Winstein. 2020. Learning in situ: a randomized experiment in video streaming. In 17th USENIX Symposium on Networked Systems Design and Implementation (NSDI 20). 495–511. [56] Francis Y Yan, Jestin Ma, Greg D Hill, Deepti Raghavan, Riad S Wahby, Philip Levis, and Keith Winstein. 2018. Pantheon: the training ground for Internet congestion-control research. In 2018 USENIX Annual Tech- nical Conference (USENIX ATC 18). 731–743. [57] Qizhen Zhang, Kelvin KW Ng, Charles Kazer, Shen Yan, João Sedoc, and Vincent Liu. 2021. MimicNet: fast performance estimates for data center networks with machine learning. In Proceedings of the 2021 ACM SIGCOMM 2021 Conference. 287–304. [58] Hang Zhu, Varun Gupta, Satyajeet Singh Ahuja, Yuandong Tian, Ying Zhang, and Xin Jin. 2021. Network planning with deep reinforcement learning. In Proceedings of the 2021 ACM SIGCOMM 2021 Conference. 258–271. [34] Hongzi Mao, Malte Schwarzkopf, Shaileshh Bojja Venkatakrishnan, Zili Meng, and Mohammad Alizadeh. 2019. Learning scheduling algo- rithms for data processing clusters. In Proceedings of the ACM special interest group on data communication. 270–288. [35] Hongzi Mao, Shaileshh Bojja Venkatakrishnan, Malte Schwarzkopf, and Mohammad Alizadeh. 2018. Variance reduction for reinforcement learning in input-driven environments. arXiv preprint arXiv:1807.02264 (2018). [36] Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. 2016. Asynchronous methods for deep reinforcement learning. In International conference on machine learning. PMLR, 1928– 1937. [37] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioan- nis Antonoglou, Daan Wierstra, and Martin Riedmiller. 2013. Playing Atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602 (2013). [38] Philipp Moritz, Robert Nishihara, Stephanie Wang, Alexey Tumanov, Richard Liaw, Eric Liang, Melih Elibol, Zongheng Yang, William Paul, Michael I Jordan, et al. 2018. Ray: A distributed framework for emerg- ing {AI} applications. In 13th USENIX Symposium on Operating Systems Design and Implementation (OSDI 18). 561–577. [39] Karthik Narasimhan, Tejas Kulkarni, and Regina Barzilay. 2015. Lan- guage understanding for text-based games using deep reinforcement learning. arXiv preprint arXiv:1506.08941 (2015). [40] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. 2019. Pytorch: An imperative style, high-performance deep learning library. Advances in neural informa- tion processing systems 32 (2019). [41] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. 2011. Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research 12 (2011), 2825–2830. [42] Tobias Pohlen, Bilal Piot, Todd Hester, Mohammad Gheshlaghi Azar, Dan Horgan, David Budden, Gabriel Barth-Maron, Hado Van Hasselt, John Quan, Mel Večerík, et al. 2018. Observe and look further: Achiev- ing consistent performance on Atari. arXiv preprint arXiv:1805.11593 (2018). [43] Antonin Raffin, Ashley Hill, Adam Gleave, Anssi Kanervisto, Maximil- ian Ernestus, and Noah Dormann. 2021. Stable-Baselines3: Reliable Reinforcement Learning Implementations. Journal of Machine Learning Research 22, 268 (2021), 1–8. http://jmlr.org/papers/v22/20-1364.html [44] Antonin Raffin, Jens Kober, and Freek Stulp. 2022. Smooth exploration for robotic reinforcement learning. In Conference on Robot Learning. PMLR, 1634–1644. [45] Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. 2015. Prioritized experience replay. arXiv preprint arXiv:1511.05952 (2015). [46] Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Si- monyan, Laurent Sifre, Simon Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, et al. 2020. Mastering Atari, Go, Chess and Shogi by planning with a learned model. Nature 588, 7839 (2020), 604–609. [47] John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. 2015. Trust region policy optimization. In International conference on machine learning. PMLR, 1889–1897. [48] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347 (2017). [49] David Silver. 2015. Lectures on Reinforcement Learning. url: https: //www.davidsilver.uk/teaching/. (2015). 14 Potential Trace Features Mean Quantile Quantile Quantile Truncated Mean Truncated Mean Truncated Mean Absolute Fourier Transform Spectrum Ratio of Values beyond standard dev. Ratio of Values beyond standard dev. Variation Coefficient Central Approximation of Second Derivative Truncated Mean Absolute Change Truncated Mean Absolute Change Autocorelation Autocorelation Autocorelation Parameters for feature – 2.5th 5th 95th 5th quantile 12.5th quantile 25th quantile Spectral Centroid Beyond 1× standard dev. Beyond 2.5× standard dev. – Mean Aggregation Truncated beyond 5th and 95th quantile Truncated beyond 1.25th and 98.75th quantile Lag of 3 Lag of 4 Lag of 8 Table 1: All of the Trace features extracted using the library tsfresh [13]. These features are extracted for each trace dataset and then automatically filtered by our novel feature selection technique. (a) Adaptive Bitrate Streaming Traces (b) Congestion Control Traces Figure 10: Visualization of PTS Clustering in ABR and CC: We visualize the clustering automatically produced by PTS in ABR and CC. We see that PTS produces minimal clusters while also separating salient characteristics such as mean throughput and latency. Note that Throughput CV is the per-trace coefficient of variation of throughput, and that the axes are different. 15 (a) Majority Fast Dataset (b) Balanced Dataset (c) Majority Slow Dataset Figure 11: Visualization of PTS Clustering in TraceBench: We visualize the clustering automatically produced by PTS in the Majority Fast, Balanced, and Majority Slow datasets. In each of the datasets, we see that PTS can successfully separate the two levels of throughput and variance. Note that Throughput CV is the per-trace coefficient of variation of throughput, and that the axes are different across all plots. Figure 12: Visualization of the prioritization found by PTS in various datasets: The relative change in selection weight for each kind of traces over the training progress. Selecting all kinds of traces at weight 1 is equivalent to Random selection. Here, we see that PTS successfully adapts to the behavior of the agent and the trace distribution by prioritizing the important kinds of traces in each dataset. PTS automatically identifies, clusters, and prioritizes the traces. We note that the ground-truth labels (e.g Slow-High Variance) are not provided to PTS, they are attached during plotting and shown here for visualization purposes. 16 A PRIORITIZED TRACE SELECTION DETAILS In this section, we provide details, visualizations and analysis of the PTS and its three stages. A.1 Critical Feature Identification We recall that in the Critical Feature Identification stage, PTS identifies traces by first extracting a wide range of features and then filtering them to find the critical features. A wide range of features is extracted for each trace in the dataset of traces. Then, this set of features goes through our automated filtering process. During this process, about 40% of the features are eliminated. In Table 1, we present the list of all the features extracted. The list contains 16 features, of which 7 describe the central tendency and 9 describe the spread of the input values. In TraceBench, the following critical features of the net- work throughput traces are identified. Majority Fast dataset: Truncated Mean Absolute Change of 5th and 95th quantile, Truncated Mean Absolute Change of 1.25th and 98.75th quan- tile, Truncated Mean of the 5th quantile, Truncated Mean of the 12.5th quantile, Truncated Mean of the 25th quan- tile, and Variation Coefficient. Balanced dataset: Truncated Mean Absolute Change of 5th and 95th quantile, Truncated Mean Absolute Change of 1.25th and 98.75th quantile, Trun- cated Mean of the 5th quantile, Truncated Mean of the 12.5th quantile, Truncated Mean of the 25th quantile, and Variation Coefficient. Majority Slow dataset: Autocorrelation with lag 3, Autocorrelation with lag 8, Truncated Mean of the 5th quantile, Truncated Mean of the 12.5th quantile, Truncated Mean of the 25th quantile, and Variation Coefficient. In ABR, the following critical features of throughput are identified: Autocorrelation with lag 3, Mean, Spectral Cen- troid of the Absolute Fourier Transform Spectrum, 2.5th quantile, 5th quantile, 95th quantile, Ratio of Values beyond 2.5× standard deviation, truncated Mean Absolute Change of 5th and 95th quantile, and Truncated Mean Absolute Change of 1.25th and 98.75th quantile. In Congestion Control, because traces are not time-varying series but instead a tuple of key simulation values, the tuple is treated as the set of critical features. These key simulation values include Bandwidth, Latency, Max. Queue Size, and Loss. We observe that PTS finds different features to be critical for different datasets. This highlights the ability of PTS to effectively adapt to the distribution of training traces in order to successfully them. A.2 Clustering We recall that in the Clustering stage of PTS, we group similar traces together to attempt to reduce the complexity of the prioritization problem from a trace-level to a cluster. We do this by automatically finding both the clustering and the optimal number of features through a search proce- dure. In TraceBench, we search for the number of clusters in range [3, 7]. In ABR, we search in the range [6, 15], and in CC, we search in the range [4, 9]. In Figures 10 and 11, we visual- ize the clustering found by PTS. We see that PTS effectively groups and separates traces in all five trace datasets. A.3 Prioritization We recall that in the Prioritization stage of PTS, we observe the controller's training and dynamically prioritize salient clusters that allow the controller to focus on clusters with the most to learn from. In order to visualize this prioritization, in Figure 12, we plot the relative change in selection weights of traces during training. We observe that while training on the Majority Fast dataset, it undersamples the Fast traces and oversamples the Slow ones. In the Majority Slow dataset, it undersamples the Slow–Low Variance traces while oversampling the Fast and Slow–High Variance ones. This highlights the power of PTS's automated prioritization: It adapts itself to the distribution in each dataset and balances it effectively. B TRACEBENCH DETAILS In designing TraceBench, we aim to create an environment to reliable and thoroughly evaluate different prioritization techniques. We build our environment on top of the standard ABR implementation found in the Park Project [32]. We allow the client to have a maximum buffer of 15 seconds. We consider traces with a maximum length of 100 seconds, with chunks of 1 second. The chunk sizes are generated by sampling a Gaussian distribution around the bitrates [1.0, 3.0, 6.0] megabytes per second. When generating the traces, we consider two levels of throughput, fast and slow, and two levels of variance, high- variance and low-variance. When generating a trace, we use a 2-state Markov model switching between high and low throughput with different switching probabilities for each kind of trace. In Figure 13, we present a throughput vs. time visualization of each of the four different kinds of traces. When training the controllers in TraceBench, we use the state-of-the-art feed-forward DQN algorithm Ape-X Dqn [21]. We use framestacking of history length 10. We additionally use a standard reward normalization function [42] to nor- malize the rewards. We use the training parameters defined in Table 2. We use a simple fully connected architecture with 17 Figure 13: Visualization of Traces generated in TraceBench: A Throughput vs Time plot of example traces used in TraceBench. The broad coverage of mean and variance of the throughput requires the agent to learn to adapt to each kind of trace different. 2 layers of 256 units. We additionally use the dueling and double DQN architecture with a hidden fully connected layer of 256 units. C ADAPTIVE BITRATE STREAMING DETAILS In ABR, we introduce the novel controller architecture Gelato. Gelato's neural architecture uses frame-stacking with 10 past values for the client data, and 5 future values of chunk sizes and SSIMs at every encoded bitrate. The client data is passed through a 1D convolution with a kernel size of 3 and 64 filters, followed by another 1D convolution of the same kernel size and filters. The chunk sizes and SSIMs are each passed through their own 1D convolution with a kernel size of 5 and 32 filters, each followed by another 1D convolution with the same kernel size and number of filters. The second layer of convolutions reduces the size of the resulting output by a factor proportional to the size of the kernel. The result- ing features are concatenated and passed through a policy and a value network each made up of a single hidden layer of 256 neurons. Note that the value network is not used outside of training. An inference on Gelato's neural network takes less than 0.35 ms on average on a core of our x86 − 64 CPU server in Python-a minimal per-chunk overhead for Puffer's 2.002 second chunk duration. To train Gelato, we use the 18 A2C algorithm [36] using a standard reward normalization strategy [42] and the training parameters defined in Table 3. The off-policy DQN variant of Gelato uses the same archi- tecture, swapping the final policy and value networks for a single dueling Q-network made up of a single hidden layer of 256 neurons. We additionally use a standard reward nor- malization function [42] to normalize the rewards. To train this variant of Gelato, we use the Ape-X DQN algorthm [21] using the training parameters defined in Table 4. We train Pensieve [33] using its original architecture. How- ever, because the original implementation could only work with the traces provided by the authors, to adapt Pensieve to new traces, we use the same training environment and DRL parameters as Gelato. In presenting the results for Gelato in the real world, we re-plot the data found from on the Puffer Platform [55] in Figure 9d and 9e in Section 7. In our analysis, we present the data from dates 07 Mar' 2022 through 05 Oct'2022. However, because the platform was experiencing issues and bench- marking other ABR controllers, this data is split across mul- tiple plots. To aggregate the data together, we first down- load the pre-processed public data available from the Puffer Website [2]. Second, we follow the same technique used by the platform, and employ a sampling-based approach to esti- mate the mean and 95% confidence interval of quality, quality (a) Puffer Website plot of All Traces (b) Puffer Website plot of Slow Traces, < 0.75 Mbps Figure 14: Raw Performance Plots from the Puffer Platform [2] taken on date 15 Feb' 2023, presenting results from 28 Dec' 2022-13 Feb' 2023. The results visualize 14.0 steam-years of data. Similar to our main results, we see that Gelato-PTS-v1 (maguro) outperforms all other state-of-the-art ABR controllers in both video quality and stalling, and that Gelato-Random (unagi) improves overall video quality while achieving similar stalling performance. change and stalling for each ABR algorithm. We ignore all the days when the platform was under maintenance (such as 17 July 2022) and days when the platform produced faulty data due to a known bug in the code (such as 10 December 2022). For completeness, we present the current results from the Puffer Platform in Figure 14. In this plot, we analyze 14.0 stream-years of data, collected over the period 28 December 2022 through 13 February 2023. We observe that Gelato-PTS- v1 still outperforms state-of-the-art ABR algorithms in both Quality and Stalling. Despite being trained on traces almost 2 years old, its performance does not degrade. This result highlights how PTS can successfully train robust and high performant controllers in simulation. D CONGESTION CONTROL DETAILS In CC, we train and evaluate Aurora [23] with different pri- oritization techniques. We use framestacking with a history length of 25. We use a 2-layer fully connected neural architec- ture with 64 units for both the policy and value function. We additionally use State-Dependent noise for exploration [44] and reward scaling. We use the training parameters defined in Table 5 with the algorithm A2C [36]. Hyperparameter Number of actors Number of training steps Learning rate Replay batch size γ Replay buffer size N-step return ε annealing interval Value clipping Value 4 4e6 7.5e−6 32 0.975 250000 7 7e5 steps [-32, 32] Table 2: TraceBench training parameters for Ape-X DQN [21]. Parameters left unspecified follow the default ones provided in RLlib v0.13 [28]. 19 Hyperparameter Learning rate Number of parallel envs. Number of training steps Update horizon (tmax ) GAE N-step return γ Value function coefficient in loss Entropy Entropy annealing interval Gradient clipping Value 0.001 64 4e8 15 env. steps 15 0.95 0.9 [5.75, 0.0025] 2e8 steps 0.4 Table 3: Gelato's training hyperparameters. Parameters left unspecified follow the default ones provided in Stable- Baselines3 v1.5.0 [43] for the A2C algorithm. Hyperparameter Number of actors Number of training steps Learning rate Replay batch size γ Replay buffer size N-step return Value clipping Value 64 1e9 7.5e−6 128 0.95 2M 7 [-32, 32] Table 4: Training parameters for the off-policy variant of Gelato. Parameters left unspecified follow the default ones provided in RLlib v0.13 [28]. Hyperparameter Learning rate Number of parallel envs. Number of training steps Update horizon (tmax ) GAE N-step return γ Value function coefficient in loss Entropy Entropy annealing interval Gradient clipping Value 0.000125 16 5e6 15 env. steps 15 0.975 0.05 [0.1, 0.005] 2.5e6 steps 0.25 Table 5: Aurora's training hyperparameters. Parameters left unspecified follow the default ones provided in Stable- Baselines3 v1.5.0 [43] for the A2C algorithm. 20
http://arxiv.org/abs/2302.12400v1
2023-02-24T02:03:41
2023-02-24T02:03:41
Towards Stable Test-Time Adaptation in Dynamic Wild World
Test-time adaptation (TTA) has shown to be effective at tackling distribution shifts between training and testing data by adapting a given model on test samples. However, the online model updating of TTA may be unstable and this is often a key obstacle preventing existing TTA methods from being deployed in the real world. Specifically, TTA may fail to improve or even harm the model performance when test data have: 1) mixed distribution shifts, 2) small batch sizes, and 3) online imbalanced label distribution shifts, which are quite common in practice. In this paper, we investigate the unstable reasons and find that the batch norm layer is a crucial factor hindering TTA stability. Conversely, TTA can perform more stably with batch-agnostic norm layers, \ie, group or layer norm. However, we observe that TTA with group and layer norms does not always succeed and still suffers many failure cases. By digging into the failure cases, we find that certain noisy test samples with large gradients may disturb the model adaption and result in collapsed trivial solutions, \ie, assigning the same class label for all samples. To address the above collapse issue, we propose a sharpness-aware and reliable entropy minimization method, called SAR, for further stabilizing TTA from two aspects: 1) remove partial noisy samples with large gradients, 2) encourage model weights to go to a flat minimum so that the model is robust to the remaining noisy samples. Promising results demonstrate that SAR performs more stably over prior methods and is computationally efficient under the above wild test scenarios.
[ "Shuaicheng Niu", "Jiaxiang Wu", "Yifan Zhang", "Zhiquan Wen", "Yaofo Chen", "Peilin Zhao", "Mingkui Tan" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12400v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12400v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV" ]
3 2 0 2 b e F 4 2 ] G L . s c [ 1 v 0 0 4 2 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 TOWARDS STABLE TEST-TIME ADAPTATION IN DYNAMIC WILD WORLD Shuaicheng Niu14∗, Jiaxiang Wu2∗, Yifan Zhang3∗, Zhiquan Wen1, Yaofo Chen1, Peilin Zhao2, Mingkui Tan15† [email protected]; [email protected] South China University of Technology1 Tencent AI Lab2 National University of Singapore3 Key Laboratory of Big Data and Intelligent Robot, Ministry of Education4 Pazhou Laboratory5 ABSTRACT Test-time adaptation (TTA) has shown to be effective at tackling distribution shifts between training and testing data by adapting a given model on test samples. How- ever, the online model updating of TTA may be unstable and this is often a key obstacle preventing existing TTA methods from being deployed in the real world. Specifically, TTA may fail to improve or even harm the model performance when test data have: 1) mixed distribution shifts, 2) small batch sizes, and 3) online imbalanced label distribution shifts, which are quite common in practice. In this paper, we investigate the unstable reasons and find that the batch norm layer is a crucial factor hindering TTA stability. Conversely, TTA can perform more stably with batch-agnostic norm layers, i.e., group or layer norm. However, we observe that TTA with group and layer norms does not always succeed and still suffers many failure cases. By digging into the failure cases, we find that certain noisy test samples with large gradients may disturb the model adaption and result in collapsed trivial solutions, i.e., assigning the same class label for all samples. To address the above collapse issue, we propose a sharpness-aware and reliable en- tropy minimization method, called SAR, for further stabilizing TTA from two aspects: 1) remove partial noisy samples with large gradients, 2) encourage model weights to go to a flat minimum so that the model is robust to the remaining noisy samples. Promising results demonstrate that SAR performs more stably over prior methods and is computationally efficient under the above wild test scenarios. The source code is available at https://github.com/mr-eggplant/SAR. 1 INTRODUCTION Deep neural networks achieve excellent performance when training and testing domains follow the same distribution (He et al., 2016; Wang et al., 2018; Choi et al., 2018). However, when domain shifts exist, deep networks often struggle to generalize. Such domain shifts usually occur in real ap- plications, since test data may unavoidably encounter natural variations or corruptions (Hendrycks & Dietterich, 2019; Koh et al., 2021), such as the weather changes (e.g., snow, frost, fog), sensor degradation (e.g., Gaussian noise, defocus blur), and many other reasons. Unfortunately, deep mod- els can be sensitive to the above shifts and suffer from severe performance degradation even if the shift is mild (Recht et al., 2018). However, deploying a deep model on test domains with distribution shifts is still an urgent demand, and model adaptation is needed in these cases. Recently, numerous test-time adaptation (TTA) methods (Sun et al., 2020; Wang et al., 2021; Iwa- sawa & Matsuo, 2021; Bartler et al., 2022) have been proposed to conquer the above domain shifts by online updating a model on the test data, which include two main categories, i.e., Test-Time Training (TTT) (Sun et al., 2020; Liu et al., 2021) and Fully TTA (Wang et al., 2021; Niu et al., 2022a). In this work, we focus on Fully TTA since it is more generally to be used than TTT in two aspects: i) it does not alter training and can adapt arbitrary pre-trained models to the test data without access to original training data; ii) it may rely on fewer backward passes (only one or less than one) for each test sample than TTT (see efficiency comparisons of TTT, Tent and EATA in Table 6). ∗Equal contribution. †Corresponding author. Work done when S. Niu works as an intern in Tencent AI Lab. 1 Published as a conference paper at ICLR 2023 Figure 1: An illustration of practical/wild test-time adaptation (TTA) scenarios, in which prior online TTA methods may degrade severely. The accuracy of Tent (Wang et al., 2021) is measured on ImageNet-C of level 5 with ResNet50-BN (15 mixed corruptions in (a) and Gaussian in (b-c)). TTA has been shown boost model robustness to domain shifts significantly. However, its excellent performance is often obtained under some mild test settings, e.g., adapting with a batch of test samples that have the same distribution shift type and randomly shuffled label distribution (see Figure 1 (cid:192)). In the complex real world, test data may come arbitrarily. As shown in Figure 1 (cid:193), the test scenario may meet: i) mixture of multiple distribution shifts, ii) small test batch sizes (even single sample), iii) the ground-truth test label distribution Qt(y) is online shifted and Qt(y) may be imbalanced at each time-step t. In these wild test settings, online updating a model by existing TTA methods may be unstable, i.e., failing to help or even harming the model's robustness. To stabilize wild TTA, one immediate solution is to recover the model weights after each time adaptation of a sample or mini-batch, such as MEMO (Zhang et al., 2022) and episodic Tent (Wang et al., 2021). Meanwhile, DDA (Gao et al., 2022) provides a potentially effective idea to address this issue: rather than model adaptation, it seeks to transfer test samples to the source training distribution (via a trained diffusion model (Dhariwal & Nichol, 2021)), in which all model weights are frozen during testing. However, these methods cannot cumulatively exploit the knowledge of previous test samples to boost adaptation performance, and thus obtain limited results when there are lots of test samples. In addition, the diffusion model in DDA is expected to have good generalization ability and can project any possible target shifts to the source data. Nevertheless, this is hard to be satisfied as far as it goes, e.g., DDA performs well on noise shifts while less competitive on blur and weather (see Table 2). Thus, how to stabilize online TTA under wild test settings is still an open question. In this paper, we first point out that the batch norm (BN) layer (Ioffe & Szegedy, 2015) is a key obstacle since under the above wild scenarios the mean and variance estimation in BN layers will be biased. In light of this, we further investigate the effects of norm layers in TTA (see Section 4) and find that pre-trained models with batch-agnostic norm layers (i.e., group norm (GN) (Wu & He, 2018) and layer norm (LN) (Ba et al., 2016)) are more beneficial for stable TTA. However, TTA on GN/LN models does not always succeed and still has many failure cases. Specifically, GN/LN mod- els optimized by online entropy minimization (Wang et al., 2021) tend to occur collapse, i.e., pre- dicting all samples to a single class (see Figure 2), especially when the distribution shift is severe. To address this issue, we propose a sharpness-aware and reliable entropy minimization method (namely SAR). Specifically, we find that indeed some noisy samples that produce gradients with large norms harm the adaptation and thus result in model collapse. To avoid this, we filter partial samples with large and noisy gradients out of adaptation according to their entropy. For the remaining samples, we introduce a sharpness-aware learning scheme to ensure that the model weights are optimized to a flat minimum, thereby being robust to the large and noisy gradients/updates. Main Findings and Contributions. (1) We analyze and empirically verify that batch-agnostic norm layers (i.e., GN and LN) are more beneficial than BN to stable test-time adaptation under wild test settings, i.e., mix domain shifts, small test batch sizes and online imbalanced label distribution shifts (see Figure 1). (2) We further address the model collapse issue of test-time entropy minimization on GN/LN models by proposing a sharpness-aware and reliable (SAR) optimization scheme, which jointly minimizes the entropy and the sharpness of entropy of those reliable test samples. SAR is simple yet effective and enables online test-time adaptation stabilized under wild test settings. 2 PRELIMINARIES We revisit two main categories of test-time adaptation methods in this section for the convenience of further analyses, and put detailed related work discussions into Appendix A due to page limits. 2 performancedropSingledomain:Mixeddomains:Samplefromdomain1/2/3t=1t=2t=TTentaccuracyPriorTTAWildTTA42.6%2.3%(a)TTAundermixeddomainshiftsOnlineimbalancedlabeldistributionshift:Randomlyshuffledlabeldistribution:Samplefromclass1/2/3t=1t=2t=TTentaccuracy28.7%1.3%(c)TTAunderonlineimbalancedlabelshiftSinglesample:(b)TTAwithsinglesampleBatchsamples:Testsamplest=1t=2t=TTentaccuracy28.7%0.1%////12 Published as a conference paper at ICLR 2023 N (xi, yi) Test-time Training (TTT). Let fΘ(x) denote a model trained on train = i=1 with } parameter Θ, where xi (the label space). The goal of test-time adaptation (Sun et al., 2020; Wang et al., 2021) is to boost fΘ(x) on out-of-distribution test samples train. Sun et al. (2020) first propose the TTT pipeline, in which at training phase a model is trained on source S: ∈ X M j=1, where xj xj } train (the training data space) and yi test (testing data space) and train via both cross-entropy D ∈ C test = ∈ X test = D X X { { CE and self-supervised rotation prediction (Gidaris et al., 2018) L Ex∈Dtrain[ CE(x; Θb, Θc) + S(x; Θb, Θs)], L (1) D min Θb,Θc,Θs L L where Θb is the task-shared parameters (shadow layers), Θc and Θs are task-specific parameters S, respectively. At testing phase, given a test sample x, TTT first (deep layers) for CE and updates the model with self-supervised task: Θ(cid:48) S(x; Θb, Θs) and then use the updated model weights Θ(cid:48) b to perform final prediction via f (x; Θ(cid:48) arg minΘb L b, Θc). b ← L L Fully Test-time Adaptation (TTA). The pipeline of TTT needs to alter the original model training process, which may be infeasible when training data are unavailable due to privacy/storage concerns. To avoid this, Wang et al. (2021) propose fully TTA, which adapts arbitrary pre-trained models for a given test mini-batch by conducting entropy minimization (Tent): min c ˆyc log ˆyc where ˆyc=fΘ(c | x) and c denotes class c. This method is more efficient than TTT as shown in Table 6. (cid:80) − 3 STABLE ADAPTATION BY TEST ENTROPY AND SHARPNESS MINIMIZATION Test-time Adaptation (TTA) in Dynamic Wild World. Although prior TTA methods have exhib- ited great potential for out-of-distribution generalization, its success may rely on some underlying test prerequisites (as illustrated in Figure 1): 1) test samples have the same distribution shift type; 2) adapting with a batch of samples each time, 3) the test label distribution is uniform during the whole online adaptation process, which, however, are easy to be violated in the wild world. In wild scenarios (Figure 1 (cid:193)), prior methods may perform poorly or even fail. In this section, we seek to analyze the underlying reasons why TTA fails under wild testing scenarios described in Figure 1 from a unified perspective (c.f. Section 3.1) and then propose associated solutions (c.f. Section 3.2). 3.1 WHAT CAUSES UNSTABLE TEST-TIME ADAPTATION? We first analyze why wild TTA fails by investigating the norm layer effects in TTA and then dig into the unstable reasons for entropy-based methods with batch-agnostic norms, e.g., group norm. − (cid:98)x(k) + β(k), where (cid:98)x(k) = (cid:0)x(k) Batch Normalization Hinders Stable TTA. In TTA, prior methods often conduct adaptation on pre-trained models with batch normalization (BN) layers (Ioffe & Szegedy, 2015), and most of them are built upon BN statistics adaptation (Schneider et al., 2020; Nado et al., 2020; Khurana et al., 2021; Wang et al., 2021; Niu et al., 2022a; Hu et al., 2021; Zhang et al., 2022). Specifically, for a layer with d-dimensional input x = (cid:0)x(1) . . . x(d)(cid:1), the batch normalized output are: y(k) = E (cid:2)x(k)(cid:3) (cid:1)(cid:14)(cid:113) Var (cid:2)x(k)(cid:3). Here, γ(k) and β(k) are learnable γ(k) affine parameters. BN adaptation methods calculate mean E[x(k)] and variance Var[x(k)] over (a batch of) test samples. However, in wild TTA, all three practical adaptation settings (in Figure 1) in which TTA may fail will result in problematic mean and variance estimation. First, BN statistics indeed represent a distribution and ideally each distribution should have its own statistics. Simply estimating shared BN statistics of multiple distributions from mini-batch test samples unavoidably obtains limited performance, such as in multi-task/domain learning (Wu & Johnson, 2021). Second, the quality of estimated statistics relies on the batch size, and it is hard to use very few samples (i.e., small batch size) to estimate it accurately. Third, the imbalanced label shift will also result in biased BN statistics towards some specific classes in the dataset. Based on the above, we posit that batch-agnostic norm layers, i.e., agnostic to the way samples are grouped into a batch, are more suitable for performing TTA, such as group norm (GN) (Wu & He, 2018) and layer norm (LN) (Ba et al., 2016). We devise our method based on GN/LN models in Section 3.2. To verify the above claim, we empirically investigate the effects of different normalization layers (including BN, GN, and LN) in TTA (including TTT and Tent) in Section 4. From the results, we observe that models equipped with GN and LN are more stable than models with BN when 3 (cid:54) Published as a conference paper at ICLR 2023 Figure 2: Failure case analyses (a-c) of online test-time entropy minimization (Wang et al., 2021). (a) and (b) record the model predictions during online adaptation. (c) illustrates how gradients norm evolves with and without model collapse. (d) investigates the relationship between the sample's entropy and gradients norm. All experiments are conducted on shuffled ImageNet-C of Gaussian noise with ResNet50 (GN), and a larger (severity) level denotes a more severe distribution shift. performing online test-time adaptation under three practical test settings (in Figure 1) and have fewer failure cases. The detailed empirical studies are put in Section 4 for the coherence of presentation. Online Entropy Minimization Tends to Result in Collapsed Trivial Solutions, i.e., Predict All Samples to the Same Class. Although TTA performs more stable on GN and LN models, it does not always succeed and still faces several failure cases (as shown in Section 4). For example, en- tropy minimization (Tent) on GN models (ResNet50-GN) tends to collapse, especially when the distribution shift extent is severe. In this paper, we aim to stabilize online fully TTA under various practical test settings. To this end, we first analyze the failure reasons, in which we find models are often optimized to collapse trivial solutions. We illustrate this issue in the following. During the online adaptation process, we record the predicted class and the gradients norm (pro- duced by entropy loss) of ResNet50-GN on shuffled ImageNet-C of Gaussian noise. By comparing Figures 2 (a) and (b), entropy minimization is shown to be unstable and may occur collapse when the distribution shift is severe (i.e., severity level 5). From Figure 2 (a), as the adaptation goes by, the model tends to predict all input samples to the same class, even though these samples have dif- ferent ground-truth classes, called model collapse. Meanwhile, we notice that along with the model starts to collapse the (cid:96)2-norm of gradients of all trainable parameters suddenly increases and then degrades to almost 0 (as shown in Figure 2 (c)), while on severity level 3 the model works well and the gradients norm keep in a stable range all the time. This indicates that some test samples produce large gradients that may hurt the adaptation and lead to model collapse. 3.2 SHARPNESS-AWARE AND RELIABLE TEST-TIME ENTROPY MINIMIZATION Based on the above analyses, two most straightforward solutions to avoid model collapse are filtering out test samples according to the sample gradients or performing gradients clipping. However, these are not very feasible since the gradients norms for different models and distribution shift types have different scales, and thus it is hard to devise a general method to set the threshold for sample filtering or gradient clipping (see Section 5.2 for more analyses). We propose our solutions as follows. Reliable Entropy Minimization. Since directly filtering samples with gradients norm is infeasible, we first investigate the relation between entropy loss and gradients norm and seek to remove samples with large gradients based on their entropy. Here, the entropy depends on the model's output class number C and it belongs to (0, ln C) for different models and data. In this sense, the threshold for filtering samples with entropy is easier to select. As shown in Figure 2 (d), selecting samples with small loss values can remove part of samples that have large gradients (area@1) out of adaptation. Formally, let E(x; Θ) be the entropy of sample x, the selective entropy minimization is defined by: S(x)E(x; Θ), where S(x) (cid:44) I{E(x;Θ)<E0}(x). min Θ (2) Here, Θ denote model parameters, I{*}( ) is an indicator function and E0 is a pre-defined parameter. * Note that the above criteria will also remove samples within area@2 in Figure 2 (d), in which the samples have low confidence and thus are unreliable (Niu et al., 2022a). Sharpness-aware Entropy Minimization. Through Eqn. (2), we have removed test samples in area@1&2 in Figure 2 (d) from adaptation. Ideally, we expect to optimize the model via samples only in area@3, since samples in area@4 still have large gradients and may harm the adaptation. However, it is hard to further remove the samples in area@4 via a filtering scheme. Alternatively, 4 Published as a conference paper at ICLR 2023 Figure 3: Batch size effects of different TTA methods under different models (different normaliza- tion layers). Experiments are conducted on ImageNet-C of Gaussian noise. We report mean and standard deviation of 3 runs with different random seeds. 'na' denotes no adapt accuracy. Note that except for Vit-LN, the standard deviation is too small to display in the figures. we seek to make the model insensitive to the large gradients contributed by samples in area@4. Here, we encourage the model to go to a flat area of the entropy loss surface. The reason is that a flat minimum has good generalization ability and is robust to noisy/large gradients, i.e., the noisy/large updates over the flat minimum would not significantly affect the original model loss, while a sharp minimum would. To this end, we jointly minimize the entropy and the sharpness of entropy loss by: min Θ ESA(x; Θ), where ESA(x; Θ) (cid:44) max (cid:107)(cid:15)(cid:107)2≤ρ E(x; Θ + (cid:15)). (3) Here, the inner optimization seeks to find a weight perturbation (cid:15) in a Euclidean ball with radius ρ that maximizes the entropy. The sharpness is quantified by the maximal change of entropy be- tween Θ and Θ + (cid:15). This bi-level problem encourages the optimization to find flat minima. To address problem (3), we follow SAM (Foret et al., 2021) that first approximately solves the inner optimization via first-order Taylor expansion, i.e., (cid:15)∗(Θ) (cid:44) arg max (cid:107)(cid:15)(cid:107)2≤ρ ΘE(x; Θ) = arg max (cid:107)(cid:15)(cid:107)2≤ρ E(x; Θ) + (cid:15)T arg max (cid:107)(cid:15)(cid:107)2≤ρ E(x; Θ + (cid:15)) ΘE(x; Θ). (cid:15)T ∇ ∇ ≈ Then, ˆ(cid:15)(Θ) that solves this approximation is given by the solution to a classical dual norm problem: ˆ(cid:15)(Θ) = ρ sign ( ΘE(x; Θ)) |∇ Substituting ˆ(cid:15)(Θ) back into Eqn. (3) and differentiating, by omitting the second-order terms for computation acceleration, the final gradient approximation is: (cid:12) ΘE(x; Θ) (cid:12)Θ+ˆ(cid:15)(Θ) . ΘESA(x; Θ) (cid:107)∇ (5) ∇ ∇ ≈ ∇ ΘE(x; Θ) / | ΘE(x; Θ) (cid:107)2 . (4) Overall Optimization. In summary, our sharpness-aware and reliable entropy minimization is: S(x)ESA(x; Θ), min ̃Θ (6) where S(x) and ESA(x; Θ) are defined in Eqns. (2) and (3) respectively, ̃Θ Θ denote learnable parameters during test-time adaptation. In addition, to avoid a few extremely hard cases that Eqn. (6) may also fail, we further introduce a Model Recovery Scheme. We record a moving average em of entropy loss values and reset ̃Θ to be original once em is smaller than a small threshold e0, since models after occurring collapse will produce very small entropy loss. Here, the additional memory costs are negligible since we only optimize affine parameters in norm layers (see Appendix C.2 for more details). We summarize the details of our method in Algorithm 1 in Appendix B. ⊂ 4 EMPIRICAL STUDIES OF NORMALIZATION LAYER EFFECTS IN TTA This section designs experiments to illustrate how test-time adaptation (TTA) performs on models with different norm layers (including BN, GN and LN) under wild test settings described in Fig- ure 1. We verify two representative methods introduced in Section 2, i.e., self-supervised TTT (Sun et al., 2020) and unsupervised Tent (a fully TTA method) (Wang et al., 2021). Considering that the norm layers are often coupled with mainstream network architectures, we conduct adaptation on ResNet-50-BN (R-50-BN), ResNet-50-GN (R-50-GN) and VitBase-LN (Vit-LN). All adopted model weights are public available and obtained from torchvision or timm repository (Wight- man, 2019). Implementation details of experiments in this section can be found in Appendix C.2. 5 1248163264Batch Size02040Accuracy (%)(a) TTT, Severity Level 5R-50-BN (na)R-50-GN (na)Vit-LN (na)R-50-BNR-50-GNVit-LN1248163264Batch Size02040(b) Tent, Severity Level 51248163264Batch Size204060(c) TTT, Severity Level 3R-50-BN (na)R-50-GN (na)Vit-LN (na)R-50-BNR-50-GNVit-LN1248163264Batch Size204060(d) Tent, Severity Level 3R-50-BN (na)R-50-GN (na)Vit-LN (na)R-50-BNR-50-GNVit-LN Published as a conference paper at ICLR 2023 Figure 4: Performance of TTA methods on different models (different norm layers) under the mix- ture of 15 different corruption types (ImageNet-C). We report mean&stdev. over 3 independent runs. Figure 5: Performance of TTA methods with different models (different norm layers) under on- line imbalanced label distribution shifts on ImageNet-C (Gaussian noise). We report mean&stdev. results of 3 runs. Note that except for VitBase-LN, the stdev. is too small to display in the figures. (1) Norm Layer Effects in TTA Under Small Test Batch Sizes. We evaluate TTA methods (TTT and Tent) with different batch sizes (BS), selected from . Due to GPU memory } limits, we only report results of BS up to 8 or 16 for TTT (in original TTT BS is 1), since TTT needs to augment each test sample multiple times (for which we set to 20 by following Niu et al. (2022a)). 1, 2, 4, 8, 16, 32, 64 { From Figure 3, we have: i) For Tent, compared with R-50-BN, R-50-GN and Vit-LN are less sensi- tive to small test batch sizes. The adaptation performance of R-50-BN degrades severely when the batch size goes small (<8), while R-50-GN/Vit-LN show stable performance across various batch sizes (Vit-LN on levels 5&3 and R-50-GN on level 3, in subfigures (b)&(d)). It is worth noting that Tent with R-50-GN and Vit-LN not always succeeds and also has failure cases, such as R-50-GN on level 5 (Tent performs worse than no adapt), which is analyzed in Section 3.1. ii) For TTT, all R-50- BN/GN and Vit-LN can perform well under various batch sizes. However, TTT with Vit-LN is very unstable and has a large variance over different runs, showing that TTT+VitBase is very sensitive to different sample orders. Here, TTT performs well with R-50-BN under batch size 1 is mainly benefited from TTT applying multiple data augmentations to a single sample to form a mini-batch. (2) Norm Layer Effects in TTA Under Mixed Distribution Shifts. We evaluate TTA methods on models with different norm layers when test data come from multiple shifted domains simulta- neously. We compare 'no adapt', 'avg. adapt' (the average accuracy of adapting on each domain separately) and 'mix adapt' (adapting on mixed and shifted domains) accuracy on ImageNet-C con- sisting of 15 corruption types. The larger accuracy gap between 'mix adapt' and 'avg. adapt' indicates the more sensitive to mixed distribution shifts. From Figure 4, we have: i) For both Tent and TTT, R-50-GN and Vit-LN perform more stable than R-50-BN under mix domain shifts. Specifically, the mix adapt accuracy of R-50-BN is consistently poor than the average adapt accuracy across different severity levels (in all subfigures (a-d)). In contrast, R-50-GN and Vit-LN are able to achieve comparable accuracy of mix and average adapt, i.e., TTT on R-50-GN (levels 5&3) and Tent on Vit-LN (level 3). ii) For R-50-GN and Vit-LN, TTT performs more stable than Tent. To be specific, Tent gets 3/4 failure cases (R-50-GN on levels 5&3, Vit-LN on level 5), which is more than that of TTT. iii) The same as Section 4 (1), TTT on Vit-LN has large variances over multiple runs, showing TTT+Vit-LN is sensitive to different sample orders. (3) Norm Layer Effects in TTA Under Online Imbalanced Label Shifts. As in Figure 1 (c), during the online adaptation process, the label distribution Qt(y) at different time-steps t may be different (online shift) and imbalanced. To evaluate this, we first simulate this imbalanced label distribution shift by adjusting the order of input samples (from a test set) as follows. Online Imbalanced Label Distribution Shift Simulation. Assuming that we have totally T time-steps and T equals to the class number C. We set the probability vector Qt(y) = [q1, q2, ..., qC], where qc = qmax if c = t and qc = qmin (cid:44) (1 = t. Here, qmax/qmin denotes − , we sample M images from the test set the imbalance ratio. Then, at each t } qmax)/(C − 1, 2, ..., T =C 1) if c ∈ { 6 R-50-BNR-50-GNVitBase-LN0204060Accuracy (%)18.030.629.925.242.740.08.641.146.9(a) TTT, Severity Level 5No adaptAvg. adaptMix adaptR-50-BNR-50-GNVitBase-LN020406018.030.629.942.624.948.02.313.416.5(b) Tent, Severity Level 5No adaptAvg. adaptMix adaptR-50-BNR-50-GNVitBase-LN20406039.854.053.842.059.248.023.758.365.0(c) TTT, Severity Level 3No adaptAvg. adaptMix adaptR-50-BNR-50-GNVitBase-LN20406039.854.053.859.055.869.140.733.170.2(d) Tent, Severity Level 3No adaptAvg. adaptMix adapt11k2k3k4k5kImbalance Ratio02040Accuracy (%)(a) TTT, Severity Level 511k2k3k4k5kImbalance Ratio02040(b) Tent, Severity Level 511k2k3k4k5kImbalance Ratio0204060(c) TTT, Severity Level 311k2k3k4k5kImbalance Ratio0204060(d) Tent, Severity Level 3R-50-BNR-50-GNVitBase-LN(cid:54) Published as a conference paper at ICLR 2023 according to Qt(y). Based on ImageNet-C (Gaussian noise), we construct a new testing set that has online imbalanced label distribution shifts with totally 100(M ) 1000(T ) images. Note that we pre-shuffle the class orders in ImageNet-C, since we cannot know which class will come in practice. × From Figure 5, we have: i) For Tent, R-50-GN and Vit-LN are less sensitive than R-50-BN to online imbalanced label distribution shifts (see subfigures (b)&(d)). Specifically, the adaptation accuracy of R-50-BN (levels 5&3) degrades severely as the imbalance ratio increases. In contrast, R-50-GN and Vit-LN have the potential to perform stably under various imbalance ratios (e.g., R-50-GN and Vit-LN on level 3). ii) For TTT, all R-50-BN/GN and Vit-LN perform relatively stable under label shifts, except for TTT+Vit-LN has large variances. The adaptation accuracy will also degrade but not very severe as the imbalance ratio increases. iii) Tent with GN is more sensitive to the extent of distribution shift than BN. Specifically, for imbalanced ratio 1 (all Qt(y) are uniform) and severity level 5, Tent+R-50-GN fails and performs poorer than no adapt, while Tent+R-50-BN works well. (4) Overall Observations. Based on all the above results, we have: i) R-50-GN and Vit-LN are more stable than R-50-BN when performing TTA under wild test settings (see Figure 1). However, they do not always succeed and still suffer from several failure cases. ii) R-50-GN is more suitable for self-supervised TTT than Vit-LN, since TTT+Vit-LN is sensitive to different sample orders and iii) Vit-LN is more suitable for unsupervised Tent than has large variances over different runs. R-50-GN, since Tent+R-50-GN is easily to collapse, especially when the distribution shift is severe. 5 COMPARISON WITH STATE-OF-THE-ARTS Table 1: Efficiency compari- son for processing 50,000 im- ages (Gaussian noise, level 5 on ImageNet-C) via a single V100 GPU on ResNet50-GN. GPU time Method Dataset and Methods. We conduct experiments based on ImageNet-C (Hendrycks & Dietterich, 2019), a large-scale and widely used benchmark for out-of-distribution generalization. It contains 15 types of 4 main categories (noise, blur, weather, digital) corrupted images and each type has 5 severity levels. We compare our SAR with the following state-of-the-art methods. DDA (Gao et al., 2022) performs input adaptation at test time via a diffusion model. MEMO (Zhang et al., 2022) minimizes marginal entropy 115 secs over different augmented copies w.r.t. a given test sample. Tent (Wang et al., 2021) and EATA (Niu et al., 2022a) are two entropy based online fully test-time adaptation (TTA) methods. MEMO (Zhang et al., 2022) DDA (Gao et al., 2022) TTT (Sun et al., 2020) Tent (Wang et al., 2021) EATA (Niu et al., 2022a) 55,980 secs 146,220 secs 3,600 secs 110 secs 114 secs SAR (ours) Models and Implementation Details. We conduct experiments on ResNet50-BN/GN and VitBase- LN that are obtained from torchvision or timm (Wightman, 2019). For our SAR, we use SGD as the update rule, with a momentum of 0.9, batch size of 64 (except for the experiments of batch size=1), and learning rate of 0.00025/0.001 for ResNet/Vit models. The threshold E0 in Eqn. (2) is ln 1000 by following EATA (Niu et al., 2022a). ρ in Eqn. (3) is set by the default value set to 0.4 0.05 in Foret et al. (2021). For trainable parameters of SAR during TTA, following Tent (Wang et al., 2021), we adapt the affine parameters of group/layer normalization layers in ResNet50- GN/VitBase-LN. More details and hyper-parameters of compared methods are put in Appendix C.2. × 5.1 ROBUSTNESS TO CORRUPTION UNDER VARIOUS WILD TEST SETTINGS Results under Online Imbalanced Label Distribution Shifts. As illustrated in Section 4, as the imbalance ratio qmax/qmin increases, TTA degrades more and more severe. Here, we make com- parisons under the most difficult case: qmax/qmin= , i.e., test samples come in class order. We evaluate all methods under different corruptions via the same sample sequence for fair comparisons. ∞ From Table 2, our SAR achieves the best results in average of 15 corruption types over ResNet50- GN and VitBase-LN, suggesting its effectiveness. It is worth noting that Tent works well for many corruption types on VitBase-LN (e.g., defocus and motion blur) and ResNet50-GN (e.g., pixel), while consistently fails on ResNet50-BN. This further verifies our observations in Section 4 that entropy minimization on LN/GN models has the potential to perform well under online imbalanced label distribution shifts. Meanwhile, Tent also suffers from many failure cases, e.g., VitBase-LN on shot noise and snow. For these cases, our SAR works well. Moreover, EATA has fewer failure cases than Tent and achieves higher average accuracy, which indicates that the weight regularization is somehow able to alleviate the model collapse issue. Nonetheless, the performance of EATA is still inferior to our SAR, e.g., 49.9% vs. 58.0% (ours) on VitBase-LN regarding average accuracy. 7 Published as a conference paper at ICLR 2023 Table 2: Comparisons with state-of-the-art methods on ImageNet-C (severity level 5) under ONLINE IMBALANCED LABEL SHIFTS (imbalance ratio = ) regarding Accuracy (%). "BN"/"GN"/"LN" is short for Batch/Group/Layer normalization. The bold number indicates the best result. ∞ Noise Shot 2.9 8.6 33.1 1.4 0.3 19.9 20.6 43.4 3.3 28.3 Blur Weather Digital Impul. Defoc. Glass Motion Zoom 22.5 9.8 27.5 13.2 24.4 16.4 2.6 0.9 0.9 0.2 24.9 11.3 26.9 12.7 26.1 19.4 17.0 7.9 25.3 17.1 14.5 20.8 16.6 1.2 0.5 21.3 21.8 21.9 19.5 24.4 17.8 19.8 14.6 1.0 0.2 19.7 17.1 16.5 13.9 14.9 1.8 8.9 32.0 1.4 0.3 17.9 18.4 42.3 2.7 28.1 Snow 16.8 25.6 20.0 1.7 0.8 40.4 40.7 35.8 16.5 32.2 Frost 23.4 28.6 25.5 1.8 0.9 47.4 46.9 40.2 21.9 32.0 Fog 24.6 32.3 17.2 3.6 1.8 33.6 34.8 13.7 1.8 39.8 Brit. 59.0 60.8 52.2 5.0 3.5 69.2 69.6 61.3 70.5 66.7 Contr. 5.5 11.0 3.2 0.5 0.2 36.3 36.4 25.2 42.2 33.6 Elastic 17.1 23.8 35.7 2.6 0.8 18.7 19.2 37.3 6.6 24.5 Pixel 20.7 33.2 41.8 3.2 1.2 28.4 32.2 46.9 49.4 41.9 JPEG 31.6 37.7 45.4 3.1 0.9 52.2 53.4 54.3 53.7 38.4 Avg. 18.0 24.0 27.2 2.1 0.9 30.6 31.3 35.1 22.0 31.6 33.1 ± 9.4 21.6 41.3 32.7 35.9 1.0 36.5 ± 6.7 17.4 41.3 1.4 34.6 0.4 35.5 ± 8.3 20.6 40.6 34.6 36.7 1.1 19.2 0.4 19.5 1.2 33.3 0.5 27.7 4.0 23.9 5.1 45.3 0.4 50.1 1.0 71.9 0.1 46.7 0.2 7.1 1.8 52.1 0.5 56.3 0.1 37.2 0.6 ± 29.1 37.1 24.6 54.4 45.3 ± 23.4 29.6 27.4 52.3 47.2 ± 34.0 40.6 30.7 58.2 49.3 ± 27.0 34.4 26.9 52.2 47.7 ± 15.8 25.0 18.2 7.7 56.5 ± 26.3 34.8 27.7 12.0 55.4 ± 47.4 55.2 34.8 69.3 62.2 ± 54.7 65.0 50.0 76.1 72.2 ± 43.9 54.9 32.3 66.1 21.7 ± 30.5 37.4 42.2 56.7 56.2 ± 44.5 55.5 52.5 69.4 64.7 ± 47.6 57.7 52.7 66.4 63.7 ± 29.9 39.1 36.2 47.3 49.9 46.5 ± 3.0 43.1 7.4 48.9 ± 0.4 55.3 ± 0.1 54.3 ± ± 0.2 58.9 0.1 54.8 ± ± 0.2 53.6 7.1 46.2 ± 3.5 69.7 ± ± 0.3 76.2 0.1 66.2 ± 0.3 60.9 0.3 69.6 ± ± ± 0.1 66.6 0.1 58.0 ± 0.5 ± Table 4: Comparisons with state-of-the-art methods on ImageNet-C (severity level 5) with BATCH SIZE=1 regarding Accuracy (%). "BN"/"GN"/"LN" is short for Batch/Group/Layer normalization. Noise Shot 2.9 8.7 32.8 0.1 0.1 19.8 20.5 43.3 2.9 28.3 Blur Weather Digital Impul. Defoc. Glass Motion Zoom 22.5 9.8 27.6 13.0 24.2 16.6 0.2 0.1 0.2 0.1 24.9 11.4 26.9 12.6 26.0 19.6 17.6 3.6 29.3 17.3 14.8 20.8 16.6 0.1 0.1 21.4 21.8 21.9 18.6 28.5 17.9 19.7 14.7 0.1 0.1 19.8 17.1 16.6 13.5 18.1 1.9 8.9 31.8 0.1 0.1 17.9 18.4 42.3 2.5 25.7 Snow 16.9 25.4 20.0 0.2 0.2 40.4 40.4 35.7 15.3 44.5 Frost 23.3 28.7 25.4 0.2 0.2 47.3 47.0 40.1 23.0 44.3 Fog 24.4 32.2 17.2 0.2 0.1 33.6 34.4 13.7 1.4 41.6 Brit. 58.9 60.9 52.1 0.2 0.2 69.3 69.5 61.2 70.4 70.9 Contr. 5.4 11.0 3.2 0.1 0.1 36.3 36.5 25.2 42.2 44.6 Elastic 17.0 23.8 35.7 0.1 0.1 18.6 19.2 37.5 6.2 27.0 Pixel 20.6 32.9 41.5 0.2 0.2 28.4 32.1 46.6 49.2 46.8 JPEG 31.6 37.5 45.3 0.1 0.1 52.3 53.3 54.1 53.8 55.7 Avg. 18.0 23.9 27.3 0.1 0.1 30.6 31.2 35.1 21.5 36.5 23.4 ± 9.5 21.6 41.3 42.2 29.7 0.3 26.6 ± 6.7 17.3 41.1 1.0 25.1 0.4 23.9 ± 8.2 20.6 40.7 43.3 34.6 0.0 18.4 0.1 15.4 0.3 28.6 0.3 30.4 0.2 44.9 0.3 44.7 0.2 25.7 0.6 72.3 0.2 44.5 0.1 14.8 2.7 47.0 0.1 56.1 0.0 34.5 0.2 ± 29.0 37.1 24.4 52.4 44.7 ± 23.4 29.6 27.2 48.2 39.2 ± 33.9 40.4 30.6 55.5 48.3 ± 27.1 34.4 26.9 50.5 42.4 ± 15.9 24.9 18.3 16.5 37.5 ± 26.5 34.7 27.5 16.9 45.9 ± 47.2 55.1 34.6 66.4 60.0 ± 54.7 64.8 50.1 74.9 65.9 ± 44.1 54.9 32.4 64.7 61.2 ± 30.5 37.4 42.3 51.6 46.4 ± 44.5 55.4 52.2 67.0 58.2 ± 47.8 57.6 52.6 64.3 59.6 ± 29.9 39.1 36.1 47.7 46.6 40.8 ± 0.4 36.4 0.7 41.5 ± 0.3 53.7 ± 0.2 50.7 ± ± 0.1 57.5 0.1 52.8 ± 0.3 59.1 0.4 50.7 0.6 68.1 ± ± ± ± 1.4 74.6 0.7 65.7 ± 0.0 57.9 0.1 68.9 ± ± ± 0.1 65.9 0.0 56.3 ± 0.1 ± 2.2 7.4 32.2 1.2 0.3 17.9 18.4 42.5 2.6 27.0 2.2 7.5 32.1 0.1 0.1 18.0 18.5 42.4 2.5 24.8 Model+Method Gauss. ResNet50 (BN) MEMO DDA Tent EATA • • • • • • • • • ResNet50 (GN) MEMO DDA Tent EATA SAR (ours) VitBase (LN) MEMO DDA Tent EATA SAR (ours) • • • • • Model+Method Gauss. ResNet50 (BN) MEMO DDA Tent EATA • • • • • • • • • ResNet50 (GN) MEMO DDA Tent EATA SAR (ours) VitBase (LN) MEMO DDA Tent EATA SAR (ours) • • • • • × Results under Mixed Distribution Shifts. We evaluate dif- ferent methods on the mixture of 15 corruption types (total of 15 50,000 images) at different severity levels (5&3). From Table 3, our SAR performs best consistently regarding accu- racy, suggesting its effectiveness. Tent fails (occurs collapse) on ResNet50-GN levels 5&3 and VitBase-LN level 5 and thus achieves inferior accuracy than no adapt model, showing the instability of long-range online entropy minimization. Com- pared with Tent, although MEMO and DDA achieve better re- sults, they rely on much more computation (inefficient at test time) as in Table 1, and DDA also needs to alter the train- ing process (diffusion model training). By comparing Tent and EATA (both of them are efficient entropy-based), EATA achieves good results but it needs to pre-collect a set of in- distribution test samples (2,000 images in EATA) to compute Fisher importance for regularization and then adapt, which sometimes may be infeasible in practice. Unlike EATA, our SAR does not need such samples and obtains better results than EATA. • • • • • Table 3: Comparisons with state- of-the-arts on ImageNet-C under MIXTURE OF 15 CORRUPTION TYPES regarding Accuracy (%). Level 3 Model + Method Level 5 ResNet50 (BN) MEMO (Zhang et al., 2022) DDA (Gao et al., 2022) Tent (Wang et al., 2021) EATA (Niu et al., 2022a) • • • • ResNet50 (GN) MEMO (Zhang et al., 2022) DDA (Gao et al., 2022) Tent (Wang et al., 2021) EATA (Niu et al., 2022a) SAR (ours) • • • • • VitBase (LN) MEMO (Zhang et al., 2022) DDA (Gao et al., 2022) Tent (Wang et al., 2021) EATA (Niu et al., 2022a) SAR (ours) 18.0 23.9 27.3 2.3 26.8 30.6 31.2 35.1 13.4 38.1 38.3±0.1 29.9 39.1 36.1 16.5 55.7 57.1±0.1 39.7 46.2 44.2 41.1 52.6 54.0 54.5 52.3 33.1 56.1 57.4±0.1 53.8 62.1 53.2 70.2 69.6 70.7±0.1 Results under Batch Size = 1. From Table 4, our SAR achieves the best results in many cases. It is worth noting that MEMO and DDA are not affected by small batch sizes, mix domain shifts, or online imbalanced label shifts. They achieve stable/same results under these settings since they reset (or fix) the model parameters after the adaptation of each sample. However, the computational complexity of these two methods is much higher than SAR (see Table 1) and only obtain limited performance gains since they cannot exploit the knowledge from previously seen images. Although EATA performs better than our SAR on ResNet50-GN, it relies on pre-collecting 2,000 additional in-distribution samples (while we do not). Moreover, our SAR consistently outperforms EATA in other cases, see batch size 1 results on VitBase-LN, Tables 2-3, and Tables 8-9 in Appendix. 8 Published as a conference paper at ICLR 2023 Table 5: Effects of components in SAR. We report the Accuracy (%) on ImageNet-C (level 5) under ONLINE IMBALANCED LABEL SHIFTS (imbalance ratio qmax/qmin = ). "reliable" and "sharpness-aware (sa)" denote Eqn. (2) and Eqn. (3), "recover" denotes the model recovery scheme. ∞ Model+Method ResNet50 (GN)+Entropy (cid:59) reliable (cid:59) reliable+sa (cid:59) reliable+sa+recover VitBase (LN)+Entropy (cid:59) reliable (cid:59) reliable+sa (cid:59) reliable+sa+recover Noise Gauss. Shot Impul. Defoc. Glass Motion Zoom Snow Frost Fog Brit. Contr. Elastic Pixel JPEG Avg. Blur Weather Digital 3.2 34.5 33.8 33.6 21.2 47.8 47.9 47.9 4.1 36.8 35.9 36.1 1.9 35.7 47.6 47.6 4.0 36.2 36.4 36.2 38.6 48.4 48.5 48.5 17.1 19.5 19.2 19.1 54.8 55.2 55.4 55.4 8.5 3.1 18.7 18.6 52.7 54.1 54.2 54.2 27.0 33.6 33.6 33.9 58.5 58.6 58.8 58.8 24.4 14.5 24.5 24.7 54.2 54.4 54.6 54.6 17.9 20.5 23.5 22.5 10.1 13.3 19.7 49.1 25.5 38.3 45.2 45.7 14.7 21.4 22.1 48.3 2.6 2.4 49.3 49.0 69.6 69.5 69.4 69.4 72.1 71.9 71.9 71.9 76.3 76.2 76.3 76.3 45.8 47.0 46.6 46.6 66.3 66.1 66.2 66.2 8.2 8.3 9.2 9.2 59.2 60.2 60.9 60.9 52.2 52.1 51.6 51.5 69.7 69.3 69.4 69.4 56.2 56.4 56.4 56.3 66.8 66.7 66.6 66.6 24.6 31.7 37.0 37.0 47.6 53.1 54.5 58.2 5.2 ABLATE EXPERIMENTS Comparison with Gradient Clipping. As mentioned in Section 3.2, gradient clip- ping is a straightforward solution to allevi- ate model collapse. Here, we compare our SAR with two variants of gradient clip, i.e., by value and by norm. From Figure 6, for both two variants, it is hard to set a proper threshold δ for clipping, since the gradients for different models and test data have dif- ferent scales and thus the δ selection would be sensitive. We carefully select δ on a specific test set (shot noise level 5). Then, we select a very small δ to make gradient clip work, i.e., clip by value 0.001 and by norm 0.1. Nonetheless, the per- formance gain over "no adapt" is very marginal, since the small δ would limit the learning ability of the model and in this case the clipped gradients may point in a very different direction from the true gradients. However, a large δ fails to stabilize the adaptation process and the accuracy will degrade after the model collapses (e.g., clip by value 0.005 and by norm 1.0). In contrast, SAR does not need to tune such a parameter and achieve significant improvements than gradient clipping. Figure 6: Comparison with gradient clipping. Re- sults on VitBase-LN, ImageNet-C, shot noise, sever- ity level 5, online imbalanced (ratio = ) label shift. Accuracy is calculated over all previous test samples. ∞ Effects of Components in SAR. From Table 5, compared with pure entropy minimization, the 53.1% on reliable entropy in Eqn. (2) clearly improves the adaptation performance, i.e., 47.6% 31.7% on ResNet50-GN w.r.t. average accuracy. With sharpness-aware VitBase-LN and 24.6% (sa) minimization in Eqn. (3), the accuracy is further improved, e.g., 31.7% 37.0% on ResNet50- GN w.r.t. average accuracy. On VitBase-LN, the sa module is also effective, and it helps the model to avoid collapse, e.g., 35.7% 47.6% on shot noise. With both reliable and sa, our method performs stably except for very few cases, i.e., VitBase-LN on snow and frost. For this case, our 58.2% on VitBase-LN w.r.t. average accuracy. model recovery scheme takes effects, i.e., 54.5% → → → → → Sharpness of Loss Surface. We visualize the loss surface by adding perturbations to model weights, as done in Li et al. (2018b). We plot Figure 7 via the model weights obtained after the adaptation on the whole test set. By comparing Figures 7 (a) and (b), the area (the deepest blue) within the lowest loss contour line of our SAR is larger than Tent, showing that our solution is flat- ter and thus is more robust to noisy/large gradients. 6 CONCLUSIONS Figure 7: Loss (entropy) surface. Models are learned on ImageNet-C Gaussian noise, level 5. In this paper, we seek to stabilize online test-time adaptation (TTA) under wild test settings, i.e., mix shifts, small batch, and imbalanced label shifts. To this end, we first analyze and conduct extensive empirical studies to verify why wild TTA fails. Then, we point out that batch norm acts as a crucial obstacle to stable TTA. Meanwhile, though batch-agnostic norm (i.e., group and layer norm) performs more stably under wild settings, they still suffer from many failure cases. To address these failures, we propose a sharpness-aware and reliable entropy minimization method (SAR) by suppressing the effect of certain noisy test samples with large gradients. Extensive experimental results demonstrate the stability and efficiency of our SAR under wild test settings. 9 050010001500Online Batch02040Online Accuracy (%)Clip by Valueno adapt accno clipmax_value=0.01max_value=0.005max_value=0.001SAR (ours)050010001500Online Batch02040Clip by Normno adapt accno clipmax_norm=3.0max_norm=1.0max_norm=0.5max_norm=0.1SAR (ours)306090306090(a) VitBase-LN, Tent306090306090(b) VitBase-LN, SAR (Ours)0.01.22.43.64.86.20.01.22.43.64.86.2 Published as a conference paper at ICLR 2023 ACKNOWLEDGMENTS This work was partially supported by the Key Realm R&D Program of Guangzhou 202007030007, National Natural Science Foundation of China (NSFC) 62072190, Ministry of Science and Tech- nology Foundation Project 2020AAA0106900, Program for Guangdong Introducing Innovative and Enterpreneurial Teams 2017ZT07X183, CCF-Tencent Open Fund RAGR20220108. REPRODUCIBILITY STATEMENT In this work, we implement all methods (all compared methods and our SAR) with different mod- els (ResNet50-BN, ResNet50-GN, VitBase-LN) on the ImageNet-C/R and VisDA-2021 datasets. Reproducing all the results in our paper depends on the following three aspects: 1. DATASET. The first paragraph of Section 5 and Appendix C.1 provide the details of the adopted datasets and the download url. 2. MODELS. All adopted models (with the pre-trained weights) for test-time adaptation are publicly available. Specifically, ResNet50-BN is from torchvision, ResNet50-GN and VitBase-LN are from timm repository (Wightman, 2019). Appendix C.2 provides the download url of them. 3. PROTOCOLS OF EACH METHOD. The second paragraph of Section 5 and Appendix C.2 pro- vides the implementation details of all compared methods and our SAR. We reproduce all com- pared methods based on the code from their official GitHub, for which the download url is provided (in Appendix C.2) following each method introduction. The source code of SAR has been made publicly available. REFERENCES Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. Andrei Barbu, David Mayo, Julian Alverio, William Luo, Christopher Wang, Dan Gutfreund, Josh Tenenbaum, and Boris Katz. Objectnet: A large-scale bias-controlled dataset for pushing the In Advances in Neural Information Processing Systems, limits of object recognition models. volume 32, 2019. Alexander Bartler, Andre B ̈uhler, Felix Wiewel, Mario D ̈obler, and Bin Yang. MT3: meta test- In International Conference on Artificial time training for self-supervised test-time adaption. Intelligence and Statistics, pp. 3080–3090, 2022. Dina Bashkirova, Dan Hendrycks, Donghyun Kim, Haojin Liao, Samarth Mishra, Chandramouli Rajagopalan, Kate Saenko, Kuniaki Saito, Burhan Ul Tayyab, Piotr Teterwak, et al. Visda-2021 competition: Universal domain adaptation to improve performance on out-of-distribution data. In NeurIPS 2021 Competitions and Demonstrations Track, pp. 66–79, 2022. Vasudha Bhatnagar, Sharanjit Kaur, and Sharma Chakravarthy. Clustering data streams using grid- based synopsis. Knowledge and Information Systems, 41(1):127–152, 2014. Dian Chen, Dequan Wang, Trevor Darrell, and Sayna Ebrahimi. Contrastive test-time adaptation. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 295–305, 2022a. Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International Conference on Machine Learning, pp. 1597–1607, 2020. Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets without pre-training or strong data augmentations. In International Conference on Learning Rep- resentations, 2022b. Sungha Choi, Seunghan Yang, Seokeon Choi, and Sungrack Yun. Improving test-time adaptation via shift-agnostic weight regularization and nearest source prototypes. In European Conference on Computer Vision, 2022. 10 Published as a conference paper at ICLR 2023 Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 8789–8797, 2018. Sayak Ray Chowdhury and Aditya Gopalan. On kernelized multi-armed bandits. In International Conference on Machine Learning, pp. 844–853, 2017. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255, 2009. Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. In Ad- vances in Neural Information Processing Systems, pp. 8780–8794, 2021. Qi Dou, Daniel Coelho de Castro, Konstantinos Kamnitsas, and Ben Glocker. Domain general- In Advances in Neural Information ization via model-agnostic learning of semantic features. Processing Systems, pp. 6447–6458, 2019. Jiawei Du, Hanshu Yan, Jiashi Feng, Joey Tianyi Zhou, Liangli Zhen, Rick Siow Mong Goh, and Vincent Tan. Efficient sharpness-aware minimization for improved training of neural networks. In International Conference on Learning Representations, 2022. Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimiza- tion for efficiently improving generalization. In International Conference on Learning Represen- tations, 2021. Jin Gao, Jialing Zhang, Xihui Liu, Evan Shelhamer, Trevor Darrell, and Dequan Wang. Back to In ICML Workshop on Updatable Machine the source: Diffusion-driven test-time adaptation. Learning, 2022. Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In International Conference on Learning Representations, 2018. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778, 2016. Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common cor- ruptions and perturbations. In International Conference on Learning Representations, 2019. Dan Hendrycks, Norman Mu, Ekin D Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshmi- narayanan. Augmix: A simple data processing method to improve robustness and uncertainty. In International Conference on Learning Representations, 2020. Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical In IEEE International Conference on Computer analysis of out-of-distribution generalization. Vision, pp. 8320–8329, 2021. Sepp Hochreiter and J ̈urgen Schmidhuber. Flat minima. Neural computation, 9(1):1–42, 1997. Steven CH Hoi, Doyen Sahoo, Jing Lu, and Peilin Zhao. Online learning: A comprehensive survey. Neurocomputing, 459:249–289, 2021. Junyuan Hong, Lingjuan Lyu, Jiayu Zhou, and Michael Spranger. MECTA: Memory-economic continual test-time model adaptation. In International Conference on Learning Representations, 2023. Xuefeng Hu, Gokhan Uzunbas, Sirius Chen, Rui Wang, Ashish Shah, Ram Nevatia, and Ser-Nam Lim. Mixnorm: Test-time adaptation through online normalization estimation. arXiv preprint arXiv:2110.11478, 2021. Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015. 11 Published as a conference paper at ICLR 2023 Yusuke Iwasawa and Yutaka Matsuo. Test-time classifier adjustment module for model-agnostic domain generalization. In Advances in Neural Information Processing Systems, pp. 2427–2440, 2021. Ansh Khurana, Sujoy Paul, Piyush Rai, Soma Biswas, and Gaurav Aggarwal. SITA: single image test-time adaptation. arXiv preprint arXiv:2112.02355, 2021. Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Bal- subramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, et al. WILDS: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning, pp. 5637–5664, 2021. Jogendra Nath Kundu, Naveen Venkat, R Venkatesh Babu, et al. Universal source-free domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 4544–4553, 2020. Jungmin Kwon, Jeongseop Kim, Hyunseo Park, and In Kwon Choi. ASAM: adaptive sharpness- aware minimization for scale-invariant learning of deep neural networks. In International Con- ference on Machine Learning, pp. 5905–5914, 2021. Boyi Li, Felix Wu, Ser-Nam Lim, Serge Belongie, and Kilian Q Weinberger. On feature normaliza- tion and data augmentation. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 12383–12392, 2021. Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy Hospedales. Learning to generalize: Meta-learning for domain generalization. In AAAI Conference on Artificial Intelligence, pp. 3490–3497, 2018a. Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss land- In Advances in Neural Information Processing Systems, pp. 6391–6401, scape of neural nets. 2018b. Rui Li, Qianfen Jiao, Wenming Cao, Hau-San Wong, and Si Wu. Model adaptation: Unsupervised In IEEE Conference on Computer Vision and Pattern domain adaptation without source data. Recognition, pp. 9638–9647, 2020. Jian Liang, Dapeng Hu, and Jiashi Feng. Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation. In International Conference on Machine Learning, pp. 6028–6039, 2020. Hyesu Lim, Byeonggeun Kim, Jaegul Choo, and Sungha Choi. TTN: A domain-shift aware batch normalization in test-time adaptation. In International Conference on Learning Representations, 2023. Sungbin Lim, Ildoo Kim, Taesup Kim, Chiheon Kim, and Sungwoong Kim. Fast autoaugment. In Advances in Neural Information Processing Systems, pp. 6665–6675, 2019. Hongbin Lin, Yifan Zhang, Zhen Qiu, Shuaicheng Niu, Chuang Gan, Yanxia Liu, and Mingkui Tan. Prototype-guided continual adaptation for class-incremental unsupervised domain adaptation. In European Conference on Computer Vision, pp. 351–368, 2022. Yuejiang Liu, Parth Kothari, Bastien van Delft, Baptiste Bellot-Gurlet, Taylor Mordan, and Alexan- dre Alahi. TTT++: when does self-supervised test-time training fail or thrive? In Advances in Neural Information Processing Systems, volume 34, pp. 21808–21820, 2021. Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 11976–11986, 2022. Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Confer- ence on Learning Representations, 2018. Chaithanya Kumar Mummadi, Robin Hutmacher, Kilian Rambach, Evgeny Levinkov, Thomas Brox, and Jan Hendrik Metzen. Test-time adaptation to distribution shift by confidence maxi- mization and input transformation. arXiv preprint arXiv:2106.14999, 2021. 12 Published as a conference paper at ICLR 2023 Zachary Nado, Shreyas Padhy, D Sculley, Alexander D'Amour, Balaji Lakshminarayanan, and Jasper Snoek. Evaluating prediction-time batch normalization for robustness under covariate shift. arXiv preprint arXiv:2006.10963, 2020. Shuaicheng Niu, Jiaxiang Wu, Yifan Zhang, Yaofo Chen, Shijian Zheng, Peilin Zhao, and Mingkui In International Conference on Tan. Efficient test-time model adaptation without forgetting. Machine Learning, pp. 16888–16905, 2022a. Shuaicheng Niu, Jiaxiang Wu, Yifan Zhang, Guanghui Xu, Haokun Li, Junzhou Huang, Yaowei Wang, and Mingkui Tan. Boost test-time performance with closed-loop inference. arXiv preprint arXiv:2203.10853, 2022b. A Emin Orhan. Robustness properties of facebook's resnext WSL models. arXiv preprint arXiv:1907.07640, 2019. Zhongyi Pei, Zhangjie Cao, Mingsheng Long, and Jianmin Wang. Multi-adversarial domain adap- tation. In AAAI Conference on Artificial Intelligence, pp. 3934–3941, 2018. Zhen Qiu, Yifan Zhang, Hongbin Lin, Shuaicheng Niu, Yanxia Liu, Qing Du, and Mingkui Tan. Source-free domain adaptation via avatar prototype generation and adaptation. In International Joint Conference on Artificial Intelligence, pp. 2921–2927, 2021. Alexander Rakhlin, Karthik Sridharan, and Ambuj Tewari. Online learning: Random averages, com- binatorial parameters, and learnability. In Advances in Neural Information Processing Systems, pp. 1984–1992, 2010. Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do cifar-10 classifiers generalize to cifar-10? arXiv preprint arXiv:1806.00451, 2018. Mengye Ren, Tyler R Scott, Michael L Iuzzolino, Michael C Mozer, and Richard Zemel. Online unsupervised learning of visual representations and categories. arXiv preprint arXiv:2109.05675, 2021. Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum classifier dis- In IEEE Conference on Computer Vision and crepancy for unsupervised domain adaptation. Pattern Recognition, pp. 3723–3732, 2018. Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias In Improving robustness against common corruptions by covariate shift adaptation. Bethge. Advances in Neural Information Processing Systems, volume 33, pp. 11539–11551, 2020. Shai Shalev-Shwartz et al. Online learning and online convex optimization. Foundations and Trends® in Machine Learning, 4(2):107–194, 2012. Shiv Shankar, Vihari Piratla, Soumen Chakrabarti, Siddhartha Chaudhuri, Preethi Jyothi, and Sunita Sarawagi. Generalizing across domains via cross-gradient training. In International Conference on Learning Representations, 2018. Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei Efros, and Moritz Hardt. Test-time train- ing with self-supervision for generalization under distribution shifts. In International Conference on Machine Learning, pp. 9229–9248, 2020. Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno Olshausen, and Trevor Darrell. Tent: Fully test-time adaptation by entropy minimization. In International Conference on Learning Repre- sentations, 2021. Qin Wang, Olga Fink, Luc Van Gool, and Dengxin Dai. Continual test-time domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 7201–7211, 2022. Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 7794–7803, 2018. Ross Wightman. Pytorch image models. https://github.com/rwightman/ pytorch-image-models, 2019. 13 Published as a conference paper at ICLR 2023 Yuxin Wu and Kaiming He. Group normalization. In European Conference on Computer Vision, pp. 3–19, 2018. Yuxin Wu and Justin Johnson. Rethinking "batch" in batchnorm. arXiv preprint arXiv:2105.07576, 2021. Huaxiu Yao, Yu Wang, Sai Li, Linjun Zhang, Weixin Liang, James Zou, and Chelsea Finn. Im- proving out-of-distribution robustness via selective augmentation. In International Conference on Machine Learning, pp. 25407–25437, 2022. Chen Zhang and Steven CH Hoi. Partially observable multi-sensor sequential change detection: A combinatorial multi-armed bandit approach. In AAAI Conference on Artificial Intelligence, pp. 5733–5740, 2019. Marvin Zhang, Sergey Levine, and Chelsea Finn. Memo: Test time robustness via adaptation and augmentation. In Advances in Neural Information Processing Systems, 2022. Yifan Zhang, Peilin Zhao, Shuaicheng Niu, Qingyao Wu, Jiezhang Cao, Junzhou Huang, and IEEE Trans- Mingkui Tan. Online adaptive asymmetric active learning with limited budgets. actions on Knowledge and Data Engineering, 33(6):2680–2692, 2019. Yifan Zhang, Shuaicheng Niu, Zhen Qiu, Ying Wei, Peilin Zhao, Jianhua Yao, Junzhou Huang, Qingyao Wu, and Mingkui Tan. COVID-DA: Deep domain adaptation from typical pneumonia to covid-19. arXiv preprint arXiv:2005.01577, 2020a. Yifan Zhang, Ying Wei, Qingyao Wu, Peilin Zhao, Shuaicheng Niu, Junzhou Huang, and Mingkui Tan. Collaborative unsupervised domain adaptation for medical image diagnosis. IEEE Transac- tions on Image Processing, 29:7834–7844, 2020b. Bowen Zhao, Chen Chen, and Shu-Tao Xia. DELTA: Degradation-free fully test-time adaptation. In International Conference on Learning Representations, 2023. Peilin Zhao and Steven CH Hoi. Cost-sensitive online active learning with application to mali- cious URL detection. In Proceedings of ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 919–927, 2013. Peilin Zhao, Steven CH Hoi, and Rong Jin. Double updating online learning. Journal of Machine Learning Research, 12:1587, 2011. Yaowei Zheng, Richong Zhang, and Yongyi Mao. Regularizing neural networks via adversarial model perturbation. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 8156– 8165, 2021. 14 Published as a conference paper at ICLR 2023 APPENDIX CONTENTS A Related Work B Pseudo Code of SAR C More Implementation Details C.1 More Details on Dataset . . . . C.2 More Experimental Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D Additional Results on ImageNet-C of Severity Level 3 D.1 Comparisons with State-of-the-arts under Online Imbalanced Label Shift D.2 Comparisons with State-of-the-arts under Batch Size of 1 . . . . . . . . E Additional Results on ImageNet-R and VisDA-2021 F Additional Ablate Results F.1 Effects of Components in SAR . . . . . . . . . F.2 Visualization of Loss Surface Learned by SAR . F.3 Sensitivity of ρ in SAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G Additional Discussions G.1 More Discussions on Model Collapse . . . . . . . . . . . . . . . . . G.2 Effects of Large Batch Sizes in BN models under Mix Domain Shifts G.3 Performance of Tent with ConvNeXt-LN . . . . . . . . . . . . G.4 Effectiveness of Model Recovery Scheme with Tent and EATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 18 19 19 19 22 22 22 23 24 24 25 25 26 26 26 26 26 15 Published as a conference paper at ICLR 2023 A RELATED WORK We relate our SAR to existing adaptation methods without and with target data, sharpness-aware optimization, online learning methods, and EATA (Niu et al., 2022a). Adaptation without Target Data. The problem of conquering distribution shifts has been stud- ied in a number of works at training time, including domain generalization (Shankar et al., 2018; Li et al., 2018a; Dou et al., 2019), increasing the training dataset size (Orhan, 2019), various data augmentation techniques (Lim et al., 2019; Hendrycks et al., 2020; Li et al., 2021; Hendrycks et al., 2021; Yao et al., 2022), to name just a new. These methods aim to pre-anticipate or simulate the possible shifts of test data at training time, so that the training distribution can cover the possible shifts of test data. However, pre-anticipating all possible test shifts at training time may be infea- sible and these training strategies are often more computationally expensive. Instead of improving generalization ability at training time, we conquer test shifts by directly learning from test data. Adaptation with Target Data. We divide the discussion on related methods that exploit target data into 1) unsupervised domain adaptation (adapt offline) and 2) test-time adaptation (adapt online). Unsupervised domain adaptation (UDA). Conventional UDA jointly optimizes on the labeled • source and unlabeled target data to mitigate distribution shifts, such as devising a domain discrimi- nator to align source and target domains at feature level (Pei et al., 2018; Saito et al., 2018; Zhang et al., 2020b;a) and aligning the prototypes of source and target domains through a contrastive learn- ing manner (Lin et al., 2022). Recently, source-free UDA methods have been proposed to resolve the adaptation problem when source data are absent, such as generative-based methods that generate source images or prototypes from the model (Li et al., 2020; Kundu et al., 2020; Qiu et al., 2021), and information maximization (Liang et al., 2020). These methods adapt models on a whole test set, in which the adaptation is offline and often requires multiple training epochs, and thus are hard to be deployed on online testing scenarios. Test-time adaptation (TTA). According to whether alter training, TTA methods can be mainly • categorized into two groups. i) Test-Time Training (TTT) (Sun et al., 2020) jointly optimizes a source model with both supervised and self-supervised losses, and then conducts self-supervised learning at test time. The self-supervised losses can be rotation prediction (Gidaris et al., 2018) in TTT or contrastive-based objectives (Chen et al., 2020) in TTT++ (Liu et al., 2021) and MT3 (Bartler et al., 2022), etc. ii) Fully Test-Time Adaptation (Wang et al., 2021; Niu et al., 2022a; Hong et al., 2023) does not alter the training process and can be applied to any pre-trained model, including adapting the statistics in batch normalization layers (Schneider et al., 2020; Hu et al., 2021; Khurana et al., 2021; Lim et al., 2023; Zhao et al., 2023), unsupervised entropy minimization (Wang et al., 2021; Niu et al., 2022a; Zhang et al., 2022), prediction consistency maximization (Zhang et al., 2022; Wang et al., 2022; Chen et al., 2022a), top-k classification boosting (Niu et al., 2022b), etc. Though effective at handling test shifts, prior TTA methods are shown to be unstable in the online adaptation process and sensitive to when test data are insufficient (small batch sizes), from mixed domains, have imbalanced and online shifted label distribution (see Figure 1). Here, it is worth not- ing that methods like MEMO (Zhang et al., 2022) and DDA (Gao et al., 2022) are not affected under the above 3 scenarios, since MEMO resets the model parameters after each sample adaptation and DDA performs input adaptation via diffusion (in which the model weights are frozen during test- ing). However, these methods can not exploit the knowledge learned from previously seen samples and thus obtain limited performance gains. Moreover, the heavy data augmentations and diffusion in MEMO and DDA are computationally expensive and inefficient at test time (see Table 6). In this work, we analyze why online TTA may fail under the above practical test settings and propose associated solutions to make TTA stable under various wild test settings. Sharpness-aware Minimization (SAM). SAM (Foret et al., 2021) optimizes both a supervised ob- jective (e.g., cross-entropy) and the sharpness of loss surface, aiming to find a flat minimum that has good generalization ability (Hochreiter & Schmidhuber, 1997). SAM and its variants (Kwon et al., 2021; Zheng et al., 2021; Du et al., 2022; Chen et al., 2022b) have shown outstanding performance on several deep learning benchmarks. In this work, when we analyze the failure reasons of test-time entropy minimization, we find that some noisy samples that produce gradients with large norms harm the adaptation and thus lead to model collapse. To alleviate this, we propose to minimize the 16 Published as a conference paper at ICLR 2023 sharpness of the test-time entropy loss surface so that the online model update is robust to those noisy/large gradients. Online Learning (OL). OL (Hoi et al., 2021; Chowdhury & Gopalan, 2017; Zhao et al., 2011) conducts model learning from a sequence of data samples one by one at a time, which is com- mon in many real-world applications (e.g., social web recommendation). According to the super- vision type, OL can be categorized into three groups: i) Supervised methods (Rakhlin et al., 2010; Shalev-Shwartz et al., 2012) obtain supervision at the end of each online learning iteration, ii) Semi- supervised methods (Zhang & Hoi, 2019) can obtain supervision from only partial samples, e.g., online active learning (Zhao & Hoi, 2013; Zhang et al., 2019) selects informative samples to query the ground-truth label for the model update, iii) Unsupervised methods (Bhatnagar et al., 2014) can not obtain any supervision during the whole online learning process. In this sense, test-time adapta- tion (TTA) (Sun et al., 2020; Wang et al., 2021) online updates models with only unlabeled test data and thus falls into the third category. However, unlike unsupervised OL that mainly aims to learn representations or clusters (Ren et al., 2021), TTA seeks to boost the performance of any pre-trained model on out-of-distribution test samples. Comparison with EATA (Niu et al., 2022a). Although both EATA and our SAR include a step to remove samples via entropy, their motivations behind this step are different. EATA seeks to improve the adaptation efficiency via sample entropy selection. In our SAR, we discover that some noisy gradients with large norms may hurt the adaptation and thus result in model collapse under wild test settings. To remove these gradients, we exploit an alternative metric (i.e., entropy), which helps to remove partial noisy gradients with large norms. However, this is still insufficient for achieving stable TTA (see ablation results in Table 5). Thus, we further introduce the sharpness- aware optimization and a model recovery scheme. With these three strategies, our SAR performs stably under wild test settings. 17 Published as a conference paper at ICLR 2023 B PSEUDO CODE OF SAR In this appendix, we provide the pseudo-code of our SAR method. From Algorithm 1, for each test sample xj, we first apply the reliable sample filtering scheme (refer to lines 3-6) to it to determine whether it will be used to update the model. If xj is reliable, we will optimize the model via the sharpness-aware entropy loss of xj (refer to lines 7-10). Specifically, we first calculate the optimal weight perturbation ˆ(cid:15)( ̃Θ) based on the gradient ̃ΘE(xj; Θ), and then update the model with ap- proximate gradients g = |Θ+ˆ(cid:15)( ̃Θ). Lastly, we exploit a recovery scheme to enable the model to work well even under a few extremely hard cases (refer to lines 11-13). Specifically, when the moving average value em of entropy loss is smaller than e0 (indicating that the model occurs to collapse), we will recover the model parameters ̃Θ to its original/initial value. ̃ΘE(xj; Θ) ∇ ∇ Algorithm 1: Sharpness-Aware and Reliable Test-Time Entropy Minimization (SAR) Input: Test samples Dtest = {xj}M j=1, model fΘ(*) with trainable parameters ̃Θ ⊂ Θ, step size η > 0, neighborhood size ρ > 0, E0 > 0 in Eqn. (2), e0 > 0 for model recovery. Output: Predictions {ˆyj}M j=1. 1 Initialize ̃Θ0 = ̃Θ, moving average of entropy em = 0; 2 for xj ∈ Dtest do 3 Compute entropy Ej=E(xj; Θ) and predict ˆyj=fΘ(xj); if Ej > E0 then continue ; // reliable entropy minimization (Eqn. 2) end Compute gradient ∇ ̃ΘE(xj; Θ); Compute ˆ(cid:15)( ̃Θ) per Eqn. (4); Compute gradient approximation: g = ∇ ̃ΘE(xj; Θ)|Θ+ˆ(cid:15)( ̃Θ) ; Update ̃Θ ← ̃Θ − ηg ; em=0.9×em+0.1×E(xj; Θ+ˆ(cid:15)( ̃Θ)) if em(cid:54)=0 else E(xj; Θ+ˆ(cid:15)( ̃Θ)) ; if em < e0 then Recover model weights: ̃Θ ← ̃Θ0 ; // sharpness-aware minimization (Eqn. 3) // moving average 4 5 6 7 8 9 10 11 12 13 end 14 15 end // model recovery 18 Published as a conference paper at ICLR 2023 C MORE IMPLEMENTATION DETAILS C.1 MORE DETAILS ON DATASET In this paper, we mainly evaluate the out-of-distribution generalization ability of all methods on a large-scale and widely used benchmark, namely ImageNet-C1 (Hendrycks & Dietterich, 2019). ImageNet-C is constructed by corrupting the original ImageNet (Deng et al., 2009) test set. The corruption (as shown in Figure 8) consists of 15 different types, i.e., Gaussian noise, shot noise, impulse noise, defocus blur, glass blue, motion blur, zoom blur, snow, frost, fog, brightness, con- trast, elastic transformation, pixelation, and JPEG compression, in which each corruption type has 5 different severity levels and the larger severity level means more severe distribution shift. Then, we further conduct experiments on ImageNet-R (Hendrycks et al., 2021) and VisDA-2021 (Bashkirova et al., 2022) to verify the effectiveness of our method. ImageNet-R contains 30,000 images with various artistic renditions of 200 ImageNet classes, which are primarily collected from Flickr and filtered by Amazon MTurk annotators. VisDA-2021 collects images from ImageNet-O/R/C and Ob- jectNet (Barbu et al., 2019). The domain shifts in VisDA-2021 include the changes in artistic visual styles, textures, viewpoints and corruptions. Figure 8: Visualizations of different corruption types in ImageNet corruption benchmark, which are taken from the original paper of ImageNet-C (Hendrycks & Dietterich, 2019). C.2 MORE EXPERIMENTAL PROTOCOLS All pre-trained models involved in our paper for test-time adaptation are publicly available, includ- ing ResNet50-BN2 obtained from torchvision library, ResNet-50-GN3 and VitBase-LN4 and ConvNeXt-LN5 obtained from timm repository (Wightman, 2019). We summarize the detailed characteristics of all involved methods in Table 6 and introduce their implementation details in the following. SAR (Ours). We use SGD as the update rule, with a momentum of 0.9, batch size of 64 (except for the experiments of batch size = 1), and learning rate of 0.00025/0.001 for ResNet/Vit models. The learning rate for batch size = 1 is set to (0.00025/16) for ResNet models and (0.001/32) for Vit models. The threshold E0 in Eqn. (2) is set to 0.4 ln 1000 by following EATA (Niu et al., 2022a). × ρ in Eqn. (3) is set by the default value 0.05 in Foret et al. (2021). For model recovery, we record the 1https://zenodo.org/record/2235448#.YzQpq-xBxcA 2https://download.pytorch.org/models/resnet50-19c8e357.pth 3https://github.com/rwightman/pytorch-image-models/releases/download/ v0.1-rsb-weights/resnet50_gn_a1h2-8fe6c4d0.pth 4https://storage.googleapis.com/vit_models/augreg/B_16-i21k-300ep-lr_ 0.001-aug_medium1-wd_0.1-do_0.0-sd_0.0--imagenet2012-steps_20k-lr_0. 01-res_224.npz 5https://dl.fbaipublicfiles.com/convnext/convnext_base_1k_224_ema.pth 19 PublishedasaconferencepaperatICLR2019Gaussian NoiseShot NoiseImpulse NoiseDefocus BlurFrosted Glass BlurMotion BlurZoom BlurSnowFrostFogBrightnessContrastElasticPixelateJPEGFigure1:OurIMAGENET-Cdatasetconsistsof15typesofalgorithmicallygeneratedcorruptionsfromnoise,blur,weather,anddigitalcategories.Eachtypeofcorruptionhasfivelevelsofseverity,resultingin75distinctcorruptions.SeedifferentseveritylevelsinAppendixB.faceofminorinputchanges.NowinordertoapproximateC,Eandtheserobustnessmeasures,wedesignedasetofcorruptionsandperturbationswhicharefrequentlyencounteredinnaturalimages.Wewillrefertotheseas"common"corruptionsandperturbations.ThesecommoncorruptionsandperturbationsareavailableintheformofIMAGENET-CandIMAGENET-P.4THEIMAGENET-CANDIMAGENET-PROBUSTNESSBENCHMARKS4.1THEDATAOFIMAGENET-CANDIMAGENET-PIMAGENET-CDesign.TheIMAGENET-Cbenchmarkconsistsof15diversecorruptiontypesappliedtovalidationimagesofImageNet.Thecorruptionsaredrawnfromfourmaincategories-noise,blur,weather,anddigital-asshowninFigure1.Researchthatimprovesperformanceonthisbenchmarkshouldindicategeneralrobustnessgains,asthecorruptionsarediverseandnumerous.Eachcorruptiontypehasfivelevelsofseveritysincecorruptionscanmanifestthemselvesatvaryingintensities.AppendixAgivesanexampleofthefivedifferentseveritylevelsforimpulsenoise.Real-worldcorruptionsalsohavevariationevenatafixedintensity.Tosimulatethese,weintroducevariationforeachcorruptionwhenpossible.Forexample,eachfogcloudisuniquetoeachimage.ThesealgorithmicallygeneratedcorruptionsareappliedtotheImageNet(Dengetal.,2009)validationimagestoproduceourcorruptionrobustnessdatasetIMAGENET-C.Thedatasetcanbedownloadedorre-createdbyvisitinghttps://github.com/hendrycks/robustness.IMAGENET-CimagesaresavedaslightlycompressedJPEGs;thisimpliesanimagecorruptedbyGaussiannoiseisalsoslightlycorruptedbyJPEGcompression.OurbenchmarktestsnetworkswithIMAGENET-Cimages,butnetworksshouldnotbetrainedontheseimages.NetworksshouldbetrainedondatasetssuchasImageNetandnotbetrainedonIMAGENET-Ccorruptions.Toenablefurtherexperimentation,wedesignedanextracorruptiontypeforeachcorruptioncategory(AppendixB),andweprovideCIFAR-10-C,TINYIMAGENET-C,IMAGENET64×64-C,andInception-sizededitions.Overall,theIMAGENET-Cdatasetconsistsof75corruptions,allappliedtoImageNetvalidationimagesfortestingapre-existingnetwork.3 Published as a conference paper at ICLR 2023 Table 6: Characteristics of state-of-the-art methods. We evaluate the efficiency of different methods with ResNet-50 (group norm) on ImageNet-C (Gaussian noise, severity level 5), which consists of totally 50,000 images. The real run time is tested via a single V100 GPU. DDA (Gao et al., 2022) pre-trains an additional diffusion model and then perform input adaptation/diffusion at test time. Method Need source data? Online update? #Forward #Backward Other computation GPU time (50,000 images) MEMO (Zhang et al., 2022) DDA (Gao et al., 2022) TTT (Sun et al., 2020) Tent (Wang et al., 2021) EATA (Niu et al., 2022a) SAR (ours) (cid:37) (cid:33) (cid:33) (cid:37) (cid:33) (cid:37) (cid:37) (cid:37) (cid:33) (cid:33) (cid:33) (cid:33) 64 AugMix (Hendrycks et al., 2020) 50,000 50,000 50,000 65 × 2 × 21 × 50,000 50,000 × 50,000 0 50,000 × 50,000 26,196 20 50,000 + 12,710 12,710 2 × 50,000 diffusion rotation augmentation n/a regularizer Eqn. (4) 55,980 seconds 146,220 seconds 3,600 seconds 110 seconds 114 seconds 115 seconds entropy loss values with a moving average factor of 0.9 for em, and the reset threshold e0 is set to 0.2. For learnable parameters, we only update affine parameters in normalization layers by following Tent (Wang et al., 2021). However, since the top/deep layers are more sensitive and more important to the original model than shallow layers as mentioned in (Mummadi et al., 2021; Choi et al., 2022), we freeze the top layers and update the affine parameters of layer or group normalization in the remaining shallow layers. Specifically, for ResNet50-GN that has 4 layer groups (layer1, 2, 3, 4), we freeze the layer4. For ViTBase-LN that has 11 blocks groups (blocks1-11), we freeze blocks9, blocks10, blocks11. TTT6 (Sun et al., 2020). For fair comparisons, we seek to compare all methods based on the same model weights. However, TTT alters the model training process and requires the model contains a self-supervised rotation prediction branch for test-time training. Therefore, we modify TTT so that it can be applied to any pre-trained model. Specifically, given a pre-trained model, we add a new branch (random initialized) from the end of a middle layer (2nd layer group of ResNet- 50-GN and 6th blocks group of VitBase-LN) for the rotation prediction task. We first freeze all original parameters of the pre-trained model and train the newly added branch for 10 epochs on the original ImageNet training set. Here, we apply an SGD optimizer, with a momentum of 0.9, an initial learning rate of 0.1/0.005 for ResNet50-GN/VitBase-LN, and decrease it at epochs 4 and 7 by decreasing factor 0.1. Then, we take the newly obtained model (with two branches) as the base model to perform test-time training. During the test-time training phase, we use SGD as the update rule with a learning rate of 0.001 for ResNet0-GN (following TTT) and 0.0001 for VitBase-LN, and the data augmentation size is set to 20 (following Niu et al. (2022a)). Tent7 (Wang et al., 2021). We follow all hyper-parameters that are set in Tent unless it does not provide. Specifically, we use SGD as the update rule, with a momentum of 0.9, batch size of 64 (except for the experiments of batch size = 1 and effects of small test batch sizes (in Section 4)), and learning rate of 0.00025/0.001 for ResNet/Vit models. The learning rate for batch size = 1 is set to (0.00025/32) for ResNet models and (0.001/64) for Vit models. The trainable parameters are all affine parameters of batch normalization layers. EATA8 (Niu et al., 2022a). We follow all hyper-parameters that are set in EATA unless it does not provide. Specifically, the entropy constant E0 (for reliable sample identification) is set to 0.1 × ln 1000. The (cid:15) for redundant sample identification is set to 0.05. The trade-off parameter β for entropy loss and regularization loss is set to 2,000. The number of pre-collected in-distribution test samples for Fisher importance calculation is 2,000. The update rule is SGD, with a momentum of 0.9, batch size of 64 (except for the experiments of batch size = 1 and effects of small test batch sizes (in Section 4)), and learning rate of 0.00025/0.001 for ResNet/Vit models. The learning rate for batch size = 1 is set to (0.00025/32) for ResNet models and (0.001/64) for Vit models. The trainable parameters are all affine parameters of batch normalization layers. MEMO9 (Zhang et al., 2022). We follow all hyper-parameters that are set in MEMO. Specifically, we use the AugMix (Hendrycks et al., 2020) as a set of data augmentations and the augmentation size is set to 64. For Vit models, the optimizer is AdamW (Loshchilov & Hutter, 2018), with learning 6https://github.com/yueatsprograms/ttt_imagenet_release 7https://github.com/DequanWang/tent 8https://github.com/mr-eggplant/EATA 9https://github.com/zhangmarvin/memo 20 Published as a conference paper at ICLR 2023 rate 0.00001 and weight decay 0.01. For ResNet models, the optimizer is SGD, with learning rate 0.00025 and no weight decay. The trainable parameters are the entire model. DDA10 (Gao et al., 2022). We reproduce DDA according to its official GitHub repository and use the default hyper-parameters. More Details on Experiments in Section 4: Normalization Layer Effects in TTA. In Section 4, we investigate the effects of TTT and Tent with models that have different norm layers under small { test batch sizes, mixed distribution shifts, online imbalanced label distribution shifts . For each } experiment, we only consider one of the three above test settings. To be specific, for experiments re- garding batch size effects (Section 4 (1)), we only tune the batch size and the test set does not contain multiple types of distribution shifts and its label distribution is always uniform. For experiments of mixed domain shifts (Section 4 (2)), the test samples come from the mixture of 15 corruption types, while the batch size is 64 for Tent and 1 for TTT, and the label distribution of test data is always uniform. For experiments of online label shifts (Section 4 (3)), the label distribution of test data is online shifted and imbalanced, while the BS is 64 for Tent and 1 for TTT, and test data only consist of one corruption type. Moreover, it is worth noting that we re-scale the learning rate for entropy minimization (Tent) according to the batch size, since entropy minimization is sensitive to the learn- ing rate and a fixed learning rate often fails to work well. Specifically, the learning rate is re-scaled as (0.00025/32) BS for Vit models. Compared with Tent, the single sample adaptation method TTT is not very sensitive to the learning rate, and thus we set the same learning rate for various batch sizes. We also provide the results of TTT under different batch sizes with dynamic re-scaled learning rates in Table 7. BS IF BS < 32 ELSE 0.00025 for ResNet models and (0.001/64) × × Table 7: Batch size (BS) effects in TTT (Sun et al., 2020) with different models (different norm layers). The learning rate is dynamically re-scaled by 0.001 BS. We report the accuracy (%) on ImageNet-C with Gaussian noise and severity level 5. × Model BS=1 BS=2 BS=4 BS=8 BS=16 ResNet50-BN ResNet50-GN 21.2 40.9 23.4 40.5 23.4 40.8 24.7 41.1 24.6 40.7 10https://github.com/shiyegao/DDA 21 Published as a conference paper at ICLR 2023 D ADDITIONAL RESULTS ON IMAGENET-C OF SEVERITY LEVEL 3 D.1 COMPARISONS WITH STATE-OF-THE-ARTS UNDER ONLINE IMBALANCED LABEL SHIFT We provide more results regarding online imbalanced label distribution shift (imbalance ratio = ) ∞ of all compared methods in Table 8. The results are consistent with that of the main paper (severity level 5), and our SAR performs best in the average of 15 different corruption types. It is worth noting that DDA achieves competitive results under noise corruptions while performing worse for other corruption types. The reason is that the diffusion model used in DDA for input adaptation is trained via noise diffusion, and thus its generalization ability to diffuse other corruptions is still limited. Table 8: Comparisons with state-of-the-art methods on ImageNet-C of severity level 3 under ON- LINE IMBALANCED LABEL DISTRIBUTION SHIFTS (imbalance ratio qmax/qmin = ) regarding Accuracy (%). "BN"/"GN"/"LN" is short for Batch/Group/Layer normalization. ∞ • • • • Model+Method Gauss. 27.7 ResNet50 (BN) 37.6 MEMO 49.9 DDA 3.4 Tent 1.3 EATA 54.5 55.9 61.0 59.1 52.3 ResNet50 (GN) MEMO DDA Tent EATA SAR (ours) 60.8 VitBase (LN) MEMO DDA Tent EATA SAR (ours) 68.8 ± 51.5 62.1 59.7 68.7 65.3 • • • • • • • • • • ± Noise Shot 25.2 34.5 50.0 3.2 0.9 52.9 54.3 61.0 58.6 52.9 Blur Weather Digital Impul. Defoc. Glass Motion 25.1 36.7 49.2 3.2 1.1 53.1 54.1 60.5 58.3 51.7 37.8 44.4 38.0 2.4 1.2 49.8 49.5 46.4 54.7 46.4 37.8 41.4 33.2 2.3 0.6 44.4 40.1 39.3 39.0 35.7 16.7 23.4 31.9 2.0 0.6 21.2 23.1 37.3 27.9 30.1 Zoom 35.3 40.9 36.7 3.4 1.4 39.3 41.4 39.7 41.1 39.6 Snow 35.2 44.6 35.1 2.4 1.3 54.9 54.8 47.7 51.3 43.8 Frost 32.1 37.3 34.1 2.4 1.3 54.1 54.1 48.1 41.4 39.8 Fog 46.7 52.4 35.01 4.6 1.9 55.8 57.6 29.9 62.0 55.7 Brit. 69.5 70.5 64.9 5.4 4.1 75.3 75.7 69.9 75.2 72.4 Contr. 46.2 56.3 33.7 3.0 1.6 69.7 70.2 57.8 70.1 66.6 Elastic 55.4 58.7 59.3 4.8 2.7 59.6 60.2 62.8 62.3 54.7 Pixel 46.2 55.2 53.9 4.6 2.4 59.7 61.5 60.1 63.7 56.0 JPEG 59.4 60.9 59.0 4.5 3.1 66.4 66.7 63.8 66.4 56.2 Avg. 39.8 46.3 44.3 3.4 1.7 54.1 54.6 52.4 55.4 50.3 0.1 60.5 0.3 60.2 0.2 47.9 0.5 36.7 0.7 58.2 0.2 49.7 0.5 57.9 0.3 53.6 0.0 65.0 0.1 76.4 0.2 71.0 0.0 67.0 0.2 65.8 0.1 67.6 0.0 59.9 0.1 ± 46.8 57.9 58.2 68.0 62.6 ± ± 50.4 61.5 59.4 68.1 63.6 ± ± 48.7 57.2 43.5 68.2 63.0 ± ± 37.1 45.6 43.3 63.8 57.1 ± ± 54.7 62.0 50.5 70.9 66.3 ± ± 41.6 49.9 41.0 63.8 59.3 ± ± 35.1 46.5 34.3 67.6 64.5 ± ± 33.3 43.1 34.4 41.9 61.0 ± ± 68.0 74.1 55.4 76.3 73.3 ± ± 69.3 75.8 65.0 78.8 76.9 ± ± 74.9 79.7 64.2 79.5 75.9 ± ± 65.9 72.6 64.1 75.9 74.2 ± ± 66.0 72.3 63.8 76.7 74.8 ± ± 63.6 70.6 62.9 73.7 73.1 ± 0.1 68.2 0.1 68.4 0.2 68.3 0.2 64.7 0.0 71.0 0.2 64.2 0.3 68.1 0.1 66.0 0.1 76.4 0.1 79.0 0.1 79.6 0.1 76.2 0.3 77.1 0.1 74.1 0.2 71.3 ± 53.8 62.1 53.3 69.5 67.4 0.1 ± D.2 COMPARISONS WITH STATE-OF-THE-ARTS UNDER BATCH SIZE OF 1 We provide more results regarding batch size = 1 of all compared methods in Table 9. The results are consistent with that of the main paper (severity level 5), and our SAR performs best in the average of 15 different corruption types. Table 9: Comparisons with state-of-the-art methods on ImageNet-C of severity level 3 under BATCH SIZE=1 regarding Accuracy (%). "BN"/"GN"/"LN" is short for Batch/Group/Layer normalization. • • • • Model+Method Gauss. 27.6 ResNet50 (BN) 37.5 MEMO 49.8 DDA 0.1 Tent 0.2 EATA 54.5 55.7 61.0 58.8 59.2 ResNet50 (GN) MEMO DDA Tent EATA SAR (ours) 60.3 VitBase (LN) MEMO DDA Tent EATA SAR (ours) 68.5 ± 51.6 61.9 59.8 67.1 60.7 • • • • • • • • • • ± Noise Shot 25.0 34.3 49.9 0.2 0.2 52.8 54.2 60.9 58.5 58.7 Blur Weather Digital Impul. Defoc. Glass Motion 25.1 36.6 49.2 0.2 0.1 53.1 53.9 60.4 58.7 58.8 37.7 44.2 37.9 0.1 0.2 49.7 49.2 46.4 54.9 55.5 38.0 41.2 33.2 0.2 0.2 44.3 40.0 39.2 38.2 45.7 16.9 23.3 32.0 0.1 0.1 21.2 22.8 37.2 26.8 32.6 Zoom 35.2 41.0 36.6 0.2 0.2 39.2 41.2 39.7 42.6 45.9 Snow 35.2 44.5 35.2 0.2 0.1 54.8 54.8 47.7 51.6 56.4 Frost 32.1 37.4 34.2 0.2 0.2 54.0 54.1 48.0 38.8 52.7 Fog 46.6 52.3 34.9 0.2 0.2 55.8 57.6 29.8 61.9 63.6 Brit. 69.6 70.5 64.9 0.2 0.2 75.4 75.5 70.0 75.3 75.9 Contr. 46.0 56.0 33.5 0.2 0.2 69.8 69.9 58.0 70.0 71.1 Elastic 55.6 58.7 59.3 0.2 0.2 59.6 60.0 62.7 62.3 64.7 Pixel 46.2 55.0 53.9 0.2 0.2 59.7 61.3 60.2 63.6 64.5 JPEG 59.3 60.8 59.0 0.2 0.2 66.3 66.6 63.8 66.3 67.8 Avg. 39.7 46.2 44.2 0.2 0.2 54.0 54.5 52.3 55.2 58.2 0.1 59.6 0.1 59.5 0.1 46.6 1.1 33.0 0.5 57.5 0.1 47.8 0.1 57.8 0.2 52.8 0.1 65.1 0.1 76.7 0.1 71.4 0.1 67.3 0.2 66.0 0.1 67.8 0.0 59.3 0.1 ± 46.9 57.7 58.2 66.2 58.5 ± ± 50.5 61.4 59.5 66.3 61.6 ± ± 48.7 57.0 43.4 66.3 60.1 ± ± 37.2 45.4 43.2 60.9 51.8 ± ± 54.7 61.8 50.4 69.1 64.2 ± ± 41.6 49.8 40.9 61.4 54.8 ± ± 35.1 46.6 34.2 65.2 53.3 ± ± 33.5 43.1 34.3 60.4 52.6 ± ± 67.8 73.9 55.2 75.2 72.5 ± ± 69.3 75.7 64.9 78.1 73.6 ± ± 74.8 79.6 64.0 78.8 77.9 ± ± 65.8 72.6 64.2 74.9 71.3 ± ± 66.0 72.1 63.7 75.8 71.3 ± ± 63.7 70.5 62.8 72.4 69.7 ± 0.1 67.8 0.1 68.0 0.1 67.8 0.2 63.1 0.0 70.7 0.1 63.5 0.1 66.9 0.2 62.8 2.1 75.8 0.5 77.7 0.8 78.4 0.4 74.7 1.5 75.7 0.5 72.7 1.1 70.3 ± 53.8 61.9 53.2 69.2 63.6 0.3 ± 22 Published as a conference paper at ICLR 2023 E ADDITIONAL RESULTS ON IMAGENET-R AND VISDA-2021 We further conduct experiments on ImageNet-R under two wild test settings: online imbalanced label distribution shifts (in Table 10) and batch size = 1 (in Table 11). The overall results are consistent with that on ImageNet-C: 1) ResNet50-GN and VitBase-LN perform more stable than ResNet50-BN; 2) Compared with Tent and EATA, SAR achieves the best performance on ResNet50- GN and VitBase-LN. Table 10: Comparison in terms of accuracy (%) under the wild setting online imbalanced label distribution shifts on ImageNet-R. Table 11: Comparison in terms of accuracy (%) under the wild setting single sample adaptation (batch size = 1) on ImageNet-R. Method ResNet50-BN ResNet50-GN VitBase-LN Method ResNet50-BN ResNet50-GN VitBase-LN No Adapt. Tent EATA SAR (ours) 36.2 6.6 5.8 - 40.8 41.7 40.9 42.9 43.1 45.2 47.5 52.0 No Adapt. Tent EATA SAR (ours) 36.2 0.6 0.6 - 40.8 42.2 42.3 43.9 43.1 40.5 52.5 53.1 We also compare our method with online TTA methods (Tent and EATA) on VisDA-2021. Results in Table 12 are consistent with that on ImageNet-C and ImageNet-R. Specifically, Tent and EATA fail with the BN model (ResNet50-BN) while performing stable with the GN/LN model (ResNet50- GN/VitBase-LN) under online imbalanced label shifts. Besides, our SAR further improves the adap- tation performance of Tent and EATA on ResNet50-GN/VitBase-LN. Table 12: Classification Accuracy (%) on VisDA-2021 under online imbalanced label distribu- tion shifts and mixed domain shifts. Model No adapt Tent EATA SAR (ours) ResNet50-BN ResNet50-GN VitBase-LN 36.0 43.7 44.3 9.0 42.8 49.1 7.4 40.9 49.0 – 44.1 52.0 23 Published as a conference paper at ICLR 2023 F ADDITIONAL ABLATE RESULTS F.1 EFFECTS OF COMPONENTS IN SAR We further ablate the effects of components in our SAR in Figure 9 by plotting the changes of gradients norms of our methods with different components. From the results, both the reliable (Eqn. 2) and sharpness-aware (sa) (Eqn. 3) modules together ensure the model's gradients keep in a normal range during the whole online adaptation process, which is consistent with our previous results in Section 5.2. Figure 9: The evolution of gradients norm during online test-time adaptation. Results on VitBase, ). "reli- ImageNet-C, shot noise, severity level 5, online imbalance label shift (imbalance ratio = able" and "sharpness-aware (sa)" are short for Eqn. (2) and Eqn. (3), respectively. ∞ We also conduct more ablation experiments under the wild test settings of "batch size (BS)=1" in Table 13 and "mix domain shifts" in Table 14. The results are generally consistent with that in Table 5. Both the reliable entropy and sharpness-aware optimization work together to stabilize online TTA. It is worth noting that only in VitBase-LN under BS=1 the model recovery scheme is activated and improves the average accuracy from 55.7% to 56.4%. Table 13: Effects of components in SAR. We report the Accuracy (%) on ImageNet-C (level 5) un- der BATCH SIZE=1. "reliable" and "sharpness-aware (sa)" denote Eqn. (2) and Eqn. (3), "recover" denotes the model recovery scheme. Model+Method ResNet50 (GN)+Entropy (cid:59) reliable (cid:59) reliable+sa (cid:59) reliable+sa+recover VitBase (LN)+Entropy (cid:59) reliable (cid:59) reliable+sa (cid:59) reliable+sa+recover Noise Gauss. Shot Impul. Defoc. Glass Motion Zoom Snow Frost Fog Brit. Contr. Elastic Pixel JPEG Avg. Blur Weather Digital 3.4 22.8 23.8 23.8 42.9 34.8 40.4 40.4 4.5 25.5 26.4 26.4 1.4 4.2 37.3 37.3 4.0 23.0 24.0 23.9 43.9 35.5 41.2 41.2 16.7 18.4 18.6 18.5 52.6 50.5 53.6 53.6 5.9 14.8 15.4 15.4 48.8 45.9 50.6 50.6 27.0 27.0 28.3 28.3 55.8 54.0 57.3 57.3 29.7 28.6 30.5 30.6 51.4 48.6 53.0 53.0 16.3 40.0 44.8 44.6 22.2 52.5 58.7 58.7 26.6 43.3 44.8 44.9 20.1 47.8 40.9 50.7 2.1 18.4 26.7 24.7 67.0 65.5 68.8 68.8 72.1 71.5 72.4 72.4 75.1 74.5 75.9 75.4 46.4 43.1 44.5 44.4 64.7 63.4 65.7 65.7 7.5 15.2 12.2 12.3 53.7 51.4 57.9 57.9 52.5 45.6 46.9 47.0 67.2 65.6 69.0 69.0 56.2 55.4 65.1 56.1 64.5 63.0 66.0 66.0 24.7 32.8 34.4 34.2 48.8 50.5 55.7 56.4 Table 14: Effects of components in SAR. We report the Accuracy (%) under MIXED DOMAIN SHIFTS, i.e., mixture of 15 corruption types of ImageNet-C with severity level 5. "reliable" and "sharpness-aware (sa)" denote Eqn. (2) and Eqn. (3), "recover" denotes the model recovery scheme. Model + Method Accuracy (%) ResNet50 (GN)+Entropy (cid:59) reliable (cid:59) reliable+sa (cid:59) reliable+sa+recover ResNet50 (GN)+Entropy (cid:59) reliable (cid:59) reliable+sa (cid:59) reliable+sa+recover 33.5 38.1 38.2 38.2 18.5 55.2 57.2 57.2 24 050010001500Online Batch0102030Gradient Norm (Avg.)entropyentropy+reliableentropy+reliable+sa Published as a conference paper at ICLR 2023 F.2 VISUALIZATION OF LOSS SURFACE LEARNED BY SAR In Figure 7 in the main paper, we have visualized the loss surface of Tent and our SAR on VitBase- LN. In this section, we further provide visualizations of ResNet50-GN. We select a checkpoint at batch 120 to plot the loss surface for Tent, since after batch 120 this model starts to collapse. In this case, the loss (entropy) is hard to degrade and cannot find a proper minimum. For our SAR, the model weights for plotting are obtained after the adaptation on the whole test set. By comparing Figures 10 (a)-(b), SAR helps to stabilize the entropy minimization process and find proper minima. Figure 10: Visualization of loss (entropy) surface. Models are learned on ImageNet-C of Gaussian noise with severity level 5. F.3 SENSITIVITY OF ρ IN SAR The hyper-parameter ρ (in Eqn. (3)) in sharpness-aware optimization is not hard to tune in our online test-time adaptation. Following Foret et al. (2021), we set ρ = 0.05 in all experiments, and it works well with different model architectures (ResNet50-BN, ResNet50-GN, VitBase-LN) on different datasets (ImageNet-C, ImageNet-R). Here, we also conduct a sensitivity analysis of ρ in Table 15, in which SAR works well under the range [0.03, 0.1]. Table 15: Sensitivity of ρ in SAR. We report Accuracy (%) on ImageNet-C (shot noise, severity level 5) under online imbalanced label distribution shifts, where the imbalance ratio is Method No adapt Tent SAR (ρ=0.01) SAR (ρ=0.03) SAR (ρ=0.05) SAR (ρ=0.07) SAR (ρ=0.1) . ∞ Accuracy (%) 6.7 1.4 40.3 47.7 47.6 47.2 47.2 25 306090306090(a) ResNet50-GN, Tent306090306090(b) ResNet50-GN, SAR (Ours)0.01.22.43.64.86.20.01.22.43.64.86.2 Published as a conference paper at ICLR 2023 G ADDITIONAL DISCUSSIONS G.1 MORE DISCUSSIONS ON MODEL COLLAPSE As we mentioned in Section 3.1, models online optimized by entropy (Wang et al., 2021; Niu et al., 2022a) under wild test scenarios are easy to collapse, i.e., predict all samples to a single class inde- pendent of the inputs. To alleviate this, prior methods (Liang et al., 2020; Mummadi et al., 2021) exploit diversity regularization to force the output distribution of samples to be uniform. However, this assumption is unreasonable at test time such as when test data are imbalanced during a period (as in Figure 1 (c)) and this method also relies on a batch of samples (in contrast to Figure 1 (b)). In this sense, this strategy is infeasible for our problem. In our paper, we resolve the collapse is- sue for test-time adaptation from an optimization perspective to make the online adaptation process stabilized. G.2 EFFECTS OF LARGE BATCH SIZES IN BN MODELS UNDER MIX DOMAIN SHIFTS In Section 3.1, we mentioned that a standard batch size (e.g., 64 on ImageNet) works well when there is only one type of distribution shift. However, when test data contains multiple shifts, this batch size fails to calculate an accurate mean and variance estimation in batch normalization lay- ers. Here, we investigate the effects of super large batch sizes in this setting. From Table 16, the adapted performance increases as the batch size increases, indicating that a larger batch size helps to estimate statistics more accurately. It is worth noting that the performance on severity level 3 degrades when BS is larger than 1024. This is because we fix the learning rate for various batch sizes and in this sense, BS=1024 may lead to insufficient model updates. Moreover, although en- larging batch sizes is able to boost the performance, the adapt performance is still inferior to the average accuracy of adapting on each corruption type separately (i.e., average adapt). This further emphasizes the necessity of exploiting models with group or layer norm layers to perform test-time entropy minimization. Table 16: Effects of large batch sizes (BS) in Tent (Wang et al., 2021) with ResNet-50-BN under MIXTURE OF 15 DIFFERENT CORRUPTION TYPES on ImageNet-C. We report accuracy (%). Severity Level = 5 Level = 3 Base 18.0 39.8 avg. adapt BS=64 mix adapt BS=32 BS=64 BS=128 BS=256 BS=512 BS=1,024 42.6 59.0 0.9 20.1 2.3 40.7 4.0 46.7 8.3 49.1 12.4 49.0 16.4 47.8 G.3 PERFORMANCE OF TENT WITH CONVNEXT-LN For mainstream neural network models, the normalization layers are often coupled with network architecture. Specifically, group norm (GN) and batch norm (BN) are often combined with conven- tional networks, while layer norm (LN) is more suitable for transformer networks. Therefore, we in- vestigate the layer normalization effects in TTA in Section 4 through VitBase-LN. Here, we conduct more experiments to compare the performance of online entropy minimization (Wang et al., 2021) on ResNet50-BN and ConvNeXt-LN (Liu et al., 2022). ConvNeXt is a convolutional network equipped with LN. The authors conduct significant modifications over ResNet to make this LN-based convo- lutional network work well, such as modifying the architecture (ResNet block to ConvNeXt block, activation functions, etc.), various training strategies (stochastic depth, random erasing, EMA, etc.). From Table 17, Tent+ConvNeXt-LN performs more stable than Tent+ResNet50-BN, but still suffers several failure cases. These results are consistent with that of ResNet50-BN vs. VitBase-LN. G.4 EFFECTIVENESS OF MODEL RECOVERY SCHEME WITH TENT AND EATA In this subsection, we apply our Model Recovery scheme to Tent (Wang et al., 2021) and EATA (Niu et al., 2022a). From Table 18, the model recovery indeed helps Tent a lot (e.g., the average accuracy from 22.0% to 26.1% on ResNet50-GN) while its performance gain on EATA is a bit marginal. Com- pared with Tent+recovery and EATA+recovery, our SAR greatly boosts the adaptation performance, 26 Published as a conference paper at ICLR 2023 Table 17: Results of Tent on ResNet50-BN and ConvNeXt-LN. We report Accuracy (%) on ImageNet-C under online imbalanced label distribution shifts and the imbalance ratio is . ∞ Severity level 5 ResNet50-BN Tent (Wang et al., 2021) ConvNeXt-LN Tent (Wang et al., 2021) Severity level 3 ResNet50-BN Tent (Wang et al., 2021) ConvNeXt-LN Tent (Wang et al., 2021) • • • • Noise Gauss. Shot Impul. Defoc. Glass Motion Zoom Snow Frost Fog Brit. Contr. Elastic Pixel JPEG Avg. Blur Weather Digital 2.2 1.2 52.3 26.3 2.9 1.4 52.7 11.9 1.8 1.4 52.3 36.9 17.8 1.0 31.7 31.1 9.8 0.9 18.7 12.7 14.5 1.2 42.5 14.6 22.5 2.6 38.1 5.1 16.8 1.7 54.2 7.8 23.4 1.8 58.3 5.3 24.6 3.6 50.6 6.6 59.0 5.0 75.6 79.0 5.5 0.5 56.8 67.6 17.1 2.6 32.2 1.5 20.7 3.2 39.2 68.4 31.6 3.1 60.4 65.8 18.0 2.1 47.7 29.4 Gauss. Shot Impul. Defoc. Glass Motion Zoom Snow Frost Fog Brit. Contr. Elastic Pixel JPEG Avg. 27.7 3.4 71.1 73.4 25.2 3.2 69.8 73.5 25.1 3.2 72.4 74.4 37.8 2.3 55.2 66.8 16.7 2.0 36.6 61.6 37.8 2.4 64.3 71.4 35.3 3.4 52.8 64.2 35.2 2.4 63.2 22.6 32.1 2.4 64.0 39.5 46.7 4.6 66.0 76.8 69.5 5.4 79.4 81.2 46.2 3.0 75.8 78.9 55.4 4.8 69.1 76.8 46.2 4.6 68.5 75.6 59.4 4.5 71.9 75.8 39.8 3.4 65.4 67.5 e.g., the average accuracy 26.1% (Tent+recovery) vs. 37.2% (SAR) on ResNet50-GN, suggesting the effectiveness of our proposed SAR. Table 18: Results of combining model recovery scheme with Tent and EATA. We report the Accu- racy (%) on ImageNet-C severity level 5 under online imbalanced label distribution shifts and the imbalance ratio is Model+Method ResNet50 (GN) Tent Tent+recover EATA EATA+recover SAR (ours) • • • • • VitBase (LN) Tent Tent+recover EATA EATA+recover SAR (ours) • • • • • JPEG Avg. 52.3 53.7 53.7 38.4 40.9 56.3 47.6 66.4 66.4 63.7 63.7 66.6 30.6 22.0 26.1 31.6 32.9 37.2 29.9 47.3 52.3 50.0 49.9 58.1 . ∞ Noise Gauss. Shot Impul. Defoc. Glass Motion Zoom Snow Frost Fog Brit. Contr. Elastic Pixel Blur Weather Digital 18.0 2.6 10.1 27.0 26.1 33.1 9.4 32.7 40.3 35.9 35.9 46.5 19.8 3.3 12.2 28.3 31.0 36.5 6.7 1.4 10.1 34.6 34.6 43.1 17.9 2.7 10.6 28.1 27.2 35.5 8.3 34.6 42.4 36.7 36.7 48.9 19.8 13.9 13.9 14.9 19.9 19.2 29.1 54.4 54.4 45.3 45.3 55.3 11.4 7.9 8.5 17.1 18.5 19.5 23.4 52.3 52.3 47.2 47.2 54.3 21.4 19.5 19.5 24.4 25.7 33.3 34.0 58.2 58.1 49.3 49.3 58.9 24.9 17.0 20.6 25.3 25.7 27.7 27.0 52.2 52.2 47.7 47.7 54.8 40.4 16.5 24.3 32.2 35.9 23.9 15.8 7.7 31.6 56.5 56.5 53.6 47.3 21.9 33.5 32.0 28.6 45.3 26.3 12.0 39.2 55.4 55.4 46.2 33.6 1.8 8.9 39.8 40.4 50.1 47.4 69.3 69.3 62.2 62.2 69.7 69.3 70.5 70.5 66.7 68.2 71.9 54.7 76.1 76.1 72.2 72.2 76.2 36.3 42.2 42.2 33.6 35.3 46.7 43.9 66.1 66.1 21.7 21.7 66.2 18.6 6.6 13.5 24.5 27.6 7.1 30.5 56.7 56.7 56.2 56.2 60.9 28.4 49.4 49.4 41.9 42.9 52.1 44.5 69.4 69.4 64.7 64.7 69.6 27
http://arxiv.org/abs/2302.12392v1
2023-02-24T01:46:13
2023-02-24T01:46:13
Better Predict the Dynamic of Geometry of In-Pit Stockpiles Using Geospatial Data and Polygon Models
Modelling stockpile is a key factor of a project economic and operation in mining, because not all the mined ores are not able to mill for many reasons. Further, the financial value of the ore in the stockpile needs to be reflected on the balance sheet. Therefore, automatically tracking the frontiers of the stockpile facilitates the mine scheduling engineers to calculate the tonnage of the ore remaining in the stockpile. This paper suggests how the dynamic of stockpile shape changes caused by dumping and reclaiming operations can be inferred using polygon models. The presented work also demonstrates how the geometry of stockpiles can be inferred in the absence of reclaimed bucket information, in which case the reclaim polygons are established using the diggers GPS positional data at the time of truck loading. This work further compares two polygon models for creating 2D shapes.
[ "Mehala. Balamurali", "Konstantin M. Seiler" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12392v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12392v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Proceedings of the 40th International Symposium on the Application\n of Computers and Operations Research in the Minerals Industries (APCOM,\n 2021), 257-267. Johannesburg: The Southern African Institute of Mining and\n Metallurgy, 2021" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Better Predict the Dynamic of Geometry of In-Pit Stockpiles Using Geospatial Data and Polygon Models Mehala.Balamurali1, Konstantin M. Seiler2 1,2Australian Centre for Field Robotics, University of Sydney Email: [email protected], [email protected] Modelling stockpile is a key factor of a project economic and operation in mining, because not all the mined ores are not able to mill for many reasons. Further, the financial value of the ore in the stockpile needs to be reflected on the balance sheet. Therefore, automatically tracking the frontiers of the stockpile facilitates the mine scheduling engineers to calculate the tonnage of the ore remaining in the stockpile. This paper suggests how the dynamic of stockpile shape changes caused by dumping and reclaiming operations can be inferred using polygon models. The presented work also demonstrates how the geometry of stockpiles can be inferred in the absence of reclaimed bucket information, in which case the reclaim polygons are established using the diggers GPS positional data at the time of truck loading. This work further compares two polygon models for creating 2D shapes. INTRODUCTION Detailed and up-to-date knowledge about material contained in stockpiles is crucial for modern mining operations. Knowledge about stockpiles is used for strategic planning, to achieve blend targets as well as for business reporting. Tracking the stockpile contents purely incrementally by counting the number of truck loads that have been dumped and reclaimed quickly leads to drifts caused by tracking errors from the fleet management system as well as variable payloads across individual track loads. Conventional methods for estimating the volume of stockpiles assume the geometry shape of the stockpiles are regular such as rectangular, triangular prism and trapezoidal (Bajtala et al, 2012) and therefore use mathematical models such as trapezoidal, Simpson-based, cubic spline, and cubic Hermite formulas. These methods use three dimensions points collected using the unmanned aerial vehicle (UAV) and the digital elevation models (DEM) (Uysal, et al 2015; Hamzah et al 2011; Ulvi, 2018). However, the surface of stockpiles is not often a regular shape. Thus, the models using mathematical calculations are prone to failure to infer the volume of stockpiles correctly (Zhao et al., 2012). UAV based photogrammetric point clouds are sometimes used to estimate the volume of stockpiles with irregular shapes. High-resolution and dense 3D points generated by UAV have advanced 3D surface models and thus provide detailed geometry information of irregular stockpiles (Mancini et al, 2017, Sayab et al, 2018; Raeva et al, 2016, Ref 17; Ref 18). Although 3D models from UAV-based photogrammetry provide high accuracy, measuring stockpile volumes explicitly using photogrammetry technique or any other sensor data that collects 3D point clouds such as LIDAR is time consuming and the methods need high storage and additional data collection techniques. In addition to this, most of the studies regarding the stockpile volume estimation are limited to product stockpiles. Modern mine automation systems provide telemetry data from mobile equipment which is available close to real-time. This allows for fine-grained inferencing of the movements and actions of vehicles. This paper investigates the possibility to use high resolution positional data from global navigation satellite systems (GNSS) such as GPS to perform volumetric estimates of a in pit stockpile's content. Figure 1 A typical in-pit stockpile shows that material can be dumped from either the low side (right-hand side) or high side (left-hand side). Reclaiming only happens from the low side. Figure 1 shows a typical in-pit stockpile as it is considered in this work. The stockpile consists of a low side and a high side (skyway). Material can be added to the stockpile from the low side through paddock-dumping where truckloads are placed on the ground in individual mounds. Alternatively, material is added from the skyway by dumping it over the edge, potentially further building up an area which already contains material from paddock-dumping. When reclaiming, material is always recovered from the low side of the stockpile over the entire height of the available material. By using information from a site's fleet management system (FMS) and position data from vehicles, the location of a dump event can be inferred accurately. Similarly, by combining position information from wheel loaders and FMS data, the position material is reclaimed from can be inferred. This work combines the information about individual load and dump events to infer the shape of the stockpile throughout the operation. The main objective of this study is to create timely 2D geometric shapes of stockpiles using truck dump and load events at stockpiles. A Convex-hull method (Jarvis, 1973, 1977) was used to create the polygons around dump points that demonstrate how the different parcels of ore grades that are added to and reclaimed from the stockpile over different time periods. Convex-hulls are widely used to create d-dimension convex polygons that encloses all the given points (Dunder et al, 2008; Zhongliang and Yuefeng, 2012; Jingfan Fan et al, 2013; Hazra et al, 2004). These polygons were tested on an active in-pit stockpile at Pilbara region in Western Australia, where the material was dumped and reclaimed simultaneously. The dump and reclaiming polygons were created using truck GPS positions and loader bucket reclaim positions respectively. As comparison, a second polygon model based on alpha shapes was created to represent the stockpile geometry. Alpha-shape polygons are derived from the Delaunay triangulation for a given set of points (Edelsbrunner, 1983; Edelsbrunner et al, 1994). The polygon shape is controlled by a parameter that defines how tightly the boundary hugs around points (Edelsbrunner et al., 2006, Weiqiang and Hong, 2010). Further, this study demonstrates how the geometry of stockpiles can be inferred in absence of loader bucket information, in which case the reclaim polygons are established purely using the digger GPS positional data at the time of truck loading. Aerial photographs were used to validate the results at different time points. METHODOLOGY This section describes the data used in this study and the techniques of Convex hull and Alpha shape polygons which are central to this work. Publicly available polygon methods were tested. Two algorithms are provided in this study. The Algorithm 1 describes how the 2D geometry of the stockpile grows continuously with the continuous dumps only or how the geometry of the stockpile continuously shrinks with continuous reclaims only. Algorithm 2 describes the dynamic of 2D 2 geometry of stockpile by simultaneously considering dump events followed by the reclaim events or other way. Data Data was collected at a stockpile in an iron ore surface mine in Australia's Pilbara region from March to December 2019. Truck GPS positions indicating dump events were collected using timestamps provided by the fleet management system and by selecting samples where the truck is standing still. Similarly, bucket reclaim positions and the digger GPS positions were collected at the time of a truck being present for loading at the stockpile. These raw positional data points were then used as input to create dump and load polygons for a given time period. Different intervals were used to create the polygons. Convex hull Convex hulls are widely used in many fields to create d-dimension convex polygons that enclose all the given points. The main idea behind a convex hull comes from the definition of a convex polygon. A convex polygon is a polygon with all its interior angles less than 180°. By using this definition, every regular polygon is convex. If one angle has more than 180 degrees, the polygon is considered to be concave. A convex hull uses the same principle as convex polygon applied to set of points. For instance, a convex hull is the smallest convex polygon containing all the points of a set. While simple and well understood, convex hulls come with the limitation that they are unable to represent concave shapes. Alpha shape Unlike convex hull, alpha shape gives a better precision for finding accurate outline of a set of points. Alpha-polygon is a simple polygon in which all internal angles are less than 180+alpha. When alpha is equal to zero, then the polygon is convex hull polygon. Alpha shape polygons are derived from the Delaunay triangulation for a given set of points. In mathematics and computational geometry, a Delaunay triangulation for a given set P of discrete points in a plane is a triangulation DT(P) such that no point in P is inside the circumcircle of any triangle in DT(P). Delaunay triangulations maximize the minimum angle of all the angles of the triangles in the triangulation. Computing the Delaunay triangulation of a point set consists in linking all the points in a way of creating triangles linking all the points then removing all the triangles for which at least one edge exceeds alpha in length. Dump or reclaim polygon The convex hull or alpha shapes likely break (or overestimate reclaiming or dumping) if the dump and reclaim actions don't occur in straight line patterns. As can be seen in Figure 2 while some trucks dumped at high side (Red) and some dumped at lower side (green points) at the same time interval or there is any kind of digging that's not a single contiguous "chunk". Figure 2: Dumping happens as different clusters; red points show dumps at high end of stockpile and green points show the dumps at lower side of stockpile. 3 To provide 2D polygons for spatially separated chunks of dump and reclaim events, dump and reclaim positions within a time range were clustered using DBSCAN. DBSCAN is a density-based spatial clustering method commonly used for GPS trajectory data processing (Ester, 1996). It is based on the observation that points surrounding a dump or dig event usually form a high-density cluster. Hereby two parameters are used to define density: the search distance (Eps) and the minimum number of points (MinPts) within an area defined by the distance threshold. Points which satisfy those conditions related to density were grouped to form dump and reclaim clusters. Then the polygon model is then applied to each cluster. The proposed Algorithm 1 for dump or reclaim polygons describes how the polygon grows during continuous dumping and shrinks during continuous reclaiming. This algorithm uses Scikit learn implementation for DBSCAN and publicly available implementation for convex hull or alpha shape polygons (Sean and Kevin). ALGORITHM 1: DUMP/RECLAIM POLYGON Step 1: Define variables t0, ∆t, tf and Ts for start of event interval, event duration, end of event interval and timestamp for stopping computation; Array 'Cluster' for cluster labels and array GPS for truck GPS positions or bucket reclaim positions (x, y, timestamp); DBSCAN, Polygon and Plot- hull are functions. Here the function Polygon can be replaced with Convex hull or Alpha shape implementation. Plot-hull is to plot the polygons. Step 2: Start with initial values t0, ∆t Step 3: Repeat steps below until tf =Ts 3.1 tf=t0 + ∆t 3.2 Locations = GPS [timestamp] ⊆ (t0, tf) 3.3 Cluster = DBSCAN (Locations) 3.4 For c = 1: length (unique (Cluster)) hull = Polygon (Locations [c]) plot-hull 3.5 t0= tf The Algorithm 2 is proposed to see the dynamics of a stockpile's 2D shape by tracing both regions of dumps and reclaims when the reclaim polygons simultaneously remove the dumps. The algorithm finds the area of dump polygon intersects with the reclaim polygons and then removes the dumps cover by the corresponding reclaim polygon. This algorithm also uses diggers' GPS position at the time of truck loading to create 2D geometry of stockpile shape in the absence of reclaimed bucket position data. ALGORITHM 2: Step 1: Define variables t0, ∆t, tf and Ts for start of event interval, event duration, end of event interval and timestamp for stopping computation; Array 'Cluster' for cluster labels and array 'GPS_TRUCK' for truck GPS positions/ dump locations (x, y), 'BUCKET' for bucket dig positions and 'GPS_DIGGER' for diggers GPS position with timestamps; DBSCAN, Polygon are functions. Step 2: Start with initial values t0, ∆t Step 3: Repeat steps below until tf =Ts 3.1 tf=t0 + ∆t 3.2 DL =GPS_TRUCK ⊆ (t0, tf) 3.3 BL = BUCKET ⊆ (t0, tf) 3.4 WL_GPS = GPS_DIGGER ⊆ (t0, tf) 3.5 If number of rows in (BL & WL_GPS) = 0 3.5.1 Cluster = DBSCAN (DL) 3.5.2 For c=1: length (unique (Cluster)) D_hull = Polygon (DL[c]) 4 3.6 Elseif number of rows in BL > 0 3.6.1 R_hull = Polygon (BL) 3.6.2 inhull_samples= D_hull ⋂ R_hull 3.6.3 remaining_DL=DL- inhull_samples 3.6.4 Cluster=DBSCAN (remaining_DL) 3.6 .5 For c= 1: length (unique (Cluster)) D_hull = Polygon (remaining_DL[c]) 3.7 Elseif number of rows in BL= 0 & number of rows in WL_GPS > 0 3.7.1 R_hull = Polygon (WL_GPS) 3.7.2 inhull_samples= D_hull ⋂ R_hull 3.7.3 remaining_DL= DL- inhull_samples 3.7.4 Cluster=DBSCAN (remaining_DL) 3.7.5 For c= 1 : length (unique (Cluster)) D_hull = Polygon (remaining_DL[c]) 3.8 t0= tf RESULTS AND DISCUSSION Dump and reclaim polygons using Algorithm 1 Figure 3 shows how the different parcels of dumps are clustered using DBSCAN, thus creating different polygons around the dump. Figure 3 shows the convex hull polygons on clustered dump positions The polygons in Figure 4a show how the stockpile area is continuously growing as the trucks are continuously dumping material at the given stockpile. Similarly, the polygons in Figure 4b show how the reclaim area is growing continuously with the continuous bucket reclaim points from the same stockpile. Each polygon represents the results obtained by Algorithm 1 that used convex hull polygon model with the truck dump points or bucket reclaim points for every two hours interval and 30 minutes intervals respectively. Colours of the polygons represent the oldest to latest polygons in both figures. Therefore, the latest dump polygon in Figure 4a (colour number 14) shows the stockpile area with full of material and the latest reclaim polygon in Figure 4b shows the empty stockpile area. The dump positions were inferred from the truck GPS positions. 5 s n o g y l o p t s e t a l o t t s e d O l Figure 4 (Left)Convex hull dump polygons around the dump points for every two hours interval. (Right) re- claim polygons around the reclaim positions for every 30 minutes. Number on colour bar 0 to 14 shows oldest to latest polygons. Computing the convex hull of sets of dumps or reclaim points is a way to represent the region occupied by these points. The convex hull of set of points is convex polygon with the minimum area that includes all these points. Dynamic of stockpile shape changes caused by dumping and reclaiming operations Figure 5 shows the results obtained by Algorithm 2. In this example, the proposed algorithm used the convex hull polygon. The intersecting area of the dump polygons (sky-blue and grey) shows the area where the dumps at high side (green) had been overlaid on earlier dumps (pink) at low side. The plots in Figure 5 show how the dumps had been continuously removed using the reclaim polygons (red/blue) from the right side to left side at the low side of the stockpile. The plots were produced for every 24 hours period. Reclaim polygons (red) that used bucket reclaim positions, were used to remove the previous dumps. The blue reclaim polygons in Figure 5 were created using digger's GPS positions and the polygon is presented here for a comparison purpose. The comparison between the blue and red polygon shows that the polygons around the digger's GPS positions closely follow the reclaim polygons of bucket reclaim points. Thus, the individual plots in Figure 5 clearly shows that the digger's GPS positions can be used as an alternative to bucket reclaim positions to create reclaim polygons with the correct off set values. This alternative data is beneficial for removing the dumps during loading because sometimes diggers frequently go into off-nominal states due to disturbances or faults and thus fail to record all bucket reclaim positions. The digger used in this study was a wheel loader. It can be seen in Figure 5, even though the dumps had been reclaimed, still there were some false dump points at the lower side of the stockpile and therefore the plots still show the false dump polygon at the low side of the stockpile instead of only showing the dump polygon (sky-blue) at high side. The model results can be improved by identifying the exact dump and reclaim positions using the calibrated truck and bucket positions and removing outliers. In addition to this, using improved polygon models with small time intervals may help define the dump and reclaim regions accurately and therefore can remove the dumps correctly. Optimising the parameters can further help to improve the results because the convex hull shape and DBSCAN depends on radius parameters and distance thresholds. These are subject to further investigation. The aerial image given in Figure 5 was captured in December at the same stockpile used in this example. Even though the exact time this figure was taken is not known, the remaining stockpile seen in the high side area supports the results, sky-blue polygon area, obtained by the model in December. 6 Figure 5: Green and pink points represent the dump (truck GPS position) locations and sky-blue and grey polygons represent the corresponding dump polygons at high and low side of the stockpile respectively. Red and blue points show the reclaim locations by bucket dig locations and diggers GPS positions and the corresponding colour polygons show the reclaimed area. Tracking the dynamic of 2D geometry of stockpile in the absence of bucket reclaim positions The plots in the left and right columns of Figure 6 compare how the stockpile geometry shape can be inferred in the absence of bucket reclaim positions. It has been proved from the trace of diggers GPS positions (blue points) in Figure 6 that the diggers continuously had loaded material in that area, but the bucket reclaim positions had not been recorded (no red points). Thus, when Algorithm 2 was set to only use bucket reclaim positions, the model left the dumps unchanged (Figure 6 left column). On 2019- 06-01 the plot on the left column shows some new dumps underneath the existing high side dumps. This is not possible and thus the results again prove that the diggers GPS positions shown in Figure 6 are associated with some reclaiming action. The plots in the right column of Figure 6 show how the reclaim polygon that used diggers GPS positions, had removed the dumps continuously. As mentioned before, even though we could still see the presence of dump polygon at the low side due to the falsely left over dump points, the results reasonably justify the dumps that appeared on 2019-06-01 were the new dumps that were dumped at the low side of the stockpile next to the edge of the high side (right plots in Figure 6). Figure 6: Green and pink points represent the dump (truck GPS position) locations and sky-blue and grey polygons represent the corresponding dump polygons at high and lower side of the stockpiles respectively. Blue 7 points in column left show the diggers GPS position and blue polygons in right column shows the reclaim polygon using diggers GPS The aerial image (Fig 7) taken in June at the same stockpile supports the model results provided in Figure 6. Therefore, a conclusion can be drawn that diggers GPS positions can be used to create reclaim polygons in the absence of bucket reclaim positions. June 2019 Figure 7 shows the aerial image of stockpile where new dumps are happening at the lower side of the stock pile. Alpha shape vs Convex hull Figure 8 compares the Alpha shape (left) and Convex hull (right) polygons around the dump points (green) The alpha-shapes methodology presented here represents an additional tool for quantifying 2D shape complexity across dumps characterised by high spatial disparity. As can be seen in Figure 8 the boundaries of the truck GPS positions (dump positions) are better represented by the alpha shape polygon compared to the convex hull polygon. The convex hull (Fig. 8b) occupies a space equal to or larger than that of the underlying dump locations. In contrast, very fine alpha shape (Fig. 8a) defined a 2D space smaller than the area defined by convex hull. This was obtained by some 'optimal' level of refinement. Figure 9 shows the alpha shape polygon around the dumps on satellite image. Figure 9: Alpha shape polygon around dumps are shown in satellite imagery 8 CONCLUSION The pilot work presented here is an important addition to the geologist's tool kit, providing a guidance of how the stockpile grows and ablates with time. The model suggests that the calibrated diggers GPS positions can be used to create reclaim polygons when the buckets' information are missing and there- fore the model can help to track the 2D geometry of the stockpile. Compared to convex hull, alpha shape proves to be especially useful in representing the topographical complexity of a stockpile surface. Creating the dump and reclaim polygons in the short time interval will help to understand the dynamic of 2D geometry better. Having high frequency aerial images can be a great tool for validating the model results. Further investigation is needed to improve the model outputs. ACKOWLEDGMENT This work has been supported by the Australian Centre for Field Robotics and the Rio Tinto Centre for Mine Automation, the University of Sydney. REFERENCES Bajtala, M., Bruˇ,cák, P.; Kubinec, J., Lipták, M., Sokol, Š. (2012) The problem of determining the volumes using modern surveying techniques.J. Interdiscip. Res.2012, 147–150. Uysal, M.; Toprak, A.S.; Polat, N. (2015) DEM generation with UAV photogrammetry and accuracy analysis in Sahitler hill. Measurement ,73, 539–543. Ulvi, A, (2018) Analysis of the utility of the unmanned aerial vehicle (UAV) in volume calculation by using photogrammetry techniques. International Journal of Engineering and Geosciences (IJEG), Vol; 3; Issue; 2, pp. 043-049, ISSN 2548-0960, Turkey, DOI: Your 10.26833/ijeg.377080 Hamzah, H.B., Said, S.M. (2011) Measuring volume of stockpile using imaging station. Geoinf. Sci. J.2011,11,15–32. Zhao, S., Lu, T.-F., Koch, B., Hurdsman, A. (2012) Stockpile modelling using mobile laser scanner for qualitygrade control in stockpile management. In Proceedings of the 12th International Conference on Control Automation Robotics & Vision (ICARCV), Guangzhou, China, 5–7 December 2012; pp. 811–816 Jingfan Fan, Jian Yang, Mahima Goyal, Yongtian Wang (2013) Rigid Registration of 3-D Medical Image Using Convex Hull Matching, IEEE International Conference on Bioinformatics and Biomedicine, December 18-21, 2013, Shanghai, pp 338-341. Zhongliang Fu and Yuefeng Lu (2012) An efficient algorithm for the convex hull of planar scattered point set, International Archieves of the Photogrammetry, Remote sensing and Spatial Information Sciences, XXII ISPRS Congress, Melbourne, Australia, pp 63-66. Dunder, M. M., Fung, G., Krishnapuram, B., Rao, R.B (2008) Multiple Instance learning algorithms for computer –Aided detection, IEEE Transactions on Biomedical Engineering, pp 1015-1021. Hazra, A., Deb, S., Kundu, S., Hazra, P. (2013) Shape Oriented Feature Selection for Tomato Plant Identification, International Journal of Computer Application Technology and Research, Vol. 2, Issue 4, 2013, pp 449-454. Jarvis, R. A. (1973) On the identification of the convex hull of a finite set of points in the plane. Inform. Process. Lett. 2 (1973), 18–21. 9 Jarvis, R. A. (1977) Computing the shape hull of points in the plane. In Comput. Soc. Conf. Pattern Recognition and Image Processing, 1977, 231–241. Edelsbrunner, H., Kirkpatrick, D. G. and R. Seidel (1983) On the shape of a set of points in the plane. IEEE Trans. Inform. Theory IT-29, 551–559. Edelsbrunner, H. and M ̈ucke, E. P. (1994) Three-dimensional alpha shapes. ACM Trans. Graphics 13, 43–72. Weiqiang Zhou and Hong Yan, (2010) A Discriminatory Function for Prediction of Protein-DNA Interactions based on Alpha Shape Modeling, Bioinformatics 26(20):2541-8, DOI: 10.1093/bioinformatics/btq478 Edelsbrunner, H., D. Kirkpatrick, and R. Seidel (2006), On the shape of a set of points in the plane, IEEE Trans. Inf. Theor., 29(4), 551– 559, doi:10.1109/TIT.1983.1056714. Mancini, F., Castagnetti, C. Rossi, P., Dubbini, M., Fazio, N.L., Perrotti, M., Lollino, P. (2017) An integrated procedureto assess the stability of coastal rocky cliffs: Fom UAV close-range photogrammetry to geomechanical finiteelement modeling. Remote Sens.,9, 1235. Sayab, M., Aerden, D., Paananen, M., Saarela, P. (2018) Virtual structural analysis of Jokisivu open pitusing (UAV) photogrammetry: Implications for structurally controlled gold deposits in southwest Finland. Remote Sens.,10, 1296. 'structure-from-motion' unmanned aerial vehicle Aerial Survey Techniques Applied for Stockpile Progress Measurements.Available online:https://www.iadc- dredging.com/ul/cms/terraetaqua/document/4/6/7/467/467/1/article-aerial-survey- techniques-applied-for-stockpile-progress-measurements-terra-et-aqua-141-3.pdf (accessed on 1 June 2018). Fast and Accurate Volume Measurement, Drones online: https://www.pix4d.com/blog/drone-mining-stockpile-volume-pix4dmapper (accessed on 1 June 2018). in Mining. Available Drawing boundaries https://nbviewer.jupyter.org/github/dwyerk/boundaries/blob/master/concave_hulls.ipynb Ester, M., et al. (1996) A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise. Sean Gillies, alpha_shape` function code https://sgillies.net/2012/10/13/the-fading-shape-of- alpha.html Kevin Dwyer http://blog.thehumangeo.com/2014/05/12/drawing-boundaries-in-python/ 10
http://arxiv.org/abs/2302.12391v3
2023-06-06T05:34:19
2023-02-24T01:43:17
PITS: Variational Pitch Inference without Fundamental Frequency for End-to-End Pitch-controllable TTS
Previous pitch-controllable text-to-speech (TTS) models rely on directly modeling fundamental frequency, leading to low variance in synthesized speech. To address this issue, we propose PITS, an end-to-end pitch-controllable TTS model that utilizes variational inference to model pitch. Based on VITS, PITS incorporates the Yingram encoder, the Yingram decoder, and adversarial training of pitch-shifted synthesis to achieve pitch-controllability. Experiments demonstrate that PITS generates high-quality speech that is indistinguishable from ground truth speech and has high pitch-controllability without quality degradation. Code, audio samples, and demo are available at https://github.com/anonymous-pits/pits.
[ "Junhyeok Lee", "Wonbin Jung", "Hyunjae Cho", "Jaeyeon Kim", "Jaehwan Kim" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12391v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12391v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.AS", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.AS", "cs.LG", "cs.SD" ]
PITS: Variational Pitch Inference Without Fundamental Frequency for End-to-End Pitch-Controllable TTS 3 2 0 2 n u J 6 ] S A . s s e e [ 3 v 1 9 3 2 1 . 2 0 3 2 : v i X r a Junhyeok Lee 1 Wonbin Jung 1 2 Hyunjae Cho 1 3 Jaeyeon Kim 1 3 Jaehwan Kim 1 3 Abstract Previous pitch-controllable text-to-speech (TTS) models rely on directly modeling fundamental frequency, leading to low variance in synthe- sized speech. To address this issue, we pro- pose PITS, an end-to-end pitch-controllable TTS model that utilizes variational inference to model pitch. Based on VITS, PITS incorporates the Yin- gram encoder, the Yingram decoder, and adversar- ial training of pitch-shifted synthesis to achieve pitch-controllability. Experiments demonstrate that PITS generates high-quality speech that is in- distinguishable from ground truth speech and has high pitch-controllability without quality degrada- tion. Code, audio samples, and demo are available at https://github.com/anonymous-pits/pits. 1. Introduction Text-to-speech (TTS) is a generative task that synthesizes human-like speech waveforms from a given text input. Since it is a one-to-many mapping problem, there are some chal- lenges to model diverse duration, pitch, and etc. in speeches. Recent deep neural network-based TTS models (Wang et al., 2017; Shen et al., 2018; Kim et al., 2021; Donahue et al., 2021; Ren et al., 2021; Ju et al., 2022; Shirahata et al., 2022) have significantly increased their synthesis quality. Among them, VITS (Kim et al., 2021) is the most successful end-to-end (E2E) TTS, which is modeling the one-to-many nature of TTS by adopting variational auto-encoder (VAE) (Kingma & Welling, 2014) and normalizing flow (Chen et al., 2019) to provide diverse pitches and rhythms. Espe- cially in rhythms, J. Kim et al. (Kim et al., 2021) propose a stochastic duration predictor and monotonic alignment search (MAS) that finds the maximum evidence lower bound (ELBO) path between the latent variables from the short- time Fourier transform (STFT) encoder and the text encoder to train a model without annotated duration labels. 1maum.ai Inc. 2Korea Advanced Institute of Science and Tech- nology (KAIST) 3Seoul National University (SNU). Correspon- dence to: Junhyeok Lee <[email protected]>. Preprint. On the other hand, there have been several efforts to model and control the pitch of synthesized speech. FastSpeech 2 (Ren et al., 2021) adopts a variance adaptor with a pitch pre- dictor that predicts fundamental frequency (f0) at the frame- level to provide pitch information in the speech. FastPitch (Ła ́ncucki, 2021) improves upon FastSpeech 2 by proposing character-level pitch prediction, and FastPitchFormant (Bak et al., 2021) builds on these previous methods by incorpo- rating pitch information to model speech according to the source-filter theory (Fant, 1971). These models are deter- ministic in pitch predictions and only rely on the variance in dropout. VarianceFlow (Lee et al., 2022b) applies nor- malizing flow for variance, but it also has low variance due to directly modeling f0. Although text-to-pitch is a one-to- many mapping, these pitch-controllable TTS models tend to have low pitch variance while they are directly modeling ground truth f0. There are also some variants that have been developed to adopt pitch predictors in VITS. VISinger (Zhang et al., 2021), a singing voice synthesizer, incorporates frame prior networks and f0 predictor for enhanced acoustic variation and more natural singing. However, the use of frame prior networks requires the duration predictor to be trained with annotated labels without the use of MAS. Period VITS (Shi- rahata et al., 2022), builds on the modifications introduced in VISinger and adds a periodicity generator. These models have limitations in that it requires external annotated dura- tion labels and pitch contours which are expected to reduce the diversity of speech synthesis. Since entangled pitch information, especially f0, in linguis- tic information degrades the quality of speech synthesis, there have been several efforts to disentangle them in voice conversion (Polyak et al., 2021; Choi et al., 2021; Kim et al., 2022; Wang et al., 2021). A. Polyak et al. (Polyak et al., 2021) attempt to separate these two factors using vector quantization (VQ) models, HuBERT (Hsu et al., 2021) and VQ-VAE (van den Oord et al., 2017). H. Choi et al. (Choi et al., 2021) use wav2vec 2.0 (Baevski et al., 2020) for language information and introduced Yingram, an acoustic feature inspired by YIN algorithm (de Cheveign ́e & Kawa- hara, 2002), that captures pitch information including har- monics. Yingram is designed to address the limitations of f0, which is not well-defined in some cases (Ardaillon & PITS: Variational Pitch Inference Without Fundamental Frequency for End-to-End Pitch-Controllable TTS Roebel, 2020). This feature enables the training of pitch- controllable models in a fully self-supervised manner. In addition, the Yingram-based model shows better preference than the f0-based model (Choi et al., 2021). To overcome the limitations of previous pitch-controllable TTS models, which have low variance and rely on exter- nal f0 extractors and labeled phoneme durations, we pro- pose PITS, variational Pitch Inference for Text-to-Speech, an E2E model that incorporates variational pitch inference without f0. PITS models pitch information by using condi- tional VAE and normalizing flow for the Yingram, instead of directly modeling f0. Additionally, PITS utilizes two posterior encoders, the STFT encoder, and an additional Yingram encoder, unlike the original VITS, which only uti- lizes a single posterior encoder. We also introduce several new features to PITS to improve pitch-controllability, in- cluding the Yingram decoder and pitch-shifted waveform synthesis during training. To support these new features, we propose additional loss terms, including Yingram re- construction loss, Yingram decoding loss, and adversarial pitch-shifted loss. Through our proposed method, PITS can generate speech with high naturalness, almost indis- tinguishable from recorded speech. In addition, PITS has pitch-controllability that could shift its relative pitch without quality degradation. 2. PITS Based on the VITS generator (Kim et al., 2021), we add several modifications to build a pitch-controllable model. Different from VITS, PITS has Yingram encoder, Yingram decoder, Q-VAE, and synthesizing pitch-shifted waveforms during training. Figure 1 is an overall illustration of PITS during training and inference. 2.1. Yingram Encoder We propose an additional posterior encoder, the Yingram encoder, to model pitch information including harmonics. Similar to previous works aimed at disentangling linguistic information and pitch information (Polyak et al., 2021; Choi et al., 2021), our proposed model PITS uses both the STFT encoder and the Yingram encoder to encode linguistic infor- mation and pitch information, respectively. The architecture of the Yingram encoder is identical to the STFT encoder without the number of channels. We set the number of input and output channels to be the same as 80 channels. To achieve pitch-controllability, we crop the latent variables from the Yingram encoder, instead of cropping the Yingram as done in NANSY (Choi et al., 2021). While voice conver- sion tasks have access to a source speech to calculate the Yingram, TTS does not have access to any source speech during inference. Therefore, we crop the middle (16th - 65th channels) of the latent variables in the channel dimension, similar to cropping middle-frequency bins of Yingram in NANSY. We set the scope of the latent variables for the decoder as 50 channels, while we are utilizing 80 channels Yingram. To start, the latent variables from the Yingram encoder, zyin, are cropped to default scope (16th - 65th chan- nels) as zcrop. Additionally, scope-shift is determined by the randomly sampled integer s, which represents scope-shift, from a uniform distribution between [−15, 15], and crops the scope-shifted ((s+16)th - (s+65)th channels) latent vari- ables zshift crop . The cropped latent variables from the Yingram encoder are concatenated with the latent variables from the STFT encoder and concatenated latent variables are fed to the decoder. For the flow and MAS, we concatenate the variational latent variables from the Yingram encoder and the STFT encoder and feed them to the normalizing flow. The ELBO or Kull- back–Leibler (KL) divergence calculations are also the same as in the original VITS without concatenation. The Yingram encoder can be employed for voice conver- sion (VC) by extracting pitch information from the source samples. VC details are available in Appendix A. 2.2. Yingram Decoder Building pitch-controllability by shifting the scope of la- tent variables requires the Yingram encoder to be translation equivariant in the channel direction. However, we found that outside of the default scope was not trained and remained as Gaussian. To enforce this translation equivariance, we design the Yingram decoder to reconstruct shifted scopes of Yingram from shifted latent variables. The Yingram de- coder then reconstructs the Yingram of (s+16)th - (s+65)th crop . L1 channels from the scope-shifted latent variables zshift norm is used to measure this reconstruction, the Yingram decoding loss Lyd is represented as: Lyd = λyinE (cid:104)(cid:13) (cid:13)Y shift crop − Decyin (cid:0)zshift crop (cid:1)(cid:13) (cid:13)1 (cid:105) , (1) where Y is the original Yingram, Ycrop is the cropped Yin- gram with default scope, Y shift crop is the cropped Yingram with scope-shift, Decyin is the Yingram decoder, and λyin is a multiplier for yin reconstruction loss and set to 45. 2.3. Q-VAE We try Q-VAE (Sun et al., 2020; Qiang et al., 2022) for the output of the STFT encoder zspec to disentangle the outputs of the Yingram encoder and the STFT encoder. We anticipate that quantizing the latent variables from the STFT encoder will effectively separate pitch information from linguistic features, while pitch information is typically rep- resented as a continuous variable. However, previous TTS models including VQ (Sun et al., 2020; Du et al., 2022; Siuz- PITS: Variational Pitch Inference Without Fundamental Frequency for End-to-End Pitch-Controllable TTS (a) PITS training procedure (b) PITS inference procedure Figure 1: Overall system diagram of (a) training procedure and (b) inference procedure. dak et al., 2022) have a limitation in that they are multiple- stage models. To remove multiple stages including VQ ex- tractor and vocoder training, we apply Q-VAE to the VITS training scheme (Kim et al., 2021) by quantizing the output latent variable of the STFT encoder zspec. With this imple- mentation, the VQ extractor is trained along the waveform decoder, flow, text encoder, and duration predictor. During applying Q-VAE (Sun et al., 2020; Qiang et al., 2022), we observed that codebook loss Lvq and commit loss Lcommit diverge. It seems that our scheme is different from normal VQ-VAE since zspec gets multiple gradients from flow and codebooks. To prevent the diverging loss, we scale the gradient of zshift crop from codebooks to 1/λmel, where λmel is a multiplier for mel-spectrogram reconstruction loss and set to 45. We use codebooks of size 160 and apply two codebooks as multiple codebooks in previous quantization modules (Hsu et al., 2021; Baevski et al., 2020). 2.4. Pitch-Shifted Waveform Synthesis The cropped latent variables from the Yingram encoder, zcrop and zshift crop , are concatenated with the latent variables from the STFT encoder, zvq or zspec, depending on whether quantization is applied, to form zdec and zshift for input to dec the decoder. For brevity, zvq or zspec is replaced to zling. In the case of scope-shifted variables, zshift crop is concatenated with zling after applying gradient stop to disentangle pitch information from it. To construct a stable pitch-controllable model, PITS syn- thesizes pitch-shifted waveforms during training. While the default synthesized raw waveforms are trained to minimize mel-spectrogram loss to reconstruction loss, pitch-shifted waveforms do not have a corresponding ground-truth mel- spectrogram as the default synthesized signals do. To ensure that pitch-shifted synthesized speeches are indeed "pitch- shifted" from the default synthesized speeches, we propose two additional loss terms, the Yingram reconstruction loss, and the adversarial pitch-shifted loss. First, since the ground truth mel-spectrogram of pitch- shifted speech is not available, we apply the Yingram re- construction loss to both of normal synthesized signals and pitch-shifted synthesized signals for reconstruction loss. As YIN (de Cheveign ́e & Kawahara, 2002) and Yingram (Choi et al., 2021) are autocorrelation-based algorithms, they can be made differentiable. However, unlike the Yingram decod- ing, the ideal Yingram of the pitch-shifted speech could not be perfectly translation equivariant due to the presence of lin- guistic information. Thus, we apply a negative exponential to the cropped Yingrams, as values close to zero are more critical for representing harmonics. Yingram reconstruction loss Lyin is defined as: (cid:104)(cid:13) (cid:13) Lyin =λyinE (cid:13) (cid:13)e(−Y shift (cid:13) (cid:13)e(−Ycrop) − e(−Ycrop(G(zdec)))(cid:13) (cid:13) (cid:13)1 dec )))(cid:13) (cid:105) crop ) − e(−Ycrop(G(zshift (cid:13) (cid:13)1 + , (2) where Ycrop is the Yingram crop function and G is the waveform decoder. In addition, while we apply additional Yingram reconstruction loss, we modify the notation of mel-spectrogram reconstruction loss from Lrecon to Lmel. Second, we encountered quality degradation in the pitch- shifted synthesized speech by the model that was trained using only Lyin. To prevent this degradation, we also feed pitch-shifted synthesized speech to the discriminators for adversarial feedback to pitch-shifted speeches. Since wave- form synthesis GANs (Kim et al., 2021; Kong et al., 2020; Kumar et al., 2019; Bak et al., 2022) get a paired input, we also pair the pitch-shifted waveforms with their original real waveforms. The time-aligned linguistic features of the pitch- shifted waveforms and real waveforms are identical, despite the difference in pitch, which makes the paired adversar- ial training between them reliable. Identical to waveform SpeakerEmbeddingSTFTEncoderDecoderYingramEncoderYingramDecoderDiscriminatorsDurationPredictorFlowTextEncoderRealWaveformxlinLinearSpectrogramzspeczlingzzdeczshiftdeczyinzcropzshiftcropYYingramcidSpeakerIDRawWavefromShiftedRawWavefrom(VQ)concatconcat//concatslicectextPhonemesμ,σMonotonicAlignmentSearchhtext//StopGradientSpeakerEmbeddingDecoderzspeczlingzzdeczshiftdeczyinzcropzshiftcropcidSpeakerIDRawWavefromShiftedRawWavefrom(VQ)concatconcatsplitcropshift+cropctextPhonemesμ,σLengthRegulatorTextEncoderFlowhtextDurationPredictor PITS: Variational Pitch Inference Without Fundamental Frequency for End-to-End Pitch-Controllable TTS synthesis GANs, we apply the least-square loss (Mao et al., 2017) Lshift adv (G) for the GAN and feature matching loss (Larsen et al., 2016) Lshift fm (G) for the generator. For the discriminators, we apply CoMBD and SBD from Av- ocodo (Bak et al., 2022) instead of MPD (Kong et al., 2020). We expect that CoMBD's collaborative structure, with multi- scale and hierarchical inputs, could enhance speech quality. To improve the pitch-shifted synthesis, we also feed hier- archical outputs of pitch-shifted synthesis to the CoMBD. To prevent periodicity artifacts, we apply PhaseAug (Lee et al., 2022a) during training. We do not apply PhaseAug to hierarchical outputs from the generator. state-of-the-art TTS models, VITS (Kim et al., 2021) and FastSpeech 2 + HiFi-GAN (FS2) (Ren et al., 2021; Kong et al., 2020). We trained VITS with ARPABET without stress by modifying the official implementation. For FS2, we adopted an unofficial modified implementation with un- supervised duration (Badlani et al., 2022) and its pre-trained model1 (Lee, 2022). HiFi-GAN was trained by ourselves using the official implementation. All models, except for FS2, were trained for 3,000 epochs from scratch on four V100 GPUs. Automatic mixed preci- sion was applied during training. We set the batch size to 48 for each GPU. Each training took between 14 to 18 days. 2.5. Total Loss 3.3. Implementation Details With our proposed method, the total loss for training PITS can be represented as follows: Ltotal =Lmel + LKL + Ldur + Ladv(G) + Lfm(G) + Lyin + (cid:0)Lshift adv (G) + Lshift + (Lyd) + (Lvq + Lcommit) , fm (G)(cid:1) (3) where Lmel, LKL, Ldur, Ladv, and Lfm are originated from loss of VITS (Kim et al., 2021). Terms enclosed in paren- theses can be omitted in the model architecture search. The flow model consists of 192 channels, the STFT encoder consists of 112 channels, and the decoder gets 162 channels of input. Aside from these modifications, the remaining details of the architecture are identical to the original VITS setup (Kim et al., 2021). Our Yingram setup is different from that used in H. Choi et al. (Choi et al., 2021). In our setup, 24 notes represent an octave for fine pitch modeling and note 69 is fixed at 440 Hz. We generate Yingram with 80 channels from notes ranging between -5 to 74, which corresponds to 30.8 to 508 Hz. 3. Experiments 3.1. Datasets We conduct experiments with the VCTK dataset (Veaux et al., 2016), which includes 44 hours of recorded speech by 108 speakers with text labels. We preprocess the dataset by resampling all audio files to 22.05 kHz sampling rate data and transcribing all text into ARPABET without stress using the internal grapheme-to-phoneme model. The dataset is then split into training, validation, and test sets, with 43,225, 324, and 324 files, respectively. 3.2. Model Setups To determine the optimal architecture, we perform an ar- chitecture search with four combinations. Although the Yingram encoder and Lyin are necessary for constructing a pitch-controllable model, we do not include them in the ar- chitecture search. The four variations of PITS are (A+D+Q), (A+D), (A+Q), and (D+Q), where A, D, and Q respectively denote adversarial loss for pitch-shifted signal, Yingram decoding loss, and Q-VAE. To evaluate the quality of pitch- controllability, we generate the pitch-shifted speeches by shifting the scope of normal speech, corresponding to a scope-shift of 0, with scope-shift values of [8,6,4,2,-2,-4,- 6,-8], which correspond to pitch-shift values of [-4,-3,-2,- 1,+1,+2,+3,+4] semitones, respectively. We compare normal speech synthesis of PITS with previous 3.4. Evaluation To compare the models, we generate speeches from the mod- els only with the test split's text and speaker identity. We conduct a subjective evaluation using 5-scale mean opinion score (MOS). Each of MOS is performed with 324 samples and 1,620 ratings, with 95% confidence interval (CI). To quantitatively evaluate the quality of TTS models, we mea- sure equal error rate (EER) and character error rate (CER) to assess their speaker similarity and speech intelligibil- ity, respectively. EER is measured by official pre-trained RawNet3 (Jung et al., 2022). CER is calculated by a pre- trained open-source model, Silero xlarge (Team, 2021). To measure EER and CER, we resample all audio signals to 16 kHz. (cid:104)(cid:13) (cid:13)e(−Y shift (cid:13) To evaluate the quantitative performance of pitch-shift, we use the shifted part of the Yingram reconstruction loss as dec )))(cid:13) (cid:105) yin = λyinE (cid:13) Lshift (cid:13)1 Unlike the loss calculation during training, where the ground truth is available, we compute the difference between the Yingram of normal synthesized speech and scope-shifted speech to obtain a Lshift yin . crop (zdec)) − e(−Ycrop(G(zshift . 1The pre-trained modified FastSpeech 2 model was trained on the VCTK and ARPABET datasets with stress. PITS: Variational Pitch Inference Without Fundamental Frequency for End-to-End Pitch-Controllable TTS Table 2: The evaluation results of pitch-shifted synthesized speeches. The best value in each pitch-shift is shown in bold. In cases where the standard deviation of two values overlaps, The values are paired in bold. While the (D+Q) model, which is expected to overfitting in Lshift yin , the second-best value is also highlighted in bold. yin , yields the best results in Lshift MOS ± CI (↑) CER (%) (↓) EER (%) (↓) Lshift yin (↓) s A+D+Q A+D A+Q D+Q A+D+Q A+D A+Q D+Q A+D+Q A+D A+Q D+Q A+D+Q A+D A+Q D+Q 8 6 4 2 0 -2 -4 -6 -8 3.39±0.05 3.41±0.05 3.45±0.05 3.49±0.05 3.87±0.04 3.94±0.04 3.92±0.04 4.01±0.04 3.72±0.05 3.77±0.04 3.80±0.04 3.85±0.04 2.39±0.06 2.48±0.06 2.68±0.06 2.73±0.06 3.70±0.05 4.01±0.04 3.90±0.04 3.65±0.05 3.48±0.05 3.51±0.05 3.51±0.05 3.50±0.05 3.94±0.04 3.84±0.04 3.79±0.05 3.78±0.05 3.79±0.04 3.78±0.04 3.73±0.05 3.64±0.05 2.57±0.06 2.52±0.06 2.53±0.06 2.50±0.06 57.1 56.4 58.8 55.4 42.3 56.2 58.0 58.1 58.7 5.76 5.00 3.98 3.64 3.27 3.66 4.17 4.83 5.84 20.9 19.7 18.3 17.5 18.8 18.1 19.2 20.7 23.0 52.0 51.5 51.3 50.8 49.6 52.4 53.0 54.3 54.5 22.2 14.0 10.2 5.40 7.10 3.86 2.62 1.85 10.3 7.25 5.25 3.09 38.6 35.8 32.4 26.5 2.16 0.926 1.39 2.16 6.17 12.7 20.2 24.4 2.16 3.40 5.71 6.94 4.32 6.63 12.0 15.1 22.7 32.4 37.5 40.9 1.34 1.34 1.32 1.52 − 1.53 1.34 1.36 1.44 1.01 0.959 0.982 1.15 − 1.20 1.05 1.06 1.10 1.08 1.04 1.11 1.28 − 1.29 1.16 1.12 1.18 0.927 0.934 0.938 0.927 − 0.957 1.01 1.05 1.08 4. Results Table 1 presents the results of normal speech synthesis. The evaluation metrics, including MOS, CER, and EER, indicate that PITS (A+D) outperforms VITS and FS2. In addition, the MOS of PITS (A+D) does not have a statistically sig- nificant difference from that of the ground truth samples. Table 1: The evaluation results of models. Model MOS ± CI (↑) CER (%) (↓) EER (%) (↓) Ground Truth 4.04 ± 0.04 VITS FS2 PITS (A+D+Q) PITS (A+D) PITS (A+Q) PITS (D+Q) 3.89 ± 0.04 3.84 ± 0.04 3.70 ± 0.05 4.01 ± 0.04 3.90 ± 0.04 3.65 ± 0.05 2.63 4.35 3.78 42.3 3.27 18.8 49.6 1.54 1.08 2.62 2.16 0.926 1.39 2.16 Table 2 reports the evaluation results of the pitch-shifted speech. While PITS (A+D) is also the best combination in pitch-shifted synthesis without quality degradation, there are some noticeable points. The results demonstrate that the Q-VAE leads to a degradation in the quality and intelligi- bility of synthesized speech, as evidenced by a significant increase in the CER of the Q-VAE-included models. More- over, combining the Yingram decoding loss with Q-VAE results in further deterioration in the quality and intelligi- bility of synthesized speech. The results for EER indicate that pitch-shift affects the speaker's identity. Although PITS (A+D) exhibits the smallest EER among all shifts, it in- creases as the pitch-shift increases. A comparison between (A+D+Q) and (D+Q) indicates that the adversarial loss for pitch-shift enhances the naturalness of pitch-shifted syn- thesis. However, there is no significant difference in the naturalness of synthesized speech during normal inference. In addition, when the A option is not used, we can observe that PITS (D+Q) focuses on reducing Lshift yin without qual- ity improvements. Without PITS (D+Q), PITS (A+D) also outperforms other models in Lshift yin . Figure 2 depicts the pitch contours of normal and pitch- shifted synthesized speeches, extracted by PYIN (Mauch & Dixon, 2014). The figure illustrates that the pitch contours are almost parallel in the log scale, which confirms that our proposed method has high pitch-controllability. Figure 3 illustrates that PITS could generate speeches with diverse pitches from identical text and speaker identity by modeling pitch information using a variational Yingram encoder. f0 (Hz) 240 180 120 0 8 6 4 2 0 -2 -4 -6 -8 20 40 60 Figure 2: Pitch contours of pitch-shifted speeches. Time Frame f0 (Hz) 240 200 160 0 20 40 60 Figure 3: Pitch contours of synthesized speech with identi- cal text, "How much variation is there?", and identity, p277. Time Frame 5. Conclusion In this paper, we propose PITS, an end-to-end variational pitch inference TTS. With our introduced method, the Yin- gram encoder, the Yingram decoding loss, and adversarial pitch-shifted training could build a pitch-controllable TTS model without directly modeling fundamental frequency, which is not well-defined in some cases. We also intro- duce Q-VAE with single-stage training, however, it reduces speech quality and intelligibility significantly. With our ex- periments, we could find the best architecture and losses, PITS (A+D), which could generate high naturalness and intelligibility as ground truth speeches. In addition, PITS could generate pitch-shifted speech by scope shift of latent variables without quality degradation. PITS: Variational Pitch Inference Without Fundamental Frequency for End-to-End Pitch-Controllable TTS References Ardaillon, L. and Roebel, A. GCI Detection from Raw Speech Using a Fully-Convolutional Network. In IEEE ICASSP, pp. 6739–6743, 2020. Badlani, R., Ła ́ncucki, A., Shih, K. J., Valle, R., Ping, W., and Catanzaro, B. One TTS Alignment to Rule Them All. In IEEE ICASSP, pp. 6092–6096, 2022. Baevski, A., Zhou, Y., Mohamed, A., and Auli, M. wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations. In NeurIPS, pp. 12449–12460, 2020. Bak, T., Bae, J.-S., Bae, H., Kim, Y.-I., and Cho, H.-Y. Fast- PitchFormant: Source-Filter Based Decomposed Mod- In Proc. Interspeech, pp. eling for Speech Synthesis. 116–120, 2021. Bak, T., Lee, J., Bae, H., Yang, J., Bae, J.-S., and Joo, Y.-S. Avocodo: Generative Adversarial Network for Artifact- free Vocoder. arXiv preprint arXiv:2206.13404, 2022. Chen, R. T. Q., Behrmann, J., Duvenaud, D. K., and Ja- cobsen, J.-H. Residual Flows for Invertible Generative Modeling. In NeurIPS, pp. 9916–9926, 2019. Choi, H.-S., Lee, J., Kim, W., Lee, J. H., Heo, H., and Lee, K. Neural Analysis and Synthesis: Reconstructing Speech from Self-Supervised Representations. In NeurIPS, pp. 16251–16265, 2021. de Cheveign ́e, A. and Kawahara, H. YIN, a fundamental frequency estimator for speech and music. The Journal of the Acoustical Society of America, 111 4:1917–30, 2002. Donahue, J., Dieleman, S., Binkowski, M., Elsen, E., and Simonyan, K. End-to-end Adversarial Text-to-Speech. In ICLR, 2021. Du, C., Guo, Y., Chen, X., and Yu, K. VQTTS: High- Fidelity Text-to-Speech Synthesis with Self-Supervised VQ Acoustic Feature. In Proc. Interspeech, pp. 1596– 1600, 2022. Duan, Z., Fang, H., Li, B., Sim, K. C., and Wang, Y. The nus sung and spoken lyrics corpus: A quantitative comparison of singing and speech. In APSIPA, pp. 1–9, 2013. Fant, G. Acoustic Theory of Speech Production. De Gruyter Mouton, 1971. Hsu, W.-N., Tsai, Y.-H. H., Bolte, B., Salakhutdinov, R., and Mohamed, A. Hubert: How much can a bad teacher benefit asr pre-training? In IEEE ICASSP, pp. 6533–6537, 2021. Ju, Y., Kim, I., Yang, H., Kim, J.-H., Kim, B., Maiti, S., and Watanabe, S. TriniTTS: Pitch-controllable End-to-end TTS without External Aligner. In Proc. Interspeech, pp. 16–20, 2022. doi: 10.21437/Interspeech.2022-925. Jung, J.-w., Kim, Y., Heo, H.-S., Lee, B.-J., Kwon, Y., and Chung, J. S. Pushing the limits of raw waveform speaker recognition. In Proc. Interspeech, pp. 2228–2232, 2022. Kim, J., Kong, J., and Son, J. Conditional Variational Au- toencoder with Adversarial Learning for End-to-End Text- to-Speech. In ICML, pp. 5530–5540, 2021. Kim, K.-W., Park, S.-W., Lee, J., and Joe, M.-C. ASSEM- VC: Realistic Voice Conversion by Assembling Modern Speech Synthesis Techniques. In IEEE ICASSP, pp. 6997– 7001, 2022. Kingma, D. P. and Welling, M. Auto-Encoding Variational Bayes. In ICLR, 2014. Kong, J., Kim, J., and Bae, J. HiFi-GAN: Generative Adver- sarial Networks for Efficient and High Fidelity Speech Synthesis. In NeurIPS, pp. 17022–17033, 2020. Kumar, K., Kumar, R., de Boissiere, T., Gestin, L., Teoh, W. Z., Sotelo, J., de Br ́ebisson, A., Bengio, Y., and Courville, A. C. MelGAN: Generative Adversarial Net- works for Conditional Waveform Synthesis. In NeurIPS, pp. 14910–14921, 2019. Larsen, A. B. L., Sønderby, S. K., Larochelle, H., and Winther, O. Autoencoding beyond pixels using a learned similarity metric. In ICML, pp. 1558–1566, 2016. Lee, J., Han, S., Cho, H., and Jung, W. PhaseAug: A Differentiable Augmentation for Speech Synthesis arXiv preprint to Simulate One-to-Many Mapping. arXiv:2211.04610, 2022a. Lee, K. 2022. URL Comprehensive-Transformer-TTS. Comprehensive-Transformer-TTS, 2 https://github.com/keonlee9420/ Lee, Y., Yang, J., and Jung, K. Varianceflow: High-Quality and Controllable Text-to-Speech using Variance Infor- In IEEE ICASSP, pp. mation via Normalizing Flow. 7477–7481, 2022b. Mao, X., Li, Q., Xie, H., Lau, R. Y., Wang, Z., and Paul Smolley, S. Least squares generative adversarial networks. In IEEE ICCV, pp. 2794–2802, 2017. Mauch, M. and Dixon, S. PYIN: A fundamental frequency estimator using probabilistic threshold distributions. In IEEE ICASSP, pp. 659–663, 2014. PITS: Variational Pitch Inference Without Fundamental Frequency for End-to-End Pitch-Controllable TTS Le, Q., Agiomyrgiannakis, Y., Clark, R., and Saurous, R. A. Tacotron: Towards End-to-End Speech Synthesis. In Proc. Interspeech, pp. 4006–4010, 2017. Zhang, Y., Cong, J., Xue, H., Xie, L., Zhu, P., and Bi, M. VISinger: Variational Inference with Adversarial Learning for End-to-End Singing Voice Synthesis. IEEE ICASSP, pp. 7237–7241, 2021. Ła ́ncucki, A. Fastpitch: Parallel text-to-speech with pitch prediction. In IEEE ICASSP, pp. 6588–6592, 2021. Polyak, A., Adi, Y., Copet, J., Kharitonov, E., Lakhotia, K., Hsu, W.-N., Mohamed, A., and Dupoux, E. Speech Resynthesis from Discrete Disentangled Self-Supervised Representations. In Proc. Interspeech, pp. 3615–3619, 2021. Qiang, C., Yang, P., Che, H., Wang, X., and Wang, Z. Style- Label-Free: Cross-Speaker Style Transfer by Quantized VAE and Speaker-wise Normalization in Speech Synthe- sis. In ISCSLP, pp. 61–65, 2022. Ren, Y., Hu, C., Tan, X., Qin, T., Zhao, S., Zhao, Z., and Liu, T.-Y. FastSpeech 2: Fast and High-Quality End-to-End Text to Speech. In ICLR, 2021. Shen, J., Pang, R., Weiss, R. J., Schuster, M., Jaitly, N., Yang, Z., Chen, Z., Zhang, Y., Wang, Y., Skerrv-Ryan, R., Saurous, R. A., Agiomvrgiannakis, Y., and Wu, Y. Natural TTS Synthesis by Conditioning Wavenet on MEL Spectrogram Predictions. In IEEE ICASSP, pp. 4779– 4783, 2018. Shirahata, Y., Yamamoto, R., Song, E., Terashima, R., Kim, J.-M., and Tachibana, K. Period VITS: Variational Infer- ence with Explicit Pitch Modeling for End-to-end Emo- tional Speech Synthesis. ArXiv, abs/2210.15964, 2022. Siuzdak, H., Dura, P., van Rijn, P., and Jacoby, N. WavThru- Vec: Latent speech representation as intermediate fea- tures for neural speech synthesis. In Proc. Interspeech, pp. 833–837, 2022. Sun, G., Zhang, Y., Weiss, R. J., Cao, Y., Zen, H., Rosenberg, A., Ramabhadran, B., and Wu, Y. Generating Diverse and Natural Text-to-Speech Samples Using a Quantized Fine-Grained VAE and Autoregressive Prosody Prior. In IEEE ICASSP, pp. 6699–6703, 2020. Team, S. Silero models: pre-trained enterprise-grade stt / tts models and benchmarks (v0.4.1). https://github.com/ snakers4/silero-models, 2021. van den Oord, A., Vinyals, O., and Kavukcuoglu, K. Neural Discrete Representation Learning. In NeurIPS, 2017. Veaux, C., Yamagishi, J., MacDonald, K., et al. Superseded- cstr vctk corpus: English multi-speaker corpus for cstr voice cloning toolkit(Version 0.92), 2016. URL https: //datashare.ed.ac.uk/handle/10283/3443. Wang, D., Deng, L., Yeung, Y. T., Chen, X., Liu, X., and Meng, H. VQMIVC: Vector Quantization and Mutual Information-Based Unsupervised Speech Representation Disentanglement for One-Shot Voice Conversion. In Proc. Interspeech, pp. 1344–1348, 2021. Wang, Y., Skerry-Ryan, R., Stanton, D., Wu, Y., Weiss, R. J., Jaitly, N., Yang, Z., Xiao, Y., Chen, Z., Bengio, S., PITS: Variational Pitch Inference Without Fundamental Frequency for End-to-End Pitch-Controllable TTS A. Voice Conversion We undertake voice conversion (VC) using the pretrained PITS model, since our model disentangles linguistic and pitch information following the principles in VC studies. We perform an any-to-many voice conversion, which aims to convert the speech of an unseen source speaker to the speech of a specific seen speaker while preserving the lin- guistic and pitch information of the source speech. To better preserve the linguistic information of speech, we utilized both voice and text as inputs. However, different from the seen speakers, we do not have the speaker embedding of the unseen source speakers, which is required by modules such as the posterior encoders and the flow. Therefore, we optimize the speaker embedding of the source speaker es by minimizing the KL divergence from VITS (Kim et al., 2021) as: es = argmin es log qφ(z|S, Y, es) − log pθ(z|ctext, A) (4) where S and Y represent linear spectrogram and Yingram of source speech, respectively, ctext is a phonemes of input speech, A is a optimal alignment by MAS. Furthermore, this process enables the acquisition of the optimal alignment A between text and speech, which is utilized to expand the prior distribution μ and σ from the text encoder to μA and σA. We then obtain zp from N (zp; μA, σA), which is subsequently fed into the inverse flow module f −1. Empiri- cally, one minute of training for source speaker embedding is sufficient to obtain a high-quality alignment. To preserve the linguistic information of the text, we obtain zspec by splitting z = f −1(zp, et) where et is the target speaker embedding. Furthermore, to maintain the pitch in- formation, we directly utilize zyin obtained from the source speech through the Yingram encoder with speaker condi- tion et. Finally, pitch-guided speaker-converted speech is synthesized via the decoder from the concatenated latent z, which is composed of zspec and cropped Yingram la- tent zshift crop = shift crop(zyin, s) with scope shift s where shift crop(z, s) = z[:, 15 + s : 65 + s]. Direct utilization of zshift crop from the unseen source speaker preserved pitch information, but degraded the audio quality of the converted speech. We first tried to optimize zshift crop by applying an exponential regularization and L1 loss between the decoded Yingram and the cropped Yingram Y shift crop of the source speech y with scope shift s. yin = (cid:13) LVC (cid:1)(cid:13) (cid:13)1 While the quality of the generated audio is improved through the above modification, it still failed to achieve the quality of speech generated by PITS for TTS purpose. (cid:13)exp (cid:0)zshift (cid:13)1 + λ (cid:13) (cid:1)(cid:13) crop − Decyin (cid:13)Y shift (cid:0)zshift crop crop Yingram latent of the preceding audio output yi−1, instead of zshift crop when creating the concatenated latent zi. How- ever, substituting zspec in the ith iteration with the output Encspec(S(yi), et) of the STFT encoder led to the vanish- ing of linguistic information. Therefore, we used the same zspec from the 0th iteration for every iteration to preserve linguistic information. Three iterations are sufficient for generating high-quality, pitch-conserving speech. With pretrained PITS, it has been observed that when the pitch of the source speech falls outside the pitch range of the target speaker, the generated speech occasionally exhibits pitch deviations from the source speech by multiple octaves. To address this issue, we conducted finetuning using the NUS-48E singing voice dataset (Duan et al., 2013) with the original PITS objective. This resulted in an improvement in the expressiveness and expanded pitch range capabilities of the model, resulting in a reduction in the occurrence of octave-scale pitch differences between the source and generated speech. In addition, shifting zyin to match each speaker's pitch range effectively mitigates octave-scale pitch differences and prevents quality degradation. Algorithm 1 Voice Conversion by PITS Input: source speech y, phoneme ctext, target speaker embedding et, scope shift s, number of iteration N Module: Yingram operator Y, spectrogram operator S, prior encoder Encp, Yingram encoder Encyin, STFT en- coder Encspec, flow f , decoder G Output: Converted voice yN Calculate Y ← Y(y), S ← S(y) Calculate prior distribution (μ, σ) ← Encp(ctext) Initialize source speaker embedding es ∼ N (0, I). repeat Calculate optimal alignment A by MAS Update es through SGD with KL-divergence objective log qφ(z|S, Y, es) − log pθ(z|ctext, A) until es is converged Expand μ and σ with alignment A resulting in μA and σA, respectively. Sample zp ∼ N (zp; μA, σA) z ← f −1(zp, et) zspec ← split(z)[0] zshift crop ← shift crop(Encyin(Y, et), s) z0 ← [zspec, zshift crop ] y0 ← G(z0, et) for i = 1 to N do zcropi ← shift crop(Encyin(Y(yi−1), et), 0) zi ← [zspec, zcropi] yi ← G(zi, et) The iterative synthesis illustrated in Algorithm 1 generates more natural results. In each ith iteration, the ith gener- ated audio yi is produced by feeding the zcropi, cropped end for return yN
http://arxiv.org/abs/2302.12388v3
2023-03-03T00:20:30
2023-02-24T01:29:21
TrafFormer: A Transformer Model for Predicting Long-term Traffic
Traffic prediction is a flourishing research field due to its importance in human mobility in the urban space. Despite this, existing studies only focus on short-term prediction of up to few hours in advance, with most being up to one hour only. Long-term traffic prediction can enable more comprehensive, informed, and proactive measures against traffic congestion and is therefore an important task to explore. In this paper, we explore the task of long-term traffic prediction; where we predict traffic up to 24 hours in advance. We note the weaknesses of existing models--which are based on recurrent structures--for long-term traffic prediction and propose a modified Transformer model "TrafFormer". Experiments comparing our model with existing hybrid neural network models show the superiority of our model.
[ "David Alexander Tedjopurnomo", "Farhana M. Choudhury", "A. K. Qin" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12388v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12388v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "ACM-class: I.2.1" ]
3 2 0 2 r a M 3 ] G L . s c [ 3 v 8 8 3 2 1 . 2 0 3 2 : v i X r a TRAFFORMER: A TRANSFORMER MODEL FOR PREDICTING LONG-TERM TRAFFIC David Alexander Tedjopurnomo RMIT University Melbourne, Australia [email protected] Farhana M. Choudhury The University of Melbourne Parkville, Australia [email protected] A. K. Qin Swinburne University of Technology Hawthorn, Australia [email protected] ABSTRACT Traffic prediction is a flourishing research field due to its importance in human mobility in the urban space. Despite this, existing studies only focus on short-term prediction of up to few hours in advance, with most being up to one hour only. Long-term traffic prediction can enable more comprehensive, informed, and proactive measures against traffic congestion and is therefore an important task to explore. In this paper, we explore the task of long-term traffic prediction; where we predict traffic up to 24 hours in advance. We note the weaknesses of existing models–which are based on recurrent structures–for long-term traffic prediction and propose a modified Transformer model "TrafFormer". Experiments comparing our model with existing hybrid neural network models show the superiority of our model. Keywords Traffic Prediction * Deep Learning * Transformers 1 Introduction Traffic congestion is a major problem faced by metropolitan cities. In 2015, it is estimated that the avoidable cost of traffic congestion for Australian capital cities is approximately $16.5 billion, up from the 2010 estimate of $12.8 billion. Furthermore, this value is estimated to increase to about $30 billion by 2030 [1]. Most congestion mitigation measures are costly, difficult to implement, or both. For instance, Singapore implemented regulations on the number of vehicles on roads [2], which is infeasible for countries with poor public transportation systems. Constructing new roads to ease congestion is also difficult due to the extremely high cost. As an example, the estimated per mile cost of a standard one-lane road in New Jersey, USA is $220,490 [3]. With the advancements and widespread adoption of traffic sensors, access to large traffic databases is now available. This has led to the development of traffic prediction as a research field starting from the late 70s. Educated traffic decision made through accurate prediction is a far cheaper and easier-to-implement alternative for reducing road congestion. Future traffic prediction involves creating a prediction model from historical traffic data to predict the short-term future traffic ranging from 5 to 60 minutes into the future. These traffic data are commonly collected by traffic induction loop detectors, which detect the presence of passing vehicles. The most common values to be recorded by these detectors are traffic speed and traffic flow, which are defined as the average car speed and the total number of vehicles passing through the loop detector within a period of time, respectively. Traffic prediction is different from conventional time-series analysis in that traffic prediction is subject to spatial factors as well as many other external factors. For instance, the prediction of traffic at one site depends on the traffic at other sites and all of the sites are affected by external factors such as weather and holidays. Amongst all the available traffic prediction methods, deep neural network is the most prominent. This is due to its sheer predictive power that can model TrafFormer: A Transformer Model for Prediction Long-term Traffic the complex and nonlinear traffic patterns [4][5][6][7][8]. The three most common deep neural network models used for traffic prediction are Convolutional Neural Networks, Recurrent Neural Networks, and Feedforward Neural Networks. Traffic prediction is a well-studied research field, but current research only focuses on short-term prediction, usually for up to 60 minutes in advance. Longer-term prediction for up to 24 hours ahead has not been considered despite its usefulness, as longer-term prediction allows public transport planners to take better proactive measures against traffic congestion. In addition, the existing body of literature uses a hybrid approach that relies on recurrent structures to model the traffic data. This can work on short-term prediction, but on long prediction horizons, the instability of the error propagation may degrade these models' performance thanks to their recurrent structure. In this paper, we address both of these deficiencies. We first provide a literature review of existing traffic prediction papers in Section 2. From this literature review, we identify that state-of-the-art traffic prediction models rely on hybrid neural networks with recurrent structures. In addition, we also note the lack of existing literature that tackles long-term traffic prediction and propose our day-ahead traffic prediction problem in Section 3. Short-term traffic prediction only needs short-term traffic pattern, but for long-term traffic, we require short, medium and long-term traffic patterns. We also describe in detail these challenges of long-term prediction compared to short-term in Section 3. Afterward, we describe our Transformer model called TrafFormer in Section 4. Our TrafFormer model addresses the weaknesses of the commonly used recurrent models. In addition to the model itself, we add a time-day embedding, which captures the medium and long-term traffic pattern; and a spatio-temporal multi-head attention that captures the impact of differing time steps and traffic sensor locations. In Section 5, we perform experiments comparing our model with several common deep neural network models as well as existing state-of-the-art traffic prediction models and show that our model provides the best overall performance. We also perform a set of ablation tests to explore the TrafFormer settings and our dataset-related design choices, which will help future traffic prediction research. Finally, we conclude our paper in Section 6. To summarize, our contributions are: • We introduce the problem of long-term traffic prediction and discuss the differences and challenges when compared to the more conventional short-term traffic prediction. • We formulate a novel Transformer model with time and day embedding, which we call TrafFormer. TrafFormer sidesteps the issue of using recurrent models, and our time and day embedding captures medium and long-term traffic patterns. • We conduct a set of experiments comparing our model with state-of-the-art traffic prediction papers. These experiments show that our model overall performs the best. • We perform a set of ablation tests to show the importance of the different components of our model. 2 Related Work Traffic prediction is a well-studied field. Its research dates back to the late 70s, where classical statistical models were widely used. Out of these, the Autoregressive Integrated Moving Average (ARIMA) family of models is the most popular. Ahmed and Cook were the first researchers to apply ARIMA to traffic prediction [9]. Other authors also applied different versions and improvements to ARIMA [10][11][12][13]. Despite its popularity, classical statistical models are relatively weak. This is because they are simple linear models which assume that the traffic is stationary. Consequently, they frequently fail when handling the complex, nonlinear traffic data [6][14][15][8]. Due to the aforementioned deficiencies of classical statistical models, researchers flocked to machine learning models. Out of the different machine learning models, neural network is the most commonly used. One of the first neural network applications in traffic flow prediction was by Dougherty et al. [16]. Since then, various improvements to the neural network structure have been proposed [17][18][19][20]. While machine learning models, and especially neural network, are more powerful compared to statistical models, they are very hard to train efficiently. Thus, machine learning models during the 2000s utilize shallow and simple structures, limiting their prediction power. However, the increasing computational power, as well as theoretical and software improvements in recent times had made increasingly complex neural network models feasible to train. Thus, in the middle of the 2010s, researchers started to apply deep neural network models for traffic prediction. Deep neural networks consist of complex neural network models with a large number of layers. Huang et al. [5] and Yisheng et al. [21] were among the first to apply deep neural networks to the task of traffic prediction; where they used a Deep Belief Network and Stacked Autoencoder respectively. As time progresses, traffic prediction models are becoming increasingly complex and often utilize many types of networks in a hybrid manner. Recurrent Neural Network (RNN), Convolutional Neural Network (CNN) and Feedforward Neural Network (FNN) are commonly used 2 TrafFormer: A Transformer Model for Prediction Long-term Traffic as components in these models. Amongst these three, RNN models–such as the Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU)–are the most commonly used. This is because traffic data consists of a temporal sequence of traffic readings, which fits RNN's purpose as it has a recurrent structure that is naturally suited for this sequential data. RNNs have been used for traffic prediction in past works such as the ones by Ma et al. [22], Tian and Pan [23], Fouladgar et al. [24] and Kang et al. [25]. RNNs are designed to take as input a sequence of values to output a single predicted value. For instance, in traffic prediction, the input can be the traffic speed from the past hour, and the output is the predicted traffic speed 15 minutes into the future. This renders RNNs ineffective for multiple future traffic predictions (i.e., 15, 30, 45, and 60 minutes). In this scenario, researchers use a modification of RNNs called the sequence autoencoder. Sequence autoencoder, which is also known by other names such as Seq2seq and encoder-decoder sequence-to-sequence, was pioneered by Cho et al. [26] and Sutskever et al. [27]. The idea is a combination of autoencoder and RNNs; the model takes as input a sequence and outputs another sequence as the output. This enables multiple future traffic predictions. For instance, the model can take the traffic speed from the past hour and outputs a sequence of future traffic readings up to one hour into the future. Thanks to this capability, sequence autoencoders have become one of the most common models used in traffic prediction; especially when used as a main component of a hybrid deep neural network, as in the works of He et al. [28], Do et al. [29], Pan et al. [30] and Li et al. [31]. For a more in-depth discussion about these deep neural network models, we refer viewers to the survey paper [32]. 3 Problem Definition Traffic prediction concerns the usage of a learnable function that takes as input the historical traffic data from several previous time-steps in order to predict the traffic in the future. Two main types of traffic data used are traffic flow and traffic speed. Traffic flow is denoted as the total number of vehicles detected in a target detection site during a certain time period. Traffic speed is denoted as the average traveling speed of vehicles detected in a target detection site during a certain time period. We will use the general term "traffic" to refer to both traffic flow and traffic speed. The traffic prediction problem can be denoted as: ˆyt+T (cid:48) = f ([Xt−T +1, Xt−T , ..., Xt]) (1) To predict the future traffic y at time t + T (cid:48), we feed past traffic readings X of up to T time steps in the past into an arbitrary function f . The objective is to find the model parameters which minimize the error between the predicted traffic and the observed traffic: θ∗ = arg min θ∗ L(yt+T (cid:48), ˆyt+T (cid:48); θ∗) (2) Where: • yt : The observed traffic at time t • ˆyt : The predicted traffic at time t • T : Input sequence length, i.e., how many time steps of past data are used as the input. • T (cid:48) : Prediction horizon, i.e., how many time steps in the future the prediction is for. • f : An arbitrary function that calculates the traffic prediction based on the input data. • L : Loss function, which is the function that calculates the quality of the prediction. • θ∗ : The optimal set of parameters for the function f All of f , L, and θ∗ depend on the actual model used. The function f constitutes the prediction model–e.g., the deep neural network models we mentioned in the previous section–and θ depends on the model used. The loss function L is used to measure the prediction error, which in turn will be used to train the prediction model through backpropagation. Backpropagation computes the gradient of the loss with respect to the weights of the network. This gradient is propagated backward to adjust the parameters θ in each layer of the model. While traffic prediction is a well-studied topic, most of the traffic prediction research limit themselves to predicting traffic up to 60 minutes into the future. Long-term traffic prediction, in which traffic of up to 24 hours in the future is predicted, is rarely explored despite its usefulness in allowing proactive measures against traffic congestion. In terms of the problem formulation, short and long-term traffic prediction are almost identical. The only difference lies in the prediction horizon T (cid:48). Despite the similarity of the two problems, long-term traffic prediction is more challenging 3 TrafFormer: A Transformer Model for Prediction Long-term Traffic due to the instability of long-term traffic pattern that worsens error propagation. Such problems are not present in short-term traffic prediction, as traffic fluctuations in the short-term (e.g., two hours, covering one-hour past data to predict next-hour traffic) are less extreme. In addition, unlike short-term traffic prediction that only needs to learn traffic patterns from recent timestamps, long-term (i.e., one-day-ahead prediction) requires learning three traffic patterns: • Short-term pattern. Short-term traffic pattern relates to traffic in the past hour. Despite the day-to-day differences in traffic, hourly patterns still exist. For instance, peak hours in the morning and evening occur at around the same time every weekday. Therefore, data from the past hour may provide important information to predict traffic for the next day. • Medium-term pattern. Medium-term pattern relates to traffic in the past day. This is crucial for the model as it provides information of how traffic fluctuates on a daily basis, which will help next-day prediction. • Long-term pattern. Long-term pattern relates to the different traffic patterns on different days. Small fluctuations in traffic patterns may exist on different days and especially on the weekends vs weekdays scenario. Thus, this pattern is also important. Due to these difficulties and additional factors to capture, long-term prediction is a challenging task. In the next section, we will describe in detail our proposed method to tackle these challenges. 4 Methodology While RNNs and its Sequence Autoencoder variants are commonly used in short-term traffic prediction due to their effectiveness, these models are not as proficient at handling long-term input data. This is because the instability of long-term traffic causes prediction errors, which are then propagated further into the network thanks to the recurrent structure. Moreover, in sequence autoencoders, the input traffic data is summarized into a vector representation which is fed to the decoder to output the predicted traffic. This means that the decoder does not have direct access to the input sequence anymore and can only rely on the lossy vector representation of the input. In order to sidestep these issues of long-term traffic prediction, we use a Transformer model. The Transformer model was proposed by Vaswani et al. [33] as an alternative to sequence autoencoders. Sequence autoencoders use RNNs as the encoder and decoder and thus process the data step-by-step through the recurrence process. On the other hand, Transformer uses an attention mechanism instead. This attention mechanism attends to every time step at once. We illustrate a Transformer in Figure 1a. For ease of explanation, we will describe this model in the context of machine translation from English to French; as Transformers were originally used in NLP applications. The Transformer model can be divided into the encoder (left side) which takes X as the input English sentence and the decoder (right side) which takes Y as the French translation of the input English sentence. Multiple layers of encoders and decoders can be stacked to form a more complex and potentially more powerful model. Because the input sequence X and output sequence Y are in the form of sentences, each word first needs to be transformed into an embedding vector through the embedding layers. Both the encoder and decoder use the multi-head attention module. This multi-head attention gives Transformers the ability to attend to every time step at once. The encoder's Transformer enables every English word in the sentence to attend to any word in that sentence. For the French sentence, masked multi-head attention is required instead such that when the n-th English word is being predicted, the Transformer does not have knowledge of words after the n-th word. In addition, Transformers also use several addition and normalization layers, FNN layers, and residual connections denoted with the dashed arrows. Transformers work in a similar fashion for traffic prediction. The only major difference is that the embedding layer is not used. The reason we use Transformers is twofold: • Transformers do not use recurrent structures. They instead opt for attention layers, therefore sidestepping the long-term instability of models that use these recurrent structures. • Unlike sequence autoencoders, where the decoder can only access the vector representation of the input sequence, Transformers' multi-head attention allows its decoder to have direct access to the input sequence and selectively pay more or less attention to relevant parts of the sequence. In this section, we will describe our methodology in detail. We use a modified Transformer model for our long-term traffic prediction work, which we call TrafFormer. To the best of our knowledge, TrafFormer is the first application of the Transformer model for traffic prediction. In addition to this, we also propose two novel additions: our time and day embedding, and the addition of medium and long-term past traffic reading. In addition, we also modify the multi-head 4 TrafFormer: A Transformer Model for Prediction Long-term Traffic Figure 1: A standard Transformer and our TrafFormer model (a) A transformer model (b) Our modified TrafFormer model attention to take into account the correlation between different time steps and traffic sensor locations; forming the spatio-temporal multi-head attention module. Our overall model structure is provided in Figure 1b. We describe the different components of our model below. Short and medium term data. Most existing traffic prediction models take only short-term traffic data as input. This is suitable for short-term prediction, as the traffic condition in the near future is likely to be affected by traffic in the near past. This approach however is not sufficient for long-term traffic prediction, as short-term past traffic patterns may not reflect medium-term (e.g., 1 day) future data. To address this issue, we use two inputs to our model: the short-term traffic data from the past hour, denoted by X and medium-term data from the past day, denoted by X (cid:48). Time and day embedding. The aforementioned short and medium term traffic data records how traffic changes over time in two different periods, but they do not have information of the time periods themselves. In order to incorporate this information, we use two types of embedding: time and day embedding. Specifically, for both the short and medium-term data, we record the time stamp and day, which we represent using the t and d superscript respectively in Figure 1b; the s subscript represents the past traffic reading. Afterwards, we transform them to different periods. For the time-in-day value, we use a 5 minute period window from 00:00-00:04 to 23:55-23:59, totaling 288 periods. For the day-in-week value, we use 7 for the different days. For each time period and day, we assign an embedding vector that captures the context of those periods. This is detailed in Figure 2 where two pairs of time and day recordings are used to perform lookups to retrieve their respective embedding vector of size 3. The embedding vectors are integrated into the TrafFormer model. Since the model is trained end-to-end, these vectors will also be trained, which will improve the effectiveness of the embeddings in representing the time-in-day and day-in-week information. Therefore, the embedding vectors help capture the medium-term and long-term patterns. TrafFormer Model. After transforming the timestamp and day information for both the short and medium-term traffic data, we concatenate them together with the traffic readings and present them as an input to the Transformer part of our model. We use the encoder part of a Transformer and modified the multi-head attention such that it can attend to all time steps and all traffic sensors simultaneously, providing it the capability to capture both spatial and temporal patterns. In addition, we add a residual connection between the input and output of the Transformer encoder, denoted with the dashed line. In summary, we capture both the past-hour and past-day data for the short and medium-term patterns respectively. Then, we add the time and day embedding information to capture the medium and long-term patterns. Afterwards, we provide them to our Transformer model in order to capture both spatial and temporal patterns, utilizing the Transformer's power to simultaneously attend to all timestamps at once. 5 XMulti-Head AttentionFNNEmbeddingAdd & NormAdd & NormYEmbeddingMasked Multi-Head AttentionAdd & NormMulti-Head AttentionAdd & NormFNNAdd & NormOutputTime-dayembeddingSpatio-temporal Multi-Head AttentionFNNAdd & NormAdd & NormFNNAdd & NormOutputXX'XsXtXdX' sX' tX' dConcat TrafFormer: A Transformer Model for Prediction Long-term Traffic Figure 2: The time-day embedding process 5 Experiments In this section, we will describe our experiment setup: our datasets, the hyperparameter settings of our models, and the baselines we compare our model with. We will then show our experiment results as well as several ablation tests that explore the importance of the different components of our TrafFormer model. 5.1 Datasets We use the following two dataset in our experiments, with both of them recording traffic speed: • METR-LA[34]. This dataset is collected from 207 traffic loop detectors on the highways of Los Angeles County from March 2012 to June 2012. The granularity of the recording is 5 minutes, resulting in 34,272 total speed readings for each traffic detector. We use this dataset due to its common usage in traffic prediction studies [35][30][36][37][38][39][31]. The covered area is visualized in Figure 3a. • PEMS-BAY[35]. This is a subset of the commonly-used Caltrans PEMS dataset. It covers 325 traffic loop detectors on the San Francisco Bay area from January 2017 to May 2017. The granularity of the recording is 5 minutes, resulting in 52,116 total speed readings for each traffic detector. This is also a commonly used dataset [35][36][38][39][31]. The covered area is visualized in Figure 3b. We use these datasets mainly for reproducibility purposes, as these two datasets are some of the most commonly used ones in the literature. In addition, they cover a large area, have decent temporal coverage, and have different traffic patterns, as can be seen by the different experimental results we will present later in this section. 5.2 Model Settings For our TrafFormer model, as well as the baselines, we divide the dataset into training, validation, and test sets using a 70:10:20 ratio without shuffling; meaning that the first (in terms of the time period) 70% of the data is assigned to the training set, the next 10% into the validation set, and the final 20% into the test set. This follows the setup used in [35] where these two datasets were also used. For the past hour data X, we use a granularity of 5 minutes, resulting in 12 time steps of past hour data. We use this setting as it is the default setting of the Caltrans dataset, the most commonly used granularity in the literature, and a fine enough granularity to capture short-term traffic patterns. For the past day data X (cid:48) and the ground truth value for the next day data Y , however, we cannot use this granularity as this will result in 288 time steps, which are prohibitively expensive. Therefore, instead of using the 5-minute granularity, we use a 2-hour granularity, which also results in 12 time steps of past and next-day data for X (cid:48) and Y respectively. We use a sliding window approach to retrieve the dataset. Specifically, at a time-step t, we retrieve the traffic speed data S using three sliding windows for X, X (cid:48) and y for the periods specified below: • X = [St−11, St−10, ..., St−1, St] • X (cid:48) = [St−264, St−240, ..., St−24, St] • y = [St+24, St+48, ..., St+264, St+288] 6 0.60.40.10.80.70.8Time: 06:25 Day: TueTime: 19:15 Day: Sat TrafFormer: A Transformer Model for Prediction Long-term Traffic Figure 3: Roads covered by the two datasets. (a) METR-LA dataset (b) PEMS-BAY dataset We slide these three windows starting from S264 to S|S|−288 one timestep each time (i.e., 5 minute increments), where |S| denotes the total timesteps for the entire dataset. The increment of 24 used in X (cid:48) and y denote the two hour period for the past and next day data. For the model structure, we set the time-day embedding matrix to be 288 × 7 in size, representing the time-in-day on 5 minute increments and day-in-week respectively. The size of the day and time embedding vectors is set to 64. All FNNs in the TrafFormer model have 64 computational nodes. We apply layer normalization for the traffic speed, which transforms the traffic speed reading such that the mean is 0 and the standard deviation is 1. We train our model using cyclical learning rate [40] with the 'triangular2' setting with step size equal to 2× the number of minibatches in the dataset. The model is trained for a maximum of 50 epochs with early stopping if the validation loss does not decrease for 2 consecutive epochs. In practice, we find that the model training ends at around the 6-12 epochs mark. We train the model using the Mean Absolute Error (MAE) loss. The code for our model is publicly available1. 5.3 Baselines We compare our methods against three general deep neural network structures and three state-of-the-art benchmarks; the latter three benchmarks were implemented only for short-term prediction. We describe these models below: • FNN. We replace the transformer encoder part of TrafFormer with a 3-layer FNN with 256, 64, and 16 nodes respectively. Similar to TrafFormer, this model receives both the past-day and past-hour data as the input. • Stacked GRU[26]. We use a stack of 2 GRUs with 128 hidden units each. Similar to TrafFormer, this model receives both the past-day and past-hour data as the input. • LSTM Sequence Autoencoder[27]. We adapt the sequence autoencoder structure with 2 LSTMs for the encoder and decoder, each with 64 hidden nodes. Similar to TrafFormer, this model receives both the past-day and past-hour data as the input. • Diffusion Convolution Recurrent Neural Network (DCRNN)[35]. The authors proposed a GRU sequence autoencoder with a graph diffusion convolution in order to capture the temporal dependencies of traffic data as well as spatial dependencies between different traffic detectors. We follow the default architecture and only feed the past hour's data for the next-day prediction. • Spatio-Temporal Graph Convolutional Networks (STGCN)[41]. The authors proposed a novel spatio- temporal convolution block consisting of a Graph CNN to capture the structure of the road network and a gated CNN to extract temporal features. Both of these components are then fused to give the model the capability to 1https://github.com/david-tedjopurnomo/TrafFormer 7 TrafFormer: A Transformer Model for Prediction Long-term Traffic Table 1: Experiment results for the METR-LA dataset. Method 6 hours 12 hours 18 hours 24 hours RMSE MAE MAPE RMSE MAE MAPE RMSE MAE MAPE RMSE MAE MAPE 11.46 FNN 10.70 Stacked GRU Seq2Seq LSTM 9.68 8.99 14.86 13.33 8.47 DCRNN STGCN GAMCN TrafFormer 6.05 5.68 5.02 4.29 8.76 6.30 4.11 22.14% 19.72% 16.83% 13.20% 21.07% 16.23% 13.25% 11.52 10.78 9.74 9.33 15.88 12.52 8.53 6.08 5.72 5.06 4.48 9.31 5.85 4.14 22.46% 20.03% 17.09% 13.61% 22.24% 15.90% 13.39% 11.54 10.77 9.77 9.66 15.31 11.51 8.56 6.10 5.73 5.07 4.64 9.12 5.35 4.16 22.56% 20.05% 17.17% 13.98% 21.99% 15.07% 13.50% 11.46 10.69 9.72 9.63 13.60 9.61 8.59 6.09 5.71 5.06 4.66 7.83 4.60 4.18 22.36% 19.78% 17.05% 14.29% 21.29% 13.84% 13.57% capture both the spatial and temporal features simultaneously. We follow the default architecture and only feed the past hour's data for the next-day prediction. • Graph and Attentive Multi-path Convolutional Network (GAMCN)[42]. The authors proposed a novel LPGCN module that captures the spatial correlation between traffic conditions in close and far-away locations alike, and a temporal correlation modeling with multi-path temporal convolution. These two components are fused with a gated fusion layer. We follow the default architecture and only feed the past hour's data for the next-day prediction. We evaluate all models using the Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE) values formulated below: RM SE(y, ˆy) = (cid:114) (cid:80)n i=1(yi − ˆyi)2 n M AE(y, ˆy) = M AP E(y, ˆy) = (cid:80)n i=1 |yi − ˆyi| n 1 n n (cid:88) i=1 (cid:12) (cid:12) (cid:12) (cid:12) yi − ˆyi yi (cid:12) (cid:12) (cid:12) (cid:12) (3) (4) (5) Where y is the actual traffic speed ˆy is the predicted traffic speed and n is the number of samples. For all metrics, a lower value denotes better performance. We show the experiment results not only for day-ahead prediction, but also for 6, 12 and 18 hours future prediction in order to show the performance of all models on different prediction horizons. All methods are run on a Red Hat Enterprise Linux server with an Intel Xeon E5-2690 CPU, 52 GB of RAM, and two Nvidia Tesla P100 GPUs with 16 GB of memory. 5.4 Experiment Results The experiment results for the METR-LA and PEMS-BAY dataset are provided in Tables 1 and 2 respectively. For all models, the performance on the PEMS-BAY dataset is better compared to the METR-LA dataset. This is due to two factors: 1. METR-LA contains a lot of missing data; out of the 1,396,008 data points, 175,677 are missing, which is approximately 12.6%. In contrast, PEMS-BAY contains 3,351,726 data points, but only 217 of them are missing. 2. As can be seen in Figure 3a, the METR-LA dataset spans both urban and rural areas; it covers major tourism areas such as Hollywood, and less-populated areas in the West–which is located just north of California's State Parks–and northeast–which nears the mountainous areas of Southern California. On the other hand, the PEMS-BAY dataset, shown in Figure 3b covers mostly the metropolitan areas of Silicon Valley and San Francisco Bay. Thus, the PEMS-BAY dataset is more homogeneous with relatively smaller traffic speed fluctuations within that area, contributing to its lower prediction error. From the METR-LA results, we can see that TrafFormer manages to outperform all models on all metrics and all time steps except for the 6-hours MAPE result where TrafFormer takes a very close second place to DCRNN. Moreover, 8 TrafFormer: A Transformer Model for Prediction Long-term Traffic Table 2: Experiment results for the PEMS-BAY dataset. Method 6 hours 12 hours 18 hours 24 hours RMSE MAE MAPE RMSE MAE MAPE RMSE MAE MAPE RMSE MAE MAPE 8.27 FNN 6.20 Stacked GRU Seq2Seq LSTM 6.22 5.54 5.76 5.16 5.47 DCRNN STGCN GAMCN TrafFormer 3.83 2.82 2.83 2.45 2.65 2.30 2.59 11.21% 7.17% 7.13% 6.07% 6.30% 5.56% 6.15% 8.25 6.20 6.22 5.83 6.18 5.18 5.43 3.83 2.84 2.83 2.54 2.83 2.31 2.58 11.17% 7.19% 7.11% 6.43% 6.86% 5.59% 6.09% 8.25 6.20 6.22 5.83 6.18 5.18 5.43 3.83 2.84 2.83 2.54 2.83 2.31 2.58 11.17% 7.19% 7.11% 6.43% 6.86% 5.59% 6.09% 8.23 6.20 6.24 5.84 6.81 5.22 5.46 3.84 2.86 2.85 2.58 3.07 2.34 2.59 11.12% 7.20% 7.12% 6.32% 7.80% 5.63% 6.14% Figure 4: Prediction comparison between TrafFormer and DCRNN for the METR-LA dataset. we observe that TrafFormer is the most resilient to increasing future prediction horizon, as can be seen by the smaller performance degradation between the 6 hours and 24 hours results. DCRNN is the second-best performer, followed by Seq2seq LSTM. These three models are the only ones capable of achieving sub-10 RMSE results on all prediction horizon. We also notice that our model, as well as the three general deep neural network models–FNN, Stacked GRU and Seq2seq LSTM–have better resilience across all prediction horizon compared to the three state-of-the-art baselines. From the PEMS-BAY results, we observe that GAMCN performs the best. TrafFormer competes with DCRNN, beating DCRNN on all prediction horizons in terms of RMSE, losing in terms of MAE, and generally outperforming DCRNN in terms of MAPE. The three general deep neural network models perform significantly worse, with none of them managing to achieve a sub-5 RMSE value. Contrary to the METR-LA experiments, the results from the different prediction horizon are relatively consistent for all models except STGCN. This consistency is due to PEMS-BAY's smaller fluctuations. While GAMCN outperforms TrafFormer in PEMS-BAY, it does not perform well on the METR-LA dataset–especially for the 6, 12 and 18 hours experiment. Thus, from these results, TrafFormer is the overall best performer. In Figure 4, we show the METR-LA speed prediction of TrafFormer compared to DCRNN. This data is taken on 1 March 2012 from detector ID "772140" which is located at Ventura Highway. We only choose DCRNN because it is the most competitive state-of-the-art baseline in the METR-LA experiments. From this figure, we observe that TrafFormer is better at identifying the start of a rush hour where traffic speed slows down. This can be seen from how DCRNN identifies the start of the speed drops at 06:00 and 14:30 too early. In addition, compared to DCRNN, TrafFormer has a tendency to underfit the data compared to DCRNN during periods of unstable traffic speed. This can be seen in the 15:00-19:00 stretch. At around 15:15, there is a significant, short-term speed drop. DCRNN is affected by this drop, which causes its prediction to be negatively affected until 17:00 whereas TrafFormer is not as affected. The same underfitting scenario is seen again during 17:00-19:00, but this time it affects TrafFormer negatively as it did not adapt to the traffic speed drop as good as DCRNN. In Figures 5 and 6, we compare the traffic speed prediction between TrafFormer and DCRNN on two sites in the PEMS-BAY dataset. These comparisons are taken on 1 January 2017 from detectors "400001" and "400017", which are located east of Norman Y. Mineta San Jose International Airport, and at Highway 85 north of the Good Samaritan Hospital, respectively. From these two results, we can see that just like in the METR-LA comparison, TrafFormer 9 TrafFormer: A Transformer Model for Prediction Long-term Traffic Figure 5: Prediction comparison between TrafFormer and DCRNN for detector ID "400001" in the PEMS-BAY dataset. Figure 6: Prediction comparison between TrafFormer and DCRNN for detector ID "400001" in the PEMS-BAY dataset. Table 3: Ablation test results for the METR-LA dataset. Method Default MSE Hour only Day only Cyclical Speed only 6 hours RMSE MAE MAPE 13.25% 4.11 8.47 8.03 14.05% 4.59 15.61% 4.81 9.54 22.59% 5.91 12.01 21.04% 6.02 11.18 20.84% 6.00 11.33 12 hours RMSE MAE MAPE 13.39% 4.14 8.53 8.17 14.38% 4.66 15.95% 4.87 9.64 23.06% 5.99 12.16 21.35% 6.06 11.26 20.87% 5.98 11.30 18 hours RMSE MAE MAPE 13.50% 4.16 8.56 8.22 14.47% 4.7 16.07% 4.89 9.68 23.33% 6.05 12.25 21.49% 6.09 11.31 21.44% 6.13 11.49 24 hours RMSE MAE MAPE 13.57% 4.18 8.59 8.14 14.19% 4.67 15.97% 4.88 9.63 23.05% 6.01 12.14 21.32% 6.07 11.25 21.15% 6.06 11.39 performs better than DCRNN, but only slightly as demonstrated in the results in Figure 2 as well. One point to note is the different traffic speed drop patterns between the two, as well as the METR-LA dataset. In METR-LA, both morning and evening rush hours affected the traffic speed. In PEMS-BAY, however, we see that detector "400001" only suffers from speed drops in the morning rush hours while detector "400017" only suffers from speed drops in the evening rush hours. This shows that different detection sites can have vastly different traffic pattern, which makes it important to learn the spatial correlation. 5.5 Ablation Tests We perform several ablation tests to understand the importance of the components of our TrafFormer model as well as the different aspects of the input dataset. We perform five sets of experiments: 10 TrafFormer: A Transformer Model for Prediction Long-term Traffic Table 4: Ablation test results for the PEMS-BAY dataset. Method Default MSE Hour only Day only Cyclical Speed only 6 hours RMSE MAE MAPE 6.15% 2.59 5.47 5.31 6.47% 2.76 7.15% 2.85 6.21 7.41% 3.13 6.21 11.11% 4.28 8.51 11.24% 4.26 8.57 12 hours RMSE MAE MAPE 6.09% 2.58 5.43 5.32 6.46% 2.78 7.12% 2.85 6.22 7.46% 3.13 6.19 11.09% 4.29 8.54 11.03% 4.27 8.50 18 hours RMSE MAE MAPE 6.08% 2.57 5.43 5.31 6.42% 2.77 7.13% 2.86 6.24 7.43% 3.12 6.18 11.11% 4.31 8.56 11.31% 4.35 8.66 24 hours RMSE MAE MAPE 6.14% 2.59 5.46 5.37 6.50% 2.81 7.19% 2.88 6.27 7.49% 3.16 6.23 11.21% 4.34 8.61 10.94% 4.27 8.48 MSE. In this test, we replaced the loss function in the training from MAE to MSE; which is the Mean Squared Error, i.e. RMSE without the square root operation. The results show noticeable improvements of the RMSE results at the cost of worse MAE and MAPE score. Since RMSE and MSE take the square of the error between the actual and predicted value, they greatly penalize severely wrong predictions. On the other hand, MAE and MAPE only records the absolute difference of the prediction and therefore do not incur extra penalties for severely wrong predictions. The choice between RMSE or MSE, and MAE or MAPE depends on the task. On tasks where large errors are undesirable, RMSE is the better choice. On the other hand, on tasks where this is not the case and a lower overall error is to be prioritized, MAE and MAPE could be chosen instead. The choice between MAE and MAPE also depends on the context, as MAPE records the error relative to the ground truth value as percentages whereas MAE simply records the error as it is. Hour only. Here we only use the past-hour data X as input; i.e., the past-day data X (cid:48) is removed. In this setting, the medium-term data is missing and therefore, the model is tasked to predict next day's traffic with only one hour's worth of data from the present day. TrafFormer's performance is worsened when only past-hour data is used, as there is no information about the daily traffic fluctuations. Day only. Here we only use the past-day data X (cid:48) as input. Compared to the hour-only experiment, the day-only results are worse than hour-only, especially in the METR-LA experiments. In our experiments, the past data is provided as a sequence of traffic speed readings with a two-hour gap between them. This gap causes large fluctuations in the input training sequences, which contributes to the model's inability to learn and therefore perform well. Day only information is not suitable to be used as the main input and better serve as supplementary information to accompany the hour only information. Cyclical features. For this experiment, we omit the time-day embedding matrices. Instead, we transform the day and time features from X and X (cid:48) to cyclical features. These features are static and non-trainable unlike the embedding vectors. For a feature x, we transform it to two values: (cid:18) xsin = sin (cid:18) xcos = cos (cid:19) (cid:19) (cid:18) x × 2π max(x) (cid:18) x × 2π max(x) (cid:19) + 1 × (cid:19) + 1 × 1 2 1 2 (6) Where max(x) denotes the maximum possible value for that feature, which is 288 for time data and 7 for the day data. As the name suggests, cyclical features are suitable for features that work in cycles such as time. If we model this feature linearly, for instance by scaling all possible values into the range between 0 and 1, timestamps that should be close to each other–such as 23:58 and 00:00–will be given a very large distance despite their closeness. Cyclical features will fix this issue. The results show poor performance on both datasets. The purpose of using the time-day embedding is to enable TrafFormer to learn the correlation between timestamps, both close and far, in the context of the task at hand. Cyclical features will assign similar values to timestamp or day that are close to each other, but for long-term prediction, we are not only interested in timestamps or days close to each other, but rather the full, complex correlation between all input timestamps. Traffic flow from a time stamp may be strongly correlated to timestamps farther away and this effect cannot be captured by cyclical features as they are static. Speed only. Here we discard all time and day features and use only the traffic speed reading from X and X (cid:48). Experiment results show that using speed only perform poorly, on par with using cyclical features. These two experiments shows the importance of using the embeddings to learn the temporal correlation. 11 TrafFormer: A Transformer Model for Prediction Long-term Traffic 6 Conclusion In this paper, we explore the novel problem of long-term traffic prediction. From our literature review, we observe that the existing literature predict short-term traffic only, with most being limited to hour-ahead prediction. We address this research gap by exploring the topic of day-ahead traffic prediction. For this task, the commonly used sequence autoencoder model suffers from several deficiencies that limit its effectiveness in long-term prediction. Therefore, we propose the usage of Transformers. We also imbue our model with the novel spatio-temporal multi-head attention module and the time-day embedding modules. Experiments show that our model overall performs the best compared to these baselines. The outcome of this research shows the potential of traffic prediction in assisting traffic planners with proactive measures. References [1] David Cosgove. Traffic and congestion cost trends for Australian capital cities. Department of Infrastructure and Regional Development, Bureau of Infrastructure, Transport and Regional Economics, Canberra, 2015. [2] Singapore to freeze car numbers. https://www.bbc.com/news/business-41730778, 2017. Accessed: 20 November 2018. [3] Jon Carnegie and Alan M. Voorhees. The cost of roadway construction, operations and maintenance in new jersey. Technical report, Rugers University, 2016. [4] Haiyang Yu, Zhihai Wu, Shuqin Wang, Yunpeng Wang, and Xiaolei Ma. Spatiotemporal recurrent convolutional networks for traffic prediction in transportation networks. Sensors, 17(7):1–16, 2017. [5] Wenhao Huang, Guojie Song, Haikun Hong, and Kunqing Xie. Deep architecture for traffic flow prediction: Deep belief networks with multitask learning. IEEE Transactions on Intelligent Transportation Systems, 15:2191–2201, 10 2014. [6] Yuankai Wu and Huachun Tan. Short-term traffic flow forecasting with spatial-temporal correlation in a hybrid deep learning framework. CoRR, 1612.01022, 2016. [7] Xingyi Cheng, Ruiqing Zhang, Jie Zhou, and Wei Xu. Deeptransport: Learning spatial-temporal dependency for traffic condition forecasting. CoRR, 1709.09585, 2017. [8] Xingyuan Dai, Rui Fu, Yilun Lin, Li Li, and Fei-Yue Wang. Deeptrend: A deep hierarchical neural network for traffic flow prediction. CoRR, 1707.03213, 2017. [9] Mohamed S. Ahmed and Allen R. Cook. Analysis of freeway traffic time series data by using box-jenkins techniques. Transportation Research Record, 773:1–9, 01 1979. [10] Sangsoo Lee and Daniel Fambro. Application of subset autoregressive integrated moving average model for short-term freeway traffic volume forecasting. Transportation Research Record, 1678:179–188, 11 1999. [11] Billy Williams. Multivariate vehicular traffic flow prediction: evaluation of arimax modeling. Journal of the Transportation Research Board, 1776:194–200, 2001. [12] Billy Williams and Lester A. Hoel. Modeling and forecasting vehicular traffic flow as a seasonal arima process: Theoretical basis and empirical results. Journal of Transportation Engineering, 129:664–672, 11 2003. [13] Yiannis Kamarianakis and Poulicos Prastacos. Forecasting traffic flow conditions in an urban network : Com- parison of multivariate and univariate approaches. Journal of the Transportation Research Board, pages 74–84, 2003. [14] M.G. Karlaftis and E.I. Vlahogianni. Statistical methods versus neural networks in transportation research: Differences, similarities and some insights. Transportation Research Part C: Emerging Technologies, 19(3):387 – 399, 2011. [15] Xiucheng Li, Kaiqi Zhao, Gao Cong, Christian S. Jensen, and Wei Wei. Deep representation learning for trajectory similarity computation. In 2018 IEEE 34th International International Conference on Data Engineering, pages 617–628, 2018. [16] M.S. Dougherty, H.R. Kirby, and R.D. Boyle. The use of neural networks to recognise and predict traffic congestion. Traffic Engineering and Control, 34(6):311–314, 01 1993. [17] Eleni I. Vlahogianni, Matthew G. Karlaftis, and John C. Golias. Optimized and meta-optimized neural networks for short-term traffic flow prediction: A genetic approach. Transportation Research Part C: Emerging Technologies, 13(3):211 – 234, 2005. 12 TrafFormer: A Transformer Model for Prediction Long-term Traffic [18] Weizhong Zheng and Der-Horng Lee. Short-term freeway traffic flow prediction: Bayesian combined neural network approach. Journal of Transportation Engineering, 132, 2 2006. [19] Ming Zhong, Satish Sharma, and Pawan Lingras. Short-term traffic prediction on different types of roads with genetically designed regression and time delay neural network models. Journal of Computing in Civil Engineering, 19(1):94–103, 2005. [20] Kit Yan Chan, Tharam S. Dillon, Jaipal Singh, and Elizabeth Chang. Neural network based models for short- term traffic flow forecasting using a hybrid exponential smoothing and Levenberg Marquardt algorithm. IEEE Transactions on Intelligent Transportation Systems, 13:644–654, 06 2012. [21] Lv Yisheng, Yanjie Duan, and Wenwen Kang. Traffic Flow Prediction With Big Data : A Deep Learning Approach. IEEE Transactions on Intelligent Transportation Systems, 16(2):865–873, 2015. [22] Xiaolei Ma, Zhimin Tao, Yinhai Wang, Haiyang Yu, and Yunpeng Wang. Long short-term memory neural network for traffic speed prediction using remote microwave sensor data. Transportation Research Part C: Emerging Technologies, 54:187 – 197, 2015. [23] Y. Tian and L. Pan. Predicting short-term traffic flow by long short-term memory recurrent neural network. IEEE International Conference on Smart City/SocialCom/SustainCom (SmartCity), pages 153–158, 2015. [24] Mohammadhani Fouladgar, Mostafa Parchami, Ramez Elmasri, and Amir Ghaderi. Scalable Deep Traffic Flow Neural Networks for Urban Traffic Congestion Prediction. International Joint Conference on Neural Networks, pages 2251–2258, 2017. [25] Danqing Kang, Lv Yisheng, and Yuan-yuan Chen. Short-term traffic flow prediction with LSTM recurrent neural network. Intelligent Transportation Systems, pages 1–6, 10 2017. [26] Kyunghyun Cho, Bart van Merrienboer, Çaglar Gülçehre, Fethi Bougares, Holger Schwenk, and Yoshua Ben- gio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. CoRR, abs/1406.1078, 2014. [27] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. Advances in neural information processing systems, 27, 2014. [28] Zhixiang He, Chi-Yin Chow, and Jia-Dong Zhang. Stann: A spatio-temporal attentive neural network for traffic prediction. IEEE Access, pages 4795–4806, 2019. [29] Loan Do, Hai Vu, Bao Vo, Zhiyuan Liu, and Dinh Phung. An effective spatial-temporal attention based neural network for traffic flow prediction. Transportation Research Part C: Emerging Technologies, 108:12–28, 2019. [30] Zheyi Pan, Yuxuan Liang, Weifeng Wang, Yong Yu, Yu Zheng, and Junbo Zhang. Urban traffic prediction from spatio-temporal data using deep meta learning. Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1720--1730, 2019. [31] Fuxian Li, Jie Feng, Huan Yan, Guangyin Jin, Fan Yang, Funing Sun, Depeng Jin, and Yong Li. Dynamic graph convolutional recurrent network for traffic prediction: Benchmark and solution. ACM Transactions on Knowledge Discovery from Data, 2022. [32] David Alexander Tedjopurnomo, Zhifeng Bao, Baihua Zheng, Farhana Murtaza Choudhury, and A. K. Qin. A survey on modern deep neural network for traffic prediction: Trends, methods and challenges. IEEE Transactions on Knowledge and Data Engineering, 34(4):1544–1561, 2022. [33] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. [34] H. V. Jagadish, Johannes Gehrke, Alexandros Labrinidis, Yannis Papakonstantinou, Jignesh M. Patel, Raghu Ramakrishnan, and Cyrus Shahabi. Big data and its technical challenges. Communications of the ACM, 57(7): 86–94, 2014. [35] Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. CoRR, 1707.01926, 2017. [36] Cen Chen, Kenli Li, Sin G Teo, Xiaofeng Zou, Kang Wang, Jie Wang, and Zeng Zeng. Gated residual recurrent graph neural networks for traffic prediction. Proceedings of the AAAI conference on artificial intelligence, 33(01): 485–492, 2019. [37] Ken Chen, Fei Chen, Baisheng Lai, Zhongming Jin, Yong Liu, Kai Li, Long Wei, Pengfei Wang, Yandong Tang, Jianqiang Huang, and Xian-Sheng Hua. Dynamic spatio-temporal graph-based cnns for traffic flow prediction. IEEE Access, 8:185136–185145, 01 2020. 13 TrafFormer: A Transformer Model for Prediction Long-term Traffic [38] Xiaoyang Wang, Yao Ma, Yiqi Wang, Wei Jin, Xin Wang, Jiliang Tang, Caiyan Jia, and Jian Yu. Traffic flow prediction via spatial temporal graph neural network. In Proceedings of The Web Conference 2020, page 1082–1092, 2020. [39] Chuyin Huang, Weiyang Kong, Genan Dai, and Yubao Liu. Ltphm: Long-term traffic prediction based on hybrid model. In Proceedings of the 30th ACM International Conference on Information and Knowledge Management, page 3093–3097, 2021. [40] Leslie N. Smith. Cyclical learning rates for training neural networks, 2015. [41] Bing Yu, Haoteng Yin, and Zhanxing Zhu. Spatio-temporal graph convolutional neural network: A deep learning framework for traffic forecasting. International Joint Conference on Artificial Intelligence, pages 3634–3640, 2018. [42] Jianzhong Qi, Zhuowei Zhao, Egemen Tanin, Tingru Cui, Neema Nassir, and Majid Sarvi. A graph and attentive multi-path convolutional network for traffic prediction. In IEEE Transactions on Knowledge and Data Engineering, 2022. 14
http://arxiv.org/abs/2302.14615v1
2023-02-24T01:26:56
2023-02-24T01:26:56
Distributed Randomized Kaczmarz for the Adversarial Workers
Developing large-scale distributed methods that are robust to the presence of adversarial or corrupted workers is an important part of making such methods practical for real-world problems. In this paper, we propose an iterative approach that is adversary-tolerant for convex optimization problems. By leveraging simple statistics, our method ensures convergence and is capable of adapting to adversarial distributions. Additionally, the efficiency of the proposed methods for solving convex problems is shown in simulations with the presence of adversaries. Through simulations, we demonstrate the efficiency of our approach in the presence of adversaries and its ability to identify adversarial workers with high accuracy and tolerate varying levels of adversary rates.
[ "Longxiu Huang", "Xia Li", "Deanna Needell" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.14615v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.14615v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.OC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.OC", "cs.CR", "cs.LG", "cs.NA", "math.NA", "65F20, 65F10, 65K10" ]
3 2 0 2 b e F 4 2 ] C O . h t a m [ 1 v 5 1 6 4 1 . 2 0 3 2 : v i X r a Distributed Randomized Kaczmarz for the Adversarial Workers Longxiu Huang∗ Xia Li† Deanna Needell‡ Abstract Developing large-scale distributed methods that are robust to the presence of adver- sarial or corrupted workers is an important part of making such methods practical for real-world problems. In this paper, we propose an iterative approach that is adversary- tolerant for convex optimization problems. By leveraging simple statistics, our method ensures convergence and is capable of adapting to adversarial distributions. Addition- ally, the efficiency of the proposed methods for solving convex problems is shown in simulations with the presence of adversaries. Through simulations, we demonstrate the efficiency of our approach in the presence of adversaries and its ability to identify adversarial workers with high accuracy and tolerate varying levels of adversary rates. 1 Introduction As machine-learning algorithms gain popularity in industrial applications, it is critical to make them and their optimization subroutines robust and adversary-tolerant. These attacks can take various forms, including evasion [9], data poisoning [8] and model extraction [26, 16]. In large-scale machine learning problems, which are often run on distributed systems, attacks can come in the form of Byzantine attacks [17], where individual computing units, also known as 'workers machines' or simply 'workers', may produce adversarial results. A commonly used approach to mitigate such attacks is to use redundancy; that is, to request the same computation from multiple workers. The main challenge with such an approach is how to leverage the outputs from these workers efficiently, and in such a way that even seemingly catastrophic adversarial outputs can be identified and tolerated. Let's consider the optimization problem of the following form: min x∈Rd2 F (x) = d1(cid:88) i=1 fi(x) (1) where d1 is a positive integer. To solve the problem iteratively, we use gradient descent method to update the estimate: xj+1 = xj + γj d1(cid:88) i=1 ∇fi(xj) (2) ∗Department of Computational Mathematics, Science and Engineering and Department of Mathematics, Michigan State University, MI ([email protected] ). †Microsoft, WA (Corresponding author: [email protected] or [email protected] ). ‡Department of Mathematics, University of California Los Angeles, CA ([email protected] ). 1 with some step-size γj. Such objective functions lend themselves naturally to distributed algorithms. In the distributed setting, the central worker distributes fi among the workers. Each worker returns the corresponding gradient ∇fi(xj) and the central worker aggregates those returns to compute or approximate the updating step (2). In particular, we illustrate our method on solving an over-determined linear system Ax = b. However, the algorithms can be easily adapted for (1). The linear system can be modeled as a least squares problem minx (cid:107)Ax − b(cid:107)2 2 and the least squares problem can be rewritten in the form of (1) with 2 (Aixj − bi)2, where A ∈ Rd1×d2, b ∈ Rd1, Ai is the i-th row of A, and bi is the fi(xj) = 1 i-th component of b. The central worker partitions the data matrix A into rows Ai and the rows are distributed among the workers. In the linear setting, each worker only needs to return the scalar Aixj − bi instead of the gradient (Aixj − bi)A(cid:62) i . Then the central worker aggregates those returns and approximate the updates in (2). In this work, we consider the setting where some of the workers are adversarial, i.e., the workers return noisy results or enormously large results. Our goal is to develop a variant of the randomized Kaczmarz (RK) method [25] for adversarial workers to solve the linear system Ax = b. For readers' convenience, we restate the RK method in Alg. 1. We assume Algorithm 1 Randomized Kaczmarz Algorithm 1: Select a row index ij ∈ [d1] with probability 2: Update xj+1 = arg minx∈Rd2 (cid:107)x − xj(cid:107) s.t. Aij xj+1 = bij 3: Repeat until convergence (cid:107)Aij (cid:107)2 2 (cid:107)A(cid:107)2 F that there is one central worker wc and N workers in total, among which p fraction of the unknown workers are adversarial and there are k error categories in total. During the initial data distribution, each row Ar is distributed to Nr workers. Among those Nr workers, workers in the (cid:96)-th category C(cid:96) consist of pr,(cid:96) fraction of all workers. We assume C0 contains all reliable workers. The total adversarial rate for row r is pr = (cid:80)k (cid:96)=1 pr,(cid:96) and the fraction of reliable workers for row r is pr,0. We assume pr,(cid:96) < 1 − pr = pr,0, for all r, and (cid:96) (cid:54)= 0. In particular, we assume that an adversarial worker wr s in category C(cid:96) returns the residual r (cid:105), e(cid:96),r ∈ R, and a reliable worker returns cr cr s = br + e(cid:96),r − (cid:104)xj, AT r (cid:105). Our approach utilizes simple statistics to identify and ignore adversarial results, and thus the setting in which the adversarial workers communicate and select among k types of errors to output is the most challenging for our approach. s = br − (cid:104)xj, AT 1.1 Contribution Our key contributions are threefold: (i) develop efficient methods and algorithms to guar- antee accurate estimates for the true solution in the presence of adversarial workers; (ii) identify the adversarial workers efficiently; (iii) provide theoretical convergence analysis for solving linear systems with a portion of workers being adversarial. 1.2 Related work Kaczmarz method. The Kaczmarz method is an iterative technique for solving linear In computer tomography, systems that was first introduced in 1937 by Kaczmarz [14]. 2 the method is also referred to as the Algebraic Reconstruction Technique (ART) [11, 13, 20]. The method has a broad range of applications, from computer tomography to digital signal processing. Later Strohmer et al. proposed a randomized version of the Kaczmarz method (RK) [25] in the context of consistent linear systems. They proved that RK has an exponential bound on the expected rate of convergence, with the probability of selecting each row proportional to the squared Euclidean norm of that row. The method has also been adapted to handle inconsistent linear systems [23, 24, 4, 19]. For example, Needell proved in [21] that RK converges for inconsistent linear systems to a horizon that depends on the size of the largest entry of the noise. An adaptive maximum-residual sampling strategy has also been analyzed for the inconsistent extension [23]. Additionally, RK has been studied in the context of solving systems of linear inequalities [18, 1, 3]. Robust optimization. In optimization problems, practical challenges often arise due to various factors such as errors in data collection and transmission, adversarial or non- responsive workers (also known as stragglers), and corruptions in modern storage systems. To address these challenges, researchers have proposed various mitigation strategies. For instance, to tackle the issue of straggling workers, several encoding schemes have been proposed in literature. For example, Gordon et al. [10] and Karakus et al. [15] introduced [5] proposed a methods to embed redundancy directly in the data, while Bitar et al. gradient-coding scheme for straggler mitigation when stragglers are uniformly random. [6] and Haddock et al. Another important branch in the analysis of SGD-type methods is to deal with ro- bustness to adversaries from the data. Chi et al. [12] designed [27] proposed a quantile-based methods to solve corrupted linear equations. Yang et al. variant of the gradient descent method based on the geometric median to deal with adver- sarial workers, while Alistarh et al. [2] discussed the problem of stochastic optimization in an adversarial setting where the workers sample data from a distribution and an α fraction of them may adversarially return any vector. However, these methods are limited to sce- narios where the adversary rate is less than 1 2 . Our proposed algorithm, on the other hand, can converge to the exact solution even with an adversary rate higher than 1 2 by utilizing redundancy. 2 Method In this section, we present a simple and efficient mode-based method for solving linear systems in the presence of adversarial workers, as well as identifying potential adversarial workers which may be placed in a block-list (more details will be provided later). The method detects the mode category based on the size of the returned result groups. More specifically, for each row, the central worker groups similar results and selects the result from the group with the largest size, referred to as the mode. From these modes across all selected rows, the central worker then updates the guess with the mode with the largest size. If there is only one row, the central worker updates the guess with the mode. Given the number of used workers nr for a specific row r, the expected number of 1 and the number of non-adversarial workers is nr(1 − pr) workers from category C(cid:96) is nrpr,(cid:96) 1The central worker determines the number of different result groups during the first m iterations and takes the maximum number 3 (cid:96)=1 pr,(cid:96). with pr = (cid:80)k In practice, a group with the maximum size is randomly selected and used to update the guess as long as its size is greater than nr(1 − pr) (as shown in Alg. 2 Line 13). If the algorithm is implemented with a block-list, the block-list is updated through a frequency-based approach throughout the iterations: each row has a counter that records whether a worker is selected but fails to be the mode during each iteration. For every updating cycle S, the worker with the largest count in each counter is identified as a potential adversarial worker and placed in the block-list (as shown in Alg. 2 Line 14 – 20). Once a worker is in the block-list, it will not be considered in future iterations. The full details of the algorithm can be found in Alg. 2 and the related theoretical results are provided in the following section. Algorithm 2 Distributed randomized Kaczmarz with/without block-list 1: Input: Worker sets Dr, the number of used worker for each row nr the number of used rows d0, MaxIter, Tol, updating cycle S, Blocklist flag Initialize block-list B 2: Initialize cs = 2 * Tol, a counter vector Er = 0 ∈ RNr for each row r 3: if Blocklist flag then 4: 5: end if 6: while j < MaxIter and |cs| > Tol, do 7: nr for each row r ∈ τ , uniformly at random from Dr 1, . . . , wr nr s = (cid:104)Ar,xi(cid:105)−(br+e(cid:96),r) The central worker wc selects rows τ from [d1] uniformly at random Sample wr 1, . . . , wr Broadcast Ar to wr s returns cr wr for r ∈ τ do wc splits {cr Set Gr Update Er(s) = Er(s) + 1, if cr s∗ = Gs∗, where s∗ = arg max s∈S s /∈ Gr s∗ s=1 into groups G1, . . . , Gkr , if ws ∈ C(cid:96) s}nr (cid:107)Ar(cid:107)2 |Gs| and S = {s : |Gs| ≥ nr(1 − (cid:80)kr 2 8: 9: 10: 11: 12: 13: 14: 15: end for cs∗ = maxr∈τ |cr 16: 17: Update xj+1 = xj + cs∗A(cid:62) ij 18: if Blocklist flag & mod(j, S) = 0 then s∗| and ij = arg maxr∈τ |cr s∗|, where cr s∗ ∈ Gr s∗ l=1 pr,l)} 19: 20: 21: 22: for r ∈ τ do Update B by checking the value of entries in Er Dr = Dr \ B end for end if 23: 24: Update j = j + 1 25: end while 26: if Blocklist flag then 27: Output: xj and B 28: else 29: Output: xj 30: end if 4 3 Theoretical results In this section, we provide a rigorous theoretical analysis of the mode distributions and convergence behavior of our mode-based method. To simplify the presentation, we provided a summary of the key notation used in our analysis in Table 1. A ̃A N Nr nr C(cid:96) k er,(cid:96) er e d0 pr,(cid:96) ˆq(cid:96),r mode qr [d1] (cid:0)[d1] d0 unif (cid:1) (cid:16)(cid:0)[d1] d0 (cid:1)(cid:17) τi τ (cid:48) i ti P(r mode, g, (cid:96)) P(ti, (cid:96), g|τi, xi−1) P(ti, g) Table 1: Notation Table Data matrix A, A ∈ Rd1×d2 Row normalized version of matrix A Number of workers in total Number of workers holding row r Number of workers chosen for row r (cid:96)-th error category Number of error categories in total Error of the (cid:96)-th error category for a row r Vector form of errors in all error categories of row r, er := (er,1, . . . , er,k)(cid:62) Matrix form of errors in all error categories of all rows, e := (er,(cid:96))r,(cid:96) Number of chosen rows per iteration Fraction of workers holding row r in category (cid:96) Probability that there is a mode among the outputs of chosen workers of row r and the mode is in the category (cid:96) (see Lemma 3.2) Probability that there is a mode among the outputs of chosen workers for row r (see Lemma 3.2) Set of the integers from 1 to d1, [d1] := {1, . . . , d1} Collection of the subsets of [d1] with d0 elements Uniform sampling from the collection (cid:0)[d1] d0 Index set of chosen rows at i-th iteration, |τi| = d0 Index set of chosen rows that have a mode, τ (cid:48) i ⊂ τi Row index that has the largest mode number, ti = t(xi−1, τi) Probability that the mode is in the category (cid:96) with mode number g for row r (see Lemma 3.1) Probability that a mode is from row ti among rows τi and the mode is in category C(cid:96) with mode number g, given the previous estimate xi−1. It is also denoted by P(ti, (cid:96), g), Probability that the mode is from row ti among rows τi with mode number g provided the previous estimate xi−1, more details refer to Corollary 3.4. (cid:1). 2Note for a nr-dimensional vector Er, we adopt Er(i) to denote the i-th entry of the vector. 5 3.1 Mode distribution Algorithm 2 utilizes the mode to identify adversarial workers and achieve convergence. In this section, we discuss the calculation of the probability of a specific category (cid:96) being the mode of a given row r during each iteration of the algorithm. For simplicity, let C0 denote the category of "reliable" workers (workers return correct results). For each row r, the fraction of reliable workers holding row r is pr,0 = 1 − pr. We use d0 rows for the computation per iteration. Recall that each row r is held by Nr workers (fixed). Among those Nr workers, workers in the category (cid:96) take up a fraction of pr,(cid:96). At each iteration, the central worker chooses a set of row indices of size d0 uniformly at random and requests the corresponding workers to return their results. More specifically, given a set of row indices τi at i-th iteration, the central worker first finds the modes among the results from each row r ∈ τi and among those modes, chooses the mode with the largest group size ("the majority vote"). For any row r, let ar g,(cid:96) be the coefficient of the monomial xnr−g of the polynomial   k (cid:89) g−1 (cid:88)  (cid:19) (cid:18)Nrpr,(cid:96)(cid:48) j xj  . (cid:96)(cid:48)=0,(cid:96)(cid:48)(cid:54)=(cid:96) j=0 Let br g be the coefficient of the term xnr of the polynomial k (cid:89)   g−1 (cid:88) (cid:96)=0 j=0 (cid:18)Nrpr,(cid:96) j (cid:19) xj   Lemma 3.1. For row r, the probability that the mode is in the category (cid:96) with mode number g is P(r mode, g, (cid:96)) = )ar g,(cid:96) . (Nr pr,(cid:96) g (Nr nr ) Proof. See Appendix C. Using Lemma 3.1, we obtain the following conclusions by going over all possible mode numbers and all error categories. Lemma 3.2. For row r, the probability that the category (cid:96) is the mode is ˆq(cid:96),r mode = nr(cid:88) g=g0(r) (cid:0)Nrpr,(cid:96) g (cid:0)Nr nr (cid:1)ar g,(cid:96) (cid:1) , where g0(r) = max((cid:100) nr number g for the calculation of row r is k+1 (cid:101), (cid:100)nrpr,0(cid:101)), and the probability that there is a mode with mode qr g = k (cid:88) (cid:96)=0 (cid:0)Nrpr,(cid:96) g (cid:0)Nr nr (cid:1)ar g,(cid:96) (cid:1) . Additionally, the probability that there is a mode for the calculation of row r is qr = k (cid:88) (cid:96)=0 ˆq(cid:96),r mode = nr(cid:88) k (cid:88) g=g0(r) (cid:96)=0 (cid:0)Nrpr,(cid:96) g (cid:0)Nr nr (cid:1)ar g,(cid:96) (cid:1) , (3) 6 where (cid:0)n g (cid:1) = 0 if n < g, for any integer n. In the following lemma, we also calculate the probability P(ti, (cid:96), g|τi, xi−1) that a mode is from row ti in the category C(cid:96) with a mode number g when rows τi are used in the computation and the previous estimate xi−1 is given. For simplicity, we omit the condition of τi, xi−1 in the notation and denote P(t, (cid:96), g|τi, xi−1) by P(ti, (cid:96), g). Lemma 3.3. Given the previous estimate xi−1 and row indices τi, we have P(ti, (cid:96), g) = (cid:0)Nti pti,(cid:96) g (cid:0)Nti nti (cid:1)ati g,(cid:96) (cid:1) (cid:89) s∈τi\ti bs g (cid:0)Ns ns (cid:1) . Proof. The probability that the mode is produced from category (cid:96) of row ti with the mode number g can be expressed as P(ti, (cid:96), g) =P(ti mode, g, (cid:96)) × P( the largest mode number from ti|ti mode, (cid:96), g) = = (cid:0)Nti pti,(cid:96) g (cid:0)Nti nti (cid:0)Nti pti,(cid:96) g (cid:0)Nti nti (cid:1)ati g,(cid:96) (cid:1) (cid:1)ati g,(cid:96) (cid:1) × P( the largest mode number from ti|ti mode, (cid:96), g) (cid:89) s∈τi\ti bs g (cid:0)Ns ns (cid:1) . Taking the modes produced from different categories into account, we can easily obtain the following result. Corollary 3.4. Given the previous estimate xi−1 and the row indices τi, the probability that a mode is from row ti with mode number g is P(ti, g) = k (cid:88) (cid:96)=0 P(ti, (cid:96), g) = k (cid:88) (cid:96)=0 (cid:0)Ntpti,(cid:96) g (cid:0)Nti nti (cid:1)ati g,(cid:96) (cid:1) (cid:89) s∈τi\{ti} bs g (cid:0)Ns ns (cid:1) = qti g (cid:89) s∈τi\ti bs g (cid:0)Ns ns (cid:1) . (4) 3.2 Convergence without block-list In this section, our main goal is to provide theoretical error bound for the method without block-list (i.e., Alg. 2 without block-list). The main result for this section is present below. Theorem 3.5. Let A ∈ Rd1×d2 with d1 ≥ d2 and b, e1, . . . , ek ∈ Rd1. Assume that we solve Ax∗ = b via Alg. 2 without block-list; then E(cid:107)xi − x∗(cid:107)2 2 ≤αi(cid:107)x0 − x∗(cid:107)2 2 + 1 − αi+1 1 − α (cid:88) t∈[d1] βt(cid:107)(cid:101)et(cid:107)2 2 , (5) 7 where α = 1 − Qmin bs g (cid:0)Ns ns (cid:1) , (cid:89) s∈τi bs g (cid:0)Ns ns (cid:1) , (6) min( ̃A), σ2 d0 d1 nt(cid:88) g=g0(ti) Qmin = min g,ti,τi Qmax(t, g, τi) = max (cid:96) t,(cid:96), ̃e2 ̃e2 t,(cid:96) = k (cid:88) (cid:96)=0 (cid:88) (cid:107)(cid:101)et(cid:107)2 2 = βt = (cid:89) qti g s∈τi\{ti} (cid:1)at g,(cid:96) (cid:1) (cid:0)Ntpt,(cid:96) g (cid:0)Nt nt e2 t,(cid:96) (cid:107)At(cid:107)2 2 , nti(cid:88) 1 (cid:0)d1 d0 (cid:1) Qmax(t, g, ̃τt,i), ̃τt,i∈([d1−1] d0−1 ) g=g0(t) and ̃A is the row normalized matrix of A and σmin( ̃A) is ̃A's smallest singular value. Before we prove Theorem 3.5, we let ti be the row selected at i-th iteration to update the guess x and consider solving Atix = bti + eti,0 with eti,0 = 0 Atix = bti + eti,1, ... Atix = bti + eti,k, according to some probability distribution. Thus, we have the iteration xi = xi−1 − (cid:104)Ati, xi−1(cid:105) − (bti + eti,(cid:96)) (cid:107)Ati(cid:107)2 A(cid:62) ti , at i-th iteration, where (cid:96) ∈ {0, 1, . . . , k}, and Ati is the ti-th row of matrix A. In the following analysis, let Eτi denote the expectation with respect to the uniformly random sample τi conditioned upon the sampled τj for j < i, and let E denote expectation with respect to all random samples τj for 1 ≤ j ≤ i, where i is the last iteration in the context in which E is applied. We start our analysis by decomposing the squared error (cid:107)xi − x∗(cid:107)2 2 = (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) xi−1 − (cid:104)AT (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) 2 ) )2 A(cid:62) 2 + ((cid:104)AT ti − x∗ ti, xi−1(cid:105) − (bti + eti,(cid:96)ti (cid:107)Ati(cid:107)2 2 ti, xi−1 − x∗(cid:105) − eti,(cid:96)ti (cid:107)Ati(cid:107)2 2 ti, xi−1 − x∗(cid:105) − eti,(cid:96)ti e2 ti,(cid:96)ti (cid:107)Ati(cid:107)2 2 ti, xi−1 − x∗(cid:105)2 (cid:107)Ati(cid:107)2 2 ti(cid:105)((cid:104)AT (cid:104)AT 2 − + ) = (cid:107)xi−1 − x∗(cid:107)2 − 2 (cid:107)Ati(cid:107)2 2 (cid:104)xi−1 − x∗, AT = (cid:107)xi−1 − x∗(cid:107)2 8 Taking the expectation of the above equation, we can easily achieve that E(cid:107)xi − x∗(cid:107)2 2 = (cid:107)xi−1 − x∗(cid:107)2 + Eτi Eti E(cid:96)ti e2 ti,(cid:96)ti (cid:107)Ati(cid:107)2 2 − Eτi Eti (cid:104)AT ti, xi−1 − x∗(cid:105)2 (cid:107)Ati(cid:107)2 2 . Therefore, the proof of Theorem 3.5 can be divided into the computations of the condi- tional expectation of the squared error from the adversarial workers Eτi Eti and E(cid:96)ti e2 ti,(cid:96)ti (cid:107)Ati (cid:107)2 2 the residual part Eτi Eti (cid:104)AT ti ,xi−1−x∗(cid:105)2 (cid:107)Ati (cid:107)2 2 separately which are provided in the following lemmas. Lemma 3.6. The conditional expectation of squared residual can be bounded below: Eτi Eti (cid:104)AT ti, xi−1 − x∗(cid:105)2 (cid:107)Ati(cid:107)2 2 ≥ Qminσ2 min( ̃A) d0 d1 (cid:107)xi−1 − x∗(cid:107)2, (7) where ̃A is the row normalized version of A. Thus, we have (cid:107)xi−1 − x∗(cid:107)2 − Eτi Eti (cid:104)AT ti, xi−1 − x∗(cid:105)2 (cid:107)Ati(cid:107)2 2 ≤ (1 − Qminσ2 min( ̃A) d0 d1 )(cid:107)xi−1 − x∗(cid:107)2 , (8) where Qmin = ming,ti,τi (cid:80)nt g=g0(ti) qti g (cid:81) s∈τi\{ti} bs g (Ns ns) . Proof. The expectation of the squared residual can be represented as (cid:104)AT ti, xi−1 − x∗(cid:105)2 (cid:107)Ati(cid:107)2 2 k (cid:88) nti(cid:88) Eτi Eti (cid:88) =Eτi ti∈τi g=g0(ti) (cid:96)=0 P(ti, (cid:96), g) (cid:13) (cid:13) (cid:13) (cid:13) Ati(xi−1 − x∗) (cid:107)Ati(cid:107) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:88) nti(cid:88) ti∈τi g=g0(ti) (cid:88) nti(cid:88) = = (cid:88) pxi−1(τi) τi∈([d1] d0 ) (cid:88) τi∈([d1] d0 ) pxi−1(τi) P(ti, g) (cid:13) (cid:13) (cid:13) (cid:13) Ati(xi−1 − x∗) (cid:107)Ati(cid:107) (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:89) qti g bs g (cid:0)Ns ns (cid:1) (cid:13) (cid:13) (cid:13) (cid:13) Ati(xi−1 − x∗) (cid:107)Ati(cid:107) (cid:13) 2 (cid:13) (cid:13) (cid:13) . ti∈τi g=g0(ti) s∈τi\{ti} Recall that τi ∼ unif((cid:0)[d1] d0 (cid:1)). We thus have pxi−1(τi) = 1/(cid:0)d1 d0 (cid:1) = d0!(d1−d0)! d1! . Therefore, Eτi Eti (cid:104)AT ti, xi−1 − x∗(cid:105)2 (cid:107)Ati(cid:107)2 2 ≥ Qmin * d0!(d1 − d0)! d1! * (cid:88) (cid:88) (cid:13) (cid:13) (cid:13) (cid:13) Ati(xi−1 − x∗) (cid:107)Ati(cid:107) (cid:13) 2 (cid:13) (cid:13) (cid:13) ti∈τi (cid:19) τi∈([d1] ) d0 (cid:18)d1 − 1 d0 − 1 * d0!(d1 − d0)! d1! min( ̃A)(cid:107)xi−1 − x∗(cid:107)2 2, * σ2 d0 d1 ≥ Qmin * ≥ Qmin * * (cid:107) ̃A(xi−1 − x∗)(cid:107)2 2 i.e., (7) is derived. Hence, we also have (8). 9 Lemma 3.7. The expectation of the squared error from the adversarial workers can be bounded above by (cid:80) ti∈[d1] βti(cid:107) ̃eti(cid:107)2 2, i.e., Eτi Eti E(cid:96) e2 ti,(cid:96) (cid:107)Ati(cid:107)2 2 (cid:88) ≤ βti(cid:107) ̃eti(cid:107)2 2, ti∈[d1] (9) where ̃e2 ti = e2 ti,(cid:96) (cid:107)Ati (cid:107)2 2 and βti = (cid:80) nti(cid:80) g=g0(ti) Qmax(ti, g, ̃τti,i) with 1 (d1 d0 ) Qmax(ti, g, τi) = max (cid:96) (Nti ̃τti,i∈([d1−1] d0−1 ) ti pti,(cid:96) )a bs (cid:81) g,(cid:96) g g (Ns (Nti ns) ) s∈τi nti . Proof. The expectation of the squared error from the adversarial workers can be repre- k (cid:80) sented as Eτi (cid:96)=0 . To simplify e2 ti,(cid:96) (cid:107)Ati (cid:107)2 2 e2 ti,(cid:96) (cid:107)Ati (cid:107)2 2 nti(cid:80) g=g0(ti) bs g (Ns ns) (cid:80) ti∈τi = Eτi pti,(cid:96) )a g (Nti ) nti s∈τi\{ti} Eti (Nti E(cid:96) ti g,(cid:96) (cid:81) the expressions, we let Qmax(ti, g, τi \ {ti}) = max (cid:96) (Ntpti,(cid:96) g (Nti nti ti g,(cid:96) )a ) (cid:81) s∈τi\{ti} bs g (Ns ns) , ̃e2 ti,(cid:96) = e2 ti,(cid:96) (cid:107)Ati (cid:107)2 2 , and ̃eti = (et,0, eti,1, . . . , eti,k) . Then (9) can be achieved by Eτi Eti E(cid:96) e2 ti,(cid:96) (cid:107)Ati(cid:107)2 2 (cid:88) =Eτi nti(cid:88) k (cid:88) ti∈τi g=g0(ti) (cid:96)=0 (cid:0)Nti pti,(cid:96) g (cid:0)Nti nti (cid:1)ati g,(cid:96) (cid:1) (cid:89) s∈τi\{ti} bs g (cid:0)Ns ns (cid:1) ̃e2 ti,(cid:96) (cid:88) ≤Eτi nti(cid:88) ti∈τi g=g0(ti) (cid:88) =Eτi nti(cid:88) ti∈τi g=g0(ti) Qmax(ti, g, τi \ {ti}) k (cid:88) (cid:96)=0 ̃e2 ti,(cid:96) Qmax(ti, g, τi \ {ti})(cid:107) ̃eti(cid:107)2 2 nti(cid:88) Qmax(ti, g, τi \ {ti})(cid:107) ̃eti(cid:107)2 2 (cid:88) = τi∈([d1] d0 ) 1 (cid:0)d1 d0 (cid:1) (cid:88) ti∈τi (cid:88) = (cid:88) g=g0(ti) nt(cid:88) 1 (cid:0)d1 d0 (cid:1) Qmax(t, g, ̃τt,i)(cid:107) ̃et(cid:107)2 2 = βt(cid:107) ̃et(cid:107)2 2 (cid:88) t∈[d1] t∈[d1] ̃τt,i∈([d1]\{t} d0−1 ) g=g0(t) with βt = (cid:80) ̃τt,i∈([d1−1] d0−1 ) nti(cid:80) g=g0(t) 1 (d1 d0 ) Qmax(t, g, ̃τt,i). Notice that nt(cid:88) k (cid:88) g=g0(t) (cid:96)=0 (cid:0)Ntpt,(cid:96) g (cid:0)Nt nt (cid:1)at g,(cid:96) (cid:1) (cid:89) s∈τi\{t} bs g (cid:0)Ns ns (cid:1) ≤ nt(cid:88) g=g0(t) P(t, g) ≤ 1, (10) 10 we thus have (cid:80)nt g=g0(t) Qmax(t, g, τi \ {t}) ≤ 1, and Eτi EtE(cid:96) e2 t,(cid:96) (cid:107)At(cid:107)2 2 (cid:88) ≤ τi∈([d1] d0 ) 1 (cid:0)d1 d0 (cid:1) (cid:88) nti(cid:88) t∈τi g=g0(t) Qmax(t, g, τi \ {t})(cid:107) ̃et(cid:107)2 2 ≤ d0 d1 d1(cid:88) t=1 (cid:107) ̃et(cid:107)2 2. The proof of Theorem 3.5. Combining Lemma 3.6 and Lemma 3.7, we thus have Theo- rem 3.5. Next we provide some remarks for our main result Theorem 3.5. Remark 3.8. the facts that σ2 (i) 0 < 1 − d0 d1 min( ̃A) ≤ d1 d2 Qminσ2 min( ̃A) < 1, provided that d0 ≤ d2. This results from (since (cid:80)d2 i=1 σ2 i ( ̃A) = d1) and 0 ≤ Qmin ≤ 1 (by (10)). (ii) From (6), one can see the relation between βt and d0 is complicated. An example in Table 2 shows that increasing d0, to some extent, can decrease βt and thus, improves the speed of convergence. For more details about the optimal choice of d0, one can refer to Appendix B. Meanwhile, one should be aware of that larger d0 leads to more communication cost. Thus, in practice, finding an optimal d0 is not just minimizing βt but also reducing the communication cost. (iii) When adversaries {(cid:101)et}t are relatively small, the method without the block-list can guarantee a convergence error with the same or smaller magnitude as {(cid:101)et}t using the right parameters. However, one can conclude from (6), when adversaries {(cid:101)et}t are relatively larger, the convergence is not guaranteed. Therefore, it is crucial to introduce the block-list method for excluding the adversarial workers. Table 2: Total number of workers Nr ≡ 10, number of error categories k = 3, the adversarial rate pr = p/k. p 0.6 nr 5 5 5 d0 2 3 5 Q 4.25 × 10−3 3.3 × 10−4 3.63 × 10−6 βt 8.5 × 10−4 9.9 × 10−5 1.82 × 10−6 3.3 Block-list method In this section, we use P(cid:96) to denote the proportion of workers in category (cid:96) among the total of N workers. Thus, the number of workers in category (cid:96) is N P(cid:96). As per Algorithm 2, after S iterations, the worker w∗ with the highest count of non-mode selections, c+ w∗, will be added to the block-list. To assess the effectiveness of the proposed method, it is crucial to calculate the probability that a bad or reliable worker is included in the block-list. This problem can be mathematically reformulated as follows. Problem 3.9. Let c+ w) be the counters of the worker w being non-mode (resp. mode or in no mode case) among S iterations. Then we have w(S) := c0 c0 w(S) := c+ w (resp. 11 w, c0 0 ≤ c+ S iterations can be calculated as follows: w ≤ S and (cid:80)N w=1(c+ w + c0 w) = nS. The probability that w∗ is in the block-list after Pbl(w∗) = P(c+ w∗ > c+ w, ∀w (cid:54)= w∗) s.t. N (cid:88) w=1 w + c0 c+ w = nS. (11) Note that this probability can be calculated by using integer dynamic programming or estimated by Monte Carlo simulations. Lemma 3.10. Run Alg. 2 with S iteration. Then the conditional probability that a reliable worker w0 is in the block-list is . Similarly, the conditional probability that a P0Pbl(w0) i=0 PiPbl(wi) (cid:80)k bad worker w(cid:96) in category (cid:96) is in the block-list is P(cid:96)Pbl(w(cid:96)) i=0 PiPbl(wi) (cid:80)k . Proof. First notice that we have the following two facts: (i)The probability that a reliable worker is in the block-list is P0N Pbl(w0). (ii) The probability that a bad worker w(cid:96) in category (cid:96) is in the block-list is P(cid:96)N Pbl(w(cid:96)). Therefore, the probability that a worker, either reliable or bad, i in the block-list is (cid:80)k i=0 PiN Pbl(wi). The conditional probabilities can be easily computed by considering the ratios and . P0N Pbl(w0) i=0 PiN Pbl(wi) (cid:80)k P(cid:96)N Pbl(w(cid:96)) i=0 PiN Pbl(w(cid:96)) (cid:80)k To illustrate how the quantities changes with respect to S in Lemma 3.10, we consider the following example. bl and Pbl(w3) = Pbl(w4) = Pbl(w5) := P0 Example. Assume that there are two categories of workers i.e. k = 0, 1, and 5 workers wi, i = 1, . . . , 5 in total with w1, w2 ∈ C1, w3, w4, w5 ∈ C0. Let nr ≡ 3. Note that Pbl(w1) = Pbl(w2) := P1 bl. The probability is estimated by Monte Carlo simulations. We simulated the experiment 100 times and count the numbers of experiments where each worker is listed in the block-list. Those numbers are used to calculate the frequency and estimate the probability. The estimated results are summarized in Table 3. Table 3 shows that the probability of an adversarial worker in the block-list Table 3: Conditional probability of being in block-list. S P1 bl P0 bl 5 0.403 0.065 100 50 10 0.452 0.5 0.5 0.032 ∼ 0 ∼ 0 increases as the number of iterations S increases. Meanwhile, the probability of a reliable worker in the block-list decreases. Using the method with the block-list, we are able to avoid choosing the results from the adversarial workers. As a results, the probability of using the adversarial workers decreases, i.e., βt decreases. 4 Simulations In this section, we evaluate the performance of our approaches for solving consistent linear systems through simulations. We randomly generate a row-normalized matrix A ∈ R1200×50 12 and a vector x ∈ R50, both from a normalized Gaussian distribution, and set b = Ax. For simplicity, we assume that each row has the same number of error categories k and the same adversarial rate pr = p/k, where p is the total adversarial rate. The linear system Ax = b is solved using Algorithm 2 with and without the block-list. At each iteration, d0 rows of A are chosen uniformly at random, and for each row, nr workers are selected from the Nr workers to participate in the calculation. We further assume Nr are the same and nr are equal to n for all r. The simulation results show how the number of used rows d0, the number of used workers n, the total adversary rate p, and the number of error categories k affect the performance. (a) Error vs. d0: p = 0.2; using Alg. 2 with block-list. (b) Error vs. d0: p = 0.2; using Alg. 2 with- out block-list. (c) Error vs. d0: p = 0.6; using Alg. 2 with block-list. (d) Error vs. d0: p = 0.6; using Alg. 2 with- out block-list. Figure 1: Effects of the number of used rows d0 on convergence: Nr = 20, nr = 4, k = 3, (cid:107)e(cid:107)∞ = 10−3. The error norms were averaged over 50 trials (the solid lines) with 90% percentiles (the shaded areas). Figs. 1 and 2 illustrate the impact of the number of used rows d0 on the convergence results of our distributed RK method with and without the block-list. In this example, increasing the number of used rows d0 from 2 to 4 improves the convergence rate for both with and without block-list scenarios, regardless of the magnitude of the adversaries e. Fig. 1 demonstrates the convergence results when (cid:107)e(cid:107)∞ = 10−3. From the figures, Alg. 2 13 012345Number of iterations×10310141011108105102101||xjx*||2d0 =2d0 =4d0 =6d0 =8012345Number of iterations×10310141011108105102101||xjx*||2d0 =2d0 =4d0 =6d0 =8012345Number of iterations×10310141011108105102101||xjx*||2d0 =2d0 =4d0 =6d0 =8012345Number of iterations×103103102101100101||xjx*||2d0 =2d0 =4d0 =6d0 =8 (a) Error vs. d0: p = 0.2; using Alg. 2 with block-list. (b) Error vs. d0: p = 0.2; using Alg. 2 with- out block-list. (c) Error vs. d0: p = 0.6; using Alg. 2 with block-list. (d) Error vs. d0: p = 0.6; using Alg. 2 with- out block-list. Figure 2: Effects of different data sizes d0 on convergence: Nr = 20, nr = 4, k = 3, and (cid:107)e(cid:107)∞ = 500. The error norms were averaged over 50 trials (the solid lines) with 90% percentiles (the shaded areas). with the block-list shows fast convergence over all choices of d0 when the adversarial rate p = 0.2 (Fig. 1a); the larger the number of used rows d0, the faster the convergence when the adversarial rate p = 0.6 (Fig. 1c). Fig. 1b reveals that, when d0 = 2, 4, the central worker may use a corrupted step-size, resulting in oscillations around the solution and the error converging to a range of magnitude between 10−3 and 10−5. On the other hand, when d0 = 6, 8, the error goes to 0 after 4000 iterations. As seen in Fig. 1d, the convergence errors of all d0 values lie in the range of (10−4, 10−2). With a small (cid:107)e(cid:107)∞, the method without the block-list can converge by increasing d0. However, when the magnitude of the adversaries and the adversarial rate are large (as shown in Fig. 2d), the convergence is not guaranteed without a block-list. In comparison, the method with the block-list converges quickly to an accuracy of 10−10 when d0 is sufficiently large (as seen in Fig. 2a). This highlights the importance of using the block-list in an environment with larger outliers. Figure 3 examines the impact of the number of chosen workers nr on the convergence, with adversary rates of 0.2 and 0.6. As the number of workers increases from 3 to 7, the 14 012345Number of iterations×10310141011108105102101||xjx*||2d0 =2d0 =4d0 =6d0 =8012345Number of iterations×10310141011108105102101||xjx*||2d0 =2d0 =4d0 =6d0 =8012345Number of iterations×10310141011108105102101104||xjx*||2d0 =2d0 =4d0 =6d0 =8012345Number of iterations×103103||xjx*||2d0 =2d0 =4d0 =6d0 =8 (a) Error vs. n: p = 0.2; using Alg. 2 with block-list. (b) Error vs. n: p = 0.2; using Alg. 2 without block-list. (c) Error vs. n: p = 0.6; using Alg. 2 with block-list. (d) Error vs. n: p = 0.6; using Alg. 2 without block-list. Figure 3: Effects of the number of used workers nr for row r (note that nr ≡ n for all selected rows): k = 3, d0 = 6, Nr = 20, (cid:107)e(cid:107)∞ = 500. convergence becomes faster in both with and without block-list methods. However, the method using the block-list generally provides better convergence compared to the method without block-list. The block-list method requires extra storage, but it is worth the trade- off in terms of improved convergence. Without the block-list, oscillations can be observed in the convergence when p = 0.2 and nr ≡ n = 3 and when p = 0.6 and all nr. Figure 4 demonstrates the effect of the adversary rate on the convergence. As the adversary rate p increases, the accuracy decreases. Even though the adversary rate is large, the final results using the block-list method are still satisfying. Without the block-list, when the adversarial rate p > 0.5, the central worker fails to approach the true solution due to the adversarial workers. This again shows the importance and effectiveness of using the block- list, especially in a highly hostile environment with a higher adversarial rate and a higher magnitude of the adversary. In addition, Fig. 5 shows the effect of the number k of error categories with the block-list. One can see that our method converges when k is big enough for the adversarial rate being 0.2 and 0.6. In Fig. 6, we use the Wisconsin (Diagnostic) Breast Cancer data set, which includes data points whose features are computed from a digitized image of a fine needle aspirate (FNA) of a breast mass and describe characteristics 15 012345Number of iterations×10310141011108105102101||xjx*||2n =3n =5n =7n =9012345Number of iterations×10310141011108105102101||xjx*||2n =3n =5n =7n =9012345Number of iterations×10310141011108105102101104||xjx*||2n =3n =5n =7n =9012345Number of iterations×103102103||xjx*||2n =3n =5n =7n =9 (a) Error vs. p :with block-list (b) Error vs. p: without block-list Figure 4: Effects of the adversarial rate p, d0 = 3, Nr = 20, nr = 4, (cid:107)e(cid:107)∞ = 5 × 102, and k = 3. Squared error norms were averaged over 50 trials with the 90% percentiles (a) Error vs. k: p = 0.6; using Alg. 2 with block-list. (b) Error vs. k: p = 0.6; using Alg. 2 without block-list. Figure 5: Effects of the number of categories k. Nr = 20, nr = 4, d0 = 4, (cid:107)e(cid:107)∞ = 5 × 102 16 012345Number of iterations×10310141011108105102101104||xjx*||2p =0.2p =0.3p =0.4p =0.5p =0.6012345Number of iterations×103103102101100101102103||xjx*||2p =0.2p =0.3p =0.4p =0.5p =0.6012345Number of iterations×10310141011108105102101104||xjx*||2k =3k =6k =12k =36012345Number of iterations×10310141011108105102101104||xjx*||2k =3k =6k =12k =36 of the cell nuclei present in the image (see [7] for more details). Similar to the setup in [12], we set the simulations in the following way: the collection of data points forms matrix A ∈ R569×10. We then normalize A and construct x and b using a Gaussian distribution to form a consistent system. The convergence results in Fig. 6 show the effectiveness of our method solving this linear systems in a relatively safer environment with an adversarial rate p = 0.3 (Fig. 6a) and a more hostile environment with an adversarial rate p = 0.6 (Fig. 6b). When p = 0.3, the method converges within 1000 iterations, and as d0 increases, the convergence speed becomes faster. Meanwhile, when p = 0.3, the method converges within 1500 iterations, and d0 = 8 has the fastest convergence speed among all choices of d0. Finally, we have investigated the impact of updating cycles S on the accuracy of block- list recognition. In Table 4, we calculate the accuracy of the block-list method when S = 200, 500, 1000, 2000. The two examples in the table show that as S increases, the accuracy is higher. (a) Error vs. p, with block-list. (b) Error vs. p, without block-list. Figure 6: Effects of adversarial rate p using the Breast Cancer Wisconsin data set, Nr = 10, nr = 4, k = 3, (cid:107)e(cid:107)∞ = 500. Table 4: The accuracy of recognizing the block-list with different updating cycles S by fixing k = 3, Nr = 20, and nr = 4. S p = 0.6, d0 = 8 p = 0.4, d0 = 6 200 0.75 0.75 500 0.792 0.9375 1000 0.875 1 2000 0.875 1 5 Conclusion and future work It is of great significance for optimization algorithms to be robust and resistant to adver- saries. In this work, we propose efficient algorithms based on the mode for solving large- scale linear systems in the presence of the adversarial workers. This kind of adversary has plenty of applications in the real world, e.g. Internet of Things (IoT). We provide theoretical convergence guarantee and the theories are supported by our experiments. The methods 17 02468Number of iterations×10310141011108105102101||xjx*||2p =0.2p =0.3p =0.4p =0.5p =0.602468Number of iterations×10310141011108105102101104||xjx*||2p =0.2p =0.3p =0.4p =0.5p =0.6 (a) Error vs. number of used rows d0: with- out block-list. (b) F (x) vs. number of used rows d0: without block-list. Figure 7: Effects of the number of used rows d0 on convergence: p = 0.4, (cid:107)e(cid:107)∞ = 1, (cid:17) Nr = 20, nr = 15, and γ = 1. The object function F (x) = (cid:80)d1 . i=1 (cid:16) 1 2 (Aixj − bi)2 + γ d1 (cid:107)x(cid:107)1 are capable of handling various levels of adversarial rates. In particular, the method with the block-list is able to provide accurate estimation of solution when the adversarial rate p > 0.5, and at the same time, our method can identify the adversarial workers. Our ex- periments also highlight the impact of several important parameters of the adversaries and of anti-adversary strategies, namely, the involved row number d0 to update the solution per iteration, the number of error categories k, the adversary rate p, and the number of chosen workers nr at each iteration. i=1 fi(x), where fi(x) = 1 Our method can also be adapted to solve the nonlinear problem. In Fig. 7, we applied the method with the block-list to solve the optimization problem with (cid:96)1 regularization 1 2 (cid:107)Ax − b(cid:107)2 2 + γ(cid:107)x(cid:107)1 with γ = 1. In the distributed setting, the problem can be formulated as (cid:80)d1 (cid:107)x(cid:107)1. Fig. 7a shows the distance between the solution using our method and the solution using the LASSO solver from the Python package scikit-learn [22] when choosing different number of rows d0. When the number of used rows d0 = 4, it takes the least iterations to converge. All choices of d0 end up with an relative error around 10−5 with the block-list. The object function F (x) v.s. the iterations are shown in Fig. 7b. 2 (Aixj − bi)2 + γ d1 Additionally, we provide convergence analysis for methods when multiple rows are se- lected uniformly at each iteration. We also provide the proof of a more general sampling scheme where the row is sampled according to its squared Euclidean norm, although the proof only applies to the case where only a single row is used for computation at each iteration. Interesting avenues for future work include proving convergence under different sampling rules and rigorously generalizing this method to non-linear optimization problems. Acknowledgements Authors are listed in alphabetical order. Some of the work for this article was done while Longxiu Huang was Assistant Adjunct Professor and Xia Li was a graduate student at UCLA. 18 01234Number of iterations×103105104103102101100101||xjx*||2d0 =2d0 =4d0 =6d0 =801234Number of iterations×103205.0205.5206.0206.5207.0207.5F(x)d0 =2d0 =4d0 =6d0 =8 References [1] Shmuel Agmon. The relaxation method for linear inequalities. Canadian Journal of Mathematics, 6:382–392, 1954. [2] Dan Alistarh, Zeyuan Allen-Zh, and Jerry Li. Byzantine stochastic gradient descent. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Gar- nett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. [3] Zhong-Zhi Bai and Wen-Ting Wu. On partially randomized extended Kaczmarz method for solving large sparse overdetermined inconsistent linear systems. Linear Algebra and Its Applications, 578:225–250, 2019. [4] Zhong-Zhi Bai and Wen-Ting Wu. On greedy randomized augmented Kaczmarz method for solving large sparse inconsistent linear systems. SIAM Journal on Sci- entific Computing, 43(6):A3892–A3911, 2021. [5] Rawad Bitar, Mary Wootters, and Salim El Rouayheb. Stochastic gradient coding for flexible straggler mitigation in distributed learning. pages 1–5, 2019. [6] Yuejie Chi, Yuanxin Li, Huishuai Zhang, and Yingbin Liang. Median-truncated gradi- ent descent: A robust and scalable nonconvex approach for signal estimation. 2019. [7] Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. [8] Jonas Geiping, Liam Fowl, W. Ronny Huang, Wojciech Czaja, Gavin Taylor, Michael Moeller, and Tom Goldstein. Witches' brew: Industrial scale data poisoning via gra- dient matching. Clinical Orthopaedics and Related Research, abs/2009.02276, 2020. [9] Ian Goodfellow, Patrick McDaniel, and Nicolas Papernot. Making machine learning robust against adversarial inputs. Communications of the ACM, 61(7):56–66, Jun 2018. [10] Richard Gordon, Robert Bender, and Gabor T. Herman. Algebraic reconstruction techniques (ART) for three-dimensional electron microscopy and X-ray photography. Journal of Theoretical Biology, 29(3):471–481, 1970. [11] Richard Gordon, Gabor T Herman, and Steven A Johnson. Image reconstruction from projections. Scientific American, 233(4):56–71, 1975. [12] Jamie Haddock, Deanna Needell, Elizaveta Rebrova, and William Swartworth. Quantile-based iterative methods for corrupted systems of linear equations. SIAM Journal on Matrix Analysis and Applications, 43(2):605–637, 2022. [13] Gabor T Herman and Lorraine B Meyer. Algebraic reconstruction techniques can be made computationally efficient (positron emission tomography application). IEEE transactions on medical imaging, 12(3):600–609, 1993. [14] Stefan Kaczmarz. Angen ̈aherte Aufl ̈osung von Systemen linearer Gleichungen. Bulletin International de l'Acad ́emie Polonaise des Sciences et des Lettres, pages 355–357, 1937. 19 [15] Can Karakus, Yifan Sun, Suhas Diggavi, and Wotao Yin. Straggler mitigation in distributed optimization through data encoding. In Advances in Neural Information Processing Systems, NIPS'17, page 5440–5448, 2017. [16] Kalpesh Krishna, Gaurav Singh Tomar, Ankur P. Parikh, Nicolas Papernot, and Mo- hit Iyyer. Thieves on sesame street! model extraction of bert-based apis. Clinical Orthopaedics and Related Research, abs/1910.12366, 2019. [17] Leslie Lamport, Robert Shostak, and Marshall Pease. The Byzantine generals problem. ACM Transactions on Programming Languages and Systems, 4(3):382–401, July 1982. [18] Dennis Leventhal and Adrian S Lewis. Randomized methods for linear constraints: convergence rates and conditioning. Mathematics of Operations Research, 35(3):641– 654, 2010. [19] Anna Ma, Deanna Needell, and Aaditya Ramdas. Convergence properties of the ran- domized extended Gauss–Seidel and Kaczmarz methods. SIAM Journal on Matrix Analysis and Applications, 36(4):1590–1604, 2015. [20] Frank Natterer. The Mathematics of Computerized Tomography. SIAM, 2001. [21] Deanna Needell. Randomized Kaczmarz solver for noisy linear systems. BIT Numerical Mathematics, 50:395–403, 2009. [22] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. [23] Stefania Petra and Constantin Popa. Single projection Kaczmarz extended algorithms. Numerical Algorithms, 73(3):791–806, 2016. [24] Constantin Popa. Characterization of the solutions set of inconsistent least-squares problems by an extended Kaczmarz algorithm. Korean Journal of Computational and Applied Mathematics, 6(1):51–64, 1999. [25] Thomas Strohmer and Roman Vershynin. A randomized Kaczmarz algorithm with exponential convergence. Journal of Fourier Analysis and Applications, 15(2):262, 2009. [26] Xinran Wang, Yu Xiang, Jun Gao, and Jie Ding. Information laundering for model In 9th International Conference on Learning Representations, ICLR 2021, privacy. Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021. [27] Zhixiong Yang and Waheed U Bajwa. ByRDiE: Byzantine-resilient distributed coordi- nate descent for decentralized learning. IEEE Transactions on Signal and Information Processing over Networks, 5(4):611–627, 2019. 20 A Single row convergence without block-list In this section, we present an algorithm and its corresponding theory for a specific case in which only one row (d0 = 1) is utilized for updating the solution at each iteration. Therefore, Nr ≡ N . The algorithm is based on the assumption that the probability of selecting row i ∈ [d1] for the updating process is proportional to the squared length of the corresponding row. Further details can be found in Algorithm 3. We will then proceed to analyze the convergence of Algorithm 3. Algorithm 3 Distributed Randomized Kaczmarz with block-list 1: Input: Initialize block-list B, reliable worker set D = [N ], MaxIter, Tol, Blocklist flag, checking period T . 2: Initialize cs = 2 × Tol, a counter vector E = 0 ∈ RN 3: if Blocklist flag then 4: 5: end if 6: while j < MaxIter and |cs| > Tol, do Initialize block-list B 7: 8: 9: The central worker wc selects a row index ij ∈ [d1] with probability pij = Sample w1, . . . , wn uniformly from D Broadcast Aij to w1, . . . , wn (cid:107)Aij (cid:107)2 2 (cid:107)A(cid:107)2 F , if ws ∈ Cl (cid:104)AT ij ,xi(cid:105)−(bij +e(cid:96)(ij )) 10: 11: (cid:107)Aij (cid:107)2 ws returns cs = wc splits {cs}n satisfy |Gs| ≥ n(1 − p) 12: Update xj+1 = xj + cs0A(cid:62) ij 13: Update E(s) = E(s) + 1, if cs /∈ Gs0 14: if mod(j, T ) = 0 then s=1 into groups G1, . . . , Gk and randomly choose from groups Gs that 15: 16: Update B by checking the value of entries in E D = D \ B end if 17: 18: Update j = j + 1 19: end while 20: Output: xj and B Theorem A.1. Let A ∈ Rd1×d2 with d1 ≥ d2 and b, e1, . . . , ek ∈ Rd1. Assume that we solve Ax∗ = b via Algorithm 3, then E(cid:107)xi − x∗(cid:107)2 2 ≤ αi+1(cid:107)x0 − x∗(cid:107)2 2 + 1 − αi+1 1 − α 1 (cid:107)A(cid:107)2 F k (cid:88) (cid:96)=1 q(cid:96)(cid:107)e(cid:96)(cid:107)2, where α = 1 − σ2 min(A) (cid:107)A(cid:107)2 F , q(cid:96) = ˆq(cid:96) mode q and σmin(A) is the smallest singular value of A. Additionally, if (cid:107)e(cid:96)(cid:107) ≤ C, we have E(cid:107)xi − x∗(cid:107)2 2 ≤ αi+1(cid:107)x0 − x∗(cid:107)2 2 + 1 − αi+1 1 − α Cq0 (cid:107)A(cid:107)2 F . 21 (12) (13) Remark A.2. To provide a quantitative understanding of Theorem A.1, we present several examples in Tables 5 and 6. For simplicity, assume that each error category has the same fraction p(cid:96) = p/k. Thus, all ˆq(cid:96) mode are equal. Here q0 is the probability that the algorithm chooses the right mode and q is the probability that there is a mode. In these two tables, we present the values for ˆq(cid:96) mode, q and q0 by varying the number of error categories k, the number of chosen workers n and the adversarial rate p. These two tables are generated by solving a linear system with a row-normalized matrix A ∈ R1000×100. mode, ˆq0 As k increases, q(cid:96) decreases and q0 increases. Therefore, the error bound in (13) de- creases with respect to k and thus reaches better convergence. When k is large enough, q(cid:96) ≈ 0. Therefore, when the noise is uniformly random error and there is a mode for the step-size, the mode will be the correct mode. As n increases, there is a similar decrease effect and therefore a better convergence. Table 5: Total number of workers N = 100, number of chosen workers n = 5. p 0.8 0.2 k 5 10 15 3 5 10 15 ˆq(cid:96) mode 0.1 0.04 0.02 0.002 8 × 10−4 2 × 10−4 2 × 10−4 ˆq0 mode 0.16 0.21 0.23 0.63 0.65 0.66 0.685 q 0.67 0.57 0.48 0.64 0.65 0.67 0.689 q0 0.15 0.36 0.46 0.98 0.99 0.99 0.99 Table 6: Total number of workers N = 100, number of error categories k = 5. p 0.8 0.2 n 10 15 20 10 15 20 ˆq(cid:96) mode 0.099 0.099 0.097 7 × 10−6 5 × 10−7 1 × 10−7 ˆq0 mode 0.18 0.2 0.23 0.904 0.97 0.99 q 0.67 0.7 0.71 0.90 0.97 0.99 q0 0.26 0.29 0.31 1 − 5 × 10−6 1 − 3 × 10−6 1 − 6 × 10−7 Proof of Theorem A.1. To prove (12), at each iteration, we consider solving Ax = b, Ax = b + e1,. . ., Ax = b + ek with probability q0, q1, * * * , qk, respectively. Therefore, for the (i + 1)-th step, we have the iteration or xi+1 = xi − (cid:104)Aj, xi(cid:105) − bj (cid:107)Aj(cid:107)2 A(cid:62) j , xi+1 = xi − (cid:104)Aj, xi(cid:105) − (bj + e(cid:96)(j)) (cid:107)Aj(cid:107)2 A(cid:62) j . for (cid:96) = 1, * * * , k, Aj is the j-th row of matrix A. 22 Notice that when xi+1 = xi − (cid:104)Aj ,xi(cid:105)−bj (cid:107)Aj (cid:107)2 (Aj)(cid:62), we have Ej(cid:107)xi+1 − x∗(cid:107)2 2 (cid:104)Aj, xi(cid:105) − bj (cid:107)Aj(cid:107)2 (cid:19) =Ej(cid:107)xi − (cid:18) ≤ 1 − σ2 min(A) (cid:107)A(cid:107)2 F (cid:107)xi − x∗(cid:107)2 2. (Aj)(cid:62) − x∗(cid:107)2 2 When xi+1 = xi − (cid:104)Aj ,xi(cid:105)−(bj +e(cid:96)(j)) (cid:107)Aj (cid:107)2 (Aj)(cid:62), we have Ej(cid:107)xi+1 − x∗(cid:107)2 2 =Ej(cid:107)xi − (cid:104)Aj, xi(cid:105) − (bj + e(cid:96)(j)) (cid:107)Aj(cid:107)2 2 A(cid:62)(j, :) − x∗(cid:107)2 2 (cid:18) ≤ 1 − (cid:18) = 1 − (cid:19) σ2 min(A) (cid:107)A(cid:107)2 F σ2 min(A) (cid:107)A(cid:107)2 F (cid:107)xi − x∗(cid:107)2 2 + Ej (cid:19) (cid:107)xi − x∗(cid:107)2 2 + e2 (cid:96) (j) (cid:107)Aj(cid:107)2 2 (cid:107)e(cid:96)(cid:107)2 (cid:107)A(cid:107)2 F . Combining (14) and (15), we have Ej(cid:107)xi+1 − x∗(cid:107)2 2 (cid:19) (cid:18) σ2 min(A) (cid:107)A(cid:107)2 F ≤ 1 − (cid:107)xi − x∗(cid:107)2 2 + 1 (cid:107)A(cid:107)2 F k (cid:88) (cid:96)=1 q(cid:96)(cid:107)e(cid:96)(cid:107)2. Set α = 1 − σ2 min(A) (cid:107)A(cid:107)2 F . Therefore, E(cid:107)xi+1 − x∗(cid:107)2 2 ≤αi+1(cid:107)x0 − x∗(cid:107)2 2 + 1 − αi+1 1 − α 1 (cid:107)A(cid:107)2 F k (cid:88) (cid:96)=1 q(cid:96)(cid:107)e(cid:96)(cid:107)2. (14) (15) (16) (17) B Discussion of the optimal number of used rows Assume that row r is distributed to Nr workers and nr workers are selected to involve in the computation of row r with Nr ≡ N, nr ≡ n for all r. Additionally, we assume that the probability of each error category (cid:96) ((cid:96) (cid:54)= 0) for each row is the same with pr,(cid:96) ≡ p/k. Moreover, we have the restricted minimal mode number g0(r) ≡ g0 = max((cid:100) n k+1 (cid:101), (cid:100)n(1 − 23 p)(cid:101)), and g ≡ bg, coefficient of term xn of br   g−1 (cid:88) g,(cid:96) ≡ ag, coefficient of term xn−g of ar  j=0 (cid:0)N p/k g (cid:0)N n (cid:1)ag (cid:1) , qr g ≡ qg = Q(r, τi) ≡ n (cid:88) g=g0 qg (cid:18) bg/ (cid:18)N n (cid:19)(cid:19)d0−1 = Qmax = Qmin := Q, (cid:18)N p/k j (cid:19) xj  k−1    g−1 (cid:88) g−1 (cid:88) (cid:18)N p/k j (cid:19) xj j=0  k−1  , j=0  (cid:19) (cid:18)N (1 − p) j  xj  , (18) βr = d0 d1 Qmax. Let α(d0) = α = 1 − Q d0 d1 consider min( ̃A). To study the relation between d0 and the convergence, σ2 ∂α(d0) ∂d0 ∝ − n (cid:88) g=g0 (cid:18) (cid:18) qg 1 + d0 log bg/ (cid:18)N n (cid:19)(cid:19)(cid:19) (cid:18) bg/ (cid:18)N n (cid:19)(cid:19)d0−1 . (19) If d0 ≥ − increases. When g0 = n, we have 1 log(bg/(N for all g, then ∂α(d0) ∂d0 n)) ≥ 0. This implies that as d0 increases, α(d0) ∂α(d0) ∂d0 (cid:18) (cid:18) ∝ − 1 + d0 log bn (cid:18)N (cid:14) n (cid:19)(cid:19)(cid:19) (cid:18) bn (cid:18)N (cid:14) n (cid:19)(cid:19)d0−1 , and to reach the fastest convergence rate, d0 = − for α in more general cases, where multiple local minimizers could present in the landscape. . One can explore the minimizers n)) 1 log(bg/(N C Proof of Lemma 3.1 Proof of Lemma 3.1. Given a row r, the number of combinations where the mode belongs to category (cid:96) with mode count g can be divided into two parts: the combinations of workers in category (cid:96) and the combinations of workers in all other categories excluding (cid:96). We start by calculating the number of combinations of workers in the remaining cate- gories. This is equivalent to selecting (nr − g) balls from k bins subject to constraints that the ̃(cid:96)-th bin contains Nrpr, ̃(cid:96) balls, with a maximum of g balls that can be chosen from this (cid:1) ways to choose j balls from bin bin for all ̃(cid:96) (cid:54)= (cid:96). With these constraints, there are (cid:0)Nrpr, ̃(cid:96) ̃(cid:96). By letting j vary and considering the k bins, the total number of valid combinations is (cid:1)xj. The equal to the coefficient of the term xnr−g in the polynomial j (cid:80)g−1 j=0 (cid:0)Nrpr, ̃(cid:96) j k (cid:81) ̃(cid:96)=0, ̃(cid:96)(cid:54)=(cid:96) number of combinations of workers in category (cid:96) with mode count g is (cid:0)Nrpr,(cid:96) total number of combinations is given by (cid:0)Nr nr (cid:1). This concludes the proof of Lemma 3.1. (cid:1). Finally, the g 24
http://arxiv.org/abs/2302.12383v2
2023-02-28T02:42:06
2023-02-24T01:03:56
Generalization Analysis for Contrastive Representation Learning
Recently, contrastive learning has found impressive success in advancing the state of the art in solving various machine learning tasks. However, the existing generalization analysis is very limited or even not meaningful. In particular, the existing generalization error bounds depend linearly on the number $k$ of negative examples while it was widely shown in practice that choosing a large $k$ is necessary to guarantee good generalization of contrastive learning in downstream tasks. In this paper, we establish novel generalization bounds for contrastive learning which do not depend on $k$, up to logarithmic terms. Our analysis uses structural results on empirical covering numbers and Rademacher complexities to exploit the Lipschitz continuity of loss functions. For self-bounding Lipschitz loss functions, we further improve our results by developing optimistic bounds which imply fast rates in a low noise condition. We apply our results to learning with both linear representation and nonlinear representation by deep neural networks, for both of which we derive Rademacher complexity bounds to get improved generalization bounds.
[ "Yunwen Lei", "Tianbao Yang", "Yiming Ying", "Ding-Xuan Zhou" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12383v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12383v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
Generalization Analysis for Contrastive Representation Learning Yunwen Lei1 Tianbao Yang2 Yiming Ying3∗ Ding-Xuan Zhou4 1Department of Mathematics, Hong Kong Baptist University 2Department of Computer Science and Engineering, Texas A&M University 3Department of Mathematics and Statistics, State University of New York at Albany 4School of Mathematics and Statistics, University of Sydney [email protected] [email protected] [email protected] [email protected] March 1, 2023 Abstract Recently, contrastive learning has found impressive success in advancing the state of the art in solving various machine learning tasks. However, the existing generalization analysis is very limited or even not meaningful. In particular, the existing generalization error bounds depend linearly on the number k of negative examples while it was widely shown in practice that choosing a large k is necessary to guarantee good generalization of contrastive learning in downstream tasks. In this paper, we establish novel generalization bounds for contrastive learning which do not depend on k, up to logarithmic terms. Our analysis uses structural results on empirical covering numbers and Rademacher complexities to exploit the Lipschitz continuity of loss functions. For self-bounding Lipschitz loss functions, we further improve our results by developing optimistic bounds which imply fast rates in a low noise condition. We apply our results to learning with both linear representation and nonlinear representation by deep neural networks, for both of which we derive Rademacher complexity bounds to get improved generalization bounds. 1 Introduction The performance of machine learning (ML) models often depends largely on the representation of data, which motivates a resurgence of contrastive representation learning (CRL) to learn a representa- Rd from unsupervised data [11, 20, 23]. The basic idea is to pull together similar tion function f : pairs (x, x+) and push apart disimilar pairs (x, x−) in an embedding space, which can be formulated as minimizing the following objective [11, 32] X 7→ 3 2 0 2 b e F 8 2 ] G L . s c [ 2 v 3 8 3 2 1 . 2 0 3 2 : v i X r a Ex,x+, x− { i } k i=1 k log 1 + exp f (x)⊤ f (x+) − f (x−i ) − , (cid:1)(cid:17)(cid:17) (cid:16) where k is the number of negative examples. The hope is that the learned representation f (x) would capture the latent structure and be beneficial to other downstream learning tasks [3, 40]. CRL has achieved impressive empirical performance in advancing the state-of-the-art performance in various domains such as computer vision [10, 10, 11, 20] and natural language processing [8, 15, 33]. (cid:16) (cid:0) i=1 X ∗Corresponding author 1 Assumption Arora et al.'19 Ours low noise O (cid:16) O k√d √n k√d √n (cid:17) O √d √n (cid:16) O e d n (cid:17) (cid:16) Table 1: Comparison between our generalization bounds and those in Arora et al. [3] for the logistic (cid:17) (cid:16) (cid:17) e loss. Here d is the number of learned features. The notation O ignores log factors. The empirical success of CRL motivates a natural question on theoretically understanding how the e learned representation adapts to the downstream tasks, i.e., How would the generalization behavior of downstream ML models benefit from the representation function built from positive and negative pairs? Especially, how would the number of negative examples affect the learning performance? Arora et al. [3] provided an attempt to answer the above questions by developing a theoretical framework to study CRL. They first gave generalization bounds for a learned representation function in terms of Rademacher complexities. Then, they showed that this generalization behavior measured by an unsupervised loss guarantees the generalization behavior of a linear classifier in the downstream classification task. However, the generalization bounds there enjoy a linear dependency on k, which would not be effective if k is large. Moreover, this is not consistent with many studies which show a large number of negative examples [11, 21, 23, 38] is necessary for good generalization performance. For example, the work [20] used 65536 negative examples in unsupervised visual representation learning, (65536)2d training examples to get non-vacuous bounds [3]. for which the existing analysis requires n Therefore, the existing analysis does not fully answer the question on the super performance of CRL to downstream tasks as already shown in many applications. Yuan et al. [45] has demonstrated the benefits using all negative data for each anchor data for CRL and proposed an efficient algorithms for optimizing global contrastive loss. Therefore, the existing analysis does not fully answer the question on the super performance of CRL to downstream tasks as already shown in many applications. ≥ In this paper, we aim to further deepen our understanding of CRL by fully exploiting the Lipschitz ∞ continuity of loss functions. Our contributions are listed as follows. 1. We develop generalization error bounds for CRL. We consider three types of loss functions: l2- Lipschitz loss, l -Lipschitz loss and self-bounding Lipschitz loss. For l2-Lipschitz loss, we develop a generalization bound with a square-root dependency on k by two applications of vector-contraction lemmas on Rademacher complexities, which improves the existing bound by a factor of √k [3]. For l - ∞ Lipschitz loss, we develop generalization bounds which does not depend on k, up to some logarithmic terms, by approximating the arguments of loss functions via expanding the original dataset by a factor of k to fully exploit the Lipschitz continuity. For self-bounding Lipschitz loss, we develop optimistic bounds involving the training errors, which can imply fast rates under a low noise setting. All of our generalization bounds involve Rademacher complexities of feature classes, which preserve the coupling among different features. learn- 2. We then apply our general result to two unsupervised representation learning problems: ing with linear features and learning with nonlinear features via deep neural networks (DNNs). For learning with linear features, we consider two regularization schemes, i.e., p-norm regularizer and Schatten-norm regularizer. For learning with nonlinear features, we develop Rademacher complexity and generalization bounds with a square-root dependency on the depth of DNNs. To this aim, we adapt the technique in Golowich et al. [16] by using a different moment generalization function to capture the coupling among different features. 3. Finally, we apply our results on representation learning to the generalization analysis of downstream classification problems, which outperforms the existing results by a factor of k (ignoring a log factor). The remaining parts of the paper are organized as follows. Section 2 reviews the related work, and Section 3 provides the problem formulation. We give generalization bounds for CRL in Section 4 for three types of loss functions, which are then applied to learning with both linear and nonlinear features in Section 5. Conclusions are given in Section 6. 2 2 Related Work The most related work is the generalization analysis of CRL in Arora et al. [3], where the authors developed generalization bounds for unsupervised errors in terms of Rademacher complexity of repre- sentation function classes. Based on this, they further studied the performance of linear classifiers on the learned features. In particular, they considered the mean classifier where the weight for a class label is the mean of the representation of corresponding inputs. A major result in Arora et al. [3] is to show that the classification errors of the mean classifier can be bounded by the unsupervised errors of learned representation functions. This shows that the downstream classification task can benefit from a learned representation function with a low unsupervised error. The above work motivates several interesting theoretical study of CRL. Nozawa et al. [31] studied CRL in a PAC-Bayesian setting, which aims to learn a posterior distribution of representation functions. Nozawa et al. [31] derived PAC-Bayesian bounds for the posterior distribution and applied it to get PAC-Bayesian bounds for the mean-classifier, which relaxes the i.i.d. assumption. Negative examples in the framework [3] are typically taken to be randomly sampled datapoints, which may actually have the same label of the point of interest. This introduces a bias in the objective function of CRL, which leads to performance drops in practice. Motivated by this, Chuang et al. [12] introduced a debiased CRL algorithm by building an approximation of unbiased error in CRL, and developed generalization guarantees for the downstream classification. k f (X1) k Several researchers studied CRL from other perspectives. Lee et al. [24] proposed to learn a rep- resentation function f to minimize E(X1,X2)[ 2 2], where X1, X2 are unlabeled input and X2 − pretext target. Under an approximate conditional independency assumption, the authors showed that a linear function based on the learned representation approximates the ground true predictor on down- stream problems. In a generative modeling setup, Tosh et al. [41] proposed to learn representation functions by a landmark embedding procedure, which can reveal the underlying topic posterior in- formation. Tosh et al. [40] studied CRL in a multi-view setting with two views available for each datum. Under an assumption on the redundancy between the two views, the authors showed that low-dimensional representation can achieve near optimal downstream performance with linear mod- els. HaoChen et al. [19] studied self-supervised learning from the perspective of spectral clustering based on a population augmentation graph, and proposed a spectral contrastive loss. They further developed generalization bounds for both representation learning and the downstream classification. This result is improved in a recent work by developing a guarantee to incorporate the representation function class [35]. There are also recent work on theoretical analysis of representation learning via gradient-descent dynamics [24, 39], mutual information [42], alignment of representations [43], and causality [29]. CRL is related to metric learning, for which generalization bounds have been studied in the literature [9]. 3 Problem Formulation X Let form of pairs (x, x+) drawn from a distribution a distribution representation functions norm. Here d Dneg unrelated to x. Our aim is to learn a feature map f : R f : N denotes the number of features. denote the space of all possible datapoints. In CRL, we are given several similar data in the Dsim and negative data x−1 , x−2 , . . . , x−k drawn from Rd from a class of k * k2 denotes the Euclidean for some R > 0, where Dsim and the distribution we assume there is a probability , which quantifies the relevance of x to the class c. We assume there is a We follow the framework in Arora et al. [3] to define the distribution denote the set of all latent classes and for each class c Dc over Dneg. Let C distribution probability distribution ρ defined over . Then we define ) k2 ≤ X 7→ f ( * = F X ∈ (cid:8) (cid:9) k Dneg(x−) as follows Dc(x) Dc(x−) (cid:2) ρ ∼ (cid:3) (cid:2) Dsim(x, x+) measures the probability of x and x+ being drawn from the same class c Dneg(x−) measures the probability of drawing an un-relevant x−. Let (xj, x+ j ) ρ, ∼ Dsim and , where k denotes the number of negative examples. We 1, . . . , n [n] := ∼ ρ Intuitively, while (x−j1, . . . , x−jk) ∼ Dneg, j ∈ { } ∈ C Dsim(x, x+) and Dc(x+) . (cid:3) , C Dsim(x, x+) = Ec Dneg(x−) = Ec ∼ 3 collect these training examples into a dataset S = (x1, x+ 1 , x−11, . . . , x−1k), (x2, x+ 2 , x−21, . . . , x−2k), . . . , (xn, x+ n , x−n1, . . . , x−nk) . (3.1) n o Given a representation function f , we can measure its performance by building a classifier based on this representation and computing the accuracy of the classifier. To this aim, we define a (K + 1)-way supervised task . The examples for this supervised task are drawn by the following process: consisting of distinct classes T { = ∈ T We first draw a label c , after which we draw an example x from (x, c) = Dc. This defines the following distribution over labeled pairs (x, c): RK+1 Dc(x) (c). Since there is a label for each example, we can build a multi-class classifier g : DT , where gc(x) measures the "likelihood" of assigning the class label c to the example x. The loss for T R+. of g on a point (x, y) by the supervised loss. By minimizing We quantify the performance of a classifier g on the task (cid:0)(cid:8) the supervised loss, we want to build a classifier whose component associated to the correct label is largest. DT X 7→ , where ls : RK can be measured by ls g(x)y − T ∈ X × T g(x)y′ over }y′ DT 7→ =y T (cid:1) c1, . . . , cK+1} ⊆ C from a distribution { c1, . . . , cK+1} Definition 3.1 (Supervised loss). Let g : of g is defined as RK+1 be a multi-class classifier. The supervised loss X 7→ Lsup( T , g) := E(x,c) T ∼D g(x)c − g(x)c′ c′ =c ls h . (cid:1)i (cid:9) (cid:0)(cid:8) For CRL, we often consider g as a linear classifier based on the learned representation f , i.e., d. Then the performance of the representation function f (x) can g(x) = W f (x), where W be quantified by the accuracy of the best linear classifier on the representation f (x): R(K+1) ∈ × Lsup( T , f ) = W ∈ min R(K+1)×d Lsup( T , W f ). To find a good representation f based on unsupervised dataset S, we need to introduce the concept R+ be a loss function for which popular choices include of unsupervised loss functions. Let l : Rk the hinge loss 7→ l(v) = max 0, 1 + max and the logistic loss (cid:8) l(v) = log 1 + Let f (x)⊤ denote the transpose of f (x). (cid:0) [k] Xi ∈ [k]{− i ∈ vi} (cid:9) exp( − vi) . (cid:1) (3.2) (3.3) Definition 3.2 (Unsupervised error). The population unsupervised error is defined as Lun(f ) := E l f (x)⊤(f (x+) The empirical unsupervised error with S is defined as (cid:2) (cid:0)(cid:8) f (x−i )) k i=1 . − (cid:9) (cid:1)(cid:3) ˆLun(f ) := 1 n n j=1 X l f (xj )⊤(f (x+ j ) f (x−ji)) k i=1 . − A natural algorithm is to find among (cid:0)(cid:8) the function with the minimal empirical unsupervised loss, ˆLun(f ). This function can then be used for the downstream supervised learning F (cid:9) (cid:1) i.e., ˆf := arg minf task, e.g., to find a linear classifier g(x) = W f (x) indexed by W ∈F R(K+1) d. × ∈ 4 Generalization Error Bounds In this paper, we are interested in the performance of ˆf on testing, i.e., how the empirical behavior of ˆf on S would generalize well to testing examples. Specifically, we will control Lun( ˆf ) ˆLun( ˆf ). Since ˆf depends on the dataset S, we need to control the uniform deviation between population unsupervised , which depends on the complexity of error and empirical unsupervised error over the function class − . In this paper, we will use Rademacher complexity to quantify the complexity of F [6]. F F 4 6 6 Definition 4.1 (Rademacher Complexity). Let be a class of real-valued functions over a space F zi} { ) = Eǫ n i=1 ⊆ Z supf . The empirical Rademacher complexity of and S = as R e S( e variables. We define the worst-case Rademacher complexity as R S e , where ǫ = (ǫi)i ∈ is the cardinality of [n] ǫif (zi) F [n] ∼ {± e ,n( P e F i ∈ S. F 1 n e (cid:2) (cid:3) Z ∈ F | | For any f e , we introduce gf : e ∈ F k+2 X 7→ R as follows with respect to (w.r.t.) Z S is defined n are independent Rademacher } ), where ) = sup e S e R e S( =n 1 : e S | ⊆Z | F e e gf (x, x+, x−1 , . . . , x−k ) = l f (x)⊤ f (x+) It is then clear that (cid:0)(cid:8) (cid:0) f (x−i ) − k i=1 . (cid:1)(cid:9) (cid:1) Lun(f ) − ˆLun(f ) = Ex,x+,x− 1 ,...,x− k (cid:2) gf (xj , x+ j , x−j1, . . . , x−jk). 1 n gf (x, x+, x−1 , . . . , x−k ) [n] Xj (cid:3) ∈ ˆLun( ˆf ) by RS( G − − gf (x, x+, x−1 , . . . , x−k ) : f . ∈ F Results in learning theory show that we can bound Lun( ˆf ) ) [6], where = (x, x+, x−1 , . . . , x−k ) G involve the nonlinear function l : Rk 7→ (cid:8) G R+, which introduces difficulties in the Note functions in complexity analysis. Our key idea is to use the Lipschitz continuity of l to reduce the complexity of to the complexity of another function class without l. Since the arguments in l are vectors, we G can have different definition of Lipschitz continuity w.r.t. different norms [14, 25, 26, 37]. For any a = (a1, . . . , ak) 1, we define the lp-norm as Rk and p 7→ (cid:9) p 1 ∈ ≥ k a kp = ai| R+ is G-Lipschitz w.r.t. the lp-norm iff (cid:0) P p . (cid:1) n i=1 | Definition 4.2 (Lipschitz continuity). We say l : Rk l(a) | − l(a′) | ≤ a G k − a′ a, a′ ∀ ∈ Rk. 7→ kp, the l 1-Lipschitz continuous w.r.t. ∞ In this paper, we are particularly interested in the Lipschitz continuity w.r.t. either the l2-norm or -norm. According to Proposition F.1, the loss functions defined in Eq. (3.2) and Eq. (3.3) are Note each component of the arguments in l are of the form f (x)⊤(f (x+) f (x−)). This motivates , and 1-Lipschitz continuous w.r.t. k * k∞ k * k2 [26]. − the definition of the following function class = hf (x, x+, x−) = f (x)⊤ f (x+) f (x−) : f − . ∈ F H n As we will see in the analysis, the complexity of show how to control the complexity of bounds of prove it [28]. The basic idea is to notice the Lipschitz continuity of the map (x, x+, x−) w.r.t. . Therefore, we first . In the following lemma, we provide Rademacher complexity w.r.t. a general dataset S′ of cardinality n. We will use a vector-contraction lemma to x−) 3. The proof is given in Section A. x⊤(x+ 7→ H H − G o (cid:0) is closely related to that of (cid:1) N and S′ = (xj, x+ j , x−j ) : j { [n] } ∈ . Assume f (x) k2 ≤ k ∈ R for any f and ∈ F H k * k2 on Lemma 4.3. Let n x S′. Then X ∈ RS′ ( H ) ≤ √12R n Eǫ n 1 } ∼{± ×{± d 1 } ×{± 1 3 } h where ft(x) is the t-th component of f (x) sup f ∈F Xj ∈ Rd. ∈ ǫj,t,1ft(xj) + ǫj,t,2ft(x+ j ) + ǫj,t,3ft(x−j ) , (cid:17)i [n] Xt ∈ [d] (cid:16) Remark 4.4. We compare Lemma 4.3 with the following Rademacher complexity bound in HaoChen et al. [19] Eǫ ∼{±} n sup f [n] ∈F Xj ∈ h ǫjf (xj)⊤f (x+ j ) i ≤ d max [d] t ∈ Eǫ ∼{±} sup ft t ∈F n h [n] Xj ∈ ǫjft(xj)ft(x+ j ) i , (4.1) 5 where bound Ft = x 7→ ft(x) : f ∈ F (cid:8) (cid:9) . As a comparison, our analysis in Lemma 4.3 can imply the following Eǫ ∼{±} n sup f [n] ∈F Xj ∈ h ǫjf (xj)⊤f (x+ j ) i ≤ 2RE ǫ 2nd ∼{±} sup f ∈F Xj ∈ [d] [n] Xt ∈ h (cid:0) ǫj,t,1ft(xj ) + ǫj,t,2ft(x+ j ) . (cid:1)i Eq. (4.1) decouples the relationship among different features since the maximization over t [d] is outside of the expectation operator. As a comparison, our result preserves this coupling since the summation over t [d] is inside the supermum over f on the bound. Indeed, it is expected that ∈ . This preservation of coupling has an effect ∈ F E ǫ 2nd ∼{±} sup f ∈F Xj ∈ [d] [n] Xt ∈ h ǫj,t,1ft(xj) + ǫj,t,2ft(x+ j ) = (cid:0) (cid:1)i √dEǫ ∼{±} O (cid:16) 2n h sup ft ∈F t ǫj,1ft(xj) + ǫj,2ft(x+ j ) . [n] Xj ∈ (cid:0) (cid:1)i(cid:17) In this case, our result implies a bound with a better dependency on d as compared to Eq. (4.1) (the factor of d in Eq. (4.1) is replaced by √d here). We can plug our bound into the analysis in HaoChen et al. [19] to improve their results. ∈ Remark 4.5. Lemma 4.3 requires an assumption by adding a projection operator as f (x) = R. This assumption can be achieved PR denotes the projection operator onto the Euclidean ball with radius R around the zero point. According to the inequality kPR( ̃f (x)) k2, the arguments in the proof indeed show the following inequality with f (x) k2 ≤ k PR( ̃f (x)) for ̃f , where ̃f (x) ∈ F : ̃f ′(x) PR( ̃f (x))⊤ − PR( ̃f ′(x)) = H k2 ≤ k − h ̃f (x, x+, x−) = (cid:8) √12R n Eǫ ∼{± } 1 RS′ ( ) H sup ̃f ∈F Xj ∈ That is, we can add a projection operator over ≤ 3nd h [n] Xt ∈ [d] (cid:16) PR( ̃f (x+)) (cid:0) − PR( ̃f (x−)) (cid:1) j ) + ǫj,t,3 ̃ft(x−j ) ǫj,t,1 ̃ft(xj) + ǫj,t,2 ̃ft(x+ ∈ F : ̃f (cid:9) . (cid:17)i to remove the assumption f (x) k2 ≤ k R. F Loss Arora et al.'19 1-l2-Lipschitz 1-l ∞ -Lipschitz S.B. 1-Lipschitz √kB n √kB n Ours A n C n√k ∗ n− 1 +n− 2k− 1C2+(n− 1 2 + n− 1k− 1 2 C) ˆL 1 2 un(f )∗ Table 2: Comparison between our generalization bounds and those in Arora et al. [3]. The notation ∗ means we ignore log factors. S.B. means self-bounding. The notations A, B and C are defined in Eq. (4.2), (4.4) and (4.5), which are typically of the same order. Then, our results improve the bounds in Arora et al. [3] by a factor of √k for l2-Lipschitz loss, and by a factor of k for l self-bounding loss, we get optimistic bounds. -Lipscthiz loss. For ∞ 4.1 l2 Lipschitz Loss We first consider l2 Lipschitz loss. The following theorem to be proved in Section A gives Rademacher complexity and generalization error bounds for unsupervised loss function classes. We always assume l in this paper. B for any f f (x)⊤(f (x+) f (x−i )) k i=1 − ≤ ∈ F (cid:0)(cid:8) (cid:9) (cid:1) 6 ≤ A = E Theorem 4.6 (Generalization bound: l2-Lipschitz loss). Assume x RS( G . Let S be defined as in Eq. (3.1). If l : Rk √24RG2A n ∈ X ) , where 7→ and R+ is G2-Lipschitz w.r.t. the l2-norm, then R for any f k2 ≤ ∈ F f (x) k {ǫ }∼{± 3nkd E } 1 h sup f ∈F Xj ∈ [n] Xi ∈ [k] Xt ∈ [d] (cid:16) ǫj,i,t,1ft(xj) + ǫj,i,t,2ft(x+ j ) + ǫj,i,t,3ft(x−ji) . (4.2) (cid:17)i Furthermore, for any δ f ∈ F (0, 1), with probability at least 1 − ∈ δ the following inequality holds for any Lun(f ) − ˆLun(f ) 4√6RG2A n ≤ + 3B log(2/δ) 2n . r Remark 4.7. Under the same Lipschitz continuity w.r.t. k * k2, the following bound was established in Arora et al. [3] where B = Eǫ n 1 } ∼{± ×{± Lun(f ) = ˆLun(f ) + O G2R√kB n log(1/δ) n + B r , (cid:17) (cid:16) (4.3) d 1 k+2 1 } ×{± } sup f ∈F Xj ∈ [n] Xt ∈ [d] (cid:16) h ǫj,t,k+1ft(xj )+ǫj,t,k+2ft(x+ j )+ ǫj,t,kft(x−ji) . (4.4) [k] Xi ∈ (cid:17)i Note A and B are of the same order. Therefore, it is clear that our bound in Theorem 4.6 improves the bound in Arora et al. [3] by a factor of √k. 4.2 l ∞ Lipschitz Loss We now turn to the analysis for the setting with l challenging. The following theorem controls the Rademacher complexity of terms of the worst-case Rademacher complexity of defined on the set S G , where H H ∞ Lipschitz continuity assumption, which is more w.r.t. the dataset S in = S H (x1, x+ 1 , x−11), (x1, x+ 1 , x−12), . . . , (x1, x+ 1 , x−1k) , (x2, x+ 2 , x−21), (x2, x+ 2 , x−22), . . . , (x2, x+ 2 , x−2k) , . . . , n | induced by the first example induced by the second example {z (xn, x+ } | n , x−n1), (xn, x+ n , x−n2), . . . , (xn, x+ {z n , x−nk) induced by the last example } . o , the function class As compared to basic idea is to exploit the Lipschitz continuity of l w.r.t. l(v1(y), . . . , vk(y)) { } expand the set S of cardinality n to the set S removes the loss function l and is easier to handle. Our : to approximate the function class [k]. This explains why we k * k∞ ∈ of cardinality nk. The proof is given in Section B. , it suffices to approximate each component vj(y), j H G {z } | H Theorem 4.8 (Complexity bound: l x . Let S be defined as in Eq. (3.1). If l : Rk ∞ -Lipschitz loss). Assume f (x) R for any f and k R+ is G-Lipschitz w.r.t. the l k2 ≤ ∈ F -norm, then ∈ X 7→ RS( G ) ≤ 24G(R2 + 1)n− 1 2 + 48G√kRSH,nk( H ) × where RSH,nk( H ) = max j , ̃x− j ) ( ̃xj , ̃x+ j∈[nk]⊆ Eǫ ∼{± SH nk 1 } sup h ∈H h (cid:18) 1 nk Note in RSH,nk( (cid:8) ) we restrict the domain of functions in H (cid:9) be chosen several times in the above maximization. We can use Lemma 4.3 to control RSH,nk( H error bound. The proof is given in Section B. 1 + log(4R2n 3 2 k) log2 ∞ R2√n 12 , m(cid:19) l ǫjf ( ̃xj)⊤(f ( ̃x+ j ) − . f ( ̃x−j )) i , and allow an element in S to H [nk] Xj ∈ to S H H ) in Theorem 4.8, and derive the following generalization 7 Theorem 4.9 (Generalization bound: l w.r.t. k * k∞ . Assume f (x) k2 ≤ k R, δ ∈ we have -Lipschitz loss). Let l : Rk ∞ (0, 1). Then with probability at least 1 7→ R+ be G-Lipschitz continuous δ over S for all f − ∈ F Lun(f ) ≤ ˆLun(f ) + 3B log(2/δ) 2n r + 48G(R2 + 1)n− 1 2 + where 96√12GR n√k (cid:18) 1 + log(4R2n 3 2 k) log2 l R2√n 12 C, m(cid:19) C = { ( ̃xj, ̃x+ max j , ̃x− j ) } Eǫ ∼{± nk j=1⊆ SH nk 1 } d 1 ×{± } ×{± 1 3 } sup f ∈F Xj ∈ [d] [nk] Xt ∈ h (cid:0) ǫj,t,1ft( ̃xj )+ǫj,t,2ft( ̃x+ j )+ǫj,t,3ft( ̃x−j ) . (cid:1)i (4.5) Remark 4.10. We now compare our bound with Eq. (4.3) developed in Arora et al. [3]. It is reasonable to assume C and B are of the same order. 1 Then, our bound becomes Lun(f ) = ˆLun(f ) + O GRB log2(nRk) n√k log(1/δ) n + B r . (4.6) (cid:16) We know if l is G2-Lipschitz continuous w.r.t. . k * k∞ Therefore, in the extreme case we have G = √kG2. Even in this extreme case, our bound is of the order Lun(f ) = ˆLun(f ) + O , which improves Eq. (4.3) by a factor of q √k up to a logarithmic factor. For popular loss functions defined in Eq. (3.2) and Eq. (3.3), we have G = G2 = 1 and in this case, our bound in Eq. (4.6) improves Eq. (4.3) by a factor of k if we ignore a logarithmic factor. k * k2, it is also √kG2-Lipschitz continuous w.r.t. G2RB log2(nRk) n log(1/δ) n + B (cid:17) (cid:17) (cid:16) 4.3 Self-bounding Lipschitz Loss Finally, we consider a self-bounding Lipschitz condition where the Lipschitz constant depends on the loss function values. This definition was given in Reeve & Kaban [34]. Definition 4.11 (Self-bounding Lipschitz Continuity). A loss function l : Rk Gs-self-bounding Lipschitz continuous w.r.t. l norm if for any a, a′ Rk R+ is said to be 7→ ∞ l(a) − l(a′) ≤ Gs max l(a), l(a′) 1 2 a k − . k∞ (cid:12) (cid:12) (cid:9) It was shown that the logistic loss given in Eq. (3.3) satisfies the self-bounding Lipschtiz continuity with Gs = 2 [34]. In the following theorem, we give generalization bounds for learning with self- bounding Lipschitz loss functions. The basic idea is to replace the Lipschitz constant G in Theorem O to hide logarithmic factors. 4.9 with empirical errors by using the self-bounding property. We use The proof is given in Section C. (cid:8) (cid:12) (cid:12) Theorem 4.12 (Generalization bound: self-bounding Lipschitz loss). Let l : Rk bounding Lipschitz continuous w.r.t. R+ be Gs-self- (0, 1). Then with probability at . Assume f (x) R, δ 7→ ∈ k * k∞ δ over S we have the following inequality uniformly for all f k k2 ≤ least 1 − Lun(f ) = ˆLun(f ) + O (B + G2 sR4)n− 1 + G2 sR2n− 2k− 1C2 + O 1Indeed, under a typical behavior of Rademacher complexity as Eǫ∼{±}n supa∈A⊂Rn (cid:2)ǫiai(cid:3) = O(√n) [6], we have e (√B + GsR2)n− (cid:16) 2 + GsRn− un(f ). 1k− (cid:17) e 1 2 C 1 2 ˆL (cid:17) (cid:16) C = O(√nkd) and B = O(√nkd). ∈ a′ e 1 ∈ F 8 Remark 4.13. Theorem 4.12 gives optimistic generalization bounds in the sense that the upper bounds ˆLun(f ) would un(f ) = 0, Theorem 4.12 implies generalization depend on empirical errors [36]. Therefore, the generalization bounds for Lun(f ) benefit from low training errors. In particular, if ˆL bounds − 1 2 Lun(f ) = ˆLun(f )+ O Bn− 1 +G2 sR4n− 1+G2 sR2n− 2k− 1C2 . Typically, we have C = O(√nk) and in this case Lun(f ) = ˆLun(f ) + words, we get fast-decaying error bounds in an interpolating setting. e (cid:16) O Bn− (cid:17) 1 + G2 sR4n− 1 . In other (cid:0) e (cid:1) 5 Applications 7→ ∈ X d′ U v(x), where U × to an intermediate feature in Rd′ To apply Theorem 4.6 and Theorem 4.9, we need to control the term A or C, which is related to the Rademacher complexity of a function class. In this section, we will show how to control C for features of the form x . Here v maps the original data is a matrix and v : , which is used for all the final features. If v is the identity x map, then we get linear features. If v is a neural network, then we get nonlinear features. For a norm its dual norm. The following lemmas to be proved in Section D k * k give general results on Rademacher complexities. Lemma 5.1 gives upper bounds, while Lemma 5.2 gives lower bounds. It is immediate to extend our analysis to control A. For brevity we ignore such a discussion. on a matrix, we denote by k * k∗ X 7→ Rd′ Rd ∈ Lemma 5.1 (Upper bound). Let d, d′ = f (x) = U v(x) : U , v { F f (x) = U v(x) = (u1, . . . , ud)⊤v(x). Then ∈ V} ∈ U N. Let = ∈ , where U be a class of functions from V U = (u1, . . . , ud)⊤ d′ Rd × : k ∈ X U ⊤ to Rd′ Λ k ≤ . Let and (cid:8) Eǫ ∼{± 1 } nd sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫj,tft(xj) ΛEǫ ≤ ∼{± 1 nd sup v } [n] (cid:0) Xj ∈V (cid:13) (cid:13) ∈ Lemma 5.2 (Lower bound). If F is symmetric in the sense that f ǫ1,jv(xj ), . . . , ǫd,jv(xj ) (cid:9) . [n] Xj ∈ f − implies ∗ (cid:1)(cid:13) (cid:13) , then we have ∈ F ∈ F C ≥ r nk 2 sup f ∈F max ( ̃x, ̃x+, ̃x−) ∈ SH (cid:16) f ( ̃x) k k 2 2 + f ( ̃x+) k k 2 2 + f ( ̃x−) k k 2 2 1 2 . (cid:17) 5.1 Linear Features W ≥ [d′] k tures. For any p k2,p = 1 and a matrix W = (w1, . . . , wd′) wik We first apply Lemma 5.1 to derive Rademacher complexity bounds for learning with linear fea- , the l2,p norm of W is defined as 1, the kF . For any p is defined as the lp-norm of the vector of singular values (W ))⊤ (the singular values are assumed to be sorted in non-increasing order), kp. Let p∗ be the number satisfying 1/p + 1/p∗ = 1. The following proposition i k ∈ Schatten-p norm of a matrix W (σ1(W ), . . . , σmin i.e., to be proved in Section D.1 gives complexity bounds for learning with linear features. p . If p = 2, this becomes the Frobenius norm kSp := d,d′ { } σ(W ) (cid:0) P Rd Rd W W ≥ ∈ ∈ p 2 d′ d′ k k k (cid:1) × × 1 Proposition 5.3 (Linear representation). Consider the feature map defined in Lemma 5.1 with v(x) = x. (a) If = k * k2,p, then k * k Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj) min p q ≥ ≤ Λd1/q∗ n max( q∗ − p 1, 1) [n] o(cid:16) Xj ∈ xjk k 2 2 1 2 . (cid:17) 9 (b) If = k * kSp with p ≤ k * k 2, then Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj ) Λ2− ≤ 1 4 min q ∈ [p,2] r q∗π e max d xj x⊤j (cid:16) [n] Xj ∈ n(cid:13) (cid:13) (cid:13) 1 2 (cid:17) Sq∗ (cid:13) (cid:13) (cid:13) , d1/q∗ xjk k 2 2 1/2 . (cid:17) o [n] (cid:16) Xj ∈ error bounds for learning with unsupervised loss. Let Bx = max We now plug the above Rademacher complexity bounds into Theorem 4.9 to give generalization . [k] } {k √nkBx for ̃xj in the definition of C, from which and Proposition 5.3 we Note get the following bound for the case v(x) = x (the definition of C involves nk examples, while in (cid:1) Proposition 5.3 we consider n examples): x−jtk2 : j x+ j k2, xjk2, ̃xjk [nk] k [n], t (cid:0) P ≤ ∈ ∈ 2 2 k k ∈ 1 2 j The following corollary then follows from Theorem 4.9. C = O √nkBx min p ≥ q (cid:16) (cid:8) Λd1/q∗ max( q∗ − 1, 1) . (cid:9)(cid:17) p Corollary 5.4. Consider the feature map in Proposition 5.3 with loss and δ ∈ (0, 1). Then with probability at least 1 − = k * k2,p. Let l be the logistic k * k δ the following inequality holds for all f ∈ F Lun(f ) − ˆLun(f ) = B log 1 2 (1/δ) √n GRBx minq p ≥ + O Λd1/q∗ √n (cid:8) max(√q∗ − 1, 1) . (cid:9) (cid:17) (cid:16) e It is also possible to give generalization bounds for learning with l2-Lipschitz loss functions, and optimistic generalization bounds for learning with self-bounding Lipschitz loss functions. We omit the discussion for brevity. 5.2 Nonlinear Features We now consider Rademacher complexity for learning with nonlinear features by DNNs. The following lemma to be proved in Section D.2 gives Rademacher complexity bounds for learning with R is positive-homogeneous if σ(ax) = aσ(x) for features by DNNs. We say an activation σ : R a is both x σ(x) | ≤ | positive-homogeneous and contractive. . The ReLU activation function σ(x) = max 0, contractive if σ(x′) x, 0 7→ x′ − − ≥ } { | | Proposition 5.5 (Nonlinear representation). Consider the feature map defined in Lemma 5.1 with = k * kF and k * k V = x v(x) = σ VLσ VL σ(V1x) 1 * * * − : VlkF ≤ k Bl, l ∀ ∈ 7→ [L] , n (cid:0) (cid:0) (cid:1)(cid:1) o where σ is positive-homogeneous, contractive and σ(0) = 0, and L is the number of layers. Then Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj ) ≤ √dΛBLBL 1 * * * − B1 16L (cid:18) (x⊤i xj )2 1 2 + n (cid:1) [n] Xj ∈ 1 2 . xjk k 2 2 (cid:19) i<j (cid:0) X1 ≤ ≤ Remark 5.6. If d = 1, the following bound was established in Golowich et al. [16] Eǫ sup f ǫjft(xj) = O √L [n] (cid:16) Xj ∈ Proposition 5.5 extends this bound to the general case d [n] ∈F Xj ∈ (cid:16) 2 2 xjk k 1 2 Bl . (cid:17) [L] Yl ∈ (cid:17) matches the result in Golowich et al. [16] within a constant factor. We need to introduce different tech- niques to handle the difficulty in considering the coupling among different features u⊤t v(x), t which is reflected by the regularizer on U as Ignoring this coupling would imply a [d], Λ. U ∈ N. In particular, if d = 1, our result ∈ k kF ≤ 10 j 2 [d] ∈F t ∈ [n] ǫt,jft(xj) bound with a crude dependency on d. For example, we consider the moment generation function of supf Rademacher chaos variable (cid:0) P , and then reduce it to the moment generation function of a n ǫiǫjx⊤i xj by repeated applications of contraction inequalities of Rademacher complexities. A direct application of the analysis in Golowich et al. [16] would imply bounds Eǫ supf ∈ sis implies a bound with a square-root dependency on d. We will give more details on the comparison . As a comparison, our analy- [n] ǫjft(xj) = O [L] Bl xjk (cid:1) i<j ≤ d√L [n] k P P ∈F 2 2 ≤ ∈ ∈ ∈ 1 2 1 j j l (cid:0) (cid:0) P (cid:1) Q (cid:1) P of technical analysis in Remark D.6. 1 n(x⊤i xj)2 Note i<j 1 ≤ linear features that C = O from Theorem 4.9. (cid:0) P ≤ 2 = O √dLΛ(nk) (cid:1) 1 j ∈ 2 Bx [n] k l (cid:0) P 2 xjk 2 [L] Bl (cid:1) ∈ (cid:0) Q (cid:1) , from which and Proposition 5.5 we get for non- . The following proposition then follows directly Corollary 5.7. Consider the feature map in Proposition 5.5. Let l be the logistic loss and δ (0, 1). ∈ With probability at least 1 − δ the following inequality holds for all f ∈ F Lun(f ) − ˆLun(f ) = O GR√dLΛBx (cid:16) [L] Bl + B log l ∈ √n Q 1 2 1 δ . (cid:17) 5.3 Generalization for Downstream Classification e In this subsection, we apply the above generalization bounds on unsupervised learning to derive generalization guarantees for a downstream supervised learning task. Similar ideas can be dated back to metric/similarity learning, where one shows that similarity-based learning guarantees a good generalization of the resultant classification [4, 5, 18]. Following Arora et al. [3], we consider a particular W μf (x) with mean classifier with rows being the means of the representation of each class, i.e., x the c-th row of W being the mean μc of representations of inputs with label c: μc := Ex c[f (x)]. Consider the average supervised loss sup(f ) := E Lμ { ci 6 (cid:2) K+1 where we take the expectation over i=1 . The following lemma shows that the generalization performance of the mean classifier based on a representation f can be guaranteed in terms of the generalization performance of the representation in unsupervised learning. K+1 i=1 , W μf ) | K+1 i=1 ∼ } = Lsup( { ci} ci} = cj ρK+1 7→ ∼D T { ci (cid:3) , Lemma 5.8 (Arora et al. 3). There exists a function ρ : holds for any f : E T ∼D ρ( T ∈ F )Lμ sup(f ) ≤ Lun(f ). K+1 C 7→ R+ such that the following inequality We refer the interested readers to Arora et al. [3] for the expression of ρ( ), which is independent of n. The following corollaries are immediate applications of Lemma 5.8 and our generalization bounds for unsupervised learning. We omit the proof for brevity. T (cid:2) (cid:3) Corollary 5.9 (Linear representation). Consider the feature map in Proposition 5.3 with Let ls, l be the logistic loss and δ holds ∈ (0, 1). Then with probability at least 1 − k*k2,p. δ the following inequality k*k = E T ∼D ρ( T h )Lμ sup( ˆf ) i 1 ≤ (cid:16) − Remark 5.10. If p (log d)/(log d 1), we set q = (log d)/(log d e = ˆLun( ˆf ) + O B log 1 2 (1/δ) √n + GRBx minq p ≥ Λd1/q∗ √n 1), and get d1/q∗ (cid:8) − max(√q∗ − 1, 1) . (cid:17) (cid:9) 1, 1) = max(√q∗ − O(log 2 d) (q∗ = log d). In this case, we get a bound with a logarithmic dependency on the number of features. It is possible to extend our discussion to more general norms = k * kp,q, p, q ≥ k * k 1 [22]. Corollary 5.11 (Nonlinear representation). Consider the feature map in Proposition 5.5. Let ls, l be the logistic loss and δ (0, 1). With probability at least 1 δ we have ∈ E T ∼D ρ( T h )Lμ sup( ˆf ) i = ˆLun( ˆf ) + O (cid:16) e − GR√dLΛBx √n 11 [L] Bl l ∈ + B log1/2(1/δ) √n Q . (cid:17) Remark 5.12. If we combine our Rademacher complexity bounds in Section 5 and Eq. (4.3) developed in Arora et al. [3], we would get generalization bounds for supervised classification with a linear dependency on k. If we combine our complexity bounds and Theorem 4.6, we would get generalization bounds for supervised classification with a square-root dependency on k. These discussions use the Lipschitz continuity of l w.r.t k * k∞ allows us to derive generalization bounds with a logarithmic dependency on k in Corollary 5.9 and k * k2. As a comparison, the use of Lipschitz continuity w.r.t. Corollary 5.11. Furthermore, we can improve the bounds O(1/√n) in these corollaries to O(1/n) in an interpolation setting by applying Theorem 4.12. e e 6 Conclusion Motivated by the existing generalization bounds with a crude dependency on the number of negative examples, we present a systematic analysis on the generalization behavior of CRL. We consider three types of loss functions. Our results improve the existing bounds by a factor of √k for l2 Lipschitz loss, and by a factor of k for l Lipschitz loss (up to a log factor). We get optimistic bounds for self- bounding Lipschitz loss, which imply fast rates under low noise conditions. We justify the effectiveness of our results with applications to both linear and nonlinear features. ∞ Our analysis based on Rademacher complexities implies algorithm-independent bounds. It would be interesting to develop algorithm-dependent bounds to understand the interaction between optimization and generalization. For l loss, our bound still enjoys a logarithmic dependency on k. It would be interesting to study whether this logarithmic dependency can be removed in further study. ∞ References [1] Alon, N., Ben-David, S., Cesa-Bianchi, N., and Haussler, D. Scale-sensitive dimensions, uniform convergence, and learnability. Journal of the ACM, 44(4):615–631, 1997. [2] Anthony, M. and Bartlett, P. L. Neural network learning: Theoretical foundations, volume 9. 1999. [3] Arora, S., Khandeparkar, H., Khodak, M., Plevrakis, O., and Saunshi, N. A theoretical analysis In International Conference on Machine of contrastive unsupervised representation learning. Learning, pp. 9904–9923, 2019. [4] Balcan, M.-F. and Blum, A. On a theory of learning with similarity functions. In international Conference on Machine Learning, pp. 73–80, 2006. [5] Balcan, M.-F., Blum, A., and Srebro, N. Improved guarantees for learning via similarity functions. In Conference on Learning Theory, pp. 287–298, 2008. [6] Bartlett, P. and Mendelson, S. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3:463–482, 2002. [7] Boucheron, S., Lugosi, G., and Massart, P. Concentration Inequalities: A Nonasymptotic Theory of Independence. Oxford university press, 2013. [8] Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. [9] Cao, Q., Guo, Z.-C., and Ying, Y. Generalization bounds for metric and similarity learning. Machine Learning, 102(1):115–132, 2016. [10] Caron, M., Misra, I., Mairal, J., Goyal, P., Bojanowski, P., and Joulin, A. Unsupervised learning of visual features by contrasting cluster assignments. Advances in Neural Information Processing Systems, 33:9912–9924, 2020. 12 [11] Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A simple framework for contrastive learn- ing of visual representations. In International Conference on Machine Learning, pp. 1597–1607. PMLR, 2020. [12] Chuang, C.-Y., Robinson, J., Lin, Y.-C., Torralba, A., and Jegelka, S. Debiased contrastive In Advances in Neural Information Processing Systems, volume 33, pp. 8765–8775, learning. 2020. [13] De la Pena, V. and Gin ́e, E. Decoupling: from dependence to independence. Springer Science & Business Media, 2012. [14] Foster, D. J. and Rakhlin, A. l arXiv:1911.06468, 2019. ∞ vector contraction for rademacher complexity. arXiv preprint [15] Gao, T., Yao, X., and Chen, D. Simcse: Simple contrastive learning of sentence embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 6894–6910, 2021. [16] Golowich, N., Rakhlin, A., and Shamir, O. Size-independent sample complexity of neural networks. In Conference On Learning Theory, pp. 297–299. PMLR, 2018. [17] Guermeur, Y. Lp-norm sauer–shelah lemma for margin multi-category classifiers. Journal of Computer and System Sciences, 89:450–473, 2017. [18] Guo, Z.-C. and Ying, Y. Guaranteed classification via regularized similarity learning. Neural Computation, 26(3):497–522, 2014. [19] HaoChen, J. Z., Wei, C., Gaidon, A., and Ma, T. Provable guarantees for self-supervised deep learning with spectral contrastive loss. Advances in Neural Information Processing Systems, 34: 5000–5011, 2021. [20] He, K., Fan, H., Wu, Y., Xie, S., and Girshick, R. Momentum contrast for unsupervised visual representation learning. In Computer Vision and Pattern Recognition, pp. 9729–9738, 2020. [21] H ́enaff, O. J., Srinivas, A., De Fauw, J., Razavi, A., Doersch, C., Eslami, S. A., and Van Den Oord, A. Data-efficient image recognition with contrastive predictive coding. In International Conference on Machine Learning, pp. 4182–4192, 2020. [22] Kakade, S. M., Shalev-Shwartz, S., and Tewari, A. Regularization techniques for learning with matrices. Journal of Machine Learning Research, 13:1865–1890, 2012. [23] Khosla, P., Teterwak, P., Wang, C., Sarna, A., Tian, Y., Isola, P., Maschinot, A., Liu, C., and Krishnan, D. Supervised contrastive learning. Advances in Neural Information Processing Systems, 33:18661–18673, 2020. [24] Lee, J. D., Lei, Q., Saunshi, N., and Zhuo, J. Predicting what you already know helps: Provable self-supervised learning. Advances in Neural Information Processing Systems, 34:309–323, 2021. [25] Lei, Y., Dogan, U., Binder, A., and Kloft, M. Multi-class svms: From tighter data-dependent generalization bounds to novel algorithms. In Advances in Neural Information Processing Systems, pp. 2026–2034, 2015. [26] Lei, Y., Dogan, ̈U., Zhou, D.-X., and Kloft, M. Data-dependent generalization bounds for multi- class classification. IEEE Transactions on Information Theory, 65(5):2995–3021, 2019. [27] Lust-Piquard, F. and Pisier, G. Non commutative khintchine and paley inequalities. Arkiv f ̈or Matematik, 29(1):241–260, 1991. [28] Maurer, A. A vector-contraction inequality for rademacher complexities. In International Con- ference on Algorithmic Learning Theory, pp. 3–17, 2016. [29] Mitrovic, J., McWilliams, B., Walker, J., Buesing, L., and Blundell, C. Representation learning via invariant causal mechanisms. arXiv preprint arXiv:2010.07922, 2020. [30] Mohri, M., Rostamizadeh, A., and Talwalkar, A. Foundations of Machine Learning. MIT press, 2012. [31] Nozawa, K., Germain, P., and Guedj, B. PAC-bayesian contrastive unsupervised representation 13 learning. In Uncertainty in Artificial Intelligence, pp. 21–30. PMLR, 2020. [32] Oord, A. v. d., Li, Y., and Vinyals, O. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. [33] Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748–8763. PMLR, 2021. [34] Reeve, H. and Kaban, A. Optimistic bounds for multi-output learning. In International Conference on Machine Learning, pp. 8030–8040. PMLR, 2020. [35] Saunshi, N., Ash, J., Goel, S., Misra, D., Zhang, C., Arora, S., Kakade, S., and Krishnamurthy, A. Understanding contrastive learning requires incorporating inductive biases. In International Conference on Machine Learning, volume 162, pp. 19250–19286, 2022. [36] Srebro, N., Sridharan, K., and Tewari, A. Smoothness, low noise and fast rates. In Advances in Neural Information Processing Systems, pp. 2199–2207, 2010. [37] Tewari, A. and Chaudhuri, S. Generalization error bounds for learning to rank: Does the length of document lists matter? In International Conference on Machine Learning, pp. 315–323. PMLR, 2015. [38] Tian, Y., Krishnan, D., and Isola, P. Contrastive multiview coding. In European Conference on Computer Vision, pp. 776–794. Springer, 2020. [39] Tian, Y., Yu, L., Chen, X., and Ganguli, S. Understanding self-supervised learning with dual deep networks. arXiv preprint arXiv:2010.00578, 2020. [40] Tosh, C., Krishnamurthy, A., and Hsu, D. Contrastive learning, multi-view redundancy, and linear models. In Algorithmic Learning Theory, pp. 1179–1206. PMLR, 2021. [41] Tosh, C., Krishnamurthy, A., and Hsu, D. Contrastive estimation reveals topic posterior informa- tion to linear models. Journal of Machine Learning Research, 22:281–1, 2021. [42] Tsai, Y.-H. H., Wu, Y., Salakhutdinov, R., and Morency, L.-P. Demystifying self-supervised learning: An information-theoretical framework. arXiv preprint arXiv:2006.05576, 2, 2020. [43] Wang, T. and Isola, P. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In International Conference on Machine Learning, pp. 9929–9939. PMLR, 2020. [44] Ying, Y. and Campbell, C. Rademacher chaos complexities for learning the kernel problem. Neural computation, 22(11):2858–2886, 2010. [45] Yuan, Z., Wu, Y., Qiu, Z., Du, X., Zhang, L., Zhou, D., and Yang, T. Provable stochastic opti- mization for global contrastive learning: Small batch does not harm performance. In Proceedings of International Conference of Machine Learning, 2022. [46] Zhou, D.-X. The covering number in learning theory. Journal of Complexity, 18(3):739–767, 2002. A Proof of Theorem 4.6 To prove Theorem 4.6, we first prove Lemma 4.3 by the following vector-contraction lemma on Rademacher complexities. Lemma A.1 (Maurer 28). Let S = h : Rd R be G-Lipschitz w.r.t. l2-norm. Then n j=1 ∈ Z zj} { 7→ n. Let F ′ be a class of functions f ′ : Rd and Z 7→ Eǫ n 1 } ∼{± sup f ′ ∈F ′ h [n] Xj ∈ ǫj(h ◦ f ′)(zj ) i ≤ √2GEǫ nd 1 } ∼{± sup f ′ ∈F ′ h Xj ∈ [d] [n] Xt ∈ . ǫj,tf ′t(zj ) i In Section E, we will provide an extension of the above lemma. 14 Proof of Lemma 4.3. Let f ′ : 3 R3d be defined as 7→ X f ′(x, x+, x−) = f (x), f (x+), f (x−) R3d ∈ (cid:0) (cid:1) and h : R3d 7→ R be defined as Then it is clear that h(y, y+, y−) = y⊤(y+ y−), y, y+, y− Rd. ∈ − f (x)⊤(f (x+) f (x−)) = h ◦ − f ′(x, x+, x−). Furthermore, for any y1, y+ 1 , y−1 , y2, y+ 2 , y−2 with Euclidean norm less than or equal to R, we have 1 , y−1 ) h(y2, y+ y⊤1 (y+ 2 − y+ 2 + y−2 ) + (y1 − 1 − It then follows from the elementary inequality (a + b)2 h(y1, y+ = y⊤1 (y+ = y⊤1 (y+ − y−1 ) − y−1 − 1 − 2 , y−2 ) = y⊤1 (y+ 1 − y−2 ) + y⊤1 (y+ 2 − y2)⊤(y+ y−1 ) 2 − y⊤2 (y+ 2 − y⊤2 (y+ − y−2 ) y−2 ) y−2 ) 2 − − y−2 ). (1 + p)a2 + (1 + 1/p)b2 that ≤ h(y1, y+ 1 , y−1 ) (cid:12) (cid:12) 2(1 + p) k 2 h(y2, y+ − y+ 2 y1k 1 − 2 , y−2 ) y+ (cid:12) 2 k (cid:12) k ≤ 2 + 2(1 + p) k 2 y1k y−1 − k y−2 k 2 2 + (1 + 1/p) k y+ 2 − y−2 k 2 2k y1 − 2 2. y2k We can choose p = 2 and get h(y1, y+ 1 , y−1 ) − h(y2, y+ 2 , y−2 ) 2 (cid:12) (cid:12) (cid:12) (cid:12) 6R2 ≤ = 6R2 2 + y+ 1 − k (y1, y+ (cid:0) k y+ 2 k 1 , y−1 ) − y−1 − k (y2, y+ y−2 k 2 , y−2 ) k 2 2 + k 2 2. y1 − y2k 2 2 (cid:1) This shows that h is √6R-Lipschitz continuous w.r.t. k * k2. We can apply Lemma A.1 to derive Eǫ ∼{± n 1 } h ≤ sup f ′ ′ [n] Xj ∈F ∈ √12REǫ ǫj(h ◦ f ′)(zj ) i ∼{± n 1 } ×{± 1 } d ×{± 1 3 } h sup f ∈F Xj ∈ [n] Xt ∈ [d] (cid:16) ǫj,t,1ft(xj ) + ǫj,t,2ft(x+ j ) + ǫj,t,3ft(x−j ) . The proof is completed. The following standard lemma gives generalization error bounds in terms of Rademacher complex- ities. Lemma A.2 (Mohri et al. 30). Let have g(z) [0, B], then for any δ be a function class and S = ∈ G (0, 1) the following inequality holds with probability (w.r.t. e e { z1, . . . , zn} . If for any g ∈ least 1 δ − E[g(z)] 1 n ≤ g(zi) + 2R e S( G ) + 3B log(2/δ) 2n , r g ∀ . ∈ G ∈ n i=1 X e Proof of Theorem 4.6. According to the G2-Lipschitz continuity of l w.r.t. l2-norm and Lemma A.1, we have e (cid:17)i we G S) at e e Eǫ ∼{± n 1 } sup f [n] ∈F Xj ∈ h ǫjl f (xj)⊤(f (x+ j ) f (x−ji)) − [k] i ∈ (cid:0)(cid:8) √2G2E {ǫ ≤ }∼{± (cid:9) nk E } 1 (cid:1)i sup f ∈F Xj ∈ [k] [n] Xi ∈ ǫj,if (xj)⊤(f (x⊤j ) − . f (x−ji)) i h 15 According to Lemma 4.3, we further get E {ǫ }∼{± nk E } 1 sup f ∈F Xj ∈ [k] [n] Xi ∈ ǫj,if (xj)⊤(f (x⊤j ) − f (x−ji)) i ≤ h √12RE {ǫ }∼{± 3nkdE } 1 sup f ∈F Xj ∈ ǫj,i,t,1ft(xj ) + ǫj,i,t,2ft(x+ j ) + ǫj,i,t,3ft(x−ji) . [n] Xi ∈ We can combine the above two inequalities to get the Rademacher complexity bounds. [k] Xt ∈ [d] (cid:16) h (cid:17)i We now turn to the generalization bounds. Applying Lemma A.2, with probability at least 1 the following inequality holds with probability at least 1 δ − Lun(f ) ˆLun(f ) + 2RS( G ≤ ) + 3B log(2/δ) 2n , r f ∀ . ∈ F δ − The stated bound on generalization errors then follows by plugging the Rademacher complexity bounds into the above bound. The proof is completed. B Proof of Theorem 4.9 We first introduce several complexity measures such as covering numbers and fat-shattering dimen- sion [1, 2, 46]. Definition B.1 (Covering number). Let S := functions defined over a space Np(ǫ, (f (z1), . . . , f (zn)) : f { S) with respect to F ∈ , F } e e e such that . For any ǫ > 0 and p e Z { z1, . . . , zn} ∈ Z ≥ F e n. Let be a class of real-valued 1, the empirical lp-norm covering number S is defined as the smallest number m of a collection of vectors v1, . . . , vm ∈ e sup e f F ∈ min [m] j ∈ (cid:16) 1 n [n] Xi ∈ f (zi) | p vj i | − 1 p (cid:17) ǫ, ≤ where vj i is the i-th component of the vector vj. In this case, we call v1, . . . , vm { } an (ǫ, lp)-cover of with respect to S. e F Definition B.2 (Fat-Shattering Dimension). Let e space there exist D points z1, . . . , zD ∈ e there exists f F ∈ . We define the fat-shattering dimension fatǫ( e with ̃ Z Z F and witnesses s1, . . . , sD ∈ e e δi(f (zi) si) ǫ/2, [D]. i ∀ ∈ ≥ − ) at scale ǫ > 0 as the largest D be a class of real-valued functions defined over a N such that 1 R satisfying: for any δ1, . . . , δD ∼ {± F ∈ } To prove Theorem 4.8, we need to introduce the following lemma on Rademacher complexity, fat- shattering dimension and covering numbers. Part (a) shows that the covering number can be bounded by fat-shattering dimension (see, e.g., Theorem 12.8 in Anthony & Bartlett [2]). Part (b) shows that the fat-shattering dimension can be controlled by the worst-case Rademacher complexity, which was developed in Srebro et al. [36]. Part (c) is a discretization of the chain integral to control Rademacher complexity by covering numbers [36], which can be found in Guermeur [17]. Let e be the base of the natural logarithms. Lemma B.3. Let S := z1, . . . , zn} ⊆ { ̃ Z . Let space . Z (a) If functions in e e F take values in [ − be a class of real-valued functions defined over a F e B, B], then for any ǫ > 0 with fatǫ( F ) < n we have e log (ǫ, F N∞ , S) ≤ 1 + fatǫ/4( F ) log2 e e e 16 (cid:16) 4eBn ǫfatǫ/4( F ) (cid:17)(cid:16) 16B2n e log ǫ2 . (cid:17) e (b) For any ǫ > R e Z ,n( F ), we have fatǫ( F ) < 4n ǫ2 R2 e Z ,n ). ( F (c) Let (ǫj)∞j=0 be a monotone sequence decreasing to 0 and any (a1, . . . , an) e e e Rn. If ∈ 1 sup e f F ∈ n f (zi) i=1 X (cid:0) 2 , ai − (cid:1) n− ǫ0 ≥ v u u t then for any non-negative integer N we have R e S( F 2 ) ≤ e N ǫj + ǫj j=1 X (cid:0) 1) s − log N∞ , S) (ǫj, n F + ǫN . e e (B.1) According to Part (a) of Lemma B.3, the following inequality holds for any ǫ ) = 0 is trivial since in this case we have (ǫ, , F N∞ S) = 1, and otherwise we have fatǫ/4( ∈ (0, 2B] (the case 1) ) F ≥ fatǫ/4( F e log (ǫ, F N∞ , S) ≤ e 1 + fatǫ/4( e F ) log2 2 S 8eB2 ǫ2 | | . e (B.2) We follow the arguments in Lei et al. [26] to prove Theorem 4.8. e e e e Proof of Theorem 4.8. We first relate the empirical l -covering number of j [n] } ∈ to the empirical l ∞ rm = -covering number of ∞ w.r.t. S . Let H rm 1,1, rm 1,2, . . . , rm n,1, rm n,2, . . . , rm n,k H 1,k, . . . , rm be an (ǫ/G, l n )-cover of ∞ (cid:0) w.r.t. S H H . Recall that : m ∈ [N ] o (cid:1) w.r.t. S = { F (xj, x+ j , x−j1, x−j2, . . . , x−jk) : hf (x, x+, x−) = f (x)⊤ f (x+) f (x−) . − (B.3) Then, by the definition of l ∞ (cid:0) -cover we know for any f we can find m (cid:1) ∈ F [N ] such that ∈ hf (xj , x+ j , x−ji) rm j,i − ≤ ǫ/G. max [n] j ∈ max [k] i ∈ (cid:12) (cid:12) By the Lipschitz continuity of l, we then get max [n] j ∈ G l f (xj )⊤ f (x+ j ) f (x−ji) − k i=1 (cid:12) (cid:12) (cid:0)(cid:8) f (xj)⊤ (cid:0) f (x+ j ) f (x−ji) − (cid:1)(cid:9) (cid:1) k i=1 − l − rm j,i rm j,i} { (cid:0) k i=1 (cid:1)(cid:1) (cid:0) (cid:1) ≤ ≤ Gǫ/G = ǫ. (cid:0) (cid:13) (cid:13) This shows that l S and therefore (cid:8)(cid:0) (cid:0) { (cid:0) rm 1,i} k i=1 , l (cid:1) { (cid:0) (cid:12) (cid:12) k i=1 (cid:1)(cid:12) (cid:12) = G ∞ (cid:13) (cid:13) (cid:13) (cid:0) (cid:13) hf (xj , x+ j , x−ji) k i=1 − (cid:1) rm j,i k i=1 (cid:0) (cid:1) ∞ (cid:13) (cid:13) rm 2,i} k i=1 , . . . , l (cid:1) , S) G (ǫ, N∞ rm n,i} k i=1 : m ∈ [N ] is an (ǫ, l )-cover of ∞ w.r.t. G (cid:1)(cid:1) (cid:9) { (cid:0) ≤ N∞ (ǫ/G, , S ). H H (B.4) Since we consider empirical covering number of w.r.t. S, we can assume functions in are defined . For simplicity, we denote Rnk( ) := RSH,nk( ). We now control over S H Rademacher complexities of H . For any ǫ > 2Rnk( H H H ), it follows from Part (b) of Lemma B.3 that H (ǫ/G, N∞ , S H ) by H F fatǫ( H ) ≤ 4nk ǫ2 R2 SH,nk( H nk. ) ≤ (B.5) 17 Note for any f and Eq. (B.5) that (replace B by 2R2) , we have f (x)⊤(f (x+) ∈ F f (x−)) [ − ∈ − 2R2, 2R2]. It then follows from Eq. (B.2) log (ǫ, , S ) H H ≤ N∞ 1 + fatǫ/4( ) log2(32eR4nk/ǫ2) H 64nkR2 nk( ǫ2 1 + ≤ H ) log2(32eR4nk/ǫ2), (0, 4R2]. ǫ ∈ We can combine the above inequality and Eq. 2GRnk( 4GR2 ǫ ) H ≤ ≤ (B.4) to derive the following inequality for any log , S) (ǫ, G ≤ N∞ 1 + Let ǫN = 24G max √kRnk( H ), n− 1 2 , 64nkG2R2 nk( ǫ2 ) log2(32eR4G2nk/ǫ2). (B.6) H (cid:8) (cid:9) ǫj = 2N jǫN , − j = 0, . . . , N 1, − where N = log2 (cid:24) 24G max 2GR2 √kRnk( It is clear from the definition that n ), n− 1 2 . (cid:25) o H The Lipschitz continuity of l implies 2GR2 ǫ0 ≥ ǫ0/2. ≥ l(( { hf (x, x+, x−i ) }i ∈ [k])) − l((0, 0, . . . , 0)) G k ≤ hf (x, x+, x−) k∞ ≤ 2R2G. According to the above inequality and Part (c) of Lemma B.3, we know (note ǫN ≥ therefore Eq. (B.6) holds for ǫ = ǫj, j = 1, . . . , N ) 2GRnk( H ) and (ǫj + ǫj 1) r − log N∞ , S) (ǫj, n G + ǫN N RS( G ) ≤ 2 j=1 X N 2n− 1 2 j=1 X ≤ ≤ ≤ (ǫj + ǫj 1) + − 16G√nkRnk( √n H ) N (ǫj + ǫj − j=1 X 1) log(32eR4G2nk/ǫ2 j ) ǫj + ǫN 6ǫ0n− 1 2 + ǫN + log(32eR4G2nk/ǫ2 j ) 48G√nkRnk( √n H ) N j=1 X 24GR2n− 2 + ǫN + 48GN √kRnk( 1 ) log(32eR4G2nk) + 48G√kRnk( H H log(1/ǫ2 j ). N ) j=1 X According to the definition of ǫk, we know N N log(1/ǫ2 j ) = log(22j/ǫ2 0) = log(1/ǫ2 0) + log 4 N j=1 X j=1 X = N j=1 X 0 + (N + 1) log 2 log 1/ǫ2 (cid:16) N log ≤ (cid:16) √n 24G 1 GR2 (cid:17) = N log (cid:17) √n 24G2R2 . 18 j = N log(1/ǫ2 0) + N (N + 1) log 4 2 N * j=1 X = N log 2N +1/ǫ2 0 = N log 1 ǫN 2 ǫ0 (cid:16) ≤ (cid:17) N log 1 ǫN 2 2GR2 (cid:16) (cid:17) We can combine the above two inequalities together to get RS( G ) 24GR2n− 24GR2n− 24GR2n− ≤ ≤ ≤ 1 2 + ǫN + 48N G√kRnk( H ) 1 2 + ǫN + 48G√kRnk( H 1 2 + ǫN + 48G√kRnk( H ) (cid:16) ) (cid:16) log(32eR4G2nk) + log (cid:16) log(32eR4G2nk) + log √n 24G2R2 √n 24G2R2 log(4R2n 3 2 k) log2 R2√n 12 , m (cid:17)l where we have used the definition of N and 32e/24 4. The proof is completed. ≤ (cid:17) log2 2GR2√n 24G m (cid:17)l Proof of Theorem 4.9. Applying Lemma A.2, with probability at least 1 holds with probability at least 1 δ − δ the following inequality − Lun(f ) ˆLun(f ) + 2RS( G ≤ ) + 3B log(2/δ) 2n , r f ∀ . ∈ F According to Theorem 4.8 and Lemma 4.3, we know RS( G ) ≤ 48G(R2 + 1)n− 1 2 + 48G√kRnk( 48G(R2 + 1)n− 1 2 + ≤ H 48√12GR√k nk (cid:18) 1 + log(R2n ) (cid:18) 1 + log(R2n 3 2 k) log2 l log2 3 2 k) l R2√n 12 R2√n 12 m(cid:19) C. m(cid:19) We can combine the above two inequalities together and derive the stated bound. The proof is com- pleted. C Proof of Theorem 4.12 To prove Theorem 4.12, we introduce the following lemma on generalization error bounds in terms of local Rademacher complexities [34]. Lemma C.1 (Reeve & Kaban 34). Consider a function class of functions mapping zi : i { [n] } ∈ and g ∈ G any S = have e , let ˆE e S[g] = 1 n i ∈ [n] g(zi). Assume for any G R e S g P : ˆE e S[g] r φn(r), ∈ Z S e to [0, b]. For Z n and r > 0, we ≤ R+ is non-decreasing and φn(r)/√r is non-increasing. Let ˆrn be the largest solution δ the following inequality (0, 1), with probability at least 1 { (cid:0) ∈ G ≤ } (cid:1) where φn : R+ 7→ of the equation φn(r) = r. For any δ holds uniformly for all g ∈ ∈ G − Ez[g(z)] ≤ ˆE e S[g] + 90(ˆrn + r0) + 4 ˆE e S[g](ˆrn + r0), q where r0 = b log(1/δ) + 6 log log n /n. Proof of Theorem 4.12. For any r > 0, we define (cid:0) (cid:1) Fr as a subset of F with the empirical error less than or equal to r Let : 1 n ∈ F Fr = f n [n] Xj ∈ gf (xj , x+ j , x−j1, . . . , x−jk) ≤ r . o rm = 1,1, rm rm 1,2, . . . , rm 1,k, . . . , rm n,1, rm n,2, . . . , rm n,k n (cid:0) 19 : m ∈ [N ] o (cid:1) be an (ǫ/(√2rGs), l l -cover we know for any f ∞ )-cover of ∞ w.r.t. S : f ∈ Fr [N ] such that (cid:9) . Then, by the definition of H Hr := hf ∈ H ∈ Fr we can find m (cid:8) ∈ hf (xj , x+ max [n] j ∈ max [k] i ∈ j , x−ji) (cid:12) (cid:12) rm j,i − ≤ ǫ/(√2rGs). (cid:12) (cid:12) According to the self-bounding Lipschitz continuity of l, we know 1 n ≤ ≤ ≤ l f (xj )⊤ f (x+ j ) f (x−ji) − k i=1 l − 2 rm j,i} k i=1 Xj [n] ∈ G2 s n (cid:0)(cid:8) (cid:12) (cid:12) [n] Xj ∈ G2 s n (cid:0) l max f (xj)⊤ f (x+ j ) n (cid:0)(cid:8) f (xj)⊤ (cid:0) f (x+ j ) l Xj [n] (cid:0) (cid:0)(cid:8) ∈ srǫ2/(2rG2 (cid:0) s) = ǫ2, 2G2 { (cid:0) (cid:1)(cid:9) − (cid:1) f (x−ji) (cid:1)(cid:9) (cid:1) f (x−ji) − k i=1 + l (cid:1)(cid:9) (cid:1) { (cid:0) (cid:1)(cid:12) (cid:12) rm j,i} { (cid:0) rm j,i} k i=1 (cid:1)(cid:1)(cid:13) (cid:0) (cid:13) k i=1 , l k i=1 f (xj)⊤ f (x+ j ) f (x−ji) − k i=1 − rm j,i k i=1 (cid:1)o(cid:13) (cid:0) (cid:13) hf (xj , x+ (cid:0) j , x−ji) k i=1 − (cid:1) (cid:0) (cid:1) (cid:1)(cid:1) k i=1 rm j,i (cid:0) (cid:1) 2 ∞ (cid:13) (cid:13) 2 ∞ (cid:13) (cid:13) where we have used the following inequalities due to the definition of Fr 1 n l f (xj )⊤ f (x+ j ) [n] Xj ∈ (cid:0)(cid:8) (cid:0) f (x−ji) − k i=1 r, ≤ (cid:1)(cid:9) (cid:1) 1 n l { (cid:0) [n] Xj ∈ rm j,i} k i=1 r. ≤ (cid:1) Therefore, we have where gf ∈ G Gr = G there by √2rGs) { : f ∈ Fr} Gr, S) Hr, S N2(ǫ, . Analyzing analogously to the proof of Theorem 4.8, we get (replacing ≤ N∞ (ǫ/(√2rGs), ), H RS( Gr) ≤ 24√2rGs(R2 + 1)n− 1 2 + 48√2rGs√kRSH,nk( H 1 + log(4R2n ) (cid:18) 3 2 k) log2 l R2√n 12 m(cid:19) := ψn(r). Let ˆrn be the point satisfying ˆrn = ψn(ˆrn): ˆrn = 24 2ˆrnGs(R2 + 1)n− 1 2 + 48 p from which we get 2ˆrnGs√kRSH,nk( H p ) (cid:18) 1 + log(4R2n 3 2 k) log2 l R2√n 12 , m(cid:19) We can apply Lemma C.1 to get the following inequality with probability at least 1 ˆrn = O G2 sR4n− 1 + G2 skR2 SH,nk( H ) . (cid:17) (cid:16) e δ uniformly for − all f ∈ F Lun(f ) = ˆLun(f )+ O Bn− 1+G2 sR4n− (cid:16) We can apply Lemma 4.3 to control RSH,nk( e ) and derive the following bound e H (cid:17) (cid:16) 1+G2 skR2 SH,nk( ) + O √Bn− 1 2 +GsR2n− 1 2 +Gs√kRSH,nk( ) ˆL 1 2 un(f ). (cid:17) H Lun(f ) = ˆLun(f )+ O Bn− 1+G2 sR4n− The proof is completed. e (cid:16) H sR2n− 1+G2 2k− 1C2 + O √Bn− 1 2 +GsR2n− 1 2 +GsRn− 1k− 1 2 C (cid:17) (cid:16) e 1 2 un(f ). ˆL (cid:17) 20 D Proof on Rademacher Complexities We first prove Rademacher complexity bounds for feature spaces in Lemma 5.1, and then give lower bounds. Finally, we will apply it to prove Proposition 5.3 and Proposition 5.5. Proof of Lemma 5.1. Let U = (u1, . . . , ud)⊤ and VS = (v(x1), . . . , v(xn)). Then it is clear U VS =  u⊤1 v(x1) ... u⊤d v(x1)    * * * ... * * * u⊤1 v(xn) ... u⊤d v(xn)  .    Mǫ =  ǫ1,1 ... ǫd,1    * * * ... * * * ǫ1,n ... ǫd,n     Rd n. × ∈ Let Then we have ǫt,ju⊤t v(xj ) = Xt ∈ [n] [d] Xj ∈ = Mǫ, U VSi (cid:10) U ⊤, VSM ⊤ǫ U ⊤ VSM ⊤ǫ k∗ , kk ≤ k = trace(M ⊤ǫ U VS) = trace(U VSM ⊤ǫ ) where trace denotes the trace of a matrix. Therefore, we have (cid:10) (cid:11) sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj ) = sup ,v U ∈U ≤ Λ sup v ∈V The proof is completed. Proof of Lemma 5.2. Note ǫt,ju⊤t v(xj ) ∈V Xt [d] Xj [n] ∈ ∈ VSM ⊤ǫ k∗ k = Λ sup v ǫ1,jv(xj ), . . . , ǫd,jv(xj ) . [n] Xj ∈ ∗ (cid:1)(cid:13) (cid:13) [n] (cid:0) Xj ∈V (cid:13) (cid:13) ∈ ǫj,t,1ft( ̃xj) + ǫj,t,2ft( ̃x+ j ) + ǫj,t,3ft( ̃x−j ) = [d] [nk] Xt ∈ Xj (cid:12) ∈ (cid:12) (cid:12) max (cid:0) ǫj,t,1ft( ̃xj)+ǫj,t,2ft( ̃x+ (cid:1)(cid:12) (cid:12) (cid:12) j )+ǫj,t,3ft( ̃x−j ) n Xj ∈ [d] [nk] Xt ∈ (cid:0) According to the symmetry of we know (cid:1) , − F nk ǫj,t,1ft( ̃xj )+ǫj,t,2ft( ̃x+ j )+ǫj,t,3ft( ̃x−j ) . (cid:1)o Xj ∈ [d] [nk] Xt ∈ (cid:0) C = { ( ̃xj, ̃x+ max j , ̃x− j ) } Eǫ ∼{± nk j=1⊆ SH 1 } d 1 ×{± } ×{± 1 3 } h ≥ sup f ∈F { ( ̃xj , ̃x+ max j , ̃x− j ) } Eǫ ∼{± nk j=1⊆ SH nk 1 } d 1 ×{± } ×{± 1 3 } sup f ∈F (cid:12) (cid:12) (cid:12) ǫj,t,1ft( ̃xj) + ǫj,t,2ft( ̃x+ j ) + ǫj,t,3ft( ̃x−j ) Xj ∈ [d] [nk] Xt ∈ (cid:0) ǫj,t,1ft( ̃xj ) + ǫj,t,2ft( ̃x+ j ) + ǫj,t,3ft( ̃x−j ) (cid:1)(cid:12) (cid:12) (cid:12) i , Xj ∈ [d] [nk] Xt ∈ (cid:0) h(cid:12) (cid:12) (cid:12) i (cid:1)(cid:12) (cid:12) (cid:12) where we have used the Jensen's inequality in the last step. Since we take maximization over ( ̃xj, ̃x+ j , ̃x−j ) } nk j=1 ⊆ S H { , we can choose ( ̃xj, ̃x+ j , ̃x−j ) = ( ̃x, ̃x+, ̃x−) 21 ǫj,t,1ft( ̃x) + ǫj,t,2ft( ̃x+) + ǫj,t,3ft( ̃x−) S . Then we get for any ( ̃x, ̃x+, ̃x−) ∈ C ≥ sup f ∈F max ( ̃x, ̃x+, ̃x−) SH ∈ H Eǫ nk 1 ∼{± } d 1 ×{± } ×{± 1 3 } 2− ≥ = 2− 1 2 sup f ∈F 1 2 sup f ∈F max ( ̃x, ̃x+, ̃x−) SH ∈ max ( ̃x, ̃x+, ̃x−) SH ∈ = √2− 1nk sup f max ( ̃x, ̃x+, ̃x−) (cid:0) f ( ̃x) k (cid:16) Xj ∈ [d] [nk] Xt ∈ k (cid:0) f ( ̃x) k [nk] (cid:16) Xj ∈ SH ∈ k [d] [nk] Xt Xj h(cid:12) (cid:0) ∈ ∈ (cid:12) (cid:12) t ( ̃x+) + f 2 t ( ̃x) + f 2 f 2 t ( ̃x−) 2 2 + f ( ̃x+) k k 2 2 + k f ( ̃x−) k 2 2 + f ( ̃x+) k k 2 2 + f ( ̃x−) k k 1 2 1 2 (cid:1)(cid:17) 2 2 (cid:1)(cid:17) , 1 2 2 2 (cid:17) where we have used the following Khitchine-Kahane inequality [13] (cid:16) ∈F n Eǫ i=1 X (cid:12) (cid:12) ǫiti 1 2 2− ≥ (cid:12) (cid:12) n i=1 X (cid:2) 1 2 , 2 ti| | (cid:3) t1, . . . , tn ∈ ∀ R, The proof is completed. Remark D.1. The analysis in the proof implies a lower bound for R e S( S = z1, . . . , zn} { F e Indeed, by the symmetry of , the Jensen inequality and Eq. (D.1), we have e R e S( F ) ≥ 1 √2n sup e f F (cid:13) (cid:0) (cid:13) ∈ f (z1), . . . , f (zn) 2. (cid:1)(cid:13) (cid:13) e i (cid:1)(cid:12) (cid:12) (cid:12) (D.1) and F e ) for a symmetric F ) = Eǫ R e S( F 1 n sup e f F ∈ (cid:2) [n] Xi ∈ e 1 n ≥ Eǫ sup e f F ∈ 1 n sup e f F ∈ ǫif (zi) = Eǫ ǫif (zi) (cid:3) ǫif (zi) ≥ (cid:3) (cid:12) (cid:12) [n] Xi ∈ (cid:2) 1 √2n [n] Xi ∈ (cid:12) (cid:12) sup e f [n] F (cid:16) Xi ∈ ∈ (cid:12) (cid:3) (cid:12) f 2(zi) (cid:17) 1 2 . (cid:2)(cid:12) (cid:12) D.1 Proof of Proposition 5.3 The following Khintchine-Kahane inequality [13, 27] is very useful for us to estimate Rademacher complexities. Lemma D.2. Let ǫ1, . . . , ǫn be a sequence of independent Rademacher variables. (a) Let v1, . . . , vn ∈ H 1 there holds p ≥ , where H is a Hilbert space with k * k being the associated norm. Then, for any Eǫk n i=1 X (cid:2) (cid:3) p 1 p p ǫivik ≤ max( p 1, 1) − 1 2 . 2 vik k (D.2) (b) Let X1, . . . , Xn be a set of matrices of the same dimension. For all q 2, n i=1 X (cid:2) (cid:3) ≥ n n Eǫ ǫiXi q Sq 1 q 1 4 2− ≤ qπ e r max n X ⊤i Xi 1 2 , Sq i=1 X (cid:1) p∗. The dual norm of (cid:13) (cid:0) (cid:13) (cid:13) (cid:13) i=1 X n(cid:13) (cid:0) (cid:13) ≤ XiX ⊤i (cid:1) k * k2,p is 1 2 . Sq (D.3) o (cid:13) (cid:13) k * k2,p∗. Therefore, (cid:16) i=1 X (cid:13) (cid:13) Proof of Proposition F.1. Let q (cid:13) (cid:13) (cid:17) according to Lemma 5.1 and Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj ) ≤ ≥ k * kp∗ p. It is clear q∗ ≤ k * kq∗ we know ǫt,jxj ΛEǫ Λ ≤ [n] Xj ∈ (cid:16) Xt [d] ∈ Eǫ (cid:13) (cid:13) (cid:13) (cid:13) ǫt,jxj (cid:17) q∗ 2 (cid:16) [d] h Xt ∈ [n] Xj ∈ (cid:13) (cid:13) i(cid:17) (cid:13) (cid:13) 22 p∗ 2 1/p∗ ≤ 1/q∗ ΛEǫ 1/q∗ ǫt,jxj q∗ 2 = Λ (cid:16) Xt [d] ∈ dEǫ (cid:16) (cid:13) (cid:13) (cid:13) (cid:13) [n] Xj ∈ ǫjxj (cid:17) 1/q∗ , (cid:13) (cid:13) q∗ 2 [n] Xj ∈ (cid:17) (cid:13) (cid:13) where we have used Jense's inequality and the concavity of x x1/q∗ 7→ . By Lemma D.2, we know Eǫ [n] Xj ∈ (cid:13) (cid:13) ǫjxj q∗ 2 ≤ max( 1, 1)q∗ q∗ − (cid:13) (cid:13) p ∗ q 2 . 2 2 xjk k (cid:17) [n] (cid:16) Xj ∈ It then follows that Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj ) ≤ Λd1/q∗ max( q∗ − p 1, 1) [n] (cid:16) Xj ∈ 2 2 xjk k 1 2 . (cid:17) Note the above inequality holds for any q We now prove Part (b). Since the dual norm of ≥ p. This proves Part (a). k * kSp is Eǫ sup f ǫt,jft(xj) ΛEǫ ≤ ∈F Xt ∈ [n] [d] Xj ∈ [n], define k * kSp∗ , by Lemma 5.1 we know ǫd,jxj ǫ1,jxj, . . . , Sp∗ . [n] (cid:0) Xj (cid:13) (cid:13) ∈ [n] Xj ∈ (cid:1)(cid:13) (cid:13) For any t [d] and j ∈ ∈ i.e., the t-th column of Xt,j = 0 0 xj 0 * * * * * * 0 , (cid:17) (cid:16) Xt,j = xj, and other columns are zero vectors. This implies that e e ǫ1,jxj , . . . , ǫd,jxj = ǫt,j Xt,j. It is clear that Xt,j ∈ [n] (cid:0) Xj X ⊤t,j = xjx⊤j and [n] Xj ∈ (cid:1) Xt ∈ [n] [d] Xj ∈ e e e X ⊤t,j Xt,j = e e  0 ... ...     0   * * * . . . 0 * * * * * * x⊤j xj * * * * * * 0 0 0 . . . .        = x⊤j xjdiag(0, . . . , 0 , 1, 0 . . . , 0), 1 t − | {z } where diag(a1, . . . , an) denotes the diagonal matrix with elements a1, . . . , an. Therefore, we have Xt,j X ⊤t,j = d xjx⊤j Xt ∈ [n] [d] Xj ∈ e e [n] Xj ∈ X ⊤t,j Xt,j = x⊤j xj Id d, × [n] (cid:0) Xj ∈ (cid:1) Xt ∈ [n] [d] Xj ∈ d denotes the identity matrix in Rd e e d. Therefore, we can apply Lemma D.2 to show that × and where Id × Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj) Λ Eǫ (cid:16) Λ2− 1 4 ≤ ≤ The proof is completed. [n] (cid:0) Xj (cid:13) ∈ (cid:13) q∗π e r 1/q∗ q∗ S∗ q (cid:1)(cid:13) (cid:13) 1 2 (cid:17) , d1/q∗ Sq∗ (cid:13) (cid:13) (cid:13) 2 2 xjk k 1 2 . o (cid:1) [d] (cid:0) Xj ∈ ǫ1,jxj, . . . , ǫd,jxj [n] Xj ∈ max d xjx⊤j [n] Xj ∈ (cid:17) (cid:16) n(cid:13) (cid:13) (cid:13) 23 D.2 Proof of Proposition 5.5 For convenience we introduce the following sequence of function spaces Vk = x 7→ σk Vkσ Vk σ(V1x) 1 * * * − : VjkF ≤ k Bj , k [L]. ∈ n (cid:0) (cid:0) (cid:1)(cid:1) o To prove Proposition 5.5, we need to introduce several lemmas. The following lemma shows how the supremum over a matrix can be transferred to a supremum over a vector. It is an extension of Lemma N, and can be proved exactly by the arguments in Golowich 1 in Golowich et al. [16] from d = 1 to d et al. [16]. ∈ Lemma D.3. Let σ : R which is applied elementwise. Then for any vector-valued function class R be a 1-Lipschitz continuous, positive-homogeneous activation function 7→ F sup Rh×h′ ̃f e F ,V : V B F k k ∈ ∈ ≤ Xt ∈ [d] (cid:13) (cid:13) (cid:13) Proof. Let v⊤1 , . . . , v⊤h be rows of matrix V , i.e., V ⊤ = property of activation function we have [n] Xj ∈ ǫt,jσ(V ̃f (xj )) (cid:13) (cid:13) (cid:13) 2 2 ≤ B2 sup Rh′ : ∈ ̃v k ̃f ∈ , ̃v e F v1, . . . , vh 1 k2≤ e sup ̃v k2≤ ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) . Then by the positive-homogeneous [d] (cid:12) Xt ∈ (cid:12) (cid:12) [n] Xj ∈ k 1 2 . 2 ǫt,jσ(V ̃f (xi)) 2 (cid:13) (cid:13) (cid:13) [n] Xj ∈ Xt ∈ [d] (cid:13) (cid:13) (cid:13) = = ≤ ≤ The proof is completed. (cid:0) ̃f (xj )) (cid:1) 2 ̃f (xj )) ǫt,jσ k (cid:16)  (cid:13) (cid:13) (cid:13)  (cid:13)  (cid:13) 2 (cid:13)  (cid:13) v⊤r (cid:13) vrk2 ǫt,jσ [n] ǫt,jσ(v⊤1 ... [n] ǫt,jσ(v⊤h j ∈ P  j ∈    P 2 vrk 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) k [d] Xt ∈ [h] Xr ∈ [n] ∈ Xt ∈ 2 2 [d] (cid:18) Xj max [h] r ∈ (cid:17) vrk k (cid:16) Xr [h] ∈ B2 sup ̃v k2≤ k k Xj [n] Xt [d] (cid:12) (cid:16) ∈ ∈ (cid:12) 2 (cid:12) ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) 1 [d] (cid:12) Xt ∈ (cid:12) (cid:12) [n] Xj ∈ = Xt ∈ [h] [d] Xr ∈ 2 ̃f (xj) (cid:17)(cid:19) ̃f (xj ) v⊤r vrk2 . 2 (cid:17)(cid:12) (cid:12) (cid:12) 2 ǫt,jσ(v⊤r ̃f (xj ))     [n] Xj ∈ The following lemma gives a general contraction lemma for Rademacher complexities. It allows us to remove a nonlinear function ψ, which is very useful for us to handle the activation function in DNNs. Lemma D.4 (Contraction Lemma, Thm 11.6 in Boucheron et al. [7]). Let ̃τ : R+ 7→ and nondecreasing. Suppose ψ : R ̃t | − Then the following inequality holds for any R is contractive in the sense ψ( ̃t) | ≤ | ψ(t) 7→ − t | F R+ be convex and ψ(0) = 0. Eǫ ̃τ sup e f F ∈ (cid:18) n ǫiψ e f (xi) i=1 X (cid:0) (cid:19) (cid:1) ≤ Eǫ ̃τ (cid:18) n sup e f F ∈ i=1 X ǫif (xi) . (cid:19) The following lemma gives bounds of moment generation functions for a random variable Z = n ǫiǫjaij, which is called a Rademacher chaos variable [13, 44]. i<j 1 ≤ ≤ P Lemma D.5 (page 167 in De la Pena & Gin ́e [13]). Let ǫi, i Let ai,j ∈ [n]. Then for Z = R, i, j n ǫiǫjaij we have i<j ∈ ∈ 1 ≤ ≤ [n] be independent Rademacher variables. Eǫ exp Z | | (cid:16) P /(4es) (cid:17) ≤ 2, where s2 := a2 i,j. i<j X1 ≤ ≤ n 24 Proof of Proposition 5.5. The dual norm of know k * kF is k * kF . Therefore, according to Lemma 5.1 we Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj ) ≤ ΛEǫ sup v [d] ∈V (cid:16) Xt ∈ [n] Xj ∈ ǫt,jv(xj ) 1/2 2 2 (cid:17) (cid:13) (cid:13) [n] Xj ∈ Xt ∈ [d] (cid:13) (cid:13) (cid:13) = ΛEǫ (cid:18) ̃f ∈V L−1,V : BL F k ≤ (cid:13) (cid:13) sup V k ΛBLEǫ ≤ (cid:18) ̃f ∈V sup L−1, ̃v: ̃v k 2 2 1 2 (cid:19) 2 1 2 , (cid:19) ǫt,jσ(V ̃f (xj)) (cid:13) (cid:13) (cid:13) ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) 1 k2≤ Xj [n] ∈ 0 and τ (x) = exp(λx2). It is clear ). It then follows from the Jensen's inequality that [d] (cid:12) Xt ∈ (cid:12) (cid:12) ≥ where we have used Lemma D.3 in the second inequality. Let λ that τ is convex and increasing in the interval [0, ∞ exp λ (cid:18) (cid:16) Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ 2 ǫt,jft(xj ) (cid:19) (cid:17) ≤ ≤ exp λ ΛBLEǫ (cid:18) (cid:18) sup L−1, ̃v: k ̃v 1 k2≤ (cid:18) ̃f ∈V Eǫ exp λ ΛBL (cid:18) (cid:18) sup L−1, ̃v: k (cid:18) ̃f ∈V ̃v 1 k2≤ [n] Xj ∈ [d] (cid:12) Xt ∈ (cid:12) (cid:12) [n] Xj ∈ [d] (cid:12) Xt ∈ (cid:12) (cid:12) [n] Xj ∈ [d] (cid:12) Xt ∈ (cid:12) (cid:12) sup L−1, ̃v: k ̃f ∈V ̃v 1 k2≤ = Eǫ exp λΛ2B2 L Eǫ exp ≤ (cid:18) (cid:18) λΛ2B2 L = Eǫ exp (cid:18) Yt [d] ∈ Eǫt exp = [d] Yt ∈ = Eǫ ∼{± Xt [d] ∈ λΛ2B2 L sup L−1, ̃v: k ̃f ∈V ̃v k2≤ sup L−1, ̃v: k ̃f ∈V ̃v k2≤ λΛ2B2 L (cid:18) sup L−1, ̃v: k ̃f ∈V ̃v k2≤ [n] Xj ∈ [n] Xj ∈ 1 (cid:12) (cid:12) (cid:12) 1 (cid:12) (cid:12) (cid:12) [n] Xj ∈ 1 (cid:12) (cid:12) (cid:12) n exp 1 } dλΛ2B2 L (cid:18) ̃f sup L−1, ̃v: ̃v ∈V k k2≤ Xj [n] ∈ [d]. Let ̃τ : R+ 7→ 1 (cid:12) (cid:12) (cid:12) 1 2 2 2 (cid:19) (cid:19) 1 2 2 (cid:19) 2 (cid:19) (cid:19) (cid:19) ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) 2 (cid:19) (cid:19) 2 2 ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) ǫt,jσ( ̃v⊤ ̃f (xj)) (cid:12) (cid:12) (cid:12) ǫjσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) (cid:19) 2 R+ be defined as (cid:19) 2 , (cid:19) where we have used the independency between ǫt = (ǫt,j)j Lx2). Then we have ̃τ (x) = exp(dλΛ2B2 ∈ [n], t ∈ exp λ (cid:18) (cid:16) Eǫ sup f Eǫ ≤ ∼{± 1 } n ̃τ (cid:18) ∈F Xt ∈ [n] [d] Xj ∈ sup L−1, ̃v: ̃f ∈V 2 ǫt,jft(xj ) Eǫ ≤ ∼{± 1 n ̃τ } (cid:18) sup L−1, ̃v: k ̃f ∈V ̃v k2≤ (cid:19) (cid:17) ǫjσ( ̃v⊤ ̃f (xj)) + Eǫ (cid:19) ∼{± 1 } ̃v 1 k2≤ [n] Xj ∈ k n ̃τ (cid:18) ̃f ∈V 1 (cid:12) (cid:12) (cid:12) [n] Xj ∈ sup L−1, ̃v: ǫjσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) ǫjσ( ̃v⊤ ̃f (xj )) (cid:19) 1 − ̃v k2≤ k [n] Xj ∈ (cid:19) = 2Eǫ ∼{± 1 n ̃τ } (cid:18) sup L−1, ̃v: k ̃f ∈V ̃v k2≤ = Eǫ ∼{± 1 } n ̃τ (cid:18) ̃f ∈V sup L−1, ̃v: k ̃v 1 k2≤ 1 [n] Xj ∈ ̃v⊤ ǫjσ( ̃v⊤ ̃f (xj )) (cid:19) 2Eǫ ≤ ∼{± 1 n ̃τ } (cid:18) sup L−1, ̃v: ̃v k ̃f ∈V 1 k2≤ [n] Xj ∈ ǫj ̃v⊤ ̃f (xj ) ǫj ̃f (xj ) = Eǫ [n] Xj ∈ (cid:19) ∼{± 1 n ̃τ } (cid:18) sup ̃f ∈V ǫj ̃f (xj) (cid:13) (cid:13) (cid:13) . (cid:19) 2 [n] Xj ∈ L−1 (cid:13) (cid:13) (cid:13) (cid:19) (D.4) where we have used Lemma D.4 and the contraction property of σ in the last inequality. 25 According to Lemma D.3, we know Eǫ ∼{± 1 n ̃τ } (cid:18) sup ̃f ∈V [n] Xj ∈ L−1 (cid:13) (cid:13) (cid:13) ǫj ̃f (xj) (cid:13) (cid:13) (cid:13) 2 (cid:19) = Eǫ ∼{± Eǫ ≤ ∼{± 1 n ̃τ } (cid:18) 1 n ̃τ } (cid:18) VL−1k k F BL 1 − ̃v k It then follows that sup BL−1, ̃f ≤ sup 1, ̃f k2≤ ∈V ǫjσ VL − 1 ̃f (xj ) ǫjσ (cid:0) (cid:0) ̃v⊤ ̃f (xj ) (cid:1)(cid:12) (cid:12) (cid:12) . (cid:19) ∈V L−2 (cid:13) (cid:13) (cid:13) [n] Xj ∈ [n] Xj ∈ L−2 (cid:12) (cid:12) (cid:12) (cid:19) 2 (cid:1)(cid:13) (cid:13) (cid:13) Eǫ 1 n ̃τ } ∼{± Eǫ ≤ ∼{± 1 } n ̃τ sup (cid:18) ̃f ∈V L−1 (cid:13) (cid:13) (cid:13) 1 BL − (cid:18) ǫj ̃f (xj ) 2 (cid:13) (cid:13) (cid:13) [n] Xj ∈ sup 1, ̃f ∈V ̃v k k2≤ = 2Eǫ ∼{± = 2Eǫ ∼{± 1 n ̃τ } BL 1 n ̃τ } BL (cid:18) (cid:18) 1 − 1 − ̃v k ̃v k sup 1, ̃f k2≤ ∈V sup 1, ̃f k2≤ ∈V (cid:19) ǫjσ ̃v⊤ ̃f (xj) + Eǫ L−2 [n] Xj ∈ (cid:0) ǫjσ (cid:19) (cid:1) ̃v⊤ ̃f (xj ) (cid:19) (cid:1) L−2 [n] Xj ∈ ̃v⊤ (cid:0) ǫj ̃f (xj) L−2 [n] Xj ∈ (cid:19) 2Eǫ ≤ ∼{± 1 n ̃τ } BL (cid:18) 2Eǫ ≤ ∼{± 1 } n ̃τ BL (cid:18) 1 − We can apply the above inequality recursively and derive ∼{± 1 } n ̃τ BL (cid:18) 1 − ̃v k sup 1, ̃f k2≤ ∈V − L−2 ǫjσ ̃v⊤ ̃f (xj) [n] Xj ∈ (cid:0) (cid:19) (cid:1) sup 1, ̃f k2≤ ∈V 1 − ̃v k sup ̃f ∈V [n] Xj ∈ L−2 (cid:13) (cid:13) (cid:13) ǫj ̃v⊤ ̃f (xj ) (cid:19) L−2 Xj [n] ∈ ǫj ̃f (xj) (cid:13) (cid:13) (cid:13) . (cid:19) 2 Eǫ 1 n ̃τ } ∼{± sup (cid:18) ̃f ∈V ǫj ̃f (xj ) 2 (cid:13) (cid:13) (cid:13) 2L − 1Eǫ ∼{± ≤ (cid:19) 1 n ̃τ } (cid:18) BL B1 1 * * * − ǫjxj . (cid:19) 2 (cid:13) (cid:13) (cid:13) [n] Xj ∈ (cid:13) (cid:13) (cid:13) [n] Xj ∈ L−1 (cid:13) (cid:13) (cid:13) Furthermore, by Eq. (D.4) we know Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj ) = τ − 1τ (cid:18) Eǫ sup f ǫt,jft(xj) (cid:19) 1 τ − Eǫ (cid:18) ∼{± ∈F Xt ∈ n ̃τ } [n] [d] Xj ∈ sup 1 (cid:18) ̃f ∈V 1 τ − 2L − 1Eǫ (cid:18) n ̃τ ∼{± 1 } (cid:18) ≤ ≤ L−1 (cid:13) (cid:13) (cid:13) BL − [n] Xj ∈ 1 * * * ǫj ̃f (xj ) 2 (cid:13) (cid:13) (cid:13) B1 (cid:19)(cid:19) ǫjxj = τ − 1 2L − 1Eǫ (cid:18) n exp ∼{± 1 } (cid:18) dλΛ2B2 [n] Xj ∈ (cid:13) (cid:13) (cid:13) LB2 L 1 * * * − 2 (cid:13) (cid:13) (cid:13) B2 1 (cid:19)(cid:19) ǫjxj 2 2 , (cid:19)(cid:19) Xj [n] ∈ B2 (cid:13) (cid:13) (cid:13) 1. Then (cid:13) (cid:13) (cid:13) 1 * * * where the last identity follows from the definition of ̃τ . Let λ0 = dλΛ2B2 LB2 L − Eǫ 1 n exp } ∼{± λ0 (cid:16) ǫjxj 2 2 (cid:13) (cid:13) (cid:13) (cid:17) [n] Xj ∈ (cid:13) (cid:13) (cid:13) = Eǫ 1 n exp } ∼{± λ0 (cid:16) xjk k ≤ exp λ0 (cid:16) [n] Xj ∈ Xj [n] ∈ Eǫ 2 2 (cid:17) xjk k 2 2 + 2λ0 1 n exp } ∼{± ǫiǫjx⊤i xj n X1 i<j ≤ ≤ 2λ0 (cid:17) ǫiǫjx⊤i xj . (cid:16) i<j X1 ≤ ≤ n (cid:17) We choose λ = B2 1 apply Lemma D.5 to derive that 8esdΛ2B2 L−1*** 1 LB2 , where s = n(x⊤i xj )2 i<j 1 ≤ ≤ (cid:0) P (cid:1) 1 2 . Then it is clear λ0 = 1 8es . We can Eǫ ∼{± 1 } n exp 2λ0 ǫiǫjx⊤i xj (cid:16) i<j X1 ≤ ≤ n 2 ≤ (cid:17) and therefore Eǫ ∼{± 1 } n exp λ0 (cid:16) [n] Xj ∈ (cid:13) (cid:13) (cid:13) ǫjxj 2 2 (cid:13) (cid:13) (cid:13) 26 ≤ (cid:17) 2 exp λ0 (cid:16) [n] Xj ∈ 2 2 xjk k . (cid:17) We know τ − 1(x) = λ− 1 log x. It then follows that Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ p ǫt,jft(xj) ≤ ≤ λ− 1(L (cid:18) λ− 1(L (cid:18) − − 1) log 2 + λ− 1 log Eǫ ∼{± 1 } n exp λ0 ǫjxj 1 2 2 2 (cid:13) (cid:13) (cid:13) (cid:17)(cid:19) [n] Xj ∈ (cid:13) (cid:13) (cid:13) xjk (cid:16) k [n] Xj ∈ 1 2 2 2 (cid:17)(cid:17)(cid:19) 1) log 2 + λ− 1 log 2 exp λ0 (cid:16) 1 2 (cid:16) 2 2 xjk k (cid:19) [n] Xj ∈ = λ− 1L log 2 + λ− 1λ0 (cid:18) = 8esdΛ2B2 LB2 L (cid:18) 1 * * * − B2 1L log 2 + dΛ2B2 LB2 L B2 1 1 * * * − 1 2 xjk k 2 2 (cid:19) [n] Xj ∈ = √dΛBLBL The proof is completed by noting 8e(log 2) B1 8esL log 2 + (cid:18) 1 2 . xjk k 2 2 (cid:19) [n] Xj ∈ 1 * * * − 16. ≤ Remark D.6. Our proof of Proposition 5.5 is motivated by the arguments in Golowich et al. [16], which studies Rademacher complexity bounds for DNNs with d = 1. Our analysis requires to introduce techniques to handle the difficulty of considering d features simultaneously. Indeed, we control the Rademacher complexity for learning with d features by Eǫ sup f ∈F Xt ∈ If d = 1, this becomes [n] [d] Xj ∈ ǫt,jft(xj) Eǫ ≤ sup L−1, ̃v: ̃v k 1 k2≤ (cid:18) ̃f ∈V ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) [n] Xj ∈ [d] (cid:12) Xt ∈ (cid:12) (cid:12) 2 1 2 . (cid:19) Eǫ sup f ∈F Xt ∈ [n] [d] Xj ∈ ǫt,jft(xj) Eǫ ≤ sup L−1, ̃v: ̃v k ̃f ∈V k2≤ , ǫjσ( ̃v⊤ ̃f (xj)) (cid:12) (cid:12) (cid:12) [n] Xj ∈ 1 (cid:12) (cid:12) (cid:12) and the arguments in Golowich et al. [16] apply. There are two difficulties in applying the arguments N. First, the term in Golowich et al. [16] to handle general d ∈ [d] be written as a Rademacher complexity due to the summation over t [d]. Second, there is a square P . To handle this difficulty, we introduce the function function of the term τ (x) = exp(λx2) instead of the function τ (x) = exp(λx) in Golowich et al. [16]. To this aim, we need j ǫiǫj(x⊤i xj)2, to handle the moment generation function of a Rademacher chaos variable which is not a sub-Gaussian variable. As a comparison, the analysis in Golowich et al. [16] considers [n] ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∈ (cid:12) P P t ∈ i<j (cid:12) (cid:12) (cid:12) ≤ ≤ ∈ ∈ 1 j j [n] ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) cannot P the moment generation function for a sub-Gaussian variable. One can also use the following inequality ∈ (cid:18) Xt [d] (cid:12) (cid:12) (cid:12) [n] Xj ∈ ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) , ǫt,jσ( ̃v⊤ ̃f (xj )) (cid:12) (cid:12) (cid:12) [n] Xj ∈ [d] (cid:12) Xt ∈ (cid:12) (cid:12) 1 2 2 ≤ (cid:19) the latter of which can then be further controlled by the arguments in Golowich et al. [16]. This, however, incurs a bound with a linear dependency on d. As a comparison, our analysis gives a bound with a square-root dependency on d. 27 E A General Vector-contraction Inequality for Rademacher Complexities In this section, we provide a general vector-contraction inequality for Rademacher complexities, which recovers Lemma A.1 with τ (a) = a. The lemma is motivated from Lemma D.4 by considering a general convex and nondecreasing τ . Theorem E.1. Let Let τ : R+ → are G-Lipschitz continuous w.r.t. F be a class of bounded functions f : R+ be a continuous, non-decreasing and convex function. Assume ̃g1, . . . , ̃gn : Rd Z 7→ Rd which contains the zero function. R → k * k2 and satisfy ̃gi(0) = 0. Then Eǫ n τ 1 ∼{± } sup f ∈F n ǫi ̃gi(f (xi)) Eǫ 1 ndτ } ∼{± ≤ G√2 sup f ∈F (cid:17) The following lemma is due to [28]. We provide here the proof for completeness. (cid:16) (cid:16) i=1 X j=1 X i=1 X (cid:17) n d ǫi,jfj(xi) . (E.1) Lemma E.2. Let that ̃g1, . . . , ̃gn : Rd F be a class of functions f : R are G-Lipschitz continuous w.r.t. Z 7→ → k * k2. Then, Rd and g be any functional defined on . Assume F n Eǫ ∼{± 1 } n sup f ∈F (cid:2) g(f ) + ǫi ̃gi(f (xi)) i=1 X (cid:3) Eǫ ≤ ∼{± g(f ) + G√2 1 nd sup } f ∈F h n d . ǫi,jfj(xi) i i=1 X j=1 X (E.2) Proof. We prove this result by induction. According to the symmetry between f and ̃f , we derive g(f ) + n ǫi ̃gi(f (xi)) i=1 X g(f ) + g( ̃f ) + Eǫn sup f ∈F (cid:2) sup f, ̃f 1 2 = ∈F h = 1 2 g(f ) + g( ̃f ) + sup f, ̃f ∈F h (cid:3) ǫi ̃gi(f (xi)) + ǫi ̃gi(f (xi)) + 1 n − i=1 X 1 n − i=1 X 1 n − i=1 X 1 n − i=1 X ǫi ̃gi( ̃f (xi)) + ̃gn(f (xn)) − ̃gn( ̃f (xn)) i ̃gn( ̃f (xn)) − ǫi ̃gi( ̃f (xi)) + ̃gn(f (xn)) , (E.3) According to the Lipschitz property and Eq. (D.1), we derive (cid:12) (cid:12) ̃gn(f (xn)) − ̃gn( ̃f (xn)) G f (xn) ≤ ̃f (xn) − 2 ≤ (cid:12) (cid:12) (cid:12) (cid:12) (cid:13) (cid:13) (cid:13) (cid:13) G√2Eǫn,1,...,ǫn,j ǫn,j fj(xn) d j=1 X (cid:2) (cid:12) (cid:12) Plugging the above inequality back into (E.3) and using the Jensen's inequality, we get i (cid:12) (cid:12) ̃fj(xn) . − g(f ) + Eǫn sup f i=1 ∈F (cid:2) X Eǫn,1,...,ǫn,j sup 1 2 ≤ f, ̃f ∈F h n ǫi ̃gi(f (xi)) (cid:3) g(f ) + g( ̃f ) + = 1 2 Eǫn,1,...,ǫn,j sup g(f ) + g( ̃f ) + f, ̃f ∈F h = Eǫn,1,...,ǫn,j sup f ∈F h g(f ) + 1 n − i=1 X ǫi ̃gi(f (xi)) + ǫi ̃gi(f (xi)) + 1 n − i=1 X 1 n − i=1 X 1 n − i=1 X 1 n − i=1 X ǫi ̃gi( ̃f (xi)) + G√2 ǫn,j fj(xn) d ǫi ̃gi( ̃f (xi)) + G√2 j=1 X d (cid:12) (cid:12) (cid:2) ǫn,j fj(xn) j=1 X (cid:2) − ̃fj(xn) − ǫi ̃gi(f (xi)) + G√2 d j=1 X ǫn,jfj(xn) i , where we have used the symmetry in the second step. The stated result can be derived by continuing the above deduction with expectation over ǫn 2 and so on. − ǫn − 28 (cid:3)(cid:12) (cid:12) ̃fj(xn) i (cid:3)(cid:12) (cid:12) (cid:3)i 1, To prove Theorem E.1, we introduce the following lemmas on the approximation of a continuous, non-decreasing and convex function. Let a+ = max { a, 0 . } Lemma E.3. Let f : [a, b] → R+ be a continuous, non-decreasing and convex function and m R defined by < xm = b. Then the function ̃g : [a, b] 2. ≥ Let a = x1 < * * * → ̃g(x) = f (xk) + f (xk+1) − xk+1 − f (xk) xk (x − xk), if x [xk, xk+1] ∈ belongs to the set H[a,b] := c0 + n m i=1 X ci(x ti)+ : ci ≥ − 0, i [n], ti ∈ ∈ R, m N, x ∈ ∈ [a, b] . o (E.4) Proof. Define ̄f (x) = f (x1) + m 1 − i=1 X We first show that ̄f (x) = ̃g(x) for all x ∈ f (xi+1) f (xi) xi (x − xi+1 − [a, b]. Suppose that x − (cid:2) ̄f (x) = f (x1) + k 1 − i=1 X 1 m − + Xi=k+1 k − = f (x1) + 1 = f (xk) + f (xi+1) − xi+1 − f (xi) xi (cid:2) f (xi+1) − xi+1 − f (xi+1) f (xi) xi (cid:2) f (xi) xi i=1 X f (xk+1) − xi+1 − − xk+1 − f (xk) xk (x xi)+ − − (x − xi+1)+ + (cid:3) (cid:3) (x xi)+ − − (x − xi+1)+ (x xi) (x − − − xi+1) + (cid:2) − (x xk) = ̃g(x). (cid:3) xi)+ − (x − xi+1)+ . [xk, xk+1). Then, it is clear that (cid:3) ∈ f (xk+1) − xk+1 − f (xk) xk (cid:2) (x xk)+ − − (x − xk+1)+ (cid:3) f (xk+1) − xk+1 − f (xk) xk (x xk) 0 − − (cid:2) (cid:3) We now show that ̄f (x) belongs to the set H[a,b]. Indeed, it follows from (x xm = b that ≤ x xm)+ = 0 for all − ̄f (x) = f (x1) + m 1 − f (xi+1) − xi+1 − f (x1) x1 i=1 X f (x2) − x2 − = f (x1) + (x x1)+ + − f (xi) xi (x xi)+ − − m f (xi) f (xi xi 1 − − 1) (x xi)+ − − xi − m 1 − i=2 X f (xi+1) i=2 h X 1 m i=1 ci(x f (xi) f (xi) xi 1) f (xi xi (x − − − − xi − xi+1 − ti)+ with ti = xi, c0 = f (x1), c1 = f (x2) − x2− − 1. The terms c1, . . . , cm − i − 1 xi)+. 1 are all non-negative f (x1) x1 − Therefore, ̄f (x) can be written as ̄f (x) = c0+ and ci = f (xi+1) − − xi+1− − since f is non-decreasing and convex. The proof is completed. , i = 2, . . . , m P f (xi) xi − f (xi−1) xi−1 f (xi) xi − − Lemma E.4. If f : [a, b] R+ is continuous, non-decreasing and convex, then f belongs to the closure of H[a,b] defined in Eq. (E.4). → Proof. Let m ∈ Introduce N. We can find a = x(m) 1 < x(m) 2 < < x(m) n+1 = b such that * * * f (x(m) k ) f (x(m) 1) k − − ≤ f (b) f (a) . − n f (m)(x) := f (x(m) k ) + f (x(m) k+1) − x(m) k+1 − ) f (x(m) k x(m) k 29 x(m) k ) (x − if x ∈ [x(m) k , x(m) k+1]. For any x [x(m) k ∈ , x(m) k+1], it follows from the convexity of f that f (m)(x) | f (x) | − = f (x(m) k ) − f (x) + f (x(m) k+1) (cid:0) f (x(m) k+1) ) (x x(m) (cid:1) k f (x(m) k − x(m) k+1 − f (x(m) k ) (x x(m) (cid:1) k − x(m) k+1 − ) x(m) k x(m) k ) − (cid:12) (cid:12) (cid:12) x(m) k ) − f (b) f (a) , − n ≤ (cid:12) (cid:12) (cid:12) = f (x(m) k ) − f (x) + f (x(m) k+1) ≤ (cid:0) f (m)(x) f (x) | − (cid:0) f (x(m) k ) (x x(m) (cid:1) k − x(m) k+1 − = 0 for all x − ∈ from which we know limn for all m →∞ | ∈ N. Therefore, f belongs to the closure of H[a,b]. The proof is completed. [a, b]. Lemma E.3 shows that f (m) H[a,b] ∈ Proof of Theorem E.1. According to the boundedness assumption of f exist B > 0 such that and the fact 0 , there ∈ F ∈ F min 0 ≤ n sup f ∈F n i=1 X ǫi ̃gi(f (xi)), G√2 sup ∈F f n d ǫi,jfj(xi) i=1 X j=1 X o n max ≤ sup f ǫi ̃gi(f (xi)), G√2 sup ∈F f n R be an arbitrary number. Define gt : ∈F i=1 X n d ǫi,jfj(xi) i=1 X j=1 X o B ≤ R by gt(f ) = 0 for any f = 0 F 7→ for all ǫ 1 } and gt(0) = t. It is clear that n. Let t ∈ {± ∈ Eǫ ∼{± and gt(f ) + 1 n sup } f ∈F (cid:2) n i=1 X ǫi ̃gi(f (xi)) = Eǫ 1 n max } ∼{± (cid:3) f n sup :f =0 ∈F n i=1 X (cid:2) ǫi ̃gi(f (xi)) , t o (cid:3) n d gt(f ) + G√2 ǫi,jfj(xi) = Eǫ Eǫ ∼{± 1 nd sup } f ∈F (cid:2) i=1 X Plugging the above identities into (E.2) with g = gt gives j=1 X (cid:3) nd max G√2 1 ∼{± } f n sup :f =0 ∈F n d ǫi,jfj(xi) , t . i=1 X j=1 X (cid:2) o (cid:3) Eǫ 1 n max } ∼{± sup :f =0 f ∈F n o (cid:2) 0, the above inequality is equivalent to (cid:3) i=1 X If t ≥ n ǫi ̃gi(f (xi)) , t Eǫ 1 nd max } ∼{± ≤ G√2 f n sup :f =0 ∈F n d ǫi,jfj(xi) , t . i=1 X j=1 X (cid:2) o (cid:3) Eǫ 1 n max } ∼{± i=1 X by noting ̃gi(0) = 0 for all i n n ǫi ̃gi(f (xi)) , t Eǫ ≤ ∼{± 1 } nd max n d G√2 sup f ∈F (cid:2) n i=1 X j=1 X ǫi,jfj(xi) , t (E.5) o (cid:3) o (cid:3) sup f ∈F (cid:2) Nn. If t < 0, it follows from (E.2) with g(f ) = 0 that ∈ Eǫ ∼{± 1 } n max n i=1 X sup f ∈F (cid:2) n n = Eǫ ∼{± 1 } = Eǫ ∼{± 1 } n sup f ∈F (cid:2) nd max i=1 X ǫi ̃gi(f (xi)) , t o (cid:3) Eǫ n d ∼{± 1 } nd sup f ∈F h G√2 ǫi,jfj(xi) i i=1 X j=1 X ǫi ̃gi(f (xi)) ≤ (cid:3) n d G√2 sup f ∈F (cid:2) n i=1 X j=1 X ǫi,jfj(xi) , t , o (cid:3) 30 6 6 6 6 6 where we have used ̃gi(0) = 0 for all i Subtracting t from both sides of Eq. (E.5) gives ∈ Nn in the first identity. That is, (E.5) holds for all t R. ∈ n ǫi ̃gi(f (xi)) Eǫ n 1 ∼{± } sup f i=1 X from which we know ∈F (cid:16) Eǫ nd 1 } ∼{± + ≤ t − (cid:17) n d G√2 sup f ∈F (cid:2) (cid:16) i=1 X j=1 X ǫi,jfj(xi) (cid:3) t − , + (cid:17) R, (E.6) t ∀ ∈ Eǫ ∼{± 1 n ̃τ } (cid:16) sup f ∈F n i=1 X ǫi ̃gi(f (xi)) (cid:17) Eǫ ≤ ∼{± 1 nd ̃τ } (cid:16) n d G√2 sup f ∈F ǫi,jfj(xi) , i=1 X j=1 X (cid:17) ̃τ ∀ ∈ H[0,B]. According to Lemma E.4, we know τ : [0, B] (E.1) holds. The proof is completed. → R+ belongs to the closure of H[0,B]. Therefore, Eq. F Lipschitz Continuity of Loss Functions The following proposition is known in the literature [26]. We prove it for completeness. Proposition F.1. (a) Let l be defined as Eq. (3.2). Then l is 1-Lipschitz continuous w.r.t. and 1-Lipschitz continuous w.r.t. k * k2. k * k∞ (b) Let l be defined as Eq. (3.3). Then l is 1-Lipschitz continuous w.r.t. continuous w.r.t. k * k2. Proof. We first prove Part (a). For any v and v′, we have and 1-Lipschitz k * k∞ l(v) | l(v′) | − = max 0, 1 + max max 0, 1 + max vi} − (cid:9) v′i}| ≤ [k]{− i ∈ max i ∈ [k]{− (cid:8) vi − max [k] | i ∈ v′i| [k]{− i ∈ = v k v′i} (cid:9)(cid:12) v′ (cid:12) k∞ − , (cid:12) (cid:12) ≤ | (cid:8) [k]{− max i ∈ vi} − where we have used the elementary inequality max [k] i ∈ | ai − max [k] i ∈ bi| ≤ max [k] | i ∈ ai − . bi| This proves Part (a). We now prove Part (b). It is clear that ∂l(v) ∂vi = − 1 + exp( vi) − [k] exp( i ∈ − . vi) Therefore, the l1 norm of the gradient can be bounded as follows P exp( − vi) 1. ≤ [k] Xi ∈ l(v) k1 ≤ k∇ 1 + 1 [k] exp( − i ∈ vi) This proves Part (b). The proof is completed. P 31
http://arxiv.org/abs/2303.12753v1
2023-02-24T00:51:17
2023-02-24T00:51:17
On-Device Unsupervised Image Segmentation
Along with the breakthrough of convolutional neural networks, learning-based segmentation has emerged in many research works. Most of them are based on supervised learning, requiring plenty of annotated data; however, to support segmentation, a label for each pixel is required, which is obviously expensive. As a result, the issue of lacking annotated segmentation data commonly exists. Continuous learning is a promising way to deal with this issue; however, it still has high demands on human labor for annotation. What's more, privacy is highly required in segmentation data for real-world applications, which further calls for on-device learning. In this paper, we aim to resolve the above issue in an alternative way: Instead of supervised segmentation, we propose to develop efficient unsupervised segmentation that can be executed on edge devices. Based on our observation that segmentation can obtain high performance when pixels are mapped to a high-dimension space, we for the first time bring brain-inspired hyperdimensional computing (HDC) to the segmentation task. We build the HDC-based unsupervised segmentation framework, namely "SegHDC". In SegHDC, we devise a novel encoding approach that follows the Manhattan distance. A clustering algorithm is further developed on top of the encoded high-dimension vectors to obtain segmentation results. Experimental results show SegHDC can significantly surpass neural network-based unsupervised segmentation. On a standard segmentation dataset, DSB2018, SegHDC can achieve a 28.0% improvement in Intersection over Union (IoU) score; meanwhile, it achieves over 300x speedup on Raspberry PI. What's more, for a larger size image in the BBBC005 dataset, the existing approach cannot be accommodated to Raspberry PI due to out of memory; on the other hand, SegHDC can obtain segmentation results within 3 minutes while achieving a 0.9587 IoU score.
[ "Junhuan Yang", "Yi Sheng", "Yuzhou Zhang", "Weiwen Jiang", "Lei Yang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2303.12753v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2303.12753v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG" ]
On-Device Unsupervised Image Segmentation Junhuan Yang1 Yi Sheng2 Yuzhou Zhang3 Weiwen Jiang2 Lei Yang1 1 Information Sciences and Technology Department, George Mason University 2 Department of Electrical and Computer Engineering, George Mason University 3 Khoury College of Computer Sciences, Northeastern University 3 2 0 2 b e F 4 2 ] V C . s c [ 1 v 3 5 7 2 1 . 3 0 3 2 : v i X r a Abstract-Along with the breakthrough of convolutional neural net- works, in particular encoder-decoder and U-Net, learning-based segmen- tation has emerged in many research works. Most of them are based on supervised learning, requiring plenty of annotated data; however, to support segmentation, a label for each pixel is required, which is obviously expensive. As a result, the issue of lacking annotated segmentation data commonly exists. Continuous learning is a promising way to deal with this issue; however, it still has high demands on human labor for annotation. What's more, privacy is highly required in segmentation data for real-world applications, which further calls for on-device learning. In this paper, we aim to resolve the above issue in an alternative way: Instead of supervised segmentation, we propose to develop efficient unsupervised segmentation which can be executed on edge devices without annotated data. Based on our observation that segmentation can obtain high performance when pixels are mapped to a high-dimension space using their position and color information, we for the first time bring brain-inspired hyperdimensional computing (HDC) to the segmentation task. We build the HDC-based unsupervised segmentation framework, namely "SegHDC". In SegHDC, we devise a novel encoding approach, which follows the Manhattan distance. A clustering algorithm is further developed on top of the encoded high-dimension vectors to obtain segmentation results. Experimental results show that SegHDC can significantly surpass neural network-based unsupervised segmentation. On a standard segmentation dataset, DSB2018, SegHDC can achieve a 28.0% improvement in Intersection over Union (IoU) score; meanwhile, it achieves over 300× speedup on Raspberry PI. What's more, for a larger size image in the BBBC005 dataset, the existing approach cannot be accommodated to Raspberry PI due to out of memory; on the other hand, SegHDC can obtain segmentation results within 3 minutes while achieving a 0.9587 IoU score. I. INTRODUCTION Segmentation is a fundamental task in a lot of applications, such as shadow detection and medical imaging [1]–[3]. With the fast development of artificial intelligence (AI), targeting the segmentation tasks, there emerge both manually developed deep neural network architectures (e.g., encoder and decoder [4], [5] and U-Net [6]) as well as automated generated architectures (e.g., Auto-DeepLab [7]). These deep learning models have demonstrated superior performance on benchmarking datasets against segmentation in traditional imaging processing. However, when it comes to real-world applications, the lack of annotated data becomes a critical issue: on the one hand, the annotation demands human labor to label data which is costly, not mention to the segmentation tasks that require labels for each pixel; on the other hand, the lack of training data will drastically degrade segmentation performance. In consequence, how to perform segmentation without plenty of annotated data is highly desired. With such a need, unsupervised learning seems to be a natural answer, since it can discover useful patterns in data without annotation [8]. It seems straightforward to apply unsupervised learning to segmentation, however, the segmentation task itself and the demands from the application bring new challenges. First, unlike unsupervised classification (a.k.a, clustering), segmentation requires the process of features for every pixel to figure out which ones are compact enough to form distinct clusters. As such, unsupervised segmentation can require a deeper neural architecture, which makes the model much larger. Second, real-world segmentation applications commonly have data privacy demands (e.g., medical imaging) and real-time requirements (e.g., autonomous vehicles). The ideal solution to address data privacy is to process data on-device [9]–[14]; however, the edge devices have limited computation resources and they are facing a large model size, both of which conflict with the real-time requirement. To address the above challenges, we are rethinking what is the best computing model to extract features for segmentation tasks. For a long while, due to the superior performance of neural networks, they are typically adopted in unsupervised segmentation [15], [16]. However, as stated, it requires a large model size, which may easily exceed the capacity of edge devices. In segmentation, the pixel position and color are the most important information, and we find that it can achieve high performance if we smartly map the pixels into a high-dimensional space, according to the position and color information. With such motivation, in this paper, we for the first time bring a re- cent emerging computing model, i.e., brain-inspired hyperdimensional computing (HDC) [17], into image segmentation. HDC has shown its superiority in robustness, scalability, and high energy efficiency for classification tasks [18]–[22]. Fundamentally, HDC encodes data into a high-dimensional space using a hypervector (HV), and learns features in that space [23]. It seems that HDC is naturally suitable for segmentation; however, this characteristic of HDC has not been well developed and utilized. To bring HDC to segmentation, the first task is to figure out how to encode pixels such that the encoded pixels can precisely describe the disparity. What's more, since the feature extracted by HDC is represented in high-dimension; it is challenging to efficiently perform clustering on high-dimension vectors. To address these challenges, we propose a novel framework, namely SegHDC. Through a fundamental analysis of the characteristics of HDC and image segmentation, we first propose a brand-new HDC encoding approach to encode both position and color information into high dimensional space. Then, a revised K-Means algorithm has been devised to cluster encoded HVs and label corresponding pixels. The main contributions of this paper are as follows. • To the best of our knowledge, this is the first work to perform on-device unsupervised image segmentation. • We innovatively apply hyperdimensional computing for image segmentation tasks with a brand-new design for encoding images. • Evaluation results verify the effectiveness of SegHDC, which surpasses state-of-the-art unsupervised CNN-based algorithm. We have carried out a set of experiments on 3 commonly used segmentation datasets to evaluate the effectiveness of our proposed SegHDC. Experiment results on the DSB2018 dataset show the efficiency of SegHDC, specifically by outperforming the CNN-based baseline with 28.0% improvement in Intersection over Union (IoU) score; meanwhile, achieving over 300× speedup on the edge device. On the BBBC005 dataset with a larger size of images, SegHDC achieves an IoU score of 0.9414 which is 25.7% higher than the score obtained by the baseline. SegHDC also obtains a 0.9587 IoU score for a sample image in the BBBC005 dataset with a latency of only around 178 seconds, while the existing CNN-based unsupervised segmentation approach cannot predict this image due to the computing resources limitation. On the other dataset, MoNuSeg, SegHDC also gains an improvement of 8.27% compared with the baseline method. The remainder of the paper is as follows: Section II presents the related work and motivation. Section III demonstrates our proposed SegHDC framework. Experimental results and conclusion are in Section IV and Section V respectively. II. RELATED WORK AND MOTIVATION This section will first discuss the need for unsupervised segmen- tation and related work. Then, we provide our observation which motivates to use hyperdimensional computing for segmentation. Need and challenge: Unsupervised and on-device learning for image segmentation is highly demanded. Image segmentation is a typical task in machine learning, and supervised learning has a high cost of labeling. Unlike the classification task that one image needs only one label [24]–[27], the labeling of the segmentation dataset requires the assignment of a class to each pixel in an image. What's worse, since segmentation is largely required in domain-specific applications, like medical imaging, the labeling task commonly calls for domain expertise. For example, only good Computed Tomography (CT) doctors can distinguish if there is accurate lesion exists and where the accurate lesion is. The involvement of doctors to do the labeling work is obviously too costly. To overcome the high cost of labeling for segmentation tasks, unsupervised learning is highly demanded, which does not need labels of data to perform the segmentation tasks. What's more, unsupervised segmentation can be applied to perform the automated annotation. Although promising, unsupervised segmentation commonly requires a longer time over the inference of supervised learning. What's more, when unsupervised segmentation is applied to real-world applications, with the consideration of data security, in-situ and real-time processing on edge devices is typically required. Besides, the high cost of unsupervised learning and the limited computing resources on edge devices make the problem more challenging. Related work: Supervised segmentation has been widely studied, but unsupervised segmentation is still in its infancy. The very first deep learning-based image segmentation was pro- posed in [28], which used a fully convolutional network (FCN) to perform segmentation. Another popular method used encoder-decoder architecture segment the images [4], [5]. Inspired by the FCN and encoder-decoder architecture, U-Net [6] and V-Net [29] were proposed, which largely prompt the segmentation performance. Unsupervised segmentation becomes active recently. Authors in [30] presented a novel unsupervised segmentation method for the 3-D microstructure of lung cancer specimens in micro-computed tomography images. A CNN-based unsupervised image segmentation method was proposed in [16], and a clustering function was used after the CNN to cluster the pixels. Generative adversarial networks (GANs) were also used for unsupervised image segmentation [31]. The authors utilized the features generated by a GAN and trained the segmentation networks. Recently, there emerge research efforts in on-device learning for better deploying ML models on edge devices. Some traditional ML models, like SVMs, can be directly accommodated on edge devices [32]. In [33], the authors employ the "int8" quantization in both forward and backward passes over a deep model to enable on-device learning. Neural architecture search (NAS) is another solution to find tiny ML models and on-device training, like MCUNets [34]. Fig. 1. Vectorized pixels with the same color have a short distance in space. However, there is still a missing link between unsupervised segmentation and on-device learning. Instead of repeatedly designing algorithms based on convolutional neural networks, we believe new innovations are needed to fill such a gap. Observation: Vectorizing pixels in a high-dimension space can map pixels in a similar area. The previous segmentation works mainly employ convolutional neural networks (CNNs) to extract the feature of the pixels, which brings high computation costs and can easily become the performance bottleneck on edge devices. In this paper, we aim to simplify the feature extraction process for segmentation. Specifically, each pixel has two fundamental information: (1) position, and (2) color. The question is whether we can perform segmentation by only exploring the spatial and color correlation of pixels. To this end, we perform vectorization of pixel position and color and map each pixel in a high-dimension space. To enable the visualization, we limit the vector dimension to 3, as the example shown in Figure 1. In this example, we generate a 3 × 3 binary image. We randomly assign a binary vector to each row and column, and use XOR to associate the vectors between a row and a column to generate the vector of a position. We also randomly generate a vector for each color. For example, the first pixel has the vector of (1, 0, 1) for position and (0, 1, 1) for the white color. The second pixel has a different position vector (1, 1, 1) and the same vector for color. After we obtain these vectors, we sum up the pair of vectors at the same position to map the pixel to the 3-dimension space. The right-hand in Figure 1 shows the distribution of all these 9 pixels in the Cartesian coordinate system. We can easily observe that all the white pixels are mapped to a small area while the black pixels are mapped to another distinct area. Motivation: Using hyperdimensional computing (HDC) for unsu- pervised segmentation. The above example gives us the hint that mapping image pixels to high-dimension space can be an effective way to perform the segmentation. We are inspired and novelly involve hyperdimensional computing for segmentation process and apply it to more complicated images, to better represent pixels using vectors with much higher dimensions (e.g., 10,000) than the 3-dimension vectors used in the above example. Unlike the traditional ML algorithms to directly process data, HDC will encode data into a high-dimensional space, where the data are represented by high-dimensional and pseudo-orthogonal hypervectors −→ (HVs) [17]. For an HV with dimension d, we can denote it as H = (−→e1, −→e2, ..., −→ei , ..., −→ed), where −→ei represents the i − th element in −→ H . In this way, data can be encoded and features can be extracted HV in the high-dimensional space. Existing works have shown that HDC can work well on image classification [35]. To the best of our knowledge, there is no work to use HDC for segmentation tasks. It seems straightforward to extend HDC designed for classification to perform segmentation tasks. However, most of the existing classification approaches rely on the randomly generated vectors to represent pixels, while the relative relationship between Position:(1,0,1)White:(0,1,1)Vectorizep1p2p3p4p5p6p7p8p9p1,p5p2,p4p3p6,p8p7p9 Fig. 2. Overview of the SegHDC framework. different positions and between different colors is a key to extracting features in segmentation, which is not studied. As explored in our work, together with experimental results, directly applying the existing approach cannot perform a good segmentation. Therefore, a more dedicated design of position and color embedding is needed. With such vision, we have proposed a holistic framework to complete these tasks with details in Section III. III. SEGHDC FRAMEWORK In this section, we will formally introduce the SegHDC framework. As shown in Figure 2, SegHDC is mainly composed of 4 components: 1(cid:13) position encoder module, 2(cid:13) color encoder module, 3(cid:13) pixel HV producer, and 4(cid:13) clusterer. In the rest of this section, each component will be introduced in detail. 1(cid:13) Position Encoder Spatial information is one of the key pieces of information in one image, which is particularly important for segmentation. We need to clearly represent and measure both the relationship and the difference of pixels in different positions. Manhattan distance is a typical distance metric used to measure different positions in the 2-dimensional space (row and column), which will also be used in this paper to guide the position encoding. The main concept of Manhattan distance is that the distance between two points is the sum of the absolute differences of their Cartesian coordinates [36], i.e., L1 norm. In a plane with point p1 at (x1, y1) and point p2 at (x2, y2), their Manhattan distance is calculated as d1(p1, p2) = |x1 − x2| + |y1 − y2|. When we extend these two points p and q in a n dimension space, the Manhattan distance can be described as Equ 1, where, p = (p1, p2, ..., pn), q = (q1, q2, ..., qn). d1(p, q) = n (cid:88) |pi − qi| (1) i=1 Given any three pixels in a single channel image, p1 at i − th row and j − th column, p2 at m0 − th row and n0 − th column and p3 at m1 − th row and n1 − th column, we let the points meet Equ 2. d1(p1, p2) = d1(p1, p3), if f m0 + n0 = m1 + n1 f or ∀p1 = (i, j), ∀p2 = (m0, n0), ∀p3 = (m1, n1) (2) Inspired by randomly flipped elements in HVs in the traditional encoding method, we are going to use the element flip to represent the distance. To this end, we need to control the row and column at the same time and treat the image matrix (single channel) as in two dimension space instead of one dimension in the traditional encoding method. Take the rows HVs as the example, we first randomly generate a binary HV (all elements are "0" and "1" ) with a high dimensionality d, e.g., 10,000. The second step is to flip the next xrow (shown in Equ 3, where Nrow and Ncolumn means the number of rows/columns) elements. The process will be continued until the last row. A similar process will be conducted to columns, while the number of elements that need to be flipped is defined as xcol, shown in Equ 3. xrow = (cid:22) d (cid:23) Nrow , xcol = (cid:23) (cid:22) d Ncolumn (3) The most important step is to use an HV to represent the pixel at i − th row and j − th column. Classical HDC uses element-wise XOR Fig. 3. Distance between HV at 0-th row, 0-th column and others, when α and β set as 0.5 and 2 or multiplication to associate two HVs. Element-wise multiplication can not keep the distance, since any 0 can diminish the distance, and we can not control where the 0 should be. Element-wise XOR is naturally suitable for this operation. Thus we get the position HV to represent the pixel at i − th row and j − th column as y(i,j) = ri ⊕ cj. Thus, we can use the position HVs to describe the Manhattan distance, and we can have Equ 4. d1(ri ⊕ cj , ri+m0 ⊕ cj+n0 ) = d1(ri ⊕ cj , ri+m1 ⊕ cj+n1 ), f or ∀i, j, ∀m0, n0, ∀m1, n1, if f m0 + n0 = m1 + n1 (4) The distance of the above encoding is shown in Figure 3 (a). All the distances shown in the position are the distance between the position HV at p(0,0) (0 − th row and 0 − th column) and the position HV at p(i,i) (i − th row and i − th column). For example, the distance between p(0,0) and p(1,1) is 0, shown in the position at the intersection of the second row and second column(in the red circle). The x means the xrow and xcolumn defined in Euq 3. To simplify the question, we suppose xrow = xcol = x here. The zeroth row and zeroth column seem to meet the Manhattan distance, while other parts do not. For example, the distance between p(0,0) and p(1,1) (in the red circle) should be 2x instead of 0. This is because, for the pixel at i − th row and i − th column, the ri and ci flip the element on the same sites (shown in the top part of Figure 3 (a)). Thus r1 ⊕ c1 = ri ⊕ ci, and all the distances between p(1,1) and p(i,i) is 0. Similar distance diminishing occurs in other parts. So, we need to let the HVs of rows and columns flip different sites. Specifically, row HV can change the first half of row HV while column HV can change the second half of column HV. Thus the changes in row HV will not affect the changes in column HV, and vice versa. The distance of this encoding is shown in Figure 3 (b), and it meets Equ 4 now. We call this encoding method Manhattan distance encoding. However, all the distances add x from the closer one and it can not describe a smaller distance. Thus we bring a new hyperparameter α to describe the ratio of the half dimension which needs to be changed and thus control the flip unit. This encoding is called decay Manhattan distance encoding, and the distances when α set as 0.5 is shown in Figure 3 (c). And thus Equ 3 changes to Equ 5. (cid:22) α × d (cid:23) (cid:23) (cid:22) α × d 2 × Ncol (5) xrow = , xcol = 2 × Nrows PositionEncoderColorEncoderPixelHVsProducerClusterer12340x2x3xx0x2x2xx0x3x2xx00x2x3xx2x3x4x2x3x4x5x3x4x5x6x000.5x0.5x000.5x0.5x0.5x0.5xxx0.5x0.5xxx(a)Rowandcolumnuniformencoding(b)Manhattandistanceencoding(d)BlockdecayManhattandistanceencodingri0......nx...!"#ci0...nx2nx1(n2−1)x(n2+i+2)x...ri0x...ix...nx...ci0...nx!"#+ix......nx2...ri012...ix(i+1)x...nx$#+1x(i+1)x(n2−1)x...nx2$%!%##x...ci012...ix(i+1)x...nx00.5xx1.5x0.5xx1.5x2xx1.5x2x2.5x1.5x2x2.5x3xri0x...ix...nx...ci0...nx!"#+ix......nx2...$#+1xnx2$%!%##x...(c)DecayManhattandistanceencoding Fig. 4. 3-channel color encoding under the guidance of Manhattan distance. The block with diagonal stripes means the elements in this block are flipped. It can also meet Equ 4 and the smaller distance can be described. Another issue is that continuous near pixels are much more likely to be annotated as the same label. So it seems that the position HVs in a small area should not change. Thus, we bring the second hyperparameter β to let β rows and β columns as a block, and Manhattan distance is computed based on these blocks. We call this encoding method block decay Manhattan distance encoding. Figure 3 (d) shows the distance when β is set as 2. And all the distance between HVs of two positions should meet the new block Manhattan distance, as shown in Equ 6. d1(bri ⊕ bcj , bri+m0 ⊕ bcj+n0 ) = d1(bri ⊕ bcj , bri+m1 ⊕ bcj+n1 ), if f m0 + n0 = m1 + n1, f or ∀i, j, ∀m0, n0, ∀m1, n1 (6) 2(cid:13) Color Encoder The color value is in a one-dimension space, and it varies from 0 to 255. However, we have three channels in most images. These three channels have the same position but possibly different color values. To simplify the question, we consider a single channel at first. Classical HDC randomly generates 256 HVs to represent the 256 values of color, or randomly flips several elements based on the previous HV. While random means color values with a greater difference can be assigned to more similar HVs, which does not make sense. Similar to position encoding, we need to encode the color value according to the Manhattan distance defined in Equ 1. The Manhattan distance of two HVs is the number of different elements in the HVs, thus we can also use the summation of the element-wise XOR to obtain it. Similar to the position HVs, we can flip the number of continuous sites of HVs to add the Manhattan distance to the HVs. Since the value variance is fixed from 0 to 255, we can define the unit length per flip as uc as uc = (cid:4) d (cid:5). 256 The Manhattan distance of two color values a and b can be described as d1(a, b) = 256 × uc, is between the HVs corresponding to 0 and 255. Thus, we obtain the 256 HVs of 256 single-channel color values. while the largest Manhattan distance, 255 (cid:106) |a−b| 256 (cid:107) To encode the 3-channels color value at one position actually encodes three different values into one HV with dimension d. From classical HDC, we may use element-wise XOR or multiplication to associate two HVs and then three. In fact, the difficulty is how to keep the Manhattan distance. However, neither element-wise XOR nor element-wise multiplication can keep the Hamming distance. Element-wise multiplication can diminish the distance when there is a 0 at the same site of any one of three HVs, while element-wise XOR only counts number of 1s. So we need a new way to encode the 3-channels color values. To contain all the information of the three channels and keep the Manhattan distance, we consider reducing the HV dimension of each channel from d to d 3 . Thus we can get a 3 × 256 × d 3 HVs to represent the color values in 3 channels, and each channel obtain 256 × d 3 HVs. At last, when the three values in the three-channel are obtained, the three corresponding HVs will be concatenated together to produce a new HV to represent the color value of this pixel. As shown in Figure 4, if the color values of a Fig. 5. Different situations when producing pixel HV, and relative Manhattan distance changes when γ = 2 is applied to color HV. pixel are [255, i, 0], the HV to represent its color should consist of three parts: (1) the first d 3 elements come from the 256th HV (value 255) of the first channel, (2) the second d 3 elements come from the (i + 1) − th HV (value i) of the second channel, and (3) the rest elements come from the 1st HV (value 0) of the third channel. 3(cid:13) Pixel HV Producer After the position and color values of the pixel are encoded to HVs, we will produce the pixel HVs based on these two types of HVs. The only issue that needs to be concerned about is how can we keep the Manhattan distance in position HVs and color HVs. We use Hamming distance dh as guidance here. It describes the number of positions with the different symbols in two equal-length strings [37]. To help adjust the composition ratio of position HV and color HV, we also bring a new hyperparameter γ. γ makes the flipped element longer to the γ bit filling in the flipped value, which can impact on either position HV or color HV. For example, when γ = 2, and 0 can flip to 1 and then change as long as to be 11. Figure 5 shows the different situations when producing pixel HV, and the relative Hamming distance changes when γ = 2 is applied to color HV vi. In Figure 5 (b), color HV v2 flips one element, thus the resulting pixel HV y2 flips the same site. The Hamming distance is 1 between the new pixel HV y2 and the original pixel HV y1. In Figure 5 (c), position HV p3 and color HV v3 flip at the same time but on different sites, thus the resulting pixel HV y3 flips the two sites. Similarly, the Hamming distance is 2 between the new pixel HV y3 and the original pixel HV y1. For the case shown in Figure 5 (d), position HV p4 and color HV v4 flip at the same site, and the relative Hamming distance is 1. So far, we have encoded an image with (r, c) size to r × c HVs. HDC requires the HVs are pseudo-orthogonal. We need to note that the pixel HVs come from position HVs and color HVs, which are pseudo-orthogonal to each other, and the proof is shown in Lemma 1. Lemma 1. Any HVs which will do the element-wise operation in the encoding process, are pseudo-orthogonal. Proof: The basic idea is that although we specify the flip segment, it seems they have a correlation, however, all the correlated HVs will never do an element-wise operation with each other. From [17], the 2 HVs are orthogonal when their normalized Hamming distance N (dh) = 0.5. Due to the high dimension and random generation, the first row HV r0 and first column HV c0 are pseudo-orthogonal [17]. This is because 50% "1" and 50% "0" are randomly assigned to the different sites of 2 HVs. ri flips the xrow elements based on ri−1. The flipped xrow elements have the same probability of distribution of "1" and "0" with the whole HV. Thus the number of "1" in ri will be very similar to ri−1, and thus to r0. This is the same for column HV cj. So, ri and cj are also pseudo-orthogonal like the r0 and c0. Therefore, position HV p(i,j) = ri ⊕ cj has nearly 50% "1" and 50% "0". Color HV vk is similar to row HV, with nearly 50% "1" and 50% "0". Thus, the position HV p(i,j) is also pseudo-orthogonal to the color HV vk, because N (dh(p(i,j), vk) ≈ 0.5). Note that, there is no any HV operations between any 2 position HVs, and any 2 color HVs. i255...0ColorValue...Example:HVof3channel[255,i,0]:0uc32uc3256uc3......ChannelR.........iuc3(i+1)uc30uc32uc3256uc3.........0uc32uc3256uc30uc32uc3256uc3......ChannelB.........iuc3(i+1)uc30uc32uc3256uc3.........0uc32uc3256uc30uc32uc3256uc3......ChannelG.........iuc3(i+1)uc30uc32uc3256uc3.........0uc32uc3256uc3256uc30512uc3256uc.........1010(a)Originaloperation(c)PositionHVandcolorHVflipdifferentsites(d)PositionHVandcolorHVflipsamesites0100111011011111000111XOR->p1v1y1XOR->00010111003110XOR->p3v3y3p4v4y4dh(y1,y3)=2dh(y1,y4)=111010111000110XOR->p2v2y2dh(y1,y2)=1(b)OnlypositionHVorcolorHVflippi:positionHVs,vi:colorvalueHVs,yi:pixelHVsdh(y1,y1)=0 TABLE I IOU SCORE ON 3 DATASETS Dataset BL [16] RPos [17] RColor [17] SegHDC Improvement BBBC005 0.7490 DSB2018 0.6281 MoNuSeg 0.5088 0.0361 0.1172 0.1959 0.1016 0.2352 0.3832 0.9414 0.8038 0.5509 25.7%↑ 28.0%↑ 8.27%↑ 4(cid:13) Clusterer In this work, we use the K-Means algorithm to cluster the pixel HVs. In the K-means algorithm, the distance function is a key part to measure the distances of points to centroids [38]. For HDC, Hamming distance and cosine distance are widely used. In this work, we use cosine distance to be accommodated with HDC, and the reason will be mentioned later. The cosine distance of two HVs is defined in Equ 7, where y represents the pixel HV, z represents the centroid HV and d is the dimension of HVs. In classical K-Means, the centroids are chosen randomly. To boost the performance, we choose the pixels with the largest color difference in this work. After the first batch of centroids are chosen, the HV distances between all pixels and centroids will be calculated, and each pixel will be clustered to the class of its nearest centroid. After that, all HVs in the same class will be summed to produce the new centroid HV. This is the reason we choose the cosine distance. The length of a vector in space will not affect the angle, and the distance will only check the angle. The process will be conducted iteratively until the preset iteration is achieved, and the pixels have been clustered into different classes. dc(−→y , −→z ) = 1 − −→y −→z (cid:107)−→y (cid:107)(cid:107)−→z (cid:107) = 1 − (cid:80)d −→y i −→z i (cid:113)(cid:80)d i=1 −→z 2 i (7) i=1 −→y 2 i (cid:113)(cid:80)d i=1 IV. EXPERIMENTS This section reports the evaluation results of SegHDC on three nuclei segmentation datasets. Results show our method outperforms the CNN-based unsupervised segmentation on both segmentation performance and latency. A. Experimental Setup Dataset: We employ three segmentation datasets, including BBBC005 [39] (first 200 images are used), DSB2018 [40] ("stage1_train" set is used, cause DSB2018 does not provide the ground truth for the test set), and MoNuSeg [41] (test set is used), to evaluate our method. Training setting and baseline: The performance of SegHDC is evaluated by comparing it with the unsupervised image segmentation method [16]. The default setting of clustering iteration is 10. The hyperparameters α, and γ are 0.2 and 1, while β is 21 on the BBBC005 dataset and 26 on the DSB2018 and MoNuSeg datasets. The number of clusters is set as 2 for BBBC005 and DSB2018 datasets, while 3 is set for the MoNuSeg dataset. The baseline method runs on the default setting provided by [16]. The metrics of Intersection over Union (IoU) is applied, which is defined as the area of intersection between the predicted segmentation map and the ground truth, divided by the area of union between those two [42]. Edge device: To compare the latency of SegHDC and baseline, we employ an edge device: Raspberry PI 4 Model B [43] with 4 GB memory. The latency is obtained by deploying SegHDC and baseline on the device and testing the processing time for one image. B . Experimental Results (1) Our method beats CNN-based baseline Table I reports the average IoU score on three datasets. Besides the baseline, we also evaluate the encoding method using randomly generated HVs for the position part (denoted as RPos) and for the TABLE II RESULT OF LATENCY ON RASPBERRY PI FOR PROCESSING AN IMAGE IN DSB2018 DATASET AND BBBC DATASET Image Size IoU Score Latency on PI SpeedUp Baseline 256 × 320 × 3 SegHDC (DSB2018) Baseline 520 × 696 × 1 0.7612 0.8275 × * 11453.0s 35.8s × * baseline 319.9× baseline SegHDC ×∗ Out of memory. (BBBC005) 0.9587 178.31s - Fig. 6. Visualization of prediction masks of an image in BBBC005 dataset, DSB2018 dataset, and MoNuSeg dataset. color part (denoted as RColor) to verify the effectiveness of our encoding method. We can have some observations from the results in Table I. Overall, SegHDC achieves better results over the baseline on all three datasets. Specifically, on the BBBC005 dataset, SegHDC achieves a 0.9414 average IoU score, which is 25.7% higher than that obtained by the baseline (where the score is 0.749). When it comes to the DSB2018 dataset, our method gets a 0.8038 average IoU score and gains an improvement of 28.0% compared with the score of 0.6281 obtained by the baseline method. On the MoNuSeg dataset, the score of SegHDC surpasses 0.042 over that of the baseline. Besides, there is another observation that the results of RPos and RColor are comparable to worse with extremely low IoU scores on these three datasets. These results have demonstrated the effectiveness of our encoding method. Table II reported the results of the latency obtained by deploying on the Raspberry Pi for processing an image. An image with size 256 × 320 × 3 from the DSB2018 dataset and an image with size (520×696×1) from the BBBC005 dataset are used to test the latency on Raspberry Pi. Specifically, we use the HV with 800 dimensions, three iterations, and α is set as 1 for the image from DSB2018. The baseline method obtains a 0.7612 score, but the latency is over 3 hours as shown in the table. In contrast, SegHDC can obtain a higher IoU score (0.8275) score, meanwhile with a processing time of only 35.8s on the Raspberry Pi, which has achieved 319.9× speedups than that of the baseline. For the image from BBBC005, the HV is with 2000 dimensions, three iterations are applied, and α is set as 0.8. Results show that SegHDC can obtain a 0.9587 IoU score with a latency of 178.31s. However, the baseline approach can not run on the Raspberry Pi (as ×∗ indicated) due to memory limitation. This set of experiments proves that unsupervised image segmentation is hard to perform on an edge device, where the resources are limited. Baseline(IoU:0.3496)SegHDC(IoU:0.5299)ImageinMoNuSegGroundTruthBaseline(IoU:0.6995)SegHDC(IoU:0.9559)ImageinBBBC005GroundTruthBaseline(IoU:0.7612)SegHDC(IoU:0.8259)ImageinDSB2018GroundTruth that, after the 4 − th iteration, SegHDC can obtain a good prediction mask for this image. As Figure 7 (b) reports, the latency time raises from around 90 seconds for 200-dimension HV to about 110 seconds for 1000-dimension HV. It seems 800 dimensions is a good choice for dealing with this image. Figure 8 shows the prediction masks of the experiment shown in Figure 7 (a). We show the 3-channel test image, ground truth as well as the prediction masks in the first 4 iterations because the later iterations give similar results. As shown in the figure, only 1 iteration can not work well, with more than 2 iterations, it gives a much better result which is close to ground truth. V. CONCLUSION To implement the on-device unsupervised image segmentation, we try the first attempt to apply the HDC to perform segmentation. In this paper, we devise a brand new encoding method for both position and color HVs in accordance with Manhattan distance, and propose a segmentation framework, namely SegHDC. 3 nuclei datasets are employed to evaluate the performance of SegHDC. Results show that SegHDC can significantly improve the IoU score with much less latency on Raspberry Pi compared with the CNN-based unsupervised image segmentation approach. REFERENCES [1] J. Liao, Y. Liu, G. Xing, H. Wei, J. Chen, and S. Xu, "Shadow detection via predicting the confidence maps of shadow detection methods," in Proceedings of the 29th ACM International Conference on Multimedia, 2021, pp. 704–712. [2] Y. Wu, D. Zeng, Z. Wang, Y. Shi, and J. Hu, "Federated contrastive learning for volumetric medical image segmentation," in Medical Image Computing and Computer Assisted Intervention–MICCAI 2021: 24th International Conference, Strasbourg, France, September 27–October 1, 2021, Proceedings, Part III 24. Springer, 2021, pp. 367–377. [3] L. Yang, Z. Yan, M. Li, H. Kwon, L. Lai, T. Krishna, V. Chandra, W. Jiang, and Y. Shi, "Co-exploration of neural architectures and heterogeneous asic accelerator designs targeting multiple tasks," in 2020 57th ACM/IEEE Design Automation Conference (DAC). IEEE, 2020, pp. 1–6. [4] H. Noh et al., "Learning deconvolution network for semantic segmenta- tion," in Proc. ICCV, 2015, pp. 1520–1528. [5] V. Badrinarayanan et al., "Segnet: A deep convolutional encoder-decoder architecture for image segmentation," IEEE transactions on pattern analysis and machine intelligence, vol. 39, no. 12, pp. 2481–2495, 2017. [6] O. Ronneberger et al., "U-net: Convolutional networks for biomedical image segmentation," in Proc. MICCAI. Springer, 2015. [7] C. Liu et al., "Auto-deeplab: Hierarchical neural architecture search for semantic image segmentation," in Proc. CVPR, 2019, pp. 82–92. [8] M. E. Celebi et al., Unsupervised learning algorithms. Springer, 2016. [9] L. Yang, W. Jiang, W. Liu, H. Edwin, Y. Shi, and J. Hu, "Co-exploring neural architecture and network-on-chip design for real-time artificial intelligence," in 2020 25th Asia and South Pacific Design Automation Conference (ASP-DAC). IEEE, 2020, pp. 85–90. [10] W. Jiang, X. Zhang, E. H.-M. Sha, L. Yang, Q. Zhuge, Y. Shi, and J. Hu, "Accuracy vs. efficiency: Achieving both through fpga-implementation aware neural architecture search," in Proceedings of the 56th Annual Design Automation Conference 2019, 2019, pp. 1–6. [11] W. Jiang, L. Yang, E. H.-M. Sha, Q. Zhuge, S. Gu, S. Dasgupta, Y. Shi, and J. Hu, "Hardware/software co-exploration of neural architectures," IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 39, no. 12, pp. 4805–4815, 2020. [12] W. Jiang, E. H.-M. Sha, X. Zhang, L. Yang, Q. Zhuge, Y. Shi, and J. Hu, "Achieving super-linear speedup across multi-fpga for real-time dnn inference," ACM Transactions on Embedded Computing Systems (TECS), vol. 18, no. 5s, pp. 1–23, 2019. [13] J. Zhan, W. Jiang, Y. Li, J. Wu, J. Zhu, and J. Yu, "Accelerating queries of big data systems by storage-side cpu-fpga co-design," IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 41, no. 7, pp. 2128–2141, 2021. [14] J. Zhan, Y. Zhang, W. Jiang, J. Yang, L. Li, and Y. Li, "Energy-aware page replacement and consistency guarantee for hybrid nvm–dram memory systems," Journal of Systems Architecture, vol. 89, pp. 60–72, 2018. Fig. 7. IoU score and latency on Raspberry Pi with different iterations. Fig. 8. Visualization of prediction masks of an image in DSB2018 dataset during different iterations. Figure 6 demonstrates the sample image, ground truth, prediction mask of baseline and SegHDC, and the IoU score obtained by both approaches. For example, for the sample of BBBC005 in the first line, the baseline method can only obtain a 0.6995 IoU score while SegHDC gets a 0.9559 IoU score, where it is obvious to see the difference between the two images in regard to the size and outline of the nuclei. When it comes to another sample image DSB2018, the baseline and SegHDC can predict two similar masks (IoU score 0.7612 v.s. 0.8259). However, there is more noise in nuclei obtained by the baseline compared with that obtained by our SegHDC (e.g., some inner noise in nuclei and a small part at the right-up corner in these two images). In order to further verify the performance of SegHDC, we have conducted an additional set of experiments on the image in MoNuSeg, where there are much more complex details in the image. Similar results can be achieved and our proposed SegHDC can predict the mask of most separate nuclei and obtains a higher score of 0.5299. compared with that of the baseline method, where only a rough outline can be predicted with the IoU score of 0.3496. (2) Exploration of SegHDC Except for comparison with the baseline, we also explore how the SegHDC performs with different clustering iterations and dimensions. By using the sample image in the DSB2018 dataset, Figure 7 (a) shows the result of the IoU score and the latency on Raspberry Pi with the different number of iterations, specifically when 1 iteration to 10 iterations clustering is applied. Figure 7 (b) demonstrates the effect due to the different dimensions applied to this image, where the number of dimensions is set from 200 to 1000. To unify the variables for a fair comparison, the HV dimension is set as 10000 in the experiment shown in Figure 7 (a), while the results shown in Figure 7 (b) are obtained by processing in 10 iterations. In both sub-figures, the left vertical axis is the IoU score, and the right vertical axis means the latency (s). There are some observations in this set of experimental results. As shown in Figure 7 (a), the latency time increases from around 20 seconds for 1 iteration to over 300 seconds for 10 iterations. Notated 0501001502002503003500.30.40.50.60.70.80.912345678910Time(s)IoUScoreNumberofIterationsIoU ScoreLatency(a)DifferentresultofIoUscoreandlatencywithdifferentnumberofiterationsapplied(b)DifferentresultofIoUscoreandlatencywithdifferentdimensionsapplied808590951001051101151200.20.30.40.50.60.70.80.92004006008001000Time(s)IoUScoreDimensionsIoU ScoreLatency1Iteration2Iterations3Iterations4IterationsTestImageGroundTruthNote:Almostallpixelsassignedtothesamelabel [15] X. Xia and B. Kulis, "W-net: A deep model for fully unsupervised image segmentation," arXiv preprint arXiv:1711.08506, 2017. [16] W. Kim et al., "Unsupervised learning of image segmentation based on differentiable feature clustering," IEEE Transactions on Image Processing, vol. 29, pp. 8055–8068, 2020. [17] L. Ge et al., "Classification using hyperdimensional computing: A review," IEEE Circuits and Systems Magazine, vol. 20, no. 2, pp. 30–47, 2020. [18] S. Zhang, R. Wang, J. J. Zhang, A. Rahimi, and X. Jiao, "Assessing robustness of hyperdimensional computing against errors in associative memory," in 2021 IEEE 32nd International Conference on Application- specific Systems, Architectures and Processors (ASAP). IEEE, 2021, pp. 211–217. [19] S. Zhang, M. Imani, and X. Jiao, "Scalehd: Robust brain-inspired hyperdimensional computing via adapative scaling. in 2022 ieee," in ACM International Conference on Computer-Aided Design (ICCAD), 2022. [20] J. Yang, Y. Sheng, S. Zhang, R. Wang, K. Foreman, M. Paige, D. Reis, X. Jiao, W. Jiang, and L. Yang, "Automated architecture search for brain- inspired hyperdimensional computing," in First Conference on Automated Machine Learning (Late-Breaking Workshop). [21] J. Yang, V. K. R. Yasa, Y. Sheng, D. Reis, X. Jiao, W. Jiang, and L. Yang, "Hardware-aware automated architecture search for brain- inspired hyperdimensional computing," in 2022 IEEE Computer Society Annual Symposium on VLSI (ISVLSI). IEEE, 2022, pp. 352–357. [22] S. Zhang, R. Wang, D. Ma, J. J. Zhang, X. Yin, and X. Jiao, "Energy- efficient brain-inspired hyperdimensional computing using voltage scal- ing," in 2022 Design, Automation & Test in Europe Conference & Exhibition (DATE). IEEE, 2022, pp. 52–55. [23] Y. Sheng, J. Yang, W. Jiang, and L. Yang, "Toward fair and efficient hyperdimensional computing," in Proceedings of the 28th Asia and South Pacific Design Automation Conference, 2023, pp. 612–617. [24] Y. Sheng, J. Yang, Y. Wu, K. Mao, Y. Shi, J. Hu, W. Jiang, and L. Yang, "The larger the fairer? small neural networks can achieve fairness for edge devices," in Proceedings of the 59th ACM/IEEE Design Automation Conference, 2022, pp. 163–168. [25] Z. Hu, J. Li, Z. Pan, S. Zhou, L. Yang, C. Ding, O. Khan, T. Geng, and W. Jiang, "On the design of quantum graph convolutional neural network in the nisq-era and beyond," in 2022 IEEE 40th International Conference on Computer Design (ICCD). IEEE, 2022, pp. 290–297. [26] W. Jiang, L. Yang, S. Dasgupta, J. Hu, and Y. Shi, "Standing on the [38] J. Wu, "Cluster analysis and k-means clustering: an introduction," in Advances in K-means Clustering. Springer, 2012, pp. 1–16. shoulders of giants: Hardware and neural architecture co-search with hot start," IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 39, no. 11, pp. 4154–4165, 2020. [27] J. Zhan, R. Sun, W. Jiang, Y. Jiang, X. Yin, and C. Zhuo, "Improving fault tolerance for reliable dnn using boundary-aware activation," IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 41, no. 10, pp. 3414–3425, 2021. [28] J. Long et al., "Fully convolutional networks for semantic segmentation," in Proc. CVPR, 2015, pp. 3431–3440. volumetric medical image segmentation," in Proc. 3DV. [29] F. Milletari et al., "V-net: Fully convolutional neural networks for IEEE, 2016. [30] T. Moriya et al., "Unsupervised segmentation of micro-ct images of lung cancer specimen using deep generative models," in Proc. MICCAI. Springer, 2019, pp. 240–248. [31] R. Abdal et al., "Labels4free: Unsupervised segmentation using stylegan," in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021, pp. 13 970–13 979. [32] S. Dhar et al., "A survey of on-device machine learning: An algorithms and learning theory perspective," ACM Transactions on Internet of Things, vol. 2, no. 3, pp. 1–49, 2021. [33] Q. Zhou et al., "Octo:{INT8} training with loss-aware compensation and backward quantization for tiny on-device learning," in 2021 USENIX Annual Technical Conference (USENIX ATC 21), 2021, pp. 177–191. [34] J. Lin et al., "On-device training under 256kb memory," arXiv preprint arXiv:2206.15472, 2022. [35] D. Liang et al., "Distrihd: A memory efficient distributed binary hyperdimensional computing architecture for image classification," in 2022 27th ASP-DAC. IEEE, 2022, pp. 43–49. [36] "Manhattan distance," https://en.wikipedia.org/wiki/Taxicab_geometry, accessed Nov, 2022. [37] B. Waggener et al., Pulse code modulation techniques. Springer Science & Business Media, 1995. [39] V. Ljosa et al., "Annotated high-throughput microscopy image sets for validation." Nature methods, vol. 9, no. 7, pp. 637–637, 2012. [40] "2018 data science bowl," https://www.kaggle.com/competitions/ data-science-bowl-2018/overview, accessed Nov 2022. [41] N. Kumar et al., "A multi-organ nucleus segmentation challenge," IEEE transactions on medical imaging, vol. 39, no. 5, pp. 1380–1391, 2019. [42] S. Minaee et al., "Image segmentation using deep learning: A survey." [43] "Raspberry pi 4 model b," https://www.raspberrypi.com/products/ raspberry-pi-4-model-b/specifications/, accessed Nov, 2022.
http://arxiv.org/abs/2302.12378v1
2023-02-24T00:49:43
2023-02-24T00:49:43
Cosmic Microwave Background Recovery: A Graph-Based Bayesian Convolutional Network Approach
The cosmic microwave background (CMB) is a significant source of knowledge about the origin and evolution of our universe. However, observations of the CMB are contaminated by foreground emissions, obscuring the CMB signal and reducing its efficacy in constraining cosmological parameters. We employ deep learning as a data-driven approach to CMB cleaning from multi-frequency full-sky maps. In particular, we develop a graph-based Bayesian convolutional neural network based on the U-Net architecture that predicts cleaned CMB with pixel-wise uncertainty estimates. We demonstrate the potential of this technique on realistic simulated data based on the Planck mission. We show that our model accurately recovers the cleaned CMB sky map and resulting angular power spectrum while identifying regions of uncertainty. Finally, we discuss the current challenges and the path forward for deploying our model for CMB recovery on real observations.
[ "Jadie Adams", "Steven Lu", "Krzysztof M. Gorski", "Graca Rocha", "Kiri L. Wagstaff" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12378v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12378v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "astro-ph.CO", "astro-ph.IM" ]
Cosmic Microwave Background Recovery: A Graph-Based Bayesian Convolutional Network Approach Jadie Adams1,2, Steven Lu1, Krzysztof M. Gorski1, Grac ̧a Rocha1, Kiri L. Wagstaff1 1 Jet Propulsion Laboratory, California Institute of Technology, 4800 Oak Grove Drive, Pasadena, CA 91109-8099, USA 2 Scientific Computing and Imaging Institute, University of Utah, 201 Presidents' Cir, Salt Lake City, UT 84112, USA [email protected], {you.lu,krzysztof.m.gorski,graca.m.rocha}@jpl.nasa.gov, [email protected] 3 2 0 2 b e F 4 2 ] G L . s c [ 1 v 8 7 3 2 1 . 2 0 3 2 : v i X r a Abstract The cosmic microwave background (CMB) is a significant source of knowledge about the origin and evolution of our universe. However, observations of the CMB are contami- nated by foreground emissions, obscuring the CMB signal and reducing its efficacy in constraining cosmological param- eters. We employ deep learning as a data-driven approach to CMB cleaning from multi-frequency full-sky maps. In partic- ular, we develop a graph-based Bayesian convolutional neural network based on the U-Net architecture that predicts cleaned CMB with pixel-wise uncertainty estimates. We demonstrate the potential of this technique on realistic simulated data based on the Planck mission. We show that our model ac- curately recovers the cleaned CMB sky map and resulting angular power spectrum while identifying regions of uncer- tainty. Finally, we discuss the current challenges and the path forward for deploying our model for CMB recovery on real observations. Introduction Cosmic Microwave Background (CMB) is remnant electro- magnetic radiation from the early universe and a fundamen- tal probe of cosmology. Small anisotropies, or irregularities, in the temperature fluctuations and polarization of CMB sky maps, can constrain models of structure formation and fun- damental physics. However, such anisotropies are hidden by foreground emissions (i.e., contamination from Galac- tic emission, dust emission, synchrotron emission, etc.) as shown in Figure 1. Thus correctly discriminating between CMB and foreground emissions via observations made at multiple frequencies is crucial to cosmological parameter es- timation. Recent success in applying machine learning techniques to astrophysical tasks has motivated using artificial neural networks to remove foreground and reduce systematic er- rors in CMB cleaning. For such techniques to be maximally valuable for cosmological study, capturing uncertainty or an estimate of model confidence is crucial. In this work, we propose a graph-based Bayesian convolutional neural net- work (CNN) for recovering the underlying CMB signal from multi-frequency temperature maps of the full-sky in a prob- abilistic manner. To avoid edge effects imposed by project- Copyright © 2023, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. Figure 1: (A) The CMB. This graphic displays our galaxy at the center (including magnetic fields), the intergalactic medium, and the CMB in the outer shell. The color map shows temperature fluctuation and the vector lines represent the polarization amplitude and direction of the radiation. The inner shell displays foreground emissions which block tele- scopes from observing the CMB. Figure from a Keck Insti- tute for Space Studies (KISS) workshop report (Rocha et al. 2019a). (B) CMB Cleaning Overview. CMB cleaning mod- els take multi-frequency full-sky temperature maps as input and recover the cleaned CMB map. ing spherical sky maps onto a two-dimensional plane, we employ HEALPix (Gorski et al. 2005) - a graph represen- tation that enables local operations while minimizing dis- cretization error. We reformulate the state-of-the-art image- to-image network, U-Net (Ronneberger, Fischer, and Brox 2015), as a Bayesian framework that operates on the graph- based representation and provides probabilistic predictions. The proposed model shows promise in accurately recover- ing CMB temperature maps and quantifying data and model- dependent uncertainty associated with the prediction. The contributions of this paper are (1) a novel approach to CMB extraction that combines a graph-based represen- tation with a Bayesian U-Net CNN, (2) initial results on low-resolution full-sky data with a comparison to existing methods for CMB extraction that do not employ machine learning, (3) an analysis of uncertainty quantification cali- bration and quality, and (4) a discussion of the strengths and weaknesses of the proposed approach. A.B.Multi-frequency Temperature Maps Cleaned CMB Map Model30 GHz ⋯857 GHz Related Work Sky component separation, i.e., extraction of primordial CMB anisotropy signals from multi-frequency measure- ments of the microwave sky, is the key data processing step to identify the cosmological model that best describes the observed properties of the universe. The most comprehen- sive comparison of component separation methods applied to data collected by the Planck satellite was provided by the Planck Collaboration (2014, 2016a, 2020). These compo- nent separation methods range from linear data combination techniques to multiparameter Bayesian model fitting (Rocha et al. 2019b). In this initial work, we compare our results to those derived using the simplest implementation of the In- ternal Linear Combination (ILC) technique (Bennett et al. 1992). Recent work has explored employing neural networks as a data-driven approach to CMB extraction. Early approaches utilized fully-connected multilayer perceptrons, neglecting the inherent spatial correlation of the input maps (Nørgaard- Nielsen and Jørgensen 2008). CNNs retain spatial correla- tions but are formulated for Euclidean input. There has been progress in training CNNs using flattened 2D patches of full and partial-sky maps (Wang et al. 2022; Casas et al. 2022); however, these 2D projections are prone to edge artifacts. DeepSphere (Perraudin et al. 2019) presents an efficient spherical CNN that leverages the hierarchical HEALPix (Gorski et al. 2005) graph representations for pooling and performs convolution in the spectral domain. A recent model (Petroff et al. 2020) combines DeepSphere with a U-Net ar- chitecture (Ronneberger, Fischer, and Brox 2015) for full- sky map CMB recovery. Additionally, this model employs concrete dropout for UQ. We employ a similar technique, but in (Petroff et al. 2020) independent copies of the U-Net encoder are trained for each of the different frequency input maps, then features are combined and passed through the de- coder. In our formulation, we treat the frequencies as chan- nels of the same input and have a single encoder, making the model more scalable and preserving the cross-frequency correlation. Deep neural network uncertainty quantification (UQ) is an active line of research. The most straightforward technique to acquire such measures of model confidence is to train an ensemble of networks and consider the variance in predic- tions (Lakshminarayanan, Pritzel, and Blundell 2017). How- ever, ensembles are computationally expensive and are not guaranteed to produce diverse output. The M -heads frame- work was proposed to remedy this by using one common network that produces M different output (Lee et al. 2015; Rupprecht et al. 2017). Nevertheless, the M -heads method similarly scales poorly and lacks a principled theoretical foundation. A more principled approach is Bayesian deep learning, which uses Bayes' rule to learn a distribution over network weights, providing both aleatoric and epistemic uncertainty quantification. Aleatoric (or data-dependent) uncertainty is the irreducible uncertainty inherent in the input data (for example, noise resulting from measurement imprecision). It can be learned as a function of the input data via MAP inference by adjusting the loss function (Kendall and Gal 2017). Epistemic (or model-dependent) uncertainty is the re- ducible uncertainty in model structure and parameters and is captured by placing a probability distribution over model weights. (Kendall and Gal 2017) showed that Monte Carlo (MC) dropout is a scalable, principled approach to approx- imate variational inference for acquiring epistemic uncer- tainty measures. Concrete dropout is a continuous relaxation of dropouts discrete masks that allows updating the opti- mization operation to automatically tune the dropout prob- abilities of a Bayesian network (Gal, Hron, and Kendall 2017). An alternative approach to dropout combines a con- ditional variational autoencoder (Kingma and Welling 2013) with a U-Net (Ronneberger, Fischer, and Brox 2015) to learn a conditional density model over output conditioned on the input (Kohl et al. 2018). However, this approach does not differentiate between aleatoric and epistemic uncertainty and requires training auxiliary networks making it challeng- ing to scale. For these reasons, we elect to use concrete dropout with heteroscedastic uncertainty loss in adapting our graph-based CNN to be Bayesian for UQ. Methods Our model operates on full-sky maps, predicting the cleaned CMB from nine temperature observations (frequency bands in GHz: 30, 44, 70, 100, 143, 217, 353, 545, and 857). We use Bayesian graph-based CNN with U-Net architecture that preserves the spherical nature of the data and provides un- certainty reasoning. Graphical Representation and Convolution To address this, we perform convolutions in the spectral do- main and represent sky maps as graphs using the Hierarchi- cal Equal Area isoLatitude Pixelization (HEALPix (Gorski et al. 2005)) scheme as is done in DeepSphere (Perraudin et al. 2019). The Fourier transform of these HEALPix graph signals is the projection of the signal onto the set of eigen- vectors of the graph Laplacian. In this work, we use the com- binatorial Laplacian, which is defined as: L = D − A (1) where A is the weighted adjacency matrix of the graph and D is the diagonal degree matrix, which contains the sum of the weights of all the edges for each node on its diagonal. Traditional graph convolutions are often performed in the spectral domain using spherical harmonics, and the computational complexity of such convolution methods is 3). In convolutional neural networks (CNN), there O(Npix are often tens to thousands of convolution operators, and each convolution operation is done in every forward pass during the training process. A computational complexity of 3) convolution operation will almost make the train- O(Npix ing process intractable. In this work, we use the efficient convolution operation proposed in (Perraudin et al. 2019), which reduces the computational complexity of graph con- volution to O(Npix). This efficiency is obtained by repre- senting each convolutional kernel, h, as a polynomial ap- proximation using Chebyshev polynomials. Convolution for the CMB signal, f , is then defined as: hφ(ˆL)f = K (cid:88) k=0 θkTk(ˆL)f (2) where Tk(*) is the Chebyshev polynomial of degree k de- fined by the recursive relation, ˆL is the normalized form of the Laplacian matrix, and φ is the polynomial coefficients that are learned during the training process. In addition to the convolution operation, CNN architectures involve pool- ing and up-sampling layers. Pooling refers to an operation that summarizes (e.g., down-samples) a feature map by a pre-defined factor, and up-sampling is the inverse operation that expands a feature map by a given factor. This work uses maximum pooling and nearest neighbor up-sampling defined on HEALPix grids. The hierarchical tree structure of the HEALPix graph easily allows for such operations. Network Architecture and Loss We utilize a Bayesian formulation of the U-Net architec- ture (Ronneberger, Fischer, and Brox 2015) shown in Figure 2. It consists of an encoding and a decoding path. The en- coding path consists of repeated operations of two Cheby- shev convolutions with a Chebyshev polynomial order of 3, each followed by a 1-dimensional batch normalization and a rectified linear unit (ReLU) (Agarap 2018). After the two Chebyshev convolutions, the HEALPix-based max-pooling operation is applied to down-sample the feature maps by a factor of 4. Each depth of the decoding path consists of a HEALPix-based nearest neighbor up-sampling operation, concatenation with the corresponding feature maps from the encoding path, two Chebyshev convolutions, each followed by 1-dimensional batch normalization and ReLU. The network is formulated as Bayesian using concrete dropout for approximate variational inference and het- eroscedastic aleatoric loss. Monte Carlo dropout was ini- tially formulated as a technique for stochastic variational in- ference that uses a Bernoulli distribution for the approximate posterior distribution, qθ(ω) (where θ are the variational pa- rameters and ω the network weights), adapting the model output stochastically (Kendall and Gal 2017). However, ob- taining well-calibrated uncertainty estimates requires a te- dious grid search to tune dropout probabilities layer-wise. Spatial concrete dropout (Gal, Hron, and Kendall 2017) presents a continuous relaxation of Monte Carlo dropout's discrete masks that allows updating the optimization opera- tion to tune layer-wise dropout probabilities automatically. We apply spatial concrete dropout to every Chebyshev con- volutional layer in the network in training and testing. We sample multiple predicted clean CMB maps with different dropout masks during testing and quantify the epistemic un- certainty as the variance across those maps. The model captures aleatoric uncertainty by directly pre- dicting a pixel-wise Gaussian distribution for the output CMB map. There are two one-by-one convolutional output layers; one predicts the mean, ˆy and the other the log vari- ance, log(ˆσ2) (note the log is predicted for numerical stabil- ity). The model is trained to predict both by maximizing the logarithm of the likelihood function under the observed data. The heteroscedastic aleatoric loss with concrete dropout is defined as: L = 1 D D (cid:88) i=1 (cid:0) 1 2 ˆσ−2 i ||yi − ˆyi||2 + 1 2 log (ˆσ2 i )(cid:1) (3) +KL(qθ(ω)||p(ω)) where D is the number of pixels, y is the target CMB map, ˆy is the predicted CMB map, ˆσ2 is the predicted variance, and the last term is the Kullback–Leibler (KL) regularization term (Kendall and Gal 2017; Gal, Hron, and Kendall 2017). The KL regularization term ensures that the approximate posterior qθ(ω) does not deviate too far from the prior distri- bution p(ω), where p(ω) is selected to be standard Gaussian to allow for analytical evaluation. Prediction uncertainty, denoted Var(y), is quantified as the sum of the epistemic and aleatoric uncertainty. Var(y) is acquired by sampling predictions with different concrete dropout masks T times, then computing: (cid:33)2 (cid:32) Var(y) ≈ 1 T T (cid:88) t=1 ˆy2 t − 1 T T (cid:88) t=1 ˆyt + ˆσ2 t (4) 1 2 T (cid:88) t=1 Figure 2: Model Architecture. The graph-based CNN has a U-Net based architecture. The down arrows represent the en- coding path and the up arrows represent the encoding path. where ˆyt, ˆσ2 t are the network predictions with the t-th weights sampled from the approximate posterior, ωt ∼ qθ(ω). The first part of Equation 4, the variance in the pre- dicted means, is the epistemic uncertainty, and the second part, the average predicted variance, is the aleatoric uncer- tainty. Model Initialization As noted in the Bayesian deep learning literature, using the negative log-likelihood based loss in equation 3 in conjunc- tion with a gradient-based optimizer can lead to very poor SCD Double Conv.Max PoolingSCD Double Conv.Max PoolingSCD Double Conv.Max PoolingSCD Double ConvSCD Double Conv.Up-SamplingSCD Double Conv.Up-SamplingSCD Double Conv.Up-samplingSpatial Concrete Dropout (SCD) Double ConvolutionChebyshev ConvolutionSpatial Concrete DropoutBatch NormalizationReLUActivationChebyshev ConvolutionSpatial Concrete DropoutBatch NormalizationReLUActivationSCD 1x1 Conv.SCD 1x1 Conv.Input Temperature Maps(9 frequencies) CMB MapUncertaintyHEALPix Max PoolingKernel size = 4HEALPix Nearest Neighbor Up-SamplingWindow size = 4SCD One-By-One Convolution1D ConvolutionSpatial Concrete DropoutMultiple SamplesSkip Connection30 GHz⋯857 GHz but stable parameter estimates (Seitzer et al. 2022). This can result in poor predictive accuracy. We found that this pitfall can be avoided using a sensible transfer learning approach. We initialize the weights of our graph-based Bayesian CNN using a trained deterministic version of the CNN. The deter- ministic version has an identical architecture to the proposed model (Figure 2), except the predictive variance output layer and all spatial concrete dropout layers are removed. We train the deterministic network using mean square error loss: Ldeterministic = 1 D D (cid:88) i=1 ||yi − ˆyi||2 (5) until it reaches convergence. We then initialize the Cheby- shev convolutional weights in the Bayesian model using the weights learned by the deterministic model. This pre- training helps the Bayesian CNN achieve good predictive accuracy while learning to quantify uncertainty. The output layer that predicts the variance, which is not pre-trained, is initialized to have small random values sam- pled from the Gaussian distribution, N (0, 1e−6). This ini- tialization prevents the variance term from overshooting in early Bayesian training epochs. The layer-wise spatial con- crete dropout probabilities are all initialized to be 1e−3. This small initialization also makes model training more sta- ble and helps account for any covariance shift caused by batch normalization in conjunction with dropout (Li et al. 2019). Experimental Results Simulated Data We generate simulated sky observations following estab- lished practice that combines three elements: 1. Ci: A randomly generated realization of primordial CMB anisotropies (the target we seek to recover) from the dis- tribution specified by Planck 2015 estimates (Planck Col- laboration 2016b) of the cosmological model parameters. 2. F : Existing (fixed) maps, at each of the nine Planck fre- quency bands, of the composite foreground emission pro- vided in the 2015 Planck data release (Planck Collabora- tion 2016a). 3. Ni: Randomly generated, spatially modulated noise real- izations consistent with Planck instrument sensitivity per frequency band. Each complete simulation is the sum of elements Ci + F + Ni. We reduced the angular resolution of the signal maps (CMB and foregrounds) to FWHM=150 arcmin (un- like Planck, the same resolution per frequency band, to sim- plify the analysis), and rendered the sky maps at HEALPix resolution of NSIDE = 64. The resulting simulated sky maps contain 49,152 pixels. We generated 1,000 instances of noisy multi-frequency maps and clean CMB pairs, each with a unique foreground sky map and unique noise realization. We split these in- stances into a training set, validation set, and held-out test- ing sets using a random 80%, 10%, 10% split, resulting in Figure 3: Model Training Learning Curves. The curves show training and validation loss over the epochs as well as the se- lected epoch to use for initialization or prediction. Note the validation loss is very close to the training loss, suggesting the models are not over-fitting to the training data. a training set of 800, a validation set of 100, and a test- ing set of 100. The input temperature maps were normal- ized channel/frequency-wise to be zero-centered with a stan- dard deviation of one. This standard input normalization im- proves model training. We found that applying normaliza- tion techniques to the target CMB maps did not improve model accuracy, so the model learns to predict un-scaled (not normalized) CMB maps. Model Training The model was implemented using PyTorch and trained on an NVIDIA Tesla M60 RAF GPU. The deterministic model used for weight initialization was trained with a learning rate of 1e−3 with SGD optimization and MSE loss (Equation 5). A batch size of 10 was selected as this was the largest batch size the GPU memory would allow. In both the deterministic and Bayesian training, we saved the model after every train- ing epoch and used the validation set to determine which model to use. We selected the epoch that minimized com- bined loss defined as: 0.8∗(validation loss)+0.2∗(train loss). This metric allowed us to select the ideal stopping epoch to prevent over-fitting. The selected epoch for the deterministic model was 190, and it took 21 hours to train. The Bayesian model was found to train better with a lower learning rate (1e−5) and Adam optimization (Kingma and Ba 2014). A length scale of 1e−4 was used for concrete dropout. The batch size was reduced to 7 in training the Bayesian model to account for the memory required by the additional concrete dropout parameters. The selected epoch for the Bayesian model was 191, and it took 51 hours to train. The combined training required 382 epochs and took about three days. The learning curves and selected model epochs are shown in Fig- ure 3. Analysis of Results We provide qualitative and quantitative metrics for analyz- ing the prediction accuracy and uncertainty calibration on the simulated data. Figure 4 displays three examples from the test set. On the left, we can see the true CMB temper- ature map versus the one predicted by the model. On the right, we can see the absolute error, or the absolute differ- ence between the true and predicted maps, and the predicted uncertainty. The predicted uncertainty is the standard devi- ation of the pixel-wise predicted distribution (or the square Deterministic Model Learning CurveBayesian Model Learning CurveEpochsEpochsDeterministic LossBayesian LossTraining LossValidation LossSelected Epoch Figure 5: Pixel-wise Prediction Accuracy. Plots show corre- lation between true and predicted CMB pixel values (where values that lie on the diagonal are more accurately predicted) for the ILC and proposed method. An example from the test set is provided to illustrate the ±30 degree sky cut used in evaluation. ing imporved accuracy over the ILC baseline, Figure 5 illus- trates how closely predicted pixel values correlate with the true CMB pixel values over the entire test for both meth- ods. We note that the CNN predicted values are closer to the diagonal (i.e., more accurate) in general than the ILC val- ues, they are farther from the diagonal for pixels with an actual CMB value of large magnitude. This can be seen in the slight "S" shape of the distribution in Figure 5, where the tails are under-estimated by the model. This issue is also manifested in the sky maps in Figure 4. Regions of large temperature magnitude in the true CMB correlate to regions of slightly higher error in the absolute error maps and no- tably higher uncertainty in the predicted uncertainty maps. This indicates that the model has less confidence in predict- ing values of high magnitude, suggesting such regions are under-represented in the training data. In Figure 6, we can see a comparison in the spectral domain between the test maps predicted by the proposed method and those generated from the ILC method. The spec- tra were computed on ±30 degree sky cuts and averaged over the 100 test realizations. In comparing the spectra from the true (input CMB) and the predictions from the ILC and proposed CNN, we can see that both approaches deviate. Notably, the ILC approach picks up noise at high (cid:96) values, and we see a drop in the power from the CNN predictions after ≈ 100(cid:96). This suggests that using the two approaches in tandem could provide better accuracy. Figure 4: Model Prediction. An example from the test set is provided with the true and predicted CMB maps, absolute error or absolute difference between the true and predicted, and predicted uncertainty. root of the variance given by Equation 4). As expected, we can see the error and uncertainty are highest along the galac- tic plane. The predicted uncertainty should correlate with the error, and we observe that it does so, but it is over-estimated in some regions. To analyze prediction accuracy, we compare against the ILC method. We consider the overall root mean square er- ror (RMSE) as well as the Pearson correlation coefficient between the true and predicted pixel values within a ±30 degree sky cut. On the test set, the ILC method predictions yield RMSE=7.597 and r=0.993. The predictions from the proposed CNN yield RMSE=4.449 and r=0.997, suggest- True CMBPredicted CMBAbsolute ErrorPredicted UncertaintyTest Example 1Test Example 2Test Example 3True CMBPredicted CMBAbsolute ErrorPredicted UncertaintyTrue CMBPredicted CMBAbsolute ErrorPredicted UncertaintyILC ApproachProposedCNNApproachExampleTrue CMBILCPredictedCMBCNNPredictedCMB multiple GPUs to address the computational expense as- sociated with scaling up to this high-resolution data. 3. Predicting both temperature and polarization. CMB anisotropies lie both in the temperature and polarization of the radiation. Currently, our approach and other ex- isting works consider only fluctuations in temperature. Adapting the model to predict polarization amplitude and direction is required to recover the full CMB signal. Ac- curately predicting polarization will be more challeng- ing than temperature because the polarization of the fore- ground emissions is an order of magnitude larger than the CMB. Integrating traditional techniques for CMB clean- ing, such as Commander (Eriksen et al. 2008), could im- prove our approach and help address this challenge. Such a technique could be applied first and provided as addi- tional input to the graph-based CNN, which could then learn to refine the CMB cleaning further. Future work may also involve exploring different techniques for uncertainty quantification. The concrete dropout ap- proach to variational approximate inference relies on the as- sumption that the weight prior is standard Gaussian. Meth- ods that learn a prior, such as (Kohl et al. 2018), rather than assuming the prior, may provide more flexibility and thus better calibrated uncertainty quantification. Path to Deployment. The graph-based Bayesian CNN ap- proach proposed in this work has the potential to be used by current and future cosmology missions from NASA and ESA (the European Space Agency). Separating CMB sig- nals from foreground emission and systematic noise pro- vides the key input needed to constrain models of how the universe began and has evolved. Currently the maps avail- able on mission websites and archives lack pixel-wise un- certainties. Deployment would include integration into mis- sion pipelines and publicly posting the CMB maps with un- certainties (e.g., https://pla.esac.esa.int/pla/#maps). Two au- thors of this paper (Krzysztof M. Gorski and Grac ̧a Rocha) are cosmologists who worked as project scientists on ESA's Planck mission and can inform and guide integration. All cosmologists could use these maps for their own further modeling. The pixel-wise uncertainties will enable fine- grained identification of reliable and problematic sky re- gions as well as filtering for users who wish to exclude less confidently modeled regions. Acknowledgments We thank the Jet Propulsion Laboratory Research and Tech- nology Development program for funding support and the Science Understanding from Data Science initiative leads, Susan Owen and Lukas Mandrake, for this project's contin- uous support. The High Performance Computing resources used in this investigation were provided by funding from the JPL Information and Technology Solutions Directorate. This research was carried out at the Jet Propulsion Laboratory, California Institute of Technology, under a contract with the National Aeronautics and Space Administration. Copyright 2022. All rights reserved. Figure 6: Spectral Comparison. The upper lines show the input CMB (true) spectra as well as those from the ILC and proposed CNN predictions. The lower lines show the spectra of difference maps between ILC and CNN predictions vs. input CMB (smaller is better). Conclusion and Future Work We presented a Bayesian deep learning approach to CMB recovery via a probabilistic graph-based CNN. We demon- strated the efficacy of this approach in accurately predicting cleaned CMB maps using simulated low-resolution temper- ature maps of the full-sky. These results demonstrate the po- tential for using the proposed model to recover the CMB sig- nal from Plank observations. Three major challenges need to be addressed to make this possible: 1. Improving accuracy in regions of high magnitude. As previously noted, the model underestimates regions where the CMB temperature has a high magnitude and predicts high uncertainty in these areas. We find this issue in related works (Petroff et al. 2020; Wang et al. 2022; Casas et al. 2022) as well, where there are structured dif- ferences in the true and recovered spectra, which can- not be accounted for by randomness or noise. Resolving this issue will improve prediction accuracy and uncer- tainty quantification calibration. We believe the root of this issue is that regions of high signal-to-noise are under- represented in the training data, resulting in low model confidence in predicting them. To resolve this, we plan to explore adapting the loss to weigh these regions to a greater extent as well as data augmentation techniques to reduce pixel-value imbalance in simulated data. 2. Scaling up to full-resolution sky maps. Currently, we are using a HEALPix map resolution of NSIDE = 64 for faster experimentation and model training. However, the Planck observations provide a resolution of NSIDE 1024 to 4096. Acquiring the most precise estimation of the CMB requires using this full resolution. We plan to implement parallelization or distributed training across References Agarap, A. F. 2018. Deep Learning using Rectified Linear Units (ReLU). arXiv preprint arXiv:1803.08375. Bennett, C. L.; Smoot, G. F.; Hinshaw, G.; Wright, E. L.; Kogut, A.; de Amici, G.; Meyer, S. S.; Weiss, R.; Wilkinson, D. T.; Gulkis, S.; Janssen, M.; Boggess, N. W.; Cheng, E. S.; Hauser, M. G.; Kelsall, T.; Mather, J. C.; Moseley, J., S. H.; Murdock, T. L.; and Silverberg, R. F. 1992. Preliminary Separation of Galactic and Cosmic Microwave Emission for the COBE Differential Microwave Radiometers. The Astro- physics Journal, 396(L7-L12). Casas, J.; Bonavera, L.; Gonz ́alez-Nuevo, J.; Baccigalupi, C.; Cueli, M.; Crespo, D.; Goitia, E.; Santos, J.; S ́anchez, M.; and de Cos, F. 2022. CENN: A Fully Convolutional Neural Network for CMB Recovery in Realistic Microwave Sky Simulations. arXiv preprint arXiv:2205.05623. Eriksen, H.; Jewell, J.; Dickinson, C.; Banday, A.; G ́orski, K.; and Lawrence, C. 2008. Joint Bayesian Component Sep- aration and CMB Power Spectrum Estimation. The Astro- physical Journal, 676(1): 10. Gal, Y.; Hron, J.; and Kendall, A. 2017. Concrete Dropout. Advances in Neural Information Processing Systems, 30. Gorski, K. M.; Hivon, E.; Banday, A. J.; Wandelt, B. D.; Hansen, F. K.; Reinecke, M.; and Bartelmann, M. 2005. HEALPix: A Framework for High-Resolution Discretiza- tion and Fast Analysis of Data Distributed on the Sphere. The Astrophysical Journal, 622(2): 759. Kendall, A.; and Gal, Y. 2017. What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision? Ad- vances in Neural Information Processing Systems, 30. Kingma, D.; and Ba, J. 2014. Adam: A Method for Stochas- International Conference on Learning tic Optimization. Representations. Kingma, D. P.; and Welling, M. 2013. Auto-encoding Vari- ational Bayes. arXiv preprint arXiv:1312.6114. Kohl, S.; Romera-Paredes, B.; Meyer, C.; De Fauw, J.; Led- sam, J. R.; Maier-Hein, K.; Eslami, S.; Jimenez Rezende, D.; and Ronneberger, O. 2018. A Probabilistic U-Net for Segmentation of Ambiguous Images. Advances in Neural Information Processing Systems, 31. Lakshminarayanan, B.; Pritzel, A.; and Blundell, C. 2017. Simple and Scalable Predictive Uncertainty Estimation us- ing Deep Ensembles. Advances in Neural Information Pro- cessing Systems, 30. Lee, S.; Purushwalkam, S.; Cogswell, M.; Crandall, D.; and Batra, D. 2015. Why M Heads are Better than One: Train- ing a Diverse Ensemble of Deep Networks. arXiv preprint arXiv:1511.06314. Li, X.; Chen, S.; Hu, X.; and Yang, J. 2019. Understanding the Disharmony between Dropout and Batch Normalization In Proceedings of the IEEE/CVF con- by Variance Shift. ference on computer vision and pattern recognition, 2682– 2690. Nørgaard-Nielsen, H. U.; and Jørgensen, H. 2008. Fore- ground Removal from CMB Temperature Maps using an MLP Neural Network. Astrophysics and Space Science, 318(3): 195–206. Perraudin, N.; Defferrard, M.; Kacprzak, T.; and Sgier, R. 2019. DeepSphere: DeepSphere: Efficient spherical Convo- lutional Neural Network with HEALPix sampling for cos- mological applications. Astronomy and Computing, 27: 130–146. Petroff, M. A.; Addison, G. E.; Bennett, C. L.; and Weiland, J. L. 2020. Full-sky Cosmic Microwave Background Fore- ground Cleaning Using Machine Learning. The Astrophysi- cal Journal, 903(104). Planck Collaboration. 2014. Planck 2013 results. XII. Com- ponent separation. Astronomy & Astrophysics, 571(A12). Planck Collaboration. 2016a. Planck 2015 Results. IX. Dif- fuse component separation: CMB maps. Astronomy & As- trophysics, 594(A9). Planck Collaboration. 2016b. Planck 2015 Results. XIII. Astronomy & Astrophysics, Cosmological parameters. 594(A13). Planck Collaboration. 2020. Planck 2018 Results. IV. Dif- fuse component separation. Astronomy & Astrophysics, 641(A4). Rocha, G.; Banday, A.; Barreiro, R. B.; Challinor, A.; Gorski, K. M.; Hensley, B.; Jae, T.; Jewell, J.; Keating, B.; Kogut, A.; Lawrence, C.; Panopoulou, G.; Partridge, B.; Pearson, T.; Silk, J.; Steinhardt, P.; Wehus, I.; Bock, J.; Crill, B.; Delabrouille, J.; Dore, O.; Raul, F. R.; Ijjas, A.; Keski- talo, R.; Kritsuk, A.; Mangilli, A.; Moncelsi, L.; Myers, S.; Steinbach, B.; and Tristram, M. 2019a. Designing Future CMB Experiments: ThinK. Forthcoming. Rocha, G.; Banday, A.; Barreiro, R. B.; Challinor, A.; G ́orski, K. M.; Hensley, B.; Jaffe, T.; Jewell, J.; Keating, B.; and Kogut, A. 2019b. Astro2020 APC White Paper: The need for better tools to design future CMB experiments. Bul- letin of the American Astronomical Society, 51, Issue 7(221). Ronneberger, O.; Fischer, P.; and Brox, T. 2015. U-Net: Convolutional Networks for Biomedical Image Segmenta- tion. In Medical Image Computing and Computer-Assisted Intervention, volume 9351, 234–241. Rupprecht, C.; Laina, I.; DiPietro, R.; Baust, M.; Tombari, F.; Navab, N.; and Hager, G. D. 2017. Learning in an Un- certain World: Representing Ambiguity Through Multiple Hypotheses. In Proceedings of the IEEE International Con- ference on Computer Vision, 3591–3600. Seitzer, M.; Tavakoli, A.; Antic, D.; and Martius, G. 2022. On the Pitfalls of Heteroscedastic Uncertainty Estima- tion with Probabilistic Neural Networks. arXiv preprint arXiv:2203.09168. Wang, G.-J.; Shi, H.-L.; Yan, Y.-P.; Xia, J.-Q.; Zhao, Y.-Y.; Li, S.-Y.; and Li, J.-F. 2022. Recovering the CMB Signal with Machine Learning. The Astrophysical Journal Supple- ment Series, 260(1): 13.
http://arxiv.org/abs/2302.12372v1
2023-02-24T00:24:17
2023-02-24T00:24:17
Keyword Decisions in Sponsored Search Advertising: A Literature Review and Research Agenda
In sponsored search advertising (SSA), keywords serve as the basic unit of business model, linking three stakeholders: consumers, advertisers and search engines. This paper presents an overarching framework for keyword decisions that highlights the touchpoints in search advertising management, including four levels of keyword decisions, i.e., domain-specific keyword pool generation, keyword targeting, keyword assignment and grouping, and keyword adjustment. Using this framework, we review the state-of-the-art research literature on keyword decisions with respect to techniques, input features and evaluation metrics. Finally, we discuss evolving issues and identify potential gaps that exist in the literature and outline novel research perspectives for future exploration.
[ "Yanwu Yang", "Huiran Li" ]
10.1016/j.ipm.2022.103142
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1016/j.ipm.2022.103142", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.12372v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12372v1", "@rel": "related", "@type": "application/pdf" } ]
[ "Information Processing and Management, 60.1 (2023), 103142" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.IR", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.IR", "cs.AI", "cs.LG", "68Txx", "I.2.6" ]
Keyword Decisions in Sponsored Search Advertising: A Literature Review and Research Agenda Yanwu Yang1 and Huiran Li2 1School of Management, Huazhong University of Science and Technology, Wuhan 430074, China 2School of Business Administration and Customs Affair, Shanghai Customs College, Shanghai 201204, China {yangyanwu.isec, lihuiran.isec}@gmail.com Abstract. In sponsored search advertising (SSA), keywords serve as the basic unit of business model, linking three stakeholders: consumers, advertisers and search engines. This paper presents an overarching framework for keyword decisions that highlights the touchpoints in search advertising management, including four levels of keyword decisions, i.e., domain-specific keyword pool generation, keyword targeting, keyword assignment and grouping, and keyword adjustment. Using this framework, we review the state-of-the-art research literature on keyword decisions with respect to techniques, input features and evaluation metrics. Finally, we discuss evolving issues and identify potential gaps that exist in the literature and outline novel research perspectives for future exploration. Keyword: keyword decisions, sponsored search advertising, keyword generation, keyword targeting, keyword assignment and grouping Yanwu Yang & Huiran Li (2023). Keyword Decisions in Sponsored Search Advertising: A Literature Review and Research Agenda, Information Processing and Management, 60.1 (2023): 103142. DOI: https://doi.org/10.1016/j.ipm.2022.103142. 1 1. Introduction Sponsored search advertising (SSA) has become one of the most successful business models of online advertising. Millions of advertisers spent a large amount of advertising budgets in SSA to promote their products and services (Yang et al., 2018). According to a recent IAB report (Interactive Advertising Bureau, 2022), in the United States alone, the annual internet advertising revenue of 2021 reached $189.3 billion where SSA accounts for around 41.4% of that pie. In SSA, firms need to choose suitable keywords to describe their products or services efficiently, and organize these keywords following certain advertising structures (e.g., account, ad-campaign, and ad-group) defined by major search engines. Once a user submits a query to a search engine which is related to one or several of these keywords, it triggers an auction process that determines which advertisements and their rankings to be displayed on search engine result pages (SERPs), together with a set of organic search results. In the SSA ecosystem, keywords are the unique carriers connecting advertisers, potential consumers, and search engines. Moreover, keywords are the basic units for advertisers to conduct online market research, design and evaluate marketing strategies. Keywords play a crucially important role in business competition for companies in online platforms. In practice, advertisers have to make various keyword decisions throughout the entire lifecycle of SSA campaigns (Yang et al., 2019). Therefore, it becomes a critical issue for search advertisers to make a series of effective keyword decisions in SSA. Since the advent of SSA, keyword decisions have increasingly attracted research interests from both academia and industries. As far as we knew, on one hand, it is apparent that there are no commonly agreed definitions for related concepts identified in the extant literature on keyword decisions; on the other hand, prior research on keyword decisions has been conducted either separately on an individual keyword decision or without consideration of search advertising structures. There is a need for developing an integrated review of the state-of-the-art knowledge about keyword decisions in SSA. Our objectives for this paper are to examine what has been done in the literature on keyword decisions, uncover the potential gaps, and figure out novel research perspectives for future exploration. This review complements recent review articles on online advertising and advertising selection. Ha (2008) conducted a review of online advertising published in major advertising journals from 1996 to 2007, which focuses on analyzing conceptual foundations, theories, and state-of-the-art practices of 2 online advertising. Shatnawi & Mohamed (2012) presented an overview of online advertising selection, which focuses on investigating existing approaches, comparing and classifying these approaches. Our review focuses on keyword decisions in SSA from the system perspective, by taking into account search advertising structures and the entire lifecycle of advertising campaigns. The contribution of our review can be summarized in the following ways. First, to the best of our knowledge, this review is the first effort focusing on keyword decisions in SSA, which has not been systematically explored before. We present an overarching framework for keyword decisions based on practical decision scenarios throughout the entire lifecycle of SSA campaigns, and conduct a systematic review of the state-of-the-art literature with respect to techniques, input features and evaluation metrics. Second, we find that a lot of practical issues remain unaddressed in this field, although plenty of research efforts have been involved in the last two decades. In particular, few research efforts reported on practical keyword decisions such as keyword targeting, keyword assignment and grouping, and keyword adjustment. In addition, our review will provide foundations for continuing studies on keyword decisions in SSA and other advertising forms. 2. Survey Scope and Structure 2.1 Survey Scope Figure 1. Study Search and Selection 3 EBSCOhostJSTORABI/InformGlobalAutomatedDatabaseSearch:Searchcriteria:("keyword") AND("optimization" OR "decisions") AND ("sponsored search advertising" OR "sponsored search" OR "search engine advertising" OR "paid search"),FullText,English 32results(2004-2022)academicjournals 17,news 8,dissertations 2,periodicals 5171results(2000-2022)journals 163, book chapters 7, documents 1373results(2000-2022)scholarlyjournals233,dissertations 68, blogs44, news18,working papers7, reports2, conference1Consolidation:eliminateduplicatepapersfromthesamestudy;dropnews,dissertations,periodicals,bookchapters,documents,blogs,news,reports;Adding:retrieved citations and related articles of those identified in the previous step in Google scholar, which identified additional25 results;ManualScreening: dropqualitativearticles, literature reviews;articlesthatdidnotdirectlyrelatedtokeyworddecision,e.g.,keyword characteristics and advertising effectivenessrelatedresearch,whichexcluded249articles; 43articles(2006-2022)journal 12, conferences 31IEEE25results(2007-2021)journals4, conferences 21267articles(2004-2022) Due to the interdisciplinary nature of keyword decisions topics, research articles covered in this review were published in major IT-oriented (e.g., computer science, artificial intelligence and information retrieval) and/or business-oriented (e.g., management information systems, advertising and marketing) journals and conferences. Our review includes articles retrieved mainly from four academic databases: EBSCOhost, JSTOR, ABI-Inform and IEEE using full text search of ("keyword") AND ("optimization" OR "decisions") AND ("sponsored search advertising" OR "sponsored search" OR "search engine advertising" OR "paid search"). We restricted our selected studies in English. The search resulted in 32 results from EBSCOhost, 171 results from JSTOR, 373 results from ABI/Inform Global and 25 results from IEEE. We manually screened the results to eliminate duplicate articles, news, dissertations, periodicals, book chapters, documents, blogs, news and reports. This process led to 267 articles. Moreover, we expanded the literature by retrieving citations of the articles obtained in the previous step in Google scholar, which yielded additional 25 results. Furthermore, we dropped qualitative articles, literature reviews and empirical articles on keyword research, by going through title, abstract, full-text of each article, which excluded 249 articles. Finally, this literature search resulted in a selection of 43 research publications, including 12 peer-reviewed journal articles and 31 conference articles, covering the period from 2006 to 2022. Our search process is illustrated in Fig. 1. 2.2 Survey Structure In SSA, a general advertising structure employed by major search engines (e.g., Google, Bing) can be described as: under a SSA account of an advertiser, there are one or several campaigns that are run simultaneously in order to fulfill a promotional goal; in the meanwhile, one or several ad-groups comprise a campaign, and each ad-group consists of one or more ad-copies and a set of keywords. Fig. 2 presents an illustration of the search advertising structure. In this sense, SSA is essentially distinct from traditional advertising (e.g., print ads and TV ads) due to its hierarchical advertising structure. Thus, advertising decisions in SSA are essentially structured, rather than flatted as in traditional advertising (Yang et al., 2012, 2019). 4 Account Ad- campaign-1 Ad- campaign-2 Ad-group-1 Ad-group-2 Ad-group-3 Ad-group-4 Keyword set-1 Adcopy-1 Keyword set-2 Adcopy-2 Keyword set-3 Adcopy-3 Keyword set-4 Adcopy-4 Figure 2. An Illustration of Sponsored Search Advertising Structure Throughout the entire lifecycle of SSA campaigns, advertisers have to make a series of keyword related decisions at different levels, namely keyword generation at the domain level, keyword targeting at the market level, keyword assignment and grouping at the campaign and ad-group level, and dynamical keyword adjustment, forming a closed-loop decision cycle (Yang et al., 2019). In this review, we organize the extant literature on keyword decisions within a research framework, as presented in Fig. 3. Figure 3. The Framework of Our Literature Review on Keyword Decisions Section 3 centers on keyword generation, which is also known as the domain-level keyword optimization, aiming to generate a domain-specific keyword pool. In this section, after defining the 5 keyword generation problem, we go over techniques, features and evaluation metrics used in the literature on keyword generation. Section 4 discusses keyword targeting, which is also known as the market-level keyword optimization, aiming to obtain a more targeted set of keywords from the domain-specific keyword pool and choose appropriate match types for selected keywords in order to reach the right population of potential consumers. In this section, we first define the keyword targeting problem, and then review techniques, features and evaluation metrics for keyword selection and keyword match. Section 5 focuses on keyword assignment and grouping, which is also known as the campaign and ad-group level keyword optimization, aiming to yield an effective keyword structure by following the advertising structure of SSA. In this section, we first define the problem of keyword assignment and grouping, and then introduce techniques, features and evaluation metrics used in this area. Section 6 concerns keyword adjustment, i.e., advertisers have to dynamically adjust their keyword structures and associated strategies according to the realtime advertising performance of SSA campaigns. In this section, we first define the keyword adjustment problem in more detail, and then we discuss the status of this area. Section 7 summarizes the state-of-the-art keyword decisions, uncovers the gaps that exist in the literature, and suggests promising research perspectives for future exploration. Finally, we conclude our review in Section 8. Notations used in problem definitions for keyword decisions are presented in Table 1. Table 1. Notations in problem definitions for keyword decisions Terms f(GNT) S(GNT) K(GNT) ki n(GNT) f(TGT) n(TGT) K(TGT) (TGT) xi,m̅ m̅ f(ASM) (ASM) Kj Definition The keyword generation function Information source for keyword generation A set of generated keywords The i-th keyword in a set The number of generated keywords The keyword targeting function The number of targeting keywords A set of selected keywords A binary decision variable of keyword targeting, indicating whether the i-th keyword in match type m̅ is selected Keyword match type The keyword assignment function A set of keywords assigned to the j-th campaign 6 (ASM) xi,j ncampaign f(GRP) (GRP) Kj,l (GRP) xi,j,l ngroup f(ADJ) (ADJ) xi,j,l,t (ADJ) Kj,l,t A binary decision variable of keyword assignment, indicating whether the i -th keyword is assigned to the j-th campaign The number of ad campaigns The keyword grouping function A set of keywords for the l-th ad-group of the j-th campaign A binary decision variable of keyword grouping, indicating whether the i-th keyword is grouped into the l-th ad-group of the j-th campaign The number of ad-groups The keyword adjustment function A binary decision vector of keyword adjustment, indicating whether the i-th keyword is grouped into the l-th ad-group of the j-th campaign at time t A set of keywords grouped into the l-th ad-group of the j-th campaign at time t 3. Domain-Specific Keyword Pool Generation 3.1 Problem Description For advertisers in an application domain, they need to build a pool of relevant keywords over which they can conduct marketing research and from which a more accurate set of keywords can be determined for their search advertising campaigns. This step is called keyword generation, and its output is the domain-specific keyword pool. Formally, the keyword generation problem can be defined as follows. Let S(GNT) denote information sources for keyword generation such as a corpus of Web pages, query logs, search results, advertising database, domain-specific semantics and concept hierarchy, the keyword generation process can be given as f(GNT): S(GNT) → K(GNT) = {k1, ... , ki, ... , kn(GNT)}, i ∈ {1,2, ... , n(GNT)}, (1) where f(GNT) denotes the keyword generation function, K(GNT) denotes a set of generated keywords and ki denotes the i-th keyword in the set. Generally, keyword pool generation aims to obtain a set of keywords that represents the domain- specific knowledge and information of the targeted market as comprehensive and relevant as possible (Nie et al., 2019), starting with websites (or Web pages) or a set of seed keywords provided by advertisers. In this sense, keyword generation is also known as keyword expansion in that it expands from one or several seed keywords. The generated set of keywords can be viewed as an extended business description for advertisers. 7 A plethora of academic efforts have been devoted to keyword generation, in order to help advertisers reach potential consumers (e.g., Yih et al., 2006; Thomaidou and Vazirgiannis, 2011; Nie et al., 2019; Scholz et al., 2019; Yang et al., 2019). Note that the keyword generation problem of SSA is essentially similar to that of online contextual advertising in that both are intended to obtain a set of keywords of interest to consumers. Thereby, prior research in this direction did not make a distinction between them. Hence, we follow such a convention in this paper by reviewing keyword generation for the two advertising contexts within a same framework. A related research stream to keyword generation is query expansion in the field of information retrieval. For an extensive review on query expansion, refer to see Carpineto & Romano (2012) and Azad & Deepak (2019). In the following, we present major techniques, and then discuss input features and evaluation metrics used in the literature. 3.2 Techniques for Keyword Generation State-of-the-art keyword generation techniques reported in the SSA literature can be categorized into five groups: (1) co-occurrence statistics, (2) similarity measures, (3) multivariate models, (4) linguistics processing models, and (5) machine learning models. Table 2 presents categories of state-of-the-art keyword generation techniques and the distribution of selected studies in this section. In the following, we will go over the specific keyword generation techniques in each category, and analyze their advantages and disadvantages. Table 2. Techniques for Keyword Generation Category Approach Reference Sources Co-occurrence / Zhou et al. (2007) Websites and Web pages statistics Similarity measures The Jaccard similarity Joshi & Motwani (2006) Search result snippets Mirizzi et al. (2010) Semantics and concept hierarchy, search result snippets Chen et al. (2008) Semantics and concept hierarchy The cosine similarity Abhishek & Hosanagar Websites and Web pages, search (2007) result snippets Chang et al. (2009); Advertising databases Sarmento et al. (2009) Thomaidou & Vazirgiannis Search result snippets, websites (2011) and Web pages 8 Semantic similarity Amiri et al. (2008) Semantics and concept hierarchy, between terms search result snippets, query logs Multivariate Logistic regression Yih et al. (2006); Wu Websites and Web pages models &Bolivar (2008); Lee et al. (2009) Berlt et al. (2011) Advertising databases Bartz et al. (2006) Query logs, advertising databases Collaborative filtering Bartz et al. (2006) Query logs, advertising databases Topic-sensitive Zhang et al. (2012a) Semantics and concept hierarchy, PageRank websites and Web pages Latent Dirichlet Qiao et al. (2017) Query logs allocation Welch et al. (2010) Semantics and concept hierarchy, search result snippets Hierarchical Bayesian Nie et al. (2019) Semantics and concept hierarchy Linguistics Translation model Ravi et al. (2010) Advertising databases, websites processing and Web pages, query logs Word sense disambiguation Scaiano &Inkpen (2011) Semantics and concept hierarchy The relevance-based Jadidinejad &Mahmoudi Semantics and concept hierarchy language model (2014) Heuristics-based method Scholz et al. (2019) Fuxman et al. (2008) Query logs Query logs Machine learning Random walk Decision tree GM et al. (2011) Websites and Web pages Sequential pattern Li et al. (2007) Websites and Web pages mining Active learning Wu et al. (2009) Search result snippets Bayesian online learning Schwaighofer et al. (2009) Advertising databases Multi-step semantic Zhang &Qiao (2018); Semantics and concept hierarchy, transfer analysis Zhang et al. (2021) Sequence-to-sequence Zhou et al. (2019) query logs Query logs learning 3.2.1 Co-occurrence Statistics Co-occurrence statistics count paired terms within a collection such as Web pages, taking Web advertising as an information retrieval problem. Notations used in co-occurrence statistics for keyword generation are presented in Table 3a. Table 3a. Notations used in co-occurrence statistics for keyword generation Terms Definition K, K′ k, k′ freq(ki, kj) K(tf) A finite set of keywords/terms A keyword/term The co-occurrence frequency of ki and kj The top frequent keywords/terms 9 k̅ ratio(k) nk̅ The current keyword/term The ratio of the sum of the total number of terms in sentences including k to the total number of terms in the document The total number of keywords/terms in sentences including k̅ In keyword generation, the word co-occurrence matrix is constructed to get weighted keywords. The general setting of co-occurrence statistics is as follows. Given two finite sets of keywords K and K′, ki ∈ K, kj ∈ K′, let K × K′ denote the Cartesian product of K and K′, the co-occurrence statistics of a keyword pair (ki, kj) is given by freq(ki, kj) = |{(k, k′) ∈ K × K′|k = ki, k′ = kj}|, which measures the frequency of co-occurrence of ki and kj. Zhou et al. (2007) proposed a keyword extraction model where Web pages and advertisements are represented in a same data structure to support a retrieval process. In their model, nouns and verbs are extracted from the text of Web pages and the co-occurrence frequency between each term and top frequent terms is counted. Specifically, the term weight is calculated as Chi − Square(k̅) = ∑ k∈K(tf) (freq(k̅ ,k)−nk̅ratio(k))2 nk̅ratio(k) − max k∈K(tf) (freq(k̅ ,k)−nk̅ratio(k))2 nk̅ratio(k) , (2) where K(tf) is the top frequent terms; k and k̅ are a term in K(tf) and the current term, respectively; freq(k̅, k) is the co-occurrence frequency of k and k̅; nk̅ is the total number of terms in sentences including k̅; ratio(k) is the ratio of the sum of the total number of terms in sentences including k to the total number of terms in the document. A higher Chi − square(k̅) indicates that the current term (i.e., k̅ ) is more important in representing the document. Generally, co-occurrence statistics is used as a baseline in the research on keyword generation. 3.2.2 Similarity Measures In cases where two relevant keywords do not occur together, co-occurrence statistics may fail to generate right keywords. Moreover, a keyword may have more than one meaning (Chen et al., 2008), which makes it difficult to filter out generated keywords. Thus, similarity measures are developed to explore the characteristic of keywords. Notations used in similarity measures for keyword generation are presented in Table 3b. Table 3b. Notations used in similarity measures for keyword generation Terms Definition C[ki] W A characteristic keyword vector A feature weighting function 10 sim(ki, kj) doc DOC quality(k′, k) Vi TF IDF PMI(k) pmiki The similarity between ki and kj A document A set of documents DOC = {doc1, doc2, ... , docn} The quality of suggesting keyword k′ for query k The TFIDF keyword vector for doci The term frequency The inverse document frequency A point-wise mutual information feature vector for keyword k The pointwise mutual information between ki and a given keyword Specifically, each candidate keyword is represented as a characteristic keyword vector C[ki]. Similarity between each pair of keywords is given as sim(ki, kj) = sim_metric(W(C[ki]), W(C[kj])), (3) where sim_metric is a similarity measure, and one of the most popular possible instantiations of sim_metric is the cosine; W is the feature weighting function. Term frequency-inverse document frequency (TFIDF) is commonly used as a weighting statistic, which is calculated as TFIDF(k, doc, DOC) = TF(k, doc) ⋅ IDF(k, DOC) , where term frequency (TF) is the relative frequency of keyword k within document doc, i.e., TF(k, doc) = freqk,doc ∑ k′∈doc freqk′,doc , and the inverse document frequency (IDF) is the logarithmically scaled inverse fraction of DOC that contains k, i.e., IDF(k, DOC) = −log |{doc∈DOC:k∈doc}| |DOC| . A similarity graph can be constructed on the basis of the similarity between each pair of keywords, where nodes are keywords and the edges indicate similarities between keywords. Through traversing the similarity graph, a set of relevant but cheaper keywords can be generated (Joshi & Motwani, 2006; Abhishek & Hosanagar, 2007; Amiri et al., 2008; Thomaidou & Vazirgiannis, 2011). In similarity-based keyword generation, one of common information sources is search result snippets. Given starting seeds, each keyword k is submitted as a query to a search engine to retrieve a set of characteristic documents DOC = {doc1, doc2, ... , docn}, which is used to create a context vector for the input keyword and extract relevant keywords. For example, Joshi & Motwani (2006) characterized each input keyword using its text-snippets (i.e., words before and after the input keyword) document from the top 50 search-hits. The relevance of keyword k′ to k is measured by the frequency of k′ observed in the characteristic document of keyword k; then the directed relevance between keywords was used to construct a directed graph (i.e., TermsNet). TermsNet suggests keywords through ranking their qualities. Specifically, the quality of k′ for k is defined as quality(k′, k) = 11 freq(k′, k)/(1 + log (1 + ∑ freq(k′, i))), where each i is an outneighbor of k′, which helps identify relevant yet nonobvious terms and their semantic associations. Abhishek & Hosanagar (2007) built a mathematical formulation which measures semantic similarity between keywords using a Web-based kernel function. They scraped advertisers' webpages, extracted and added keywords with high TFIDF into the initial dictionary, then created the context vector for each keyword. Given the TFIDF keyword vector Vi for document doci, the context vector is the L2 normalized centroid of 1 n ∑ (Vi/‖Vi‖2) . n i=1 The semantic similarity kernel function is defined as the inner product of context vectors for two keywords. Through extracting keywords from the landing page as initial seeds, Thomaidou & Vazirgiannis (2011) entered the extracted seeds into a search engine and parsed the snippets and titles of search results to construct a characteristic vector for these keywords. Most occurrences inside the resulted documents are kept as the most relevant keywords for the seed query. The proposed method can generate keywords that do not explicitly show on the landing page. Similarity-based methods by exploring sources such as search result snippets can help increase the precision of keyword generation and catch the trend of consumer behaviors. However, when constructing the characteristic vectors of keywords, most similarity-based methods with search result snippets favor the keywords with high co-occurrence frequency. This might lead an expensive cost for the generated keywords, because keywords with high co-occurrence frequency are typically popular. Moreover, keywords generated by exploring the top-hit search result snippets are expensive as well (Thomaidou & Vazirgiannis, 2011). Thus, similarity-based keyword generation with search result snippets may place advertisers into a highly competitive environment, thus can't guarantee profit maximization. To address this issue, researchers have explored semantic relationships between keywords with user-generated contents such as Wikipedia, DBpedia and manually-defined Web directories as valuable sources to generate non-obvious keywords (Amiri et al., 2008; Chen et al., 2008; Mirizzi et al., 2010). Wikipedia contains a large amount of clean information and conceptual knowledge on a wide spectrum of topics that can be utilized to suggest excessive long-tail keywords. Amiri et al. (2008) considered each query as an initial concept and tried to find related concepts from the Wikipedia collection. For each query keyword q, they grouped the retrieved documents by expectation maximization (EM) clustering algorithm and constructed a representative vector (i.e., keywords vector) for each cluster on 12 the basis of the TFIDF scheme. The representative vector contains related keywords/concepts and the relationship weights between these keywords and q. Based on these vectors, a contextual graph was created to suggest a set of keywords/concepts that are more similar to the query keywords. DBpedia dataset is a community effort on the basis of Wikipedia to extract and store structured information in an RDF dataset that supports sophisticated queries. Mirizzi et al. (2010) presented a system to generate semantic tags through exploiting semantic relations from the DBpedia dataset. The similarity between each pair of resources in the DBpedia graph is calculated by querying external information sources (e.g., search engines and social bookmarking systems) and exploiting textual and link analysis in DBpedia. They used a hybrid ranking algorithm to rank keywords and expand queries formulated by users, and proved the validity of their algorithm by comparing with other RDF similarity measures (i.e., Algo2, Algo3, Algo4 and Algo5). By exploiting the semantic knowledge in the concept hierarchy built based on a manually-defined Web directory, Chen et al. (2008) proposed a keyword generation method. In more detail, it first matched a given seed keyword with one or several relevant concepts, and then these concepts were used together with the concept hierarchy to enrich the meaning of the seed keyword, finally a set of keywords was suggested by taking advantage of the conceptual information based on the similarity function of a variant of the Jaccard coefficient. However, similarity-based methods with semantic relationships suffer from the low concept coverage, and potentially lead to a decrease in the conversion rate, because low-cost keywords may be too far away from the initial seeds and thus fail to attract the target users. Other sources such as co-bidding information and ads database have also been exploited in similarity-based keyword generation (Chang et al., 2009; Sarmento et al., 2009). Assuming that a set of bid keywords under the same ad is associated with a similar hidden intent, Chang et al. (2009) constructed a point-wise mutual information feature vector for each keyword PMI(k) = (pmik1, pmik2, ... , pmikn), where pmiki is the pointwise mutual information between keyword k and co-bidded keyword ki . Then given an ad consisting of n keywords, they ranked the suggested keywords in the ad network through summing the cosine similarity between the PMI feature vectors, i.e., sim(k, ki) = cosine(PMI(k), PMI(ki)) for i = [1, ... , n]. Similarly, assuming that advertisers associate inter-changeable keywords into the same ad, Sarmento et al. (2009) constructed a keyword synonymy graph by computing pairwise similarity between all co-occurrence vectors, and suggested relevant and non-obvious keywords by ranking candidate keywords through a function considering both 13 the overlap and the average similarity. Through performing online comparisons of the proposed method with another keyword generation method used in the largest Portuguese Web advertising broker, they showed that advertisements containing keywords generated by the proposed method often have a superior performance in terms of click-through rate, which in turn resulted in a potential revenue increase. 3.2.3 Multivariate Models Keyword generation methods based on similarity measures are heavily confined to the local space defined by seed keywords in that they rely on statistical or semantic relationships between keywords. Moreover, in many cases, keywords generated by similarity-based methods might fail to capture search users' real intents that are the most important to advertisers. To address these issues, multivariate models have been used to use rich latent information to facilitate keyword generation. Multivariate models can help advertisers generate a long tail of candidate keywords that are relevant and occupy a large fraction of the total traffic, by exploring potential factors and hidden topics affecting the performance of candidate keywords. Notations used in multivariate models for keyword generation are presented in Table 3c. Table 3c. Notations used in multivariate models for keyword generation Terms Definition y x w̅ A binary variable indicating whether a candidate keyword is relevant to a given seed keyword A vector of input features (x̅) associated with a candidate keyword A weight learned for an input feature in x situation Situation features specific to a targeted scene count(k, situation) The number of times that k occurs in situation count(k) The collection frequency of k count(situation) The number of keywords in scenes mapped to situation U R|K|×|U| Ru Rk,u Q sim πm (m) πi G A set of items (e.g., URLs) A keyword-item rating matrix The u-th column of R|K|×|U| The rate of k on item u A binary column vector with |K|-dimensions where it is equal to 1 if the keyword on the k-th position is the seed keyword A similarity vector A vector of indexed Web pages in the m-th iteration A score of the i-th Web page A row-normalized adjacency matrix of the link graph, and Gj,i = 1 oi 14 oi Λ C θ1, θ2 g topic ntopic nd φ(topic) φ(k) β(topic), (β(k)) k0 k0. Cand I ki. AK ki. Profile k. vol Corpus ηj αj θj ′ ′, βj αj KWW(k) TFIDFs(k) TFIDFc(k) TFIDFd(k) TFIDFi(k) |AT(k)| The out-degree of i-th Web page A damping vector biased to a certain topic A content damping vector Parameters controlling the impact of the content relevant score and the advertisement relevant score A row-normalized Wikipedia graph link n × n matrix A topic The number of topics The number of documents The topic distribution for document The keyword distribution for topic Hyper parameters of Dirichlet distributions A seed keyword The set of candidate keywords for k0 A set of keywords consisting of k0 and k0. Cand A list of associative keywords of ki A corresponding characteristic profile of ki The search volume of k All characteristic profiles of keywords in I The total times that the title keyword doesn't appear in the j-th component of a Wikipedia article The importance of a component where a given keyword appears A random variable obeying an Beta distribution, denoting the unimportance of a component, i.e., θj = 1 − αj The shape parameters for the Beta distribution of θj The weight for a given keyword The importance of a keyword presented in the abstract The importance of a keyword presented in the content The importance of a keyword presented in the main text The importance of a keyword presented in the information box A variable indicating whether a keyword is in the anchor text In the literature on keyword generation, five multivariate models, namely logistic regression, collaborative filtering, topic-sensitive PageRank, latent Dirichlet allocation and hierarchical Bayesian have been employed to explore effects of various keyword characteristics in the generation process. (1) Logistic regression (LR). LR is a basic learning technique which treats keyword generation as a binary classification problem. LR learns a vector of weights for input features and returns the estimated probability of whether a candidate phrase is relevant (Yih et al., 2006; Wu & Bolivar, 2008; Berlt et al., 2011; Lee et al., 2009). Typically, LR is used in keyword generation in the following form: P(y = 1|x = x̅) = exp (x̅∙w̅ ) 1+exp (x̅∙w̅ ) , (4) 15 where y is a binary variable, whose value is equal to 1 if the candidate keyword is relevant, otherwise 0; x is a vector of input features (x̅) associated with a candidate keyword; and w̅ is a weight that the LR model learns for an input feature in x. The generated keywords are ranked by the estimated probability. LR was used in finding advertising keywords from Web pages by Yih et al. (2006). Specifically, it takes y as a binary variable under the monolithic selector; while under the decomposed selector, a phrase is decomposed into individual words and each word is tagged with one of the five labels (i.e., beginning, inside, last, unique and outside), and then five estimated possibilities are returned, i.e., 5 P(y = i|X̅ = x̅) = exp(x̅ ∙ w̅i) / ∑ j=1 exp (x̅ ∙ w̅j) . The probability of a phrase is calculated by multiplying the five probabilities of its individual words being the correct label of the sequence. Experiments illustrated that LR significantly outperforms baseline methods (e.g., the TFIDF model, an extended TFIDF model with learned weights and a domain-specific keyword extraction method). Subsequent studies used LR for different advertising scenarios. Following Yih et al. (2006), Wu & Bolivar (2008) added HTML features and proprietary data features (e.g., leaf and root category entropy) for the particular website (i.e., eBay) in the LR model, and constructed a candidate category vector for each keyword to resolve the keyword ambiguity problem. In order to find relevant keywords from online video contents, Lee et al. (2009) took into account not only within-document term features (e.g., TF-IDF scores), but also situation features specific to a targeted scene to train a LR model, i.e., pointwise mutual information (PMI) based on the co-occurrence information between a term k and situation situation , PMI(k, situation) ≈ count(k, situation)/count(k)count(situation) , where count(k, situation) is the number of times that k occurs in situation situation, count(k) and count(situation) are the collection frequency of k and the number of words in scenes mapped to situation situation , respectively. Experiments showed that the scene-specific features are potentially useful to improve the performance of keyword extraction in video advertising. Instead of directly asking humans to evaluate the relevance of candidate keywords, Berlt et al. (2011) reduced the training cost of the LR-based keyword generation model by taking experts' evaluation on the relevance of advertisements for the page where the keyword candidate is extracted from. Experiments showed that their ad-collection-aware approach could yield significant gains without dropping precision values. However, the LR-based methods can only generate keywords from particular pages, while missing 16 information from the similar pages. Besides websites and Web pages, advertisement databases and search click logs have been used by Bartz et al. (2006) to examine the performance of logistic regression, and results showed that biddedness data in advertisement databases can provide better precision. (2) Collaborative filtering (CF). CF is a classic recommendation algorithm. Suppose that there are a keyword set K and an item (e.g., URL) set U. Following Bartz et al. (2006), the keyword-item rating matrix R|K|×|U| in keyword generation is given as R|K|×|U| = R1,1 R2,1 ⋮ Rk,1 ⋮ R|K|,1 [ R1,2 R2,2 ⋮ Rk,2 ⋮ R|K|,2 ⋯ ⋯ ⋮... ⋮ ... R1,u R2,u ⋮ Rk,u ⋮ R|K|,u ⋯ ⋯ ⋮... ⋮ ... R1,|U| R2,|U| ⋮ Rk,|U| ⋮ R|K|,|U|] , (5) where Rk,u denotes the rate of keyword k on item u. Each keyword can be represented as a |U|- dimensional vector and the similarity between two rating vectors can be measured with the cosine similarity cos(k, k′) = RkRk′ ‖Rk‖2‖Rk′‖2 = ∑ Rk,uRk′,u u √∑ Rk,u u 2 √∑ Rk′,u u 2 . (6) Then the keyword-item rating matrix could be converted to a keyword-term similarity matrix based on the cosine similarity, and the Top-k most similar keywords are ranked for keyword generation. Specifically, keywords and URLs in the search logs are extracted to construct a term-URL rating matrix R|K|×|U| whose rate is the number of times that a user searched for that keyword and clicked on that URL; then a column vector Q with |K|-dimensions was created, whose value is 0-1 binary, where it is equal to 1 if the keyword in the k-th position is the seed keyword. The similarity vector was calculated as sim = ∑ 1(Ru)cos (Ru, Q) u , where Ru is the u-th column of matrix R|K|×|U|, and 1(Ru) is an 0- 1 binary indicator vector with |K|-length and contains 1 for every non-zero entry of Ru. Finally, the keywords were ranked in descending order of indexes in sim. Based on advertisement databases and search click logs, Bartz et al. (2006) examined the performance of a CF model with respect to generating relevant keywords, starting from a set of seed keywords describing an advertiser's products or services, and found that the standard collaborative filtering framework has statistically equal performance with the logistic regression with a set of selected features. (3) Topic-sensitive PageRank (TSPR). Topic-sensitive PageRank extends PageRank by 17 allowing the iteration process to be biased to a specific topic. The main idea of the PageRank algorithm is to propagate the quality score of a Web page to its out-links and obtain the static quality of Web pages by performing a random walk on the link graph. Following Haveliwala (2003), the topic-sensitive PageRank algorithm is defined as πm+1 = (1 − θ)Λ + θGπm, (7) where πm = [π1 (m), ... , πn (m)]T is a vector of the indexed Web pages in the m-th iteration, πi (m) is the score of the i-th Web page; the matrix G is a row-normalized adjacency matrix of the link graph, and Gj,i = 1 oi , oi is the out-degree of the i-th Web page; Λ is the damping vector biased to a certain topic, where i-th element in Λ is the relevance of the i-th Web page to the topic. The propagation process of the topic-sensitive PageRank algorithm is biased by the damping vector Λ in each iteration. After iterations, Web pages with higher damping values propagate higher scores to their neighbors in the link graph. In order to simultaneously generate keywords valuable for advertising from short-text Web pages, Zhang et al. (2012a) combined the content bias and advertisement bias into the propagation process of topic-sensitive PageRank, given as Rm+1 = θ1C + θ2A + (1 − θ1 − θ2)gRm, (8) where C is the content damping vector (i.e., the vector of the relevance between a set of Wikipedia entities and the target Web page) obtained through a regression based on Yih et al. (2006), and A is the advertisement damping vector obtained through calculating the frequency of each entity in the text of an advertisement; θ1 and θ2 are the parameters controlling the impact of the content relevant score to the content-sensitive PageRank value and the advertisement relevant score to the advertisement- sensitive PageRank value, respectively; g is the row-normalized Wikipedia graph link n × n matrix, where n stands for the size of the entity set. The TSPR-based keyword generation method can generate highly relevant keywords that don't occur on the target Web page, and can yield a significant improvement in precision over baseline methods (i.e., TF counting, supervised learning). (4) Latent Dirichlet allocation (LDA). Users' search intentions can be captured timely through exploring users' query topics hidden in query logs, which are valuable for commercial advertising and helpful in keyword generation (Qiao et al., 2017). Latent Dirichlet allocation (LDA) is a generative probabilistic model for a collection of documents, assuming that each document is represented as 18 random mixtures over latent topics and each topic is characterized by a distribution over words (Blei et al., 2003). Given a corpus consisting of ntopic topics over nd documents, and each document contains nd,k keywords, let φ(topic) and φ(k) denote the topic (topic) distribution for document and the keyword (k) distribution for topic, respectively. Both φ(topic) and φ(k) obey Dirichlet distributions with hyper parameters β(topic) and β(k). Given the seed keyword k0 , Qiao et al. (2017) generated a set of candidate keywords (k0. Cand) by analyzing indirect associations between k0 and keywords in query logs. Let I denote a keyword set consisting of seed keyword k0 and candidate keywords k0. Cand, i.e., I = {k0} ∪ k0. Cand. Each keyword ki ∈ I has a list of associative keywords (ki. AK), and the list of associative keywords constitutes a characteristic profile for ki , i.e., ki. Profile = {(k, k. vol)|k ∈ ki. AK}, where k is a keyword in ki. AK and k. vol is its search volume. Taking each characteristic profile (ki. Profile) as a document, all characteristic profiles of keywords in I can be collected as a corpus, which is denoted as Corpus = {ki. Profile|ki ∈ I}. In keyword generation, LDA interprets the characteristic profile of ki (i.e., ki. Profile) as a multinomial distribution Mult(φ(topic)) over a set of topics and each topic is assigned a multinomial distribution Mult(φ(k)) over keywords in Corpus. Then the generation probability of a keyword k in the Corpus can be obtained through a process that samples a topic (topic) from Mult(φ(topic)) specific with a characteristic profile (ki. Profile) and subsequently samples a keyword (k) from Mult(φ(k)) associated with topic, which is formulated as P(k|ki. Profile, β(topic), β(k)) = ∑ topic P(k|topic, β(k))P(topic|ki. Profile, β(topic)) = ∫ ∫ ∑ topic P(k|φ(k))P(topic|φ(topic)) Dir(φ(topic)|ki. Profile, β(topic))dφ(topic) Dir(φ(k)|topic, β(k))dφ(k). (9) The sampling process discussed above is repeated k. vol rounds for each keyword in a characteristic profile. Then the generation probability of the observed Corpus can be obtained by repeatedly applying the sampling process to all the characteristic profiles, which is given as P(Corpus|β(topic), β(k)) = ∏ ∏ kiεI k∈ki.profile ∏ 1≤r≤k.vol P(k|ki. profile, β(topic), β(k)) . (10) 19 Then Gibbs sampling was used to estimate parameters φ(topic) and φ(k) as well as the latent variable topic by maximizing P(Corpus|β(topic), β(k)) . After the parameter estimation, each keyword can be projected into a topic distribution. Considering the fact that two keywords related to similar topics might be competitive with each other due to market overlaps, Qiao et al. (2017) utilized topic distributions of keywords in query logs to infer competitive relationships between keywords. The mined topic structure is further combined into a factor graph model to extract a set of competitive keywords. The LDA-based method can generate competitive keywords which rarely co-occur with the seed keyword in queries. On video sites with user-generated clips (e.g., YouTube), the text data is typically short. A video comprises a small number of hidden topics, which can be represented as keyword probabilities. Thereby, a video's text can be generated from some distribution over those topics. Welch et al. (2010) explored an LDA-based keyword generation method for video advertising by mining a range of short-text sources associated with videos. Compared to statistical n-gram keyword generation methods, the LDA-based method performed better when a limited amount of text data is available, and can substantially improve the matching relevance and the profitability of generated keywords. (5) Hierarchical Bayesian (HB). HB is a statistical model formed in multiple hierarchical structures which can be used to estimate the harmonic parameters in the keyword weighting formula for keyword generation. Given that a set of articles has been randomly selected from the corpus (e.g., Wikipedia articles), HB calculates the weight based on the importance of a keyword from the components of the Wikipedia article. Let ηj be the total times that the title keyword doesn't appear in the j-th component, and θj be a random variable obeying a Beta distribution, i.e., θj~B(αj ′, βj ′), based on the sample data xj . Following Nie et al. (2019), the posterior joint probability distribution p(θj, αj ′, βj ′|ηj) is p(θj, αj ′, βj ′|ηj) = p(ηj|θj,αj ′,βj ′,βj ′)p(αj ′) ′,βj ′)p(θj|αj p(ηj) ∝ p(ηj|θj, αj ′, βj ′)p(θj|αj ′, βj ′)p(αj ′)p(βj ′). (11) By using HB, the weight of each keyword extracted from articles in the corpus can be calculated and used to decide its priority in the candidate set. Nie et al. (2019) presented a keyword generation method taking advantage of the rich link structure of Wikipedia's entry articles. Starting with a few seed keywords, the proposed method generates keywords in an iterative way, until a threshold is reached which balances the tradeoff between coverage and relevance of the generated keyword set. In the 20 keyword generation process, the weight of a keyword in an article was calculated as KWW(k) = α1TFIDFs(k) + α2TFIDFc(k) + α3TFIDFd(k) + α4TFIDFi(k) + α5|AT(k)| , where KWW(k) is the weight for a given keyword; TFIDFs(k), TFIDFc(k), TFIDFd(k) and TFIDFi(k) measure the importance of a keyword occurring in abstract, content, main text, information box, respectively; |AT(k)| indicates whether a keyword is in the anchor text; and αj (αj = 1 − θj, j = 1, ⋯ ,5) is the importance of a component where the keyword appears, which can be estimated by using the hierarchical Bayesian keyword weighting method. The HB-based method performs at a superior level with respect to both coverage and relevance. 3.2.4 Linguistics processing Multivariate methods are incapable of generating semantically relevant keywords that don't contain or co-occur with the seed keywords. Moreover, multivariate methods suffer from the problem of topic drift which might generate keywords with little clicks and conversions and thus produce a massive overhead. Thus, more syntactic and semantic analysis are needed to capture users' real search intentions in keyword generation. Keyword generation based on linguistics processing helps find more semantically related and profitable keywords. Notations used in linguistics processing models for keyword generation are presented in Table 3d. Table 3d. Notations used in linguistics processing models for keyword generation Terms k landing landing translation (landing(j)|k(i)) wj mapping SensesDIC(ki) q Definition k = {k(1), k(2), ... , k(n)}, denoting the bags of words of keyword k A landing page landing = {landing(1), landing(2), ... , landing(m)}, denoting the bags of words of landing A translation table denoting the likelihood of landing(j) being generated from k(i) A weighting parameter for landing(j) A mapping from word(s) to sense(s) The set of senses encoded in a dictionary DIC for ki A query keyword q q = {q(1), q(2), ... , q(n)}, denoting a set of query keywords after sampling n times In the following, we go through four linguistics processing methods in keyword generation, namely, translation model, word sense disambiguation, relevance-based language models and heuristics-based methods. 21 (1) Translation model (TM). Translation model is originally presented in statistical machine translation literature to translate text from one type of natural languages to another (Brown et al., 1993). In keyword generation, translation model learns translation probabilities from keywords to landing pages through a parallel corpus, and bridges the vocabulary mismatch by giving credits to words in a phrase that are relevant to the landing page but do not appear as part of it. By treating keywords and landing page as bags of words, i.e., k = {k(1), k(2), ... , k(n)} and landing = {landing(1), landing(2), ... , landing(m)} , for each k(i) ∈ k , the probability of the translation probability from the keyword to the landing page P (landing|k) can be estimated as P (landing|k) ∝ ∏ ∑ translation(landing(j)|k(i)) j i , (12) where translation(landing(j)|k(i)) is the translation table, i.e., the probability that characterizes the likelihood of a word in a landing page being generated from a word in a keyword. Ravi et al. (2010) proposed a keyword generation method by combining a translation model with language models to produce highly relevant well-formed phrases. Specifically, the probability P (landing|k) was modified by associating a weight wj for all landing(j) ∈ landing with respect to different features (e.g., a higher weight for words with HTML tags), i.e., P (landing|k) ∝ wj ∏ (∑ translation (landing(j)|k(i)) ) j i , then the keyword language model P(k) was instantiated with a bigram model capturing most of useful co-occurrence information and smoothed by a unigram model. Based on the Bayes' law, the probability P(k|landing), i.e., the likelihood of a keyword given the landing page, can be estimated to rank the keywords, i.e., P (k|landing) ∝ P (landing|k) P(k). Experiments based on a realworld corpus of landing pages and associated keywords showed that the TM-based method outperformed significantly over a method based purely on text extraction, and could generate many human-crafted keywords. (2) Word sense disambiguation (WSD). WSD is the ability in computational linguistics to identify which sense (meaning) of a word is used in a particular context (Navigli, 2009). Through viewing a text as a sequence of words (k1, k2, ... , kn), WSD can be defined as a task of assigning the appropriate sense(s) to word(s) in the text, i.e., to identify a mapping (mapping) from word(s) to sense(s), such that mapping(i) ⊆ SensesDIC(ki), where SensesDIC(ki) is the set of senses encoded in a dictionary DIC for word ki , and mapping(i) is that subset of the senses of ki which are appropriate in the text. In online advertising and SSA, in order to exclude the display of an 22 advertisement from a population of non-target audiences, it is necessary to identify negative keywords. For example, Scaiano & Inkpen (2011) proposed a method to automatically identify negative keywords, using Wikipedia as a sense inventory and an annotated corpus. Specifically, they searched all links containing the seed keywords and collected all destination pages to find all senses for each keyword, then generated context vectors for each sense by tokenizing each paragraph containing a link to the sense being considered. In this process, all words were recorded and counted as a dimension in the context vector. After identifying the intended sense and creating a broad-scope intended-sense list, negative keywords are identified through finding words from the context vectors of the unintended senses with high TFIDF. The WSD-based method could find keywords strongly correlated with negative topics and improve the performance of advertising campaigns. (3) The relevance-based language (RBL) model. The RBL model is used to determine the probability of observing a keyword k in a collection of documents, i.e., P(k|DOC) (Lavrenko & Croft, 2017). Given a query keyword q and a large collection of documents ( DOC ), both q and each document are represented as a sequence of words. Each document in DOC is related to q and there is no training data about which document in DOC is related to k. The relevance model is referred to the underlying mechanism that determines the probability P(k|DOC) . We assume that both q and documents related to k can be sampled from DOC, but possibly by different sampling processes. After sampling n times, we can observe query keywords q = {q(1), q(2), ... , q(n)} . Thus, given such observations, we can estimate the conditional probability of observing k as P(k|DOC) ≈ P(k|q(1)q(2) ... q(n)) = P(k,q(1)q(2)...q(n)) P(q(1)q(2)...q(n)) . (13) Jadidinejad & Mahmoudi (2014) proposed a keyword generation method based on a modified relevance-based language model, with Wikipedia as the knowledge base. First, by capitalizing Wikipedia's disambiguation pages, different semantic groups for a given ambiguous query were extracted. Second, appropriate semantic groups were selected based on user's intent, and an initial list of candidate keywords were generated by tracking bidirectional anchor links. Third, given a seed query and a collection of documents corresponding to candidate keywords from Wikipedia, the relevance- based language model was applied to estimate the probability of observing a keyword in documents, which helped measure the relevance between candidate keywords to the seed query. The RBL-based method is language independent, well-grounded with expert keywords and computationally efficient. 23 (4) Heuristics-based method. Consumers with a high conversion probability tend to use an online store's internal search engine (Ortiz-Cordova et al., 2015). Scholz et al. (2019) proposed a heuristics- based method to extract keywords from an online store's internal search logs. Specifically, a set of candidate keywords identified from the internal search and other sources (e.g., Thesauri) was enriched with other keyword generation tools and filtered according to the monthly search volume in Google, then keywords whose internal search volumes are higher than a predefined threshold were included into the target set. This heuristics-based method can substantially increase the number of profitable keywords and the conversion rate, and in the meanwhile, decrease the average cost per click. 3.2.5 Machine learning The performance of linguistics processing is influenced by the quality of sources (e.g., Web pages, texts, dictionaries), which might make suggested keywords deviate from search users' real intentions. Machine learning can automatically learn and produce more accurate and reliable results by consuming a large amounts of data accumulated in online advertising, executing feature engineering without little interference of humans and capturing more rich behavioral information and structural relationships with high-order representation. Thus, machine learning models can generate large sets of relevant keywords by capturing the intention of users and processing the up-to-date information sources. Notations used in machine learning models for keyword generation are presented in Table 3e. Table 3e. Notations used in machine learning models for keyword generation Terms ξn wn c̃ lk lu T D n̂ n̂′ Definition A random variable describing the position of random walk after n steps The n-th step of a random walk A concept that an advertiser is interested in The random variable related to a concept for query keyword k The random variable related to a concept for URL u The probability of transiting to the absorbing null class node Dataset A node in decision tree A child node of n̂ C(n̂|Υ) A set of child nodes of n̂ Dn̂ Υ G(n̂, Υ) xΥ XΥ XΥ,k A subset of dataset D at node n̂ The branching criterion The quality of the partition of Dn̂ induced by Υ An element of x A set of unique values of categorical variable xΥ The k-th value of XΥ 24 |XΥ| H seq, seq′ ′) seqi (seqi seq_id The number of values in XΥ The entropy A sequence The i-th element in sequence seq(seq′) The id of sequence seq seq_pattern A sequential pattern KT KL εi fT σ2 σ2Cf sik Ci μjk r̃ij candkn−1 R1(ki, ki+1) Rn H The union of the keyword matrix [kT,1, ... , kT,n] T and the target dataset {kT,i} The union of the keyword matrix [kL,1, ... , kL,m] T and {kL,i}, i.e., a subset of KT that is chosen to be labeled The measurement error fT = [f(kT,1), ... , f(kT,n)]T, denoting the function values on all the available data KT The variance of a distribution A covariance matrix A binary parameter indicating whether the i-th ad is subscribed with the keyword k A binary variable indicating whether the i-th ad belongs to category j The mean of the prior distribution for the keyword subscription probability The probability that the i-th ad belongs to category j A candidate set of keywords with one-step relevance to kn−1 The one-step relevance of keyword pair (ki, ki+1) Rn(k0, k|k1, k2, ... , kn−1), denoting the n-step relevance of k0 and k via the intermedia keywords k1, k2, ... , kn−1 H = (h1, h2, ... , hn), denoting hidden representations The embedding of keyword kt A context vector e(kt) ctt−1 st 2, ... , k̃ K̃ domaink, domaink̃ The corresponding domain categories of K and K̃ A state vector K̃ = (k̃ 1, k̃ m), denoting a generated target keyword sequence In the literature, researchers have investigated several statistical learning methods to facilitate keyword generation in SSA, including random walk, decision tree, sequential pattern mining, active learning, Bayesian online learning, multi-step semantic transfer analysis and sequence-to-sequence learning. (1) Random walk (RW). RW can be used to describe a keyword generation path including a succession of random steps in the query-click graph extracted from search logs. In essence, clicks represent a strong association between queries and URLs (Yang & Zhai, 2022). Hence, advertisers can exploit the proverbial "wisdom of the crowds" to reconstruct query-click logs as a weighted bipartite graph (K, U, R). Specifically, query keywords in K and URLs in U constitute the partitions of the 25 graph, and the number of times that users issued query k to the search engine and clicked on URL u (i.e., Rk,u ) can be regarded as weight on the edge (k, u) ∈ R. Suppose that w1, w2, ...,wn is a sequence of independent and identically distributed random variables, a random walk is a random process which describes a path consisting of a succession of random steps on some mathematical space (Xia et al., 2019). It can be denoted as {ξn, n = 0,1,2, ... }, where ξn is a random variable describing the position of random walk after n steps and ξn = ξn−1 + wn, n ≥ 1, where wn denotes the step of the random walk. Fuxman et al. (2008) formulated the keyword generation problem within a framework of Markov Random Fields and developed an RW-based algorithm with absorbing states to traverse a query-click graph. Given a concept c̃ that an advertiser is interested in, a seed set of URLs relevant to c̃ was constructed manually, which can be regarded as the representation of c̃. Let lk and lu denote the random variable related to c̃ for query keyword k and URL u, respectively. The probability that a random walk starting from query k will be absorbed at concept c̃, i.e., P(lk = c̃), can be computed as P(lk = c̃) = (1 − T) ∑ u:(k,u)∈R Rk,u ∑ u:(k,u)∈R Rk,u P(lu = c̃) , (14) where T is the probability of transiting to the absorbing null class node. The null class node is a node in a query-click graph whose probability (i.e., P(lk = c̃) or P(lu = c̃)) is below a threshold, and the set of null class nodes define the boundary of the query-click graph. Similarly and recursively, for all URLs in the seed set, P(lu = c̃) = 1; for other URLs (i.e., unlabeled URL) in search logs, the probability of a random walk that starts from URL u and ends up being absorbed in concept c̃, i.e., P(lu = c̃), can be computed as P(lu = c̃) = (1 − T) ∑ k:(k,u)∈R Rk,u ∑ k:(k,u)∈R Rk,u P(lk = c̃) . (15) The processes defined by P(lk = c̃) and P(lu = c̃) iterated alternately until the convergence. Discarding P(lk = c̃) and P(lu = c̃) whose probabilities lower than a predefined threshold, we can obtain P(lk = c̃), the probability that query k belongs to seed concept c̃, for every query in the set K. we can obtain P(lk = c̃), i.e., the probability that k will be absorbed at c̃, for every query keyword in search logs, which can be regarded as the relevance between k and c̃. The RW-based can generate a large amount of high-quality keywords with minimal effort from advertisers. (2) Decision tree (DT). DT is a flowchart-like structure where paths from the root to leafs represent classification rules. Given a dataset D = {(x, y)} with x being a feature vector of keywords 26 and y being the label of relevance, DT represents a recursive partition of D such that (a) each node of the tree stores a subset of D with the root node storing D, (b) the subset Dn̂ at node n̂ is the union of the mutually disjoint subsets stored at its child nodes (n̂′), i.e., {Dn̂′| n̂′ ∈ C(n̂|Υ)} forms a partition of Dn̂ where C(n̂|Υ) denotes the set of child nodes of n̂, and (c) the partition is determined by a branching criterion Υ. The optimal DT is built by recursively identifying the locally optimal branching criterion at each node starting from the root node while subjecting to some stopping as well as pruning criteria. Specifically, at node n̂, the optimal branching criterion is ∗ = argmaxΥ G(n̂, Υ), (16) θn̂ where G(n̂, Υ) measures the quality of the partition of Dn̂ induced by Υ. In the decision tree-based scheme, GM et al. (2011) developed a keyword generation approach to learn the website-specific hierarchy from the (Web page, URL) pairs of a website, and keywords are populated on nodes of the induced hierarchy via successive top-down and bottom-up iterations. Human evaluations showed that their method outperformed previous approaches by Broder et al. (2007) and Anagnostopoulos et al. (2007) in terms of relevance. In keyword generation, as specified by GM et al. (2011), an instance (x, y) corresponds to a Web page, where x is a vector of features extracted from the URL of the Web page, and y is the cluster of Web pages with similar contents. As an example, consider a Web page with the URL "www.examplewear.com/exampleshop/product.php?view=detail& group=shoes&dept=men", from which four features can be extracted, i.e., x1 ="product.php" (the name of the php script), x2 ="detail" (the value of argument "view"), x3 ="shoes" (the value of argument "group") and x4 ="men" (the value of argument "group"). Each element of x, i.e., xΥ, is a categorical variable having a set of unique values denoted by XΥ . For example, X4 = {"men", "women", "outlet", "accessories"}, which is constructed by going through all URLs and collecting values of the "dept" argument. For convenience, let XΥ,k denote the k-th value of XΥ assuming an arbitrary order, and |XΥ| denote the number of values in XΥ. The branching criterion is to select a feature Υ, according to which Dn̂ is partitioned. The quality of the resulting partition is measured with the gain ratio metric, specified as follows. G(n̂, Υ) = H(y|Dn̂)−∑ |XΥ| k=1 P(xΥ=XΥ,k|Dn̂)H(y|D ) (n̂,XΥ,k) H(xΥ|Dn̂) , (17) where P(xΥ = XΥ,k|Dn̂) is the estimated probability of having value XΥ,k on feature dimension i for a data instance in Dn̂, H(y|Dn̂) is the entropy of labels in Dn̂ measuring how impure (diversified) 27 Web pages in Dn̂ are in terms of assigned clusters, H (y|D(n̂,XΥ,k)) is the entropy of labels in D(n̂,XΥ,k), and H(xΥ|Dn̂) is the entropy of feature Υ in Dn̂ measuring the complexity of the partition. The gain ratio metric measures how much impurity (content dissimilarity) reduction can be achieved through a data space partition, and favors partitions with high impurity reduction but low partition complexity, which is helpful in preventing overfitting. (3) Sequential pattern mining (SPM). SPM aims to find frequent patterns from a set of sequences (Mabroukeh & Ezeife, 2010), which is used to find keywords in online broadcasting contents. Given a set of items (e.g., terms) K = {k1, k2,...,knK}, two sequences seq =< seq1seq2 ... seqnseq > and seq′ = < seq1 ′ seq2 ′ ... seqnseq′ ′ >, where seqi (seqi ′) is a subset of items K, if there exist integers 1 ≤ j1 < 2 < j2 < ⋯ < nα ≤ jnα making seq1 ′ ⊆ seqj1, seq2 ′ ⊆ seqj2, ... , seqnα ′ ⊆ seqjnα , seq′ is called a subsequence of seq , i.e., seq′ ⊆ seq . Given a sequence dataset D , i.e., a set of tuples 〈seq_id, seq〉, where seq is a sequence and seq_id is the id of seq, the support of a subsequence α′ is the number of tuples in the dataset containing seq′, given as supportD(seq′) = |{〈seq_id, seq〉|(〈seq_id, seq〉 ∈ D)^(seq′ ∈ seq)}|. (18) Given a positive integer min_support as the support threshold, a sequence seq′ is called a sequential pattern if supportD(seq′) ≥ min_support. In keyword generation from online community contents, Li et al. (2007) used sequential mining to discover language patterns (i.e., a sequence of frequent words around an extracted keyword). The Web has become a communication platform, where users spend a large amount of time on broadcasting and interactions with others in online communities, e.g., blogging, posting, chatting, etc. Online contents are composed of specific keywords, phrases and wordings associated with frequently changed topics in communities. Keywords are extracted once a sentence is matched with a pattern from online broadcasting contents and scored with the sum of the confidence of matched patterns, i.e., ∑ confidence(seq_pattern) = ∑ supportD(seq)/supportD(seq_pattern\< topic >) , where seq_pattern\< topic > is the remaining part of sequential pattern seq_pattern after < topic > is removed. The process of sequential pattern mining and keyword extraction iterates and eventually generates a large number of keywords. Experiments showed that the proposed approach can find meaningful language patterns and reduce the cost of manual data labeling, compared with traditional 28 statistical approaches that considered each word individually. (4) Active learning (AL). AL is a special type of machine learning where a learning algorithm actively queries users (or some information sources) to label new data points with the desired outputs under situations where unlabeled data is abundant but manual labeling is expensive. Transductive Experimental Design is an active learning approach which can be used to select candidate keywords (for labeling and training) that are hard to predict and representative for unlabeled candidates. Let KT denote the union of the keyword matrix [kT,1, ... , kT,n] T and the target dataset {kT,i}, and KL denote the union of the keyword matrix [kL,1, ... , kL,m] T and a subset of KT that is chosen to be labeled (i.e., {kL,i}). Define f(x) = wTkL as the output function learned from the measure yi = wTkL,i + εi, i = 1, ... , m, where w is the weight vector, εi~N(0, σ2) is measurement error and yi (label) is the binary relevance score. Let fT = [f(kT,1), ... , f(kT,n)]T be the function values on all the available data KT. Then the predictive error fT − fT̂ has the covariance matrix σ2Cf with Cf = KT(KL TKL + μI)−1KT T. (19) The total predictive variance on the complete data set KT is given as ∑ E[(F(kT,i − f(kT,i)))2] n i=1 = σ2Tr(Cf). (20) The objective is to find a subset KL which can minimize the total predictive variance. Users' relevance feedback is another type of valuable information source for profitable keyword generation. Wu et al. (2009) proposed an efficient interactive model based on an active learning approach called transductive experimental design using relevance feedback for keyword generation in SSA. Each keyword was represented using a characteristic document consisting of top-hit search snippets for a seed keyword. In a seed's characteristic document, top-n weighted terms were recommended as candidate keywords. The AL-based method could significantly improve the relevance of generated keywords. (5) Bayesian online learning (BOL). Bayesian online learning replaces the true posterior distribution with a simple parametric distribution, and defines an online algorithm by a repetition of two steps (i.e., an update of the approximate posterior when a new sample arrives and an optimal projection into the parametric family) (Opper & Winther, 1999). BOL is helpful to improve the computational efficiency when estimating the unknown variables based on a large data. In SSA, advertisers use a set of keywords to describe an advertisement. Let K be the set of subscribed keywords 29 in the i-th ad: if the i-th ad is subscribed with keyword k ∈ K, then sik = 1, else sik = 0. Assuming that the keyword vector of an ad is sampled from one or several ad categories, such as automobiles and travel, let p(sik = 1|Ci = j) denote the probability that the i-th ad is subscribed by k when it belongs to category j. Then under the scheme of Bayesian online learning, each data point of ads is processed at a time, and the posterior distributions of the probability p(sik = 1|Ci = j) obtained after processing a data point are passed as the prior distributions for processing the next data point. Keywords can be generated to an advertiser based on keyword subscriptions of other advertisers. The probability of an unobserved keyword k′ ∉ K that is implicitly related to the i-th ad can be given as n p(sik′ = 1|{sik}k∈K) = ∑ j=1 r̃ijμjk , (21) where r̃ij = p(Ci = j|si) is the probability that the i-th ad belongs to category j, and μjk is the mean of prior distribution for the keyword subscription probability p(sik = 1|Ci = j). Schwaighofer et al. (2009) provided an efficient Bayesian online learning algorithm to group advertisements into categories and applied the BOL algorithm to generate keywords. Experiments based on two advertisement datasets showed that the BOL-based algorithm is suitable for large scales of data streams because of its low computational cost. (6) Multi-step semantic transfer analysis (MTSTA). The MTSTA-based keyword generation can yield keywords based on both their direct and indirect relevance to the seed keywords via semantic transfer. Given a seed keyword k0, for keyword k , if there exist n − 1 intermedia keywords k1, k2, ... , kn−1 satisfying the conditions that k is in the candidate set of kn−1 (i.e., candkn−1), kn−1 is in the candidate set of kn−2 (i.e., candkn−2), ..., and k1 is in the candidate set of k0 (i.e., candk0), then the n-step relevance of k0 and k via the intermedia keywords k1, k2, ... , kn−1, can be defined as Rn(k0, k|k1, k2, ... , kn−1) = R1(k0, k1) ∏ R1(ki, ki+1) n−2 i=1 R1(kn−1, k), (22) where R1(k0, k1), R1(ki, ki+1), R1(kn−1, k) are the one-step relevance of keyword pairs. The MTSTA-based keyword generation finds keywords with multi-step relevance that is no less than a certain threshold in the query logs (Zhang & Qiao, 2018; Zhang et al., 2021). In order to explore keywords with indirect relevance, Zhang and his colleagues explored a MTSTA-based keyword generation method by iteratively conducting co-occurrence analysis to form a hierarchal multi-step relevance tree, and developed a pruning strategy to reduce the computational consumption in generating the transfer paths. 30 (7) Sequence-to-sequence learning (Seq2Seq). The encoder-attention-decoder framework based on Seq2Seq learning is an end-to-end approach to sequence learning that makes minimal assumptions on the sequence structure (Sutskever et al., 2014). In keyword generation, the encoder represents an input keyword sequence K = (k1, k2, ... , kn) with hidden representations H = (h1, h2, ... , hn), i.e., ht = GRU(ht−1, e(kt)), (23) where GRU is gated recurrent unit (Chung et al., 2014) and e(kt) is the embedding of keyword kt. The decoder updates state st as follows: st = GRU(st−1, [ctt−1; e(k̃t−1)]), (24) where ctt−1 is the context vector defined as a weighted sum of the encoder's hidden states, and e(k̃t−1) is the embedding of a previously decoded keyword. After obtaining the state vector st, the decoder samples from the generation distribution and generates a keyword k̃t: k̃t~P(k̃t|k̃1, k̃2, ... , k̃t−1, ctt) = softmax(w ∙ st). (25) K̃ = (k̃1, k̃2, ... , k̃m) forms a sequence of generated keywords. Zhou et al. (2019) proposed a keyword generator based on Seq2Seq learning to generate domain- specific keywords through estimating the probability P(K̃, domaink̃ |K, domaink) = P(domaink̃ |K, domaink) ∏ (k̃t|k̃1, k̃2, m t=1 ... , k̃t−1, domaink̃ , K, domaink) , where domaink and domaink̃ are the corresponding domain categories of K and K̃ , respectively. In addition, a reinforcement learning algorithm was developed to strengthen the domain constraint in the generation process. The Seq2Seq-based method could generate diverse, relevant keywords within the domain constraint. However, statistical learning methods have some limitations, such as requiring a set of labelled keywords and the low efficiency in online computation. 3.3 Features used for Keyword Generation In the literature, keyword generation methods have been proposed on the basis of five major information sources to extract keywords and relationships among them, which are described as follows. (1) Websites and Web pages: The Web has become a vital place for firms to post advertisements and other commercial information (Thomaidou and Vazirgiannis, 2011). In the meanwhile, the richness of information sources on the Web entitles advertisers to build a domain-specific keyword pool. In 31 particular, websites and Web pages can be used as a corpus of the source text to extract relevant keywords of interest for their online advertising campaigns. In this branch of keyword generation methods, meta-tags of Web pages are used as an important information feature. The meta-tag crawler sends one or more seed keywords to search engines and extracts a set of meta-tag keywords from Web pages in the organic list. Several popular online advertising tools (e.g., WordStream and Wordtracker) employ meta-tag crawlers to obtain a pool of meta-tag keywords and then based on it suggest relevant keywords for advertisers. (2) Search users' query logs: User's query logs with search engines timely reflect their intents (Da et al., 2011), which are significantly valuable for commercial communications and advertising. This stream of keyword generation primarily utilizes statistical information of co-occurrence relationships among keywords mining from historical query logs. (3) Search results snippets: One or several seed keywords are sent to search engines and resulting search result snippets are used to generate relevant keywords. (4) Advertisement databases and advertisers' bidding data: Search advertisement databases and advertising logs such as bidding data are taken as inputs to obtain relevant keywords. (5) Domain semantics and concept hierarchy: Keyword generation methods relying on query logs mining generally ignore the semantic similarity between keywords, thus fail to suggest keywords that don't explicitly contain seed keywords or have less co-occurrence with but are semantically related to seed keywords. To this end, the fifth category of keyword generation primarily focuses on the expansion of the keyword scope by taking advantage of conceptual hierarchies built manually or extracted either from vocabulary dictionaries/corpus (e.g., thesaurus dictionary, Wikipedia) or constructed by domain experts. In the following, we explore features used in prior research in the five streams. Tables 4a-4e summarize input/features used in keyword generation in five research streams. In the literature, a variety of features are used to represent keywords, which have great contributions to the effectiveness of keyword generation solutions. In keyword generation from websites and Web pages, from Table 4a, it is apparent that information retrieval oriented features are most widely used in keyword extraction from websites and Web pages. As reported by Yih et al. (2006), information retrieval oriented features and query log features are helpful for keyword generation, while linguistic features don't seem to work. Consequently, Berlt et al. (2011) adopted features extracted from 32 the ad collection and GM et al. (2011) took the hierarchic URL tokens as features, while omitting linguistic features. However, Li et al. (2007) found that features of language patterns can help keyword generation, and Zhou et al. (2007) inserted features such as title and keyword importance into meta keywords vector to improve keyword generation. In addition to features from Web pages as in Yih et al. (2006), Wu and Bolivar (2008) explored features from the view of retailers (e.g., eBay). In keyword generation for video advertising, Lee et al. (2009) advocated features reflecting the targeted scene situation. Table 4a. Input/Features for Keyword Generation from Websites and Web Pages Refs. L F C A H Y M F T I Yih et al. √ √ √ √ √ Features U R L √ I R F √ R L √ S D L √ L C P √ Q L F √ R E N R C H 1 C O C I D T D L P S F (2006) Wu & Bolivar (2008) √ √ √ √ √ √ √ √ √ Berlt et al. √ √ √ √ √ √ √ √ √ √ (2011) GM et al. (2011) Zhou et al. (2007) Li et al. (2007) Lee et al. √ (2009) √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ Note: LF=Linguistic Features; CA=Capitalization; HY=Hypertext; MF=Meta related Features (e.g., meta section, meta keywords, meta description); TI=Title; URL=Uniform Resource Locator; IRF=Information Retrieval Oriented Features (e.g., TF, IDF, TF history, log value of TF and DF); RL=Relative Location (e.g., wordRatio, sentenceRatio, wordDocRatio); SDL=Sentence and Document Length; LCP=Length of the Candidate Phrase; QLF=Query Log Features (e.g., whether the word appears in the query log files as the first/interior/last word of a query keyword, whether the word never appears in any query log); RE=Root Entropy; NRC=The Number of Root Categories; H1=the Highest Section Level; CO=Co-occurrence; CID=Class ID (i.e., the category of Web pages or advertisements such as sports); TD=Text Descriptions (i.e., a detail description to the product, company or related matter of Web pages or advertisements); LP=Language Pattern; SF=Situation Features. In online advertising, clicks demonstrate a strong relationship between queries and URLs. This makes query logs valuable information for keyword generation (Bartz et al., 2006; Fuxman et al., 2008), as illustrated in Table 4b. Meanwhile, joint search demand and keyword search demand are informative 33 and helpful in keyword expansion and competitive strategy development (Qiao et al., 2017). Moreover, semantic and domain-specific information entitles to generate keywords that aren't present in the corpus (Zhou et al., 2019). In addition, online store's internal search is another source to extract keywords relevant to consumer behaviors (Scholz et al., 2019). Table 4b. Input/Features for Keyword Generation from Query Logs Refs. Bartz et al. (2006) SL √ Fuxman et al. √ (2008) Qiao et al. (2017) Zhou et al. (2019) Scholz et al. (2019) URL CL SD KO HT SF DSF NIS Features √ √ √ √ √ √ √ √ √ Note: SL=Seed Links; URL=Uniform Resource Locator; CL= Clicks; SD=Search Demand (e.g., keyword search demand and joint search demand); KO=Keyword Overlap; HT=Hidden Topic; SF=Semantic Features (e.g., language model score); DSF=Domain-specific Features (e.g., domain category distribution); NIS=The Number of Internal Search Results. In keyword generation from search result snippets, as we can see from Table 4c, TF and TFIDF, inverse TF, search snippets similarity and common search URLs are taken as predictive variables to characterize the relevance between seed terms and candidate keywords (Wu et al., 2009); and weighted title, meta keywords, meta description and anchor text with its importance inside the HTML document are used to hold semantics of a document (Thomaidou and Vazirgiannis, 2011). Table 4c. Input/Features for Keyword Generation from Search Result Snippets Refs, IRF SSF URL TI MF AT BT H1 Features Wu et al. (2009) Thomaidou & Vazirgiannis √ √ √ √ √ (2011) √ √ √ √ √ Note: IRF=Information Retrieval Oriented Features (e.g., TF and TF-IDF, inverse TF); SSF=Search Snippets related Features (e.g., search snippets similarity, search result snippets); URL=Uniform Resource Locator; TI=Title; MF=Meta related Features (e.g., meta keywords, meta description); AT=Anchor Text; BT=Bold Tags; H1=the Highest Section Level. 34 In keyword generation from advertising databases, from Table 4d, we can notice that features are relatively scattered. In Chang et al. (2009), feature vectors based on pointwise mutual information are constructed to represent bidding keywords. Similarly, Sarmento et al. (2009) weighted the keyword co- occurrence value feature with mutual information. Schwaighofer et al. (2009) utilized the feature of ad category to suggest keywords based on the prior selected keywords with similar semantics, and Ravi et al. (2010) used keyword overlap, cosine similarity and position of the candidate keyword on the landing page. Table 4d. Input/Features for Keyword Generation from Advertising Databases Reference SOC PMI CO KO AC KO URL PK IRF Features Chang et al. (2009) √ √ Sarmento et al. (2009) Schwaighofer et al. (2009) Ravi et al. (2010) √ √ √ √ √ √ √ √ Note: SOC=Second Order Co-bidding; PMI=Point-wise Mutual Information; CO=Co-occurrence; KO=Keyword Overlap; AC=Ad Category; KO=Keyword Overlap; URL=Uniform Resource Locator; PK=Position of the Keyword (i.e., binary features indicating whether the keyword is present in the title of the landing page, or in its body); IRF=Information Retrieval Oriented Features (e.g., a variant of TF-IDF weighting). In keyword generation based on semantics and concept hierarchy, semantic relationships between keywords are taken into account for keyword generation (Joshi and Motwani, 2006; Abhishek and Hosanagar, 2007; Mirizzi et al., 2010; Zhang and Qiao, 2018; Zhang et al., 2021), as shown in Table 4e. Similarly, information retrieval oriented features are frequently used to improve the keyword generation results. It is notable to see that Wikipedia is widely used as a corpus to generate keywords for online advertising in various ways, e.g., creating representative vectors for semantic concepts (Amiri et al., 2008; Zhang et al., 2012a) and context vectors (Scaiano and Inkpen, 2011), ranking keyword pairs based on hypertextual links (Mirizzi et al., 2010), mining keywords based on Wikipedia graph (Welch et al., 2010; Jadidinejad and Mahmoudi, 2014). Table 4e. Input/Features for Keyword Generation based on Semantics and Concept Hierarchy Reference C D I R F C O W F C H H T E I S U R L Features T I H E A T H L M F S P O C A C L C P Q L F 35 Joshi √ √ &Motwani (2006) Abhishek &Hosanag ar (2007) Amiri et al. (2008) Chen et al. (2008) Mirizzi et al. (2010) Welch et al. (2010) Scaiano &Inkpen (2011) Zhang et al. (2012a) Jadidinejad &Mahmou di (2014) Zhang and Qiao (2018) Nie et al. (2019) √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ √ Zhang et √ √ al. (2021) Note: CD=Characteristic Document (i.e., text-snippets from top 50 search-hits for the keyword); IRF=Information Retrieval Oriented Features (e.g., IDF, TF-IDF, DF, DF-ICF, DF-LCF, CF-IDF); CO=Co-occurrence; WF= Wikipedia Features (e.g., incoming links, outgoing links, redirects, candidate concepts, pool size); CH=Concept Hierarchy; EIS=External Information Sources (e.g., classical search engine results and social tagging); HT=Hidden Topics; URL=Uniform Resource Locator; TI=Title; HE=Headline (i.e., whether it is exactly the headline); AT=Anchor Text; HL=Hyperlink (i.e., whether it is part of a hyperlink of the page); MF=Meta related Features; SP=Span; OC=OneCapt; AC=AllCapt; LCP=Length of the Candidate Phrase; QLF=Query Log Features (e.g., the number of queries related to a keyword in a query log). 3.4 Evaluation Metrics for Keyword Generation In the literature, various evaluation metrics have been employed to evaluate the effectiveness of keyword generation techniques, as summarized in Table 5. 36 Most research used more than one metric to evaluate the proposed method. Precision, recall, and F-measure are the most commonly used metrics. Among them, precision ranks first, which has been taken into account in 14 out of 30 keyword generation studies; and recall has been considered together with precision in most situations. Precision and recall are regarded as two facets of the quality of keyword generation (Zhou et al., 2007; Berlt et al., 2011). The F-measure family of metrics combines precision and recall, e.g., F1 is the harmonic mean of precision and recall (Zhou et al., 2019). Li et al. (2007) used the F1 from both macro (i.e., the transcript level) and micro (i.e., the section level) perspectives. Besides these three popular metrics, a rich set of metrics has been used to measure whether the generated keyword set is satisfactory, useful or effective, such as relevance (Thomaidou and Vazirgiannis, 2011), novelty (Qiao et al., 2017; Zhou et al., 2019; Zhang et al., 2021) and coverage (Chang et al., 2009; Nie et al., 2019). Joshi and Motwani (2006) developed a variant of F-measure taking into account maximizing precision, recall and nonobviousness to measure the goodness of keyword generation. Because the ultimate goal of keyword generation is to improve advertising performance and bring more profits to advertisers, performance indexes such as click-through rate are also considered as important metrics (Sarmento et al., 2009; Zhou et al., 2019). Table 5. Evaluation Metrics for Keyword Generation Metric Definition Refs. Top-n score The number of the top-n outputs that are in the Yih et al. (2006); Lee et al. (2009) list of terms described by the annotator for that page, e.g., Top-10 score. Entropy Let P(k|p) denote the probability that Yih et al. (2006) keyword k is relevant to page p, Entropy = − log2 P(k|p) if k is relevant to p; Entropy = − log2(1 − P(k|p)), otherwise. Accuracy The ratio of correctly predicted observations to Berlt et al. (2011); Zhou et al. (2019) the total observations. Accuracy = (True postitive + True negative)/(True postitive + True negative + False postitive + False negative). Precision The ratio of correctly predicted positive Wu &Bolivar (2008); Berlt et al. observations to the total predicted positive (2011); Zhou et al. (2007); Li et al. observation. (2007); Bartz et al. (2006); Zhou et al. 37 Precision = True positive/ (2019); Wu et al. (2009); Chang et al. (True positive + False positive). (2009); Joshi &Motwani (2006); Abhishek &Hosanagar (2007); Chen et al. (2008); Mirizzi et al. (2010); Zhang et al. (2012a); Zhang et al. (2021) Recall The ratio of correctly predicted positive Berlt et al. (2011); Zhou et al. (2007); observations to all observations in actual class. Li et al. (2007); Zhou et al. (2019); Recall = True positive/(True positve + Joshi &Motwani (2006); Abhishek False negaitve). &Hosanagar (2007); Chen et al. (2008); Zhang et al. (2021) F1-measure The weighted average of Precision and Recall. Li et al. (2007); Qiao et al. (2017); F1 = 2 ∗ Precision ∗ Recall/(Precision + Zhou et al. (2019); Joshi &Motwani Recall). (2006); Chen et al. (2008); Zhang &Qiao (2018); Zhang et al. (2021) NDCG The normalized discounted cumulative gain, GM et al. (2011); Chen et al. (2008) i.e., a measure of ranking quality. It is calculated for the sorted list of results for each of the keywords NDCG = N ∑ 2score(j)−1 log2(j+1) k i=1 , where N is the normalization constant chosen so that a perfect ordering of the results will receive the score of one; score(j) is the gain value associated with the label of the item at the j-th position of the ranked list; log2(j + 1) is a discounting function that reduces the document's gain value as its rank increases. Percentage of A measure of the efficiency of a hierarchy in GM et al. (2011) URL Match matching unindexed URLs which is defined as the percentage of correctly matched URL in a given hierarchy. Percentage URL Match = ∑ (k,v)∈u 1(k,v)matchedhierarchy |u| , where (k, v) is a key-value pair for an URL, and |u| is the set of all key-value pairs for an URL. Jaccard Similarity A measure of similarity between two keyword GM et al. (2011) sets which is defined as the size of the intersection divided by the size of the union of the sample sets. Jaccard Similarity = hfeats∩sfeats hfeats∪sfeats , 38 where sfeats and hfeats are keywords and categories from semantic and matched path in the hierarchy. The fraction of relevant keywords in the set. Relevance Fuxman et al. (2008); Thomaidou &Vazirgiannis (2011); Joshi &Motwani (2006); Mirizzi et al. (2010); Nie et al. (2019) Indirectness The fraction of keywords indirectly connected Fuxman et al. (2008) to the seed set in the result set, a query q is indirect if q ∉ Q(S), where Q(S) denotes the query set directly connected to seed set S. Novelty The fraction of new effective keywords which Qiao et al. (2017); Zhou et al. (2019); are omitted or not found by other methods. Zhang &Qiao (2018); Zhang et al. The number of generated keywords. Scholz et al. (2019) (2021) Keyword number Impression The number of times that an advertisement is Scholz et al. (2019); Scaiano &Inkpen displayed on results pages. (2011) Cost per click Advertiser's pay for each click on the ads. Scholz et al. (2019) Conversion rate The number of conversions divides the number Scholz et al. (2019) of total ad interactions that can be tracked to a conversion during the same period. Perplexity A measurement of how well a probability Zhou et al. (2019) distribution or probability model predicts a sample, specifically the generation quality with respect to grammar and fluency computed by the generation distribution in the models. Perplexity(p) = 2H(p), where H(p) is the entropy of the distribution. Distinct-n The proportion of distinct n-grams to all the n- Zhou et al. (2019) grams in generated keywords to evaluate the diversity. Coverage The ratio between the number of suggestions Zhou et al. (2019); Chang et al. (2009); produced by a system and the maximum Nie et al. (2019) number of allowed suggestions. Click-through The ratio of page views that lead to a click to Zhou et al. (2019); Sarmento et al. rate the total number of page views. (2009) Revenue per The revenue of a search engine per one Zhou et al. (2019) mille thousand page views. Specificity How general or specific were the generated Thomaidou &Vazirgiannis (2011) keywords judged by some researchers and students. Nonobviousness A term not containing the seed keyword or its Thomaidou &Vazirgiannis (2011); variants sharing a common stem. Joshi &Motwani (2006) 39 Automatic The ratio between the number of automatically Sarmento et al. (2009) suggestion ratio suggested keywords and the number of user- suggested keywords associated with the ad. Sr(i) = fauto(i) fuser(i)+fauto(i) , where fauto(i) and fuser(i) are the number of automatically suggested keywords and the number of user-suggested keywords associated with the i-th ad. Average rank The average rank of the suggested keywords. Sarmento et al. (2009) Keyword The fraction of suggested keywords at rank n Sarmento et al. (2009) ranking index (e.g., rank 1 or rank 10) selected by the user. Average keyword The average number of ad prints (i.e., Sarmento et al. (2009) impression) that are made as result of a bid printability placed on a suggested keyword. Average ad printability Average keyword The average number of times an ad is printed Sarmento et al. (2009) as result of an automatically suggested keyword. The average number of clicks made on ads that Sarmento et al. (2009) are printed as result of a bid placed on a clickability suggested keyword. Average ad clickability Keyword printability efficiency Keyword clickability efficiency True/False The average number of times an ad is clicked Sarmento et al. (2009) as a result of an automatically suggested tag. The fraction of suggested keywords that lead Sarmento et al. (2009) the corresponding ads being printed (i.e., displayed). The fraction of suggested keywords that lead Sarmento et al. (2009) the corresponding ads being clicked. The fraction of the pairs correctly/incorrectly Schwaighofer et al. (2009) positive ratio classified as belonging to the same cluster. Negative log Closely related to the log perplexity, a quality Schwaighofer et al. (2009) likelihood of the criterion that has been used to evaluate for the test set LDA model. Advertiser The entropy of the distribution of advertisers Schwaighofer et al. (2009) entropy scores across clusters. Edit distance The average number of words required to be Ravi et al. (2010) inserted, deleted or substituted within the phrase k in order to convert it to the gold phrase k∗. ED(k, k∗) = # of operations to convert k→k∗ # of words in k∗ . 40 Rouge-1 score A recall-based measure which evaluates the Ravi et al. (2010) quality of a candidate bid phrase against all the relevant gold bid phrases. ROUGE − 1(k, l) = ∑ k∗∈K∗ ∑ k∗∈K∗ # of words in k∩k∗ # of words in k∗ , Ad display where l is the test landing page. Whether campaign ads (or very closely related Scaiano &Inkpen (2011) ads) are shown or not. Popularity An indicator of how pertinent the keywords are Welch et al. (2010) to advertisers. Popularity = 1 |R(S)| ∑ k∈R(S) ∗ Ak , where R(S) are the keywords from source S ∗ is judged relevant by at least one user, and Ak the number of advertisers bidding for keyword k. 3.5 Summary In summary, all the five sources of information are valuable to build domain-specific keyword pools. In this sense, none of keyword generation methods based on a single information source can provide the perfect solution because each of them has its own advantages and shortcomings. We believe that the five branches of works complement each other, and thus it calls for a benchmark study integrating the five sources of information to generate relevant keywords. 4. Keyword Targeting 4.1 Problem Description In SSA, advertisers need to select a specific set of keywords from the domain-specific keyword pool and determine appropriate match types (i.e., broad match, phrase match and exact match) for these keywords in order to reach a specific target population. Based on selected keywords, their advertisements are displayed when users submit queries or browse Web pages. We term this process as keyword targeting following the marketing paradigm (analog to the targeting strategy), or market-level keyword optimization from the perspective of decision making. Note that keyword targeting has a more broad sense than keyword selection. The output of keyword targeting is a set of keywords and corresponding match types called the target keyword set. 41 Formally, given that a set of generated keywords K(GNT) is determined, keyword targeting can be defined as follows. f(TGT): K(GNT) (TGT) xi,m̅̅̅ → K(TGT), K(TGT) ⊆ K(GNT), 3 ∑ m̅ =0 (TGT) xi,m̅ = 1, (TGT) = { xi,m̅ 1, if ki is selected in match type m̅ 0, otherwise , i ∈ {1,2, ... , n(GNT)}, m̅ ∈ {0,1,2,3}, (26) where f(TGT) is the keyword targeting function, K(TGT) is a set of selected keywords from the domain- specific keyword pool (K(GNT)), and xi,m̅ (TGT) is the decision variable of keyword targeting, indicating whether the i-th keyword is selected in match type m̅. Note that each keyword can be selected in one 3 and only one match type or is not selected at all. Hence, ∑ m̅ =0 (TGT) xi,m̅ = 1, m̅ = 0,1,2,3 indicate null, exact match, phrase match and broad match, respectively. In SSA, many keywords do not raise reliable advertising impacts, and instead occupy a large portion of the advertising expenditure. Keyword targeting can prevent advertisers from targeting wrong populations that waste their advertising resources with poor returns. Moreover, it's critical to select keywords because consumers with different intents tend to use different types of keywords (e.g., general keywords and specific keywords). Thus, product sales via SSA highly rely on an effective set of keywords that describe advertised offerings and consumers' intents. However, it's not a straightforward task to select a set of right keywords from a large pool with millions of available keywords (Bartz et al., 2006). Even if the size of the keyword pool is relatively small, it's unwise to bid on all keywords simultaneously (Ji et al., 2010). Thus, keyword targeting is one of the most crucial steps in search advertising optimization. In effect, keyword targeting is a cornerstone process for all SSA stakeholders (i.e., search engines, advertisers, and consumers) pursuing the best combination of advertising presentation, promotion, and discovery (Thomaidou and Vazirgiannis, 2011). Moreover, the keyword targeting process needs to take into account mechanisms behind search engines, product/service features, as well as characteristics of the target population. There are two tradeoffs in the keyword targeting process (Rusmevichientong and Williamson, 2006). First, there is a tradeoff between selecting a limited number of profitable keywords versus selecting an extensive set of keywords (i.e., the more-less tradeoff). The former will not spend the entire 42 budget, while the latter will deplete the budget quickly, in turn which might lose opportunities to receive clicks and conversions that may arrive later. Second, advertisers must balance the tradeoff between selecting known keywords that yielded high profits in the past versus selecting previously unused keywords whose performance indexes such as click-through probabilities can be learnt in future advertising campaigns (i.e., the exploitation-exploration tradeoff)1. In the literature, keyword targeting has been treated as two independent problems, namely keyword selection and keyword match. In the following, we discuss these two research streams in terms of techniques, features and evaluation metrics. 4.2 Techniques for Keyword Targeting 4.2.1 Keyword Selection Given a certain amount of budget, advertisers try to spend their money on the most profitable keywords. In a highly uncertain environment such as SSA (Yang et al., 2013; Li and Yang, 2020), identifying a set of profitable set of keywords becomes even more challenging for advertisers (Yang et al., 2019). In the literature, techniques used for keyword selection, include feature selection, adaptive approximation, mixed integer optimization, technique for order of preference by similarity to ideal solution (TOPSIS) and the mean-variance model, as summarized in Table 6a. Table 7a presents notations used in keyword selection. Table 6a. Techniques for Keyword Selection Category Approach Feature selection Information gain Symmetrical uncertainty Chi-square statistics Odds ratio Precision on the positive class Refs. Kiritchenko &Jiline (2008) Kiritchenko &Jiline (2008) Kiritchenko &Jiline (2008) Kiritchenko &Jiline (2008) Kiritchenko &Jiline (2008) Optimization Adaptive approximation Rusmevichientong &Williamson (2006) Mixed integer optimization Zhang et al. (2014b) Technique for order of preference by Arroyo-Cañada &Gil-Lafuente similarity to ideal solution Mean-variance model (2019) Symitsi et al. (2022) 1 In the reinforcement learning literature, it is cast as balancing the exploitation of known good options and the exploration of unknown options that might be better than known options. 43 Table 7a. Notations in keyword selection Terms Definition nk _ki C _cj pi ci zi λi δa u l it bt γt gt t di t ci sum_di sum_ci t−1 ĉi Θi θ Kl vl bl,i dl,θ cl bε ωθ rl,θ zij wj vij A+ A− J J′ + ai − ai Ri The number of query keywords The absence of ki A category set The categories in C other than cj The cost-per-click for keyword ki The click-through rate for keyword ki The expected profit from keyword ki The probability that keyword ki is queried The upper bound of the expected number of queries for keyword ki The mean of the total number of queries that arrive in a period The largest prefix for keyword selection An integer random variable in period t An independent binary random variable in period t The probability that bt = 0, i.e., γt = P{bt = 0} The largest index for keyword selection in period t The number of impressions that keyword ki receives in period t The number of clicks that keyword ki receives in period t The cumulative number of impressions for keyword ki in periods from 1 to t The cumulative number of clicks for keyword ki in periods from 1 to t The estimated click-through rate (CTR) for keyword ki in period t The auctions triggered by keyword ki An auction A set of keyword for the l-th ad-group The average true value of a click for the l-th ad-group The bid price for keyword ki in the l-th ad-group The impression probability for the l-th ad-group in auction θ The average click-through rate for the l-th ad-group The floor bid price The winning score of auction θ The relevance score of the l-th ad-group in auction θ The performance value of the i-th set of keywords under the j-th evaluation criterion The weight of the j-th criterion The weighted normalized value of the i-th set of keywords under the j-th evaluation criterion The positive ideal solution The negative ideal solution A benefit criteria index A cost criteria index An alternative from the positive ideal solution A+ An alternative from the negative ideal solution A− The relative closeness 44 uA+(xj), uA−(xj) wi zi The characteristic membership functions The percentage allocation of the budget for the i-th keyword The growth in profit for the i-th keyword (1) Feature selection (FS). By assuming that keywords can be optimized based on their historic performance, Kiritchenko & Jiline (2008) applied a set of feature selection techniques to a set of words (i.e., search terms) combinations (i.e., multi-word phrases) comprising historical users' queries to optimize keyword selection. More specifically, the past performance of individual keywords and all possible multi-word keywords is analyzed, then feature selection techniques were used to sort phrases according to their effectiveness extracted from the historical data, and then a set of profitable phrases was selected. Let nk denote the number of query keywords (i.e., single words and word combinations), ki denote a sequence of non-space characters, _ki represent the absence of ki , and _cj denote categories in C other than cj. The relevance of ki to category cj ∈ C can be measured by a function such as information gain, chi-square statistic, symmetrical uncertainty, odds ratio, and precision on the positive class, which are described as follows. Information gain is the amount of information gained about a random variable, which can tell how important a given attribute is in a feature vector. The information gain-based relevance of ki to category cj is given as H(C) − H(C|A) , where H(C) = − ∑ P(cj) log2 P(cj) j , and H(C|A) = − ∑ A∈{ki,_ki} P(A) ∑ P(cj|A) log2 P(cj|A) . j Chi-square statistic is a measure of the difference between observed and expected frequencies of outcomes of a set of events or variables. The Chi-square-based relevance of ki to category cj is given as nk(P(ki,cj)P(_ki,_cj)−P(ki,_cj)P(_ki,cj))2 P(ki)P(_ki)P(cj)P(_cj) , where P(ki, cj)P(_ki, _cj) is the probability that keywords containing ki is related to cj and keywords excluding ki is related to categories other than cj; P(ki, _cj)P(_ki, cj) is the probability that keywords containing ki is related to categories other than cj and keywords excluding ki is related to cj. Symmetrical uncertainty measures the relevance between a feature and the class label. The symmetrical uncertainty-based relevance of ki to category cj is given as 2 [ H(C)−H(C|A) H(C)+H(A) ]. Odds ratio is a measure of association between an exposure and an outcome, which represents the odds that an outcome will occur given a particular exposure, compared to the odds of the outcome 45 occurring in the absence of that exposure. The odds ratio-based relevance of ki to category cj is given as P(ki|cj)(1−P(ki|_cj)) (1−P(ki|cj))P(ki|_cj) . Precision on the positive class measures the fraction of keywords containing word ki which is relevant to category cj, i.e., P(cj|ki). Feature selection techniques discussed above showed similar performance. Among them, symmetrical uncertainty performed the best by a slight margin and the precision on the positive class technique is a little inferior to others. In general, feature selection techniques could not only identify profitable keywords, but also discover more specific phrases. (2) Adaptive approximation (AA). In light of the more-less tradeoff and the exploitation- exploration tradeoff, Rusmevichientong and Williamson (2006) developed adaptive approximation algorithms to solve the keyword selection problem. In the static case where click-through rates of keywords are known, keyword selection can be modeled as a stochastic knapsack problem with query arrival as a random variable. Let pi , ci, zi denote the cost-per-click, click-through rate and expected profit for keyword ki, respectively. Let λi denote the probability that ki is queried and u denote the mean of the total number of queries that arrive in a period. In order to develop an efficient approximation algorithm for keyword selection, keywords are sorted in a prefix-orderings, i.e., the descending order of profit-to-cost ratio, i.e., z1 p1 ≥ z2 p2 ... ≥ zN pN and the expected number of queries for ki (i.e., λiu) is at most δa (0 ≤ a < 1, δ ≥ 1, and pi ≤ 1 δ ). Then a near-optimal approximation algorithm was developed to choose the largest prefix l which satisfies max {l: u ∑ piciλi l i=1 ≤ 1 − 1 δ − 1 δ(1−a)/3}. (27) That is, the near-optimal selected set includes keywords with prefix-orderings {1,2, ... , l}, whose cost is close to the budget. In the dynamic case where the click-through rates are not known, keyword selection was formulated as a multi-armed bandit problem. An improved adaptive approximation algorithm was developed to select a bandit (i.e., a subset of keywords) in each time period based on their past observations that yield near-optimal profits. In this algorithm, the click-through rates for ki are updated according to impressions di t and clicks ci t that the keyword receives in period t : as for all i , 46 sum_di: = sum_di + di t, sum_ci: = sum_ci + ci t, and estimated click-through rate ĉi t−1 = sum_ci sum_di , if sumdi > 0; ĉi t−1 = 1, otherwise. Let it denote an integer randomly chosen uniformly from the set {1,2, ... , nk} in period t and bt denote an independent binary random variable with P{bt = 1} = 1 − γt and P{bt = 0} = γt, where γt ∈ [0,1]. Similarly, keywords were sorted in the descending order of profit-to-cost ratio. Keywords with indexes {1,2, ... , gt} are selected as their target set, where gt = lt, if bt = 1; gt = it, otherwise; and lt is the index such that lt u ∑ piĉi i=1 t−1λi ≤ 1 − 1 k − 2 k(1−a)/3 ≤ u ∑ lt+1 i=1 piĉi t−1λi . (28) The AA algorithm outperformed multi-armed bandit algorithms by increasing about 7% profits, and the expected profit could converge to a near-optimal level. (3) Mixed integer optimization (MIP). MIP adds an additional condition that at least one of the variables can only take integer values on the basis of linear programming which maximizes (or minimizes) a linear objective function subject to one or more constraints. In the SSA context, Zhang et al. (2014b) modeled keyword selection as a MIP problem, which maximizes an advertiser's revenue and the relevance of selected keywords, while minimizing the keyword competitiveness, with constraints of the lower and the upper bounds of bidding prices on a set of keywords and the limited budget for an ad-group. Given an ad-group l, a keyword set for l (i.e., Kl) can be obtained by filtering out keywords whose relevance scores are less than a certain threshold. Let Θi denotes auctions triggered by keyword ki. In an auction θ ∈ Θi, the expected revenue of ad-group l from ki is ∑ θ∈Θi (vl − bl,i)dl,θcl , where vl is the average true value of a click, bl,i is the bidding price, dl,θ is the impression probability, and cl is the average CTR. Let xi (SEL) = 1 denote the indicator variable for keyword selection if ki is selected; otherwise xi (SEL) = 0. In order to maximize the total expected revenue, the objective is given as max (SEL),bl,i xi ∑ ki∈Kl {ci ∑ θ∈Θi (vl − bl,i)dl,θ (SEL)} clxi , (29) where ci is the impression confidence based on keyword competitiveness. Constraints are the budget of an ad-group, and the lower bound and the upper bound of bidding prices, which are given as 47 s. t. ∑ ki∈Kl {∑ θ∈Θi bl,idl,θ (SEL)} clxi ≤ Bl, with max θ∈Θi {bε, ωθ rl,θ } ≤ bl,i ≤ vl, (30) where bε is the floor price, ωθ is the winning score of auction θ, and rl,θ is the relevance score of ad-group l in θ. In order to select relevant yet less-competitive keywords and put optimal bidding prices over these keywords, Zhang et al. (2014b) constructed a mixed integer programming model and solved it by iteratively conducting binary integer programming and sequential quadratic programming until convergence. Simulation experiments showed that the MIP-based keyword selection method is capable of increasing impressions, expected clicks, advertiser's revenue, as well as search engine's revenue. (4) Technique for order of preference by similarity to ideal solution (TOPSIS). TOPSIS is a multi-criteria decision analysis method based on the concept that the chosen alternative should have the shortest distance from the positive ideal solution (PIS) and the furthest distance from the negative ideal solution (NIS) (García-Cascales and Lamata, 2012). Given several alternative sets of keywords for an advertising campaign, let zij denote the performance value of the i-th set of keywords under the j-th evaluation criterion zj (e.g., advertising inventory, impressions per week, clicks per week, opportunity to see, click-through rate, cost per click, and revenue), i = 1,2, ... , n, j = 1,2, ... , m, and wj denote the weight of the j-th criterion. The weighted normalized value of the i-th set of keywords under the j-th evaluation criterion is calculated as vij = wj zij n √∑ j=1 (zij)2 . (31) The positive ideal value set A+ and the negative ideal solution A− are determined as A+ = {v1 +, ... , vm +} = {(max i A− = {v1 −, ... , vm −} = {(min i vij, j ∈ J)(min i vij, j ∈ J′)}, and vij, j ∈ J)(max i vij, j ∈ J′)}, (32) where J is associated with benefit criteria, and J′ is associated with cost criteria. Then the separation of an alternative from the positive ideal solution (PIS) A+ and the negative ideal solution (NIS) A− is given as m + = ∑ |vij − vj ai j=1 +| , and m − = ∑ |vij − vj ai j=1 −| . (33) 48 Then the relative closeness Ri to the ideal solution can be expressed as Ri = − ai ++ai ai − , and keywords can be selected according to rank Ri in descending order. Arroyo-Cañada & Gil-Lafuente (2019) proposed a fuzzy asymmetric TOPSIS-based keyword selection method. Specifically, this method introduced fuzzy indicators by replacing zij with fuzzy numbers or linguistic values, and incorporated characteristic membership functions uA+(zj) and uA−(zj) to asymmetrically penalize the n lack of frequency and soften light excesses for the j -th criterion, i.e., Ri = ∑ j=1 |vij − −|uA_(zj)/(∑ n vj j=1 |vij − vj +|uA+(zj) n + ∑ j=1 |vij − vj −|uA−(zj) ). (5) Mean-variance model (MVM). MVM selects the most efficient portfolio by analyzing expected returns (mean) and standard deviations (variance) of various portfolios (Markowitz, 1952). The efficient frontier of keyword portfolios can be obtained as follows. ∑ ∑ wiwjcov(zi, zj) , nk i=1 nk j=1 min wi s. t. , μp = ∑ wi nk i=1 E(zi), ∑ wi nk i=1 = 1, wi ≥ 0, (34) where wi and zi are the percentage allocation of the budget and the growth in profit for the i-th keyword, respectively. Symitsi et al. (2022) explored keyword portfolios by examining the risk-adjusted keyword performance, and selected unrelated and negatively related keywords into keyword portfolios for the goal of diversification. The MVM-based keyword selection method outperformed advertisers' heuristic rules used in practice. In summary, current keyword selection methods can recognize profitable keywords under budget constraints by balancing the tradeoff between costs and revenues. However, the dynamic feature of SSA has been ignored in prior studies on keyword selection, which assumes that keyword costs and revenues are unchangeable (Rusmevichientong and Williamson, 2006; Kiritchenko and Jiline, 2008). 4.2.2 Keyword Match In SSA, advertisers need to make another important choice over keyword match types, including exact match, phrase match and broach match, when making keyword targeting decisions (Dhar and Ghose, 2010). Keyword match type controls when advertisements will be shown to consumers, which in turn determines the target population of potential consumers. Therefore, keyword match is a critical variable in SSA (Du et al., 2017; Yang et al., 2021). 49 In the literature on keyword match, current research primarily focused on broad match, which falls into two research streams. One stream explored broad match mapping mechanisms to help advertisers identify similar keywords, increase the advertising reach and reduce the campaign management burden, by using regression SVM, max-margin voted perceptron and distributed language model (Radlinski et al., 2008; Gupta et al., 2009; Grbovic et al., 2016). Another stream addressed optimization problems in broad match, using graph model and game-theoretic model (Singh and Roychowdhury, 2008; Amaldoss et al., 2016). Techniques used for keyword match in the literature are summarized in Table 6b. Table 7b presents notations used in keyword match. Table 6b. Techniques for Keyword Match Category Approach Refs. Learning model Support vector regression Radlinski et al. (2008) Max-margin voted perceptron Gupta et al. (2009) Distributed language model Grbovic et al. (2016) Graph model Game theory / Singh &Roychowdhury (2008) Game-theoretic model Amaldoss et al. (2016) Table 7b. Notations in keyword match Terms Definition xi yi τ ð x = f(k → k′) c ĉ w nwi wavg ζ Ŝ s van ξ Φ nK nAder nAS E εj,k The i-th training sample The target value of the i-th training sample The intercept of a prediction A threshold A feature vector encoding various properties of an advertisement's impressions on a broad match keyword k′ shown in a context containing keyword k A binary variable indicating whether keyword k′ is clicked The click probability of a broad match keyword A weight vector The number of iterations that the i-th weight vector don't change A moving average weight vector An amnesia rate A set of search sessions A search session s = (a1, ... , aN) ∈ Ŝ A multiple dimensional real-valued representation for a unique action an The length of the relevant context for action sequences A vocabulary set for unique actions in the dataset The number of keywords in set K The number of advertisers who are interested in the keywords The maximum number of ad-slot available The valuation matrix with entries εj,k The product of true value and quality score of advertiser aderj for keyword k 50 Bj dk Ader S S′ G G′ EU The daily budget for advertiser aderj The daily search demands of keyword k A set of advertisers A set of edges connecting advertisers and keywords in broad match graph The extension set of edges, S ⊂ S′ A graph G = (Ader, K, S) A broad-match graph for graph G The expected utility (1) Support vector regression (SVR). SVR is a supervised learning model for regression analysis (Scholkopf, 1999). Given a training sample xi with a target value yi and the prediction of the inner- product plus intercept 〈w, xi〉 + τ for that sample, SVR is defined as min 1 2 ‖w‖2 s. t. |yi − 〈w, xi〉 − τ| ≤ ð, (35) where ð is a threshold. Radlinski et al. (2008) presented a two-stage method combining exact match and broad match to recommend advertisements, with the objective of optimizing both the advertising relevance and the advertising revenue for search engines simultaneously. At the first stage, an ad query substitution table was built using external knowledge sources in an offline setting. Specifically, they fixed a large set of sufficiently frequent ad queries, and used SVR to learn weights for features in a combined linear function computing the final score for each query substitute. At the second stage, advertisements retrieval was performed by finding advertisements whose keywords exactly match the substituted query. The SVR-based method combines merits of both broad match (i.e., flexibility) and exact match (i.e., computational efficiency). (2) Max-margin voted perceptron (MMVP). MMVP is a discriminative online classifier performing well on high-dimensional learning tasks (Freund & Schapire, 1999). Assume that for every keyword (k), there exists a set of broad-match keywords ({k′}) that can be identified using some similarity functions. The problem of identifying broad match for a given keyword is equal to predicting the click probability of broad match keyword. Let x = f(k → k′) denote a feature vector encoding various properties of the impression of an advertisement on a broad match keyword k′ shown in a context containing keyword k, and c ∈ {−1, +1} denotes a binary variable indicating whether k′ is clicked. The dataset of training instances for MMVP in SSA is constructed as {(x = f(k → 51 k′), c)}, c ∈ {−1, +1}. The MMVP algorithm starts with an initial zero weight vector w = 0, and predicts the click probability of a broad match keyword, i.e., ĉ = sigmoid(w ∙ x). If the prediction ĉ is different from the label c, it updates the weight vector w: = w + cx, otherwise w is not changed. The process runs repeatedly through all the training instances. In the process, the number of iterations that each weight vector doesn't change is counted as nwi. Then the predicted click probability of a broad keyword k′ can be computed as sigmoid(∑ nwi m i=1 sigmoid(wi ∙ x)). In order to effectively capture the fluid SSA environment, Gupta et al. (2009) developed an amnesiac averaged perceptron algorithm by incorporating the exponentially weighted moving average into the MMVP and exploiting implicit feedback (i.e., advertising click-through logs) to identify high- quality broad matches for a given keyword. Specifically, besides w, another moving average weight vector wavg is initialized as 0; for each (x = f(k → k′), c), after updating w, wavg is updated as wavg: = (1 − ζ)wavg + ζw, where ζ ∈ (0,1] is the amnesia rate indicating that the weight vectors observed in the past are less influential than the most recent one. Finally, the moving average weight vector is used to conduct the click probability prediction. The MMVP-based matching method can quickly adjust to rapidly-changing distributions of keywords, advertisements and user behaviors. (3) Distributed language model (DLM). DLM learns word representations in a low-dimensional continuous vector space using a surrounding context of a word in a sentence, where in the resulting embedding space, semantically similar words are close to each other (Mikolov et al., 2013). In SSA, DLM can be used to learn ad and query representations in a low-dimensional space and solve the query- ad matching problem (Grbovic et al., 2016). Given a search session set Ŝ, s = (a1, ... , aN) ∈ Ŝ is an uninterrupted sequence of user's actions comprising queries, ad clicks, and link clicks. The search embedding learns a D-dimensional real-valued representation van ∈ RD for each unique action an by maximizing the following objective function L̂ = ∑ s∈Ŝ ∑ an∈s ∑ −ξ≤i≤ξ,i≠0 logp(an+i|an) = ∑ s∈Ŝ ∑ an∈s ∑ −ξ≤i≤ξ,i≠0 log ′ exp (van |Φ| a=1 T van+i ) ′ ) T van exp (van ∑ , (36) where va and va ′ are the input and output vector representations of user's actions, respectively, ξ is the length of the relevant context for action sequences, and Φ is a vocabulary set for unique actions in the dataset consisting of queries, ads, and links. 52 The optimization can be done via stochastic gradient ascent. Grbovic et al. (2016) presented a DLM-based matching method through semantic embeddings of search queries and advertisements. This method delineates the temporal context of action sequences, where actions with similar contexts will have similar representations, and reduces the complex broad match problem to a trivial K-nearest- neighbor search between queries and ads in the joint embedding space. The DLM-based method can gain a good performance in terms of relevance, coverage and incremental revenue. (4) Graph model (GM). Broad match graph is a weighted bipartite graph between a set of advertisers and a set of keywords. Let nK denote the total number of keywords, nAder denote the total number of advertisers, nAS denote the maximum number of ad-slot available, E denote the valuation matrix where εj,k is the product of true value and quality score of advertiser aderj for keyword k, Bj is the daily budget for aderj and dk denote the daily search demands of k. Given instance parameters (nAder, nK, nAS, E = (εj,k), B = (Bj), d = (dk)), a bipartite graph G = (Ader, K, S) is constructed, with vertex sets (i.e., the advertiser set Ader and the keyword set K) and the edge set (i.e., S = {(aderj, k): aderj ∈ Ader, k ∈ K, εj,k > 0}). Each edge (j, k) ∈ S has a weight εj,k, each ader-node aderj ∈ Ader has a weight Bj, and each keyword-node k ∈ K has a weight dk. Then, given instance parameters (nAder, nK, nAS, E′, B, d) where E ⊂ E′, G′ = (Ader, K, S′) is a broad-match graph for G = (Ader, K, S), if S ⊂ S′ and εj,k ′ = εj,k for all (j, k) ∈ S. Based on the broad match graph, Singh and Roychowdhury (2008) studied dynamics of bidding over various related keywords, and discussed two broad match scenarios and the extent of auctioneer's control on budget splitting. When the quality of broad match is good, the auctioneer (i.e., search engine) could always improve the revenue by judiciously using broad match. (5) Game-theoretic model (GTM). GTM uses game theory (i.e., mathematical models of strategic interactions among rational agents) to predict actions of either cooperative or competitive individuals (Moorthy, 1985). Amaldoss et al. (2016) applied a game-theoretic model to analyze advertisers' expected utilities in four possible cases, i.e., both advertisers use broad match (EUB,B), advertiser 1 uses exact match but advertiser 2 uses broad match ( EUX,B ), advertiser 1 uses broad match whereas advertiser 2 uses exact match ( EUB,X ), and both advertisers use exact match ( EUX,X ), under an assumption that there are two risk-neutral advertisers bidding for a keyword. Their analysis disclosed that a) search engine profits increase when advertisers adopt broad match; b) search engines should increase the accuracy of broad match up to the point where advertisers are willing to adopt. 53 Effective keyword match can improve both the relevance and monetization of SSA campaigns by controlling advertisers' reach (Gupta et al., 2009). Current research on keyword match concentrated on various themes: identifying high-quality broad match mappings (Gupta et al., 2009; Grbovic et al., 2016), allocating budget over several broad match scenarios (Singh and Roychowdhury, 2008), optimizing the relevance of keyword match (Radlinski et al., 2008) and examining the strategic role of broad match (Amaldoss et al., 2016). Nonetheless, in order to obtain an optimal solution for keyword targeting, keyword match should be addressed together with keyword selection. 4.3 Input Features for Keyword Targeting Table 8a summarizes input/features used in keyword selection techniques reported in the literature. From Table 8a, we can see that historical performance is the main source for feature extraction in keyword selection, e.g., profit-to-cost (Rusmevichientong and Williamson, 2006), cost per click and clicks (Arroyo-Cañada and Gil-Lafuente, 2019; Symitsi et al., 2022). In machine learning based keyword selection, keyword combinations are taken as features (Kiritchenko and Jiline, 2008) and extracted from queries and keywords, combined with human judged labels (Zhang et al., 2014b). Table 8a. Input/Features used for keyword selection Refs. PCR WC EV BP CPC IMP CTR VPA RS CL OS RAP CPR Features Rusmevichientong √ &Williamson (2006) Kiritchenko &Jiline √ √ (2008) Zhang et al. (2014b) Arroyo-Cañada &Gil-Lafuente (2019) √ √ √ √ √ √ √ √ √ √ √ √ Symitsi et al. (2022) √ √ √ √ √ Notes: PCR=Profit-to-Cost Ratio; WC=Words Combinations; EV=Engaged Visit (i.e., the time spent at the website multiplied by the number of pages visited); BP=Bid Price; CPC=Cost Per Click; IMP=Impression (e.g., impression per week, impression probability based on bid price, impression confidence based on competitiveness); CTR=Click-Through Rate; VPA=Value Per Ad-group; RS=Relevance Score (calculated based on the query-ad similarity, semantic similarity, taxonomy, and user query time); CL=Clicks; OS=Opportunity to See; RAP=Relevance of the Advertising Place; CPR=Cots-Per-Reservation. Table 8b summarizes input/features used in research on keyword match. In keyword targeting, match type is often considered as an important decision factor where optimization and equilibrium 54 analysis are conducted (Singh and Roychowdhury, 2008; Amaldoss et al., 2016). Feature selection provides considerable improvement in keyword match (Gupta et al., 2009). For keyword match optimization, features extracted from search sessions are used to learn low-dimensional continuous representations of queries and advertisements (Grbovic et al., 2016). Moreover, features such as lexical similarity, semantic similarity and revenue describe match quality between the query and candidate substitution (Radlinski et al., 2008). Table 8b. Input/Features used for Keyword Match Refs. Gupta et al. (2009) Grbovic et al. (2016) M F C O D E √ √ √ S S M √ C T R √ K I D √ Singh &Roychowdhury (2008) Radlinski et al. (2008) √ Amaldoss et al. (2016) √ Features S Q C L C I I A B C K O S D L S F S S F P R F √ √ √ √ √ √ √ √ √ √ Note: MF=Match related Feature (e.g., broad match mapping, the accuracy of broad match bid); CO=Co- occurrence; DE=Densified (i.e., the local structure of similarity graphs); SSM=Syntactic Similarity Measures (e.g., string edit distance, the presence of one keyword as a substring inside the other); CTR=Click-Through Rate; KID=Keyword-ID (e.g., the total number of bidded keywords for the original and broad-match keywords); SQ=Sequences of Queries; CL=Clicks (ad clicks, search link clicks); CI=Contextual Information (e.g., dwell time and skipped ads); IA=Information Asymmetry; BC=Budget Control (i.e., the extent of auctioneer's control on the budget splitting); LSF=Lexical Similarity Features (i.e., share words, word distance, cosine and trigram cosine); SSF=Semantic Similarity Features (i.e., max match score, abstract cosine and taxonomy similarity); KO=Keyword Overlap; SD=Search Demand; PRF= Potential Revenue Features (i.e., max bid, second bid). 4.4 Evaluation Metrics for Keyword Targeting Evaluation metrics that we identified in the reviewed articles on keyword targeting (i.e., keyword selection and match) are presented in Table 9. As keyword decisions move deeper into the lifecycle framework from keyword generation to keyword targeting, evaluation metrics become closer to the ultimate goal of keyword decisions for advertisers, i.e., revenue/profit maximization. In particular, the revenue/profit is the most common evaluation metric in keyword targeting (either keyword selection or keyword match) (Rusmevichientong and Williamson, 2006; Singh and Roychowdhury, 2008; Radlinski et al., 2008; Gupta et al., 2009; Zhang et al., 2014b; Symitsi et al., 2022), while the most commonly used metrics in keyword generation (e.g., precision, recall and F-measure) disappear. Moreover, it appears that keyword selection and keyword match emphasize different metrics. That is, keyword 55 selection highlights keyword/advertising performance indexes such as impressions, expected clicks, CPC, and advertising cost, while keyword match accentuates metrics such as NDCG, relevance, and coverage (Radlinski et al., 2008; Gupta et al., 2009; Grbovic et al., 2016). Table 9. Evaluation Metrics for Keyword Targeting Metrics Definition Research Refs. Stream Revenue/Profit An advertiser's or search engine's economic Keyword Rusmevichientong benefits. selection &Williamson (2006); Kiritchenko &Jiline (2008); Zhang et al. (2014b); Symitsi et al. (2022) Keyword Gupta et al. (2009); Singh match &Roychowdhury (2008); Radlinski et al. (2008) AUC The area under the ROC curve representing Keyword Kiritchenko &Jiline (2008) the degree or measure of separability. selection Impressions The number of times that an advertisement Keyword Zhang et al. (2014b); is displayed on results pages. selection Symitsi et al. (2022) Expected clicks The number of times that the ads get clicked Keyword Zhang et al. (2014b) Keyword Grbovic et al. (2016) match when shown for that keyword. selection Expected clicks = Average CTR ∗ Impression. Cost per click An advertiser's pay for each click on the Keyword Zhang et al. (2014b) ads. selection Advertising The sum of all keyword costs which equals Keyword Zhang et al. (2014b) cost Brand to the search engine revenue. selection The awareness about the brand related to Keyword Arroyo-Cañada &Gil- awareness impressions per week, cookies per week, selection Lafuente (2019) opportunity to see and relevance. Website Traffic The traffic to the corporative website most Keyword Arroyo-Cañada &Gil- lined with clicks, click-through rate and cost selection Lafuente (2019) per click. Rankings of The keyword set rankings of proximities to Keyword Arroyo-Cañada &Gil- proximities the ideal solution. selection Lafuente (2019) Risk The performance of selected keywords in Keyword Symitsi et al. (2022) standard deviation of the popularity growth. selection Sharpe ratio The difference between investment returns Keyword Symitsi et al. (2022) and the risk-free return, divided by the selection standard deviation of investment returns. Sharpe ratio = (Rp − Rf)/σp, 56 Keyword number LogLoss where Rp is the return of portfolio, Rf is the risk-free rate, and σp is the standard deviation of the portfolio's excess return. The number of selected keywords. Keyword Symitsi et al. (2022) selection Keyword Gupta et al. (2009) match (k→k′,c)∈X Log-loss over a test dataset. X = {(k → k′, c)}: LogL(X) = log2(p(c|k → k′)) ∑ where c is the click-through rate (CTR), and k′ is one of the replacements given by the broad match mapping for the original , keyword k. LogL-Lift The difference between the model's log- Keyword Gupta et al. (2009) likelihood and the entropy of the test set. match Relative CTR The CTR of the subset of the test set that Keyword Gupta et al. (2009); Grbovic match et al. (2016) overlaps with the mapping. CTR(BM) = p(c|(k → k′) ∈ BM), where c is the click-through rate (CTR), and k′ is one of the replacements given by the broad match mapping BM for the original keyword k. Coverage The number of items where model made Keyword Gupta et al. (2009); Grbovic any prediction divides the number of total match et al. (2016) items, specifically the coverage of the mapping. Coverage(BM) = p((k → k′) ∈ BM), where k′ is one of the replacements given by the broad match mapping BM for the original keyword k. Macro NDCG A measure of how well the ranked scores Keyword Grbovic et al. (2016) align with the ranked editorial grades using (2grade − 1) as NDCG labels and position discounting of log. match Relevance The relevance of an advertisement and a Keyword Radlinski et al. (2008) query substitution. The expected utility EUT1,T2 for advertiser 1 choosing T1-type match and advertiser 2 choosing T2-type match. match Keyword Amaldoss et al. (2016) match Utility (for search engine) 4.5 Summary In summary, as we were aware of the existing literature, there are few studies on keyword targeting (Li and Yang, 2022). Instead, scholars have tried to address either keyword selection or determination of 57 keyword match types separately. We argue that it's of necessity to address the keyword selection and keyword match problems in an integrated way, in order to help advertisers effectively reach the targeted population via SSA campaigns. 5. Keyword Assignment and Grouping 5.1 Problem Description SSA is a structural advertising form, which is distinctly different from the flattened structure of traditional advertising (Yang et al., 2017). For advertisers who wish to promote their products or services via SSA, they need to design one or more advertising campaigns, and create one or more ad- groups for each campaign (we call this the basic SSA structure) (Chatwin, 2013), as shown in Figure 2. Given that a set of keywords is determined by the keyword targeting process (i.e., the target keyword set), an advertiser needs to assign a subset of target keywords to each campaign, and then each campaign-specific set of keywords also needs to be grouped into several subsets, one of which corresponds to an ad-group. Keyword assignment is conducted at the campaign level, and keyword grouping is made at the ad-group level. The output of this step is the keyword structure. From an operational perspective, keyword assignment and grouping is one of the most critical keyword decisions throughout the entire life cycle of SSA campaigns (Yang et al., 2019; Whitney, 2022). In SSA, advertising campaigns with one or several ad-groups are run to fulfill promotional goals, which constitute the search advertising structure and serve as the basic units for daily advertising operations. Organizing keywords according to search advertising structures allows advertisers to better manage advertising activities (Rutz et al., 2012) and track the effectiveness of their advertising efforts (Hou, 2015). Moreover, keyword assignment and grouping helps advertisers display the ads to the right consumers (Gopal et al., 2011; Polato et al., 2021). Formally, given that a set of keywords and corresponding match types K(TGT) are determined, keyword assignment and grouping can be defined as follows. (1) Keyword assignment: f(ASM): K(TGT) (ASM) xi,j → K1 (ASM), ... , Kj (ASM), ... , Kncampaign (ASM) , (ASM) = { xi,j 1, if ki is assigned to the j − th campaign 0, otherwise , i ∈ {1,2, ... , n(TGT)}, j ∈ {1,2, ... , ncampaign}, (37) 58 where f(ASM) is the keyword assignment function, Kj (ASM) is the set of keywords assigned to the j-th campaign, and xi,j (ASM) is the decision variable of keyword assignment, indicating whether the i-th keyword is assigned to the j-th campaign. (2) Keyword grouping: f(GRP): Kj (ASM) (GRP) xi,j,l → Kj,1 (GRP), ... , Kj,l (GRP), ... , Kj,ngroup (GRP) , (GRP) = { xi,j,l 1, if ki is grouped into the l − th ad − group of the j − th campaign , 0, otherwise i ∈ {1,2, ... , n(TGT)}, j ∈ {1,2, ... , ncampaign}, l ∈ {1,2, ... , ngroup}, (38) where f(GRP) is the keyword grouping function, Kj,l (GRP) is the set of keywords grouped to the l-th ad- group of the j-th campaign, and xi,j,l (GRP) is the decision variable of keyword grouping, indicating whether the i-th keyword is grouped into the l-th ad-group of the j-th campaign. Notations used in keyword assignment and grouping are presented in Table 10. Table 10. Notations in keyword assignment and grouping Definition Terms di cil pil (GRP) xil Bl φl λi ρil ψ w τ xi nkeyword nembedding fθ fθ′ The total number of search demands of the i-th keyword in a search market The click-through rate (CTR) of the i-th keyword in the l-th ad-group The cost-per-click (CPC) of the i-th keyword in the l-th ad-group The 0-1 binary decision variable indicating whether the i-th keyword is assigned to the l-th ad-group or not. The advertising budget available to the l-th ad-group An acceptable probability range of the l-th ad-group The value-per-sale of the i-th keyword The conversion rate of the i-th keyword in the l-th ad-group The risk-tolerance of an advertiser The normal vector to the hyperplane The intercept of the hyperplane function The i-th training sample in the form of a multiple dimensional real vector The maximum number of words per keyword The size of the embedding A multi-layer perceptron with a single hidden layer parametrized by θ A multiple layers feed forward network with a linear activation function in the θ, θ′ The network parameters output layer parametrized by θ′ 59 5.2 Keyword Assignment and Grouping Although how to effectively organize keywords following search advertising structures (i.e., keyword assignment and grouping) is a critical operational-level issue, as far as we are aware, in the literature, less attention has been put to keyword assignment and grouping, except for recent works on keyword grouping (Li & Yang, 2020) and keyword categorization (Krasňanská et al., 2021; Polato et al., 2021). Techniques used for keyword assignment and grouping in the literature are summarized in Table 11. Table 11. Techniques for Keyword Assignment and Grouping Category Optimization Approach Refs. Chance constrained programming Li &Yang (2020) Machine learning Linear support vector machine Krasňanská et al. (2021) DeepSets model Polato et al. (2021) (1) Chance constrained programming (CCP). CCP is a technique to solve optimization problems under various uncertainties, which formulates an optimization problem ensuring that the probability of meeting a certain constraint is above a certain level (Charnes & Cooper, 1959). Let di denote the total number of search demands of the i-th keyword in a search market. Let cil and pil denote the click-through rate (CTR) and cost-per-click (CPC) of the i-th keyword in the l-th ad-group, respectively. Given an advertising campaign with m ad-groups and a set of keywords (i.e., n), let (GRP) denote the 0-1 binary decision variable indicating whether the i-th keyword is assigned to the l- xil th ad-group or not. Then the budget constraint in keyword assignment and grouping can be formulated with chance constrained programming as n p{∑ xil i=1 (GRP)dicilpil ≤ Bl } ≥ φl, (39) where Bl is the advertising budget available to the l-th ad-group and φl is an acceptable probability range indicating that the probability that the cost of the l-th ad-group is less than the allocated budget, is greater than or equal to a certain level. Considering that SSA environments are essentially uncertain, Li & Yang (2020) formulated keyword grouping as a stochastic programming problem with click-through rate and conversion rate as random variables, taking into account budget constraints and advertiser's risk-tolerance as follows. n m max E [∑ ∑ xil l=1 i=1 (GRP)dicil(ρilλi − pil) ] s. t. p{∑ xil n i=1 (GRP)dicilpil ≤ Bl } ≥ φl m Var(∑ ∑ xil l=1 n i=1 (GRP)dicil(ρilλi − pil) m )/ ∑ Bl l=1 ≤ ψ 60 m ∑ xil l=1 (GRP) ≤ 1, xil (GRP) = {0,1}, di ≥ 0, λi ≥ 0, pil ≥ 0, 0 ≤ cil ≤ 1, 0 ≤ ρil ≤ 1, (40) where ρil is the conversion rate of the i-th keyword in the l-th ad-group; λi is the value-per-sale of the i-th keyword; and ψ is the risk-tolerance of an advertiser. Moreover, they developed a branch-and- bound algorithm to solve their model. Their experiments illustrated that, a) the proposed method could approximately approach the optimal level; b) keyword grouping leads to a significant improvement in the profit for search advertisers with a large number of keywords. (2) Linear support vector machine (LSVM). LSVM creates the hyperplane to segregate n- dimensional space into classes (Abe, 2005). Given a training dataset of n points (xi, yi), i = 1, ... , n, where xi is a multiple dimensional real vector, and yi ∈ {−1,1} is a binary target value indicating the class that xi belongs, the maximum-margin hyperplane that divides the set of points xi is given as min‖w‖ s. t. , yi(wTxi − τ) ≥ 1, i = 1, ... , n, (41) where w is a normal vector to the hyperplane and τ is the intercept of the hyperplane function. Krasňanská et al. (2021) applied a one-against-one LSVM-based method to classify keywords into multiple categories. The LSVM-based method can obtain a higher accuracy rate compared with other machine learning methods such as multinomial logistic regression and multinomial Naïve Bayes. (3) DeepSets model (DSM). DSM is a designing model for machine learning tasks whose objective functions are defined on sets that are invariant to permutations (Zaheer et al., 2017). It characterizes permutation invariant functions and provides a family of functions that has a special structure helpful to design a deep network architecture. In SSA, keywords can be regarded as a set of words. In general, when a keyword is short, the sequential order of a word in that keyword is not very important when learning a suitable keyword representation. Thus, keywords can be represented as a 2D tensor in Rnkeyword×nembedding, where nkeyword is the maximum number of words per keyword and nembedding is the size of the embedding. Given a keyword k, the DeepSets is given as follows. fDS(k, θ′, θ) = fθ(∑ k∈k fθ′(k; θ′); θ ), (42) where fθ is a multi-layer perceptron with a single hidden layer parametrized by θ, and fθ′ is a multiple layers feed forward network with a linear activation function in the output layer parametrized 61 by θ′. The network parameters can be optimized by a stochastic gradient descent approach with the goal of minimizing the cross entropy loss. Polato et al. (2021) developed a deep learning model for multilingual keyword categorization by employing the fastText multilingual word embeddings, and designed its structure based on the DeepSets model. The DSM-based method can obtain good performance on accuracy scores and computational efficiency. In the research stream on keyword assignment and grouping, in addition to academic efforts, research in the SSA industry has explored how to represent advertisers' business objectives through the search advertising structure. Search Engine Land (2022) suggested to create campaigns (i.e., make keyword assignment decisions) to fulfill advertisers' goals, e.g., finding consumers for the product (or service), increasing brand awareness, or driving new visitors to advertiser's website, and create ad- groups (i.e., make keyword grouping decision) connected to each campaign's goal. Keyword assignment and grouping should consider various factors including the structure of advertisers' website, products (or services) offered, locations, branded keywords and non-branded keywords, different bidding options, devices, consumer intents and keyword match types (Whitney, 2022; One PPC, 2022; Zirnheld, 2020). In the meanwhile, as the budget is set at the campaign level, it is effective to conduct keyword assignment with consideration of campaign-specific budget constraints (Whitney, 2022). For keyword grouping decisions under each campaign, it is suggested to construct more granular and specific ad-groups (Hill, 2018), taking into account ad-copies (Cherepakhin, 2021). However, methods used in the industry research are not theoretically rigorous, and lack necessary details and experimental evaluations to prove the effectiveness of the methods. Note that, in the field of information retrieval, there are two research streams related to keywords grouping, namely keyword clustering (e.g., Regelson and Fain, 2006; Ortiz-Cordova and Jansen, 2012) and query clustering (e.g., Broder, 2002; Jansen et al., 2008; Yi and Maghoul, 2009), which are beyond the scope of our review. 5.3 Input Features used for Keyword Assignment and Grouping Table 12 summarizes input/features used in techniques for keyword assignment and grouping, as reported in the literature. Together with keyword performance parameters such as click-through rate, the SSA structure matters in keyword decisions (Li and Yang, 2020). In keyword categorization, 62 statistical characteristics of keyword like TF-IDF has often been listed as input features (Krasňanská et al., 2021), and internal word structures are also used as the underlying framework for keyword representation (Polato et al., 2021). Table 12. Input/Features for Keyword Assignment and Grouping and Related Research Refs. Li &Yang (2020) Krasňanská et al. (2021) Polato et al. (2021) Features AS √ SD CTR CPC CVR VPS √ √ √ √ √ RT √ IRF IWS √ √ Note: AS=Ad Structure; SD=Search Demand; CTR=Click-Through Rate; CPC=Cost Per Click; CVR=Conversion Rate; VPS=Value Per Sale; RT=Risk Tolerance; IRF=Information Retrieval Oriented Features (e.g., TF-IDF); IWS=Internal Word Structure. 5.4 Evaluation Metrics for Keyword Assignment and Grouping As the goal of keyword assignment and grouping is to fill promotional goals (e.g., maximizing the expected profit) by finding an optimal solution for segmenting a set of keywords into groups, Li and Yang (2020) took profit and return on investment as metrics. Frequently used evaluation metrics such as precision, recall, F1-score and accuracy are employed in keyword categorization. Evaluation metrics that we identified in the reviewed articles on keyword assignment and grouping and related streams are presented in Table 13. Table 13. Evaluation Metrics for Keyword Assignment and Grouping Metric Profit Definition Research Stream Refs. An advertiser's or search engine's economic Keyword Li &Yang benefits. assignment and (2020) Return on The expected profit divided by the expected grouping Keyword Li &Yang investment total cost. assignment and (2020) Keywords The number of grouping keywords. number grouping Keyword Li &Yang assignment and (2020); grouping Krasňanská et al. (2021) Precision The ratio of correctly predicted positive Keyword Krasňanská et al. observations to the total predicted positive categorization (2021) observation. Precision = True positive/ (True positive + False positive). 63 Recall The ratio of correctly predicted positive Keyword Krasňanská et al. observations to the all observations in actual categorization (2021) class. Recall = True positive/(True positve + False negaitve). F1-score The weighted average of Precision and Recall. Keyword Krasňanská et al. F1 = 2 ∗ Precision ∗ Recall/(Precision + categorization (2021) Recall). Accuracy The ratio of correctly predicted observations to Keyword Polato et al. the total observations. categorization (2021) Accuracy = (True postitive + True negative)/(True postitive + True negative + False postitive + False negative). Time The amount of time taken by an algorithm. Keyword Polato et al. complexity 5.5 Summary categorization (2021) These prior works on keyword assignment and grouping problem could provide additional insights for advertisers in SSA. However, few are designed for the keyword assignment and grouping optimization problem following the search advertising structure, which is one of the critical research directions in the field of keyword decisions. 6. Keyword Adjustment 6.1 Problem Description Search engines have to serve both organic and sponsored search results with low response latency in order to support better user experiences (Bai and Cambazoglu, 2019). Additionally, owing mainly to the ever- changing nature of the bidding processes, and search users' and advertisers' behaviors, the search advertising market is extremely dynamic (Yang et al., 2015; 2022). In other words, consumer behaviors (e.g., ad clicks), characteristics of advertisement (e.g., ad positions) and competitions from other advertisers would change over time (Amaldoss et al., 2016). In such a dynamic market, advertisers need to prudently adjust their advertising strategies over time, which could be a strenuous task given the level of inherent complexity of search advertising. In particular, advertisers have to track the performance of ongoing search advertising campaigns and accordingly adjust their keyword structure in real time. 64 Search engine allows advertisers to actively adjust their keyword decisions. In SEA, it has been well recognized that keyword adjustment is important for advertisers to precisely display their advertisements and achieve more profit (Ye et al., 2015; George, 2019). First, keyword adjustment aims to obtain a dynamic policy maximizing the expected profit for SSA campaigns during a promotional period, which is distinctly different from one or several static keyword decisions at a series of times. Second, the number of distinct keywords used by search users is enormous in practical settings and search behaviors change over time (Bartz, 2006), which exponentially increase the search space for keyword adjustment. This raises a large challenge for the computational efficiency of online keyword adjustment. Mathematically, given the selected keyword set K(TGT), we define the keyword adjustment process as follows. f(ADJ): K(TGT) (ADJ)=(xi,m̅̅̅,t xi,t → Kj,1,t (TGT),xi,j,t (GRP) ,xi,j,l,t (ASM) ) (ADJ), ... , Kj,l,t (ADJ), ... , Kj,ngroup,t (ADJ) , i ∈ {1,2, ... , n(TGT)}, j ∈ {1,2, ... , ncampaign}, l ∈ {1,2, ... , ngroup}, t ∈ {1,2, ... T}, (43) where f(ADJ) is the keyword adjustment function, Kj,1,t (ADJ) is the adjusted keyword set in the l-th ad- group of the j -th campaign at time t , and xi,t (ADJ) is a decision vector of keyword assignment, indicating the structure adjustments of the i-th keyword in time t. 6.2 Keyword Adjustment and Related Work How to effectively conduct keyword adjustment in real time has become a critical problem for advertisers in SSA. However, in the literature, no study we are aware of has been reported on this issue. Keyword spreading is a technique related to keyword adjustment, which provides indirectly valuable help for advertisers in keyword research. In more detail, keyword spreading is a technique with the goal of optimizing the expected advertising revenue, where an advertiser substitutes high-cost keywords that are likely to be intensely competitive, with a set of related long-tail keywords that are collectively of lower costs but capable of leading to an equivalent volume of traffics. Budinich et al. (2010) provided an experimental benchmark of keyword spreading, and conducted large scale simulations to pin-point that the keyword spreading technique is generally convenient and acceptable to all three parties involved in SSA. 65 One related research stream to keyword adjustment is dynamic bid optimization (i.e., bid adjustment), i.e., how to adjust bids over a set of keywords over time. The bid optimization problem is referred to dynamically determining bids over a subset of keywords in order to maximize advertiser's expected profit. SSA entitles advertisers to adjust their bids over keywords and rankings of their advertisements any time they want, and their payoffs can be realized in real time, which demands a dynamic equilibrium bidding strategy. As reported in an empirical research by Zhang and Feng (2011) based on two data sets containing bidding records over a sample of keywords, advertisers may engage in cyclical bid adjustments under certain conditions. Cyclical bidding patterns happen in both generalized first-price (GFP) and generalized second-price (GSP) auctions. Importantly, cyclical bid- updating behaviors emphasize the necessity of adopting a dynamic perspective when exploring equilibrium properties of bidding strategies in SSA. For more information on bid adjustment, refer to see Borgs et al. (2007), Zhou et al. (2008), Katona and Sarvary (2010), Cai et al. (2017), and Küçükaydin et al. (2019). Another related research stream to keyword adjustment is budget adjustment, i.e., how to allocate advertising budget over time. In addition to bid adjustment, advertisers need to dynamically distribute their advertising budgets in order to avoid early ineffective clicks and save money for better advertising opportunities in the future. In SSA, there exist three levels of budget decisions throughout the entire lifecycle of advertising campaigns, namely, allocation across SSA markets, distribution over a series of time slots, and adjustment of the daily budget across keywords (Yang et al., 2012). For more information on budget adjustment, refer to see Yang et al. (2012, 2014, 2015) and Zhang et al. (2014a). Moreover, research in the SSA industry believes that advertisers should adjust their keyword structures in real time (Search Engine Land, 2022). However, it takes time for advertisers to manage, track and adjust advertising structures to get the optimal results (Whitney, 2022). A good search advertising structure is critical for a successful SSA efforts, which helps advertisers effectively reach the right consumers (Whitney, 2022; Search Engine Land, 2022; Cherepakhin, 2021; One PPC, 2022). As a content marketing specialist at WordStream wrote, "Not having a well-structured account is like attempting to drive a car that's not properly built – accidents are bound to happen". Saravia (2020) suggested advertisers to conduct keyword research and adjust ad-structure related settings over time for optimal advertising performance. In order to equip with a more organized and manageable SSA structure, advertisers should keep fine-tuning and optimizing their campaigns (Hill, 2018). 66 7. Discussion and Future Directions 7.1 General Discussion 7.1.1 The Disciplinary Perspective Our review collected 43 research papers on keyword decisions that have been published in 28 outlets (journals or conferences) in the fields of computer science, artificial intelligence, information retrieval, information systems, advertising, and marketing. This suggests that keyword decisions have been a hot topic covered in a great variety of high-level journals and conferences. From the disciplinary perspective, keyword decisions are an interdisciplinary research field, which falls into computational advertising (Yang et al., 2017). Table 14 summarizes major disciplines, terminology and publication outlets for research on keyword decisions. Note that, we tell the major discipline of a study based on the research issue it addressed, authors' affiliations and publication outlets. From Table 14, we can observe the following phenomena. First, in keyword generation, most contributions are from computer science, except for a few from management science, while for keyword targeting, keyword assignment and grouping, researchers from economics and management become the dominant forces. This is probably because that keyword generation is closely related to popular topics in computer science (e.g., query generation and expansion), while keyword targeting, keyword assignment and grouping are related to market mechanisms, advertising structure and processes. Second, it is apparent that researchers from different disciplines have different focuses on keyword decisions. Specifically, in keyword generation, computer science researchers emphasize developing and comparing methods for keyword extraction from various sources including websites and Web pages, search result snippets, advertising databases and query logs (e.g., Yih et al., 2006; Li et al., 2007; Wu and Bolivar, 2008; Lee et al., 2009; Nie et al., 2019), and those in management science give prominence to investigating keyword generation from the perspective of consumers (e.g., Scholz et al., 2019) and using indirect associations between keywords to facilitate keyword generation (e.g., Abhishek and Hosanagar, 2007; Qiao et al., 2017; Zhang and Qiao, 2018; Zhang et al., 2021); in keyword targeting, computer science researchers primarily aim to identify a set of profitable keywords through adaptive approximation (Rusmevichientong and Williamson, 2006), feature selection (Kiritchenko and Jiline, 2008) and integer programming (Zhang et al., 2014b), and improve the matching efficiency by using 67 machine learning methods (e.g., Radlinski et al., 2008; Gupta et al., 2009; Grbovic et al., 2016), those in economics put a premium on the balance between risk and profit in keyword selection (Symitsi et al., 2022) and the economic consequence of matching mechanisms (Singh and Roychowdhury, 2008), and those in management science concentrate on the strategic role of keyword management costs (Amaldoss et al., 2016) and brand awareness and traffic generated from selected keywords (Arroyo-Cañada and Gil-Lafuente, 2019); in keyword assignment and grouping, computer science researchers employ machine learning methods to increase accuracy and efficiency of keyword categorization (Polato et al., 2021; Krasňanská et al., 2021), and those in management science take into account search advertising structure to formulate keyword grouping in a stochastic programing framework aiming to maximize the expected profit (Li and Yang, 2020). Third, it is apparent that there are no commonly agreed definitions for related concepts identified in the literature on keyword decisions. In particular, these terms have been defined variously in different papers. For example, regarding keyword generation, some studies used keyword suggestion (e.g., Chen et al., 2008; Sarmento et al., 2009; Schwaighofer et al., 2009; Qiao et al., 2017) to represent it, some used keyword recommendation (e.g., Thomaido and Vazirgiannis, 2011; Zhang et al., 2012a), others used keyword extraction (e.g., Yih et al., 2006; Li et al., 2007; Zhou et al., 2007; Wu and Bolivar, 2008), and there are also other terms such as keyword enrichment (GM et al., 2011), term recommendation (Bartz et al., 2006), bidterm suggestion (Chang et al., 2009), and bid phrases generation (Ravi et al., 2010). Some scholars used keyword selection to indicate the process of shrinking the domain-specific keyword pool in order to target potential customers precisely (e.g., Rusmevichientong and Williamson, 2006), while others used it to represent keyword extraction from Web pages or search logs (e.g., Berlt et al., 2011). We also found that some studies used keyword suggestion to represent keyword selection (e.g., Zhang et al., 2014b; Zhang and Qiao, 2018). We believe that this phenomenon can be attributed to the interdisciplinary nature of keyword decisions. Table 14. The Summary of Disciplines, Terminology and Publication Outlets for Keyword Decision Research Keyword Refs. Major Journal/Conference Terminology Decision Discipline Keyword Bartz et al. Computer The 2nd Workshop on Sponsored Search Keyword generation (2006) science Auctions (EC'06) recommendation 68 Joshi Computer The 6th IEEE International Conference Keyword &Motwani science on Data Mining-Workshops generation (2006) (ICDMW'06) Yih et al. Computer The 15th International Conference on Keyword (2006) science World Wide Web (WWW'06) Abhishek Managemen The 9th International Conference on &Hosanagar t science Electronic Commerce (ICEC'07) extraction Keyword generation (2007) Li et al. (2007) Computer The 1st International Workshop on Data Keyword science Mining and Audience Intelligence for extraction Advertising (ADKDD'07) Zhou et al. Computer Integration and Innovation Orient to E- Keyword (2007) science Society Amiri et al. Computer The International Conference on extraction Keyword (2008) science Information and Knowledge Engineering suggestion (IKE'08) Chen et al. Computer The 2008 International Conference on Keyword (2008) science Web Search and Data Mining suggestion (WSDM'08) Fuxman et al. Computer The 17th International Conference on Keyword (2008) science World Wide Web (WWW'08) generation Wu &Bolivar Computer The 17th International Conference on Keyword (2008) science World Wide Web (WWW'08) extraction Chang et al. Computer The 18th International Conference on Bidterm (2009) science World Wide Web (WWW'09) Lee et al. Computer The 32nd International ACM SIGIR (2009) science Conference on Research and Suggestion Keyword extraction Development in Information Retrieval (SIGIR'09) Wu et al. Computer The 18th International Conference on Keyword (2009) science World Wide Web (WWW'09) generation Sarmento et Computer The 3rd International Workshop on Data Keyword al. (2009) science Mining and Audience Intelligence for suggestion Advertising (ADKDD'09) Schwaighofer Computer The 3rd International Workshop on Data Keyword et al. (2009) science Mining and Audience Intelligence for suggestion Advertising (ADKDD'09) Mirizzi et al. Computer The 19th ACM International Conference Keyword (2010) science on Information and Knowledge suggestion Management (CIKM'10) Ravi et al. Computer The 3rd ACM International Conference Bid phrases (2010) science on Web Search and Data Mining generation (WSDM'10) 69 Welch et al. Computer The 19th ACM International Conference Keyword (2010) science on Information and Knowledge selection Management (CIKM'10) Berlt et al. Computer Journal of Information and Data (2011) science Management Keyword selection GM et al. Computer The 4th ACM International Conference Keyword (2011) science on Web Search and Data Mining enrichment (WSDM'11) Scaiano &Inkpen (2011) Computer The International Conference on Recent Keyword science Advances in Natural Language selection Processing Thomaidou Computer The 2011 International Conference on Keyword &Vazirgianni science Advances in Social Networks Analysis recommendation s (2011) and Mining Zhang et al. Computer ACM Transactions on Intelligent Keyword (2012a) science Systems and Technology (TIST) recommendation Jadidinejad Computer Journal of Computer & Robotics &Mahmoudi science (2014) Qiao et al. Managemen Information & Management (2017) t science Keyword suggestion Keyword suggestion Zhang &Qiao Managemen The 22nd Pacific Asia Conference on Keyword (2018) t science Information Systems (PACIS'18) Nie et al. Computer IEEE Intelligent Systems (2019) science Scholz et al. Managemen Decision Support Systems (2019) t science suggestion Keyword generation Keyword generation Zhou et al. Computer The 27th International Conference on Keyword (2019) science World Wide Web (WWW'19) Zhang et al. Managemen Electronic Commerce Research (2021) t science generation Keyword suggestion Keyword Rusmevichie Computer The 7th ACM Conference on Electronic Keyword targeting ntong science Commerce (EC'06) selection &Williamson (2006) Kiritchenko Computer The Workshop on New Challenges for Keyword &Jiline (2008) science Feature Selection in Data Mining and optimization Knowledge Discovery at ECML/PKDD 2008 Zhang et al. Computer Information Processing & Management Keyword (2014b) Arroyo- science Managemen Operational Research International Cañada and t science Journal suggestion Keyword selection 70 Gil-Lafuente (2019) Symitsi et al. Economics European Journal of Operational (2022) Research Keyword selection Radlinski et Computer The 31st Annual International ACM Keyword match al. (2008) science SIGIR Conference on Research and Development in Information Retrieval (SIGIR'08) Singh and Economics The 4th Workshop on Ad Auctions, Keyword match Roychowdhu ry (2008) Conference on Electronic Commerce (EC'08) Gupta et al. Computer The 15th ACM SIGKDD International Keyword match (2009) science Conference on Knowledge Discovery and Data Mining (KDD'09) Amaldoss et Managemen Marketing Science Keyword match al. (2016) t science Grbovic et al. Computer The 39th International ACM SIGIR Keyword match (2016) science conference on Research and Development in Information Retrieval (SIGIR'16) Keyword Li and Yang Managemen International Journal of Electronic Keyword assignment (2020) t science Commerce and grouping Krasňanská et Computer TEM Journal al. (2021) science assignment and grouping Keyword categorization Polato et al. Computer 2021 IEEE Symposium Series on Keyword (2021) science Computational Intelligence (SSCI'21) categorization 7.1.2 The Perspective of Keyword Decisions Following the framework of keyword decisions, articles collected in our review can be categorized into four groups: domain-specific keyword pool generation (30 studies), keyword targeting (10 studies), keyword assignment and grouping (3 studies) and keyword adjustment (0 study). From the literature distribution over different keyword decisions identified in SSA, we have the following observations. First of all, research efforts on keyword decision topics are unbalanced. More specifically, research efforts focus more on keyword generation and keyword targeting; however, there are few research efforts systematically solving keyword optimization problems related to advertising structures defined by search engines, i.e., keyword assignment and grouping and keyword adjustment. In practical 71 campaign management, it is impossible to exaggerate the importance of the SSA structure in keyword decisions. Although the industry needs have been clear, the academic literature on keyword assignment and grouping has been sparse. Second, concerning keyword targeting, as discussed in Section 4, a dozen of prior research efforts have separately explored either keyword selection or keyword match. However, there are few studies considering both of the two issues to realize the optimal targeting for SSA campaigns. In addition, there is no research on keyword adjustment reported in the existing literature. Regarding the less research on keyword assignment and grouping (Section 5.2) and keyword adjustment (Section 6.2), there are several possible explanations. The major reason might be the fact that SSA is distinctly different from the traditional advertising forms due to its advertising mechanism and structure. That is, there are different related keyword decisions throughout the lifecycle of SSA campaigns (Yang et al., 2019), rather than a single decision. Moreover, the SSA environment is extremely dynamic (Zhang and Feng, 2011; Yang et al., 2022) and highly uncertain (Li and Yang, 2020). The dynamic complexity inherent in SSA makes keyword decisions complicated. Furthermore, different from budget adjustment and bid adjustment that have been widely explored by researchers, keyword adjustment is a discrete optimization problem in a large feasible space raised by the scale of keyword number. Finally, keyword decisions are interdisciplinary topics which need joint efforts from different disciplines. However, as we can realize, it's not straightforward to get over disciplinary barriers. To sum up, although plenty of research efforts have been invested in keyword decisions, there is few, if any, research taking into account practical decision components (e.g., the search advertising structure, dynamics). In this sense, we can see that there is a big gap between academic research and search advertising practice. Thus, this calls for substantial research efforts to address the practical difficulties that search advertisers meet in keyword decisions. 7.1.3 The Perspective of Datasets Table 15 summarizes the datasets used to evaluate the performance of the proposed methods for various keyword decisions in the literature. We divided the data sources into four types: synthetic data generated by the authors by using computer programs, private data collected by the authors, business data provided by search engines or firms that advertise their products and services and public data shared by 72 their owners. The first three can only be accessed by authors and those with permissions, and the fourth is available to everybody; except for the first, the other three are real-world data. As illustrated in Table 15, 1 synthetic dataset, 19 private datasets, 10 business datasets and 1 public dataset were used in keyword generation; 3 synthetic datasets, 1 private dataset and 6 business datasets were used in keyword targeting; 1 private dataset and 3 business datasets were used in keyword assignment and grouping. First, it is obvious that almost all studies are based on datasets that are not publicly available, which may hinder the research development in this field. Second, approximately half of the prior research has access to business datasets, and the other half has to generate the necessary data for validation or collect the data through crawlers. This may also echo the gap between academic researchers and SSA practitioners. Last but not the least, we also notice that only a few studies conducted experimental evaluation on two or more datasets. Thus, it is urgent to construct benchmarking datasets for evaluating the performance of keyword decision models and algorithms. Table 15. The Summary of Datasets for Keyword Decisions Keyword Refs. Description Decision Data Source Keyword Bartz et al. The advertising database and the search click logs were obtained Business generation (2006) from Yahoo Inc., including terms and URLs used by the data advertisers and the searchers, respectively. Joshi The dataset includes 8,000 search terms picked randomly from Private &Motwani Web pages relevant on three broad topics (travel, car-rentals, and data (2006) mortgage). Yih et al. The dataset includes 1,109 web pages randomly crawled from Private (2006) MSN Search results by the authors. data Abhishek The corpus consists of 96 documents crawled from websites of 3 Private &Hosanagar spas and 1 dental clinic by the authors. The initial dictionary was data (2007) created by taking top 15 words from each page, out of which 1,087 were distinct. Li et al. (2007) The dataset includes 2,200 TV broadcast transcripts crawled from Private CNN Live Today by the authors. data Zhou et al. The dataset includes 300 Web pages crawled from three Chinese Private (2007) websites (i.e., Sohu, Sina and 163), and 300 advertisements data crawled from Google's sponsored lists by the authors. Amiri et al. The INEX Wikipedia collection includes more than 658,000 (2008) documents, 267,625,000 terms. https://www.mpi- Public data inf.mpg.de/departments/databases-and-information- systems/software/inex/ 73 Chen et al. The dataset includes 1,306,586 web pages crawled from the Private (2008) 150,446 ODP (Open Directory Project) categories by the authors. data Fuxman et al. A snapshot of the query logs obtained from a major search Business (2008) engine, including 41 million queries, 55 million URLs, and 93 data million edges. Wu &Bolivar The dataset includes 800 Web pages randomly crawled from a Private (2008) large pool of eBay partner websites by the authors. data Chang et al. The dataset includes 200 ads from Yahoo's sponsored search ad Business (2009) database, and each ad had fewer than 50 bidterms. Lee et al. The dataset includes 10 popular drama shows and the first 5 data Private (2009) episode scripts per show were selected from various sources (50 data scripts, 3,404 scenes total) by the authors. Wu et al. The dataset includes 100 seed category names widely spread over Private (2009) different topics from eBay and Amazon. For each characteristic data document generation, top 400 Google search-hits were crawled by the authors. Sarmento et The dataset includes a set of 84,180 advertisements and 122,099 Business al. (2009) unique keywords, compiled over a period of about 5 years. data Schwaighofer The first dataset includes 10,000 advertisements and 100 et al. (2009) keywords sampled from a randomly generated model. Synthetic data, The second dataset is derived from a corpus of almost 6 million Business advertisements and 19 million distinct keywords. data Mirizzi et al. The dataset is a domain-specific subgraph of Dbpedia crawled Private (2010) starting from a set of seed nodes. data Ravi et al. The dataset includes a set of ads with advertiser-specified bid Business (2010) phrases from the Yahoo! Ad corpus, and each ads is associated data with a landing URL. Welch et al. The dataset includes a range of videos including 12 films, 3 clips Private (2010) from news and educational content, and 5 amateur clips crawled data from YouTube by the authors. Berlt et al. The dataset includes 300 Web pages extracted from a Brazilian Private (2011) newspaper. data GM et al. The dataset includes 95,104 websites sampled from contextual Business (2011) advertising system of Yahoo! and all Web page requests from data these websites for a duration of 90 days, 220 million pages accounting for 21 billion impressions. The dataset records the performance of existing campaigns from Business an industrial partner. data Scaiano &Inkpen (2011) Thomaidou The dataset includes landing pages taken from eight different Private &Vazirgianni thematic areas promoting several products and services. data s (2011) Zhang et al. The Pagelinks dataset was crawled by the authors in September Private (2012a) 2009. It includes 81.83 million triples and each triple represents a data 74 relation where the first entity has a page link to the second entity, resulting in an initial graph with 81.83 million directed edges and 9.54 million entities. Jadidinejad The dataset leveraged 2008-07-14 offline XML version of Private &Mahmoudi Wikipedia, including more than 7 million articles crawled by the data (2014) authors. Qiao et al. The dataset includes approximately 8,500 query logs on October Private (2017) 2014 crawled from Baidu Tuiguang by the authors. data Zhang &Qiao Query logs were collected through Google Keyword Suggestion Private (2018) Tool by the authors, including query keywords and query data volumes for 20 seed keywords. Nie et al. The dataset was crawled from Wikipedia by the authors, Private (2019) including 879 articles: 130, 104, 317 and 328 articles for four data seed keywords, respectively. Scholz et al. The dataset records the performance of SSA campaigns for two Business (2019) large-scale online stores, which was provided by a company that data runs more than 100 online stores worldwide and has online sales of just under Euro 7 billion a year. Zhou et al. The dataset includes 40 million query logs provided by Business (2019) Sogou.com, and each sample consists of a <ad keyword, user data query> pair. Zhang et al. The corpus of Zhihu was crawled by the authors and the corpus Private (2021) for calculating the Web-based kernel function and semantic drift data levels was collected from top 50 search results of Baidu. Keyword Rusmevichien The dataset includes 100 randomly generated problem instances. Synthetic targeting tong In the first experiment, each problem instance has 8,000 data &Williamson keywords, 200 time periods, $400 budget per period, and the (2006) number of search queries in each time period has a Poisson distribution with a mean of 40,000. In the second experiment, each problem instance has 50,000 keywords, 200 time periods, $1,000 budget per period, and the number of search queries in each time period has a Poisson distribution with a mean of 150,000. Kiritchenko The dataset includes 3-month records of an SME's advertising Business &Jiline (2008) campaign on Google provided by the Epiphan Systems Inc. data The company operates in a video signal processing business. In the reported period, it advertised on 388 unique keywords ranging from single words to 5-word phrases. The dataset is constructed from the company's weblogs and contains all users' queries resulting in paid clicks along with the label on users' activities. Zhang et al. The dataset was obtained from Microsoft Research, including Business (2014b) search logs and auction logs collected during one month (April data 75 2011) and the advertising database containing 31 million ad groups. Arroyo- The advertising performance data (e.g., impressions per week, Business Cañada &Gil- clicks per week) obtained by the advertising planner tool of data Lafuente (2019) Google, and twenty-four different alternative keyword sets provided by a stock exchange brokerage service company. Symitsi et al. The set of relevant keywords and the relevant metrics was drawn Private (2022) from Google Ad Words on September 11, 2015, and the Search data Volume Index (SVI) time series data were drawn from Google Trends by the authors. Gupta et al. The dataset was derived from two months of logs collected from Business (2009) the Microsoft contextual advertising system containing millions data of advertising impressions based on millions of bidded keywords. Radlinski et The dataset is provided by Yahoo! Research, including 10 million Business al. (2008) most frequent queries issued to the Web search engine over a data one-week period. Singh The authors illustrated the research scenarios via calculating Synthetic &Roychowdh examples (e.g., four advertisers and two keywords with different data ury (2008) revenue). Amaldoss et The authors illustrated the research scenarios via calculating Synthetic al. (2016) examples (e.g., a search advertising market with two risk-neutral data advertisers and one keyword). Grbovic et al. The dataset includes more than 126.2 million unique queries, Business (2016) 42.9 million unique ads, and 131.7 million unique links, data comprising over 9.1 billion search sessions on Yahoo Search. Keyword Li &Yang The first dataset was obtained from advertising campaigns run by Business assignmen (2020) an e-commerce firm that promoted celebration commodity on data t and grouping Amazon from June 2016 to March 2017. The second data set records advertising campaigns on Google adwords provided by a large firm selling sportswear, from January 2016 to September 2016. Krasňanská et The dataset includes 112,117 keywords collected by the authors Private al. (2021) using online marketing tools (e.g., Google Search Console, data Google Analytics, Marketing Miner, Ahrefs, Google Ads, Collabim, various whisperers like Google Keyword Planner or Ubersuggest's free keyword tool), the website of the customer for whom the analysis was performed, competitor websites, discussion forums, social networks, and several other resources that focus on the field of jewellery. Polato et al. The dataset includes users' generated keywords provided by a Business (2021) Spanish company in 17 different languages that have been semi- data automatically categorized over the Google Product Taxonomy. 76 7.2 Future Directions 7.2.1 Keyword adjustment Most of prior research focuses on static keyword decisions without consideration of the real-time keyword performance in SSA markets. Keyword adjustment should take into account changes over time in consumer behaviors (e.g., ad clicks), characteristics of advertisement (e.g., ad positions) and competitions from other advertisers (Amaldoss et al., 2016). First of all, it calls for a systematic investigation on dynamic strategies for various keyword decisions throughout the entire lifecycle of SSA campaigns, as discussed in this survey, with consideration of the interdependence between these keyword decisions. Second, it is of necessity to explore dynamic strategies with reference to each type of keyword decisions. As for keyword generation, advertisers should maintain and update the domain-specific keyword pool as the Web contents (e.g., websites and Web pages) and search users' behaviors (e.g., query logs and clicks) have been growing and evolving over time (Nie et al., 2019). Regarding keyword targeting, prior studies (e.g., Rutz et al., 2012) showed that it's more profitable to select general and brand keywords with broad match in the initial stage, and select specific keywords with exact match in the later stage, based on the fact that consumers would change their intentions from the exploring stage to the final purchase stage in the conversion funnel (Scholz et al., 2019). Such insights from empirical studies are valuable for designing strategies for keyword adjustment; however, they are temporally coarse-grained and thus can not support real-time operations. Dynamic strategies for keyword assignment and grouping need to consider structural constraints defined by search engines and handle the evolving interactions between keyword decisions at the two levels (i.e., keyword assignment and keyword grouping). In cases with multiple campaigns, it is also necessary to consider the dynamical relationships between keyword assignment decisions among campaigns and keyword grouping decisions among ad-groups. Third, it is suggested to apply dynamic optimization techniques such as optimal control and reinforcement learning to deal with dynamics in keyword decisions. Different from budget adjustment and bid adjustment, keyword adjustment is a discrete optimization problem in a large feasible space characterized by the scale of keyword number. Hence, discrete optimal control can be used to adjust 77 advertisers' keyword decisions during the entire lifecycle of SSA campaigns in a real-time manner, maximizing the expected profit over a certain time horizon. 7.2.2 Keyword assignment and grouping Although research in the SSA industry gave quite a few heuristic-based methods for keyword assignment and grouping (Hill, 2018; Whitney, 2022), there is no concrete evidence for their effectiveness. In this sense, it's interesting to conduct experimental evaluations to validate and compare the performance of these heuristic-based methods based on real-world datasets collected from practical SSA campaigns. Through drawing direct analogies between SSA markets and financial markets, Dhar and Ghose (2010) stated that like financial markets, the increasing availability of information through IT and the Internet made SSA markets more efficient over time. This inspires us to treat each keyword as a risky asset and use the modern portfolio theory to assemble an asset portfolio (i.e., keyword assignment and grouping) that maximizes expected return for a given level of risk. Optimal strategies for keyword assignment and grouping are more complicated in that they are closely related to the search advertising structure, thus need to handle multiple objectives and take into account structural constraints from search engines. It is suggested to model keyword assignment and grouping as a bi-level optimization model and apply a multi-objective deep reinforcement learning algorithm to solve the model. 7.2.3 Deep learning technologies for keyword decisions In the literature, various techniques have been employed to solve keyword decision problems, such as logistic regression (e.g., Lee et al., 2009; Berlt et al., 2011), latent Dirichlet allocation (e.g., Welch et al., 2010; Qiao et al., 2017), integer optimization (e.g., Zhang et al., 2014b; Li and Yang, 2020), random walks (e.g., Fuxman et al., 2008) and game-theoretic model (e.g., Singh and Roychowdhury, 2008; Amaldoss et al., 2016), as we discussed in Sections 3-6. Search and electronic markets prevailing nowadays provide a large amount of microstructure data for model training and adaptive learning. In recent years, the rise of deep techniques has revived interests in applying deep learning algorithms to support and facilitate advertising decisions (e.g., Cai et al., 2017; Polato et al., 2021; Yang and Zhai, 2022). By taking keyword decisions (e.g., keyword 78 assignment and grouping) as classification problems, a variety of deep learning models can substantially improve the model performance. Moreover, deep learning techniques are helpful to capture complex keyword correlations and complicated advertising settings for keyword decisions (Zhou et al., 2019). The attention-based neural network module (i.e., Transformer) is specifically designed to capture interactions among elements in the input (Lee et al., 2019). Such that, attention-based models, such as set transformers (Polato et al., 2021) may work well in modeling interactions among keywords to boost keyword decisions. The performance (e.g., clicks and conversions) of a set of similar keywords may be interdependent (Amaldoss et al., 2016). Interactions between keywords can be expressed by various graphs in terms of co-occurrence relationships, semantic relationships and performance influences that can be obtained either by analyzing search advertising logs or by extracting the corpus of vocabulary dictionaries/corpus (e.g., thesaurus dictionary, Wikipedia). Graph models such as graph neural networks (GNNs) are capable of dealing with non-Euclidean graph data by representing high-order feature interactions in the graph structure (Zhai et al., 2023). Hence, GNN can be used to model complex interactions and relationships and thus improve the performance of keyword decision models. However, it's not trivial to address the keyword decision problems in deep learning frameworks. For example, keyword generation may pursue keywords that are diversified and relevant to the seed keywords. This calls for deep learning models with high interpretability and a deep integration with domain (e.g., advertising and marketing) knowledge. 7.2.4 Comparison studies In the literature on keyword decisions in the SSA context, as we discussed in previous sections, 39 metrics and 31 datasets were used in 30 articles on keyword generation; 19 metrics and 10 datasets were used in 10 articles in the research stream of keyword targeting; and 8 metrics and 4 datasets were used in 3 articles on keyword assignment and grouping. It is apparent that there is no commonly agreed evaluation metric and benchmark dataset. In the meanwhile, most of the datasets used in prior studies are not publicly available. Moreover, methods developed for keyword decisions were typically compared with a few baselines (including simple heuristic-based methods), rather than with state-of- the-art methods. 79 This calls for plenty of research efforts on comparison studies to evaluate various keyword decision models. It is also worthwhile to build public datasets and design a set of evaluation metrics for each type of keyword decisions in SSA. 7.2.5 Joint optimization In SSA, keyword decisions at different levels form a closed-loop decision cycle, where results from high-level decisions serve as constraints/inputs for low-level decisions, and operational results at low levels create feedbacks for decisions at high levels (Yang et al., 2019). As far as we knew, most of existing efforts deal with a single keyword decision separately. It is necessary to consider joint optimization for two or more related keyword decisions in an integrated manner by considering relationships between them in the search advertising structure. Addressing keyword assignment and grouping problem in a unified model can be viewed as an example in this direction. Another direction for joint optimization is to characterize the interface of keyword decisions with other advertising decisions in SSA, such as budget allocation and bid determination. In SSA, besides identifying relevant keywords and designing effective keyword structure, advertisers have to optimally allocate the advertising budget and determine optimal bidding prices on keywords, in order to maximize the performance of campaigns. More specifically, the outcome of budget decisions largely defines the feasible space for keyword decisions; in the meanwhile, keyword decisions are closely related to bidding decisions in that the latter can be considered as an important parameter in the former, which of the two together determine whether and when search advertisements can be displayed to potential consumers. That is, keyword decisions need to cooperate with other decision variables (e.g., budget and bid) in an integrated way. Fortunately, several researches have emerged recently in this direction, e.g., the dual adjustment of daily budget and bids (Zhang et al., 2012b; Zhang et al. 2014a), simultaneously selecting relevant keywords and putting optimal bidding prices over these keywords (Zhang et al., 2014b). Additionally, it is also an interesting perspective to elaborate cooperative keyword decision scenarios in the context of SSA and explore corresponding optimal strategies. 8. Conclusions The main objective of this paper is to present a research agenda for keyword decisions in the context of SSA. We propose an overarching framework that highlights keyword related decision scenarios 80 throughout the entire lifecycle of SSA campaigns. Based on this framework, we conduct a substantive review of the state-of-the-art literature on keyword decisions. We cover the related issues with sufficient depth by enumerating techniques for optimizing keyword decisions, input features and evaluation metrics. We further summarize the research status, identify the research gaps, and outline interesting prospects for future exploration in this area. Keyword decisions are a distinct topic in online advertising because state-of-the-art Web science basically takes keyword as the basic unit to offer various information services. In this sense, without loss of generality, insights and solutions yielded from keyword decisions in SSA can also shed light on other online advertising forms such as social media advertising. References [1]. Abe, S. (2005). Support vector machines for pattern classification (Vol. 2, p. 44). London: Springer. [2]. Abhishek, V., & Hosanagar, K. (2007, August). Keyword generation for search engine advertising using semantic similarity between terms. In Proceedings of the 9th International Conference on Electronic Commerce (ICEC'07) (pp. 89-94), Minneapolis, MN, USA. ACM. [3]. Amaldoss, W., Jerath, K., & Sayedi, A. (2016). Keyword management costs and "broad match" in sponsored search advertising. Marketing Science, 35(2), 259-274. [4]. Amiri, H., AleAhmad, A., Rahgozar, M., & Oroumchian, F. (2008, July) Keyword suggestion using conceptual graph construction from Wikipedia rich documents. International Conference on Information and Knowledge Engineering (IKE'08), Las Vegas, USA. [5]. Anagnostopoulos, A., Broder, A. Z., Gabrilovich, E., Josifovski, V., & Riedel, L. (2007, November). Just-in-time contextual advertising. In Proceedings of the 16th ACM Conference on Information and Knowledge Management (CIKM'10) (pp. 331-340), Lisboa, Portugal. ACM. [6]. Arroyo-Cañada FJ. & Gil-Lafuente, J. (2019). A fuzzy asymmetric TOPSIS model for optimizing investment in online advertising campaigns. Operational Research International Journal, 19(3), 701-716. [7]. Azad, H. K., & Deepak, A. (2019). Query expansion techniques for information retrieval: A survey. Information Processing & Management, 56(5), 1698-1735. [8]. Bai, X., & Cambazoglu, B. B. (2019). Impact of response latency on sponsored search. Information Processing & Management, 56(1), 110-129. [9]. Bartz, K., Murthi, V., & Sebastian, S. (2006, June). Logistic regression and collaborative filtering for sponsored search term recommendation. In 2nd Workshop on Sponsored Search Auctions (EC'06) (Vol. 5), Ann Arbor, Michigan. ACM. [10]. Berlt, K., Pessoa, M., Herrera, M., Sena, C. A., Cristo, M., & de Moura, E. S. (2011). ACAKS: An Ad-Collection-Aware Keyword Selection Approach for Contextual Advertising. Journal of Information and Data Management, 2(3), 243. 81 [11]. Blei, D. M., Ng, A. Y., & Jordan, M. I. (2003). Latent dirichlet allocation. Journal of Machine Learning Research, 3(Jan), 993-1022. [12]. Borgs, C., Chayes, J., Immorlica, N., Jain, K., Etesami, O., & Mahdian, M. (2007, May). Dynamics of bid optimization in online advertisement auctions. In Proceedings of the 16th International Conference on World Wide Web (WWW'07) (pp. 531-540), Banff, Canada. [13]. Broder, A. (2002, September). A taxonomy of web search. In ACM SIGIR Forum (Vol. 36, No. 2, pp. 3-10), New York, NY, USA. ACM. [14]. Broder, A., Fontoura, M., Josifovski, V., & Riedel, L. (2007, July). A semantic approach to contextual advertising. In Proceedings of the 30th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR'07) (pp. 559-566), Amsterdam, The Netherlands. ACM. [15]. Brown, P. F., Della Pietra, S. A., Della Pietra, V. J., & Mercer, R. L. (1993). The mathematics of statistical machine translation: Parameter estimation. Computational Linguistics, 19(2), 263-311. [16]. Budinich, M., Codenotti, B., Geraci, F., & Pellegrini, M. (2010, September). On the benefits of keyword spreading in sponsored search auctions: an experimental analysis. In International Conference on Electronic Commerce and Web Technologies (pp. 158-171), Springer, Berlin, Heidelberg. [17]. Cai, H., Ren, K., Zhang, W., Malialis, K., Wang, J., Yu, Y., & Guo, D. (2017, February). Real-time bidding by reinforcement learning in display advertising. In Proceedings of the 10th ACM International Conference on Web Search and Data Mining (WSDM'11) (pp. 661-670), Cambridge, UK. ACM. [18]. Carpineto, C., & Romano, G. (2012). A survey of automatic query expansion in information retrieval. ACM Computing Surveys (CSUR), 44(1), 1-50. [19]. Chang, W., Pantel, P., Popescu, A. M., & Gabrilovich, E. (2009, April). Towards intent-driven bidterm suggestion. In Proceedings of the 18th International Conference on World Wide Web (WWW'09) (pp. 1093-1094), Madrid, Spain. [20]. Charnes, A., & Cooper, W. W. (1959). Chance-constrained programming. Management Science, 6(1), 73-79. [21]. Chatwin, R. E. (2013, June). An overview of computational challenges in online advertising. In 2013 American Control Conference (pp. 5990-6007). Washington, DC. IEEE. [22]. Chen, Y., Xue, G. R., & Yu, Y. (2008, February). Advertising keyword suggestion based on concept hierarchy. In Proceedings of the 2008 International Conference on Web Search and Data Mining (WSDM'08) (pp. 251-260), Palo Alto, CA, USA. ACM. [23]. Cherepakhin, I. (2021). Structure Best Practices: How to Create Your Campaigns & Ad Groups. https://www.searchenginejournal.com/ppc-guide/ad-groups/ (accessed on Sep 2, 2022). [24]. Chung, J., Gulcehre, C., Cho, K., & Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. In NIPS 2014 Deep Learning and Representation Learning Workshop. [25]. Da, Z., Engelberg, J., & Gao, P. (2011). In search of attention. The Journal of Finance, 66(5), 1461-1499. [26]. Dhar, V., & Ghose, A. (2010). Research commentary-Sponsored search and market efficiency. Information Systems Research, 21(4), 760-772. [27]. Du, X., Su, M., Zhang, X., & Zheng, X. (2017). Bidding for multiple keywords in sponsored search advertising: Keyword categories and match types. Information Systems Research, 28(4), 711-722. 82 [28]. Freund, Y., & Schapire, R. E. (1999). Large margin classification using the perceptron algorithm. Machine Learning, 37(3), 277-296. [29]. Fuxman, A., Tsaparas, P., Achan, K., & Agrawal, R. (2008, April). Using the wisdom of the crowds for keyword generation. In Proceedings of the 17th International Conference on World Wide Web (WWW'08) (pp. 61-70), Beijing, China. [30]. García-Cascales, M. S., & Lamata, M. T. (2012). On rank reversal and TOPSIS method. Mathematical and Computer Modelling, 56(5-6), 123-132. [31]. George, T. (2019) How feature, https://searchengineland.com/how-to-use-amazon-advertisings-dynamic-bidding-feature-320505 (accessed on Sep 2, 2022). to use amazon advertising's dynamic bidding [32]. GM, P. K., Leela, K. P., Parsana, M., & Garg, S. (2011, February). Learning website hierarchies for keyword enrichment in contextual advertising. In Proceedings of the 4th ACM International Conference on Web Search and Data Mining (WSDM'11) (pp. 425-434), Hong Kong, China. ACM. [33]. Gopal, R., Li, X., & Sankaranarayanan, R. (2011). Online keyword based advertising: Impact of ad impressions on own-channel and cross-channel click-through rates. Decision Support Systems, 52(1), 1-8. [34]. Grbovic, M., Djuric, N., Radosavljevic, V., Silvestri, F., Baeza-Yates, R., Feng, A., Ordentlich, E., Yang, L., & Owens, G. (2016, July). Scalable semantic matching of queries to ads in sponsored search advertising. In Proceedings of the 39th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR'16) (pp. 375-384), Pisa, Italy. ACM. [35]. Gupta, S., Bilenko, M., & Richardson, M. (2009, June). Catching the drift: learning broad matches from clickthrough data. In Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 1165-1174). ACM. [36]. Ha, L. (2008). Online advertising research in advertising journals: A review. Journal of Current Issues & Research in Advertising, 30(1), 31-48. [37]. Haveliwala, T. H. (2003). Topic-sensitive pagerank: A context-sensitive ranking algorithm for web [38]. Hill, search. IEEE Transactions on Knowledge and Data Engineering, 15(4), 784-796. search campaigns. structure https://creativewebsitemarketing.com/google-ads-campaign-structure/ (accessed on Sep 2, 2022). [39]. Hou, L. (2015). A hierarchical Bayesian network-based approach to keyword auction. IEEE (2018). google How ads S. to Transactions on Engineering Management, 62(2), 217-225. [40]. Interactive Advertising Bureau. IAB Annual Report 2021. Available at https://www.iab.com/wp- content/uploads/2022/04/IAB_Internet_Advertising_Revenue_Report_Full_Year_2021.pdf (accessed on Jun 28, 2022). [41]. Jadidinejad, A. H., & Mahmoudi, F. (2014). Advertising keyword suggestion using relevance- based language models from wikipedia rich articles. Journal of Computer & Robotics, 7(2), 29- 35. [42]. Jansen, B. J., Booth, D. L., & Spink, A. (2008). Determining the informational, navigational, and transactional intent of Web queries. Information Processing & Management, 44(3), 1251-1266. [43]. Ji, L., Rui, P., & Hansheng, W. (2010). Selection of best keywords. Journal of Interactive Advertising, 11(1), 27–35. [44]. Joshi, A., & Motwani, R. (2006, December). Keyword generation for search engine advertising. In 6th IEEE International Conference on Data Mining-Workshops (ICDMW'06) (pp. 490-496), Hong Kong, China. IEEE. 83 [45]. Katona, Z., & Sarvary, M. (2010). The race for sponsored links: Bidding patterns for search advertising. Marketing Science, 29(2), 199-215. [46]. Kiritchenko, S., & Jiline, M. (2008, September). Keyword optimization in sponsored search via feature selection. In Proceedings of the Workshop on New Challenges for Feature Selection in Data Mining and Knowledge Discovery at ECML/PKDD 2008, (pp. 122-134), Antwerp, Belgium. JMLR. [47]. Krasňanská, D., Komara, S., & Vojtková, M. (2021). Keyword categorization using statistical methods. TEM Journal, 10(3), 1377-1384. [48]. Küçükaydin, H., Selçuk, B., & Özlük, Ö. (2019). Optimal keyword bidding in search-based advertising with budget constraint and stochastic ad position. Journal of the Operational Research Society, 1-13. [49]. Lavrenko, V., & Croft, W. B. (2017, August). Relevance-based language models. In ACM SIGIR Forum (Vol. 51, No. 2, pp. 260-267). New York, USA. ACM. [50]. Lee, J. T., Lee, H., Park, H. S., Song, Y. I., & Rim, H. C. (2009, July). Finding advertising keywords on video scripts. In Proceedings of the 32nd International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR'09) (pp. 686-687), Boston, Massachusetts, USA. ACM. [51]. Lee, J., Lee, Y., Kim, J., Kosiorek, A., Choi, S., & Teh, Y. W. (2019, May). Set transformer: A framework for attention-based permutation-invariant neural networks. In Proceedings of the 36th International Conference on Machine Learning (ICML'19) (pp. 3744-3753), Long Beach, CA, USA. PMLR. [52]. Li, H., & Yang, Y. (2020). Optimal keywords grouping in sponsored search advertising under uncertain environments. International Journal of Electronic Commerce, 24(1), 107-129. [53]. Li, H., & Yang, Y. (2022). Keyword Targeting Optimization in Sponsored Search Advertising: Combining Selection and Matching. Electronic Commerce Research and Applications, 56, 101209. [54]. Li, H., Zhang, D., Hu, J., Zeng, H. J., & Chen, Z. (2007, August). Finding keyword from online broadcasting content for targeted advertising. In Proceedings of the 1st International Workshop on Data Mining and Audience Intelligence for Advertising (ADKDD'07) (pp. 55-62), San Jose, CA, USA. ACM. [55]. Mabroukeh, N. R., & Ezeife, C. I. (2010). A taxonomy of sequential pattern mining algorithms. ACM Computing Surveys (CSUR), 43(1), 1-41. [56]. Markowitz, H. (1952). Portfolio selection. The Journal of Finance, 7(1), 77-91. [57]. Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., & Dean, J. (2013). Distributed representations of words and phrases and their compositionality. Advances in Neural Information Processing Systems, 26. [58]. Mirizzi, R., Ragone, A., Di Noia, T., & Di Sciascio, E. (2010, October). Semantic tags generation and retrieval for online advertising. In Proceedings of the 19th ACM International Conference on Information and Knowledge Management (CIKM'10) (pp. 1089-1098), Toronto, Ontario, Canada. ACM. [59]. Moorthy, K. S. (1985). Using game theory to model competition. Journal of Marketing Research, 22(3), 262-282. [60]. Navigli, R. (2009). Word sense disambiguation: A survey. ACM Computing Surveys (CSUR), 41(2), 1-69. 84 [61]. Nie, H., Yang, Y., & Zeng, D., (2019). Keyword Generation for Sponsored Search Advertising: Balancing Coverage and Relevance. IEEE Intelligent Systems, 34(5), 14 - 24. [62]. One PPC (2022). How to build a Google Ads account structure that works well. https://oneppcagency.co.uk/google-ads/account-structure/ (accessed on Sep 2, 2022). [63]. Opper, M., & Winther, O. (1999). A Bayesian approach to on-line learning. Saad, David (ed.) Publications of the Newton Institute. Cambridge: Cambridge University Press. [64]. Ortiz-Cordova, A. and Jansen, B. J. (2012). Classifying web search queries to identify high revenue generating customers. Journal of the American Society for Information Science and Technology, 63 (7), 1426-1441. [65]. Ortiz-Cordova, A., Yang, Y., & Jansen, B. J. (2015). External to internal search: Associating searching on search engines with searching on sites. Information Processing & Management, 51(5), 718-736. [66]. Polato, M., Demchenko, D., Kuanyshkereyev, A., & Navarin, N. (2021, December). Efficient Multilingual Deep Learning Model for Keyword Categorization. In 2021 IEEE Symposium Series on Computational Intelligence (SSCI'21) (pp. 01-08), Orlando, FL, USA. IEEE. [67]. Qiao, D., Zhang, J., Wei, Q., & Chen, G. (2017). Finding competitive keywords from query logs to enhance search engine advertising. Information & Management, 54(4), 531-543. [68]. Radlinski, F., Broder, A., Ciccolo, P., Gabrilovich, E., Josifovski, V., & Riedel, L. (2008, July). Optimizing relevance and revenue in ad search: a query substitution approach. In Proceedings of the 31st Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR'08) (pp. 403-410). Singapore. ACM. [69]. Ravi, S., Broder, A., Gabrilovich, E., Josifovski, V., Pandey, S., & Pang, B. (2010, February). Automatic generation of bid phrases for online advertising. In Proceedings of the 3rd ACM International Conference on Web Search and Data Mining (WSDM'10) (pp. 341-350), New York, USA. ACM. [70]. Regelson, M., & Fain, D. (2006, January). Predicting click-through rate using keyword clusters. In Proceedings of the 2nd Workshop on Sponsored Search Auctions (EC'06) (Vol. 9623, pp. 1-6), Ann Arbor, MI. ACM. [71]. Rusmevichientong, P., & Williamson, D. P. (2006, June). An adaptive algorithm for selecting profitable keywords for search-based advertising services. In Proceedings of the 7th ACM Conference on Electronic Commerce (EC'06) (pp. 260-269). Ann Arbor, Michigan. ACM. [72]. Rutz, O. J., Bucklin, R. E., & Sonnier, G. P. (2012). A latent instrumental variables approach to modeling keyword conversion in paid search advertising. Journal of Marketing Research, 49(3), 306-319. [73]. Saravia, A. (2020). 5 brilliant tips to strengthen your google ads campaign structure. https://www.whitesharkmedia.com/blog/google-ads/campaign-structure/ (accessed on Sep 2, 2022). [74]. Sarmento, L., Trezentos, P., Gonçalves, J. P., & Oliveira, E. (2009, June). Inferring local synonyms for improving keyword suggestion in an on-line advertisement system. In Proceedings of the 3rd International Workshop on Data Mining and Audience Intelligence for Advertising (ADKDD'09) (pp. 37-45), Paris, France. ACM. [75]. Scaiano, M., & Inkpen, D. (2011, September). Finding negative key phrases for internet advertising campaigns using wikipedia. In Proceedings of the International Conference Recent Advances in Natural Language Processing 2011 (pp. 648-653), Hissar, Bulgaria. 85 [76]. Scholkopf, B. (1999). Making large scale SVM learning practical. Advances in Kernel Methods: Support Vector Learning, 41-56. [77]. Scholz, M., Brenner, C., & Hinz, O. (2019). AKEGIS: automatic keyword generation for sponsored search advertising in online retailing. Decision Support Systems, 119, 96-106. [78]. Schwaighofer, A., Candela, J. Q., Borchert, T., Graepel, T., & Herbrich, R. (2009, June). Scalable clustering and keyword suggestion for online advertisements, In Proceedings of the 3rd International Workshop on Data Mining and Audience Intelligence for Advertising (ADKDD'09) (pp. 27–36), Paris, France. ACM. [79]. Search Engine Land (2022). PPC Guide: How to structure search campaigns https://searchengineland.com/guide/ppc/search-campaign-structure (accessed on Sep 2, 2022). [80]. Shatnawi, M., & Mohamed, N. (2012, March). Statistical techniques for online personalized advertising: a survey. In Proceedings of the 27th Annual ACM Symposium on Applied Computing (SAC'12) (pp. 680-687), Riva del Garda, Italy. ACM. [81]. Singh, S. K., & Roychowdhury, V. P. (2008) To broad-match or not to broad-match: An auctioneer's dilemma. In Proceedings of the 4th Workshop on Ad Auctions, Conference on Electronic Commerce (EC'08), Chicago, IL. [82]. Sutskever, I., Vinyals, O., & Le, Q. V. (2014). Sequence to sequence learning with neural networks. Advances in Neural Information Processing Systems, 3104–3112. [83]. Symitsi, E., Markellos, R. N., & Mantrala, M. K. (2022). Keyword portfolio optimization in paid search advertising. European Journal of Operational Research, 303(2), 767-778. [84]. Thomaidou, S., & Vazirgiannis, M. (2011, July). Multiword keyword recommendation system for online advertising. In 2011 International Conference on Advances in Social Networks Analysis and Mining (ASONAM'11) (pp. 423-427). Taiwan, China. IEEE. [85]. Welch, M. J., Cho, J., & Chang, W. (2010, October). Generating advertising keywords from video content. In Proceedings of the 19th ACM International Conference on Information and Knowledge Management (CIKM'10) (pp. 1421-1424). Toronto, Ontario, Canada. ACM. [86]. Whitney, M. (2022). 6 steps to building a brilliant paid search account structure. Available at https://www.wordstream.com/blog/ws/2015/03/06/adwords-account-structure (accessed on Sep 2, 2022). [87]. Wu, H., Qiu, G., He, X., Shi, Y., Qu, M., Shen, J., Bu, C. & Chen, C. (2009, April). Advertising keyword generation using active learning. In Proceedings of the 18th International Conference on World Wide Web (WWW'09) (pp. 1095-1096), Madrid, Spain. ACM. [88]. Wu, X., & Bolivar, A. (2008, April). Keyword extraction for contextual advertisement. In Proceedings of the 17th International Conference on World Wide Web (WWW'08) (pp. 1195-1196), Beijing, China. ACM. [89]. Xia, F., Liu, J., Nie, H., Fu, Y., Wan, L., & Kong, X. (2019). Random walks: A review of algorithms and applications. IEEE Transactions on Emerging Topics in Computational Intelligence, 4(2), 95- 107. [90]. Yang, S., Pancras, J., & Song, Y. A. (2021). Broad or exact? Search Ad matching decisions with keyword specificity and position. Decision Support Systems, 143, 113491. [91]. Yang, Y. and Zhai, P. (2022). Click-through rate prediction in online advertising: A literature review. Information Processing & Management, 59(2), 102853. 86 [92]. Yang, Y., J. Zhang, R. Qin, J. Li, F. Wang, W. Qi (2012). A Budget optimization framework for search advertisements across markets, IEEE Transactions on Systems, Man, and Cybernetics. Part A: Systems and Humans, 42(5): 1141-1151. [93]. Yang, Y., Li, X., Zeng, D., and Jansen, B. J., (2018). Aggregate effects of advertising decisions: a complex systems look at search engine advertising via an experimental study. Internet Research, 28(4), 1079-1102. [94]. Yang, Y., Qin, R., Jansen, B. J., Zhang, J., & Zeng, D. (2014). Budget planning for coupled campaigns in sponsored search auctions. International Journal of Electronic Commerce, 18(3), 39- 66. [95]. Yang, Y., Yang, Y. C., Jansen, B. J., and Lalmas, M. (2017). Computational Advertising: A Paradigm Shift for Advertising and Marketing?. IEEE Intelligent Systems, 32(3), 3-6. [96]. Yang, Y., Yang, Y., Guo, X., and Zeng, D. (2019). Keyword optimization in sponsored search advertising: a multi-level computational framework. IEEE Intelligent Systems, 34(1), 32-42. [97]. Yang, Y., Zeng, D., Yang, Y., & Zhang, J. (2015). Optimal budget allocation across search advertising markets. Informs Journal on Computing, 27(2), 285-300. [98]. Yang, Y., Zhang, J., Qin, R., Li, J., Liu, B., & Liu, Z. (2013). Budget strategy in uncertain environments of search auctions: A preliminary investigation. IEEE Transactions on Services Computing, 6(2), 168-176. [99]. Yang, Y., Zhao, K., Zeng, D. D., & Jansen, B. J. (2022). Time-varying effects of search engine advertising on sales–An empirical investigation in E-commerce. Decision Support Systems, 113843. https://doi.org/10.1016/j.dss.2022.113843 [100]. Ye, S., Aydin, G., & Hu, S. (2015). Sponsored search marketing: Dynamic pricing and advertising for an online retailer. Management Science, 61(6), 1255-1274. [101]. Yi, J., & Maghoul, F. (2009, April). Query clustering using click-through graph. In Proceedings of the 18th International Conference on World Wide Web (WWW'09) (pp. 1055-1056), Madrid, Spain. ACM. [102]. Yih, W. T., Goodman, J., & Carvalho, V. R. (2006, May). Finding advertising keywords on web pages. In Proceedings of the 15th International Conference on World Wide Web (WWW'06) (pp. 213-222), Edinburgh, Scotland. ACM. [103]. Zaheer, M., Kottur, S., Ravanbakhsh, S., Poczos, B., Salakhutdinov, R. R., & Smola, A. J. (2017). Deep sets. Advances in Neural Information Processing Systems, 30. [104]. Zhai, P., Yang, Y. and Zhang, C. (2023). Causality-based CTR Prediction using Graph Neural Networks. Information Processing & Management, 103137. [105]. Zhang, J., & Qiao, D. (2018). A Novel Keyword Suggestion Method for Search Engine Advertising. In Proceedings of the 22nd Pacific Asia Conference on Information Systems (PACIS'18) (p. 305), Yokohama, Japan. [106]. Zhang, J., Yang, Y., Li, X., Qin, R., & Zeng, D. (2014a). Dynamic dual adjustment of daily budgets and bids in sponsored search auctions. Decision Support Systems, 57, 105-114. [107]. Zhang, J., Zhang, J., & Chen, G. (2021). A semantic transfer approach to keyword suggestion for search engine advertising. Electronic Commerce Research, forthcoming. https://doi.org/10.1007/ s10660-021-09496-7. [108]. Zhang, W., Wang, D., Xue, G. R., & Zha, H. (2012a). Advertising keywords recommendation for short-text web pages using Wikipedia. ACM Transactions on Intelligent Systems and Technology (TIST), 3(2), 36. 87 [109]. Zhang, W., Zhang, Y., Gao, B., Yu, Y., Yuan, X., & Liu, T. Y. (2012b, August). Joint optimization of bid and budget allocation in sponsored search. In Proceedings of the 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD'12) (pp. 1177-1185), Beijing, China. ACM. [110]. Zhang, X., & Feng, J. (2011). Cyclical bid adjustments in search-engine advertising. Management Science, 57(9), 1703-1719. [111]. Zhang, Y., Zhang, W., Gao, B., Yuan, X., & Liu, T. Y. (2014b). Bid keyword suggestion in sponsored search based on competitiveness and relevance. Information Processing & Management, 50(4), 508-523. [112]. Zhou, H., Huang, M., Mao, Y., Zhu, C., Shu, P., & Zhu, X. (2019, May). Domain-Constrained Advertising Keyword Generation. In Proceedings of the International Conference on World Wide Web (WWW'19) (pp. 2448-2459), San Francisco, CA, USA. ACM. [113]. Zhou, N., Wu, J., & Zhang, S. (2007). A keyword extraction based model for web advertisement. In Integration and Innovation Orient to E-Society, Volume 2 (pp. 168-175), Springer, Boston, MA. [114]. Zhou, Y., Chakrabarty, D., & Lukose, R. (2008, December). Budget constrained bidding in keyword auctions and online knapsack problems. In International Workshop on Internet and Network Economics (WINE'08) (pp. 566-576). Springer, Berlin, Heidelberg. ACM. [115]. Zirnheld, C. structure. Google https://cypressnorth.com/resources/guide/google-ads-account-structure/ (accessed on Sep 2, 2022). account (2020). Ads 88
http://arxiv.org/abs/2302.12370v1
2023-02-24T00:02:24
2023-02-24T00:02:24
Best-of-Three-Worlds Linear Bandit Algorithm with Variance-Adaptive Regret Bounds
This paper proposes a linear bandit algorithm that is adaptive to environments at two different levels of hierarchy. At the higher level, the proposed algorithm adapts to a variety of types of environments. More precisely, it achieves best-of-three-worlds regret bounds, i.e., of ${O}(\sqrt{T \log T})$ for adversarial environments and of $O(\frac{\log T}{\Delta_{\min}} + \sqrt{\frac{C \log T}{\Delta_{\min}}})$ for stochastic environments with adversarial corruptions, where $T$, $\Delta_{\min}$, and $C$ denote, respectively, the time horizon, the minimum sub-optimality gap, and the total amount of the corruption. Note that polynomial factors in the dimensionality are omitted here. At the lower level, in each of the adversarial and stochastic regimes, the proposed algorithm adapts to certain environmental characteristics, thereby performing better. The proposed algorithm has data-dependent regret bounds that depend on all of the cumulative loss for the optimal action, the total quadratic variation, and the path-length of the loss vector sequence. In addition, for stochastic environments, the proposed algorithm has a variance-adaptive regret bound of $O(\frac{\sigma^2 \log T}{\Delta_{\min}})$ as well, where $\sigma^2$ denotes the maximum variance of the feedback loss. The proposed algorithm is based on the SCRiBLe algorithm. By incorporating into this a new technique we call scaled-up sampling, we obtain high-level adaptability, and by incorporating the technique of optimistic online learning, we obtain low-level adaptability.
[ "Shinji Ito", "Kei Takemura" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12370v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12370v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
3 2 0 2 b e F 4 2 ] G L . s c [ 1 v 0 7 3 2 1 . 2 0 3 2 : v i X r a Best-of-Three-Worlds Linear Bandit Algorithm with Variance-Adaptive Regret Bounds Shinji Ito* Kei Takemura∗ Abstract √ (cid:113) C log T ∆min This paper proposes a linear bandit algorithm that is adaptive to environments at two dif- ferent levels of hierarchy. At the higher level, the proposed algorithm adapts to a variety of types of environments. More precisely, it achieves best-of-three-worlds regret bounds, i.e., of + T log T ) for adversarial environments and of O( log T ∆min O( ) for stochastic envi- ronments with adversarial corruptions, where T , ∆min, and C denote, respectively, the time horizon, the minimum sub-optimality gap, and the total amount of the corruption. Note that polynomial factors in the dimensionality are omitted here. At the lower level, in each of the adversarial and stochastic regimes, the proposed algorithm adapts to certain environmental characteristics, thereby performing better. The proposed algorithm has data-dependent regret bounds that depend on all of the cumulative loss for the optimal action, the total quadratic vari- ation, and the path-length of the loss vector sequence. In addition, for stochastic environments, the proposed algorithm has a variance-adaptive regret bound of O( σ2 log T ) as well, where σ2 ∆min denotes the maximum variance of the feedback loss. The proposed algorithm is based on the SCRiBLe algorithm. By incorporating into this a new technique we call scaled-up sampling, we obtain high-level adaptability, and by incorporating the technique of optimistic online learn- ing, we obtain low-level adaptability. 1 Introduction This paper considers linear bandit problems. In this class of problems, a player chooses, in each round t, an action at from a given action set A, which is a subset of a d-dimensional linear space. The player then observes the incurred loss ft(at) ∈ [−1, 1], where the (conditional) expectation of ft is assumed to be a linear function, i.e., ft is expressed as ft(a) = (cid:104)(cid:96)t, a(cid:105) + εt(a) with some vector (cid:96)t ∈ Rd and some noise εt. The performance of the player is evaluated in terms of of regret RT defined as RT (a∗) = E (cid:105) t=1 ft(a∗) Algorithms for linear bandit problems have been proposed mainly for two different types of environments: stochastic and adversarial. In stochastic environments, {ft} are assumed to follow an unknown distribution D independently for all t. Consequently, we may assume that there exists and RT = maxa∗∈A RT (a∗). t=1 ft(at) − (cid:80)T (cid:104)(cid:80)T *NEC Corporation. Email: [email protected], kei [email protected]. 1 (cid:96)∗ ∈ Rd such that (cid:96)t = (cid:96)∗ and εt(a) follows an identical distribution for all t.1 In adversarial environments, the distributions of ft (and thus also (cid:96)t) are decided arbitrarily depending on the action sequence (as)t−1 s=1 that the player has chosen so far. √ What we can do in linear bandit problems varies greatly depending on the type of environ- ment. For stochastic environments, it is known that the optimal regret is of Θ(log T ) [Lattimore and Szepesvari, 2017], ignoring the factor dependent on d, A and (cid:96)∗. For adversarial environments, the mini-max optimal regret is ̃Θ(d T ) [Bubeck et al., 2012], where we ignore poly-logarithmic factors with respect to d and T in the notation of ̃O, ̃Ω and ̃Θ. A class of intermediate settings between these two types of environments are called stochastic environments with adversarial cor- ruption [Lykouris et al., 2018], or corrupted stochastic environments. Environments in this regime are parametrized by corruption level C, which measures the amount of the adversarial component. For this setting, an algorithm achieving O((log T )2 + C)-regret has been proposed [Lee et al., 2021]. The aim of this paper is to make possible the construction of adaptive algorithms that auto- matically exploit certain specific characteristics of environments. In existing studies of bandit al- gorithms, the concept of adaptability has been considered at two different levels, regarding which we here refer to high-level adaptability and low-level adaptability. Algorithms with high-level adaptability are designed to work well for different types of environments, e.g., stochastic and adversarial types. Algorithms with low-level adaptability perform better in specific individual en- vironments by exploiting certain favorable characteristics that they possess, e.g., small cumulative loss or small variance in loss sequences. High-level-adaptive bandit algorithms that perform (nearly) optimally for both stochastic and adversarial environments are called best-of-both-worlds (BOBW) algorithms [Bubeck and Slivkins, 2012]. Among such algorithms, those that can adapt to corrupted stochastic environments are re- ferred to as best-of-all-worlds [Erez and Koren, 2021] or best-of-three-worlds (BOTW) algorithms [Lee et al., 2021]. For linear bandit problems, Lee et al. [2021] provide a best-of-three-worlds algorithm that achieves regret bounds of O((log T )2) for stochastic environments, of ̃O( T ) for adversarial environments, and of O((log T )2 + C) for corrupted stochastic environments. √ √ √ Various types of low-level-adaptive algorithms have been considered for adversarial bandit problems. Representative examples are algorithms with ̃O( L∗)-regret, where L∗ represents the cumulative loss for the optimal action; such examples are said to have first-order regret bounds. In addition to such algorithms, Hazan and Kale [2011] proposed an algorithm with a second-order re- gret bound of ̃O( Q) that depends on the total quadratic variation Q of loss vectors. An algorithm by Ito [2021] achieves ̃O((cid:112)min{L∗, Q, P })-regret, which means that the algorithm simultane- ously has first-order and second-order bounds as well as a bound depending on the path-length P of the loss sequence. These regret bounds, which are referred to as data-dependent regret bounds, imply that algorithm performance can be improved by exploiting certain environmental character- istics that are common in applications, such as small variations in loss sequences or sparsity of loss. For the stochastic multi-armed bandit problem, Audibert et al. [2007] proposed an algorithm 1In standard stochastic settings, it is assumed that εt(a) follows a zero-mean distribution for all a ∈ A. Our proposed algorithm, however, works well under milder assumptions, details of which are given in Section 2.1 and Remark 3. 2 i( σ2 with an O((cid:80) but also on the variance σ2 they can be considered to represent low-level adaptability in stochastic regimes. + 1) log T )-regret bound that depended not only on the sub-optimality gap ∆i i of the loss. We refer to such bounds as variance-adaptive bounds, and i ∆i 1.1 Contribution of this work The main contribution of this paper is the proposal of a linear bandit algorithm that combines high- level adaptability and low-level adaptability. It is a BOTW algorithm that achieves regret bounds of O(log T ) in stochastic environments, ̃O( C log T ) in corrupted stochastic environments, ignoring factors depending on d, A and (cid:96)∗. Further, the al- gorithm achieves first-order, second-order, and path-length bounds in adversarial environments. Simultaneously, it has variance-adaptive regret bounds for (corrupted) stochastic environments. T ) in adversarial environments, and O(log T + √ √ The proposed algorithm (Algorithm 1) follows the approach of SCRiBLe [Abernethy et al., 2008a, 2012] which stands for Self-Concordant Regularization in Bandit Learning. This approach uses a class of functions known as self-concordant barriers [Nesterov and Nemirovskii, 1994] as regularizers. Self-concordant barriers are characterized with a parameter θ ≥ 1 that can be assumed to satisfy θ = O(d), details of which are given in Section 2.3. The regret bounds of our algorithm can be expressed with parameters explained in Table 1, including the parameter θ, as follows: (cid:16) Theorem 1 (informal). In adversarial environments with εt(a) = 0, the regret for Algorithm 1 is (cid:17) d(cid:112)θ min{T, Q, P } log T . Further, if ft(a) ≥ 0 for all a ∈ A and t ∈ [T ], bounded as RT = O √ we have RT = O (cid:0)d θL∗ log T (cid:1). In stochastic environments (i.e., if (cid:96)t = (cid:96)∗ for all t), we have (cid:16) . In corrupted stochastic environments with the corruption level RT = O (cid:113) C = (cid:80)T t=1 (cid:107)(cid:96)t − (cid:96)∗(cid:107)2, we have RT = O + 1)dθ log T + + 1)d2θ log T + 1)dθ log T ( dσ2 ∆min (cid:17) (cid:17) (cid:16) C * ( σ2 ∆min ( dσ2 ∆min . Table 2 provides a comparison of our regret bounds with those in existing studies. For stochas- tic settings, the tight asymptotic regret given A and (cid:96)∗ can be characterized with c∗ = c(A, (cid:96)∗), a definition of which can be found in, e.g., the paper by Lattimore and Szepesvari [2017]. They have provided an algorithm that achieves an asymptotically optimal regret bound of RT = c∗ log T + o(log T ). However, such asymptotically optimal algorithms are not necessarily optimal in envi- ronments with small variance σ2. In the case of c∗ = Ω , the proposed algorithm provides a better regret bound. We would also like to emphasize the fact that our stochastic regret bound includes only a single log T factor, while the bound by the BOTW algorithm of Lee et al. [2021] includes a (log T )2 factor. ( dσ2 ∆min + 1)dθ (cid:16) (cid:17) For adversarial environments, Ito [2021] has provided an algorithm with data-dependent regret bounds that depend on L∗, Q, and P simultaneously. In this regard, our regret bounds here have an dθ but are better in terms of the dependency w.r.t. log T . Our regret bounds additional factor of can be better than those with BOTW algorithm by Lee et al. [2021] if the loss sequence satisfies min{L∗, Q, P } = O (cid:0)T log(T |A|)/ dθ log T (cid:1). √ √ 3 Table 1: List of parameters in regret bounds. Parameter Description T ∈ N d ∈ N A ⊆ Rd θ ≥ 1 time horizon dimensionality of action set action set (One may assume log(|A|) = O(d log T ) w.l.o.g.) parameter of a self-concordant barrier ψ used in the algorithm (One can choose ψ so that θ = O(d)) ∆min > 0 minimum suboptimality gap: ∆min = mina∈A\{a∗} (cid:104)(cid:96)∗, a − a∗(cid:105) c∗ > 0 σ2 ≥ 0 L∗ ≥ 0 asymptotic lower bound parameter: c∗ = c(A, (cid:96)∗) = O(d/∆min) maximum variance of loss: σ2 = maxa∈A,t E [(ft(a) − (cid:104)(cid:96)∗, a(cid:105))2] minimum cumulative loss: L∗ = mina∗∈A E (cid:105) t=1 ft(a∗) (cid:104)(cid:80)T total quadratic variation in loss sequence: Q = min ̄(cid:96)∈Rd E (cid:105) (cid:104)(cid:80)T t=1 path-length of loss sequence: P = E (cid:104)(cid:80)T −1 t=1 (cid:107)(cid:96)t − (cid:96)t+1(cid:107)2 Q ≥ 0 P ≥ 0 (cid:105) (cid:13)(cid:96)t − ̄(cid:96)(cid:13) (cid:13) 2 (cid:13) 2 Table 2: Regret bounds for stochastic and adversarial linear bandits. Bounds depending on L∗ are applicable when ft(a) ≥ 0. Bounds depending on Q or P are applicable when εt(a) = 0. Algorithm Stochastic Bubeck et al. [2012] Abernethy et al. [2008a] Ito [2021] Lattimore and Szepesvari [2017] Lee et al. [2021] [This work] Adversarial (cid:17) (cid:16)(cid:112)dT log(|A|) O θT log T (cid:1) O (cid:0)d d(cid:112)min{T, L∗, Q, P }(log T )2(cid:17) √ (cid:16) O c∗ log T + o (log T ) O (c∗ log(T |A|) log T ) (cid:17) (cid:16) + 1)dθ log T ( dσ2 ∆min O (cid:16) O (cid:16)√ O dT log(T |A| log T ) d(cid:112)θ min{T, L∗, Q, P } log T (cid:17) (cid:17) For corrupted stochastic environments, the BOTW algorithm by Lee et al. [2021] achieves , where Rsto Rsto + RstoC √ (cid:16) (cid:17) (cid:17) a regret bound of O (cid:16) (cid:16) d log(T |A|) log T ∆min + 1)d2θ log T + C ( σ2 ∆min , while our bound is O (cid:17) √ . As RstoC ≤ 1 satisfies Rsto ≤ O 2(Rsto + C) follows from the AM- GM inequality, our algorithm also implies RT = O (Rsto + C), which is superior to the bound by Lee et al. [2021] when σ2 + ∆min = O . We would like to stress here that the impact of corruption on the performance of our algorithm is only of a square-root factor in C, while algorithms in existing studies [Lee et al., 2021, Li et al., 2019, Bogunovic et al., 2021] include at least a linear factor in C. Comparison of such results w.r.t. corrupted settings, however, requires particular care, as there are differences in the details of problem settings. (cid:16) log(T |A|) dθ (cid:17) Remark 1. In this paper, regret is defined in terms of loss including corruption, while existing 4 Figure 1: Illustration of scaled-up sampling. studies define regret in terms of loss without corruption. As the difference between these two notions of regret is at most O(C), our algorithm enjoys O (Rsto + C)-bound even in terms of the latter definition of regret. Such a difference in models has been discussed by Gupta et al. [2019]. The main innovations for achieving high-level adaptability (i.e., the BOTW property) are with regard to the sampling method for actions. In a previous study by Abernethy et al. [2008b], they compute a point xt in the convex hull conv(A) of the action set A using a follow-the-regularized- leader (FTRL) approach, and they then pick at from the Dikin ellipsoid W1(xt) ⊆ conv(A) that is defined from the self-concordant barrier for conv(A). Here, the action at must be sampled so that its expectation matches xt. In addition, the larger the variance of at, the better estimator ˆ(cid:96)t for (cid:96)t that we can construct, i.e., the smaller variance of ˆ(cid:96)t. In this paper, in order to improve the variance of the loss estimator, we introduce a new technique that we refer to as scaled-up sampling (see Figure 1). In this approach, we construct a scaled-up set W (cid:48) ⊆ conv(A) of the Dikin ellipsoid W1(xt) with a reference point zt ∈ A, for which we let αt ≥ 1 denote the scaling factor. Rather than sampling from W1(xt) as is done in the previous study, we pick at from W (cid:48) with probability α−1 , and otherwise set at = zt (the expectation of at then matches xt as well). Consequently, t the variance of at becomes αt times larger and the variance of the loss-vector estimator becomes α−1 times smaller, which contributes to the improvement of the regret upper bound. In stochastic t environments in particular, intuitively, xt approaches an extreme point (a truly optimal solution), allowing for a smaller W1(xt) and a larger value of αt, which leads to a significant improvement in regret. In proving the high-level adaptability, we use the self-bounding technique [Zimmert and Seldin, 2021, Wei and Luo, 2018]. We first show that the proposed algorithm, an FTRL method with scaled-up sampling and an adaptive learning rate, achieves a regret bound of RT = O d We further show that α−1 t = O(∆(xt)/∆min) holds in any stochastic environment, where ∆(xt) 5 (cid:18) (cid:113) θ (cid:80)T t=1 α−1 t (cid:19) . log T d (cid:18) (cid:19) (cid:113) θ (cid:80)T RT = O denotes the round-wise regret caused by choosing xt. Combining these two facts, we can obtain (cid:16) t=1 ∆(xt)∆−1 to RT = O(d2θ∆−1 min log T ) in stochastic environments. As has been done in previous analyses using the self-bounding technique, we can prove improved regret bounds for the stochastically constrained adversarial regime [Zimmert and Seldin, 2021] as well, which includes corrupted stochastic environments. , which immediately leads d(cid:112)θRT ∆−1 min log T min log T = O (cid:17) To achieve low-level adaptability (i.e., data-dependent bounds in adversarial environments and variance-adaptive bounds in stochastic environments), we employ the framework of optimistic online learning [Rakhlin and Sridharan, 2013]. This framework incorporates optimistic predic- tion mt for (cid:96)t into online learning algorithms, thereby providing regret bounds depending on ((cid:104)(cid:96)t − mt, at(cid:105))2 rather than ((cid:104)(cid:96)t, at(cid:105))2. The proposed algorithm determines mt by means of the technique of tracking the best linear predictor, which leads the hybrid data-dependent bounds and variance-adaptive bounds. Similar approaches can be found in [Ito, 2021, Ito et al., 2022]. 1.2 Limitation of this work and future work We should note the issue of computational complexity w.r.t. the proposed algorithm. In the proof of O(log T )-regret bounds for (corrupted) stochastic environments, we need the assumption that the reference point zt, illustrated in Figure 1, is chosen so that the scaling factor αt is (approximately) maximized. We have not, however, found an efficient method for computing such a point zt. A naive method for computing such a zt requires a computational time of at least Ω(|A|), which is highly expensive, e.g., as in most examples of combinatorial bandits [Cesa-Bianchi and Lugosi, 2012]. Resolving this issue of computational complexity will be important in future work. There is still some room for improvement in terms of regret bounds as well. As can be seen from Example 4 by Lattimore and Szepesvari [2017], the gap between c∗ and d/∆min can be arbitrarily large, which implies that our stochastic regret bound is much larger than the lower bound in the worst case. We also note that our regret bounds only hold in expectation while regret guarantees by Lee et al. [2021] hold with high probability. If we pursue high probability bounds as well, we cannot avoid an extra O(log T ) factor, as discussed in their Appendix D, 2 Preliminary 2.1 Problem setup This section introduces the setup of the linear bandit problems dealt with in this paper. Before a game starts, the player is given the time horizon T and an action set A ⊆ Rd, a closed and bounded set of d-dimensional vectors. Without loss of generality, we assume that A is not included in any proper affine subspace of Rd. We also assume that all points in A have L2 norm of at most 1, i.e., 2 (r) = {x ∈ Rd | (cid:107)x(cid:107)2 ≤ r}. A ⊆ Bd In each round t = 1, 2, . . . , T , the environment determines a loss function ft : A → [−1, 1], and the player then chooses an action at ∈ A without knowing ft. After that, the player observes the 2 (r) denotes an L2 ball of the radius r: Bd 2 (1), where Bd 6 incurred loss ft(at). The loss function ft can be chosen depending on the actions (as)t−1 so far. We assume that the conditional expectation of ft given (as)t−1 there exists (cid:96)t ∈ Rd, which is referred to as a loss vector, and ξt ∈ R such that ft is expressed as s=1 selected s=1 is an affine function, i.e., ft(a) = (cid:104)(cid:96)t, a(cid:105) + εt(a), where E (cid:2)εt(a)|(as)t−1 s=1 (cid:3) = ξt for all a ∈ A. (1) This paper also assumes that (cid:96)t ∈ Bd variety of regimes, as are discussed below: 2 (1). By imposing further conditions on ft, we can express a In a stochastic regime, it is assumed that ft follows an unknown distribution Stochastic regime D for all t ∈ [T ] independently. This assumption implies that (cid:96)t and ξt do not change over all rounds, i.e., there exists a true loss vector (cid:96)∗ ∈ Rd and ξ∗ such that (cid:96)t = (cid:96)∗ and ξt = ξ∗ hold for all t ∈ [T ]. Note here that standard stochastic settings also assume that functions of εt represent zero- mean noise, i.e., ξ∗ = 0. This assumption is, however, not necessary in the algorithm proposed in this paper. Moreover, the proposed algorithm does not even require the assumption that εt follows an identical distribution, details of which will be discussed in Section 4.1. In the adversarial regime, by way of contrast to the stochastic regime, Adversarial regime ((cid:96)t)T t=1 is an arbitrary sequence. More precisely, (cid:96)t can be chosen in an adversarial way depending on (as)t−1 s=1. Though adversarial environments considered in previous studies are often free from noise, i.e., εt(a) = 0 is assumed, most algorithms work well as long as the noise follows bounded zero-mean distributions. The proposed algorithm in this paper does not require this assumption as well. t=1 is subject to the constraint that (cid:80)T Stochastic regime with adversarial corruption The stochastic regime with adversarial corrup- tion is an intermediate regime between stochastic and adversarial regimes. It is parametrized by a true loss vector (cid:96)∗ ∈ Bd 2 (1) and by a corruption level C ≥ 0. In this regime, the sequence of t=1 (cid:107)(cid:96)t − (cid:96)∗(cid:107)2 ≤ C. This can be interpreted as a situation ((cid:96)t)T in which an adversary adds a corruption of ct = (cid:96)t − (cid:96)∗ to the loss function defined by (cid:96)∗ and the magnitude of ct sums up to C at most, i.e., (cid:80)T t=1 (cid:107)ct(cid:107)2 ≤ C. If we set the condition level C to zero, this regime coincides with the stochastic regime. On the other hand, if C = Ω(T ), then the regime is adversarial as there are no constraints on (cid:96)t except for (cid:107)(cid:96)t(cid:107)2 ≤ 1. 2.2 Follow the regularized leader In the proposed algorithm, we use the framework of (optimistic) follow-the-regularized-leader (FTRL) methods. In this framework, we choose a point xt in a closed convex set X ⊆ Rd by solving the following optimization problem: (cid:40)(cid:42) xt ∈ arg min mt + x∈X (cid:43) (cid:41) ˆ(cid:96)s, x + ψt(x) , t−1 (cid:88) s=1 (2) 7 where ˆ(cid:96)s is the (estimated) loss vector, mt ∈ Rd is an optimistic prediction, and ψt(x) is a reg- ularization term, which is a differentiable convex function over X . Note that the original FTRL framework here does not employ optimistic prediction, i.e., the value of mt is fixed to 0. The technique of optimistic prediction mt has been introduced to further improve the performance of FTRL, e.g., by Rakhlin and Sridharan [2013]. In the analysis of FTRL, we use the Bregman divergence Dψ associated with some differen- tiable convex function ψ defined as follows: Dψ(x, y) = ψ(x) − ψ(y) − (cid:104)∇ψ(y), x − y(cid:105) , (3) where ∇ψ(y) denotes the gradient of ψ at y. We can easily see that Dψ(x, y) ≥ 0 for any x and y, which follows from the convexity of ψ. The following lemma provides an upper bound of the regret for FTRL: Lemma 1. We assume that ψ1(x) ≥ 0 and ψt+1(x) ≥ ψt(x) hold for all x and t. If xt is given by (2), it holds for any x∗ ∈ int(X ) that (cid:68)ˆ(cid:96)t, xt − x∗(cid:69) ≤ T (cid:88) t=1 T (cid:88) t=1 (cid:16)(cid:68)ˆ(cid:96)t − mt, xt − ̃xt+1 (cid:69) − Dψt( ̃xt+1, xt) (cid:17) + ψT +1(x∗), (4) where ̃xt is defined by ̃xt ∈ arg minx∈X (cid:110)(cid:68)(cid:80)t−1 s=1 (cid:69) ˆ(cid:96)s, x + ψt(x) (cid:111) . This lemma can be shown via a standard analysis for FTRL, e.g., as in Chapter 28 of Lattimore and Szepesv ́ari [2019]. We can also refer to, e.g., the proof of Lemma 1 by Ito et al. [2022]. 2.3 Self-concordant barriers In our proposed algorithm, we use self-concordant barriers to define regularization terms, just as Abernethy et al. [2008b] did. Self-concordant barriers are defined as follows: Definition 1. A convex function ψ : int(X ) → R of class C 3 is called a self-concordant function if (i) |D3ψ(x)[h, h, h]| ≤ 2(D2ψ(x)[h, h])3/2 holds for any x ∈ int(A) and h ∈ Rd, and (ii) ψ(xi) tends to infinity along every sequence x1, x2, . . . ∈ int(X ) converging to a boundary point of int(X ), where Dkψ(x)[h1, . . . , hk] denotes the value of the k-th differential of ψ at x along the directions h1, . . . , hk. Let θ ≥ 0 be a non-negative real number. A self-concordant function ψ : int(X ) → R is called a θ-self-concordant barrier for X if |Dψ(x)[h]| ≤ θ1/2(D2ψ(x)[h, h])1/2 holds for any x ∈ int(X ) and h ∈ Rd. Remark 2. For any convex set X ⊆ Rd, there exists a d-self-concordant barrier for X [Lee and Yue, 2021]. This barrier is, however, not always efficiently computable. On the other hand, for any d-dimensional polytope, we can compute an θ-self-concordant barrier with θ = O(d) in polyno- mial time [Lee and Sidford, 2014, 2019]. 8 Given a self-concordant barrier ψ : int(X ) → R, for any x ∈ int(X ) and h ∈ Rd, we assume that ∇2ψ(x) has full rank. Denote (cid:107)h(cid:107)x,ψ = (cid:112)h(cid:62)∇2ψ(x)h, (cid:107)h(cid:107)∗ x,ψ = (cid:112)h(cid:62)(∇2ψ(x))−1h and define the Dikin's ellipsoid Wr(x) ⊆ Rd of ψ centered at x of the radius r > 0 as follows: Wr(x) = (cid:8)y ∈ Rd | (cid:107)y − x(cid:107)x,ψ ≤ r(cid:9) . (5) (6) The three lemmas below are used in the design and analysis of our proposed algorithm. Lemma 2 (Theorem 2.1.2 by Nesterov and Nemirovskii [1994]). If ψ is a self-concordant barrier for a closed convex set X , every Dikin's ellipsoid of ψ of radius 1 is contained in X , i.e., W1(x) ⊆ X holds for any x ∈ int(X ). Let πz,X (x) denote the Minkowsky function of X whose pole is at z: πz,X (x) = inf (cid:8)r > 0 | z + r−1(x − z) ∈ X (cid:9) . (7) We have an upper bound on ψ expressed with this Minkowsky function, as follows: Lemma 3 (Propositoin 2.3.2 by Nesterov and Nemirovskii [1994]). If ψ is a θ-self-concordant barrier for X , it holds for any x and y in int(X ) that ψ(x) ≤ ψ(y) + θ log 1 1−πy,X (x) . If we use a self-concordant barrier ψ, we can use the following lemma to bound the stability (cid:16)(cid:68)ˆ(cid:96)t − mt, xt − x(cid:48) in Lemma 1. − Dψt(x(cid:48) t+1, xt) t+1 (cid:69) (cid:17) term Lemma 4. Let ψ be a self-concordant function on X and x, y ∈ int(X ). Let β > 0 and (cid:96) ∈ Rd. Suppose that (cid:107)(cid:96)(cid:107)∗ x,ψ ≤ β/3. We then have (cid:104)(cid:96), x − y(cid:105) − βDψ(y, x) ≤ 2 x,ψ. β (cid:107)(cid:96)(cid:107)∗2 3 Algorithm Let X be the convex hull of A and ψ be a θ-self-concordant barrier for X . In the proposed algorithm, we compute xt by solving the optimization problem (2) with ψt(x) = βtψ(x), where βt is a learning rate parameter satisfying 6d ≤ β1 ≤ β2 ≤ * * * . The manner of computing at, ˆ(cid:96)t, mt, and βt will be presented below. Action at and unbiased estimator ˆ(cid:96)t for loss vector After computing xt, we choose the action at ∈ A so that E[at|xt] = xt. Let {e1, . . . , ed} and {λ1, . . . , λd} be the set of eigenvectors and eigenvalues of ∇2ψ(xt). Define Et := {xt + λ−1/2 ei | i ∈ [d]}. Note i that here Et ⊆ X holds since Et ⊆ W1(xt) follows from the definition of Et and since W1(x) ⊆ X follows from Lemma 2. In the algorithm by Abernethy et al. [2008b], the action at is chosen from Et uniformly at random. Unlike this existing method, our proposed algorithm chooses an action ei | i ∈ [d]} ∪ {xt − λ−1/2 i 9 from a set E (cid:48) probability. More precisely, after computing Et and choosing a point zt ∈ A, we set E (cid:48) t scaled up from Et with a reference point zt ∈ A, or chooses at = zt with some t by E (cid:48) t = {zt + αt(x − zt) | x ∈ Et} , (8) where αt ≥ 1 is defined as the largest real number such that E (cid:48) is discussed in the next pragraph. If we denote rt = α−1 rt = inf (cid:8)r > 0 | zt + r−1 t (x − zt) ∈ X (x ∈ Et)(cid:9) = max t is included in X . How to choose zt t ∈ (0, 1], we can express rt as follows: πzt,X (x), (9) x∈Et t denote the center of E (cid:48) where π is the Minkowsky function defined by (7). We choose zt ∈ A so that the value of rt is as small as possible. Let x(cid:48) t (xt − zt). We then set bt = 1 with probability rt and bt = 0 with probability 1 − rt. If bt = 0, we choose a(cid:48) t = zt. If bt = 1, we choose a(cid:48) t uniformly at random. In other words, we pick it uniformly at random t = zt + r−1 from [d] and vt = ±1 with probability 1/2, and set a(cid:48) eit − zt). We then it output at ∈ A so that its expectation coincides with a(cid:48) t ∈ X = conv(A). After obtaining feedback of ft(at), we define ˆ(cid:96)t by t (xt + vtλ−1/2 t, i.e., define x(cid:48) t = zt + r−1 t from E (cid:48) ˆ(cid:96)t = mt + dbtvtλ1/2 (10) We can show that the conditional expectation of at is equal to xt and that ˆ(cid:96)t is an unbiased estimator of (cid:96)t, i.e., we have E [at|xt] = xt and E[ˆ(cid:96)t|xt] = (cid:96)t, proofs of which are given in Section D in the appendix. We note that, thanks to the scaled-up sampling, the mean square of ˆ(cid:96)t − mt is improved by a factor of 1/αt, which plays a central role in our proof of BOTW regret bounds. it (ft(at) − (cid:104)mt, at(cid:105))eit. Reference point zt We will see that the smaller value of rt is, the smaller variance of ˆ(cid:96)t − mt is, resulting in an improvement in regret. To take maximum advantage of this effect, we choose zt so that rt is as small as possible. More precisely, for a constant κ ≥ 1, we assume that zt satisfies πzt,X (x) ≤ κ * min z∈A rt = max x∈Et πz,X (x) max x∈Et (11) for all t ∈ [T ]. This assumption is used in our proof of O(log T )-regret in stochastic environments. Learning rate parameter βt the proposed algorithm is bounded as RT = O is defined as In the regret analysis in Section 4, we will show that the regret for , where gt(m) + βT +1θ log T (cid:104) d2 (cid:80)T (cid:105)(cid:17) E (cid:16) gt(mt) βt t=1 gt(m) = bt * ((cid:104)at, m(cid:105) − ft(at))2 . (cid:68)ˆ(cid:96)t − mt, xt − ̃xt+1 (cid:69) (12) Intuitively, gt(mt)/βt comes from the part of − Dψt( ̃xt+1, xt) in (4), which is called stability terms, and βT +1 log T comes from the part of ψT +1(x∗), called penalty terms. To balance stability and penalty terms, we set βt by βt = 6d + 2d , (13) which leads to RT = O d E (cid:18) (cid:20)(cid:113) θ log T * (cid:80)T (cid:115)(cid:80)t−1 s=1 gs(ms) θ log T (cid:21) t=1 gt(mt) + d log T (cid:19) . 10 Optimistic prediction mt To minimize the part of (cid:80)T projected gradient descent for gt. We set m1 = 0 and update mt as follows: t=1 gt(mt), we choose mt by using online m(cid:48) t+1 = mt − ηbt * ((cid:104)at, mt(cid:105) − ft(at))at, mt+1 = min (cid:26) 1, (cid:27) 1 (cid:107)m(cid:48) t+1(cid:107)2 m(cid:48) t+1, (14) where η ∈ (0, 1/4) is the learning rate parameter for updating mt. The proposed algorithm can be summarized as Algorithm 1 in Section B in the appendix. Computational complexity The procedure in each round can be performed in polynomial time in d, except for the computation of zt. Indeed, given a self-concordant barrier for X , we can solve an arbitrary linear optimization problem over X (and thus also over A), with the aid of, e.g., interior point methods [Nesterov and Nemirovskii, 1994]. This implies that convex optimization problems (2) can be solved in polynomial time as well. Futher, for any a(cid:48) t ∈ X , we can find an expression of convex combination of points in A in polynomial time [Mirrokni et al., 2017, Schrijver, 1998, Corollary 11.4], which means that we can randomly choose at ∈ A so that E[at|a(cid:48) t. As for the calculation of zt satisfying (11), it is not clear if there is a computationally efficient way at this point. Because we can compute the value of maxx∈Et πz,X (x) for any z ∈ A in polynomial time in d, we can find zt minimizing this value in O(poly(d)|A|) time, which can be exponential in d. t] = a(cid:48) 4 Analysis 4.1 Regret bounds for the proposed algorithm Theorem 2 (Regret bounds in the adversarial regime). Let L∗, Q and P be parameters defined as in Table 1. The regret for Algorithm 1 is bounded as  RT = O d (cid:118) (cid:117) (cid:117) (cid:116)θ log T (cid:32) min {Q, P } + E (cid:34) T (cid:88) (εt(at))2 (cid:35)(cid:33)  + dθ log T  . (15) Further, if ft(a) ≥ 0 for any a ∈ A and t ∈ [T ], we have t=1 RT = O (cid:16) d(cid:112)θL∗ log T + dθ log T (cid:17) . (16) Note that the regret bounds in Theorem 2 are valid regardless of the choice of zt. In fact, we can demonstrate these regret bounds even if we sample at from Et, as is similarly done with the algorithm by Abernethy et al. [2008b], which corresponds to rt = 1. By way of contrast, to show O(log T )-regret bounds for stochastic environments, we need the assumption of (11). Under this assumption, we have the following regret bounds: Theorem 3 (Regret bounds in the corrupted stochastic regime). Let (cid:96)∗ ∈ Rd and denote C = (cid:80)T t=1 (cid:107)(cid:96)t − (cid:96)∗(cid:107)2. Define a∗ ∈ arg mina∈A (cid:104)(cid:96)∗, a(cid:105) and ∆min = mina∈A\{a∗} (cid:104)(cid:96)∗, a − a∗(cid:105). We have 11 (cid:18) (cid:114)(cid:16) C + (cid:80)T (cid:17) (cid:19) d RT = O Further, if a∗ ∈ arg mina∈A (cid:104)(cid:96)∗, a(cid:105) exists uniquely, under the assumption of (11), we have θ log T + dθ log T , where we define σ2 t=1 σ2 t t = maxa∈A E[(εt(a))2]. RT (a∗) = O (cid:32)(cid:18) κdσ2 ∆min (cid:19) + 1 dθ log T + (cid:115)(cid:18) κσ2 ∆min (cid:19) + 1 (cid:33) Cd2θ log T , (17) where σ2 = maxt∈[T ] σ2 t . Remark 3. In standard settings of the stochastic regime, it is assumed that ft follows an identical distribution for different rounds and E[εt(a)|(as)t−1 s=1] = 0 for all a. Such assumptions are not, however, needed in Theorem 3. In other words, even when ξt = E[εt(a)|(as)t−1 s=1] is non-zero and changes depending on t, we still have the O(log T )-regret bounds given in Theorem 3. 4.2 Proof sketch Regret bounds in Theorems 2 and 3 are derived from the following lemma: Lemma 5. The regret for Algorithm 1 is bounded as follows:  RT = O d * E (cid:118) (cid:117) (cid:117) (cid:116)θ log T     gt(mt)  + dθ log T  . (18) T (cid:88) t=1 In proving this lemma, we use Lemmas 1, 3 and 4. From Lemma 4, the stability term (cid:68)ˆ(cid:96)t − mt, xt − ̃xt+1 (cid:69) − (cid:107)ˆ(cid:96)t − mt(cid:107)∗2 Dψt( ̃xt+1, xt) in Lemma 1 is bounded by 2 d2gt(mt). From Lemma 3, we can βt bound the penalty term ψT +1(x∗) in Lemma 1 as ψT +1(x∗) ≤ βT +1θ log T . Combining these bounds, we obtain RT = O . From this and the definition of βt given in (13), we have the regret bound in Lemma 5. A complete proof of this lemma is given in Section D in the appendix. + βT +1θ log T x,ψ = 2 βt d2 (cid:80)T gt(mt) βt (cid:105)(cid:17) t=1 E (cid:16) (cid:104) From the result of tracking linear experts [Herbster and Warmuth, 2001], we obtain the follow- ing upper bound on (cid:80)T t=1 gt(mt). Lemma 6. If mt is given by (14), it holds for any sequence (ut)T +1 t=1 ∈ (Bd 2 (1))T +1 that T (cid:88) t=1 gt(mt) ≤ 1 1 − 2η T (cid:88) t=1 gt(ut) + 1 η(1 − 2η) (cid:32)√ 2 T (cid:88) t=1 (cid:107)ut+1 − ut(cid:107)2 + (cid:33) (cid:107)uT +1(cid:107)2 2 . (19) 1 2 This lemma is a special case of Theorem 11.4 by Cesa-Bianchi and Lugosi [2006]. 12 Proof sketch of Theorem 2 By substituting ut = ̄(cid:96) ∈ arg min(cid:96) (cid:105) t=1(εt(at))2(cid:105) + 1 t=1 gt(mt) (19), we obtain E (cid:16) (cid:105) = O t=1 gt(mt) Q + E (cid:104)(cid:80)T (cid:104)(cid:80)T (cid:104)(cid:80)T = O (cid:16) (cid:80)T (cid:17) t=1 (cid:107)(cid:96)t − (cid:96)(cid:107)2 2 for all t in . Similarly, by substitut- (cid:17) t=1(εt(at))2(cid:105) (cid:104)(cid:80)T + 1 ing ut = (cid:96)t for all t in (19), we obtain E . Combining these with Lemma 5, we obtain (15) in Theorem 2. Further, if ft(a) ≥ 0, by substi- = O (L∗ + RT + 1), which leads to a regret bound of tuting ut = 0, we obtain E (cid:17) t=1 gt(mt) P + E (cid:104)(cid:80)T (cid:16) (cid:105) RT = O d(cid:112)θ log T (L∗ + RT ) + dθ log T . This implies that (16) in Theorem 2 holds. Proof sketch of Theorem 3 By setting ut = (cid:96)∗ for all t in (19), we obtain E (cid:104) (cid:16) E C + (cid:80)T t=1 rtσ2 t + 1 (cid:105)(cid:17) O O (cid:113) (cid:18) d (C + (cid:80)T t=1 σ2 t )θ log T + dθ log T . As we have rt ≤ 1, from this bound and Lemma 5, we have RT = (cid:19) . We also have the following regret bound: (cid:104)(cid:80)T t=1 gt(mt) (cid:105) =  RT = O d (cid:32) (cid:118) (cid:117) (cid:117) (cid:116) C + σ2 E (cid:34) T (cid:88) t=1 (cid:35)(cid:33) rt θ log T + dθ log T From the assumption of (11), rt is bounded as (cid:26) (cid:27) (cid:26)   . (cid:27) rt ≤ κ * min z∈A max x∈Et πz,X (x) ≤ κ * min z∈A max x∈W1(xt) πz,X (x) , (20) (21) where the second inequality follows from Et ⊆ W1(xt). The following lemma provides an upper bound on the right-hand side of this: Lemma 7. Suppose a∗ ∈ arg mina∈A (cid:104)(cid:96)∗, a(cid:105) uniquely exists. It holds for any y ∈ int(X ) that max x∈W1(y) πa∗,X (x) ≤ 2 ∆(y) ∆min , where ∆(y) = (cid:104)(cid:96)∗, y − a∗(cid:105) , ∆min = min a∈A\{a∗} ∆(a). (22) By combining this lemma with (20) and (21), we obtain a bound depending on (cid:80)T t=1 ∆(xt) as follows: RT = O d C + κσ2 ∆min E (cid:18) (cid:114)(cid:16) regret is bounded from below as RT (a∗) ≥ E on RT , we obtain (cid:104)(cid:80)T (cid:105)(cid:17) t=1 ∆(xt) (cid:104)(cid:80)T (cid:105) t=1 ∆(xt) θ log T + dθ log T . On the other hand, (cid:19) −2C. By combining these two bounds RT (a∗) = O (cid:32) (cid:115) (cid:18) d θ log T * C + (cid:19) (cid:33) (RT + C) + dθ log T κσ2 ∆min (cid:32) (cid:115) = O d θκσ2 log T ∆min RT (a∗) + d (cid:115)(cid:18) κσ2 ∆min (cid:19) (cid:33) + 1 Cθ log T + dθ log T . 13 As X = O( √ AX + B) implies X = O(A + B), we have RT (a∗) = O (cid:32) d2θκσ2 log T ∆min (cid:115)(cid:18) κσ2 ∆min + d (cid:19) + 1 Cθ log T + dθ log T (cid:33) = O (cid:32)(cid:18) dκσ2 ∆min (cid:19) + 1 dθ log T + d (cid:115)(cid:18) κσ2 ∆min (cid:19) (cid:33) + 1 Cθ log T , which means that (17) holds. A complete proof is given in Section G of the appendix. References J. Abernethy, E. E. Hazan, and A. Rakhlin. Competing in the dark: An efficient algorithm for bandit linear optimization. In 21st Annual Conference on Learning Theory, COLT 2008, pages 263–273, 2008a. J. D. Abernethy, E. Hazan, and A. Rakhlin. An efficient algorithm for bandit linear optimization. In 21st Annual Conference on Learning Theory, 2008b. J. D. Abernethy, E. Hazan, and A. Rakhlin. Interior-point methods for full-information and bandit online learning. IEEE Transactions on Information Theory, 58(7):4164–4175, 2012. J.-Y. Audibert, R. Munos, and C. Szepesv ́ari. Tuning bandit algorithms in stochastic environments. In Algorithmic Learning Theory: 18th International Conference, ALT 2007, Sendai, Japan, October 1-4, 2007. Proceedings 18, pages 150–165. Springer, 2007. I. Bogunovic, A. Losalka, A. Krause, and J. Scarlett. Stochastic linear bandits robust to adversarial In International Conference on Artificial Intelligence and Statistics, pages 991–999. attacks. PMLR, 2021. S. Bubeck and A. Slivkins. The best of both worlds: Stochastic and adversarial bandits. In Conference on Learning Theory, pages 42–1. JMLR Workshop and Conference Proceedings, 2012. S. Bubeck, N. Cesa-Bianchi, and S. Kakade. Towards minimax policies for online linear optimiza- tion with bandit feedback. In Conference on Learning Theory, volume 23, pages 41.1–41.14, 2012. N. Cesa-Bianchi and G. Lugosi. Prediction, learning, and games. Cambridge university press, 2006. N. Cesa-Bianchi and G. Lugosi. Combinatorial bandits. Journal of Computer and System Sciences, 78(5):1404–1422, 2012. L. Erez and T. Koren. Towards best-of-all-worlds online learning with feedback graphs. Advances in Neural Information Processing Systems, 34, 2021. 14 D. J. Foster, C. Gentile, M. Mohri, and J. Zimmert. Adapting to misspecification in contextual bandits. In Advances in Neural Information Processing Systems, pages 11478–11489, 2020. A. Gupta, T. Koren, and K. Talwar. Better algorithms for stochastic bandits with adversarial cor- ruptions. In Conference on Learning Theory, pages 1562–1578. PMLR, 2019. E. Hazan and S. Kale. Better algorithms for benign bandits. Journal of Machine Learning Re- search, 12(4), 2011. M. Herbster and M. K. Warmuth. Tracking the best linear predictor. Journal of Machine Learning Research, 1(281-309):10–1162, 2001. J. Honda, S. Ito, and T. Tsuchiya. Follow-the-Perturbed-Leader Achieves Best-of-Both-Worlds for Bandit Problems. In S. Agrawal and F. Orabona, editors, Proceedings of The 34th International Conference on Algorithmic Learning Theory, volume 201 of Proceedings of Machine Learning Research, pages 726–754. PMLR, 20 Feb–23 Feb 2023. S. Ito. Hybrid regret bounds for combinatorial semi-bandits and adversarial linear bandits. Ad- vances in Neural Information Processing Systems, 34:2654–2667, 2021. S. Ito, T. Tsuchiya, and J. Honda. Adversarially robust multi-armed bandit algorithm with variance- dependent regret bounds. In Conference on Learning Theory, pages 1421–1422. PMLR, 2022. T. Jin and H. Luo. Simultaneously learning stochastic and adversarial episodic mdps with known transition. Advances in Neural Information Processing Systems, 33:16557–16566, 2020. T. Jin, L. Huang, and H. Luo. The best of both worlds: stochastic and adversarial episodic mdps with unknown transition. Advances in Neural Information Processing Systems, 34, 2021. S. K. Krishnamurthy, V. Hadad, and S. Athey. Adapting to misspecification in contextual bandits with offline regression oracles. In International Conference on Machine Learning, pages 5805– 5814, 2021. T. Lattimore and C. Szepesvari. The end of optimism? an asymptotic analysis of finite-armed linear bandits. In Artificial Intelligence and Statistics, pages 728–737. PMLR, 2017. T. Lattimore and C. Szepesv ́ari. Bandit algorithms. preprint, Revision: 1699, 2019. T. Lattimore, C. Szepesvari, and G. Weisz. Learning with good feature representations in bandits In International Conference on Machine Learning, pages and in rl with a generative model. 5662–5670, 2020. C.-W. Lee, H. Luo, C.-Y. Wei, M. Zhang, and X. Zhang. Achieving near instance-optimality and minimax-optimality in stochastic and adversarial linear bandits simultaneously. In International Conference on Machine Learning, pages 6142–6151. PMLR, 2021. 15 Y. T. Lee and A. Sidford. Path finding methods for linear programming: Solving linear programs In 2014 IEEE 55th Annual in o (vrank) iterations and faster algorithms for maximum flow. Symposium on Foundations of Computer Science, pages 424–433. IEEE, 2014. Y. T. Lee and A. Sidford. Solving linear programs with sqrt (rank) linear system solves. arXiv preprint arXiv:1910.08033, 2019. Y. T. Lee and M.-C. Yue. Universal barrier is n-self-concordant. Mathematics of Operations Research, 46(3):1129–1148, 2021. Y. Li, E. Y. Lou, and L. Shan. Stochastic linear optimization with adversarial corruption. arXiv preprint arXiv:1909.02109, 2019. T. Lykouris, V. Mirrokni, and R. Paes Leme. Stochastic bandits robust to adversarial corruptions. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pages 114–122, 2018. T. Lykouris, M. Simchowitz, A. Slivkins, and W. Sun. Corruption-robust exploration in episodic reinforcement learning. In Conference on Learning Theory, pages 3242–3245, 2021. V. Mirrokni, R. P. Leme, A. Vladu, and S. C.-w. Wong. Tight bounds for approximate carath ́eodory and beyond. In International Conference on Machine Learning, pages 2440–2448. PMLR, 2017. A. Nemirovski. Interior point polynomial time methods in convex programming. Lecture notes, 42(16):3215–3224, 2004. Y. Nesterov and A. Nemirovskii. Interior-point polynomial algorithms in convex programming. SIAM, 1994. A. Pacchiano, M. Phan, Y. Abbasi Yadkori, A. Rao, J. Zimmert, T. Lattimore, and C. Szepesvari. Model selection in contextual stochastic bandit problems. In Advances in Neural Information Processing Systems, pages 10328–10337, 2020. A. Rakhlin and K. Sridharan. Online learning with predictable sequences. In Conference on Learning Theory, pages 993–1019. PMLR, 2013. A. Schrijver. Theory of linear and integer programming. John Wiley & Sons, 1998. Y. Seldin and A. Slivkins. One practical algorithm for both stochastic and adversarial bandits. In International Conference on Machine Learning, pages 1287–1295. PMLR, 2014. K. Takemura, S. Ito, D. Hatano, H. Sumita, T. Fukunaga, N. Kakimura, and K.-i. Kawarabayashi. A parameter-free algorithm for misspecified linear contextual bandits. In International Conference on Artificial Intelligence and Statistics, pages 3367–3375, 2021. 16 T. Tsuchiya, S. Ito, and J. Honda. Best-of-both-worlds algorithms for partial monitoring. In S. Agrawal and F. Orabona, editors, Proceedings of The 34th International Conference on Al- gorithmic Learning Theory, volume 201 of Proceedings of Machine Learning Research, pages 1484–1515. PMLR, 20 Feb–23 Feb 2023a. T. Tsuchiya, S. Ito, and J. Honda. Further adaptive best-of-both-worlds algorithm for combinato- rial semi-bandits. In International Conference on Artificial Intelligence and Statistics. PMLR, 2023b. C.-Y. Wei and H. Luo. More adaptive algorithms for adversarial bandits. In Conference On Learn- ing Theory, pages 1263–1291. PMLR, 2018. L. Yang, M. Hajiesmaili, M. S. Talebi, J. C. S. Lui, and W. S. Wong. Adversarial bandits with corruptions: Regret lower bound and no-regret algorithm. In Advances in Neural Information Processing Systems, volume 33, pages 19943–19952, 2020. J. Zimmert and Y. Seldin. Tsallis-inf: An optimal algorithm for stochastic and adversarial bandits. Journal of Machine Learning Research, 22(28):1–49, 2021. J. Zimmert, H. Luo, and C.-Y. Wei. Beating stochastic and adversarial semi-bandits optimally and simultaneously. In International Conference on Machine Learning, pages 7683–7692. PMLR, 2019. 17 A Related Work Best-of-Both-Worlds Bandit Algorithms Best-of-both-worlds algorithms have been developed for various settings of multi-armed bandit (MAB) problems, including the standard MAB problem [Bubeck and Slivkins, 2012, Seldin and Slivkins, 2014, Zimmert and Seldin, 2021, Ito et al., 2022, Honda et al., 2023], combinatorial semi-bandits [Zimmert et al., 2019, Ito, 2021, Tsuchiya et al., 2023b], partial monitoring problems [Tsuchiya et al., 2023a], episodic Markov decision processes [Jin and Luo, 2020, Jin et al., 2021], and linear bandits [Lee et al., 2021]. While most of these studies focuses only on high-level adaptability, the algorithms by Ito et al. [2022], Tsuchiya et al. [2023a] for the MAB problem and combinatorial semi-bandit problems have low-level adaptability In fact, their algorithms are best-of-three-worlds as well, similarly to our proposed algorithm. algorithms with multiple data-dependent regret bounds as well as variance-adaptive regret bounds. Their algorithms are also similar to ours in that it is based on the optimistic follow-the-regularizer approach with an adaptive learning rate. As the class of linear bandits problem includes the multi- armed bandit problem, the results in this paper can be interpreted as an extension of their results. Regret bounds by Ito et al. [2022] are, however, better than ours in terms of the dependency on the dimensionality of the action set (or the number of arms) and in that they depend on arm-wise sub-optimality gaps. Adversarial Corruption There are several studies on the stochastic environment with adversar- ial corruption in the linear bandit problem [Li et al., 2019, Bogunovic et al., 2021, Lee et al., 2021] and the sibling problems such as the multi-armed bandits [Lykouris et al., 2018, Gupta et al., 2019, Zimmert and Seldin, 2021, Yang et al., 2020] and the linear Markov decision processes [Lykouris et al., 2021]. These studies and this paper have different assumptions and regret. This paper and Lee et al. [2021] assume that corruption depends only on information in the past rounds and is an affine function of the chosen action. On the other hand, Li et al. [2019], Bogunovic et al. [2021] allow corruption to be any (possibly non-linear) function. Furthermore, Bogunovic et al. [2021] consider the corruption that depends on the action chosen in that round. We also note that the definitions of the corruption level in these studies are slightly different. While this paper includes the corruption in regret, Li et al. [2019], Bogunovic et al. [2021], Lee et al. [2021] do not. It is known that we can convert one to the other by an additional O(C)-regret. Moreover, the regret bounds in these existing studies have linear terms with respect to C. Thus, our regret bound for the corrupted stochastic regime have the same dependence of the corruption as in these studies, but not vice versa. Misspecified Linear Contextual Bandits The corrupted stochastic regime is a special case of the misspecified linear contextual bandits without knowledge of the misspecification [Lattimore et al., 2020, Foster et al., 2020, Pacchiano et al., 2020, Takemura et al., 2021, Krishnamurthy et al., 2021].2 This problem assumes that the expected loss functions can be approximated by a linear function. While the approximation error can be any function of the information in the past and the 2Note that some studies assume oblivious adversary [Lattimore et al., 2020, Foster et al., 2020, Krishnamurthy et al., 2021], i.e., the approximation errors do not depend on the actions chosen in the past. 18 current rounds in general, the corrupted stochastic regime assumes that the approximation error is an affine function of the action chosen in the current round. It is an open question whether the proposed algorithm can obtain a regret upper bound similar to the known regret bounds for this problem when the approximation error can be non-linear. B Pseudocode of the proposed algorithm Algorithm 1 Require: T : time horizon, d: dimensionality of action set, A ⊆ Rd: action set, ψ: self-concordant barrier over X = conv(A), θ ≥ 1: self-concordance parameter of ψ, η ∈ (0, 1/4): learning rate for optimistic prediction 1: Set m1 = 0. 2: for t = 1, 2, . . . , T do 3: 4: Set βt by (13) and compute xt defined by (2). Let {e1, . . . , ed} and {λ1, . . . , λd} be the set of eigenvectors and eigenvalues of ∇2ψ(xt) and set Et := {xt + λ−1/2 Choose zt ∈ A and set rt ∈ (0, 1] by (9). Set bt = 1 with probability rt and set bt = 0 with probability (1 − rt). if bt = 1 then ei | i ∈ [d]} ∪ {xt − λ−1/2 ei | i ∈ [d]}. i i Choose it from [d] uniformly at random and set vt ± 1 with probability 1/2. Set a(cid:48) t (xt + vtλ−1/2 t = zt + r−1 eit − zt). it Set a(cid:48) t = zt. end if Output at ∈ A so that E[at] = a(cid:48) Compute ˆ(cid:96)t defined by (10) and update mt by (14). t and get feedback of ft(at). 5: 6: 7: 8: else 9: 10: 11: 12: 13: 14: 15: end for C Proof of Lemma 4 For the convex function ψ and x ∈ dom(ψ), denote the Newton decrement at point x by λ(x, ψ), i.e., λ(x, ψ) = (cid:107)∇ψ(x)(cid:107)∗ x,ψ. Lemma 8 (Theorem 2.2.1 by Nesterov and Nemirovskii [1994]). Let S be an open non-empty convex subset of a finite-dimensional real vector space. Let ψ be a self-concordant function on S and x ∈ S. Then, for each y ∈ S such that (cid:107)x − y(cid:107)x,ψ < 1, we have (1 − (cid:107)x − y(cid:107)x,ψ)2∇2ψ(y) (cid:22) ∇2ψ(x) (cid:22) (1 − (cid:107)x − y(cid:107)x,ψ)−2∇2ψ(y) 19 Lemma 9 ((2.21) by Nemirovski [2004]). Let ψ be a self-concordant function on X . If λ(x, ψ) < 1, we have (cid:107)x − x∗(cid:107)x,ψ ≤ λ(x, ψ) 1 − λ(x, ψ) , where x∗ ∈ arg miny ψ(y). Lemma 10. Let ψ be a self-concordant function on X and x, y ∈ int(X ). Suppose that (cid:107)x − y(cid:107)x,ψ ≤ 1/2. Then, we have (cid:104)(cid:96), x − y(cid:105) − βDψ(y, x) ≤ 2 β (cid:107)(cid:96)(cid:107)∗2 x,ψ for all (cid:96) ∈ Rd and β > 0. Proof. Using the Cauchy-Schwarz inequality and the AM-GM inequality, we have (cid:104)(cid:96), x − y(cid:105) ≤ (cid:107)(cid:96)(cid:107)∗ x,ψ(cid:107)x − y(cid:107)x,ψ ≤ 2 β (cid:107)(cid:96)(cid:107)∗2 x,ψ + β 8 (cid:107)x − y(cid:107)2 x,ψ. Thus, it is sufficient to show Dψ(y, x) ≥ 1 By Taylor's theorem, we have Dψ(y, x) = 1 8(cid:107)x − y(cid:107)2 x,ψ. 2(cid:107)x − y(cid:107)2 α ∈ (0, 1). It follows from Lemma 8 that ξ,ψ for some ξ = x + α(y − x) where (cid:107)x − y(cid:107)2 ξ,ψ ≥ (1 − (cid:107)ξ − x(cid:107)x,ψ)2(cid:107)x − y(cid:107)2 x,ψ = (1 − α(cid:107)x − y(cid:107)x,ψ)2(cid:107)x − y(cid:107)2 x,ψ ≥ 1 4 (cid:107)x − y(cid:107)2 x,ψ. Proof of Lemma 4 Let f (y) = Dψ(y, x) − (cid:104)(cid:96), x − y(cid:105)/β. Since ψ is self-concordant, there exists y∗ ∈ int(X ) such that y∗ ∈ arg miny∈X f (y). If we have λ(x, f ) ≤ 1/3, by Lemma 9, we obtain (cid:107)x − y∗(cid:107)x,ψ = (cid:107)x − y∗(cid:107)x,f ≤ λ(x, f ) 1 − λ(x, f ) ≤ 1/2. Thus, we obtain (cid:104)(cid:96), x − y(cid:105) − βDψ(y, x) ≤ (cid:104)(cid:96), x − y∗(cid:105) − βDψ(y∗, x) ≤ 2 β (cid:107)(cid:96)(cid:107)∗2 x,ψ, where the first inequality holds due to y∗ ∈ arg miny∈X f (y) and the second inequality is derived from Lemma 10. Hence, it suffices to show λ(x, f ) ≤ 1/3. By the definition of f , we have ∇f (x) = (cid:96)/β. Thus, we obtain λ(x, f ) = (cid:107)∇f (x)(cid:107)∗ x,f = (cid:107)∇f (x)(cid:107)∗ x,ψ = (cid:107)(cid:96)(cid:107)∗ x,ψ/β ≤ 1/3, where the inequality is obtained by the assumption. 20 D Proof of Lemma 5 We first show that E [at|xt] = xt. The expectation of at is E[at|xt] = E[a(cid:48) t|xt] = (1 − rt) E[a(cid:48) (cid:104) = (1 − rt) zt + rt E = (1 − rt) zt + rt(zt + r−1 zt + r−1 t|bt = 0] + rt E[a(cid:48) (cid:16) xt + vtλ−1/2 t|bt = 1] eit − zt (cid:17)(cid:105) t it t (xt − zt)) = zt + (xt − zt) = xt, (23) where the forth equality follows from E[vt] = 0. Let us next show that ˆ(cid:96)t defined by (10) is an unbiased estimator of (cid:96)t. We have (cid:104)ˆ(cid:96)t − mt|xt (cid:104) dvtλ1/2 it (ft(at) − (cid:104)mt, at(cid:105))eit it ((cid:104)(cid:96)t − mt, at(cid:105) + ξt)eit (cid:104) dvtλ1/2 = rt E (cid:105) (cid:105) (cid:105) = rt E E = rt E (cid:104) dvtλ1/2 it eit (cid:68) zt + r−1 t (xt + vtλ−1/2 it (cid:104) (cid:68) dvtλ1/2 = rt E = d E (cid:2)eite(cid:62) t vtλ−1/2 r−1 it eit it it ((cid:96)t − mt)(cid:3) = (cid:96)t − mt, (cid:69)(cid:105) eit − zt), (cid:96)t − mt (cid:69)(cid:105) (cid:104) dvtλ1/2 it eit eit, (cid:96)t − mt + rt E (cid:10)zt + r−1 t (xt − zt), (cid:96)t − mt (cid:11)(cid:105) (24) where we used v2 t = 1, E[vt] = 0, and the fact that vt and mt are independent in the fifth equality. Suppose that minx∈X ψ(x) = 0 holds without loss of generality. Let x0 ∈ arg minx∈X ψ(x). Given a∗ ∈ A, define x∗ by (cid:18) 1 − x∗ = (cid:19) 1 T a∗ + 1 T x0 = a∗ + (x0 − a∗). 1 T (cid:35) From this, (23) and (24), we have RT (a∗) = E (cid:34) T (cid:88) (cid:35) (cid:104)(cid:96)t, at − a∗(cid:105) = E (cid:34) T (cid:88) (cid:104)(cid:96)t, at − x∗(cid:105) + E (cid:34) T (cid:88) (cid:35) (cid:104)(cid:96)t, x∗ − a∗(cid:105) t=1 (cid:34) T (cid:88) t=1 (cid:34) T (cid:88) t=1 = E = E (cid:35) (cid:104)(cid:96)t, at − x∗(cid:105) + 1 T (cid:35) (cid:104)(cid:96)t, xt − x∗(cid:105) + 1 = E t=1 (cid:34) T (cid:88) E (cid:35) (cid:104)(cid:96)t, x0 − a∗(cid:105) t=1 (cid:34) T (cid:88) ≤ E t=1 (cid:68)ˆ(cid:96)t, xt − x∗(cid:69) (cid:35) + 1 t=1 (cid:34) T (cid:88) t=1 (cid:35) (cid:104)(cid:96)t, at − x∗(cid:105) + 1 (25) Then, as we have x0+(1−1/T )−1(x∗−x0) = x0+(a∗−x0) = a∗ ∈ A, we have πx0(x∗) ≤ 1−1/T . Hence, from Lemma 3, we have ψ(x∗) = ψ(x∗) − ψ(x0) ≤ θ log (cid:18) (cid:19) 1 1 − πx0,X (x∗) ≤ θ log (cid:18) (cid:19) 1 1 − (1 − 1/T ) = θ log T. 21 From this, (25) and Lemma 1, we have RT (a∗) ≤ E (cid:34) T (cid:88) t=1 (cid:16)(cid:68)ˆ(cid:96)t − mt, xt − x(cid:48) t+1 (cid:69) − βtD(x(cid:48) t+1, xt) (cid:17) (cid:35) + βT +1θ log T + 1. (26) (cid:68)ˆ(cid:96)t − mt, xt − x(cid:48) (cid:69) − βtD(x(cid:48) t+1, xt) can bounded by using Lemma 4. From the t+1 The part of definition (10), we have (cid:107)ˆ(cid:96)t − mt(cid:107)∗2 xt,ψ = (ˆ(cid:96)t − mt)(cid:62)(∇2ψ(xt))−1(ˆ(cid:96)t − mt) = btd2(ft(at) − (cid:104)mt, at(cid:105))2λite(cid:62) = btd2(ft(at) − (cid:104)mt, at(cid:105))2 = d2gt(mt) ≤ 4btd2 ≤ 4d2. it (∇2ψ(xt))−1eit (27) Hence, if βt ≥ 6d, we have (cid:107)ˆ(cid:96)t − mt(cid:107)∗ bound the stability term as follows: xt,ψ ≤ βt/3, and, consequently, we can apply Lemma 4 to (cid:68)ˆ(cid:96)t − mt, xt − x(cid:48) t+1 (cid:69) − βtD(x(cid:48) t+1, xt) ≤ 2 βt (cid:107)ˆ(cid:96)t − mt(cid:107)∗2 ψ,xt = 2d2gt(mt) βt , where gt(m) is defined in (12). Then, from this and (26), we have (cid:34) RT (a∗) ≤ E 2 T (cid:88) t=1 d2gt(mt) βt (cid:35) + βT +1θ log T + 1. (28) If βt is given by (13), we then have d2gt(mt) βt = d √ 6 √ θ log T gt(mt) (cid:113)(cid:80)t−1 θ log T + 2 s=1 gs(ms) √ (cid:113)(cid:80)t θ log T gt(mt) (cid:113)(cid:80)t−1 s=1 gs(ms) + s=1 gs(ms) ≤ d which yields √ θ log T gt(mt) ≤ d (cid:113)(cid:80)t−1 s=1 gs(ms) + 36θ log T + = (cid:112)θ log T   (cid:118) (cid:117) (cid:117) (cid:116) t (cid:88) s=1 gs(ms) − (cid:113)(cid:80)t−1 (cid:118) (cid:117) (cid:117) (cid:116) t−1 (cid:88) s=1 s=1 gs(ms)  gs(ms)  . T (cid:88) t=1 d2gt(mt) βt ≤ (cid:112)θ log T T (cid:88)   (cid:118) (cid:117) (cid:117) (cid:116) t (cid:88) t=1 s=1 gs(ms) −  gs(ms)  = (cid:118) (cid:117) (cid:117) (cid:116)θ log T * (cid:118) (cid:117) (cid:117) (cid:116) t−1 (cid:88) s=1 T (cid:88) t=1 gt(mt). (29) We also have βT +1θ log T = 2 (cid:118) (cid:117) (cid:117) (cid:116)θ log T * T (cid:88) t=1 gt(mt) + 6dθ log T 22 from the definition (13) of βt. Combining this with (28) and (29), we obtain RT (a∗) ≤ 4d E (cid:118) (cid:117) (cid:117) (cid:116)θ log T *    gt(mt)  + 6dθ log T + 1, T (cid:88) t=1 which completes the proof. E Proof of Theorem 2 Fix η ∈ (0, 1/4) arbitrarily. By substituting ut = ̄(cid:96) ∈ arg min(cid:96) obtain (cid:80)T t=1 (cid:107)(cid:96)t − (cid:96)(cid:107)2 2 for all t in (19), we T (cid:88) t=1 gt(mt) = O = O (cid:32) T (cid:88) t=1 (cid:32) T (cid:88) t=1 (cid:0)(cid:10)(cid:96)t − ̄(cid:96)T , at (cid:11) + εt(at)(cid:1)2 + 1 bt (cid:33) (cid:33) gt( ̄(cid:96)T ) + 1 = O (cid:32) T (cid:88) t=1 (cid:0)(cid:107)(cid:96)t − ̄(cid:96)T (cid:107)2 2 + (εt(at))2(cid:1) + 1 (cid:33) . Similarly, by substituting ut = (cid:96)t, we obtain T (cid:88) t=1 gt(mt) = O (cid:32) T (cid:88) (εt(at))2 + t=1 (cid:33) ((cid:107)(cid:96)t − (cid:96)t+1(cid:107)2) + 1 . T −1 (cid:88) t=1 By combining these with Lemma 5 and applying Jensen's inequality, we obtain (15). Further, if ft(a) ≥ 0, by substituting ut = 0, we obtain T (cid:88) t=1 gt(mt) = O (cid:33) gt(0) + 1 = O (cid:32) T (cid:88) t=1 (cid:32) T (cid:88) t=1 (cid:33) bt(ft(at))2 + 1 = O (cid:33) ft(at) + 1 . (cid:32) T (cid:88) t=1 By combining this with Lemma 5, we obtain  RT (a∗) = O d (cid:118) (cid:117) (cid:117) (cid:116)θ log T (cid:32) E (cid:34) T (cid:88) (cid:35) ft(at) + 1 (cid:33)  t=1  = O d (cid:118) (cid:117) (cid:117) (cid:116)θ log T (cid:32) RT (a∗) + E (cid:35) ft(a∗) + 1 (cid:33)  (cid:34) T (cid:88) t=1 which implies that (16) holds. 23 F Proof of Lemma 7 As X is the convex hull of A(cid:48) = {a∗} ∪ conv(A \ {a∗}), any point y ∈ X can be expressed as a convex combination of a∗ and a point in conv(A \ {a∗}), which means that there exists λ ∈ [0, 1] and x(cid:48) ∈ conv(A \ {a∗}) such that x = λx(cid:48) + (1 − λ)a∗. For such x, we have πa∗,X (x) ≤ λ. (30) In fact, we have a∗ + λ−1(x − a∗) = a∗ + λ−1λ(x(cid:48) − a∗) = x(cid:48) ∈ X , which means that (30) holds. We further have ∆(x) = λ∆(x(cid:48)) + (1 − λ)∆(a∗) = λ∆(x(cid:48)) ≥ λ∆min, where the last inequality follows from the fact that x(cid:48) ∈ conv(A \ {a∗}) and the definition of ∆min. Combining this with (30), we obtain We next show πa∗,X (x) ≤ ∆(x) ∆min . max x∈W1(y) ∆(x) ≤ 2∆(y). (31) (32) As W1(y) is an ellipsoid centered at y, it holds that (cid:104)(cid:96)∗, y(cid:105) − min x∈W1(y) (cid:104)(cid:96)∗, x(cid:105) = max x∈W1(y) (cid:104)(cid:96)∗, x(cid:105) − (cid:104)(cid:96)∗, y(cid:105) . We hence have max x∈W1(y) ∆(x) = max x∈W1(y) (cid:104)(cid:96)∗, x(cid:105) − (cid:104)(cid:96)∗, y(cid:105) + ∆(y) = (cid:104)(cid:96)∗, y(cid:105) − min x∈W1(y) (cid:104)(cid:96)∗, x(cid:105) + ∆(y) ≤ (cid:104)(cid:96)∗, y(cid:105) − min x∈X (cid:104)(cid:96)∗, x(cid:105) + ∆(y) = 2∆(y), where the inequality follows from the fact that W1(y) ⊆ X . Combining (31) and (32), we obtain max x∈W1(y) πa∗,X (x) ≤ max x∈W1(y) ∆(x) ∆min ≤ 2 ∆(y) ∆min . 24 G Proof of Theorem 3 From Lemma 6 with ut = (cid:96)∗, we have (cid:34) T (cid:88) E t=1 (cid:35) (cid:32) gt(mt) = O E (cid:34) T (cid:88) (cid:35) gt((cid:96)∗) (cid:33) (cid:32) + 1 ≤ O E (cid:34) T (cid:88) bt((cid:104)(cid:96)t − (cid:96)∗, at(cid:105) + εt(at))2 + 1 (cid:35) (cid:33) (cid:32) ≤ O E t=1 (cid:34) T (cid:88) t=1 (cid:0)(cid:107)(cid:96)t − (cid:96)∗(cid:107)2 2 + rtσ2 t (cid:1) (cid:35) t=1 (cid:33) (cid:32) (cid:34) + 1 ≤ O E C + (cid:35) (cid:33) rtσ2 t + 1 . T (cid:88) t=1 From this and Lemma 5, we have  RT = O d (cid:118) (cid:117) (cid:117) (cid:116)θ log T * E (cid:34) C + (cid:35)  σ2 t rt + dθ log T  . T (cid:88) t=1 (33) Under the assumption of (11), we have (cid:26) (cid:27) (cid:26) (cid:27) rt ≤ κ * min z∈A max x∈Et πz,X (x) ≤ κ * min z∈A max x∈W1(xt) πz,X (x) ≤ 2κ ∆(xt) ∆min , where second inequality follows from Et ⊆ W1(xt) and the last inequality follows from Lemma 7. From this, (33) and σ2 = maxt∈[T ] σ2 t , we have  RT = O d (cid:118) (cid:117) (cid:117) (cid:116)θ log T * E (cid:34) C + κσ2 ∆min T (cid:88) t=1 (cid:35)  ∆(xt) + dθ log T  . (34) On the other hand, RT is bounded from below as follows: E [(cid:104)(cid:96)t, at − a∗(cid:105)] = T (cid:88) t=1 RT (a∗) = ≥ T (cid:88) t=1 T (cid:88) E [(cid:104)(cid:96)∗, at − a∗(cid:105) − 2(cid:107)(cid:96)t − (cid:96)∗(cid:107)2] = E E [(cid:104)(cid:96)∗, at − a∗(cid:105) + (cid:104)(cid:96)t − (cid:96)∗, at − a∗(cid:105)] (cid:35) (cid:104)(cid:96)∗, xt − a∗(cid:105) − 2C (cid:34) T (cid:88) t=1 (35) t=1 (cid:34) T (cid:88) (cid:35) ∆(xt) − 2C . = E Combining this with (34), we obtain t=1 RT (a∗) = O (cid:32) (cid:115) (cid:18) d θ log T * C + (cid:19) (cid:33) (RT + C) + dθ log T κσ2 ∆min (cid:32) (cid:115) = O d θκσ2 log T ∆min RT (a∗) + d (cid:115)(cid:18) κσ2 ∆min (cid:19) (cid:33) + 1 Cθ log T + dθ log T . 25 As X = O( √ AX + B) implies X = O(A + B), we have RT (a∗) = O (cid:32) d2θκσ2 log T ∆min (cid:115)(cid:18) κσ2 ∆min + d (cid:19) + 1 Cθ log T + dθ log T (cid:33) = O (cid:32)(cid:18) dκσ2 ∆min (cid:19) + 1 dθ log T + d (cid:115)(cid:18) κσ2 ∆min (cid:19) (cid:33) + 1 Cθ log T . 26
http://arxiv.org/abs/2303.15449v2
2023-08-31T01:11:10
2023-02-23T23:51:44
Backpropagation through Back Substitution with a Backslash
We present a linear algebra formulation of backpropagation which allows the calculation of gradients by using a generically written ``backslash'' or Gaussian elimination on triangular systems of equations. Generally, the matrix elements are operators. This paper has three contributions: (i) it is of intellectual value to replace traditional treatments of automatic differentiation with a (left acting) operator theoretic, graph-based approach; (ii) operators can be readily placed in matrices in software in programming languages such as Julia as an implementation option; (iii) we introduce a novel notation, ``transpose dot'' operator ``$\{\}^{T_\bullet}$'' that allows for the reversal of operators. We further demonstrate the elegance of the operators approach in a suitable programming language consisting of generic linear algebra operators such as Julia \cite{bezanson2017julia}, and that it is possible to realize this abstraction in code. Our implementation shows how generic linear algebra can allow operators as elements of matrices. In contrast to ``operator overloading,'' where backslash would normally have to be rewritten to take advantage of operators, with ``generic programming'' there is no such need.
[ "Alan Edelman", "Ekin Akyurek", "Yuyang Wang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2303.15449v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2303.15449v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.NA", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.NA", "cs.LG", "cs.NA" ]
3 2 0 2 g u A 1 3 ] A N . h t a m [ 2 v 9 4 4 5 1 . 3 0 3 2 : v i X r a BACKPROPAGATION THROUGH BACK SUBSTITUTION WITH A BACKSLASH ALAN EDELMAN∗, EKIN AKY ̈UREK† , AND YUYANG WANG‡ Abstract. We present a linear algebra formulation of backpropagation which allows the calcu- lation of gradients by using a generically written "backslash" or Gaussian elimination on triangular systems of equations. Generally, the matrix elements are operators. This paper has three contri- butions: (i) it is of intellectual value to replace traditional treatments of automatic differentiation with a (left acting) operator theoretic, graph-based approach; (ii) operators can be readily placed in matrices in software in programming languages such as Julia as an implementation option; (iii) we introduce a novel notation, "transpose dot" operator "{}T• " that allows for the reversal of operators. We further demonstrate the elegance of the operators approach in a suitable programming lan- guage consisting of generic linear algebra operators such as Julia [3], and that it is possible to realize this abstraction in code. Our implementation shows how generic linear algebra can allow operators as elements of matrices. In contrast to "operator overloading," where backslash would normally have to be rewritten to take advantage of operators, with "generic programming" there is no such need. 1. Preface: Summary and the Challenge. This paper provides the math- ematics to show how an operator theoretic, graph-based approach can realize back- propagation by applying back substitution to a matrix whose elements are operators. As a showcase result, one can back-propagate to compute the gradient on feed- forward neural networks (or Multi-layer Perceptron (MLP)) [5] with (1.1) ∇J = M T ((I − ̃L)T \g), where M (source to non-source nodes) and ̃L (within non-source nodes) are blocks of the adjacency matrix of the computational graph (see Section 3.2.2 for precise definitions), g is the vector of gradients of the loss function, and I is the identity matrix. For readers unfamiliar with the backslash notation, an equivalent expression of (1.1) is ∇J = M T (I − ̃L)−T g. We then set up a challenge to ourselves. Could we correctly implement (1.1) by simply typing the command (after basic setup but without overloading of backslash) ? We demonstrate that indeed the backpropagation can be achieved, almost by magic, in a programming language armed with generic programming allowing for operators as elements of matrices. The software in Section 6.1 is by itself interesting not for the usual reasons of what it does, but in this case how it does it: how a powerful language with generic programming and multiple dispatch can allow this abstract mathematical formulation to be realized. 2. Introduction: Linear Algebra, Graphs, Automatic Differentiation (AD), Operators, and Julia. Automatic differentiation (AD) is fundamental to gradient-based optimization of neural networks and is used throughout scientific com- puting. There are two popular approaches to AD: namely, forward and backward (reverse) modes [6, 7, 2, 13], the latter of which is also known as backpropagation in the Machine Learning (ML) literature.1 A common high-level description of AD is ∗Department of Mathematics and CSAIL, MIT, Cambridge, MA ([email protected]). †Department of EECS and CSAIL, MIT, Cambridge, MA ([email protected]) ‡AWS AI Labs, Santa Clara, CA ([email protected]). Work done prior to joining Amazon. 1Despite similar terminology, the term "forward propagation" (or forward pass) in machine learn- ing (ML) has no connection to forward mode automatic differentiation (AD). Instead, it refers to the 1 that it is really "only" the chain-rule. The centuries old technology of taking deriva- tives is taking on a modern twist in the form of Differentiable Programming [8, 11]. Who would have thought that one of the most routine college course subjects would now be the subject of much renewed interest both in applied mathematics and com- puter science? This paper introduces the notion that AD is best understood with a matrix-based approach. The chain-rule explanation, in retrospect, feels to us as a distraction or at least extra baggage. We suspect that while the chain-rule is well known, it is under- stood mechanically rather than deeply by most of us. We argue that a linear algebra based framework for AD, while mathematically equivalent to other approaches, pro- vides a simplicity of understanding, and equally importantly a viable approach worthy of further study. Regarding software, while most high-level languages allow for matrices whose elements are scalars, the ability to work with matrices whose elements might be oper- ators without major changes to the elementwise software is an intriguing abstraction. We discuss a Julia implementation that makes this step particularly mathematically natural. It is our view that a linear algebraic approach sheds light on how backpropagation works in its essence. We theoretically connect backpropagation to the back substi- tution method for triangular systems of equations. Similarly, forward substitution corresponds to the forward mode calculation of automatic differentiation. As is well documented in the preface to the book Graph Algorithms in the Language of Linear Algebra [10], there have been many known benefits to formulate mathematically a graph algorithm in linear algebraic terms. The ability to implement these abstractions while retaining performance is demon- strated using Julia, a language that facilitates abstractions, multiple dispatch, the type system, and which offers generic operators. 3. A Matrix Method for Weighted Paths. 3.1. "Forward and Back" through Graphs and Linear Algebra. In the spirit of reaching the mathematical core, let us strip away the derivatives, gradients, Jacobians, the computational graphs, and the "chain rule" that clutter the story of how is it possible to compute the same thing forwards and backwards. We set ourselves the goal of explaining the essence of forward mode vs backward mode in AD with a single figure. Figure 3.1 is the result. Note that "forward mode" differentiation is not to be confused with the forward computation of the desired quantity. 3.1.1. Path Weights on Directed Graphs. Consider a directed acyclic graph (DAG) with edge weights as in Figure 3.1 where nodes 1 and 2 are sources (starting nodes), and node 5 is a sink (end node). The problem is to compute the path weights, which we define as the products of the weights from every start node to every sink node. Evidently, the path weights that we seek in Figure 3.1 may be obtained by cal- process where a neural network calculates its output by sequentially passing input data through each layer, applying weighted sums and activation functions, until it reaches the output layer. In later sections, Algorithm 5.1 and 5.2 illustrate such a procedure. Whereas, "backpropagation" (backward pass, or reverse mode AD) is so named because information flows backwards through the network during this process. 2 culating (3.1) path weights =  T            1 0 0 1 0 0 0 0 0 0 (cid:123)(cid:122) sources (cid:124) (I − LT )−1 (cid:125)    ,     0 0   0   0  1 (cid:124) (cid:123)(cid:122) (cid:125) sink where LT , the adjacency matrix (edge weight matrix), is displayed in the lower left of Figure 3.1. One explanation of why (3.1) works for calculating the path weights is that (LT )k ij sums the path weights of length k from node i to node j and (I −LT )−1 = I + LT + . . . + (LT )n−1 then counts path weights of all lengths from i to j. forward computation, Orange: Fig. 3.1: Legend : Purple: target weights, Blue: backward computation. The dots in matrices denote zeros. (Upper Left:) Multiply the weights along the paths from source node 1 to sink node 5 and also source node 2 to sink node 5 to obtain acd and bcd. (Right Blue:) The ob- vious forward method. (Right Orange:) A backward method that requires one fewer multiplication. (Below:) A matrix method: if LT ij = the weight on edge ij, then (I − LT )−1 simul- taneously exhibits the forward (i.e. a → ac → acd and b → bc → bcd) and backward methods (i.e. d → cd → bcd → acd/bcd). If one follows step by step the linear algebra methods of forward substitution for lower triangular matrices or back substitution for upper triangular matrices, one obtains path weights algorithms as summarized in Figure 3.2. We remind the reader 3 <latexit sha1_base64="iGO5AZbg4UWVIsQpaZhYrFoqiKM=">AAADXHicfVJBa9swGJXtbkvTdUs32GUXsdDRgWuskM7ZYVC6wzbYoRtNW4jdIMtKKirLRpLHgvGf3K2X/ZVNdg1Lk5IPhB7v6el9+lCcc6a0799atrP16PGTznZ35+nus+e9vRfnKiskoWOS8UxexlhRzgQda6Y5vcwlxWnM6UV886nWL35SqVgmzvQip1GK54LNGMHaUNM9Sx58hYfw29XZu6vyEFXwIwxjOmeizFOsJftVdRF8Cz2zyrCJm/z4fBKVwZGLgoGLPowqiKuNKlmTERq4w5GL3vu1nFQwDLt1Atp0T7wxJd6cEi+leG2QcaxaBsPARUe+GxhL7ViyPNjf8vl7Ac0GG0vNhlQk/wc67fV9z28KrgPUgj5o63Ta+x0mGSlSKjThWKkJ8nMdlVhqRjitumGhaI7JDZ7TiYECp1RFZdNnBfcNk8BZJs0SGjbssqPEqVKL1Ix33zR4rVa1mnxImxR6NopKJvJCU0HugmYFhzqD9U+DCZOUaL4wABPJTK+QXGOJiTb/sR4CWn3yOjgfeMj30Pdh//ikHUcHvAZvwAFAIADH4As4BWNArFvrr92xt+0/zpaz4+zeHbWt1vMS3Cvn1T8X9PK3</latexit>abcdaacacd123415bbcbcd2acdcd5Forward Path WeightsBackward Path WeightsDirected Acyclic Graph (DAG)1234512345Edge Weights MatrixPath Weights Matrixdbcd<latexit sha1_base64="pRa2Zk4kEIlF/DtllGDRmPjxwWk=">AAACeHicbZE7T8MwEMed8CrlVWDsYlGeS5RUSLAgVbAwMIBEW6SmVI5zLVYdJ9gOoor6GfhubHwQFiacNiAonHTy37+7053PQcKZ0q77Ztlz8wuLS6Xl8srq2vpGZXOrpeJUUmjSmMfyLiAKOBPQ1ExzuEskkCjg0A6GF3m8/QRSsVjc6lEC3YgMBOszSrRBvcrL1f0tPsP+Y0pC7AcwYCJLIqIlex47eB/nTorTwb7/xQI8C6dXOuW/Ye7hLPrK80GE3y3LvUrNddyJ4b/CK0QNFXbdq7z6YUzTCISmnCjV8dxEdzMiNaMcxmU/VZAQOiQD6BgpSASqm00WN8Z7hoS4H0vjQuMJ/VmRkUipURSYTDPgg5qN5fC/WCfV/dNuxkSSahB02qifcqxjnP8CDpkEqvnICEIlM7Ni+kAkodr8Vb4Eb/bJf0Wr7niu490c1xrnxTpKqIp20CHy0AlqoEt0jZqIonerau1ae9aHje0D+2iaaltFzTb6ZXb9E7PerKI=</latexit> that forward and back substitution are the standard methods to solve lower and upper triangular systems respectively. Two Equivalent Ways to Compute the Path Weights in Figure 3.1: Forward Substitution: Back Substitution:       T   0 0   0   0  1      (I − L)−1       1 0 0 0 0        0 1   0   0  0  1 0   0   0  0 T  0 1   0   0  0      (I − LT )−1         0 0     0     0   1 Fig. 3.2: The forward and backward methods compared: Both are seen equivalently as a choice of parenthesizing (3.1) or as forward substitution vs. back substitution. Generally speaking, when the number of sources is larger than the number of sinks, one might expect the backward method to have less complexity. 3.1.2. Generalizing "Forward and Back" to a Catalan number of pos- sibilities. Continuing with the same L matrix from Section 3.1, we can begin to un- derstand all of the possibilities including the forward method, the backward method, the mixed-modes methods, and even more possibilities:       1 0 0 0 0  T 0 1   0   0  0 (I − LT )−1        0 0   0   0  1       1 0 0 1 0 0 0 0 0 0 T  1 .     .     .   . . 1 . . . a . 1 . . . . . 1 .   . .     .     .   1 1 . . . . . 1 . . . . b 1 . . . . . 1 .   . 1 . .     . .     . .   1 . . 1 . . . . . 1 . . = . . c 1 .   1 .     .     .   . . . . . 1 . 1 . . . . . 1 . . . . . . . . 1 d 1 .    0 0       0 .       0    1 It is well known [14], that there are a Catalan number, C5 = 42, ways to paren- thesize the above expression. One of the 42 choices evaluates left to right; this is forward substitution which computes the graph weights forward. Another evaluating from right to left is backward substitution. There are three other "mixed-modes" [12] which combine forward and backward methods. The remaining 37 methods require matrix-matrix multiplication as a first step. We encourage the reader to work out some of these on the graph. Partial products correspond to working through sub- graphs. Perhaps readers might find cases where working from the middle outward 4 can be useful. For example it would be possible to go from the middle outward using the Example of Figure 3.1: we would go from c to cd then compute acd and bcd. Fig. 3.3: Elimination of the edge from node 3 to node 4 on the graphs and with matrices. The matrix versions involve a rank one update to a row and column deleted matrix in the case of the Edge Weights Matrix and only a deletion of a row and column in the Path Weights Matrix. 3.1.3. Edge Elimination. It is possible to eliminate an edge (and preserve the path weights) by moving the weight of the edge to the weights of the incoming edges. 5 We illustrate this in Figure 3.3 by eliminating the edge from node 3 to node 4, moving the weight c to the incoming edges by multiplication. The corresponding linear algebra operation on LT is the deletion of column 3 and row 3 and the rank 1 update based on this column and row with the (3,3) element deleted. The corresponding linear algebra operation on (I − LT )−1 is merely the deletion of column 3 and row 3. This example is representative of the general case. 3.1.4. Edge addition at the Sink Node. We will be interested in the case where the edge weight graph is modified by adding one edge to the sink node. Con- tinuing our example from Figure 3.3, we will add an edge "e" by starting with: (3.2) path weights =  1 0   0   0  0  T 0 1   0   0  0 (cid:123)(cid:122) sources (cid:124) (cid:125) (I − LT )−1 (cid:124) (cid:125) (cid:123)(cid:122) path weights matrix        0 0   0   0  1 (cid:124) (cid:123)(cid:122) (cid:125) sink and then updating by augmenting the graph with one end node to become (3.3) updated path weights =  T  1 0   0   0   0  0 0 1 0 0 0 0 (cid:123)(cid:122) sources        (cid:124) (cid:125) (cid:124) (cid:18)(I − LT )−1 . (cid:19) . 1  1 .   .   .   .  . (cid:123)(cid:122) updated path weights matrix . 1 . . . . . . 1 . . . . . . 1 . . . . . . . . . . 1 e 1 .         (cid:125)          0 0   0   0   0  1 (cid:124) (cid:123)(cid:122) (cid:125) sink . The update from the path weights matrix in (3.2) to the updated path weights matrix in (3.3) can be verified in many ways. One simple way is to look at the explicit elements of the path weights matrix before and after and then notice that the new matrix has a column with one more element e augmented with a 1. It is an easy exercise in linear algebra to show that (3.3) is the same as (3.4) which folds the added edge e multiplicatively into the sink vector. (3.4) updated path weights =  T  1 0   0   0  0 0 1 0 0 0 (cid:123)(cid:122) sources      (cid:124) (I − LT )−1 (cid:125) .        . .   .   .  e (cid:124) (cid:123)(cid:122) (cid:125) sink 3.2. Examples of DAGs and Weighted Paths. 3.2.1. The "Complete DAG" and Weighted Paths. Consider as an exam- ple in Figure 3.4, the complete DAG on four nodes with graph weights evaluated through a forward and backward method. There is one source and one sink. We find that this complete DAG example reveals most clearly the equivalence between path weights and the inverse matrix. 6 We see that the forward path weights folds in the edges labelled "a," then "b," then "c." This works through the matrix LT by columns. The backward mode folds in the edges with subscript "3," then "2," then "1." This works through the matrix LT by rows from bottom to top. Fig. 3.4: The complete DAG on four nodes illustrates a symmetric situation where for- ward and backward have the same complexity but arrive at the same answer through different operations. 3.2.2. The "multi-layer perceptron DAG" and Weighted Paths. Fig- ure 3.5 is the DAG for the derivatives in a multi-layer perceptron (MLP). It may be thought of as a spine with feeds for parameters (nodes 1,2,3, and 4 in the figure). If sources are labeled 1, . . . , s (in Figure 3.5, s = 4), then the top left s by s matrix in LT is the zero matrix as there are no connections. We can then write (3.5) where M T = LT = (cid:18)0 M T ̃LT 0 (cid:19) ,     w . . . . . x . y . . .     . . . z , ̃LT =  . a . .   . .  . . . b . .     . . c . , where the matrix M T corresponds to connections between the sources and internal nodes, and ̃LT corresponds to internal connections. In this example M T is diagonal corresponding to a bipartite matching between nodes 1, 2, 3, 4 and 5, 6, 7, 8. The ̃LT 7 Fig. 3.5: This diagram contains most of what is needed to understand forward and backward propagation of derivatives through a MLP. The details of what the weights look like will come later. If we take n = 4 for the pictured network, the sources are labeled 1 : n and the sink is labeled 2n. Forward mode requires n(n − 1)/2 multiplications while backward mode requires 2n − 3 multiplications. matrix represents internal connections, in this case it is the "spine" linearly connecting nodes 5, 6, 7, 8. Now we have (I − LT ) = (cid:18)I −M T I − ̃LT 0 (cid:19) , and (I − LT )−1 = (cid:18)I M T (I − ̃LT )−1 (cid:19) 0 (I − ̃LT )−1 . If the last node is the one unique sink, then we obtain the useful formula (3.6) Path weights = M T (I − ̃LT )−1       0 ...    0  1 . We can now take a close look at Figure 3.5 and fully grasp the path weight struc- ture. The spine consisting of a, b, c and 1 (understood) requires the computation of the cumulative suffix product 1, c, bc, abc. What follows is an element-wise multiplication 8 by z, y, x, w, from which we can calculate the last column of M T (I − ̃LT )−1 (3.7) M T (I − ̃LT )−1      0 0   0  1 =     wabc xbc yc z     . 3.3. Computational Graphs, Derivative Graphs, and their superposi- tion. Many treatments of automatic differentiation introduce computational graphs at the start of the discussion. Our treatment shows that this is not necessary. How- ever, in the end the key application of edge weights will be as derivatives of computed quantities. To this end, we define Definition 3.1. A computational graph is a node labelled DAG, where leaf nodes consist of variable names, and non-leaf nodes contain variable names and formulas that depend on incoming variables. We remark that there are variations on where the variable names and formulas live on a computational graph, but we believe the definition here is the cleanest when wishing to incorporate derivative information. Fig. 3.6: An example of Computational (node) graph, derivative (edge) graph, and their "superposition." 3.3.1. The chain rule, derivatives, and Jacobians. Here we say explicitly how the edge weights and path weights relate to derivatives in a computation. Consider the computation from Figure 3.6, the next three algorithms show the computation, the derivatives of each line of code, and the overall derivatives. We see that the one step derivatives are edge weights and the overall derivatives are path weights. If the final output is a scalar, we immediately have that the gradient with respect to the source x and y (in Figure 3.6) is exactly the path weight defined in (3.6), (3.8) gradient = the last column of M T (I − ̃LT )−1, which corresponds to the output in Algorithm 3.8 with M T = (cid:18)y * x * (cid:19) * * , ̃L = 9 *  * 2p *  * * −e−q * *   . Player Description Edge weight from node i and j These are the derivatives of one step of a computa- tion. These can be scalars but in general these are Jacobian matrices (or operators). Path weight node i to j from Source Sink These are the derivatives that reach back into a chain of computations. The chain rule states that if you multiply ("chain together") the derivatives at each step you get the dependence of one variable on an earlier variable. The sources in the graph are typically parameters in real computations, as many modern applications are interested in the derivatives with respect to the input parameters. The sink is usually what is known as a loss function in modern applications. Table 1: A dictionary translating graph elements to AD (cf. Figure 3.6). Equation (3.8) fully describes backpropogation. For completeness, the term "forward propagation" (forward pass) describes the process of executing the computational graph in a forward direction (left to right), storing the intermediate values that are subsequently utilized in backpropagation (backward pass). Algorithm 3.1 Simple Algorithm Ex- ample from Figure 3.6 1: p ← multiply(x, y) 2: q ← square(p) 3: r ← exp neg(q) 4: output r Algorithm 3.2 Edge weights (deriva- tives of one line of code) 1: d{multiply(x, y)}/dx = y 2: d{multiply(x, y)}/dy = x 3: d{square(p)}/dp = 2p 4: d{exp neg(q)}/dr = −e−q (= ∂p ∂x ) (= ∂p ∂y ) (= ∂q ∂p ) (= ∂r ∂q ) Algorithm 3.3 Path weights (Chained derivatives) 1: dr/dx = y × 2p × (−e−q) (Chain lines 1,3, and 4 of Algorithm 3.2) 2: dr/dy = x × 2p × (−e−q) (Chain lines 2,3, and 4 of Algorithm 3.2 ) 4. Linear Operators as elements of Matrices. We will illustrate in Section 6.1 the value of software that allows linear operators as elements of matrices. Here we set the mathematical stage, starting with a question. Consider a matrix transformation of X such as TA,B : X (cid:55)→ BXAT , how should we represent the Jacobian ∂TA,B/∂X? Before we answer, we remind the reader how the Kronecker product works. One view of the Kronecker product A ⊗ B of two matrices is that it multiplies every element in A times every element of B placing the elements in such a way that we have the 10 identity (A ⊗ B)vec(X) = vec(BXAT ), where vec denotes the flattening of a matrix X into a vector by stacking its columns. We may abuse notation when there is no confusion and write (A ⊗ B)(X) = BXAT , for the linear operator TA,B that sends X to BXAT . Identifying the matrix A ⊗ B with the operator is more than a handy convenience, it makes computations practical in a software language that allows for this. Table 2 defines some operators of interest. Kronecker Product of A, B Left Multiplication by B Right Multiplica- tion by A Hadamard Product with M Matrix inner prod- uct with G Symbol Definition Dense Representation A ⊗ B X (cid:55)→ BXAT A ⊗ B m1n1 × mn BL AR MH X (cid:55)→ BX I ⊗ B m1n × mn X (cid:55)→ XA AT ⊗ I mn1 × mn X (cid:55)→ M. ∗ X diag(vec(M )) mn × mn GT• X (cid:55)→ Tr(GT X) vec(G)T 1 × mn Table 2: Matrix Operators and the size of their dense representations assuming X : m × n, A : n1 × n, B : m1 × m, M : m × n, and G : m × n. We overload A ⊗ B to be both the operator and the matrix. Consider the inner product (matrix dot product) ⟨X, Y ⟩ = Tr(X T Y ). The iden- tity ⟨X, AY ⟩ = ⟨AT X, Y ⟩ implies (AL)T = (AT )L, in words, the operator adjoint with respect to the operator AL (left multiplication by A) is left multiplication by AT . The operator transposes are (AL)T = (AT )L, (BR)T = (BT )R, and (MH )T = MH (sym- metric). We wish to propose a carefully thought out notation for another useful operator, GT• ("G transpose dot"), the matrix inner (or dot) product with G. Definition 4.1. Let GT• ("G transpose dot") denote the matrix inner (or dot) product with G. This operator takes a matrix X of the same size as G and returns the scalar, GT• X := Tr(GT X)= vec(G)T vec(X) = (cid:80) i,j GijXij. Many communities choose a notation where small Roman letters denote a column vector, so that x (cid:55)→ gT x denotes a linear function of x. Those who are used to this notation no longer "see" the transpose so much as turning a column into a row, but rather they see the linear function gT as an object that acts on ("eats") vectors and returns scalars. In the same way we propose that one might denote a linear function of a matrix X (cid:55)→ Tr(GT X) with the operator notation X (cid:55)→ GT• X, an operator that "eats" matrices and returns scalars. Lemma 4.1. If the superscript "()T " is overloaded to denote real operator adjoint or matrix transpose as appropriate, L is a linear operator and G is a matrix, then we 11 have the operator identity: (LT G)T• = GT• L. Notice that if we pretend all letters are just matrices and you ignore the dot, the notation has the appearance of the familiar transpose rule. Proof. We have that for all X, (LT G)T• X = ⟨LT G, X⟩ = ⟨G, LX⟩ = GT• LX, showing that as operators (LT G)T• = GT• L. As an example, we have (AT LG)T• = X (cid:55)→ Tr((AT G)T X), and GT• AL = X (cid:55)→ Tr(GT AX), which shows that (AT ces A, G, AT and the operators AT notation can be valuable.) LG)T• = GT• AL. We encourage the reader to follow the matri- LG)T• , GT• . (See Section 5.4 for why this L, AL, (AT 5. Operator Methodology. We proceed from matrices of scalars to matrices of vectors to matrices of operators in Sections 5.1, 5.2, and 5.3. ultimately taking advantage of Julia's capabilities. We encourage the reader to compare the matrices in each of these sections. Section 5.4 illustrates the power of the GT• notation, while Section 5.5 shows the relationship to the adjoint method that is well known in the field of scientific computing. Algorithm 5.1 Scalar MLP without Bias (forward propagation) i = 1, * * * , N 1: Input data x0, initial weights wi, 2: Select activation functions hi(*) such as sigmoid, tanh, ReLU, etc. 3: for i = 1 to N do 4: 5: 6: end for 7: Output xN xi ← hi(wixi−1) (δi ← h′ i(wixi−1)) 5.1. Matrices of scalars. The simple case of scalar neural networks (shown in Algorithm 5.1) without bias shows the power of the graph approach. However, the full power is revealed in the coming sections. Here we remind the reader of the algorithm, draw the graphs, and instantly write down the linear algebra that provides the gradients through backpropogation. (The graphs and matrices are illustrated for N = 4 for ease of presentation.) 12 Gradient w.r.t. pa- rameters p (leaf nodes) ∇pL = M T  m1 =    m2  T    m3 m4 × × (I − L)−1 × g I −l2      −T I −l3    I I −l4 ×         . . . g4 (i) Scalar p = {wi} (ii) Vector p {[wi, bi]} = (iii) Matri- ces p {[Wi, Bi]} = mi = δixi−1 li = δiwi g4 = L′(x4) mi = [δixi−1 δi] '' '' '' '' mi = [∆iH ◦ Xi−1R ∆iH ] li = ∆iH ◦ WiL g4 = ∇X4L ↑− Operators −↑ Table 3: Algebraic Structure for an MLP when the parameters (i.e. the set of leaf nodes collectively referred to as p) are (i) only scalar weights (ii) a weight/bias vector, and (iii) a vector of weight/bias matrices. We emphasize the common algebraic struc- ture and the benefit of software that can represent matrices of vectors and matrices of operators. Fig. 5.1: Top left: computational graph of a scalar MLP. This computation, which has nothing to do with derivatives, is often referred to as forward propagation because 13 of its direction. Evaluation must generally necessarily go from left to right. Top right: derivative edge weights. Since derivatives are linear, multiple directions are possible to evaluate the products. Bottom: the superimposed graph showing both the forward computation and the derivative edge weights. Starting with ̃LT =  . .   .  . δ2w1 . . . . δ3w2 . .     . . δ4w3 . , M =     δ1x0 . . . . δ2x1 . . . . δ3x2 .     , . . . δ4x3 it is an immediate consequence of our graph theory methodology which concluded with (3.4) and (3.7) that the backpropagated gradient is computed by evaluating efficiently  δ1x0 ∇wL =    δ2x1 δ3x2     δ4x3 1 −δ2w1     1 −δ3w2 1 −δ4w3  −T        1     . . . L′(x4) 5.2. Matrices of vectors. As a baby step towards the matrices of operators approach, we show how one can (optionally) group weights and biases that appear in a neuron. Algorithm 5.1 is modified so that wixi−1 is replaced with wixi−1 + bi. In the interest of space, we will simply write the answer of ∇[w,b]L and discuss its format,  [δ1x0 δ1] [δ2x1 δ2]    1 −δ2w1  T       [δ3x2 δ3] [δ4x3 δ4] 1 −δ3w2 1 −δ4w3    1  −T   .      . . . L′(x4) We see we have an ordinary matrix back substitution followed by multiplication by a diagonal matrix of row vectors of length 2 so that the result is a vector of column vectors of length 2 which nicely packages the gradients with respect to the weight and bias in each neuron. We remark that the transpose applies recursively in the diagonal matrix. The transpose is overkill in this case but is critical in the next section. 5.3. Matrices of operators. Letting I denote the identity operator and empty space the zero operator, we have the following  [∆1H ◦ X0R ∆1H ] ∇[W,B]L =    [∆2H ◦ X1R ∆2H ] [∆3H ◦ X2R ∆3H ] I −∆2H ◦ W2L     × I −∆3H ◦ W3L I −∆4H ◦ W4L I    [∆4H ◦ X3R ∆4H ] −T      . . . ∇X4L  T        for the matrix neural network in Algorithm 5.2. The entries of our matrix of operators may be read immediately from the differential of line 4 of Algorithm 5.2: dXi = d [hi(WiXi−1 + Bi] = (∆iH ◦ Xi−1R)dWi + ∆iH dBi + (∆iH ◦ WiL)dXi−1, 14 where ∆i is the gradient matrix, and the definitions of the operators ∆iH , WiL, and Xi−1R are given in Table 2. Algorithm 5.2 Matrix MLP (forward propagation) 1: Input data X0 (n0 × k), and initial weight matrices and corresponding bias terms Wi(ni × ni−1), Bi(ni × k) 2: Select activation functions hi(*) such as sigmoid, tanh, ReLU, etc. 3: for i := 1 to N do 4: 5: 6: end for 7: output XN Xi ← hi(Wi ∗ Xi−1 + Bi). (∆i ← h′ i(Wi ∗ Xi−1 + Bi)) Fig. 5.2: Computational and derivative graphs of a matrix MLP with their superim- posed version. Compared to Figure 5.1 of the scalar MLP, everything remains the same except for two changes: the elements in the computational graph are now ma- trices, and the edges in the derivative graph have been replaced by operators. 5.4. The Power of Notation. We read directly off the edge weight graph in Figure 5.2 that for a matrix neural network we have Forward Mode Operators (right to left) = GT• (∆N )H (WN )L . . . (Wi+2)L(∆i+1)H (Wi+1)L(∆i)H (Xi−1)R = GT• (∆N )H (WN )L . . . (Wi+2)L(∆i+1)H (Wi+1)L(∆i)H (5.1) ∂L ∂Wi ∂L ∂Bi 15 or going the other way we have, backward Mode Operators (right to left) (5.2) (cid:21)T• (cid:21)T• (cid:20) ∂L ∂Wi (cid:20) ∂L ∂Bi = (cid:8)(X T i−1)R(∆i)H (W T i+1)L(∆i+1)H (W T i+2)L . . . (W T N )L(∆N )H G(cid:9)T• = (cid:8)(∆i)H (W T i+1)L(∆i+1)H (W T i+2)L . . . (W T N )L(∆N )H G(cid:9)T• . Understanding these operators. The forward operators in Equation (5.1) may be thought of as sensitivity operators or as a means of computing the full gradient. As a sensitivity operator, one can state that the directional derivative of L in the direction ∆Wi is ∂L (∆Wi). Alternatively, each operator can be written out as a ∂Wi (large) matrix, and ultimately a gradient can be computed. The backward operator is intended to be evaluated from right to left inside the braces. Doing so computes the gradient directly. We hope the reader appreciates the power of the "T•" notation, whereby one feels we are taking transposes of matrices and reversing order, but in fact we are transposing the operators. Either way the operators can be read right off the graphs. 5.5. Relationship to the Adjoint Method of scientific computing. We will show how to derive (3.8) and (3.7) using the adjoint method so-named because of its focus on the transpose (the adjoint) of the Jacobian. We encourage interested readers to see [9] and [4] to learn more about adjoint methods in numerical computa- tion. We find it satisfying that the graph theoretic interpretation of backward mode AD and the adjoint method of scientific computing yield the same answer from two very different viewpoints. Consider a general computation with known constant input x0 ∈ R and parame- ters p = [p1, . . . , pk]: Algorithm 5.3 General Computation 1: Input constant x0 2: Input parameters p1, . . . , pk 3: x1 ← Φ1(; p1, . . . , pk; x0) 4: x2 ← Φ2(x1; p1, . . . , pk; x0) ... 5: 6: xN ← ΦN (x1, . . . , xN −1; p1, . . . , pk; x0) 7: Output xN ... Algorithm 5.3 is an explicit computation. The function φi computes the value of gives the partial derivatives of one step of the the variable xi. The notation dΦi or dΦi dpj dxj algorithm. By contrast, the notation dxi gives the partial derivatives across multiple dpj steps of the algorithm. Algorithm 5.3 is the general case of Algorithm 3.1, the dΦi dxj and dΦi are general cases of what is seen in Algorithm 3.2, and the dxi generalize dpj dpj what is seen in Algorithm 3.3. We note that the adjoint method literature tends to consider a yet more general implicit approach. Placing Section 3 of [9] in an explicit setting, we define a function 16 f such that f (x, p) = 0. To this end, let (5.3) f (x, p) = x − Φ(x, p) :=           −      x1 x2 ... xN Φ1(; p; x0) Φ2(x1; p; x0) ... ΦN (x1, . . . , xN −1; p; x0)      . Clearly, given p, the computed x = (x1, . . . , xN ) from Algorithm 5.3 is a solution to f (x, p) = 0. Our goal is to reproduce (3.8), which is the derivative of xN w.r.t. to the parameter p. Let us first consider the derivation for xp, which is the derivative of x, implicitly defined by f (x, p) = 0, w.r.t. to p. To connect the viewpoints a table of notation for various Jacobians is helpful: Adjoint Method Nabla Notation Matrix I − ̃L ∇xf fx Size N × N N × k −M T (I − ̃L)−1M T N × k fp xp ∇pf ∇px The matrices themselves are explicitly: ̃L = (cid:20) ∂Φi ∂xj (cid:21) i,j , i > j, j = 1, . . . , N − 1, and M T = (cid:20) ∂Φi ∂pj (cid:21) i,j , ∇px = (cid:20) ∂xi ∂pj (cid:21) i,j , i ∈ 1, . . . , N, j ∈ 1, . . . , k. The matrix ̃L that contains the partials ∂Φj/∂xj is strictly lower triangular ex- actly because Algorithm 5.3 is an explicit computation, whereas an implicit function would generally have a dense Jacobian. Since f (x, p) = x − Φ(x, p), the Jacobian ∇xf = I − ̃L. Differentiating 0 = f (x, p) with respect to p we get 0 = fxxp + fp or x fp which is (I − ̃L)−1M T in matrix notation explaining the bottom row of xp = −f −1 the above table. If g(x) is any scalar function of x, then the key adjoint equation is ∇pg = gxxp = −gxf −1 x fp := −λT fp, where λ satisfies the so-called adjoint equation f T x . Since gx is an 1 by k vector, by computing the adjoint λ first, we reduce the computation of a matrix-matrix mul- tiplication and a matrix-vector multiplication to two matrix-vector multiplications. x λ = gT If we take g(x) = xN then gx = [0, . . . , 0, 1]. The gradient is then ∇pg(x) = [0, . . . , 0, 1](I − ̃L)−1M T , achieving our goal of reproducing (3.7). 17 So much is happening here that it is worth repeating with other notation. We can use the Jacobian of f with respect to x and p to differentiate (5.3): 0 =      dx1 dx2 ... dxN      −         0 ∂Φ2 ∂x1 ... ∂ΦN ∂x1 0 0 . . . . . . . . . . . . ... ∂ΦN ∂xN −1  0        0 ... 0 which can be solved to obtain      dx1 dx2 ... dxN      −       ∂Φ1 ∂p1 ... ∂ΦN ∂p1 . . . ... . . .       ∂Φ1 ∂pk ... ∂ΦN ∂pk      ,      dp1 dp2 ... dpk      dx1 dx2 ... dxN      =         I −         0 ∂Φ2 ∂x1 ... ∂ΦN ∂x1 0 0 . . . . . . . . .  0 −1  . . . ... ∂ΦN ∂xN −1         0   ...     0       ∂Φ1 ∂p1 ... ∂ΦN ∂p1 . . . ... . . . ∂Φ1 ∂pk ... ∂ΦN ∂pk                 . dp1 dp2 ... dpk Some readers unfamiliar with the notation of differentials might prefer what amounts to a notational change, but avoids the notation of differentials:       ∂x1 ∂p1 ... ∂xN ∂p1 . . . ... . . .         =       ∂x1 ∂pk ... ∂xN ∂pk I −         0 ∂Φ2 ∂x1 ... ∂ΦN ∂x1 0 0 . . . . . . . . .  0 −1  . . . ... ∂ΦN ∂xN −1         0   ...     0       ∂Φ1 ∂p1 ... ∂ΦN ∂p1 . . . ... . . .       . ∂Φ1 ∂pk ... ∂ΦN ∂pk 6. Julia, the power of language. 6.1. The challenge. This section provides a complete realization of the chal- lenge described in the preface (Section 1). The question we asked is whether we could bring to life the linear algebra mathematics expressed in by typing the command ∇J = M T ((I − L)T \g) and computing the backpropagated gradient of a matrix neural network almost by magic? We remark that it is common to see code in papers. Code can serve the purpose of specifying details, facilitating reproducibility, and verifiability. Code can also allow users to adapt methods to their own situations. In addition to all of the above, we have a further purpose. We believe the code example we provide shows the power, elegance, and utility of the Julia programming language in ways that may be difficult or impossible to imagine in other languages. At the risk of showing the end of the code before the start, 63 lines of setup culminate in exactly what we wanted: code which looks just like the math of ma- trices with operators that correctly calculates the gradient fulfilling our title goal of backpropagating through back substitution with a backslash: 18 The first 28 lines elegantly set up the mathematics very much like a mathematician defining operators and algebraic axioms: Lines 10-14 above define matrix operators and their adjoints. Lines 16-28 define various math operations, such as the negative operator on line 21, or the composition of operators on line 25. 19 For completeness we list lines 29 through 63 which constitute the setup of a basic forward pass through a matrix neural net. We remark that lines 30 and 38 allow an index origin of 0. The readers are encouraged to try the code at https://github.com/ alanedelman/BackBackBack. 6.2. Modern Computer Science meets Linear Algebra. The venerable po- sition of numerical linear algebra libraries can not be undersold. Years of rigorous mathe- matical and algorithmic research have culminated in the modern LAPACK library [1] which represents a crowning achievement of value to a huge number of users who call LAPACK perhaps from, for example, Julia, NumPy, or MATLAB. In most cases the users are unaware of the scientific bedrock of which they are beneficiaries. Continuing this grand tradition, we wish to highlight some of the computer science in- novations that allow for the code in Section 6.1 to look so deceptively simple. Generic Programming or how can the backslash just work? We invite the reader to consider how the innocent backslash on line 75 of the code in Section 6.1 could possibly perform a backpropogation of derivative. We believe this would be impossible in, for example, NumPy or MATLAB as these packages currently exist. From a computer science point of view, Julia's multiple dispatch mechanism and generic programming features allow the generic backslash to work with matrices and vectors whose elements are operators and compositions of opera- tors. We remind the reader that the operators are not language constructs, but are created in software on the first 28 lines of code. The backslash, however, is not LAPACK's backslash, as the LAPACK library is constrained to floating point real and complex numbers. Julia's backslash currently runs LAPACK when dispatched by matrices of floats, but, as is the case here, the generic algorithm is called. We are fascinated by the fact that the author of the 20 generic algorithm would not have imagined how it might be used. We are aware of back- slash being run on quaternion matrices, block matrices, matrices over finite fields, and now matrices with operators. Such is the mathematical power of abstraction and what becomes possible if software is allowed to be generic. In the context of backpropagation, replacing the "for loops" with the backslash helps us see backpropogation from a higher viewpoint. The significance of transpose all the way down. Not without controversy, Julia implements transpose recursively. We believe this is the preferred behavior. This means a block matrix of block matrices of matrices (etc.) will transpose in the expected manner. Similarly matrices of complex number or quaternions will perform conjugate transposes as expected. In this work the M as seen in Line 66 of the code in Section 6.1 is diagonal, but is not symmetric. In line 75 we are transposing a diagonal matrix of 1 × 2 matrices of composed operators M' while in that same line we are also transposing a bidiagonal matrix of operators. Because the operator adjoint is defined on lines 10-14 of the code and the adjoint for a composed operator is defined on line 25, Julia's generic implementation, again, just works. We are not aware of any other linear algebra system whereby the transpose would just work this readily. The page https://discourse.julialang.org/t/why-is-transpose-recursive/2550 doc- uments some of the controversy. We are extremely grateful that the recursive definition won the day. A quick word about performance. There is nothing in the backslash formulation that would impede performance. Possible extensions to the example code in Section 6.1. We deliberately only used as an example the matrix neural network. We also have implemented a fully connected neural network where the matrix I − L is a Julia triangular type, whereas the reference example was bidiagonal. We also implemented a square case where the W parameter was constant from one iteration to the next. We also conceived of the case of being restricted to a mani- fold. We thus stress that we did not build a fully functional package at this time, and thus emphasize that this could be future research, but we have not yet seen any roadblock to this methodology. Concluding Moral. Exciting new innovations in numerical algorithms are emerging from soft- ware developments. Critical elements for creativity include: generic programming (generic operators), abstract representations, fast performance without waste, multiple dispatch, and an aggressive type system. Abstraction matters. Software matters. Language matters. 7. Acknowledgments. We would like to thank the anonymous reviewers for their valuable comments. We wish to thank David Sanders and Jeremy Kepner for helpful con- versations. This material is based upon work supported by the National Science Foundation under grant no. OAC-1835443, grant no. SII-2029670, grant no. ECCS-2029670, grant no. OAC-2103804, and grant no. PHY-2021825. We also gratefully acknowledge the U.S. Agency for International Development through Penn State for grant no. S002283-USAID. The in- formation, data, or work presented herein was funded in part by the Advanced Research Projects Agency-Energy (ARPA-E), U.S. Department of Energy, under Award Number DE- AR0001211 and DE-AR0001222. This material is based upon work supported by the Defense Advanced Research Projects Agency (DARPA) under Agreement No HR00112290091. We also gratefully acknowledge the U.S. Agency for International Development through Penn State for grant no. S002283-USAID. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof. This material was supported by The Research Council of Norway and Equinor ASA through Research Council project "308817 - Digital wells for optimal production and drainage". Re- search was sponsored by the United States Air Force Research Laboratory and the United States Air Force Artificial Intelligence Accelerator and was accomplished under Cooperative 21 Agreement Number FA8750-19-2-1000. The views and conclusions contained in this doc- ument are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the United States Air Force or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein. REFERENCES [1] E. Anderson, Z. Bai, C. Bischof, L. S. Blackford, J. Demmel, J. Dongarra, J. Du Croz, A. Greenbaum, S. Hammarling, A. McKenney, et al., LAPACK users' guide, SIAM, 1999. [2] A. G. Baydin, B. A. Pearlmutter, A. A. Radul, and J. M. Siskind, Automatic differen- tiation in machine learning: a survey, Journal of Machine Learning Research, 18 (2018), pp. 1–43, http://jmlr.org/papers/v18/17-468.html. [3] J. Bezanson, A. Edelman, S. Karpinski, and V. B. Shah, Julia: A fresh approach to nu- merical computing, SIAM review, 59 (2017), pp. 65–98. [4] A. M. Bradley, PDE-constrained optimization and the adjoint method, 2010, https://cs. stanford.edu/∼ambrad/adjoint tutorial.pdf. [5] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning, MIT Press, 2016. http: //www.deeplearningbook.org. [6] A. Griewank, A mathematical view of automatic differentiation, Acta Numerica, 12 (2003), pp. 321–398. [7] A. Griewank and A. Walther, Evaluating derivatives: principles and techniques of algorith- mic differentiation, SIAM, 2008. [8] M. Innes, A. Edelman, K. Fischer, C. Rackauckus, E. Saba, V. Shah, and W. Teb- butt, ∂P : A differentiable programming system to bridge machine learning and scientific computing, 2019, http://arxiv.org/abs/1907.07587. [9] S. G. Johnson, Notes on adjoint methods for 18.335, 2006, https://math.mit.edu/∼stevenj/ 18.336/adjoint.pdf. [10] J. Kepner and J. Gilbert, Graph algorithms in the language of linear algebra, SIAM, 2011. [11] T.-M. Li, M. Gharbi, A. Adams, F. Durand, and J. Ragan-Kelley, Differentiable program- ming for image processing and deep learning in halide, ACM Transactions on Graphics (TOG), 37 (2018), pp. 1–13. [12] J. Revels, T. Besard, V. Churavy, B. D. Sutter, and J. P. Vielma, Dynamic automatic differentiation of GPU broadcast kernels, 2018, https://arxiv.org/abs/arXiv:1810.08297. [13] J. Revels, M. Lubin, and T. Papamarkou, Forward-mode automatic differentiation in Julia, arXiv preprint arXiv:1607.07892, (2016). [14] R. P. Stanley, Catalan numbers, Cambridge University Press, 2015. 22
http://arxiv.org/abs/2302.12367v1
2023-02-23T23:50:24
2023-02-23T23:50:24
Extracting Victim Counts from Text
Decision-makers in the humanitarian sector rely on timely and exact information during crisis events. Knowing how many civilians were injured during an earthquake is vital to allocate aids properly. Information about such victim counts is often only available within full-text event descriptions from newspapers and other reports. Extracting numbers from text is challenging: numbers have different formats and may require numeric reasoning. This renders purely string matching-based approaches insufficient. As a consequence, fine-grained counts of injured, displaced, or abused victims beyond fatalities are often not extracted and remain unseen. We cast victim count extraction as a question answering (QA) task with a regression or classification objective. We compare regex, dependency parsing, semantic role labeling-based approaches, and advanced text-to-text models. Beyond model accuracy, we analyze extraction reliability and robustness which are key for this sensitive task. In particular, we discuss model calibration and investigate few-shot and out-of-distribution performance. Ultimately, we make a comprehensive recommendation on which model to select for different desiderata and data domains. Our work is among the first to apply numeracy-focused large language models in a real-world use case with a positive impact.
[ "Mian Zhong", "Shehzaad Dhuliawala", "Niklas Stoehr" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12367v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12367v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG", "I.2.7; J.0" ]
Extracting Victim Counts from Text Mian Zhong Shehzaad Dhuliawala Institute for Machine Learning, ETH Zürich Niklas Stoehr [email protected] [email protected] [email protected] 3 2 0 2 b e F 3 2 ] L C . s c [ 1 v 7 6 3 2 1 . 2 0 3 2 : v i X r a Abstract Decision-makers in the humanitarian sector rely on timely and exact information during crisis events. Knowing how many civilians were injured during an earthquake is vital to allocate aids properly. Information about such victim counts is often only available within full-text event descriptions from newspapers and other reports. Extracting numbers from text is challenging: numbers have different formats and may require numeric reasoning. This renders purely string matching-based ap- proaches insufficient. As a consequence, fine- grained counts of injured, displaced, or abused victims beyond fatalities are often not ex- tracted and remain unseen. We cast victim count extraction as a question answering (QA) task with a regression or classification objec- tive. We compare regex, dependency pars- ing, semantic role labeling-based approaches, and advanced text-to-text models. Beyond model accuracy, we analyze extraction reliabil- ity and robustness which are key for this sen- sitive task. In particular, we discuss model calibration and investigate few-shot and out- of-distribution performance. Ultimately, we make a comprehensive recommendation on which model to select for different desiderata and data domains. Our work is among the first to apply numeracy-focused large language models in a real-world use case with a positive impact.1 1 Introduction Timely and accurate information during crisis events is crucial for rescue operations and the allo- cation of humanitarian aid (Lepuschitz and Stoehr, 2021). However, crisis information is often scarce, subjective, or biased, which renders reported num- bers in text extremely important (Hellmeier et al., 2018; Zavarella et al., 2020; Radford, 2021). For instance, the count of injured or missing people 1Code is available online at: https://github.com/mianzg/victim_counts provides quantitative information about the catas- trophic impact of an earthquake. In this work, we focus on human victims in crisis events, e.g., fatal- ities in floods, herein referred to as victim counts. A reliable estimate of victim counts is helpful dur- ing crisis (Darcy and Hofmann, 2003; Kreutzer et al., 2020), and also post-crisis, benefiting re- search to diversify measures of crisis intensity. As of now, most intensity measures are either limited to event types (Vincent, 1979; Goldstein, 1992), fa- tality counts (Kalyvas, 2006; Chaudoin et al., 2017) or both (Stoehr et al., 2022). More fine-grained measures such as injured, displaced, or abused vic- tims are not captured in most popular databases and remain unmonitored (Krause, 2013; Cruyff et al., 2017; Cullen et al., 2021). Many victim counts are reported in full-text form within event descriptions in news media. This makes their systematic collection and anal- ysis technically complex. Manual extraction of victim counts from text is very labor-intensive and does not scale to big data collections (Schrodt and Ulfelder, 2016; Lewis et al., 2016). Computer- ized approaches such as the event coding software Tabari (Schrodt, 2009) and Petrarch2 (Norris et al., 2017) focus on extracting actor and event types. They rely on lambda calculus and syntactic pattern matching, but disregard mentions of victim counts. As we will show, parsing-based approaches per- form decently well at extracting explicitly reported victim counts. They can identify the mention of the count "5" in "5 people were injured". How- ever, they are often inadequate when the descrip- tion implies a correct count - for example, from the description that "one logger was shot but sur- vived", a human reader may infer that one person is injured. Since neither a count nor the injury is mentioned explicitly, a parsing-based system may fall short. Another difficulty stems from the fact that the counts can be reported in many, different formats. A reported count may be digit-based or spelled out, define an exact quantity or a range as in "dozens of people were injured". As a conse- quence, formulating the task of victim count ex- traction is not an easy endeavor (§3). Most prior work assumes a setting where the count is explic- itly mentioned in an event description (Döhling and Leser, 2011; Imran et al., 2013; Rudra et al., 2018; Camilleri et al., 2019). Such settings can be tackled by sequence labeling models that select a relevant span from the given description. However, if the victim count does not appear verbatim, as in the above "one logger" example, models with some form of abstract reasoning capacity may be needed (Roy et al., 2015). Recently, large language models have shown promising results in answer- ing number-focused questions with and without explicit mentions of relevant numbers (Lewkowycz et al., 2022; Nye et al., 2021; Wei et al., 2022; Lefebvre and Stoehr, 2022). This paper is concerned with studying these dif- ferent approaches (§4): as baselines, we compare regular expression, dependency parsing, and se- mantic role labeling. We consider the NT5 (Yang et al., 2021) model as a representative numeracy- enhanced pre-trained language model. We use the representation of this model in a generation, a classification, and a regression setting. We eval- uate all models along three dimensions: accu- racy (§5), reliability (§6), and robustness (§7). We find that the fine-tuned language model outper- forms the baseline models, especially when the victim count extraction requires reasoning. Reli- ability and robustness are particularly important in high-stake, human-centric tasks such as vic- tim count extraction (Zhang et al., 2020; Kong et al., 2020; Russo et al., 2022b). Model relia- bility indicates to which extent model behavior can be trusted within decision-making settings (Leibig et al., 2017; Jiang et al., 2021). One dimension of reliability is model calibration which indicates if a model's confidence is aligned well with it mak- ing correct predictions (Guo et al., 2017). While calibration has been widely studied for classifica- tion, we add to the discussion of calibrated regres- sion (Song et al., 2019) and generation settings (Widmann et al., 2021). Finally, the dimension of robustness describes how stably a model per- forms. For instance, when the training set is lim- ited or when the test data is out-of-distribution, a less robust model will forfeit more of its predic- tive performance. To shed light on this dimension, we conduct experiments in few-shot learning and out-of-distribution settings. We conclude with an application to showcase the extraction of fine-grained and highly special- ized types of victim counts. Lastly, we discuss the benefits and drawbacks of the different approaches to assist practitioners in choosing the most suitable task formulation and model. 2 Data We use publicly available datasets covering natural disasters and armed conflicts, namely: (1) World Atrocities Dataset (WAD) (Schrodt and Ulfelder, 2016), (2) Non-violent and Violent Campaigns and Outcomes 3.0 (NAVCO) (Lewis et al., 2016), and (3) European Media Monitor (EMM) (JRC Sci- ence Hub, 2018; Steinberger et al., 2017). For each dataset, we use the event text description and two types of victim counts: the death count and the injury count that we refer to as "WAD death" or "WAD injury". We pre-process the data by re- moving the samples with missing values (NaN) in the victim counts . For EMM, we only consider samples with a non-zero victim count since "0" is over-represented. 3 Task Formulation In this section, we discuss some questions and chal- lenges faced in formulating the task of extracting victim counts from event descriptions. We justify some of the choices we make and describe why it is not possible to have a single formulation that fits all needs: Is the victim count always present in the text? Victim counts can be expressed in various ways in the text. When the count is expressed explicitly in the text, say "5 people were injured", a span extrac- tion model can effectively extract the injury count 5. However, in certain cases, a single explicit num- ber might not be mentioned, and the victim count needs to be logically or algebraically inferred from the text. Consider the description "a 4-year-old girl and her mother were found dead"; a model would need to logically deduce that the victim count of death is 2. To handle this, we not only look at span extraction models but also experiment with models that can understand the text at a deeper level and produce a victim count. Is the victim count always a single number? Often, in the event description, the victim count is described as a range, such as "at least 330 peo- ple died", or in vague terms, like "dozens were injured". Additionally, even within a description, the victim counts for the same event can be vary- ing, possibly because of recording the counts from different sources. This makes extracting a single exact count almost impossible. In such cases, the best a model can do is to output a close estimate of the actual victim count. Another solution would be to provide a range within which the count could lie. For a humanitarian section deciding on the quantity of aid to be deployed, a range might suffice over a single exact count. To account for this, we also look at models that are trained to output a range by classifying the victim counts into a set of binned categories. 4 Models In §4.1, we introduce baselines models that parse an event description and heuristically extract a vic- tim count. We then specify the model implementa- tion for the different task formulations in §4.2. 4.1 Baseline Models All baselines extract a victim count by locating the part of the text that could be relevant to victims and finding the nearby victim counts. The locating step requires a pre-defined list of words denoted as locating list. For example, to extract death counts, this list would include terms like "kill" and "die". Regex. Regular expressions (regex) is a rule- based method to extract counts by string pattern matching. The patterns (App. A) are built based on active or passive voice to extract a count closest to phrases in the locating list. Dependency Parsing. The dependency parsing model collects all possible numeric modifiers and their dependency relationships. Since not every numeric modifier relates to victim counts, e.g., "42- year-old", we construct dependency rules with the locating list to decide if the number is the victim count. For example, one rule is to check if the numeric modifier is for a subject phrase that would reject "42" in the example of "42-year-old". If no numeric modifier is found (e.g., "a journalist was injured"), additional rules use the locating list to return "1" if the rule is satisfied and otherwise return "0". SRL. Semantic role labeling (SRL) recursively decomposes text input into pairs of predicates and their arguments. We define a list of predicate verbs for death and injury count as the locating list. Then, we iterate over the predicate-argument pairs, check if any predicate from the locating list occurs, and extract the count from its argument if possible. If a predicate exists, the implementation returns the first number as the count if multiple are found and returns "1" if no verbatim number is found. If no such predicate appears, the count is set to "0". 4.2 Task Modeling We perform victim count extraction using three methods: generation, regression, and classifica- tion. As discussed above, each of these approaches caters to the different formulations of our task and can be beneficial in different scenarios. Across these methods, we use the same underlying NT5 model. For clarity, we denote NT5-Gen, NT5-Reg, and NT5-Clf for the corresponding models. The NT5 model (Yang et al., 2021) is a variant of the T5 model (Raffel et al., 2020) with further fine- tuning on numerical tasks. We query the model in a similar fashion to previous works by giving the question and event description in the form: "answer me:[question] context:[passage]". We discuss how we fine-tune this model for each of our specific methods below. Generation. For generation, we fine-tune NT5 to decode the victim counts autoregressively. At inference, we use beam search to generate output. Generation does not guarantee to only generate numeral tokens; therefore, we follow De Cao et al. (2021) to constrain the possible generation tokens in a prefix-conditioned way, such that only number digit tokens 0 − 9 and EOS token are allowed at each decoding step. Regression. For regression, we add two linear layers (with ReLU activation) on the encoder repre- sentation to output the numerical victim count. The model is trained to optimize the log mean-squared error between the true and predicted count. Classification. We model the task as a classifi- cation problem by binning the victim counts into ordinal classes. Similar to regression, the model has a classification head of a linear layer and a softmax layer on top of an encoder initialized with NT5 weights. Our experiments use a 3-class classi- fication by converting the victim counts into three categories: [0, 3], (3, 10], (10, ∞). Figure 1: Confusion matrices of the baselines and the fine-tuned NT5-Gen model (columns) of extracting injury counts from different data (rows). We convert the true and prediction victim counts into 4 categories: for any count y, "0" is y = 0, "1" is 0 < y ≤ 3, "2" is 3 < y ≤ 10 and "3" is y > 10. Values are normalized over true counts. Baselines tend to have low precision on extracting injury counts (dark columns on "0"). SRL and NT5-Gen have comparable accuracy and recall; however, NT5-Gen is slightly better in precision. 5 Accuracy of Counts Extraction We begin by evaluating the efficacy of our proposed methods for victim count extraction. We examine the model accuracy by comparing baselines and the fine-tuned model with a generation objective (§5.1). We then show the results of using classification and regression formulations (§5.2). Exact-Match F1 WAD NAVCO EMM WAD NAVCO EMM Regex Dep SRL 0.117 0.226 0.741 0.264 0.064 0.202 0.303 0.052 0.355 0.318 0.124 0.363 0.136 0.430 0.313 0.779 0.484 0.361 NT5-Gen 0.813 0.501 0.443 0.846 0.544 0.492 Table 1: Exact-Match and F1 scores of the baseline models and the fine-tuned NT5-Gen on injury counts. The best results are bolded. The NT5-Gen model per- forms better than baselines across all datasets. DEP refers to the dependency parsing model and SRL refers to the semantic role labeling model. 5.1 Comparing Baselines with NT5-Gen We compare the accuracy performance of the base- line models and the fine-tuned NT5-Gen model. Tab. 1 shows the results of extracting the injury counts using Exact-Match and F1scores commonly used in related tasks (Yang et al., 2021; Dua et al., 2019). We measure F1 score on digitized tokens (i.e., "34" → ["3", "4"]). The fine-tuned NT5-Gen model has an accuracy boost up by 7-13% in Exact- Match and by 6-13% in F1 score than the strongest baseline model SRL. The performance of regex and dependency parsing varies heavily across different data, which implies that the regex pattern or depen- dency relationship may be less helpful in finding the victim counts. Moreover, we convert the victim counts into four bins, where the bins are selected to have a balanced number of samples in each bin. As an illustra- tion, Fig. 1 shows the confusion matrices on the transformed injury counts. For both victim types, baseline models have a low precision to falsely re- turn "0" too often. Compared with baselines, the NT5-Gen model improves to extract victim counts whose numeric values are large (e.g., y > 10). Qualitative Analysis. We qualitatively examine error samples of the SRL model that the NT5-Gen model extracts correctly. We randomly select 20 error samples for each test set to evaluate and sum- marize 4 types of errors with examples in Tab. 2. Out of all errors2, 39.2% belong to diverse lin- 2There are a few samples where the ground truth might be erroneous. As the event-coding requires more domain expertise within the corresponding social science discipline, we leave the discussion out of this work. 0123wad_injuryREGEXDEPSRLNT5-GEN0123navco_injury01230123emm_injury0123012301230.20.40.60.00.20.40.60.80.00.20.40.60.80.20.40.60.80.20.40.60.80.00.20.40.60.80.20.40.60.80.20.40.60.80.00.20.40.60.00.20.40.60.80.00.20.40.60.00.20.4Prediction LabelTrue Label Error Type Diverse Expression Numerical Reasoning Herders shot and killed four people [...]. Herders Context Six passengers in a taxi also had their throats cut Number Ambiguity Number Spelling then shot and killed a farmer at Jokhana [...] Unidentified gunmen clash with army .Twenty-three people were killed [...] Truth SRL NT5 6 5 0 4 6 5 1 23 0 1 1 23 Table 2: Error examples of SRL that the NT5-Gen model is correct on extracting death counts. Diverse Expression refers to the string patterns not captured by pre-defined rules. Numerical Reasoning shows that the correct count has to be achieved by some mathematical operation over the text. Number Ambiguity indicates that a verbatim number is not written but an estimate may be made (with domain expertise). Number Spelling refers to problems with number / text format that are typos or the tokenizer parses wrongly (e.g., "twenty-three"→ "twenty"). guistic expressions on depicting victims, 38.3% contain number ambiguity, 8.3% need numerical reasoning, and 5.8% have spelling issues (for the tokenizer). The NT5-Gen model performs better when the count needs numerical reasoning. Even if the reasoning is not needed, SRL may fail when the linguistic expression to depict victims (e.g., "have throats cut") is out of the pre-defined locating list (e.g., ["die", "kill", "slay"]). These error types are difficult for baseline models to be improved since the patterns cannot be defined beforehand. 5.2 Results on Classification and Regression We examine the accuracy of the classification and regression formulations by comparing NT5-Clf and NT5-Reg with different initialization weights. To compare, we use T5-SMALL and BERT-BASE- UNCASED pre-trained weights for the encoder. Tab. 3 shows the classification results on NAVCO injury data. Fine-tuning T5-SMALL and NT5 reaches comparable performance; precision and recall scores are similar, but precision is slightly higher. The scatter plots (Fig. 2) show the results of regression using different pre-trained weights with the mean squared error (MSE). For a (log- transformed) victim count larger than 5, using the regression objective seems more conservative in giving small-valued predictions. The numeracy- rich NT5 weights do not particularly improve ac- curacy for a classification or regression objective, and employing some standard pre-trained weights might be sufficient. 6 Evaluating Reliability Another important dimension is reliability which we evaluate through the lens of calibration (§6.1). As we approach the task with multiple formula- Accuracy F1 Precision Recall 0.59 0.59 0.33 0.65 0.60 0.65 0.60 0.52 0.23 0.62 0.61 0.17 NT5 T5 BERT Table 3: Classification results on NAVCO injury data with the NT5-Clf model initialized by different pre- trained weights: NT5, T5-SMALL, and BERT-BASE- UNCASED. F1 , precision and recall scores are macro. Figure 2: Scatter plots of the fine-tuned NT5-Reg model initialized with different pre-trained weights (NT5, T5-SMALL, and BERT-BASE-UNCASED). The models are trained on log-transformed victim counts. tions, calibration analysis is especially needed to understand whether a model is calibrated (§6.2), and how post-hoc calibration techniques may ad- just models to be better calibrated (§6.3). 6.1 Preliminaries: Calibration Metrics A well-calibrated model ensures that the confidence of the output is well aligned with the chance of the output being accurate. This is a desirable property for our task - consider a model extracts "0" when the text depicts an injured person. A calibrated model would assign very low confidence to the ex- tracted count, which may avoid error propagation to downstream decisions, e.g., medical resource dispatch. We here introduce the expected calibra- 05Truth0246PredictionMSE = 1.19NT505TruthMSE = 1.09T505TruthMSE = 1.02BERT tion error (ECE) (Pakdaman Naeini et al., 2015), a standard metric used for classification and is ex- tended for generation decoding (Widmann et al., 2021). For regression, we apply quantile calibra- tion error (Kuleshov et al., 2018). Given n samples, we create M equal-width bins over the interval [0, 1]. ECE takes a weighted av- erage on the differences between the classification accuracy and the mean confidence within each Bm, ECE = M (cid:88) m=1 |Bm| n (cid:12) (cid:12) acc(Bm) − conf(Bm) (cid:12) (cid:12) (cid:12) (cid:12) . (cid:12) (cid:12) The quantile calibration error averages the differ- ences between the empirical frequency freq(Bm) and the upper bound of Bm (i.e., sup(Bm)), where freq(Bm) is the fraction of n samples whose quan- tiles lower or equal to sup(Bm), RegCE = 1 M M (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) freq(Bm) − sup(Bm) (cid:12) (cid:12) (cid:12) (cid:12) m=1 . The calibration error of generation decoding takes the best b beam search answers, and applies softmax on their scores to represent the confidence. The ECE is then calculated on the best beam search answer similar to classification. 6.2 Calibration Error on Different Models Death Injury Data Model Orig Calib. Orig Calib. NAVCO Clf Reg Gen 0.222 0.044 0.332 0.060 0.220 0.097 0.141 0.057 0.054 0.040 0.092 0.092 WAD Clf Reg Gen EMM Clf Reg Gen 0.192 0.055 0.228 0.088 0.272 0.107 0.167 0.294 0.218 0.221 0.096 0.042 0.277 0.098 0.314 0.055 0.201 0.189 0.368 0.188 0.087 0.092 0.328 0.122 Table 4: Calibration errors of fine-tuned NT5-Clf, NT5- Reg, and NT5-Gen models before (Orig.) and after (Calib.) applying post-hoc calibration. Post-hoc cali- bration effectively reduces the errors. We show in Tab. 4 the calibration errors mea- sured on the fine-tuned NT5-Clf, NT5-Reg, and NT5-Gen with different data. Surprisingly, the NT5-Gen model is well-calibrated on most datasets, except for EMM injury: the lowest calibration er- ror is 0.05 on NAVCO death, and the errors on other data range between 0.08 and 0.33. Classi- fication models tend to have large calibration er- rors (> 0.19). In particular, the error is larger than 0.3 on NAVCO and EMM data to classify injury counts. Regression is also prone to large calibration errors (> 0.15). Another helpful tool is the reliability diagrams which visualize the calibration errors at different confidence bins. As an illustration, Fig. 3 shows the diagram of the NT5-Clf model fine-tuned on NAVCO injury data, and the diagonal line indi- cates the perfect calibration. This model is over- confident, and we can observe large gaps when the model confidence is larger than 0.8. Figure 3: Reliability diagrams compare the calibration error before (left) and after (right) post-hoc calibration of the fine-tuned NT5-Clf model using the NAVCO in- jury data. This model is prone to large calibration er- rors (red gaps) in many bins. This is especially true for bins with high model confidence (> 0.8). 6.3 Post-hoc Calibration Since the models can be over-confident based on the above analysis, we see the necessity to calibrate models for victim count extraction. We use temper- ature scaling for classification and generation de- coding, and isotonic regression for regression. The post-hoc calibrators use development data to mini- mize negative log-likelihood and are then applied to test sets to measure calibration errors. As a com- parison, Fig. 3 (right) shows the calibrated results of the fine-tuned NT5-Clf model on NAVCO injury data. The calibration error (i.e., ECE) reduces from 0.33 to 0.06. The errors of other calibrated models can be found in Tab. 4. In general, when the models have rather a large calibration error (e.g., > 0.3), post-hoc calibration is more helpful and adjusts the models to a better-calibrated level. 0.00.20.40.60.81.0Confidence0.00.20.40.60.81.0AccuracyError = 0.33UncalibratedGapOutputs0.00.20.40.60.81.0ConfidenceError = 0.06CalibratedGapOutputs Figure 4: Timeline of victim counts in Syria data from Sept to Nov 2021 as given in the ACLED dataset. We use the NT5-Gen model that is fine-tuned on NAVCO data. Our model can be tested on the extraction of fatality counts which is the only victim count featured in ACLED (Fig. (a)). Beyond fatality counts, it can extract more fine-grained victim types such as (b) injury and (c) abduction counts. Confidence scores are shown for some of the predictions. 7 Evaluating Robustness Typically, conflict or disaster data is noisy and lim- ited. This is making it challenging to train models on a large-scale, high-quality training set. For this reason, we need robust models that excel in few- shot and out-of-distribution settings. Reduced Training Size. We fine-tune the NT5- Gen, NT5-Reg, and NT5-Clf models on different- size portions of the training set. Specifically, we use 100%, 50%, 10%,5%, 0.5% and 0% of the training data and as further discussed in App. C.1. As expected, we find that the accuracy of all mod- els drops when using a smaller training set. The NT5-Gen model reveals to be the most robust in keeping the Exact-Match metric above 0.6 when be- ing fine-tuned on only 5% of the training data. The calibration error of the fine-tuned NT5-Clf model increases when the training size is reduced, while the fine-tuned NT5-Reg and NT5-Gen models do not follow this trend. In the zero-shot setting, the NT5-Reg and NT5-Gen models reach their largest calibration error. In contrast, the NT5-Clf model reaches its smallest calibration error in the zero- shot setting. Out-of-distribution (OOD) Setting. We set up synthetic tasks in which a fine-tuned model is con- fronted with an out-of-distribution setting at test time. For example, we fine-tune a model on WAD death and then repurpose it to classify WAD in- jury. Then, we evaluate the drop in performance of this "out-of-distribution" model compared to an "in-distribution" model, that has been trained on WAD injury labels directly. We conduct this comparison on different datasets and models. In App. C.2, we evaluate the NT5-Clf model in a classification formulation and report accu- racy. As expected, we find that accuracy decreases in every setting with performance drops between 0.001% and 0.3%. In Fig. 15, we evaluate the NT5-Reg model in a regression setting measured in MSE. We find that the performance decreases in the out-of-distribution settings as evidenced by an average increase of 1.12 in MSE. Finally, in Fig. 16, we turn to an NT5-Gen model in a genera- tive setting. As an evaluation metric, we consider Exact-Match and observe a decrease of 0.18 in Exact-Match on average. 8 Application: Overlooked Victim Types Most event datasets feature only one column de- tailing victim counts. This column typically quan- tifies fatalities, as they are considered least am- bivalent and most important (Kalyvas, 2006; Chau- 01234Death Counts0.330.950.650.770.390.760.860.380.95a)TruthNT5-Gen01234Injury Counts0.510.470.770.810.460.540.960.260.94On 24 October 2021, QSD shot and injured a woman in Tal Kifji town in AlHasakeh countryside, for refusing to install a mortar launch pad in herhouse. There were no fatalities.b)NT5-Gen2021-09-022021-09-092021-09-162021-09-232021-09-302021-10-072021-10-142021-10-212021-10-2802468Abduction Counts0.410.680.880.840.960.610.900.470.59On 4 October 2021, QSD carried out a security operation in the first sectionin Hole Camp in Al Hasakeh countryside, and detained two IDP women forunknown reasons.c)NT5-Gen doin et al., 2017). The Armed Conflict Location & Event Data Project (ACLED) (Raleigh et al., 2010; Raleigh and Kishi, 2019) recently published curated datasets containing violence against health- care workers, media personnel, and women. Con- sidering the ACLED dataset on Political Violence Targeting Women & Demonstrations Featuring Women, we find that more than 85% of events have zero fatalities. This means, many forms of violence remain non-quantified, often those against "marginalized" groups of society. Using the methods presented in this work, we can extract much more fine-grained victim types such as "injured women" and "abducted women". To this end, we rely on the NT5-Gen model that we fine-tuned on the NAVCO data, without specif- ically asking for "women". In Fig. 4, we present exemplary two-month time series of events in Syria. We find that our model has a higher recall than pre- cision on the ground truth annotations for fatality counts. This may be desirable since we would like to avoid overlooking true victim counts. 9 Discussion This work surveys different task formulations of victim count extraction and inspects desiderata like accuracy, reliability, and robustness of different models. We now summarize our findings and con- clude which approach performs best under which circumstances (Tab. 5). Some of the parsing-based approaches have the advantage of requiring no ground truth annotations of the extracted victim counts. This means, there is no need for training, but instead, a manually cu- rated list of patterns and rules has to be assembled. The regex approach, for instance, has minimum re- quirements regarding hardware, but writing regex patterns is very time-intensive and can be prone to mistakes. Overall, the baseline models shine when it comes to speed, and they perform reasonable when victim counts are explicitly mentioned. Yet they fail at complex reasoning. For instance, when asking for the count of deaths in "one child and four women lost their lives", all baselines mistakenly output "1". This is where language model-based methods have a competitive edge. The fine-tuned NT5-Gen model has high accuracy both in Exact-Match met- ric and relative error metric. Surprisingly, it is also well-calibrated and relatively robust in the few-shot and out-of-distribution setting. This performance comes at the costs of reduced speed, the require- ment of large amounts of training data, and the need for resources like GPUs to be deployed on a large scale. Comparing classification and regression objec- tives, we conclude that classification is easier to handle. In most settings, it may be sufficient to ex- tract a range rather than an exact number anyways. In comparison to generation, in classification and regression settings, models show higher calibration errors and require post-hoc calibration to adjust the model confidence. 10 Related Works This work interfaces with related works from dif- ferent disciplines to improve the measurement of crisis intensity. It draws inspiration from recent advancements in question answering models with a focus on numbers and math word problems. This includes number-enhanced language models more generally. Our work also connects with model cali- bration in natural language processing (NLP) more generally. Measurement of Crisis Intensity. Extracting in- formation about crises has been widely explored us- ing social media data (Temnikova et al., 2015) and newspapers (Keith et al., 2017; Halterman et al., 2021). Most existing measures of crisis intensity focus on counts of event types (Goldstein, 1992; Terechshenko, 2020; Stoehr et al., 2022) or fatal- ity counts (Kalyvas, 2006). Previous work studies friend-enemy relationships (Han et al., 2019; Russo et al., 2022a; Stoehr et al., 2021, 2023) and conflict- indicative changes in word embeddings (Kutuzov et al., 2017). Numerical Question Answering. Numerical Question Answering pertains to the task of pro- viding numeric answers to questions. An exem- plary model is NAQANet (Dua et al., 2019), which extends QANet (Yu et al., 2018) with numerical operations. Neural Module Networks (Gupta et al., 2020) learn and execute a chain of logical learnable and differentiable modules. Some of these modules are specifically targeted at mathematical operations such find-num or count. Other approaches lever- age knowledge graphs (Davidov and Rappoport, 2010; Kotnis and García-Durán, 2019) or graph neural networks (Chen et al., 2020). Thawani et al. (2021) provides a detailed overview over methods for representing and modeling numbers in NLP. Accuracy Optimization Reliability Robustness Hardware Absolute Error Relative Error String Match Need Training Stable in OOD REGEX High Medium Medium Medium High Low-Medium DEP SRL CLF REG GEN Low-Medium Medium N/A Low Low N/A Low Low High N/A N/A N/A N/A N/A Low Low No No No Medium-High N/A N/A N/A Low Low Low Low-Medium Medium - High High Low-Medium Medium - High Medium-High High Low-Medium Medium-High High Table 5: Overview of pros and cons of different models. We list baselines: regular expressions (REGEX), dependency parsing (DEP), and semantic role labeling (SRL). The CLF, REG, GEN refer to the fine-tuned NT5-Clf, NT5-Reg, and NT5-Gen models. Absolute / Relative Error pertains to the absolute/relative error between true victim counts and model predictions taking the real numerical value of the counts (e.g., mean squared error). String Match considers string metrics like Exact-Match used in question answering. The reliability column is based on experiments in model calibration. Robustness is divided into the need for training on a large annotated dataset and the stability in out-of-distribution (OOD). N/A means "Not Applicable". Number-enhanced Language Models. More recent work in number question answering re- lies on pre-trained large language models. Gen- BERT (Geva et al., 2020) improves numeric rea- soning abilities by including a large amount of synthetic data containing numbers. Codex (Chen et al., 2021) and NT5 (Yang et al., 2021) apply similar strategies and are trained on code and math word problems. Other approaches focus on step-by- step reasoning such as Minerva (Lewkowycz et al., 2022), scratchpad (Nye et al., 2021) and chain-of- thought prompting (Wei et al., 2022). Lefebvre and Stoehr (2022) propose a prompting-based method particularly for conflict event classification. Calibration of NLP Models. The calibration of NLP models has been extensively studied in clas- sification (Guo et al., 2017) and structured pre- diction tasks (Kuleshov and Liang, 2015; Nguyen and O'Connor, 2015). Calibration methods have been adapted in language modeling (Braverman et al., 2020; Kong et al., 2020), question answer- ing (Kamath et al., 2020; Jiang et al., 2021), and machine translation (Kumar and Sarawagi, 2019; Wang et al., 2020). 11 Conclusion We presented victim count extraction, a challenging and impactful task. The task can be tackled using different formulations and models. Models should be evaluated along different dimensions such as accuracy, reliability, and robustness. We survey this ambiguity of victim count extraction, identify promising directions, and discuss outlooks and ap- plications. Acknowledgments We would like to thank and acknowledge ideas, input, support and feedback from Leonie Muggen- thaler, Ryan Cotterell as well as the anonymous reviewers. Niklas Stoehr is supported by a scholar- ship from the Swiss Data Science Center (SDSC). Limitations The models may be biased or reproduce biases inherent in their training data. Presenting unrelated, faulty or immoral questions to a model can cause unguided and malicious behavior. For example, we caution of asking questions such as "How many people will be injured...?"; and even worse "How many people should be injured...?". Improving model calibration will help defending against these issues and enable awareness of when to abstain from answering. Ethics Statement This work originated from the motivation to diver- sify victim count extraction towards underrepre- sented victim types and overlooked forms of vi- olence. This work ultimately intends to assist re- searchers and analysts in the sector of humanitarian aid who are in demand of accurate victim count in- formation. References Mark Braverman, Xinyi Chen, Sham Kakade, Karthik Narasimhan, Cyril Zhang, and Yi Zhang. 2020. Cali- bration, entropy rates, and memory in language mod- els. In Proceedings of the 37th International Confer- ence on Machine Learning, volume 119 of Proceed- ings of Machine Learning Research, pages 1089– 1099. PMLR. Stephen Camilleri, Joel Azzopardi, and Matthew R. Agius. 2019. Investigating the relationship between earthquakes and online news. In 2019 IEEE Second International Conference on Artificial Intelligence and Knowledge Engineering (AIKE), page 203–210. Stephen Chaudoin, Zachary Peskowitz, and Christo- pher Stanton. 2017. Beyond zeroes and ones: The intensity and dynamics of civil conflict. The Jour- nal of Conflict Resolution, 61(1):56–83. Publisher: Sage Publications, Inc. Kunlong Chen, Weidi Xu, Xingyi Cheng, Zou Xi- aochuan, Yuyu Zhang, Le Song, Taifeng Wang, Yuan Qi, and Wei Chu. 2020. Question directed graph attention network for numerical reasoning In Proceedings of the 2020 Conference over text. on Empirical Methods in Natural Language Process- ing (EMNLP), pages 6759–6768, Online. Associa- tion for Computational Linguistics. Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Ka- plan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sas- try, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cum- mings, Matthias Plappert, Fotios Chantzis, Eliza- beth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welin- der, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. 2021. Eval- uating large language models trained on code. In arXiv, volume 2107.03374. Maarten Cruyff, Jan van Dijk, and Peter G. M. van der Heijden. 2017. The challenge of counting victims of human trafficking: Not on the record: A multiple systems estimation of the numbers of human traffick- ing victims in the Netherlands in 2010–2015 by year, age, gender, and type of exploitation. CHANCE, 30(3):41–49. Patricia Cullen, Myrna Dawson, Jenna Price, and James Rowlands. 2021. Intersectionality and invis- ible victims: Reflections on data challenges and vi- carious trauma in femicide, family and intimate part- ner homicide research. Journal of Family Violence, 36(5):619–628. Dmitry Davidov and Ari Rappoport. 2010. Extraction and approximation of numerical attributes from the web. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, page 1308–1317, Uppsala, Sweden. Association for Com- putational Linguistics. Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. 2021. Autoregressive entity retrieval. In 9th International Conference on Learning Repre- sentations (ICLR), Virtual Event, Austria. Dheeru Dua, Yizhong Wang, Pradeep Dasigi, Gabriel Stanovsky, Sameer Singh, and Matt Gardner. 2019. DROP: A reading comprehension benchmark requir- ing discrete reasoning over paragraphs. In Proceed- ings of the 2019 Conference of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 2368–2378, Min- neapolis, Minnesota. Association for Computational Linguistics. Lars Döhling and Ulf Leser. 2011. EquatorNLP: Pattern-based information extraction for disaster re- sponse. In Terra Cognita 2011 Workshop, Founda- tions, Technologies and Applications of the Geospa- tial Web, volume 38, Bonn, Germany. Mor Geva, Ankit Gupta, and Jonathan Berant. 2020. Injecting numerical reasoning skills into language In Proceedings of the 58th Annual Meet- models. ing of the Association for Computational Linguis- tics, pages 946–958, Online. Association for Com- putational Linguistics. Joshua Goldstein. 1992. A conflict-cooperation scale for WEIS events data. The Journal of Conflict Reso- lution, 36(2):369–385. Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. 2017. On calibration of modern neu- In Proceedings of the 34th Interna- ral networks. tional Conference on Machine Learning - Volume 70, ICML'17, page 1321–1330, Sydney, Australia. JMLR.org. Nitish Gupta, Kevin Lin Lin, Dan Roth, Sameer Singh, and Matt Gardner. 2020. Neural module networks In 8th International Con- for reasoning over text. ference on Learning Representations (ICLR), Addis Ababa, Ethiopia. Andrew Halterman, Katherine Keith, Sheikh Sarwar, and Brendan O'Connor. 2021. Corpus-level evalu- ation for event QA: The IndiaPoliceEvents corpus covering the 2002 Gujarat violence. In Findings of the Association for Computational Linguistics: ACL- IJCNLP, pages 4240–4253, Online. James Darcy and Charles-Antoine Hofmann. 2003. Ac- cording to need? Needs assessment and decision- making in the humanitarian sector. Technical report, Overseas Development Institute. Xiaochuang Han, Eunsol Choi, and Chenhao Tan. 2019. No permanent friends or enemies: Tracking rela- In Proceed- tionships between nations from news. ings of the 2019 Conference of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies, volume 1, pages 1660–1676. Sebastian Hellmeier, Nils B. Weidmann, and Espen Geelmuyden Rød. 2018. In the spotlight: Analyzing sequential attention effects in protest reporting. Po- litical Communication, 35(4):587–611. Publisher: Routledge. Muhammad Imran, Shady Elbassuoni, Carlos Castillo, Fernando Diaz, and Patrick Meier. 2013. Practical extraction of disaster-relevant information from so- cial media. In Proceedings of the 22nd International Conference on World Wide Web, page 1021–1024, Rio de Janeiro, Brazil. ACM. Zhengbao Jiang, Jun Araki, Haibo Ding, and Graham Neubig. 2021. How can we know when language models know? On the calibration of language mod- els for question answering. Transactions of the Asso- ciation for Computational Linguistics, 9:962–977. JRC Science Hub. 2018. European media monitor (EMM). Technical report, Joint Research Center Science Hub. Stathis N. Kalyvas. 2006. The Logic of Violence in Civil War. Cambridge University Press, Cambridge. Amita Kamath, Robin Jia, and Percy Liang. 2020. Se- lective question answering under domain shift. In Proceedings of the 58th Annual Meeting of the Asso- ciation for Computational Linguistics, pages 5684– 5696, Online. Association for Computational Lin- guistics. Katherine Keith, Abram Handler, Michael Pinkham, Cara Magliozzi, Joshua McDuffie, and Brendan O'Connor. 2017. Identifying civilians killed by po- lice with distantly supervised entity-event extrac- In Proceedings of the 2017 Conference on tion. Empirical Methods in Natural Language Process- ing, Copenhagen, Denmark. Association for Com- putational Linguistics. Lingkai Kong, Haoming Jiang, Yuchen Zhuang, Jie Lyu, Tuo Zhao, and Chao Zhang. 2020. Cali- brated language model fine-tuning for in- and out-of- distribution data. In Proceedings of the 2020 Con- ference on Empirical Methods in Natural Language Processing (EMNLP), pages 1326–1340, Online. As- sociation for Computational Linguistics. Bhushan Kotnis and Alberto García-Durán. 2019. Learning numerical attributes in knowledge bases. In 1st Conference on Automated Knowledge Base Construction, AKBC 2019, Amherst, MA, USA, May 20-22, 2019. Keith Krause. 2013. Challenges to counting and clas- sifying victims of violence in conflict, post-conflict, and non-conflict settings. In Counting Civilian Ca- sualties: An Introduction to Recording and Estimat- ing Nonmilitary Deaths in Conflict. Oxford Univer- sity Press. Tino Kreutzer, Patrick Vinck, Phuong N. Pham, Ai- jun An, Lora Appel, Eric DeLuca, Grace Tang, Muath Alzghool, Kusum Hachhethu, Bobi Mor- ris, Sandie L. Walton-Ellery, John Crowley, and James Orbinski. 2020. Improving humanitarian needs assessments through natural language process- IBM Journal of Research and Development, ing. 64(1/2):9:1–9:14. Volodymyr Kuleshov, Nathan Fenner, and Stefano Er- mon. 2018. Accurate uncertainties for deep learning In Proceedings of the using calibrated regression. 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Re- search, pages 2796–2804. PMLR. Volodymyr Kuleshov and Percy S Liang. 2015. Cali- brated structured prediction. In Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc. Aviral Kumar and Sunita Sarawagi. 2019. Calibration of encoder decoder models for neural machine trans- lation. In arXiv, volume 1903.00802. Andrey Kutuzov, Erik Velldal, and Lilja Øvrelid. 2017. Tracing armed conflicts with diachronic word em- bedding models. In Proceedings of the Events and Stories in the News Workshop, pages 31–36. Clement Lefebvre and Niklas Stoehr. 2022. Rethinking the event coding pipeline with prompt entailment. In arXiv, volume 2210.05257. Christian Leibig, Vaneeda Allken, Murat Seçkin Ayhan, Philipp Berens, and Siegfried Wahl. 2017. Lever- aging uncertainty information from deep neural net- Scientific Reports, works for disease detection. 7(1):17816. Raphael Lepuschitz and Niklas Stoehr. 2021. Seismo- graphAPI: Visualising temporal-spatial crisis data. In arXiv, volume 2107.12443. Orion A. Lewis, Erica Chenoweth, and Jonathan Pinck- ney. 2016. Nonviolent and violent campaigns and outcomes 3.0: Effects of tactical choices on strate- gic outcomes codebook. Technical Report Version 0.9b5, Sie Cheou-Kang Center for International Se- curity and Diplomacy University of Denver. Aitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer, Henryk Michalewski, Vinay Ramasesh, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam Neyshabur, Guy Gur-Ari, and Vedant Misra. 2022. Solving quantita- tive reasoning problems with language models. In arXiv, volume 2206.14858. Khanh Nguyen and Brendan O'Connor. 2015. Pos- terior calibration and exploratory analysis for natu- ral language processing models. In Proceedings of the 2015 Conference on Empirical Methods in Nat- ural Language Processing, pages 1587–1598, Lis- bon, Portugal. Association for Computational Lin- guistics. Clayton Norris, Philip Schrodt, and John Beieler. 2017. PETRARCH2: Another event coding program. The Journal of Open Source Software, 2(9). Maxwell Nye, Anders Johan Andreassen, Guy Gur-Ari, Henryk Michalewski, Jacob Austin, David Bieber, David Dohan, Aitor Lewkowycz, Maarten Bosma, David Luan, Charles Sutton, and Augustus Odena. 2021. Show your work: Scratchpads for interme- diate computation with language models. In arXiv, volume 2112.00114. Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. 2015. Obtaining well calibrated prob- abilities using bayesian binning. In Proceedings of the AAAI Conference on Artificial Intelligence, vol- ume 29. Benjamin J. Radford. 2021. Automated dictionary gen- eration for political eventcoding. Political Science Research and Methods, 9(1):157–171. Colin Raffel, Noam Shazeer, Adam Roberts, Kather- ine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to- text Transformer. Journal of Machine Learning Re- search, 21(140):1–67. Clionadh Raleigh and Roudabeh Kishi. 2019. Compar- ing conflict data – Similarities and differences across datasets. ACLED Report, The Armed Conflict Loca- tion & Event Data Project (ACLED). Clionadh Raleigh, Andrew Linke, Håvard Hegre, and Joakim Karlsen. 2010. Introducing ACLED-armed conflict location and event data. Journal of Peace Research, 47(5):651–660. Subhro Roy, Tim Vieira, and Dan Roth. 2015. Reason- ing about quantities in natural language. Transac- tions of the Association for Computational Linguis- tics, 3:1–13. Koustav Rudra, Niloy Ganguly, Pawan Goyal, and Sap- tarshi Ghosh. 2018. Extracting and summarizing situational information from the Twitter social me- dia during disasters. ACM Transactions on the Web, 12(3):1–35. Giuseppe Russo, Christoph Gote, Laurence Branden- berger, Sophia Schlosser, and Frank Schweitzer. 2022a. Disentangling active and passive cospon- In arXiv, volume sorship in the U.S. congress. 2205.09674. Giuseppe Russo, Manoel Horta Ribeiro, Giona Casir- aghi, and Luca Verginer. 2022b. Understanding on- line migration decisions following the banning of radical communities. In arXiv, volume 2212.04765. Philip A. Schrodt. 2009. TABARI: Textual analysis by augmented replacement instructions. Technical Re- port 0.7, Parus Analytics. Philip A. Schrodt and Jay Ulfelder. 2016. Political in- stability task force atrocities event data collection codebook. Technical Report Version 1.1b1, Parus Analytics. Hao Song, Tom Diethe, Meelis Kull, and Peter Flach. 2019. Distribution calibration for regression. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Ma- chine Learning Research, pages 5897–5906. PMLR. Ralf Steinberger, Martin Atkinson, Teofilo Domingo, Erik van der Goot, Jens Linge, Charles Macmillan, Hristo Tanev, and Gerhard Wagner. 2017. EMM: Supporting the Analyst by Turning Multilingual Text into Structured Data. Erich Schmidt Verlag, Berlin, Germany. Niklas Stoehr, Lucas Torroba Hennigen, Josef Valvoda, Robert West, Ryan Cotterell, and Aaron Schein. 2022. An ordinal latent variable model of conflict intensity. In arXiv, volume 2210.03971. Niklas Stoehr, Benjamin J. Radford, Ryan Cotterell, and Aaron Schein. 2023. The Ordered Matrix Dirichlet for modeling ordinal dynamics. In arXiv, volume 2212.04130. Niklas Stoehr, Lucas Torroba Hennigen, Samin Ahbab, Robert West, and Ryan Cotterell. 2021. Classifying dyads for militarized conflict analysis. In Proceed- ings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 7775–7784, Online and Punta Cana, Dominican Republic. Asso- ciation for Computational Linguistics. Irina P. Temnikova, Carlos Castillo, and Sarah Vieweg. 2015. EMTerms 1.0: A terminological resource for In 12th Proceedings of the Interna- crisis tweets. tional Conference on Information Systems for Crisis Response and Management, Krystiansand, Norway. ISCRAM Association. Zhanna Terechshenko. 2020. Hot under the collar: A Journal of latent measure of interstate hostility. Peace Research, 57(6):764–776. Avijit Thawani, Jay Pujara, Filip Ilievski, and Pedro Szekely. 2021. Representing numbers in NLP: a sur- vey and a vision. In Proceedings of the 2021 Con- ference of the North American Chapter of the Asso- ciation for Computational Linguistics: Human Lan- guage Technologies, pages 644–656, Online. Asso- ciation for Computational Linguistics. Jack Vincent. 1979. Project theory. Lanham M.D. Uni- versity Press of America. Shuo Wang, Zhaopeng Tu, Shuming Shi, and Yang Liu. 2020. On the inference calibration of neural ma- chine translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Lin- guistics, pages 3070–3079, Online. Association for Computational Linguistics. Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou. 2022. Chain-of-thought prompt- ing elicits reasoning in large language models. In arXiv, volume 2201.11903. fine-tuned NT5-Gen model. Similar to the results on the injury counts Tab. 1, the fine-tuned NT5- Gen model performs better than all baselines and the SRL has the best accuracy among baselines. David Widmann, Fredrik Lindsten, and Dave Zachariah. 2021. Calibration tests beyond classifica- tion. In 9th International Conference on Learning Representations (ICLR), Virtual Event, Austria. Peng-Jian Yang, Ying Ting Chen, Yuechan Chen, and Daniel Cer. 2021. NT5?! Training T5 to perform numerical reasoning. In arXiv, volume 2104.07307. Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui Zhao Zhao, Kai Chen, Mohammad Norouzi Norouzi, and Quoc V. Le. 2018. QANet: Combin- ing local convolution with global self-attention for In 6th International Con- reading comprehension. ference on Learning Representations (ICLR), Van- couver, BC, Canada. Vanni Zavarella, Jakub Piskorski, Camelia Ignat, Hristo Tanev, and Martin Atkinson. 2020. Master- ing the media hype: Methods for deduplication of conflict events from news reports. In Proceedings of the first ings of the first AI4Narratives Workshop. Yunfeng Zhang, Q. Vera Liao, and Rachel K. E. Bel- lamy. 2020. Effect of confidence and explanation on accuracy and trust calibration in AI-assisted de- cision making. In Proceedings of the 2020 Confer- ence on Fairness, Accountability, and Transparency, FAT* '20, page 295–305, New York, NY, USA. As- sociation for Computing Machinery. A Regex Patterns We convert any non-digitized numeral expressions into a digitized format (e.g. twelve → 12). Regex patterns are designed for both passive and active voices. We also distinguish plural ("are" and "were") and singular forms ("is", "was") for pas- sive voice patterns. The algorithm checks with the following order: passive plural, passive single, and active. If multiple numbers are extracted, the first is kept. We list the regex patterns used to extract victim counts in Tab. 6, for death counts and injury counts respectively. B Accuracy Evaluation In this section, we complement the accuracy evalu- ation of the models in §5. B.1 Exact-Match and F1 score on Death Counts The Exact-Match and F1 scores on extracting the death counts are shown in Tab. 7, which compares the performance of the baseline models and the B.2 Confusion Matrix on Death Counts Similar to Fig. 1 shown in §5.1, Fig. 5 plots the confusion matrices of the binned death counts for the different datasets, which compare the accuracy of the baseline models with the fine-tuned NT5- Gen model. B.3 Results on Classification and Regression In §5.2, we have shown the results of the NT5- Clf model and the NT5-Reg model fine-tuned on NAVCO injury counts in Tab. 3. Here, we use the same metrics and display the classification performance on other datasets. In specific, Tab. 8, Tab. 9, Tab. 10, Tab. 11, and Tab. 12 respectively show the classification performance of the NT5-Clf model fine-tuned on WAD death counts, WAD injury counts, NAVCO death counts, EMM death counts, and EMM injury counts. Similarly, we provide the scatter plots of the fine-tuned NT5-Reg models initialized with dif- ferent pre-trained weights in this section: WAD death counts (Fig. 6), WAD injury counts (Fig. 7), NAVCO death counts (Fig. 8), EMM death counts (Fig. 9), and EMM injury counts (Fig. 10). C Robustness Evaluation In this section, we provide the detailed performance of the few-shot setting (App. C.1) and the out-of- distribution setting (App. C.2) discussed in §7. C.1 Few-shot Performance We display the results of the few-shot settings where different proportions of the training set are used to fine-tune the models. For each formula- tion, the left figure is the variation of the accuracy metrics and the right figure is the variation of the calibration error. Fig. 11, Fig. 12, and Fig. 13 are performance of the few-shot settings of the fine- tuned NT5-Clf, NT5-Reg, and NT5-Gen models respectively. With respect to accuracy metrics, the classifica- tion accuracy and the F1 score is plotted for the fine-tuned NT5-Clf model. For the regression, we plot the change of mean squared error on the log transformed counts. In addition, we plot the pinball losses using two tar- geting quantile (at 10% and at 90%). Data Type Regex Type Regex Pattern Death Injury Passive Plural Passive Singular \S*(?!\D*(injur|wound))(?=.*(\b(was|is)\D*\b(killed|dead|died|slain))) \d(\d|,)*(?!\D*(injur|wound))(?=.*(\b(were|are)\D*\b(killed|dead|died|slain))) Active (kill|slay|slain)\D*\b\d(\d|,)* Passive Plural Passive Singular \S*(?=(was|is).*\b(injur|wound))(?!\D*(\b(were|are)\D*\b(killed|dead|died|slain))) \d(\d|,)*(?!.*(\b(were|are)?\D*\b(killed|dead|died|slain)))(?=.*\b(injur|wound)) Active (injured?|wound)\D*\d+ Table 6: Regex patterns. Figure 5: Confusion matrices of baseline models and fine-tuned NT5-Gen model (columns) of extracting death counts from different data (rows). We convert the true victim counts and model predictions into 4 categories: for any count y, "0" is y = 0, "1" is 0 < y ≤ 3, "2" is 3 < y ≤ 10 and "3" is y > 10. Values are normalized over true counts. Exact Match F1 WAD NAVCO EMM WAD NAVCO EMM 0.4196 0.3242 0.3792 0.1317 0.4837 0.3613 0.5436 0.4917 0.3921 0.2835 0.3897 0.3526 0.0767 0.2064 0.4839 0.3972 0.7794 0.6590 0.6322 0.8458 Regex 0.3543 0.1506 Dep 0.4342 SRL 0.6798 NT5 Table 7: Exact-Match and F1 scores of the baseline models and the fine-tuned NT5-Gen model on death counts. Best metrics are bolded. DEP refers to the de- pendency parsing model and SRL refers to the semantic role labeling model. Lastly, the Exact-Match and the F1 scores are drawn for the fine-tuned NT5-Gen model. C.2 Out-of-distribution Setting For each task formulation, we examine the accu- racy performance in the out-of-distribution setting for (Fig. 14), NT5- Reg (Fig. 15), and NT5-Gen (Fig. 16). For all plots, the fine-tuned NT5-Clf Accuracy F1 score Precision Recall NT5 T5 BERT 0.81 0.81 0.86 0.81 0.81 0.86 0.80 0.81 0.86 0.83 0.84 0.88 Table 8: Classification results on WAD death counts with the NT5-Clf model initialized by different pre- trained weights: NT5, T5-SMALL, and BERT-BASE- UNCASED. F1 , precision and recall scores are macro. Accuracy F1 score Precision Recall NT5 T5 BERT 0.77 0.76 0.93 0.69 0.69 0.91 0.70 0.70 0.91 0.69 0.68 0.90 Table 9: Classification results on WAD injury counts with the NT5-Clf model initialized by different pre- trained weights: NT5, T5-SMALL, and BERT-BASE- UNCASED. F1 , precision and recall scores are macro. 0123wad_deathREGEXDEPSRLNT5-GEN0123navco_death01230123emm_death0123012301230.00.20.40.60.80.00.20.40.60.80.00.20.40.60.00.20.40.60.80.20.40.60.80.00.20.40.60.80.20.40.60.80.20.40.60.80.00.20.40.60.00.20.40.60.80.00.20.40.00.20.40.6Prediction LabelTrue Label Accuracy F1 score Precision Recall NT5 T5 BERT 0.65 0.65 0.52 0.60 0.60 0.23 0.62 0.61 0.17 0.59 0.59 0.33 Table 10: Classification results on NAVCO death counts with the NT5-Clf model initialized by different pre-trained weights: NT5, T5-SMALL, and BERT-BASE- UNCASED. F1 , precision and recall scores are macro. Accuracy F1 score Precision Recall NT5 T5 BERT 0.72 0.70 0.84 0.65 0.63 0.80 0.66 0.65 0.82 0.65 0.63 0.78 Table 11: Classification results on EMM death counts with the NT5-Clf model initialized by different pre- trained weights: NT5, T5-SMALL, and BERT-BASE- UNCASED. F1 , precision and recall scores are macro. Accuracy F1 score Precision Recall NT5 T5 BERT 0.68 0.68 0.81 0.58 0.58 0.77 0.60 0.59 0.79 0.57 0.57 0.76 Table 12: Classification results on EMM injury counts with the NT5-Clf model initialized by different pre- trained weights: NT5, T5-SMALL, and BERT-BASE- UNCASED. F1 , precision and recall scores are macro. Figure 7: Scatter plots of the fine-tuned NT5-Reg model initialized with different pre-trained weights (NT5, T5-SMALL, and BERT-BASE-UNCASED). The models are trained on log-transformed victim counts of WAD injury. Figure 8: Scatter plots of the fine-tuned NT5-Reg model initialized with different pre-trained weights (NT5, T5-SMALL, and BERT-BASE-UNCASED). The models are trained on log-transformed victim counts of NAVCO death. Figure 9: Scatter plots of the fine-tuned NT5-Reg model initialized with different pre-trained weights (NT5, T5-SMALL, and BERT-BASE-UNCASED). The models are trained on log-transformed victim counts. the classification setting, we show the variation in classification accuracy. For the regression set- ting, we show the variation in mean squared errors. For the generation setting, we show the change in Exact-Match scores. Figure 6: Scatter plots of the fine-tuned NT5-Reg model initialized with different pre-trained weights (NT5, T5-SMALL, and BERT-BASE-UNCASED). The models are trained on log-transformed victim counts of WAD death. the x-axis is the accuracy metric used in each task formulation, and the y-axis indicates the test set to be made inferences on. The red bar indicates the performance of in-distribution performance, e.g., accuracy of WAD death test data using the model fine-tuned on WAD death. With respect to the accuracy metric, different formulations use their corresponding metric. For 510Truth0246PredictionNT5MSE = 0.72510TruthT5MSE = 0.43510TruthBERTMSE = 0.2405Truth02468PredictionNT5MSE = 0.8905TruthT5MSE = 0.8905TruthBERTMSE = 0.3805Truth0246PredictionNT5MSE = 0.8805TruthT5MSE = 0.5705TruthBERTMSE = 0.4301020Truth0.02.55.07.510.0PredictionNT5MSE = 2.0901020TruthT5MSE = 1.7601020TruthBERTMSE = 1.05 Figure 10: Scatter plots of the fine-tuned NT5-Reg model initialized with different pre-trained weights (NT5, T5-SMALL, and BERT-BASE-UNCASED). The models are trained on log-transformed victim counts. Figure 14: Classification accuracy for using the fine-tuned NT5-Clf models on out-of-distribution data (blue) and on in-distribution data (red) Figure 11: Few-shot performance of the fine-tuned clas- sification model on WAD death counts. Figure 15: Mean squared error for using the fine-tuned NT5-Reg models on out-of-distribution data (blue) and on in-distribution data (red) Figure 12: Few-shot performance of the fine-tuned re- gression model on WAD death counts. Figure 13: Few-shot performance of the fine-tuned NT5-Gen model on WAD death counts. Figure 16: Exact-Match for using the fine-tuned NT5- Gen models on out-of-distribution data (blue) and on in-distribution data (red) 510Truth0.02.55.07.5PredictionNT5MSE = 2.91510TruthT5MSE = 1.35510TruthBERTMSE = 0.94All50%10%5%0.5%No0.00.20.40.60.81.0AccuracyF1 scoreAll50%10%5%0.5%NoTraining Size Proportion0.150.200.250.300.35Calibration ErrorAll50%10%5%0.5%No101100101MSEPinball loss(=0.1)Pinball loss(=0.9)All50%10%5%0.5%NoTraining Size Proportion0.150.200.250.300.350.400.45Calibration ErrorAll50%10%5%0.5%No0.00.20.40.60.81.0Exact MatchF1 scoreAll50%10%5%0.5%NoTraining Size Proportion0.090.100.110.120.130.14Calibration ErrorEMM DEATHEMM INJURYNAVCO DEATHNAVCO INJURYWAD DEATHWAD INJURYModel fine-tuned on WAD DEATHModel fine-tuned on NAVCO DEATHModel fine-tuned on EMM DEATH0.00.51.0EMM DEATHEMM INJURYNAVCO DEATHNAVCO INJURYWAD DEATHWAD INJURYModel fine-tuned on WAD INJURY0.00.51.0Model fine-tuned on NAVCO INJURY0.00.51.0Model fine-tuned on EMM INJURYClassification: AccuracyEMM DEATHEMM INJURYNAVCO DEATHNAVCO INJURYWAD DEATHWAD INJURYModel fine-tuned on WAD DEATHModel fine-tuned on NAVCO DEATHModel fine-tuned on EMM DEATH024EMM DEATHEMM INJURYNAVCO DEATHNAVCO INJURYWAD DEATHWAD INJURYModel fine-tuned on WAD INJURY024Model fine-tuned on NAVCO INJURY024Model fine-tuned on EMM INJURYRegression: MSEEMM DEATHEMM INJURYNAVCO DEATHNAVCO INJURYWAD DEATHWAD INJURYModel fine-tuned on WAD DEATHModel fine-tuned on NAVCO DEATHModel fine-tuned on EMM DEATH0.00.51.0EMM DEATHEMM INJURYNAVCO DEATHNAVCO INJURYWAD DEATHWAD INJURYModel fine-tuned on WAD INJURY0.00.51.0Model fine-tuned on NAVCO INJURY0.00.51.0Model fine-tuned on EMM INJURYText-to-text: Exact Match
http://arxiv.org/abs/2302.12366v2
2023-02-28T04:16:53
2023-02-23T23:48:20
Less is More: Data Pruning for Faster Adversarial Training
Deep neural networks (DNNs) are sensitive to adversarial examples, resulting in fragile and unreliable performance in the real world. Although adversarial training (AT) is currently one of the most effective methodologies to robustify DNNs, it is computationally very expensive (e.g., 5-10X costlier than standard training). To address this challenge, existing approaches focus on single-step AT, referred to as Fast AT, reducing the overhead of adversarial example generation. Unfortunately, these approaches are known to fail against stronger adversaries. To make AT computationally efficient without compromising robustness, this paper takes a different view of the efficient AT problem. Specifically, we propose to minimize redundancies at the data level by leveraging data pruning. Extensive experiments demonstrate that the data pruning based AT can achieve similar or superior robust (and clean) accuracy as its unpruned counterparts while being significantly faster. For instance, proposed strategies accelerate CIFAR-10 training up to 3.44X and CIFAR-100 training to 2.02X. Additionally, the data pruning methods can readily be reconciled with existing adversarial acceleration tricks to obtain the striking speed-ups of 5.66X and 5.12X on CIFAR-10, 3.67X and 3.07X on CIFAR-100 with TRADES and MART, respectively.
[ "Yize Li", "Pu Zhao", "Xue Lin", "Bhavya Kailkhura", "Ryan Goldhahn" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12366v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12366v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV" ]
Less is More: Data Pruning for Faster Adversarial Training Yize Li1,†, Pu Zhao1, Xue Lin1, Bhavya Kailkhura2 and Ryan Goldhahn2 1Northeastern University, 360 Huntington Ave, Boston, MA 02115 2Lawrence Livermore National Laboratory, 7000 East Ave, Livermore, CA 94550 Abstract Deep neural networks (DNNs) are sensitive to adversarial examples, resulting in fragile and unreliable performance in the real world. Although adversarial training (AT) is currently one of the most effective methodologies to robustify DNNs, it is computationally very expensive (e.g., 5 ∼ 10× costlier than standard training). To address this challenge, existing approaches focus on single-step AT, referred to as Fast AT, reducing the overhead of adversarial example generation. Unfortunately, these approaches are known to fail against stronger adversaries. To make AT computationally efficient without compromising robustness, this paper takes a different view of the efficient AT problem. Specifically, we propose to minimize redundancies at the data level by leveraging data pruning. Extensive experiments demonstrate that the data pruning based AT can achieve similar or superior robust (and clean) accuracy as its unpruned counterparts while being significantly faster. For instance, proposed strategies accelerate CIFAR-10 training up to 3.44× and CIFAR-100 training to 2.02×. Additionally, the data pruning methods can readily be reconciled with existing adversarial acceleration tricks to obtain the striking speed-ups of 5.66× and 5.12× on CIFAR-10, 3.67× and 3.07× on CIFAR-100 with TRADES and MART, respectively. Keywords Adversarial Robustness, Adversarial Data Pruning, Efficient Adversarial Training 1. Introduction Deep neural networks (DNNs) achieve great success in various machine learning tasks, such as image classifi- cation [1, 2], object detection [3, 4], language modeling [5, 6] and so on. However, the reliability and security con- cerns of DNNs limit their wide deployment in real-world applications. For example, imperceptible perturbations added to inputs by adversaries (known as adversarial examples) [7, 8, 9] can cause incorrect predictions during inference. Therefore, many research efforts are devoted to designing robust DNNs against adversarial examples [10, 11, 12]. Adversarial Training (AT) [13] is one of the most effec- tive defense approaches to improving adversarial robust- ness. AT is formulated as a min-max problem, with the inner maximization aiming to generate adversarial exam- ples, and the outer minimization aiming to train a model based on them. However, to achieve better defense with higher robustness, the iterative AT is required to gener- ate stronger adversarial examples with more steps in the inner problem, leading to expensive computation costs. In response to this difficulty, a number of approaches investigate efficient AT, such as Fast AT [14] and their variants [15, 16] via single-step adversarial attacks. Un- The AAAI-23 Workshop on Artificial Intelligence Safety (SafeAI 2023), Feb 13-14, 2023, Washington, D.C., US † Corresponding author. " [email protected] (Y. Li); [email protected] (P. Zhao); [email protected] (X. Lin); [email protected] (B. Kailkhura); [email protected] (R. Goldhahn) © 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) fortunately, these cheaper training approaches are known to attain poor performance on stronger adversaries and suffer from 'catastrophic overfitting' [14, 17], where Pro- jected Gradient Descent (PGD) robustness is gained at the beginning, but later the robust accuracy decreases to 0 suddenly. In this regard, there does not seem to exist a satisfactory solution to achieve optimal robustness with moderate computation cost. In this paper, we propose to overcome the above limi- tation by exploring a new perspective-leveraging data pruning during AT. Differing from the prior Fast AT- based solutions that focus on the AT algorithm, we attain efficiency by selecting the representative subset of train- ing samples and performing AT on this smaller dataset. Although several recent works explore data pruning for efficient standard training (see [18] for a survey), data pruning for efficient AT is not well investigated. To the best of our knowledge, the most relevant one is [19], which speeds up AT by the loss-based data pruning. How- ever, the random sub-sampling outperforms their data pruning schemein terms of clean accuracy, robustness, and training efficiency, raising doubts about the feasibil- ity of the proposed approach. In contrast, we propose to perform data pruning in two ways: 1) by maximizing the log-likelihood of the subset on the validation dataset, and 2) by minimizing the gradient disparity between the sub- set and the full dataset. We implement these approaches with two AT objectives: TRADES [20] and MART [21]. Experimental results show that we can achieve training acceleration up to 3.44× on CIFAR-10 and 2.02× on CIFAR-100. In addition, incorporating our proposed data pruning with Bullet-Train [22], which allocates dynamic computing cost to categorized training data, further im- 3 2 0 2 b e F 8 2 ] G L . s c [ 2 v 6 6 3 2 1 . 2 0 3 2 : v i X r a CEURWorkshopProceedingshttp://ceur-ws.orgISSN 1613-0073 proves the speed-ups by 5.66× and 3.67× on CIFAR-10 and CIFAR-100, respectively. Our main contributions are summarized below. • We explore efficient AT from the lens of data pruning, where the acceleration is achieved by only focusing on the representative subset of the data. • We propose two data pruning algorithms, Adv- GRAD-MATCH and Adv-GLISTER, and perform a comprehensive experimental study. We demon- strate that our data pruning methods yield consis- tent effectiveness across diverse robustness eval- uations, e.g., PGD [13] and AutoAttack [23]. • Furthermore, combining our efficient AT frame- work with the existing Bullet-Train approach [22] achieves state-of-the-art performance in training cost. 2. Related Work Adversarial attacks and defenses. Adversarial at- tacks [13, 24, 25, 26, 27] refer to detrimental techniques that inject imperceptible perturbations into the inputs and mislead decision making process of networks. In this paper, we mainly investigate lp attacks, where p ∈ {0, 1, 2, ∞}. Fast Gradient Sign Method (FGSM) [24] is the cheapest one-shot adversarial attack. Basic Iterative Method (BIM) [28], Projected Gradient Descent (PGD) [13] and CW [25] are stronger attacks that are iterative in nature. Adversarial examples are used for the assessment of model robustness. AutoAttack [23] ensembles multiple attack strategies to perform a fair and reliable evaluation of adversarial robustness. Various defense methods [29, 30, 31, 32] have been proposed to tackle the vulnerability of DNNs against ad- versarial examples, while most of the approaches are built over AT, where perturbed inputs are fed to DNNs to learn from adversarial examples. Projected Gradient Descent (PGD) based AT is one of the most popular defense strate- gies [13], which uses a multi-step adversary. Training only with adversarial samples can lead to a drop in clean accuracy [33]. To improve the trade-off between accuracy and robustness, TRADES [20] and MART [21] compose the training loss with both the natural error term and the robustness regularization term. Curriculum Adversarial Training (CAT) [34] robustifies DNNs by adjusting PGD steps arranging from weak attack strength to strong at- tack strength, while Friendly Adversarial Training (FAT) [35] performs early-stopped PGD for adversarial exam- ples. Efficient adversarial training. Despite PGD-based training showing empirical robustness against adversar- ial examples, the learning overhead is usually dramat- ically larger than the standard training, e.g., 5 ∼ 10× computation consumption depending on the number of steps used in generating adversarial examples. The major work to achieve training efficiency focuses on how to reduce the number of attack steps and maintain the sta- bility of one-step FGSM-based AT. Free AT [36] performs FGSM perturbations and updates model weights on the simultaneous mini-batch. FAST AT [14] generates FGSM attacks with random initialization but still suffers from 'catastrophic overfitting'. Therefore, Gradient alignment regularization [17], suitable inner interval (step size) for the adversarial direction [16], and Fast Bi-level AT (FAST- BAT) [37] are proposed to prevent such failure. Data pruning. Efficient learning through data subset selection economizes on training resources. Proxy func- tions [38, 39] take advantage of the feature representation from the tiny proxy model to select the most informative subset for training the larger one. Coreset-based algo- rithms [40] mine for a small representative subset that approximates the entire dataset following established cri- teria. CRAIG [41] selects the training data subset which approximates the full gradient and GRAD-MATCH [42] minimizes the gradient matching error. GLISTER [43] prunes the training data by maximizing log-likelihood for the validation set. 3. Data Pruning Based Adversarial Training 3.1. Preliminaries AT [13] aims to solve the min-max optimization problem as follows: min θ 1 |D| [︂ ∑︁ (x,y)∈D max δ∈△ L(θ; x + δ, y) , ]︂ (1) where θ is the model parameter, x and y denote the data sample and label from the training dataset D, δ denotes imperceptible adversarial perturbations injected into x under the norm constraint by the constant strength ε, i.e., △ := {‖δ‖∞ ≤ ε}, and L is the training loss. During the adversarial procedure, the optimization first maxi- mizes the inner approximation for adversarial attacks and then minimizes the outer training error over the model parameter θ. A typical adversarial example gener- ation procedure involves multiple steps for the stronger adversary, e.g., xt+1 = Proj△ (︀xt + α sign (︀∇xt L (︀θ; xt, y)︀)︀)︀ , (2) where the projection follows ε-ball at the step t with step size α, using the sign of gradients. (a) TRADES. (b) Bullet. (c) Adv-GRAD-MATCH. (d) Adv-GLISTER. (e) Adv-GRAD-MATCH&Bullet. (f) Adv-GLISTER&Bullet. Figure 1: Tracking of adversarial robustness during 200 epochs of training. Red, Green and Blue denote outlier, robust and boundary examples, respectively. 3.2. General Formulation for Adversarial Data Pruning Our adversarial data pruning consists of two steps: ad- versarial subset selection and AT with the subset of data. In the specified epoch, adversarial subset selection first finds a representative subset of data from the entire train- ing dataset. Next, AT is performed with the selected subset. Though the size of the subset keeps the same in different iterations, the data in the subset is updated in each iteration based on the different status of the model weights. We formulate the AT with the data subset in Eq. (3) and adversarial subset selection in Eq. (4). min θ 1 k ∑︁ (x,y)∈S [︂ max δ∈△ ]︂ L(θ; x + δ, y) , min S⊆D,|S|=k G(S) (3) (4) where D represents the complete training set and δ repre- sents the perturbation under l∞ norm constraint △. The selected subset S with the size k is obtained by optimiz- ing the function G, which aims to narrow the difference between D and S under specific criteria with model pa- rameters θ. Note that the data selection step is performed periodically to achieve computational savings. Recent data subset selection schemes, GRAD-MATCH [42] and GLISTER [43], have made significant contribu- tions towards efficiently achieving high clean accuracy. We extend these approaches in the context of adversarial robustness. Motivated by GLISTER [43], we first consider training a subset that obtains the optimal adversarial log-likelihood on the validation set in Eq. (5), defined as Adv-GLISTER: G(S) = ∑︁ LV (θS; xV + δ* V , yV ) (5) (xV ,yV )∈V where LV is the negative log-likelihood on validation set; δ* V is the adversarial perturbation obtained by maxi- mizing LV (θS; xV + δV , yV ). Another adversarial data pruning approach is inspired by GRAD-MATCH [42], which aims to find the data sub- set whose gradients closely match those of the full train- ing data. Adv-GRAD-MATCH is formulated as Eq. (6): G(S) = ‖ ∑︁ w∇θLS (θ; xS + δ* S, yS) (xS ,yS )∈S −∇θ LD (xD ,yD )∈D (θ; xD + δ* D, yD)‖ (6) where w is the weight vector associated with each instance xS in the subset S; LS and LD denote the S and training loss over the subset and entire dataset; δ* D are adversarial examples obtained by maximizing δ* LS(θ; xS + δS, yS) and LD(θ; xD + δD, yD), respec- tively. During the data selection, the adversarial gra- dient difference between the weighted subset loss and 020406080100120140160180Epoch0102030405060708090FractionOutlierBoundaryRobust020406080100120140160180Epoch0102030405060708090FractionOutlierBoundaryRobust020406080100120140160180Epoch0102030405060708090FractionOutlierBoundaryRobust020406080100120140160180Epoch0102030405060708090FractionOutlierBoundaryRobust020406080100120140160180Epoch0102030405060708090FractionOutlierBoundaryRobust020406080100120140160180Epoch0102030405060708090FractionOutlierBoundaryRobust Table 1 TRADES results where data pruning methods use only 30% data points on CIFAR-10 and 50% data points on CIFAR-100 for 100 epochs of training. Dataset Method CIFAR-10 CIFAR-100 TRADES [20] Bullet [22] Adv-GLISTER (Ours) Adv-GRAD-MATCH (Ours) Adv-GLISTER&Bullet (Ours) Adv-GRAD-MATCH&Bullet (Ours) TRADES [20] Bullet [22] Adv-GLISTER (Ours) Adv-GRAD-MATCH (Ours) Adv-GLISTER&Bullet (Ours) Adv-GRAD-MATCH&Bullet (Ours) Clean 82.73 84.60 77.62 75.67 79.21 77.57 55.85 59.43 51.26 51.03 53.54 52.98 4/255 69.17 70.24 63.06 61.85 63.02 62.00 40.31 42.23 37.16 37.17 37.24 36.92 PGD 8/255 51.83 50.82 46.06 45.96 44.52 45.13 27.35 28.08 24.78 24.60 23.91 24.24 16/255 19.43 16.05 16.52 17.49 13.33 14.65 10.71 9.40 9.49 9.70 7.69 8.01 AutoAttack Time/epoch (Speed-up) 49.06 47.93 41.61 42.19 40.77 41.94 23.39 23.85 20.57 20.42 20.02 20.17 416.20 (-) 193.06 (2.16×) 120.70 (3.45×) 138.19 (3.01×) 72.91 (5.66×) 87.38 (4.76×) 387.72 (-) 173.59 (2.23×) 202.7 (1.91×) 206.05 (1.88×) 105.66 (3.67×) 105.61 (3.67×) Table 2 MART results where data pruning methods use only 30% data points on CIFAR-10 and 50% data points on CIFAR-100 for 100 epochs of training. Dataset Method CIFAR-10 CIFAR-100 MART [21] Bullet[22] Adv-GLISTER (Ours) Adv-GRAD-MATCH (Ours) Adv-GLISTER&Bullet (Ours) Adv-GRAD-MATCH&Bullet (Ours) MART [21] Bullet [22] Adv-GLISTER (Ours) Adv-GRAD-MATCH (Ours) Adv-GLISTER&Bullet (Ours) Adv-GRAD-MATCH&Bullet (Ours) Clean 80.96 85.29 71.97 73.67 73.87 78.78 54.85 57.44 46.36 48.07 52.13 52.46 4/255 68.21 70.92 60.13 61.35 59.89 64.42 39.24 39.22 34.37 36.19 35.07 35.81 PGD 8/255 52.59 50.64 46.25 47.07 44.01 46.72 25.08 24.14 24.01 26.11 20.67 22.20 16/255 19.52 13.33 16.59 18.16 14.20 13.50 8.59 6.66 9.20 10.79 5.64 6.48 AutoAttack Time/epoch (Speed-up) 46.94 43.77 39.86 40.98 38.99 39.53 22.66 21.55 19.79 21.24 18.21 18.68 329.54 (-) 199.42 (1.65×) 95.68 (3.44×) 106.51 (3.09×) 64.31 (5.12×) 77.11 (4.27×) 307.43 (-) 187.73 (1.64×) 152.11 (2.02×) 153.86 (2.00×) 100.22 (3.07×) 113.03 (2.72×) the complete dataset loss is minimized so as to produce the optimum subset and corresponding weights. 4. Experiments 4.1. Experiment Setup To evaluate the efficiency and generality of the proposed method, we apply adversarial training loss functions from TRADES [20] or MART [21] on the standard datasets, CIFAR-10, CIFAR-100 [44] trained on ResNet-18 [45]. Our adversarial data pruning methods include Adv-GRAD- MATCH and Adv-GLISTER with different data portions (subset size) [30%, 50%] with 100 and 200 epochs where the selection interval is 20 (i.e., perform adversarial subset selection every 20 epochs of AT). The original training dataset is divided into the train (90%) and the valida- tion set (10%) in Adv-GLISTER. The optimizer is SGD with momentum 0.9 and weight decay 2e-4 for TRADES and 3.5e-3 for MART. For Adv-GRAD-MATCH and Adv- GLISTER, the initial learning rate is 0.01 and 0.02 on CIFAR-10 and 0.08 and 0.05 on CIFAR-100 respectively. Besides the original TRADES [20] and MART [21] meth- ods, we also compare our approach with Bullet-Train [22]. PGD attack [13] (PGD-50-10) is adopted for evalu- ating the robust accuracy, ranging from low magnitude (ε = 4/255) to high magnitude (ε = 16/255) with 50 it- erations as well as 10 restarts at the step-size α = 2/255 under l∞-norm. Moreover, AutoAttack [23] is leveraged for the reliable robustness evaluation. Additionally, our methods can also be combined with Bullet-Train [22] and we term them as Adv-GRAD-MATCH&Bullet and Adv-GLISTER&Bullet. 4.2. Main Results Table 1 shows the results of our Adv-GLISTER and Adv- GRAD-MATCH for TRADES compared with the orig- inal TRADES and Bullet-Train methods. The compar- ison is in terms of clean and robust accuracy (under two attack methods, PGD Attack [13] and AutoAttack [23]) along with the training speed-up. We observe that Table 3 100 v.s. 200 epoch TRADES CIFAR-10 results with ResNet-18 when using 30% data points with robustness regularization factor to be 1. Method Epoch Clean Adv-GLISTER Adv-GRAD-MATCH Adv-GLISTER Adv-GRAD-MATCH 100 100 200 200 77.62 75.61 78.76 75.75 4/255 63.06 60.81 64.15 61.24 PGD 8/255 46.06 45.76 46.11 46.49 16/255 16.52 17.49 16.92 18.55 AutoAttack 41.61 42.19 42.43 43.63 Table 4 TRADES results on CIFAR-10 with ResNet-18 using 30% data samples under different selection counts for 200 epoch training. Method Number of selections Clean TRADES [20] Adv-GLISTER Adv-GRAD-MATCH Adv-GLISTER Adv-GRAD-MATCH - 4 4 9 9 83.32 75.80 73.80 78.76 75.75 4/255 68.91 60.48 60.43 64.15 61.24 PGD 8/255 49.64 44.62 46.06 46.11 46.49 16/255 17.31 16.07 18.33 16.92 18.55 AutoAttack Speed-up 47.53 40.44 43.03 42.43 43.63 - 3.15× 2.83× 2.93× 2.75× compared to the baselines, the training efficiency of our method is improved significantly on CIFAR-10, while the decrease happens on the clean accuracy and robust- ness under AutoAttack and PGD attacks for different values of ε. Especially, for ε = 16/255, the robust accu- racy can be improved from 16.05% (Bullet-Train [22]) to 16.52% and 17.49% with our Adv-GRAD-MATCH and Adv-GLISTER, indicating our defensive capability on powerful attacks. As displayed in Table 1, our Adv- GRAD-MATCH and Adv-GLISTER reduce the training overheads (seconds per epoch) enormously and achieve 3.44× and 3.09× training speed-ups. After combining our approaches with Bullet-Train [22], an even faster acceleration of 5.12× can be reached. On CIFAR-100, the validity of our schemes is consistent as well. The reason why both clean and robust accuracy drop might be that our data pruning schemes struggle with the dimensionality and complexity of the dataset. Regardless, our schemes still result in conspicuous com- putation savings compared with other baselines. To understand the robustness improvements of our schemes, we track the dynamics of the outlier, robust, and boundary sets (similar to [22]) using PGD-5-1 attack. Without any attack, the outlier examples have already been mistaken by the model, but boundary and robust examples are correctly identified. After adversarial at- tacks, boundary examples are incorrectly classified while robust examples are still correctly classified. Fig. 1 dis- plays the dynamics of the outlier, boundary, and robust examples on CIFAR-10 for various schemes. During the model training and data selection, the number of robust samples gradually increases and eventually dominates, while the number of outliers and boundary data points decreases over epochs, revealing similar achievements in TRADES-based AT and data pruning-based methods. In addition, the ultimate portions of three sets explain the clean accuracy and robustness degrading of our ap- proaches. In detail, two baselines obtain more robust samples and fewer boundary and outlier examples. We further evaluate the performances of adversarial data pruning based on the loss of MART in Table 2. Re- sults are consistent with our findings on TRADES in Table 1. 4.3. Ablation Studies Epoch. We first consider the training epoch. Table 3 shows that longer training improves both clean and ro- bust accuracy. Due to the shrinking data size, more epochs are required to enhance data-efficient adversarial learning, in alignment with standard data pruning train- ing. However, 100-epoch training appears to be sufficient for the small dataset. Subset Size. We experiment with different subset sizes. Moving from the extremely small subset (10% of the full training set) to a larger subset (70%) in Fig. 2, the obser- vation is that robust accuracy gradually increases to that of the full dataset. This highlights the benefit of pruning with optimal subset size. We can see that 30% is an appro- priate choice for the CIFAR-10 subset size, after taking the global efficiency into account. Number of selection rounds. In Sec. 4.2, our experi- ments perform adversarial data pruning every 20 epochs (with 9 selections). Here we present the results of data pruning every 40 epochs (with 4 selections). As shown in Table 4, 9 selections can achieve better clean and robust accuracy with comparable acceleration. (a) TRADES. (b) MART. Figure 2: PGD evaluation (ε = 8/255) with the corresponding speed-up under different subset sizes for 100 epoch CIFAR-10 training. Note that when the size is 100%, data pruning methods are not applied and the speed-up is compared with the baselines (TRADES or MART). 5. Conclusion and Future Work In this paper, we investigated efficient adversarial train- ing from a data-pruning perspective. With comprehen- sive experiments, we demonstrated that proposed adver- sarial data pruning approaches outperform the existing baselines by mitigating substantial computational over- head. These positive results pave a path for future re- search on accelerating AT by minimizing redundancy at the data level. Our future work will focus on designing more accurate pruning schemes for large-scale datasets. Acknowledgment This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344 and was supported by LLNL-LDRD Program under Project No. 20-SI-005 (LLNL-CONF-842760). References [1] Q. Xie, M.-T. Luong, E. Hovy, Q. V. Le, Self-training with noisy student improves imagenet classifica- tion, in: IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020. [2] P. Foret, A. Kleiner, H. Mobahi, B. Neyshabur, Sharpness-aware minimization for efficiently im- proving generalization, in: International Confer- ence on Learning Representations (ICLR), 2021. [3] Z.-Q. Zhao, P. Zheng, S.-T. Xu, X. Wu, Object de- tection with deep learning: A review, IEEE Trans- actions on Neural Networks and Learning Systems 30 (2019) 3212–3232. doi:10.1109/TNNLS.2018. 2876865. [4] S. S. A. Zaidi, M. S. Ansari, A. Aslam, N. Kanwal, M. Asghar, B. Lee, A survey of modern deep learn- ing based object detection models, Digital Signal Processing 126 (2022) 103514. [5] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. u. Kaiser, I. Polosukhin, Attention is all you need, in: Advances in Neural Information Processing Systems (NeurIPS), 2017. [6] S. Borgeaud, A. Mensch, J. Hoffmann, T. Cai, E. Rutherford, K. Millican, G. B. Van Den Driessche, J.-B. Lespiau, B. Damoc, A. Clark, D. De Las Casas, A. Guy, J. Menick, R. Ring, T. Hennigan, S. Huang, L. Maggiore, C. Jones, A. Cassirer, A. Brock, M. Pa- ganini, G. Irving, O. Vinyals, S. Osindero, K. Si- monyan, J. Rae, E. Elsen, L. Sifre, Improving lan- guage models by retrieving from trillions of tokens, in: Proceedings of the 39th International Confer- ence on Machine Learning (ICML), 2022. [7] P.-Y. Chen, H. Zhang, Y. Sharma, J. Yi, C.-J. Hsieh, Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models, in: Proceedings of the ACM Workshop on Artificial Intelligence and Security, ACM, 2017. [8] C. Xiao, B. Li, J. yan Zhu, W. He, M. Liu, D. Song, Generating adversarial examples with adversarial networks, in: Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelli- gence(IJCAI), 2018. [9] F. Tramer, N. Carlini, W. Brendel, A. Madry, On adaptive attacks to adversarial example defenses, in: Advances in Neural Information Processing Sys- tems (NeurIPS), 2020. [10] A. Athalye, N. Carlini, D. Wagner, Obfuscated gra- dients give a false sense of security: Circumventing defenses to adversarial examples, in: Proceedings 10%30%50%70%100%Subset Size020406080100PGD Robustness (%)38.3646.0648.1849.3651.8335.8845.7647.8549.1751.83Adv-GLISTERTRADESAdv-GRAD-MATCHTRADES01234567891011Speed-upAdv-GLISTER EfficiencyAdv-GRAD-MATCH Efficiency10%30%50%70%100%Subset Size020406080100PGD Robustness (%)30.3146.2548.1147.1552.5939.3947.0750.6151.9852.59Adv-GLISTERMARTAdv-GRAD-MATCHMART01234567891011Speed-upAdv-GLISTER EfficiencyAdv-GRAD-MATCH Efficiency of the 35th International Conference on Machine Learning (ICML), 2018. [11] E. Wong, Z. Kolter, Provable defenses against ad- versarial examples via the convex outer adversarial polytope, in: Proceedings of the 35th International Conference on Machine Learning (ICML), 2018. [12] H. Salman, J. Li, I. Razenshteyn, P. Zhang, H. Zhang, S. Bubeck, G. Yang, Provably robust deep learning via adversarially trained smoothed classifiers, in: Advances in Neural Information Processing Sys- tems (NeurIPS), 2019. [13] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, A. Vladu, Towards deep learning models resistant to adversarial attacks, in: International Conference on Learning Representations (ICLR), 2018. [14] E. Wong, L. Rice, J. Z. Kolter, Fast is better than free: Revisiting adversarial training, in: International Conference on Learning Representations (ICLR), 2020. [15] B. S. Vivek, R. Venkatesh Babu, Single-step adver- sarial training with dropout scheduling, in: 2020 IEEE/CVF Conference on Computer Vision and Pat- tern Recognition (CVPR), 2020. [16] H. Kim, W. Lee, J. Lee, Understanding catastrophic overfitting in single-step adversarial training, in: Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), volume 35, 2021, pp. 8119– 8127. [17] M. Andriushchenko, N. Flammarion, Understand- ing and improving fast adversarial training, in: Ad- vances in Neural Information Processing Systems (NeurIPS), 2020. [18] B. R. Bartoldson, B. Kailkhura, D. Blalock, Compute- efficient deep learning: Algorithmic trends and op- portunities, arXiv preprint arXiv:2210.06640 (2022). [19] M. Kaufmann, Y. Zhao, I. Shumailov, R. Mullins, N. Papernot, Efficient adversarial training with data pruning, in: arXiv, 2022. [20] H. Zhang, Y. Yu, J. Jiao, E. P. Xing, L. E. Ghaoui, M. I. Jordan, Theoretically principled trade-off be- tween robustness and accuracy, in: International Conference on Machine Learning (ICML), 2019. [21] Y. Wang, D. Zou, J. Yi, J. Bailey, X. Ma, Q. Gu, Im- proving adversarial robustness requires revisiting misclassified examples, in: International Confer- ence on Learning Representations (ICLR), 2020. [22] W. Hua, Y. Zhang, C. Guo, Z. Zhang, G. E. Suh, Bul- lettrain: Accelerating robust neural network train- ing via boundary example mining, in: Advances in Neural Information Processing Systems (NeurIPS), 2021. [23] F. Croce, M. Hein, Reliable evaluation of adversarial robustness with an ensemble of diverse parameter- free attacks, in: International Conference on Ma- chine Learning (ICML), 2020. [24] I. J. Goodfellow, J. Shlens, C. Szegedy, Explaining in: arXiv, and harnessing adversarial examples, 2015. [25] N. Carlini, D. Wagner, Towards evaluating the ro- bustness of neural networks, in: IEEE Symposium on Security and Privacy (S&P), IEEE, 2017. [26] F. Croce, M. Hein, Sparse and imperceivable adver- sarial attacks, in: Proceedings of the IEEE/CVF In- ternational Conference on Computer Vision (ICCV), 2019. [27] Q. Zhang, X. Li, Y. Chen, J. Song, L. Gao, Y. He, H. Xue, Beyond imagenet attack: Towards crafting adversarial examples for black-box domains, in: International Conference on Learning Representa- tions (ICLR), 2022. [28] A. Kurakin, I. Goodfellow, S. Bengio, Adversarial examples in the physical world, 2016. URL: https: //arxiv.org/abs/1607.02533. doi:10.48550/ARXIV. 1607.02533. [29] D. Meng, H. Chen, Magnet: A two-pronged defense against adversarial examples, in: Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, 2017. [30] F. Liao, M. Liang, Y. Dong, T. Pang, X. Hu, J. Zhu, Defense against adversarial attacks using high-level representation guided denoiser, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. [31] A. Mustafa, S. Khan, M. Hayat, R. Goecke, J. Shen, L. Shao, Adversarial defense by restricting the hid- den space of deep neural networks, in: Proceedings of the IEEE/CVF International Conference on Com- puter Vision (ICCV), 2019. [32] Y. Gong, Y. Yao, Y. Li, Y. Zhang, X. Liu, X. Lin, S. Liu, Reverse engineering of imperceptible adversarial image perturbations, in: International Conference on Learning Representations (ICLR), 2022. [33] D. Su, H. Zhang, H. Chen, J. Yi, P.-Y. Chen, Y. Gao, Is robustness the cost of accuracy? – a comprehensive study on the robustness of 18 deep image classifi- cation models, in: Proceedings of the European Conference on Computer Vision (ECCV), 2018. [34] Q.-Z. Cai, C. Liu, D. Song, Curriculum adversarial training, in: Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelli- gence, IJCAI-18, International Joint Conferences on Artificial Intelligence Organization, 2018, pp. 3740– 3747. URL: https://doi.org/10.24963/ijcai.2018/520. doi:10.24963/ijcai.2018/520. [35] J. Zhang, X. Xu, B. Han, G. Niu, L. Cui, M. Sugiyama, M. Kankanhalli, Attacks which do not kill training make adversarial learning stronger, in: Proceedings of the 37th International Conference on Machine Learning (ICML), 2020. [36] A. Shafahi, M. Najibi, M. A. Ghiasi, Z. Xu, J. Dicker- son, C. Studer, L. S. Davis, G. Taylor, T. Goldstein, Adversarial training for free!, in: Advances in Neu- ral Information Processing Systems (NeurIPS), 2019. [37] Y. Zhang, G. Zhang, P. Khanduri, M. Hong, S. Chang, S. Liu, Revisiting and advancing fast adversarial training through the lens of bi-level optimization, in: International Conference on Machine Learning (ICML), 2022. [38] C. Coleman, C. Yeh, S. Mussmann, B. Mirza- soleiman, P. Bailis, P. Liang, J. Leskovec, M. Za- haria, Selection via proxy: Efficient data selection for deep learning, in: International Conference on Learning Representations (ICLR), 2020. URL: https://openreview.net/forum?id=HJg2b0VYDr. [39] V. Kaushal, R. Iyer, S. Kothawade, R. Mahadev, K. Doctor, G. Ramakrishnan, Learning from less data: A unified data subset selection and active learning framework for computer vision, in: Pro- ceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), 2019. [40] D. Feldman, Core-Sets: Updated Survey, Springer International Publishing, Cham, 2020, pp. 23–44. URL: https://doi.org/10.1007/978-3-030-29349-9_2. doi:10.1007/978-3-030-29349-9_2. [41] B. Mirzasoleiman, J. Bilmes, J. Leskovec, Coresets for data-efficient training of machine learning mod- els, in: Proceedings of the 37th International Con- ference on Machine Learning (ICML), 2020. [42] K. Killamsetty, D. S, G. Ramakrishnan, A. De, R. Iyer, Grad-match: Gradient matching based data subset selection for efficient deep model training, in: Pro- ceedings of the 38th International Conference on Machine Learning (ICML), 2021. [43] K. Killamsetty, D. Sivasubramanian, G. Ramakrish- nan, R. Iyer, Glister: Generalization based data subset selection for efficient and robust learning, in: Proceedings of the AAAI Conference on Ar- tificial Intelligence (AAAI), volume 35, 2021, pp. 8110–8118. [44] A. Krizhevsky, G. Hinton, Learning multiple lay- ers of features from tiny images, Master's thesis, Department of Computer Science, University of Toronto (2009). [45] K. He, X. Zhang, S. Ren, J. Sun, Identity mappings in deep residual networks, in: European conference on computer vision (ECCV), Springer, 2016, pp. 630– 645.
http://arxiv.org/abs/2302.12360v2
2023-03-01T18:28:36
2023-02-23T22:53:02
Practical Knowledge Distillation: Using DNNs to Beat DNNs
For tabular data sets, we explore data and model distillation, as well as data denoising. These techniques improve both gradient-boosting models and a specialized DNN architecture. While gradient boosting is known to outperform DNNs on tabular data, we close the gap for datasets with 100K+ rows and give DNNs an advantage on small data sets. We extend these results with input-data distillation and optimized ensembling to help DNN performance match or exceed that of gradient boosting. As a theoretical justification of our practical method, we prove its equivalence to classical cross-entropy knowledge distillation. We also qualitatively explain the superiority of DNN ensembles over XGBoost on small data sets. For an industry end-to-end real-time ML platform with 4M production inferences per second, we develop a model-training workflow based on data sampling that distills ensembles of models into a single gradient-boosting model favored for high-performance real-time inference, without performance loss. Empirical evaluation shows that the proposed combination of methods consistently improves model accuracy over prior best models across several production applications deployed worldwide.
[ "Chung-Wei Lee", "Pavlos Athanasios Apostolopulos", "Igor L. Markov" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12360v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12360v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
3 2 0 2 r a M 1 ] G L . s c [ 2 v 0 6 3 2 1 . 2 0 3 2 : v i X r a Practical Knowledge Distillation: Using DNNs to Beat DNNs CHUNG-WEI LEE, USC, USA PAVLOS ATHANASIOS APOSTOLOPULOS and IGOR L. MARKOV, Meta, USA For tabular data sets, we explore data and model distillation, as well as data denoising. These techniques improve both gradient-boosting models and a specialized DNN architecture. While gradient boosting is known to outper- form DNNs on tabular data, we close the gap for datasets with 100K+ rows and give DNNs an advantage on small data sets. We extend these results with input-data distillation and optimized ensembling to help DNN performance match or exceed that of gradient boosting. As a theoretical justification of our practical method, we prove its equivalence to classical cross-entropy knowledge distillation. We also qualitatively explain the superiority of DNN ensembles over XGBoost on small data sets. For an industry end-to-end real- time ML platform with 4M production inferences per second, we develop a model-training workflow based on data sampling that distills ensembles of models into a single gradient-boosting model favored for high-performance real-time inference, without performance loss. Empirical evaluation shows that the proposed combination of methods consistently improves model accu- racy over prior best models across several production applications deployed worldwide. CCS Concepts: • Computing methodologies → Machine learning. Additional Key Words and Phrases: Machine Learning, DNN, Gradient Boost- ing, tabular data, knowledge distillation, data denoising 1 INTRODUCTION As machine learning is applied to more applications, higher-quality models require improving data quality, increasing data volume, us- ing more sophisticated model types, optimizing hyperparameters, and training more effectively. These paths are backed by theory, but practical contexts are not always in line with assumptions in formal analyses, while real-world considerations may not favor the models preferred by theory. Such disconnects can be illustrated by the significance of resource consumption at inference in real-time ML platforms that favors simpler models. In terms of model quality, gradient boosting tends to outperform Deep Learning models on tabular data, for reasons that have been carefully analysed only recently [18, 20, 40]. Moreover, combining multiple methods tends to give better results in practice [16]. Hence, our work is motivated by practical considerations and uses tabular data from Platform, a high-performance end-to-end real-time ML platform [removed for blind review]but also offers theoretical insights that match and explain empirical results. Hundreds of production use cases running on this platform cumulatively perform millions of inferences per second. Hence, both ML quality and the efficiency of inference are critical. Real-time inference is valuable to many applications on this platform, but limits the types of models during inference. In particular, gradient boosting models are often favored for their small memory footprint and fast inference, whereas model ensembles are not supported easily. While vibrant ML research introduces new model architectures daily, an industry ML platform cannot realisti- cally support high-performance inference for all new model types that show promising results during training. Our work shows that Authors' addresses: Chung-Wei Lee, [email protected], USC, Los Angeles, CA, USA, 90098; Pavlos Athanasios Apostolopulos, [email protected]; Igor L. Markov, [email protected], Meta, Menlo Park, CA, USA, 94025. model distillation helps not only to improve an individual models' performance, but also to leverage new model types as teachers to train simpler student models fully supported by the platform. In many production use cases, labels capture human behavior or the environment, and therefore suffer noise, inconsistencies and other irregularities. Generic data denoising [8, 17, 43] and data distillation [26, 29] methods may be applied before model training to improve ML models. But such methods must be automated when produc- tion ML models are retrained daily to handle nonstationary data distributions [28]. To address relevant ML applications, we explore recent advance- ments in ML research: (i) data and model distillation, (ii) denoising and uncertainty mitigation, and (iii) deep tabular learning. Knowledge distillation [23] was originally proposed to transfer knowledge from a "teacher" model with a larger capacity to a "stu- dent" model with a smaller capacity, to achieve model compression. When training a student model, an extra term in the loss function encourages the student model to mimic the teacher model. Surpris- ingly, the paper on Born-Again Neural Networks [15] shows that when the student uses the same architecture and capacity as the teacher model, the student model may outperform the teacher using dark knowledge (a term introduced by G.Hinton) extracted from the teacher model. Moreover, the performance is further enhanced by averaging the predictions from multiple sequentially-trained student models (where the student becomes a teacher) and by us- ing knowledge distillation (i.e., building an ensemble model). This generic way to boost an ML model has only been evaluated for DNN models so far. Uncertainty and noise are frequently observed in practical ML applications in several forms. An important distinction is between epistemic and aleatoric uncertainty [24]. Epistemic uncertainty is associated with insufficient information carried by a given data sam- ple (drawn randomly or not) and can be reduced by adding more data - training ML models on larger datasets often improves results. In contrast, aleatoric uncertainty is associated with individual data rows and cannot be mitigated by adding more data. The practical model-training workflow deveveloped and evaluated in this paper addresses aleatoric uncertainty (including label noise) by dropping a small fraction of carefully selected data rows. Additionally, we demonstrate that ensembles of distilled DNNs hold significant ad- vantage over gradient boosting models on small training datasets, where gradient boosting overfits but DNN ensembles generalize well and thus address epistemic uncertainty. Tabular data and deep learning. Much of ML literature on label denoising and knowledge distillation deals with image data and DNN-based model architectures. However, industrial applications like ours deal with tabular data by building better-performing gradi- ent boosting models, such as XGBoost [10]. In our work, we consider both XGBoost and TabNet [4], a recent DNN architecture for tabu- lar data. TabNet employs the attention mechanism for soft feature selection, enabling interpretability, and has shown performance 2 • Chung-Wei Lee, Pavlos Athanasios Apostolopulos, and Igor L. Markov Fig. 1. High-level workflow developed in this paper. Original training data assumes discrete labels. Distilled data replaces labels with model scores, which include dark knowledge. Denoising removes data rows where model scores differ too much from input labels or scores. Iterations of model training and data distillation repeat, while training models of the same architecture and capacity (self-distillation). Each new model is trained using the last iteration of distilled and denoised training data as well as the original training data. Model quality improvement is not required for each new model. An ensemble model combines all intermediate models and, possibly, models of additional types trained on original data. A weight-optimized ensemble model is distilled again into a simpler production model. competitive to XGBoost on public tabular datasets. Given that XG- Boost dominates DNNs for tabular data in comparisons on open datasets [18, 20, 40] and in industry ML platforms [28], one of our goals is to explore if TabNet (or more sophisticated models built from it) can compete with XGBoost on tabular datasets. Our emphasis on tabular data has significant impact not only on the choice of ML model type, but also on the applicability of denoising methods. In particular, denoising methods often exploit correlated features (such as image pixels) and redundant informa- tion (from nearby video frames, from different parts of an image sufficient for classification decisions, etc). However, features in tab- ular data are typically unrelated and may be on different scales, while redundancies are uncommon. Less obviously, the diversity of feature/column types in tabular data undermines the notions of distance and similarity that are natural to multimedia data. In turn, this invalidates denoising methods that rely on K nearest neigh- bors, similarity clustering and other distance-based techniques (that assume that similar inputs must lead to similar correct outputs). In this work, we combine denoising with data and model distil- lation in the context of deep tabular learning. We observe that TabNet underperforms XGBoost on larger datasets (100K rows). This is counterintuitive as DNNs are assumed to perform well on large datasets, but recent literature made similar observations and explained them [18, 20, 40]. With an eye on easy-to-implement optimizations of TabNet-based models, we assemble a series of prac- tical improvements (Figure 1). Empirical validation indicates that resulting TabNet ensembles are competitive with XGBoost and in some cases superior to XGBoost. Ensembling them with XGBoost produces even better models. However, supporting such mixed en- semble for high-performance real-time inference runs into platform limitations. We then use our distillation via weighted datasets to distill across models of different types: we distill our best XGBoost + TabNet ensemble into a single XGBoost model with no loss of performance. Implementation is easy and helps us outperform ML models previously deployed on the ML platform for all tested use cases (Table 13). More generally, in an end-to-end ML platform, this simple shortcut can extend the benefits of new ML model types with promising training results toward high-performance inference without impacting the complexity of inference infrastructure. 2 RELATED WORK Knowledge distillation. Large deep neural networks [12, 22] have led to impressive feats in real-world applications with large-scale data [50]. However, their deployment in industry-scale applica- tions for real-time inference, poses challenges due to computa- tional complexity, storage requirements and inference latency. In re- sponse, knowledge distillation (KD) [23] was introduced as a model- compression technique that distills the knowledge from a larger neural network to a smaller network [33, 44, 46]. Despite KD's great success in natural language processing, computer vision, etc [2, 19], its theoretical and empirical understanding remains limited [11, 35]. Also, while KD trains student models in supervision of a teacher model, researchers developed several promising domain-specific learning schemes [19] that select teacher's components and de- termine how they are used in training: response-based knowledge [30], feature-based knowledge [47], and relation-based knowledge [9]. Other practical KD techniques include adversarial distillation [31], multi-teacher distillation [49], cross-modal distillation [53]. Applica- tions of these algorithms often rely on heavily-tuned implementa- tions [52] whereas many practical uses encourage full automation to support regular model retraining to follow nonstationary data. Our work largely draws on self-distillation, where the architecture and capacity of the network does not change during training. Training on noisy data, is widely recognized as a practical circum- stance that may limit success of Machine Learning (ML) [32]. In the Originaltraining dataDNNtrainingDNN modeliter=1Data distillation & denoisingTraining dataiter=2DNNtrainingDNN modeliter=2...Ensemble weight optimizationusing Differential EvolutionProductionmodel training Ensemble modelData distillationTraining datafinalProduction modelData distillation & denoising context of DNNs, the problem is covered well in the literature, due to both the popularity of DNNs and DNN's propensity to overfit [25]. For instance, the work in [51] shows that sufficiently large DNNs can easily fit an entire training dataset with any ratio of corrupted labels. The noisy-label problem can be viewed from several perspectives [42]. The feature-class dependency checks if noise levels dependent on the labels alone or also on the features. The open-close dichotomy arises when the set of possible labels is large (open set) and a correct label may not even be observed, whereas the close-set alternative assumes correct labels to be among observed labels. In any case, training with noise is often related to the memorization effect of deep learning [5], and proposed mitigation techniques usually seek to downweigh or skip errouneous labels. Solutions have been inspired by the freedom to select DNN model architectures [21], loss-based regularization conditions [34], semi-supervised learning [6] and meta-learning [39]. Common limitations include limited scalability and and specificity to DNN architectures [14, 41]. Techniques to deal with noise usually rely on the assumption that similar inputs (images with similar pixels, words or sentences with similar em- bedding vectors) must produce the same model output. However, tabular data often lack a well-defined notion of distance (e.g., differ- ent timestamps added to a data row may be superflouous in some cases and important in other cases; also, combining floating-point features with categorical features to define a distance is ambiguous). Therefore, many existing techniques for training with noise are not helpful with tabular data. Ensemble learning, such as averaging the outputs of several mod- els, is common in ML practice and especially in ML contests [36]. An ensemble of ML models combines predictions of multiple con- stituent models, possibly of different types, to diminish overfitting. This tends to offer greater benefits for DNNs [48], likely because DNNs are initialized with random weights, leading to diverse DNNs with comparable ML performance. While simple averaging of mod- els often shows promising results, linear and non-linear functions can aggregate models using additional parameters that can be opti- mized [37, 38]. For example, averaging can be extended by adding a handful of tunable weights to optimize, e.g., the performance of the resulting classifier. Traditional optimization methods would be difficult to apply here because the dependence of the end metric on the parameters is not captured by an explicit formula. Therefore, one resorts to gradient-free black-box methods, such as Differential Evolution [1] that maintains a population of configurations and creates new configurations using a randomized crossover operator. 3 PROBLEM SETTING AND MOTIVATION We focus on binary classification with the ROC AUC objective, for simplicity. Consider N training samples {(xi, yi )}, where xi ∈ Rd and yi ∈ {0, 1}. A machine learning model implements a function f : Rn → [0, 1] that maps each xi to Prob[yi = 1]. A model f0 trained on the original dataset {(xi, yi )} is termed a teacher model. The key idea of model distillation is then to transfer the knowledge of the teacher fo to a student model f1. The latter is traditionally done by training with a cross-entropy term between Practical Knowledge Distillation: Using DNNs to Beat DNNs • 3 the student's and the teacher's predictions: N ∑︁ i=1 −f0 (xi ) log(f1 (xi )) − f0 (1 − xi ) log(f1 (1 − xi )). Adding this term to the loss function encourages the student model to mimic the teacher's output. Needless to say, not every ML model can accommodate this approach. Additionally, our industry setting encourages black-box components with clean interfaces. To this end, we explore a different approach to transfer knowledge from the teacher model - we train f1 on a weighted dataset, where each (xi, 0) has a weight 1−f0 (xi ) and each (xi, 1) has a weight f0 (x0). We term this approach input-data distillation. Intuitively, the weighted dataset summarizes the teacher model's belief on the training data. In practice, the model-training pipeline can interpret the weights as row-sampling probabilities for the data loader (when forming a batch), which enables this approach with any eligible ML model that might not even support training with weighted datasets. 3.1 Motivational Experiments on image datasets We first replicate the results of knowledge distillation with Born- again networks [15] using authors' code, on open image datasets MNIST and CIFAR10 (60K images) using ResNet50, we also add XGBoost. In Table 1, the figure of merit is accuracy. We observe that distillation does not necessarily improve individual student models, but their ensembles demonstrate consistent improvement. In each column, the best results (highlighted) are attained by ensembles. Thus, knowledge distillation with ensembles promises to improve initial models, but the DNN model (ResNet50) has more to gain than XGBoost (we return to this trend later). Table 1. XGBoost and ResNet performance on CIFAR10 and MNIST with knowledge distillation; generations and ensembles are indicated in rows. The best-performing row is highligted. Dataset Model Gen 0 (f0) Gen 1 (f1) Gen 2 (f2) Ens 0+1 Ens 0+1+2 MNIST CIFAR10 CIFAR10 MNIST XGBoost ResNet50 XGBoost ResNet50 0.5440 0.5356 0.5284 0.5499 0.5517 0.8339 0.8257 0.8358 0.8593 0.8703 0.9735 0.9745 0.9734 0.9749 0.9752 0.9901 0.9864 0.9892 0.9913 0.9922 3.2 Motivational experiments on tabular datasets In this paper, we focus on tabular data sets deployed in produc- tion use cases on the high-performance end-to-end real-time ML platform. Unlike in image data, columns of tabular data are often at different scales, may be of different types, may carry different amounts of noise, and do not correlate like nearby image pixels do [18, 20, 40]. Shift-invariance (a letter "O" can be moved by several pixels up or down) rarely arises in tabular data, which negates the advantages of ConvNets. Given that we study binary classification, the figure of merit is ROC AUC. A collection of Platformdata sets is described in Table 12. These data sets represent applications deployed (i) in a major 4 • Chung-Wei Lee, Pavlos Athanasios Apostolopulos, and Igor L. Markov social network, (ii) on an internal corporate system, (iii) in a popular augmented-reality system. They are used for final evaluation in Ta- ble 13. For evaluating individual improvements, we found Dataset B representative and complement it with other datasets on occasion (the text refers to table in the Appendix). We start by replicating past work and testing simple ideas, as groundwork for more advanced techniques in Section 4. For all experiments with DNN models, we use TabNet [4] (the implementation posted by the authors for public use) and compare it with XGBoost [10]. TabNet gains more from ensembling than XGBoost does, but still lags behind. We first evaluated plain TabNet and XGBoost "out of the box" without any hyperparameter tuning. Per Table 2, both benefited from knowledge distillation, but the gain for TabNet was greater than for XGBoost. XGBoost still outperforms TabNet. We observed similar results on other datasets and with the patience hyperparameter for TabNet increased by 3× (by default, TabNet stops training after 10 consecutive nonimproving epochs). Table 2. XGBoost and TabNet ensembles on Dataset B (100K sampled rows) Gen TabNet AUC (n) TabNet Ens AUC (1+..+n) XGBoost AUC (n) XGBoost Ensemble AUC (1+..+n) 0 1 2 3 4 5 0.60982 0.61859 0.58359 0.57927 0.57336 0.57793 0.61995 0.61519 0.61867 0.6233 0.62547 0.67722 0.70136 0.72189 0.72304 0.72406 0.72369 0.70052 0.71317 0.71944 0.72273 0.72418 Removing noisy labels improves performance - a simple, but powerful idea. When trainig with knowledge distillation, we remove data rows whose predictions are too far from the teacher model's predictions, that is, we remove data i if Δ = |f (xi ) −yi | ≥ threshold. A threshold equal to 1 keeps all rows. Per Table 3, threshold 0.99 leads to good performance and consistently improves results. Constant columns degrade DNN but not XGBoost performance. Removing constant columns/features improves the performance of TabNet. Table 4 indicates that adding a constant feature column degrades the performance of TabNet significantly, while XGBoost is unaffected, as one might expect. Similar observations were made recently and discussed in [18, 20, 40]. Our industry datasets have constant columns, and removing them improves the teacher model and the best ensembles. Tables 6, 17 and 14 summarize combined performance of denoising and removing constant columns. Order-preserving feature transforms have little effect on Tab- Net due to its built-in batch normalization. Unlike models based on decision trees, DNNs tend to be sensitive to the scale of input data. Therefore, we evaluated the impact of common transforms such as Box-Cox, Standardize, and Quantile on all features. Re- sults in Table 5 indicate that TabNet's performance is unaffected by the Box Cox and Quantile transforms, while the performance dips after the Standardize transform. This appears related to the use of batch normalization in TabNet, the paper explains "TabNet inputs raw tabular data without any preprocessing and is trained using gradient descent-based optimization, enabling flexible integration into end-to-end learning." Therefore, we do not apply feature trans- forms in subsequent experiments, but admit that individual features in some datasets could be amenable to such transforms. XGBoost is insensitive to order-preserving feature transforms, as one might expect for a model based on decision trees. 3.3 DNNs vs. XGBoost on small data sets We found that TabNet significantly outperforms XGBoost when we train the models on smaller sample sizes. Moreover, TabNet gains a much greater boost from ensembling, as seen in Table 7 for 10K random samples from Dataset B. Yet, XGBoost generally outperforms TabNet-based models on large data sets, at least without additional optimizations for TabNet (Tables 9 and 10). To explain this phenomenon, we note the stochasticity of DNN models. Compared to XGBoost, DNNs are initialized with random weights and trained by stochastic gradient descent. This training process explores different directions in the parameter space more easily, and hence may find better model parameters when the data are limited. To verify this hypothesis, we calculate the Pearson's cor- relation coefficient between generations (of knowledge distillation) for both XGBoost and TabNet. The results are strikingly different. For TabNet, the correlations are <0.36 even for consecutive gen- erations, while for XGBoost, the correlations are all >0.78. Hence, DNNs produce more diverse models across generations. Another observation is that XGBoost tends to overfit on small datasets. In some of our experiments, XGBoost exhibited all-1 ROC AUC scores on the original training dataset across all generations, while Tab- Net's ROC scores range between 0.61 to 0.74, similar to the ones on the test dataset. 3.4 Self-distillation from an ensemble Self-distillation trains the generation N + 1 using generation N as the teacher, then ensembles all the generations. Since ensembles usually outperform single models, one can also use a full ensemble of prior generations as a teacher to distill the next generation. Our experiments in Tables 15 and 16 compare these two options, but show no serious differences on average. When appropriate training resources are available, one can run both methods and pick the better model one every time. 4 ADVANCED CONSIDERATIONS In this section, we prove equivalence between classic knowledge distillation and the more practical method introduced in Section 3 (in the context of cross-entropy loss). In Section 4.2, we combine this method with several other practical techniques, to be evaluated experimentally in Section 5. 4.1 Equivalence between distillation via weighted datasets and distillation via loss functions We consider k-class classification, X ⊆ Rd being the feature space, Y = {1, . . . , k } being the label space, and D = {xi, yi }n , (xi, yi ) ∈ i=1 X × Y being the training set. We consider function f (*; θ ) : X → Rk parameterized by θ and σ being the softmax function. the loss Practical Knowledge Distillation: Using DNNs to Beat DNNs • 5 Table 3. Data denoising during TabNet distillation using different thresholds on Dataset B threshold = 1 Individual Ensemble 0.63163 0.59024 0.5779 0.56244 0.58737 0.60204 0.6494 0.66526 0.65684 0.67351 0.67694 threshold=0.999 Individual Ensemble 0.63163 0.61461 0.61024 0.5987 0.57877 0.60059 0.64885 0.642 0.65274 0.66111 0.67656 threshold=0.99 Individual Ensemble 0.63163 0.61452 0.62124 0.58315 0.58441 0.68675 0.65071 0.65261 0.64608 0.65452 0.65737 threshold=0.9 Individual Ensemble 0.63163 0.70889 0.60639 0.59152 0.60011 0.56188 0.70904 0.69421 0.68818 0.68156 0.69705 threshold=0.5 Individual Ensemble 0.63163 0.58429 0.60553 0.56906 0.63707 0.63219 0.63813 0.62765 0.60846 0.63133 0.63531 Gen 0 1 2 3 4 5 Table 4. Removing and adding constant columns impacts TabNet results on Dataset B Original Individual Ensemble 0.56688 0.60085 0.67693 0.63902 0.52586 0.58079 0.55747 0.57857 0.6386 0.70935 0.72011 0.74692 0.7463 0.74603 0.74603 Add 5 all-one features Individual Ensemble 0.56318 0.56646 0.54981 0.5343 0.56674 0.51794 0.55657 0.55601 0.57848 0.57872 0.57885 0.57992 0.57889 0.58351 0.58593 Remove const features Individual Ensemble 0.6255 0.63731 0.56475 0.56526 0.59496 0.64536 0.69509 0.59661 0.64534 0.65157 0.65985 0.70593 0.73507 0.76678 0.73137 Gen 0 1 2 3 4 5 6 7 Table 5. Impact of feature transforms the quality of TabNet distillation, Dataset B Original Individual Ensemble 0.56688 0.60085 0.67693 0.63902 0.52586 0.58079 0.6386 0.70935 0.72011 0.74692 0.7463 w/ Standardize Individual Ensemble 0.61268 0.61748 0.57437 0.62771 0.65891 0.60042 0.63207 0.64157 0.6668 0.69058 0.66963 w/ Quantile Individual Ensemble 0.56688 0.60085 0.67693 0.63902 0.52586 0.58079 0.6386 0.70935 0.72011 0.74692 0.7463 w/ Box Cox Individual Ensemble 0.56688 0.60085 0.67693 0.63902 0.52586 0.58079 0.6386 0.70935 0.72011 0.74692 0.7463 Gen 0 1 2 3 4 5 Table 6. Removing constants and large Δs, Dataset B (100K sampled rows) leads to small but consistent improvements Table 7. DNNs vs. XGBoost on Dataset B (10K sampled rows) TabNet 0.68346 0.67571 0.65953 0.59195 0.62141 0.57723 0.57172 0.57622 0 1 2 3 4 5 6 improved XGBoost improved 0.6899 0.69008 0.68981 0.69022 0.68757 0.68869 0.68623 0.66495 0.68899 0.70212 0.70517 0.70411 0.70599 0.70799 0.70833 0.68422 0.69445 0.69951 0.70213 0.70388 0.70529 0.70633 TabNet Individual Ensemble 0.68011 0.69234 0.71806 0.71872 0.73702 0.70074 0.71789 0.75358 0.76891 0.78404 0.79210 XGBoost Individual Ensemble 0.66868 0.68036 0.67826 0.68020 0.65533 0.68001 0.68254 0.69169 0.69137 0.68468 0.68335 Gen 0 1 2 3 4 5 function L : Rk × Rk → R is cross-entropy by default: L (q, p) = − k ∑︁ j=1 q j log p j . 6 • Chung-Wei Lee, Pavlos Athanasios Apostolopulos, and Igor L. Markov When writing L (y, p) for some y ∈ Y, it refers to L (1y, p), where 1y is a one-hot vector in Rk with y-th entry being 1. Given a teacher model g, Knowledge Distillation refers to a training process for a stu- dent model f , where both f and g are functions for the k-class clas- sification but they may have different architectures (hide parameter- dependency here from simplicity). Specifically, for every i defining qi = σ (g(xi )) and pi = σ (f (xi )), we define the following objective function Lkd for Knowledge Distillation (KD): Lkd (g, f ) = N ∑︁ i=1 [α L (qi, pi ) + (1 − α)L (yi, pi )] . Label Smoothing [45] refers to a regularization method replacing L (y, σ (f (x))) with L (qε, σ (f (x))), where ε > 0 and qε j = (1 − ε)1{ j = y} + ε k for every entry j; in other words, qε = εu + (1 −ε)1y is the ground truth vector 1y mixed with a uniform distribution u. For a single data pair (x, y), the KD loss is α L (q, p) + (1 − α)L (y, p), where q = σ (g(x)), p = σ (f (x)). When L is the cross-entropy, then the KD loss is equal to − k ∑︁ j=1 log p j (cid:0)αq j + (1 − α)1{ j = y}(cid:1) therefore it can be seen as L (αq + (1 − α)1y, p); instance-specific label smoothing with qi for every data i. We propose a variant of knowledge distillation via a weighted dataset. Specifically, fixing an i, we let q′ i = αqi + (1 − α)1yi . Then we define k pairs (xi, j) with weight q′ i ( j). There are multiple ways to implement this. The first one is by using a weighted loss function. Specifically the weighted total loss is N ∑︁ i=1 Note also that: [si * L (1, f1 (xi )) + (1 − si ) * L (0, f1 (xi ))] Lwl (g, f ) = N ∑︁ k ∑︁ q′ i ( j)L ( j, pi ) j=1 i=1 k N ∑︁ ∑︁ = − i=1 j=1 log pi ( j) (αqi ( j) + (1 − α)1{ j = yi }) = N ∑︁ i=1 (α L (qi, pi ) + (1 − α)L (yi, pi )) = Lkd (g, f ), and this again recovers knowledge distillation. However, the dataset becomes k times bigger, which significantly increases training time when there are many classes. We can therefore consider another implementation of weighted datasets by sampling. Specifically, for each instance i, we sample a label zi from a categorical distribution with parameter q′ i supported on {1, . . . , k }. In other words, we label xi as class j with probability q′ the total loss of this implementation Lws (g, f ), we see that i ( j). Considering the expectation of E [Lws (g, f )] = E (cid:34) N ∑︁ (cid:35) L (zi, pi ) i=1 k ∑︁ N ∑︁ i=1 j=1 = q′ i ( j)L ( j, pi ) = Lwl (g, f ) = Lkd (g, f ). Therefore, we can view Lws as an unbiased estimator of the KD loss, which has the same size as the original dataset, and can be calculated without implementation of probabilistic labels or a customized KD loss. Moreover, when the optimization algorithm involves stochastic gradient descent, sampling across instances is also applied by the original KD loss. In this case, our method is close to the original method but differs in how sampling is performed, which also pro- vides an unbiased stochastic gradient. To see that, suppose we pick I uniformly at random from {1, . . . , N }. Then the expectation of gradient is E [∇L (zI , pI )] = E (cid:35) ∇L (zi, pi ) (cid:34) 1 N N ∑︁ i=1 = 1 N ∇Lkd (g, f ). 4.2 Practical techniques Based on the above equivalence, we use distillation based on weighted datasets. We perform straightforward yet impactful hyperparameter optimization, and also also optimize ensemble weights. Refined distillation on input data. The knowledge-distillation literature uses a teacher model f0 to train a student model f1 with the following loss function (cid:33) H (f0 (xi ), f1 (xi )) + (1 − β) β (cid:32) N ∑︁ i=1 (cid:33) H (yi, f1 (xi )) (cid:32) N ∑︁ i=1 where H (a, b) = −a log b − (1 − a) log(1 − b) is the cross entropy function. β is a hyperparameter. When β = 0, it corresponds to the normal binary classification loss function (without any knowledge from f0). In this project, we trained f1 on a weighted dataset, where each (xi, 0) has a weight 1 − f0 (xi ) and each (xi, 1) has a weight f0 (x0). This is similar to the case β = 1 for the loss function above. Al- though this forces the student model to learn and match the teacher model's prediction on the data, it prevents the student from seeing the ground truth. We found that student models in later generations tend to perform worse. We explain that by the loss of ground-truth information during the sequential knowledge-distillation process. Consequently, similar to the loss function, we mix the ground truth information into our weighted input. Specifically, we define positive and negative weights for each pair of data points ((xi, 1) and (xi, 0)) as follows β f0 (xi ) + (1 − β)yi and β (1 − f0 (xi )) + (1 − β)(1 − yi ) respectively. Likewise, β = 0 corresponds to the original dataset, and our original distillation approach corresponds to β = 1. Empirically, we found that setting β = 0.7 effectively prevents quality loss in subsequent models. Tuning TabNet's hyperparameters. Just like we used XGBoost "out of the box," we used default hyperparameters in TabNet. The deteriorating performance of TabNet on larger datasets in our earlier experiments might be explained by the need to scale the model size and architecture parameters with the size of the dataset. Therefore, we optimize three major parameters: • na - the attention layer dimension (8 by default). • nd - the prediction layer dimension (8 by default). • nsteps - the number of decision steps in the sequential en- coding process (3 by default). Results for Dataset V are shown in Table 8. Optimizing ensemble weights. As our experimental results indi- cate, ensembles of teacher and student models usually outperform every individual model. Previously we obtained an ensemble by simply averaging the predictions of models. To improve upon that, we assign a weight to each model and consider weighted averages of the predictions, where the weights are optimized. The result of such optimization should not be worse than any individual model and the average ensemble we used before (but overfitting is possible with insufficient data). Optimizing ensemble weights may look like a lin- ear problem at the first sight, but the overall classifier performance depends on ensemble weights in nonlinear ways [13]. Interactions between the (highly-correlated) models in the ensemble compli- cate this dependence and make optimization difficult. Ensembling models of different types tends to be more impactful than homoge- neous ensembling in practice, but makes weight optimization even more challenging. To optimize the weights, we use the Differen- tial Evolution method, following the discussion in [7]. The choice of optimization method is not essential. Tables 9 and 10 evaluate the optimization of ensemble weights on two datasets, using the default TabNet architecture and one with optimized hyperparam- eters. The results are compared to those for XGBoost. The entire strategy (including our prior optimizations) improves ROC AUC by 0.01–0.03 over single models. We observed that this optimization often produces some very small weights, so we round such small weights down to zero to simplify the ensembles and reduce possible overfitting (the remaining weights are re-optimized after models with zero weights are removed from the ensemble). 5 EMPIRICAL VALIDATION AND DEPLOYMENT We now assemble individual techniques developed and evaluated in previous sections into an overall workflow that produces a final high-quality model optimized for real-time inference. This work- flow is illustrated in Figure 1. Additionally, we continue exploring comparisons between TabNet and XGBoost on data sets with 100K sampled rows (in the style of Section 3). In the results below, we observe that the new techniques introduced in Section 4 allow Tab- Net to catch up with XGBoost in performance and even beat it by a significant amount on some datasets. Practical Knowledge Distillation: Using DNNs to Beat DNNs • 7 5.1 Combining XGBoost and TabNet Hoping for further improvement, we combine TabNet and XGBoost. Similar to the optimizing ensemble weights technique in the pre- vious section, here we ensemble generations from both XGBoost and TabNet. We obtain a score better than every single ensemble we observed - not a surprising result, but significant nevertheless. Upon careful inspection, we observe that only the first few XG- Boost generations are used. This reconfirms a more general trend we've discussed - DNNs gain more from knowledge distillation than XGBoost models do. 5.2 Optimizing XGBoost hyperparameters Now we also optimize XGBoost, since we used default hyperpa- rameters so far. nestimators is the number of boosting rounds and thus the number of trees built. In Table 11, we compare the default XGBoost (100 trees) to XGBoost models with 200, 400, and 1000 trees. As nestimators grows, model performance continues improv- ing, seemingly without saturation. With 1000 trees, it even beats the ensemble of the original XGBoost and TabNet we showed above, confirming that XGBoost is very competitive for tabular data. Tun- ing additional hyperparameters may further improve results, but risks diminishing returns. 5.3 Deployment considerations As seen in Section 5, with multiple advanced training techniques, TabNet ensembles become competitive with XGBoost, and com- bining such models further improves resuts. As these results are validated on data from the industry Platformplatform, we explore application deployment with an eye on any obstacles. To this end, we implemented all proposed techniques within the training workflow in Platform. However, the infrastructure available to us does not cur- rently support highly-optimized real-time inference for TabNet and ensembles of multiple models. Rather than implement such support (a considerable ML infrastructure project), we propose a shortcut - training a comparable model of supported type. Here we again rely on knowledge distillation: we distill the best available ensemble model into a simpler model supported for high-performance real- time inference via our distillation via a weighted dataset. This can be accomplished by creating a weighted dataset table and launching an appropriate API-driven model flow -- a routine task, much sim- pler than implementing the entire self-distillation procedure from scratch. More importantly, the resulting model exhibits practically the same performance and preserves the consistent improvements we have observed for more sophisticated (best) models across the Platformuse cases we worked with. Results in Table 13 show com- pelling ROC AUC improvements for all use cases. Gains range from 0.07% for Dataset R to 7.14% for Dataset C. Large gains are mostly associated with initial models that don't exhibit strong performance, whereas improving strong models is difficult (no surprises here). 6 CONCLUSIONS AND FUTURE WORK We developed a self-distillation method, made it practical, and suc- cessfully validated it on data from an industry high-performance end-to-end real-time ML platform. As theoretical justification for 8 • Chung-Wei Lee, Pavlos Athanasios Apostolopulos, and Igor L. Markov Table 8. Hyperparameter tuning for TabNet on Dataset V nd nsteps # of params 0 1 2 3 4 5 Ensemble 0-5 4 3 61560 0.91009 0.91837 0.92251 0.92083 0.91714 0.91995 0.93162 5 3 73370 0.91396 0.9217 0.92362 0.92053 0.92001 0.91673 0.93056 7 3 97422 0.91959 0.92674 0.92803 0.92209 0.91858 0.917 0.93579 8 3 109664 0.91267 0.92167 0.92427 0.92181 0.91949 0.91821 0.93362 9 4 140970 0.91346 0.91932 0.92297 0.92414 0.92329 0.91976 0.93058 12 7 259080 0.90885 0.91935 0.92169 0.92273 0.92095 0.9214 0.93053 16 6 311712 0.91816 0.92674 0.92154 0.92095 0.91837 0.91701 0.93658 Table 9. Optimizing ensemble weights for the default and tuned TabNet architectures on Dataset B (100K sampled rows) Ensemble TabNet tuned (nd =12, na=12, nsteps =6) Params: 28288 Single 0.70157 0.70878 0.71408 0.69722 0.6857 0.68283 0.71064 0.71687 0.71523 0.71393 0.71314 0.72662 Ensemble TabNet default (nd =8, na=8, nsteps = 3) Params: 11455 Single 0.68744 0.67698 0.68061 0.6821 0.67939 0.67189 0.69067 0.69452 0.69408 0.69226 0.69095 0.69521 XGBoost default Ensemble Nodes: 6938–7544 Single 0.67354 0.69761 0.70562 0.70228 0.70469 0.70371 0.69321 0.70138 0.70368 0.70515 0.70562 0 1 2 3 4 5 Opt Table 10. Optimizing ensemble weights for the default and tuned TabNet architectures on Dataset V Ensemble TabNet tuned (nd =16, na=16, nsteps =6) Params: 311712 Single 0.91816 0.92674 0.92154 0.92095 0.91837 0.91701 0.9276 0.93151 0.93406 0.9351 0.93658 0.93692 Ensemble TabNet default (nd =8, na=8, nsteps = 3) Params: 109664 Single 0.91267 0.92167 0.92427 0.92181 0.91949 0.91821 0.9235 0.92797 0.9303 0.93209 0.93362 0.93391 XGBoost default Nodes: 9276-10488 Single Ensemble 0.94064 0.93624 0.93177 0.92886 0.92699 0.92568 0.94123 0.93964 0.93795 0.93648 0.93524 0 1 2 3 4 5 Opt Table 11. Optimizing XGBoost on Dataset V # of Trees Avg Nodes 0 1 2 3 4 5 100 10000 0.94064 0.93624 0.93177 0.92886 0.92699 0.92568 18000 0.94454 0.94277 0.94008 0.93771 0.93629 0.93333 400 34500 0.94848 0.94767 0.94798 0.94556 0.94543 0.94457 83000 0.9528 0.95268 0.95113 0.95179 0.95205 0.95101 it, we proved the equivalence between our approach and the classi- cal knowledge distillation in terms of (the expectation of) the loss function. In addition to using self-distillation to produce powerful ensembles of DNNs and optimizing those ensembles using Differ- ential Evolution, we distill these ensembles into simpler models appropriate for high-performance real-time inference in practice. What we have accomplished looks paradoxical. Recall that the prior status quo had DNN models such as TabNet lose to gradient boosting on tabular data [18, 20, 40]. Since knowledge distillation improves TabNet more than it improves XGBoost, twe reduce he performance gap, and TabNet ensembles start winning on small data sets because they leverage diversity and avoid overfitting. With additional enhancements, TabNet ensembles are improved further and exhibit superior performance. However, their implementation complexity obstructs their use in high-performance real-time in- ference in the end-to-end ML platform. Therefore, we distill these advanced models into compact XGBoost models. Thus, we have used DNNs to help XGBoost beat (single) DNNs by a larger mar- gin on tabular data and then match the performance of powerful DNN ensembles. For large non-tabular datasets, gradient-boosting models might lack the capacity to compete with DNN architectures. However, our tabular datasets reach into respectable sizes, and we did not observe such trends. The results presented in this paper use proprietary datasets, but the trends we report, in all likelihood, carry over to public tabular data sets used in [18, 20, 40]. Our techniques and results involving gradient boosting on tab- ular data may be of particular interest in the context of resource- constrained high-performance inference on tabular data. On the other hand, our empirical results are limited to data sets without sparse features, such as any kind of ID numbers, because XGBoost does handle them well. Today, sparse features are best handled by trained latent-space embeddings within specialized DNN architec- tures, and such extensions can be adapted to TabNet. To this end, our data denoising and distillation techniques should carry over verbatim to produce DNN ensembles with improved performance. Gradient boosting models lack comparable facilities for sparse fea- tures, but can be combined with DNN architectures through stacking, i.e. by considering tree leaves as features for DNNs. Overall, our techniques can be viewed in a larger universe of hybrid ML models for supervised learning. In addition, recent findings on knowledge distillation in the context of Reinforcement Learning (RL) [27] sug- gest adapting our techniques to RL applications, e.g., [3]. REFERENCES [1] Mohamad Faiz Ahmad, Nor Ashidi Mat Isa, Wei Hong Lim, and Koon Meng Ang. 2022. Differential evolution: A recent review based on state-of-the-art works. Alexandria Engineering Journal 61, 5 (2022), 3831–3872. https://doi.org/10.1016/j. aej.2021.09.013 [2] Abdolmaged Alkhulaifi, Fahad Alsahli, and Irfan Ahmad. 2021. Knowledge dis- tillation in deep learning and its applications. PeerJ Computer Science 7 (2021), e474. [3] Pavlos Athanasios Apostolopoulos, Zehui Wang, Hanson Wang, Chad Zhou, Kittipat Virochsiri, Norm Zhou, and Igor L. Markov. 2021. Personalization for Web-based Services using Offline Reinforcement Learning. (2021). https://doi. Table 12. Shapes of industry use cases. Letter labels are derived from full names of company-internal use cases, rather than taken as consecutive letters of the alphabet (e.g., there is no Dataset D). Use Case # examples Dataset A Dataset B Dataset C Dataset I Dataset J Dataset P Dataset R Dataset S Dataset V Dataset W 19,835 1,202,700 2,338 186,854 1,291,701 127,850 2,118,670 1,032,414 103,883 73,100 # of each type of features float 9 23 6 612 10 79 13 20 46 2 categorical 0 5 10 9 15 20 8 10 5 10 int 2 38 58 16 65 121 37 7 66 9 bool 1 0 5 4 15 50 4 5 7 2 Practical Knowledge Distillation: Using DNNs to Beat DNNs • 9 Table 13. The ROC AUC scores for the use cases. Ours Use Case Dataset A 0.89828 0.70414 Dataset B 0.91071 Dataset C 0.98536 Dataset I 0.98320 Dataset J 0.63069 Dataset P 0.87349 Dataset R 0.70414 Dataset S Dataset W 0.64012 Baseline Gain 0.27% 0.89555 2.00% 0.68417 7.14% 0.83928 0.02% 0.98520 0.06% 0.98258 3.54% 0.59525 0.07% 0.87276 2.00% 0.68417 0.86% 0.63156 Table 14. Removing constant columns and large Δs on Dataset V leads to small but consistent improvements. Gen TabNet 0.90733 0 0.90965 1 0.91034 2 0.91057 3 0.90888 4 0.90816 5 improved XGBoost improved 0.91146 0.91314 0.91414 0.91439 0.91435 0.93608 0.93362 0.93033 0.92783 0.92562 0.92363 0.93784 0.93693 0.93568 0.93439 0.93326 Table 15. XGBoost distilled from last vs. from ensemble on Dataset B. No substantial difference in results is observed, XGBoost (dist. from last) XGBoost (dist. from ens.) Individual Ensemble 0.89705 0.89864 0.89986 0.90062 0.90080 0.89997 Individual Ensemble 0.89705 0.89864 0.90018 0.90030 0.90019 0.90057 0.90038 0.90155 0.90190 0.90201 0.90222 0.90038 0.90108 0.90164 0.90212 0.90218 Gen 0 1 2 3 4 5 Table 16. TabNet distilled from last vs. from ensemble on Dataset B. No substantial difference in results is observed, TabNet (dist. from last) TabNet (dist. from ens.) Individual Ensemble Individual Ensemble 0.88899 0.88899 0.89321 0.89321 0.89483 0.89316 0.89297 0.89489 0.89411 0.89520 0.89360 0.89418 0.89462 0.89659 0.89720 0.89789 0.89833 0.89462 0.89535 0.89682 0.89750 0.89791 Gen 0 1 2 3 4 5 org/10.48550/ARXIV.2102.05612 [4] Sercan Ö. Arik and Tomas Pfister. 2021. TabNet: Attentive interpretable tabular learning. AAAI 35(8), 6679–6687. [5] Devansh Arpit, Stanisław Jastrzębski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. 2017. A closer look at memorization in deep networks. In Interna- tional conference on machine learning. PMLR, 233–242. [6] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. 2019. MixMatch: A Holistic Approach to Semi-Supervised 10 • Chung-Wei Lee, Pavlos Athanasios Apostolopulos, and Igor L. Markov Table 17. Removing constants and large Δs on Dataset R (100K sampled rows) leads to improvements TabNet Δ = 0.001 TabNet Δ = 0.01 XGBoost 0.87384 0.87384 0.87534 0.87543 0.8755 0.87563 0.87556 0.87558 0.87571 0.87514 0.87561 0.8746 0.88393 0.88631 0.88653 0.8852 0.88338 0.88284 0.87556 0.87623 0.8766 0.87663 0.87658 0.87562 0.87578 0.87602 0.87621 0.87643 0 1 2 3 4 5 0.88811 0.88911 0.88922 0.88899 0.88872 Learning. https://doi.org/10.48550/ARXIV.1905.02249 [7] Jason Brownlee. 2020. How to Develop a Weighted Average Ensemble for Deep Learning Neural Networks. https://tinyurl.com/wavg4dnn [8] Derek Chen, Zhou Yu, and Samuel R Bowman. 2021. Learning with noisy labels by targeted relabeling. arXiv preprint arXiv:2110.08355 (2021). [9] Hanting Chen, Yunhe Wang, Chang Xu, Chao Xu, and Dacheng Tao. 2020. Learn- ing student networks via feature embedding. IEEE Transactions on Neural Networks and Learning Systems 32, 1 (2020), 25–35. [10] Tianqi Chen and Carlos Guestrin. 2016. XGBoost: A scalable tree boosting system. KDD, 785–794. [11] Xu Cheng, Zhefan Rao, Yilan Chen, and Quanshi Zhang. 2020. Explaining knowl- edge distillation by quantifying the knowledge. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 12925–12935. [12] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018). [13] Xibin Dong, Zhiwen Yu, Wenming Cao, Yifan Shi, and Qianli Ma. 2020. A survey on ensemble learning. Frontiers of Computer Science 14, 2 (2020), 241–258. [14] Teodor Fredriksson, David Issa Mattos, Jan Bosch, and Helena Holmström Olsson. 2020. Data Labeling: An Empirical Investigation into Industrial Challenges and Mitigation Strategies. In Product-Focused Software Process Improvement, Maurizio Morisio, Marco Torchiano, and Andreas Jedlitschka (Eds.). Springer International Publishing, Cham, 202–216. [15] Tommaso Furlanello, Zachary Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. 2018. Born again neural networks. ICML, 1607–1616. [16] Mudasir A Ganaie, Minghui Hu, et al. 2021. Ensemble deep learning: A review. arXiv preprint arXiv:2104.02395 (2021). [17] Chen Gong, Yongliang Ding, Bo Han, Gang Niu, Jian Yang, Jane J. You, Dacheng Tao, and Masashi Sugiyama. 2022. Class-Wise Denoising for Robust Learning under Label Noise. IEEE Transactions on Pattern Analysis and Machine Intelligence (2022), 1–1. https://doi.org/10.1109/TPAMI.2022.3178690 [18] Yury Gorishniy, Ivan Rubachev, Valentin Khrulkov, and Artem Babenko. 2021. Revisiting Deep Learning Models for Tabular Data. (2021). https://doi.org/10. 48550/ARXIV.2106.11959 [19] Jianping Gou, Baosheng Yu, Stephen J Maybank, and Dacheng Tao. 2021. Knowl- edge distillation: A survey. International Journal of Computer Vision 129, 6 (2021), 1789–1819. [20] Léo Grinsztajn, Edouard Oyallon, and Gaël Varoquaux. 2022. Why do tree-based models still outperform deep learning on tabular data? arXiv:2207.08815 (2022). [21] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. 2018. Co-teaching: Robust Training of Deep Neural Networks with Extremely Noisy Labels. https://doi.org/10.48550/ARXIV.1804. 06872 [22] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2015. Deep Residual Learning for Image Recognition. https://doi.org/10.48550/ARXIV.1512.03385 [23] Geoffrey Hinton, Oriol Vinyals, Jeff Dean, et al. 2015. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 2, 7 (2015). [24] Eyke Hüllermeier and Willem Waegeman. 2021. Aleatoric and epistemic uncer- tainty in machine learning: An introduction to concepts and methods. Machine Learning 110, 3 (2021), 457–506. [25] Jonathan Krause, Benjamin Sapp, Andrew Howard, Howard Zhou, Alexander Toshev, Tom Duerig, James Philbin, and Li Fei-Fei. 2016. The unreasonable effectiveness of noisy data for fine-grained recognition. In European Conference on Computer Vision. Springer, 301–320. [26] Harashta Tatimma Larasati, Aji Teguh Prihatno, Howon Kim, et al. 2022. A Review of Dataset Distillation for Deep Learning. In 2022 International Conference on Platform Technology and Service (PlatCon). IEEE, 34–37. [27] Zhao-Hua Li, Yang Yu, Yingfeng Chen, Ke Chen, Zhipeng Hu, and Changjie Fan. 2021. Neural-to-Tree Policy Distillation with Policy Improvement Criterion. arXiv preprint arXiv:2108.06898 (2021). [28] Igor L. Markov, Hanson Wang, Nitya Kasturi, Shaun Singh, Sze Wai Yuen, Mia Garrard, Sarah Tran, Yin Huang, Zehui Wang, Igor Glotov, et al. 2022. Looper: An end-to-end ML platform for product decisions. KDD (2022). [29] Dmitry Medvedev and Alexander D'yakonov. 2021. New properties of the data distillation method when working with tabular data. In International Conference on Analysis of Images, Social Networks and Texts. Springer, 379–390. [30] Zhong Meng, Jinyu Li, Yong Zhao, and Yifan Gong. 2019. Conditional teacher- student learning. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 6445–6449. [31] Seyed Iman Mirzadeh, Mehrdad Farajtabar, Ang Li, Nir Levine, Akihiro Mat- sukawa, and Hassan Ghasemzadeh. 2020. Improved knowledge distillation via teacher assistant. In Proceedings of the AAAI conference on artificial intelligence, Vol. 34. 5191–5198. [32] Nitika Nigam, Tanima Dutta, and Hari Prabhat Gupta. 2020. Impact of noisy labels in learning techniques: a survey. In Advances in data and information sciences. Springer, 403–411. [33] Sankaran Panchapagesan, Daniel S Park, Chung-Cheng Chiu, Yuan Shangguan, Qiao Liang, and Alexander Gruenstein. 2021. Efficient knowledge distillation for rnn-transducer models. In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 5639–5643. [34] Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. 2017. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE conference on computer vision and pattern recognition. 1944–1952. [35] Mary Phuong and Christoph Lampert. 2019. Towards understanding knowledge distillation. In International Conference on Machine Learning. PMLR, 5142–5151. [36] Omer Sagi and Lior Rokach. 2018. Ensemble learning: A survey. WIREs Data Mining and Knowledge Discovery 8, 4 (2018), e1249. https://doi.org/10.1002/widm. 1249 arXiv:https://wires.onlinelibrary.wiley.com/doi/pdf/10.1002/widm.1249 [37] Mohsen Shahhosseini, Guiping Hu, and Hieu Pham. 2019. Optimizing Ensem- ble Weights and Hyperparameters of Machine Learning Models for Regression Problems. https://doi.org/10.48550/ARXIV.1908.05287 [38] Mohsen Shahhosseini, Guiping Hu, and Hieu Pham. 2020. Optimizing Ensemble Weights for Machine Learning Models: A Case Study for Housing Price Prediction. In Smart Service Systems, Operations Management, and Analytics, Hui Yang, Robin Qiu, and Weiwei Chen (Eds.). Springer International Publishing, Cham, 87–97. [39] Jun Shu, Qi Xie, Lixuan Yi, Qian Zhao, Sanping Zhou, Zongben Xu, and Deyu Meng. 2019. Meta-weight-net: Learning an explicit mapping for sample weighting. Advances in neural information processing systems 32 (2019). [40] Ravid Shwartz-Ziv and Amitai Armon. 2022. Tabular data: Deep learning is not all you need. Information Fusion 81 (2022), 84–90. [41] Niclas Simmler, Pascal Sager, Philipp Andermatt, Ricardo Chavarriaga, Frank- Peter Schilling, Matthias Rosenthal, and Thilo Stadelmann. 2021. A Survey of Un-, Weakly-, and Semi-Supervised Learning Methods for Noisy, Missing and Partial Labels in Industrial Vision Applications. In 2021 8th Swiss Conference on Data Science (SDS). 26–31. https://doi.org/10.1109/SDS51136.2021.00012 [42] Hwanjun Song, Minseok Kim, Dongmin Park, Yooju Shin, and Jae-Gil Lee. 2020. https: Learning from Noisy Labels with Deep Neural Networks: A Survey. //doi.org/10.48550/ARXIV.2007.08199 [43] Hwanjun Song, Minseok Kim, Dongmin Park, Yooju Shin, and Jae-Gil Lee. 2022. Learning from noisy labels with deep neural networks: A survey. IEEE Transactions on Neural Networks and Learning Systems (2022). [44] Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. 2019. Patient knowledge distillation for bert model compression. arXiv preprint arXiv:1908.09355 (2019). [45] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. 2016. Rethinking the inception architecture for computer vision. CVPR, 2818–2826. [46] Gregor Urban, Krzysztof J Geras, Samira Ebrahimi Kahou, Ozlem Aslan, Shengjie Wang, Rich Caruana, Abdelrahman Mohamed, Matthai Philipose, and Matt Richardson. 2016. Do deep convolutional nets really need to be deep and convo- lutional? arXiv preprint arXiv:1603.05691 (2016). [47] Xiaobo Wang, Tianyu Fu, Shengcai Liao, Shuo Wang, Zhen Lei, and Tao Mei. 2020. Exclusivity-consistency regularized knowledge distillation for face recognition. In European Conference on Computer Vision. Springer, 325–342. Practical Knowledge Distillation: Using DNNs to Beat DNNs • 11 [48] Yongquan Yang, Haijun Lv, and Ning Chen. 2022. A Survey on ensemble learning under the era of deep learning. Artificial Intelligence Review (nov 2022). https: //doi.org/10.1007/s10462-022-10283-5 [49] Ze Yang, Linjun Shou, Ming Gong, Wutao Lin, and Daxin Jiang. 2020. Model compression with two-stage multi-teacher knowledge distillation for web question answering system. In Proceedings of the 13th International Conference on Web Search and Data Mining. 690–698. [50] Yang You, Jing Li, Sashank Reddi, Jonathan Hseu, Sanjiv Kumar, Srinadh Bhojana- palli, Xiaodan Song, James Demmel, Kurt Keutzer, and Cho-Jui Hsieh. 2019. Large batch optimization for deep learning: Training bert in 76 minutes. arXiv preprint arXiv:1904.00962 (2019). [51] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. 2021. Understanding deep learning (still) requires rethinking generalization. Commun. ACM 64, 3 (2021), 107–115. [52] Shiwen Zhang, Sheng Guo, Limin Wang, Weilin Huang, and Matthew Scott. 2020. Knowledge integration networks for action recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34. 12862–12869. [53] Long Zhao, Xi Peng, Yuxiao Chen, Mubbasir Kapadia, and Dimitris N Metaxas. 2020. Knowledge as priors: Cross-modal knowledge generalization for datasets without superior knowledge. In Proceedings of the IEEE/CVF Conference on Com- puter Vision and Pattern Recognition. 6528–6537.
http://arxiv.org/abs/2302.12359v2
2023-02-28T20:16:05
2023-02-23T22:50:24
Targeted Search Control in AlphaZero for Effective Policy Improvement
AlphaZero is a self-play reinforcement learning algorithm that achieves superhuman play in chess, shogi, and Go via policy iteration. To be an effective policy improvement operator, AlphaZero's search requires accurate value estimates for the states appearing in its search tree. AlphaZero trains upon self-play matches beginning from the initial state of a game and only samples actions over the first few moves, limiting its exploration of states deeper in the game tree. We introduce Go-Exploit, a novel search control strategy for AlphaZero. Go-Exploit samples the start state of its self-play trajectories from an archive of states of interest. Beginning self-play trajectories from varied starting states enables Go-Exploit to more effectively explore the game tree and to learn a value function that generalizes better. Producing shorter self-play trajectories allows Go-Exploit to train upon more independent value targets, improving value training. Finally, the exploration inherent in Go-Exploit reduces its need for exploratory actions, enabling it to train under more exploitative policies. In the games of Connect Four and 9x9 Go, we show that Go-Exploit learns with a greater sample efficiency than standard AlphaZero, resulting in stronger performance against reference opponents and in head-to-head play. We also compare Go-Exploit to KataGo, a more sample efficient reimplementation of AlphaZero, and demonstrate that Go-Exploit has a more effective search control strategy. Furthermore, Go-Exploit's sample efficiency improves when KataGo's other innovations are incorporated.
[ "Alexandre Trudeau", "Michael Bowling" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12359v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12359v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.AI", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.AI", "cs.LG" ]
Targeted Search Control in AlphaZero for Effective Policy Improvement Alexandre Trudeau University of Alberta Edmonton, Canada [email protected] Michael Bowling University of Alberta Edmonton, Canada [email protected] 3 2 0 2 b e F 8 2 ] I A . s c [ 2 v 9 5 3 2 1 . 2 0 3 2 : v i X r a ABSTRACT AlphaZero is a self-play reinforcement learning algorithm that achieves superhuman play in chess, shogi, and Go via policy itera- tion. To be an effective policy improvement operator, AlphaZero's search requires accurate value estimates for the states appearing in its search tree. AlphaZero trains upon self-play matches begin- ning from the initial state of a game and only samples actions over the first few moves, limiting its exploration of states deeper in the game tree. We introduce Go-Exploit, a novel search control strategy for AlphaZero. Go-Exploit samples the start state of its self-play trajectories from an archive of states of interest. Beginning self-play trajectories from varied starting states enables Go-Exploit to more effectively explore the game tree and to learn a value function that generalizes better. Producing shorter self-play trajectories allows Go-Exploit to train upon more independent value targets, improv- ing value training. Finally, the exploration inherent in Go-Exploit reduces its need for exploratory actions, enabling it to train under more exploitative policies. In the games of Connect Four and 9x9 Go, we show that Go-Exploit learns with a greater sample efficiency than standard AlphaZero, resulting in stronger performance against reference opponents and in head-to-head play. We also compare Go-Exploit to KataGo, a more sample efficient reimplementation of AlphaZero, and demonstrate that Go-Exploit has a more effective search control strategy. Furthermore, Go-Exploit's sample efficiency improves when KataGo's other innovations are incorporated. KEYWORDS AlphaZero; Search Control; Reinforcement Learning; Planning ACM Reference Format: Alexandre Trudeau and Michael Bowling. 2023. Targeted Search Control in AlphaZero for Effective Policy Improvement. In Proc. of the 22nd Interna- tional Conference on Autonomous Agents and Multiagent Systems (AAMAS 2023), London, United Kingdom, May 29 – June 2, 2023, IFAAMAS, 15 pages. 1 INTRODUCTION AlphaZero [11–13] is a model-based reinforcement learning (RL) algorithm that has achieved impressive results in two-player, zero- sum games, reaching superhuman play in chess, shogi, and Go. AlphaZero simulates self-play matches with a perfect model of its environment (the rules of the game) to train a neural network that learns a value function and action selection priors over states. Each turn, the value function and priors guide a lookahead search that returns an improved policy. AlphaZero trains its neural network Proc. of the 22nd International Conference on Autonomous Agents and Multiagent Sys- tems (AAMAS 2023), A. Ricci, W. Yeoh, N. Agmon, B. An (eds.), May 29 – June 2, 2023, London, United Kingdom. © 2023 International Foundation for Autonomous Agents and Multiagent Systems (www.ifaamas.org). All rights reserved. on the self-play matches produced under the improved policies, enabling it to improve its play via policy iteration. Despite its success, AlphaZero's training suffers from sample inefficiency. In 19x19 Go, AlphaZero requires hundreds of millions of training samples to attain superhuman play ([12], Figure 1c). AlphaZero's sample efficiency depends upon the distribution of states visited and trained upon. Although AlphaZero has a perfect model of its environment, it cannot feasibly visit and learn the opti- mal value for each state. Instead, AlphaZero trains upon the states that it visits on-policy in simulated self-play matches beginning from the initial state of the game. As in other RL algorithms [14], AlphaZero takes exploratory actions during its self-play matches so that it can train upon a variety of states, enabling it to make more informed action selections in the future. AlphaZero employs sim- plistic exploration mechanisms during self-play training: randomly perturbing the learned priors guiding search and stochastically selecting actions near the start of self-play matches. As a result, AlphaZero's training procedure exhibits the following limitations: (1) Since AlphaZero begins its self-play matches from the initial state of a game, it often transitions into a terminal state before reaching and exploring states deeper in the game tree. In addition, AlphaZero only samples actions over the first few moves of a self-play match, further limiting exploration deeper in the game tree. (2) AlphaZero's exploration mechanisms cause it to train under weaker, exploratory policies, slowing policy iteration. (3) AlphaZero only produces a single, noisy value target from a full self-play match, slowing value training. We hypothesized that AlphaZero could address these limitations, and learn with greater sample efficiency, with a more effective search control strategy. Sutton and Barto define search control as "the process that selects the starting states and actions for the simulated experiences generated by the model" [14]. In AlphaZero, this would amount to strategically choosing the starting state of its simulated trajectories. We propose one such strategy that adheres to four guiding principles. The algorithm should: (a) Continually visit new states throughout the state space to learn their values and a good policy. (b) Keep track of states of interest and have the ability to reliably revisit them for further exploration. (c) Limit exploration's bias in the learning targets. (d) Produce more independent value targets to train upon. In this paper, we introduce Go-Exploit, a novel search control strategy for AlphaZero. Go-Exploit takes inspiration from Go-Explore [3] and Exploring Restart Distributions [15], which begin simulated episodes from previously visited states sampled from a memory. Similarly, Go-Exploit maintains an archive of states of interest. At the beginning of a self-play trajectory, the start state is either uni- formly sampled from the archive or is set to the initial state of the game. Two factors influencing Go-Exploit's performance are the definition of states of interest and the structure of the archive. In this paper, we experiment with two definitions of states of interest and three archive structures. In the games of Connect Four and 9x9 Go, we show that Go- Exploit exhibits a greater sample efficiency than standard Alp- haZero, measured in their average win rates against reference op- ponents over the course of training and in the results of their head- to-head play. We also compare and contrast Go-Exploit and KataGo [19], a more sample efficient reimplementation of AlphaZero. Go- Exploit's search control strategy results in faster learning than KataGo's. Furthermore, Go-Exploit's sample efficiency improves when KataGo's other innovations are incorporated. We conclude by showing how Go-Exploit's adherence to the guiding principles enables it to learn more effectively than AlphaZero. 2 ALPHAZERO AlphaZero [12] represents its learned game knowledge with a neu- ral network fθ (s) = (p, v) parameterized by weights θ . fθ takes a state s as input and outputs a value estimate v estimating the expected game outcome from state s under AlphaZero's current policy. fθ also outputs a vector of action selection priors p estimat- ing AlphaZero's current policy from state s. AlphaZero improves its play by training upon simulated matches played against itself. These self-play matches begin from the initial state of a game s0. On each turn t, AlphaZero performs a vari- ant of Monte Carlo Tree Search [1, 2, 4], inspired by PUCB [8], to determine the action at that is played. The search tree is ini- tialized with a root node corresponding to st and a set of edges representing the legal actions. Each edge stores a set of statistics {N (s, a), Q (s, a), P (s, a)}. N (s, a) is the number of times (s, a) has been traversed during the given search. Q (s, a) is the backed up action-value estimate of (s, a). P (s, a) is the prior probability of selecting action a from state s. In each search iteration, the search tree is traversed from the root node using PUCT action selection: a = arg maxa Q (s, a) + cpuctP (s, a) √︁N (s) 1 + N (s, a) N (s) is the number of times state s has been visited during the given search and cpuct > 0 is an exploration constant. This action selection rule encourages the search to traverse state-action pairs with large action-value estimates Q (s, a), large priors P (s, a), and few search visits N (s, a). Once the search traverses a state-action pair (sL, a) with N (sL, a) = 0, the successor state s ′ is added as a child of sL and fθ runs inference on the new state: fθ (s ′) = (p, v). The edge statistics of the legal actions that can be taken from s ′ are initialized as follows: {N (s ′, a) = 0, Q (s ′, a) = 0, P (s ′, a) = pa }, where pa is the component of p corresponding to action a. Next, the value estimate v is backed up to the state-action pairs that were traversed in the given iteration to update their action-values Q (s, a). Q (s, a) averages the value estimates v of the states in the subtree of (s, a). It estimates the expected outcome from (s, a) based on the value estimates of the likeliest successor states. Once the final search iteration is complete, the search returns a policy πt . The components of πt depend upon the distribution of N (st ,a) 1/τ search visits over the root state's actions: πt (a|st ) = (cid:205)b N (st ,b) 1/τ , where τ > 0 is a Softmax temperature. In the first k moves of a self-play match, action at is sampled from πt . After the first k moves, AlphaZero aims to be more exploitative and plays the action that was most visited during search. When a self-play match reaches a terminal state sT with outcome z, AlphaZero produces training samples (st , πt , z) that are added to an experience replay buffer B [6, 7] with fixed size |B|. Once bstep new training samples have been added to the replay buffer, bbatch training tuples are uniformly sampled to update fθ . The neural network's parameters θ are updated via stochastic gradient descent on the loss function loss = (z − v)2 − πT t log(p) + c ||θ ||2 where c is a regularization constant. Once fθ is updated, the next learning step begins. Training fθ 's policy head on the policies πt and the value head on the self-play match outcomes z brings about policy iteration, enabling AlphaZero to learn stronger policies. AlphaZero's search is a policy improvement operator because it concentrates the search visits on the root actions with the largest action-values Q (s, a). This brings about policy improvement as long as the value estimates used in search are sufficiently accurate under the current policy. Then, AlphaZero selects an action at with respect to the improved policy πt . Training fθ 's value head on outcomes produced under the improved policies enables policy evaluation to be with respect to the improved policy. These alternating processes of policy improvement and policy evaluation enable AlphaZero to learn stronger policies over time. However, the scarcity of independent value targets z relative to the policy targets πt can slow AlphaZero's value training and its subsequent ability to produce improved policies. 2.1 Exploration in AlphaZero The accuracy of fθ 's value estimates depends upon the distribution of states visited and trained upon. To have accurate value estimates for the diverse set of states that appear during search, AlphaZero must explore the state space during training. AlphaZero ensures exploration by introducing stochasticity into its action selection. In its search, AlphaZero perturbs the priors over the root node's actions with noise. When the root node sr is evaluated by the neural network fθ (sr ) = (p, v), the vector of action probabilities p is perturbed by a noise vector d ∼ Dir(α) sampled from a Dirichlet distribution. The perturbed priors P (sr , a) are computed using the equation P (sr , a) = (1−ε)pa +εda, where pa and da are components of p and d, respectively, and 0 < ε < 1. Randomly perturbing the priors over the root node's actions causes the policy πt returned by search to also be perturbed, introducing randomness in AlphaZero's action selection during self-play. AlphaZero also achieves exploration through action sampling. Upon the completion of a search, the search visits over the root N (st ,a) 1/τ node's actions are converted into a policy πt (a|st ) = (cid:205)b N (st ,b) 1/τ . The Softmax temperature τ helps control the level of exploration vs. exploitation in the produced policies. When τ = 1.0, the compo- nents of the policy πt are directly proportional to the search visits over the root state's actions. When τ < 1.0, the policies produced concentrate a greater portion of the probability on the most visited root actions and are, therefore, more exploitative. When τ > 1.0, the policies produced are more uniform, and thus, more exploratory. For the first k moves of a self-play game, the action that is played is sampled: at ∼ πt . Sampling actions proportionally to the search visit counts ensures that a variety of actions are tried from a given state, while still favouring the selection of actions that had large action-values Q (s, a) and large priors P (s, a). The stochasticity in AlphaZero's action selection presents an exploration-exploitation trade-off. On the one hand, the stochastic- ity allows AlphaZero to perform policy evaluation at a diverse set of states, improving the accuracy of the value estimates used dur- ing search. This enables AlphaZero's search to be a more effective policy improvement operator. On the other hand, the stochasticity causes AlphaZero to generate self-play matches under weaker ex- ploratory policies. This causes policy evaluation to be with respect to the weaker policies and for policy improvement to be with re- spect to policies πt perturbed with Dirichlet noise, slowing down policy iteration. AlphaZero manages this exploration-exploitation trade-off with the temperature τ, the number of action sampling moves k, and with ε, which controls the magnitude of the Dirichlet noise. These hyperparameters must be set large enough to ensure that AlphaZero sufficiently explores the state space, however, they cannot be so large that AlphaZero learns weak policies. This leads action sampling to only take place at the beginning of self-play matches, limiting the exploration of states later in games. 3 GO-EXPLOIT Given the limitations we identified in AlphaZero's training proce- dure, we adopted the guiding principles in section 1 in designing a new search control strategy for AlphaZero. We took inspiration from Go-Explore [3] and Exploring Restart Distributions [15] by incorporating an archive of states of interest in AlphaZero. Our algorithm, called Go-Exploit, modifies AlphaZero by beginning self- play trajectories from states of interest sampled from this archive. This enables Go-Exploit to reliably revisit states of interest through- out the game tree (guiding principle (b)) and to complete more self-play trajectories per learning step (guiding principle (d)). Then, the remainder of the self-play trajectory is produced identically to AlphaZero. However, Go-Exploit applies AlphaZero's exploration mechanisms of action sampling and Dirichlet noise from trajec- tories beginning throughout the game tree, enabling Go-Exploit to effectively explore the state space (guiding principle (a)). Since exploration is built into the "Go" step of sampling the start state of a self-play trajectory, we anticipated that Go-Exploit would require less stochasticity in its action selection than AlphaZero, enabling it to learn under more exploitative policies (guiding principle (c)). In this paper, we explore this approach while experimenting with two definitions of states of interest and three archive structures to see how they respectively impact the sample efficiency of Go-Exploit. The way states of interest is defined affects the performance of Go-Exploit because it changes the distribution of states that fθ is trained upon. Go-Exploit Visited States considers nonterminal states visited during self-play games as states of interest because we want action selection to improve from the states visited un- der AlphaZero's current policy. Go-Exploit Search States considers nonterminal search states appearing in trajectories beginning from s0 as states of interest because their value estimates influence the policies πt returned by search. Each variant of Go-Exploit samples start states from the archive uniformly at random. Since the archive can contain multiple copies of a state, it favours the selection of states that are frequently visited or observed during search. 3.1 Go-Exploit Visited States Go-Exploit Visited States makes simple modifications to AlphaZero. First, it initializes an archive A with the initial state of a game s0. This archive is shared amongst training actors that generate self-play trajectories. At the beginning of each self-play trajec- tory, Go-Exploit uniformly samples a random number r ∈ [0, 1]. If r < λ, Go-Exploit begins its self-play trajectory from s0. If r ≥ λ, Go-Exploit begins its self-play trajectory from a state of interest uniformly sampled from the archive. Second, Go-Exploit samples actions from πt for the first k moves of a self-play trajectory regard- less of whether the trajectory begins at s0. Finally, once a self-play trajectory completes, Go-Exploit Visited States adds the nonter- minal states that were visited to the archive A. We experimented with two variants of Go-Exploit Visited States using two different archives. Go-Exploit Visited States Expanding Archive (GEVE) uses an expanding archive consisting of every visited state. Go-Exploit Visited States Circular Archive (GEVC) employs a fixed-size circular archive consisting of the most recently visited states. 3.2 Go-Exploit Search States Go-Exploit Search States makes similar modifications to AlphaZero. It also employs training actors that sample start states from A and produce training data for fθ , however, they do not add visited states nor search states to the archive. Go-Exploit Search States, instead, concurrently runs archive actors responsible for populating the archive. The archive actors always play out complete self-play matches beginning from s0. Once an archive actor's self-play match is complete, it adds all of the nonterminal states that appeared dur- ing search into archive A. We experimented with two variants of Go- Exploit Search States. Go-Exploit Search States Reservoir Archive (GESR) uses a fixed-size archive and Reservoir Sampling [17] to determine which states are added/removed from the archive. Reser- voir Sampling approximates the distribution of states that would be included in the Expanding Archive. The Expanding Archive is not always feasible due to memory constraints. Go-Exploit Search States Circular Archive (GESC) employs a fixed-size circular archive consisting of the most recently observed search states. Pseudocode for each variant of Go-Exploit can be found in Appendix A. 3.3 Related Work Although Go-Exploit is inspired by Go-Explore [3], the two al- gorithms work very differently. In Go-Explore, the "Go" step is exploitative because it loads a start state associated with a high scoring trajectory. Exploratory actions are taken from this state to discover higher scoring trajectories. In Go-Exploit, on the other hand, the "Go" step is exploratory because it begins self-play trajec- tories from states throughout the game tree. Due to the exploration inherent in the sampling of the start states, Go-Exploit can then produce the remainder of its self-play trajectories under more ex- ploitative policies. Hence the name Go-Exploit. Go-Exploit extends Exploring Restart Distributions (ERDs) [15] to the new setting of AlphaZero. ERDs maintains a restart memory of visited states and combines it with the environment's initial state distribution to form the starting state distribution in a simulated environment. Go-Exploit Visited States is analogous to Uniform Restart, which uniformly samples the initial state of an episode from the circular restart memory. However, beginning self-play trajectories from previously visited states may not result in the most efficient learning. Go-Exploit Search States extends ERDs beyond visited states. Go-Exploit deliberately uses the notion of states of interest when defining which states to include in its archive to allow the inclusion of states that have never been explicitly visited. This enables Go-Exploit Search States to focus its planning updates on successor states appearing in search whose value estimates influence the returned policies. In MuZero [10], the successor to AlphaZero that plans with a learned model, greater sample efficiency is also achieved via search control. The authors introduce a variant of MuZero, called MuZero Reanalyze, that revisits previously visited states and performs a new search with the latest model. The model is then trained upon the new policy and value targets returned by the search. MuZero Reanalyze and Go-Exploit Visited States are similar in that they both plan from previously visited states. However, MuZero Reanalyze does not simulate new self-play trajectories from these previously visited states, limiting its exploration of the state space. KataGo [19] also incorporates search control into the AlphaZero framework. We will describe KataGo's search control procedure in Section 5 and then evaluate its sample efficiency relative to Go- Exploit. 4 EVALUATING GO-EXPLOIT Experiments were conducted in Connect Four and 9x9 Go to evalu- ate the sample efficiencies of the four variants of Go-Exploit relative to AlphaZero and KataGo and to understand how the changes intro- duced in Go-Exploit impact policy iteration. By performing experi- ments in Connect Four and 9x9 Go, we evaluated Go-Exploit in two domains with different characteristics and sizes. Connect Four has a smaller state space than 9x9 Go but has a greater percentage of terminal states in its game tree. Go-Exploit and elements of KataGo were coded on top of DeepMind's OpenSpiel [5] implementation of AlphaZero (our code is publicly available [16]). Experiments were run using OpenSpiel's versions of Connect Four and Go. Each experiment was run on a node with 48 cores (2 x AMD Milan 7413), 4 NVIDIA A100 gpus, and 498G of memory. To compare the sample efficiencies of AlphaZero, Go-Exploit, and KataGo, we had to choose a metric measuring sample efficiency. Sample efficiency can be measured by the average performance achieved over a computational budget. We chose this metric be- cause it is less sensitive to training horizon, it accounts for how effectively an algorithm learns throughout training, and it differenti- ates between algorithms achieving similar asymptotic performance. The average performance over a computational budget can be rep- resented by the "area under the curve" (AUC) in a performance vs. learning step graph. In our experiments, training runs lasted a fixed computational budget of 600 learning steps in Connect Four and 900 learning steps in 9x9 Go. An algorithm's performance was measured by its win rate against a fixed reference opponent called MCTS-Solver [18]. Over the course of training, 50 evaluator threads played evaluation matches against different difficulty lev- els of MCTS-Solver with 1x, 10x, 100x, and 1000x as many search iterations as AlphaZero, Go-Exploit, and KataGo. Equal numbers of evaluation matches were played as player 1 and player 2. Wins, draws, and losses were scored 1, 0.5, and 0, respectively. After each learning step, the win rate against each difficulty level of MCTS- Solver was computed by averaging the evaluation match results over the previous 50 learning steps. In our hyperparameter sweeps, 10 independent training runs were executed for each hyperparam- eter setting with randomly chosen seeds. Upon their completion, the win rates against each difficulty level of MCTS-Solver were av- eraged at each learning step. The average win rates were summed over all learning steps to compute the AUC over the computational budget. Ultimately, the AUC achieved against MCTS-Solver 10x was used to select hyperparameter values. To compare the sample efficiencies of AlphaZero, Go-Exploit, and KataGo, an additional 30 validation runs were conducted using the best hyperparame- ter settings. The AUCs against MCTS-Solver 1x, 10x, 100x, and 1000x were computed to see how the algorithms performed against different fixed reference opponents. For each algorithm and variant, we swept over the following hyperparameters: the learning rate lr of fθ , the regularization con- stant c of the loss function, the Dirichlet distribution parameter α, the constant ε affecting the magnitude of the Dirichlet noise, the exploration constant cpuct in search, the number of action sampling moves k, the probability λ of beginning self-play trajectories from s0, the archive type Atype, the archive size |A|, and the Softmax temperature τ. One hyperparameter was swept over at a time. The exact values swept over and the best performing hyperparameter values appear in Appendix B. There are additional hyperparameters involved in AlphaZero that do not directly affect the distribution of states visited and trained upon, and thus, are not pertinent to our main investigation. We chose sensible values for our experimental setup that also showed visible learning progress in our domains and held them fixed for all algorithms and variants. This includes the architecture of fθ , the number of threads, and batch sizes. These values also appear in Appendix B. Once the 30 validation runs were executed, we produced the learning curves appearing in Figure 1 with shaded 95% confidence intervals. In Figures 1a and 1b, we observe that in Connect Four, the four variants of Go-Exploit achieve greater AUCs than AlphaZero against MCTS-Solver. Early on in training, AlphaZero and the four variants of Go-Exploit exhibit similar learning rates, but as training progresses, AlphaZero's learning curve levels off to a lower asymp- totic win rate. It should be noted that during the hyperparameter sweeps, we observed that AlphaZero could match Go-Exploit's as- ymptotic win rate with different hyperparameter values but at the cost of a lower AUC (i.e., AlphaZero attains this asymptotic win rate too slowly). These results suggest that Go-Exploit is able to learn more efficiently than AlphaZero in Connect Four. Figures 1a and 1b also illustrate that Go-Exploit achieves even greater AUCs in Con- nect Four when including search states in its archive rather than visited states. Furthermore, greater sample efficiency is realized when Go-Exploit utilizes a Circular Archive focusing training on the states observed under the most recent policies. In Figures 1c and (a) Connect Four MCTS-Solver 10x (b) Connect Four MCTS-Solver 1000x (c) 9x9 Go MCTS-Solver 10x (d) 9x9 Go MCTS-Solver 1000x Figure 1: AlphaZero and Go-Exploit's win rates against MCTS-Solver 10x and 1000x in Connect Four and 9x9 Go. The win rates were averaged over the 30 validation runs and the shaded regions represent 95% confidence intervals. 1d, we observe that the four variants of Go-Exploit achieve much greater AUCs than AlphaZero in 9x9 Go. Go-Exploit exhibits its superior learning efficiency early on in training with much steeper learning curves than AlphaZero. Ultimately, AlphaZero and the four variants of Go-Exploit reach similar asymptotic win rates. Fig- ure 1c suggests that Go-Exploit may learn marginally faster with visited states rather than search states in the archive. Furthermore, Go-Exploit Visited States obtains a slightly greater AUC with a Circular Archive rather than an Expanding Archive. Comparing the plots in Figure 1 also reveals that Go-Exploit's gain in sample efficiency is much greater in 9x9 Go than in Connect Four. This suggests that Go-Exploit's gains in sample efficiency may be greater in larger games. This may be due to the fact that when the search space increases in size, AlphaZero wastes more samples to reach new states deeper in the game tree. To further measure Go-Exploit's learning efficiency relative to Al- phaZero, we conducted head-to-head matches between AlphaZero and each variant of Go-Exploit. Head-to-head matches were played using the validation runs' saved neural network checkpoints from learning steps 300 and 600 in Connect Four and learning steps 300 and 900 in 9x9 Go. Each algorithm's 30 neural network checkpoints played the other algorithms' 30 neural network checkpoints in one game as player 1 and one game as player 2. The win rates from the Connect Four and 9x9 Go tournaments appear in Table 1. Each row consists of two algorithms – Algorithm 1 and Algorithm 2. The Table 1: Algorithm 1's win rates in head-to-head matches Algorithm 1 2 GEVE AlphaZero GEVC AlphaZero GESR AlphaZero GESC AlphaZero GESC GEVE GESC GEVC GESC GESR GESR GEVE GESR GEVC GEVC GEVE Connect Four Checkpoint 600 300 0.643 0.538 0.593 0.483 0.603 0.513 0.632 0.582 0.515 0.565 0.530 0.601 0.519 0.605 0.493 0.505 0.502 0.496 0.495 0.483 9x9 Go Checkpoint 900 300 0.641 0.790 0.655 0.795 0.670 0.790 0.652 0.753 0.506 0.471 0.469 0.400 0.532 0.536 0.502 0.516 0.488 0.436 0.488 0.509 remaining entries in the row show Algorithm 1's win rate against Algorithm 2 at the respective checkpoints in Connect Four and 9x9 Go. These results reaffirm what was observed in Figure 1. In the Connect Four tournament, GESC outperformed AlphaZero and the other variants of Go-Exploit at checkpoint 300, reflecting its superior win rate at learning step 300 in Figures 1a and 1b. At check- point 600, each variant of Go-Exploit outperformed AlphaZero but (a) AlphaZero with KataGo's search control strategy (b) Go-Exploit with three of KataGo's modifications Figure 2: (a) Comparing the learning speeds of AKTI, AKB, and AKTIB to standard AlphaZero and GESC. (b) Comparing the learning speeds of GESCKB, GESCKPCR, GESCKFP, and GESC3K to standard AlphaZero and GESC. Both plots show the win rates against MCTS-Solver 10x in Connect Four. The shaded regions represent 95% confidence intervals. none stood out against each other. This mirrors the fact that the four variants of Go-Exploit achieved similar asymptotic win rates that were higher than AlphaZero's in Figures 1a and 1b. In the 9x9 Go tournament, each variant of Go-Exploit dominated AlphaZero at checkpoints 300 and 900. This is consistent with Go-Exploit's superior win rate against MCTS-Solver in Figures 1c and 1d. At checkpoint 300, GEVC outperformed both variants of Go-Exploit Search States and marginally beat GEVE, reflecting its superior win rate early on in training in Figure 1c. 5 GO-EXPLOIT VS. KATAGO KataGo [19] is an open-source reimplementation of AlphaZero in- troducing multiple modifications to the original algorithm improv- ing its sample efficiency. In this section, we compare Go-Exploit to the search control procedures introduced in KataGo. Then, we argue that KataGo's other modifications are compatible with Go-Exploit and help it achieve even greater sample efficiency. 5.1 KataGo's Search Control Strategy In the original KataGo paper and its subsequent release notes, key modifications to AlphaZero are highlighted. An additional change, which is not emphasized, is a search control strategy. KataGo's search control procedure involves self-play trajectory initialization and position branching. KataGo initializes self-play trajectories by sampling the first few moves from the policies p output by fθ . KataGo occasionally branches trajectories by selecting a different action from the one that was originally played. KataGo also period- ically branches from an early position by selecting the action with the greatest value from a set of randomly sampled actions. To compare the effectiveness of Go-Exploit's search control pro- cedure to KataGo's, we ran OpenSpiel's AlphaZero implementa- tion with KataGo's search control procedure in Connect Four. We ran AlphaZero with KataGo's trajectory initialization (AKTI), with KataGo's branching schemes (AKB), and then with both together (AKTIB). A hyperparameter sweep was conducted for each and then 30 additional validation runs were executed. The learning curves for AlphaZero, AlphaZero with KataGo's search control procedures, and GESC appear in Figure 2a. This figure illustrates that KataGo's search control strategy achieves a greater AUC than standard Al- phaZero, however, it is inferior to the AUC of GESC. KataGo's search control strategy marginally improves AlphaZero's sample efficiency in Connect Four but not nearly as much as Go-Exploit. 5.2 Go-Exploit's Compatibility With KataGo Excluding its trajectory initialization, KataGo's other modifications are compatible with Go-Exploit. KataGo's key modifications alter fθ 's architecture, the model updates, the feature representation, and search, which are orthogonal to Go-Exploit. To provide evidence that KataGo's other modifications are complementary with Go- Exploit, we incorporated three of KataGo's modifications into GESC to see if they could help it achieve even greater sample efficiency. The first modification was KataGo's branching scheme (GESCKB). While Go-Exploit's trajectory initialization resembles branching, it is not equivalent to KataGo's branching procedure. The second mod- ification was "Playout Cap Randomization" (GESCKPCR), which randomly varies the number of search iterations performed. The third modification was "Forced Playouts and Policy Target Pruning" (GESCKFP), which forces visits to certain root actions during search. We ran GESC with each modification individually and then with all three (GESC3K) to see if an even greater sample efficiency could be achieved. For each variant, we performed a hyperparameter sweep and 30 additional validation runs. Their respective learning curves appear in Figure 2b. This figure illustrates that GESC maintains a similar AUC when combined with branching. However, GESC achieves an even greater AUC with Playout Cap Randomization and Forced Playouts + Policy Target Pruning. Furthermore, GESC achieves an even greater AUC when combined with all three. While not definitive, this supports our argument that KataGo's modifi- cations to AlphaZero, other than its trajectory initialization, are complementary with Go-Exploit. 6 UNDERSTANDING GO-EXPLOIT To understand why Go-Exploit learns more efficiently than stan- dard AlphaZero, we collected statistics on the distribution of states (a) Connect Four (b) 9x9 Go Figure 3: The average number of unique nonterminal states visited by AlphaZero and Go-Exploit as a function of game tree depth. The shaded regions represent 95% confidence intervals. visited during self-play and observed during search in the validation runs. In the following subsections, we appeal to these collected sta- tistics and our guiding principles to try to establish why Go-Exploit outperforms AlphaZero in both Connect Four and 9x9 Go. 6.1 Greater Exploration of the State Space We have argued that one of AlphaZero's limitations is that it does not effectively explore states deeper in the game tree. Since Al- phaZero always begins its self-play trajectories from s0, it often transitions into a terminal state before reaching and exploring states deep in the game tree. In addition, AlphaZero only samples actions over the first k moves of a self-play game, further limiting explo- ration deeper in the game tree. These suspicions are confirmed when comparing AlphaZero's distribution of unique visited states to Go-Exploit's. Figures 3a and 3b depict each algorithm's distri- bution of unique nonterminal states visited by game tree depth in Connect Four and 9x9 Go, respectively. In these plots, we ob- serve that each variant of Go-Exploit visits a greater total number of unique nonterminal states than AlphaZero, particularly deeper in the game tree. At earlier game tree depths, AlphaZero visits more unique states than Go-Exploit. This is expected since Alp- haZero begins each self-play trajectory from the initial state of the game whereas Go-Exploit begins its self-play trajectories from states throughout the game tree. In Figure 3a, the AlphaZero line gradually decreases at deeper game tree depths because in Connect Four, AlphaZero often transitions into a terminal state and then resets to s0. In Figure 3b, the AlphaZero line remains fairly level over all game tree depths because there are fewer terminal states in 9x9 Go's game tree. Despite AlphaZero's increased exploration in 9x9 Go, Go-Exploit still outperforms AlphaZero by a greater margin in the larger game of 9x9 Go. It should also be noted that in Figure 3a, the slope of the AlphaZero line abruptly decreases at depth 10, which is the number of action sampling moves AlphaZero employs in Connect Four. This confirms the suspicion that only sampling actions over the first k moves of a self-play match hinders AlphaZero's exploration. These plots demonstrate that Go-Exploit is able to more effectively visit and train upon states throughout the state space than AlphaZero (guiding principle (a)) since it begins its self-play trajectories from states throughout the game tree and then subsequently takes exploratory actions from these varied starting points. Among the variants of Go-Exploit, Go-Exploit Search States vis- its a greater total number of unique states than Go-Exploit Visited States. In fact, in Connect Four, this is the case over all game tree depths. This may partly explain why Go-Exploit Search States ex- hibits a greater sample efficiency than Go-Exploit Visited States in Connect Four. On the other hand, in 9x9 Go, Go-Exploit Search States visits a greater number of unique states at earlier game tree depths whereas Go-Exploit Visited States visits a greater number of unique states deeper in the game tree. Furthermore, the percent- age difference in visited unique states between Go-Exploit Search States and Go-Exploit Visited States is greater in Connect Four than 9x9 Go. This may partly explain why the differences in sample efficiency between the variants of Go-Exploit are much smaller in 9x9 Go than in Connect Four. To understand how the differences between AlphaZero and Go- Exploit's state visit distributions impact policy iteration, we com- pared their value losses over visited states and search states. To establish a fair comparison, we generated 500 self-play matches beginning from the initial state of the game using the final neural network checkpoints from the validation runs. For each visited state, we computed the squared error between the state's value estimate vi and the outcome of the game zi . For each state observed during search, a trajectory was played to completion without Dirichlet noise and action sampling so that the value loss could also be com- puted over search states. Table 2 shows each algorithm's average value loss over visited states and search states at checkpoint 600 in Connect Four and checkpoint 900 in 9x9 Go. We observe that each variant of Go-Exploit has a smaller value loss over visited states and search states than AlphaZero.1 The fact that Go-Exploit has a smaller value loss over visited states in trajectories beginning from s0 is particularly striking considering that AlphaZero only trains on trajectories beginning from s0 and Go-Exploit does not. Go-Exploit's superior value loss over visited states and search states 1It may be surprising that smaller value losses were achieved over search states, however, this is due to there being no added stochasticity in these trajectories. Table 2: Value losses over visited states and search states at checkpoint 600 in Connect Four, checkpoint 900 in 9x9 Go Table 3: Hyperparameter values affecting the exploration- exploitation trade-off Connect Four 9x9 Go Algorithm Visited AlphaZero GEVE GEVC GESR GESC 0.196 0.161 0.164 0.170 0.151 Search Visited 0.161 0.136 0.116 0.127 0.108 0.293 0.227 0.223 0.214 0.241 Search 0.244 0.179 0.166 0.165 0.172 cpuct 1 1 1 1 1 AZ GEVE GEVC GESR GESC Connect Four k α τ 1 1 1 1 1 10 5 10 2 10 1 1 1 1 1 ε 0.25 0.25 0.1 0.25 0.25 cpuct 1 2 2 1 2 τ 1 1 1 1 1 9x9 Go k α 2 1 1 2 1 0.03 0.03 0.03 0.03 0.03 ε 0.1 0.1 0.1 0.1 0.1 illustrates that its value function can better predict match outcomes under its current policy and at a greater set of states than AlphaZero. We believe this can be attributed, in part, to Go-Exploit's more ef- fective exploration of the game tree than AlphaZero. The fact that Go-Exploit trains a more accurate and more generalizable value function might be what enables its search to be a more effective policy improvement operator. 6.2 More Independent Value Targets Another potential reason for Go-Exploit's smaller value losses over visited states and search states can be the fact that it produces and trains upon more independent value targets than AlphaZero. In AlphaZero, a new policy target is produced for each visited state whereas only a single independent value target is produced for each self-play trajectory (the outcome of the game). In addition to their scarcity, the value targets trained upon are noisy. The self- play match outcomes are affected by action sampling and Dirichlet noise, and therefore, may not reflect the true values of the visited states. Since Go-Exploit begins its self-play trajectories from states throughout the game tree, its self-play trajectories are shorter, on average, than AlphaZero's. In fact, in Connect Four, AlphaZero com- pletes an average of 147.01 trajectories per learning step whereas each variant of Go-Exploit completes over 323, on average. Similarly, in 9x9 Go, AlphaZero completes an average of 74.83 trajectories per learning step whereas each variant of Go-Exploit completes over 147, on average. Since Go-Exploit completes more self-play trajectories per learning step than AlphaZero, its experience replay buffer contains more independent value targets, on average, than AlphaZero's. Consistently training on a greater number of indepen- dent value targets (guiding principle (d)) may enable Go-Exploit to train a more accurate value function, allowing search to be a more effective policy improvement operator. 6.3 Training Under More Exploitative Policies In Figures 3a and 3b, we observed that Go-Exploit's search con- trol strategy enables it to more effectively explore the game tree than AlphaZero. Since there is exploration inherent in the sampling of a start state, we hypothesized that Go-Exploit would require less stochasticity in its action selection than AlphaZero (guiding principle (c)). This would allow Go-Exploit to train under more exploitative policies, accelerating its policy iteration. Our hypothe- sis was mostly confirmed in our hyperparameter sweeps. Table 3 shows the best performing values for the hyperparameters affecting the exploration-exploitation trade-off for AlphaZero (AZ) and each variant of Go-Exploit in Connect Four and 9x9 Go. In Connect Four, GEVE, GEVC, and GESR are tuned more exploitatively than Alp- haZero since they use fewer action sampling moves k or a smaller Dirichlet noise magnitude ε. GESC, however, was tuned identically to AlphaZero. In 9x9 Go, GEVE, GEVC, and GESC appear to be tuned more exploitatively than AlphaZero since they use fewer action sampling moves k, however, this conclusion is less certain since they employ larger cpuct constants, which affect the policies πt returned by search. Since Go-Exploit is either tuned identically or more exploitatively than AlphaZero in both Connect Four and 9x9 Go, we can conclude that Go-Exploit relies less upon stochastic action selection than AlphaZero to explore the state space. This enables Go-Exploit to produce and train under policies that are inherently more exploitative, accelerating policy iteration. 7 CONCLUSION In this paper, we have identified limitations in AlphaZero's train- ing procedure and introduced a search control strategy, called Go- Exploit, that mitigates them. In sampling the start states of self-play trajectories from an archive of states of interest, Go-Exploit more effectively visits and revisits states throughout the state-space than standard AlphaZero. Furthermore, Go-Exploit produces and trains upon more independent value targets than AlphaZero. These fac- tors enable Go-Exploit to learn a more accurate value function than AlphaZero, allowing search to be a more effective policy im- provement operator. In addition, the exploration built into the "Go" step reduces Go-Exploit's need for exploratory actions, yielding self-play trajectories produced under stronger, more exploitative policies. These three factors accelerate Go-Exploit's policy itera- tion, which results in greater sample efficiency. We demonstrated Go-Exploit's ability to learn faster than AlphaZero in Connect Four and 9x9 Go, both measured in its performance against a common reference opponent and in head-to-head matches. We also showed that Go-Exploit utilizes a more effective search control strategy than KataGo and can benefit from KataGo's other improvements. We have investigated two definitions of states of interest and three archive structures but have only sampled from the archive uniformly at random. Future work could investigate new ways of defining states of interest, new archive structures, and additional schemes for weighting and/or sampling states in the archive. Ad- ditional avenues for future work could include investigating how Go-Exploit can be used with a learned model [10] and in non- deterministic or imperfect information games [9]. REFERENCES [1] Cameron B Browne, Edward Powley, Daniel Whitehouse, Simon M Lucas, Peter I Cowling, Philipp Rohlfshagen, Stephen Tavener, Diego Perez, Spyridon Samoth- rakis, and Simon Colton. 2012. A survey of Monte Carlo tree search methods. IEEE Transactions on Computational Intelligence and AI in Games 4, 1 (2012), 1–43. [2] Rémi Coulom. 2006. Efficient selectivity and backup operators in Monte-Carlo tree search. In International Conference on Computers and Games. Springer, 72–83. [3] Adrien Ecoffet, Joost Huizinga, Joel Lehman, Kenneth O Stanley, and Jeff Clune. 2021. First return, then explore. Nature 590, 7847 (2021), 580–586. [4] Levente Kocsis and Csaba Szepesvári. 2006. Bandit based Monte-Carlo planning. In European Conference on Machine Learning. Springer, 282–293. [5] Marc Lanctot, Edward Lockhart, Jean-Baptiste Lespiau, Vinicius Zambaldi, Satyaki Upadhyay, Julien Pérolat, Sriram Srinivasan, Finbarr Timbers, Karl Tuyls, Shayegan Omidshafiei, et al. 2019. OpenSpiel: A framework for reinforcement learning in games. arXiv preprint arXiv:1908.09453 (2019). [6] Long-Ji Lin. 1992. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning 8, 3 (1992), 293–321. [7] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. 2013. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602 (2013). [8] Christopher D Rosin. 2011. Multi-armed bandits with episode context. Annals of Mathematics and Artificial Intelligence 61, 3 (2011), 203–230. [9] Martin Schmid, Matej Moravcik, Neil Burch, Rudolf Kadlec, Josh Davidson, Kevin Waugh, Nolan Bard, Finbarr Timbers, Marc Lanctot, Zach Holland, et al. 2021. Player of games. arXiv preprint arXiv:2112.03178 (2021). [10] Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon Schmitt, Arthur Guez, Edward Lockhart, Demis Hassabis, Thore Graepel, et al. 2020. Mastering Atari, Go, chess and shogi by planning with a learned model. Nature 588, 7839 (2020), 604–609. [11] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershel- vam, Marc Lanctot, et al. 2016. Mastering the game of Go with deep neural networks and tree search. Nature 529, 7587 (2016), 484–489. [12] David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. 2018. A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play. Science 362, 6419 (2018), 1140–1144. [13] David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. 2017. Mastering the game of Go without human knowledge. Nature 550, 7676 (2017), 354–359. [14] Richard S Sutton and Andrew G Barto. 2018. Reinforcement learning: An intro- duction. MIT press. [15] Arash Tavakoli, Vitaly Levdik, Riashat Islam, Christopher M Smith, and Petar Kormushev. 2018. Exploring restart distributions. arXiv preprint arXiv:1811.11298 (2018). [16] Alexandre Trudeau and Michael Bowling. 2023. Go-Exploit code. https://github. com/alextrudeau/go_exploit [17] Jeffrey S Vitter. 1985. Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS) 11, 1 (1985), 37–57. [18] Mark HM Winands, Yngvi Björnsson, and Jahn-Takeshi Saito. 2008. Monte-Carlo tree search solver. In International Conference on Computers and Games. Springer, 25–36. [19] David J Wu. 2019. Accelerating self-play learning in Go. arXiv preprint arXiv:1902.10565 (2019). A PSEUDOCODE Algorithm 1 Go-Exploit Require: total_steps, num_training_actors, num_archive_actors, Atype, |A|, use_search_states, |B|, bstep, bbatch, λ, iters, α, ε, cpuct, τ, k, lr , c training_actor(A, λ, iters, α, ε, cpuct, τ, k, Q) 1: Initialize trajectory queue Q 2: Initialize policy-value network fθ 3: A = initialize_archive(Atype, |A|, s0) 4: for i ∈ 1, ..., num_training_actors do 5: 6: end for 7: for i ∈ 1, ..., num_archive_actors do 8: 9: end for 10: learner(total_steps, |B|, bstep, bbatch, Q, A, Atype, use_search_states, lr, c) archive_actor(A, Atype, use_search_states, iters, α, ε, cpuct, τ, k) Algorithm 2 training_actor Require: A, λ, iters, α, ε, cpuct, τ, k, Q 1: while True do 2: trajectory = [] t = 0 st = initialize_game() r = rand_num(0, 1) if r > λ then st = A.sample() end if 8: 9: while st is not terminal do 10: πt = search(iters, α, ε, cpuct, τ) if t < k then at ∼ πt else at = arg maxa πt [a] end if trajectory.add(st , πt ) st = take_action(st , at ) t = t + 1 end while z = st .outcome() trajectory.set_outcome(z) Q.push(trajectory) 22: 23: end while 3: 4: 5: 6: 7: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 3: Algorithm 3 archive_actor Require: A, Atype, use_search_states, iters, α, ε, cpuct, τ, k 1: while True do Atemp = [] 2: t = 0 st = initialize_game() 4: 5: while st is not terminal do 6: πt , search_states = search(iters, α, ε, cpuct, τ) if t < k then at ∼ πt 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: else at = arg maxa πt [a] end if Atemp.add(search_states) st = take_action(st , at ) t = t + 1 end while if use_search_states then A.update(A, Atemp, Atype) end if 18: 19: end while Algorithm 4 learner Require: total_steps, |B|, bstep, bbatch, Q, A, Atype, use_search_states, lr , c 1: B = initialize_buffer(|B|) 2: for step ∈ 1, ..., total_steps do 3: Atemp = [] step_states = 0 4: 5: while step_states < bstep do trajectory = Q.pop() 6: for (st , πt , z) ∈ trajectory do 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: B.add(st , πt , z) step_states = step_states + 1 Atemp.add(st ) end for end while btrain = B.sample(bbatch) fθ .update(btrain, lr, c) if NOT use_search_states then A.update(A, Atemp, Atype) end if 17: 18: end for Algorithm 5 Archive update() Require: A, Atemp, Atype 1: for s ∈ Atemp do 2: if Atype == "Expanding" then A.push(s) 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: else if Atype == "Circular" then if A.size() < |A| then A.push(s) else A.pop() A.push(s) end if else if Atype == "Reservoir" then if A.size() < |A| then A.push(s) else i ∼ rand_int(0, n − 1) if i < |A| then A[i] = s end if end if n = n + 1 end if 21: 22: end for B HYPERPARAMETER SWEEPS Connect Four 9x9 Go Training actors Archive actors fθ 's depth fθ 's width |B| bstep bbatch Search iterations Learning steps 700 50 10 residual blocks 256 filters 217 212 8 mini-batches of 29 100 600 700 50 10 residual blocks 256 filters 217 212 8 mini-batches of 29 400 900 Table 4: Fixed hyperparameter values AlphaZero [5, 10, 20, 30] N/A N/A lr c α ε cpuct k λ |A| τ GEVE GESR GEVC ← [10−2, 10−3, 10−4] → ← [10−4, 10−5, 10−6] → ← [0.03, 1.0, 5.0] → ← [0.05, 0.1, 0.25, 0.5] → ← [0.5, 1.0, 2.0, 4.0] → [5, 10, 20] ← [0, 0.01, 0.1, 0.25] → [1, 2, 5, 10, 20] [2, 5, 10, 20] GESC [5, 10, 20] N/A ← [105, 106, 2×106] → ← [0.5, 0.75, 1.0, 2.0] → Table 5: Hyperparameters swept over in Connect Four. The hyperparameters were swept over in descending order in the table (lr first and τ last). When a set of hyperparameter values is bounded with arrows (← [. . . ] →), it indicates that this set of hyperparameter values was swept over by each algorithm in the column. The values that are bolded were the values that hyperparameters were set to prior to being swept over. AlphaZero GEVE GEVC GESR GESC 10−3 10−5 1.0 0.25 1.0 10 0.01 105 1.0 10−3 10−5 1.0 0.25 1.0 5 0.1 N/A 1.0 10−3 10−5 1.0 0.25 1.0 2 0.0 106 1.0 10−3 10−5 1.0 0.1 1.0 10 0.1 106 1.0 10−3 10−5 1.0 0.25 1.0 10 N/A N/A 1.0 lr c α ε cpuct k λ |A| τ Table 6: Best hyperparameter values in Connect Four AlphaZero GEVE GESC GEVC GESR ← [10−2, 10−3, 10−4] → ← [10−4, 10−5, 10−6] → ← [0.03, 1.0, 5.0] → ← [0.05, 0.1, 0.25, 0.5] → ← [0.5, 1.0, 2.0, 4.0] → ← [1, 2, 5, 10] → N/A N/A ← [0.01, 0.1, 0.25] → N/A [105, 106, 2×106] ← [105, 106, 2×106, 5×106] → ← [0.5, 0.75, 1.0, 2.0] → lr c α ε cpuct k λ |A| τ Table 7: Hyperparameters swept over in 9x9 Go. The hyperparameters were swept over in descending order in the table (lr first and τ last). When a set of hyperparameter values is bounded with arrows (← [. . . ] →), it indicates that this set of hyperparam- eter values was swept over by each algorithm in the column. The values that are bolded were the values that hyperparameters were set to prior to being swept over. lr c α ε cpuct k λ |A| τ AlphaZero GEVE GEVC 10−3 10−5 0.03 0.1 2.0 1 0.1 106 1.0 GESC 10−3 10−5 0.03 0.1 2.0 1 0.1 2 × 106 1.0 Table 8: Best hyperparameter values in 9x9 Go GESR 10−3 10−5 0.03 0.1 1.0 2 0.1 2 × 106 1.0 10−3 10−5 0.03 0.1 2.0 1 0.1 N/A 1.0 10−3 10−5 0.03 0.1 1.0 2 N/A N/A 1.0 C ADDITIONAL PLOTS (a) MCTS-Solver 1x (b) MCTS-Solver 100x Figure 4: AlphaZero and Go-Exploit's win rates against MCTS-Solver 1x and 100x in Connect Four. The win rates were averaged over the 30 validation runs and the shaded regions represent 95% confidence intervals. . (a) MCTS-Solver 1x (b) MCTS-Solver 100x Figure 5: AlphaZero and Go-Exploit's win rates against MCTS-Solver 1x and 100x in 9x9 Go. The win rates were averaged over the 30 validation runs and the shaded regions represent 95% confidence intervals. .
http://arxiv.org/abs/2302.12357v1
2023-02-23T22:49:56
2023-02-23T22:49:56
Auto-HeG: Automated Graph Neural Network on Heterophilic Graphs
Graph neural architecture search (NAS) has gained popularity in automatically designing powerful graph neural networks (GNNs) with relieving human efforts. However, existing graph NAS methods mainly work under the homophily assumption and overlook another important graph property, i.e., heterophily, which exists widely in various real-world applications. To date, automated heterophilic graph learning with NAS is still a research blank to be filled in. Due to the complexity and variety of heterophilic graphs, the critical challenge of heterophilic graph NAS mainly lies in developing the heterophily-specific search space and strategy. Therefore, in this paper, we propose a novel automated graph neural network on heterophilic graphs, namely Auto-HeG, to automatically build heterophilic GNN models with expressive learning abilities. Specifically, Auto-HeG incorporates heterophily into all stages of automatic heterophilic graph learning, including search space design, supernet training, and architecture selection. Through the diverse message-passing scheme with joint micro-level and macro-level designs, we first build a comprehensive heterophilic GNN search space, enabling Auto-HeG to integrate complex and various heterophily of graphs. With a progressive supernet training strategy, we dynamically shrink the initial search space according to layer-wise variation of heterophily, resulting in a compact and efficient supernet. Taking a heterophily-aware distance criterion as the guidance, we conduct heterophilic architecture selection in the leave-one-out pattern, so that specialized and expressive heterophilic GNN architectures can be derived. Extensive experiments illustrate the superiority of Auto-HeG in developing excellent heterophilic GNNs to human-designed models and graph NAS models.
[ "Xin Zheng", "Miao Zhang", "Chunyang Chen", "Qin Zhang", "Chuan Zhou", "Shirui Pan" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12357v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12357v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.SI" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 7 5 3 2 1 . 2 0 3 2 : v i X r a Auto-HeG: Automated Graph Neural Network on Heterophilic Graphs Xin Zheng¶ [email protected] Monash University Melbourne, Australia Qin Zhang‡ [email protected] Shenzhen University Shenzhen, China Miao Zhang† [email protected] Harbin Institute of Technology (Shenzhen) Shenzhen, China Chuan Zhou§ [email protected] Chinese Academy of Sciences Beijing, China Chunyang Chen¶ [email protected] Monash University Melbourne, Australia Shirui Pan∗ [email protected] Griffith University Gold Coast, Australia ABSTRACT Graph neural architecture search (NAS) has gained popularity in automatically designing powerful graph neural networks (GNNs) with relieving human efforts. However, existing graph NAS meth- ods mainly work under the homophily assumption and overlook another important graph property, i.e., heterophily, which exists widely in various real-world applications. To date, automated het- erophilic graph learning with NAS is still a research blank to be filled in. Due to the complexity and variety of heterophilic graphs, the critical challenge of heterophilic graph NAS mainly lies in devel- oping the heterophily-specific search space and strategy. Therefore, in this paper, we propose a novel automated graph neural net- work on heterophilic graphs, namely Auto-HeG, to automatically build heterophilic GNN models with expressive learning abilities. Specifically, Auto-HeG incorporates heterophily into all stages of automatic heterophilic graph learning, including search space de- sign, supernet training, and architecture selection. Through the diverse message-passing scheme with joint micro-level and macro- level designs, we first build a comprehensive heterophilic GNN search space, enabling Auto-HeG to integrate complex and vari- ous heterophily of graphs. With a progressive supernet training strategy, we dynamically shrink the initial search space according to layer-wise variation of heterophily, resulting in a compact and efficient supernet. Taking a heterophily-aware distance criterion as the guidance, we conduct heterophilic architecture selection in the leave-one-out pattern, so that specialized and expressive het- erophilic GNN architectures can be derived. Extensive experiments illustrate the superiority of Auto-HeG in developing excellent het- erophilic GNNs to human-designed models and graph NAS models. ∗Corresponding author. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. WWW '23, May 1–5, 2023, Austin, TX, USA © 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-1-4503-9416-1/23/04. . . $15.00 https://doi.org/10.1145/3543507.3583498 CCS CONCEPTS • Computing methodologies → Neural networks. KEYWORDS graph neural architecture search, graph neural networks, heterophily, diverse message-passing, progressive supernet training ACM Reference Format: Xin Zheng, Miao Zhang, Chunyang Chen, Qin Zhang, Chuan Zhou, and Shirui Pan. 2023. Auto-HeG: Automated Graph Neural Network on Heterophilic Graphs. In Proceedings of the ACM Web Conference 2023 (WWW '23), May 1–5, 2023, Austin, TX, USA. ACM, New York, NY, USA, 12 pages. https: //doi.org/10.1145/3543507.3583498 1 INTRODUCTION Current mainstream research on graph neural networks (GNNs) principally builds upon the following two foundations: the ho- mophily assumption of graph-structured data and the expertise de- pendency of GNN architecture design [25, 30, 33, 34, 40, 47, 49, 54]. At first, the homophily assumption defines that nodes with simi- lar features or same class labels are linked together. For instance, research articles within the same research area would be linked more likely by citing each other. In contrast, heterophily, the prop- erty that linked nodes have dissimilar features and different class labels, does not attract equal attention but widely exists in various web-related real-world applications [23, 28, 52, 56, 57]. For instance, in online transaction networks, fraudsters are more likely to build connections with customers instead of other fraudsters [28]. At this point, heterophily of graphs plays an important role in web socio- economic system, and modeling the heterophily explicitly would benefit the development of web techniques and infrastructure. Due to the differences of structure and property between homophilic and heterophilic graphs, existing GNNs, which target for modelling homophily, cannot be directly applied to heterophilic graphs, and the main reasons lie in the following two aspects [52]: (1) local vs. non-local neighbors: homophilic GNNs concentrate more on addressing local neighbor nodes within the same class, while on heterophilic graphs, informative same-class neighbors usually are non-local in graph topology; (2) uniform vs. diverse aggregation: homophilic GNNs uniformly aggregate information from similar local neighbors and then accordingly update central (ego) nodes, WWW '23, May 1–5, 2023, Austin, TX, USA Zheng et al. while heterophilic graphs expect discriminative node representa- tion learning to diversely extract information from similar and dissimilar neighbors. Very recently, a few researchers divert their attention to develop heterophilic GNNs, typically by introducing higher-order neigh- bors [57] or modelling homophily and heterophily separately in the message passing scheme [2]. Nevertheless, current heterophilic GNNs highly rely on the knowledge of experts to manually de- sign models for graphs with different degrees of heterophily. For one thing, this process would cost many human efforts and the performance of derived GNNs would be limited by expertise. For another thing, real-world heterophilic graphs generally show the significant complexity and variety in terms of graph structure. It would be harder to artificially customize GNNs to make them adapt to various heterophilic graphs. In light of this, automated graph neural network learning via neural architecture search (NAS) [4, 6, 16, 21, 22, 36, 41, 53], a line of research for saving human efforts in designing effective GNNs, would be a feasible way of tackling the dilemma of het- erophilic GNN development. Through learning in well-designed search spaces with efficient search strategies, automated GNNs via NAS have achieved promising progress on various graph data analysis tasks [9, 12, 17, 27, 38, 50]. However, existing graph NAS studies, e.g., GraphNAS [12] and SANE [17], are all constrained under the homophily assumption. To the best of our knowledge, there is still a research blank in developing heterophilic graph NAS for automated heterophilic graph learning. The most straightfor- ward way to implement heterophilic graph NAS might be replacing the homophilic operations in existing homophilic search spaces with heterophilic GNN operations, followed by universal gradient- based search strategies. But this direct solution would incur some issues: First, it is difficult to determine what heterophilic opera- tions are beneficial and whether certain homophilic operations should be kept for facilitating heterophilic graph learning, since the heterophilic graphs might be various and complex with different degrees of heterophily. Second, simply making existing universal search strategies adapt to new-defined heterophilic search spaces would limit the searching performance, resulting in suboptimal het- erophilic GNN architectures. The heterophily should be integrated into the searching process for architecture optimization as well. To tackle all the above-mentioned challenges of heterophilic graph NAS, in this paper, we propose a novel automated graph neural network on heterophilic graphs, namely Auto-HeG, to ef- fectively learn heterophilic node representations via heterophily- aware graph neural architecture search. To the best of our knowl- edge, this is the first automated heterophilic graph learning method, and our theme is to explicitly incorporate heterophily into all stages of automatic heterophily graph learning, containing search space design, supernet training, and architecture selection. For search space design: By integrating joint micro-level and macro-level designs, Auto-HeG first builds a comprehensive heterophilic search space through the diverse message-passing scheme, enabling it to incorporate the complexity and diversity of heterophily better. At the micro-level, Auto-HeG conducts non-local neighbor exten- sion, ego-neighbor separation, and diverse message passing; At the macro-level, it introduces adaptive layer-wise combination opera- tions. For supernet training: To narrow the scope of candidate operations in the proposed heterophilic search space, Auto-HeG presents a progressive supernet training strategy to dynamically shrink the initial search space according to layer-wise variation of heterophily, resulting in a compact and efficient supernet. For architecture selection: Taking heterophily as the specific guid- ance, Auto-HeG derives a novel heterophily-aware distance as the criterion to select effective operations in the leave-one-out pat- tern, leading to specialized and expressive heterophilic GNN ar- chitectures. Extensive experiments on the node classification task illustrate the superior performance of the proposed Auto-HeG to human-designed models and graph NAS models. In summary, our contributions are listed as follows: • We propose a novel automated graph neural network on het- erophilic graphs by means of heterophily-aware graph neu- ral architecture search, namely Auto-HeG, to the best of our knowledge, for the first time. • To integrate the complex and various heterophily explicitly, we build a comprehensive heterophilic GNN search space that incorporates non-local neighbor extension, ego-neighbor sepa- ration, diverse message passing, and layer-wise combination at the micro-level and the macro-level. • To learn a compact and effective heterophilic supernet, we in- troduce a progressive supernet training strategy to dynamically shrink the initial search space, enabling the narrowed searching scope with layer-wise heterophily variation. • To select optimal GNN architectures specifically instructed by heterophily, we derive a heterophily-aware distance criterion to develop powerful heterophilic GNNs in the leave-one-out manner and extensive experiments verify the superiority of Auto-HeG. 2 RELATED WORK Graph Neural Networks with Heterophily. Existing heterophilic GNNs mainly work on two aspects [52]: non-local neighbor exten- sion [1, 15, 18, 29, 37, 57] and GNN architecture refinement [2, 5, 7, 24, 32, 45, 46]. In detail, non-local neighbor extension methods focus on exploring the informative neighbor set beyond local topology. In contrast, GNN architecture refinement methods design heterophily- specific message-passing models to learn discriminative node rep- resentations. Typically, Mixhop [1] and H2GCN [57] introduced higher-order neighbor mixing of local one-hop neighbors and non- local K-hop neighbors to learn discriminative central node repre- sentations. And Geom-GCN [29] defined the split 2D Euclidean geometry locations as the geometric relationships with different degrees of heterophily, enabling it to discover potential neighbors for further effective aggregation. In contrast, FAGCN [2] developed diverse aggregation functions by introducing low-pass and high- pass filters, corresponding to learning homophily and heterophily, respectively. Besides, GCNII [5] and GPR-GNN [7] considered the layer-wise representation integration to boost the performance of GNNs with heterophily. Despite the promising development, these heterophilic GNNs highly rely on the expertise to manually design GNNs for tackling the complex and diverse heterophily. For one thing, it would cost exhausted human efforts. For another thing, the design scopes and flexibility would be constrained by expert Auto-HeG: Automated Graph Neural Network on Heterophilic Graphs WWW '23, May 1–5, 2023, Austin, TX, USA knowledge, leading to limited model performance. In light of this, we are the first to propose an automated graph neural architecture search framework for heterophilic graphs, to significantly save hu- man efforts and automatically derive powerful heterophilic GNN architectures with excellent learning abilities. Graph Neural Architecture Search. Graph NAS has greatly en- larged the design picture of automated GNN development for dis- covering excellent and powerful models [9, 12, 17, 27, 38, 50, 51, 55]. Generally, the development of graph NAS methods focuses on two crucial research aspects: search space and search strategy. The for- mer defines architecture and functional operation candidates in a set space, and the latter explores the powerful model components in the defined search space. Typically, GraphNAS [12] and AGNN [55] constructed the micro-level search space containing classical GNN components and related hyper-parameters, followed by architec- ture controllers based reinforcement learning (RL) search strategy. And SNAG [51] further simplified GraphNAS at the micro-level and introduced the macro-level inter-layer architecture connections. Based on this search space, SANE [17] implemented DARTS [22], a gradient-based search strategy, to automatically derive effective GNN architectures on graphs in a differential way. Nevertheless, current graph NAS methods are still constrained under the ho- mophily assumption and cannot learn explicitly and effectively on graphs with complex and diverse heterophily. Therefore, we draw inspiration from the lines of NAS research on search space shrink- ing [4, 6, 16, 21, 41], supernet optimization [10, 42], and architecture selection [36], and importantly extend them to the development of automated heterophilic GNNs. Our critical goal is to build a well-designed search space with a customized search strategy via graph NAS, to explicitly integrate the heterophily into full stages of automated heterophilic GNN development. 3 AUTO-HEG: AUTOMATED GRAPH NEURAL NETWORK ON HETEROPHILIC GRAPHS 3.1 Preliminary. Uniform Message Passing. Let G = (V, E) be an undirected, un- weighted graph where V = {v1, * * * , v |V | } is the node set and E ∈ V × V is the edge set. The neighbor set of node v is N (v) = {u : (v, u) ∈ E}, and initial node features are represented by X ∈ R|V |×d0 with d0-dimension features. For the uniform message passing scheme under the homophily assumption, node representa- tions of GNNs are learned by first aggregating the messages from local neighbors, and then updating the ego-node representations by combining the aggregated messages with themselves [43]. This process can be denoted as: (l−1) (l) v = AGG(l) ({h u (l) v = UPDATE(l) (h m h : u ∈ N (v)}), (l) v ), , m (l−1) v (1) (l) v (l) v and h where m are the message vector and the representa- tion vector of node v at the l-th layer, respectively. AGG(*) and UPDATE(*) are the aggregation function and update function, re- spectively. Given the input of the first layer, the learned node rep- resentations with d1 dimensions at each layer of L-layer GNN can be denoted as H(l) ∈ R|V |×d1 for l = {1, 2, * * * , L}. Measure of Heterophily & Homophily. In general, heterophily and homophily of a graph G = (V, E) can be measured by node ho- mophily [29]. Concretely, the node homophily γnode is the average proportion of the neighbors with the same class of each node as: γnode = 1/|V | (cid:205)v ∈V (|{u ∈ N (v) : yv = yu }|/|N (v)|). The range of γnode is [0, 1]. Graphs with strong homophily have higher γnode (closer to 1); Whereas graphs with strong heterophily have smaller γnode (closer to 0). 3.2 Heterophilic Search Space Design To incorporate the complexity and variety of heterophily on graphs, we design a comprehensive heterophilic search space in the pro- posed Auto-HeG, involving joint micro-level and macro-level candi- date operations. At the micro-level, the proposed search space con- tains three important components: non-local neighbor extension, ego-neighbor separation, and diverse message passing; While the macro-level consists of intermediate layer combination functions and skip connections for integrating layer-wise node representa- tions. The well-designed search space is the basis for building a supernet for search effective architectures on heterophilic graphs as shown in Fig. 1, and we will discuss this further in Sec. 3.3. In the following, we mainly give detailed descriptions of the candidate operations in the proposed heterophilic search space, where its summary is listed in Table 1. 3.2.1 Micro-level Design. Non-local Neighbor Extension. Homophilic graphs generally take local nodes from one hop away as neighbors of the ego node for message aggregation, since the same-class nodes mainly locate in their proximal topology. On the contrary, on heterophilic graphs, nodes within the same class could be far away from each other. That means only considering the one-hop-away neighbors would be in- sufficient to capture the heterophily on graphs explicitly. Hence, to break the local topology limitation under the homophily as- sumption, we extend local one-hop neighbors to non-local K-hop neighbors to incorporate heterophilic neighbor information. Con- cretely, we modify the uniform message passing scheme in Eq. (1) in terms of K-hop neighbors as follows: (l−1) (l) v = AGG(l) ({h u m : u ∈ Nk (v)}), k = {1, 2, * * * , K }, (2) where Nk (v) denotes the k-th hop neighbor set of node v. In this way, the derived heterophilic GNNs could mix latent information from neighbors within the same class at various distances of graph topology. Specifically, to avoid multi-hop neighbors bringing the exponential explosion of graph scale, we restrict the k-hop neighbor set as neighbors that are connected by at least k different paths to the ego nodes. For instance, a two-hop neighbor set contains neighbors that are two hops away from ego nodes and have at least two different paths to reach the ego nodes. Note that, different from existing heterophilic GNNs (e.g., Mixhop [1] and H2GCN [57]) introducing multi-hop neighbors at each layer and combining them in parallel, we relate the number of neighbor hops to the number of GNN layers correspondingly in the proposed Auto-HeG. The intuition behind this is to alleviate the complexity of the search space but keep its effectiveness at the same time. WWW '23, May 1–5, 2023, Austin, TX, USA Zheng et al. k Figure 1: Overall supernet of the proposed Auto-HeG. A denotes the adjacency matrix and A part shows the details of l -th layer with the layer-wise heterophily-specific operation space O (l ) AGG via progressive supernet training. denotes the k-th hop neighbors for k = {1, 2, * * * , K }, and the right Ego-neighbor Separation. Despite capturing the messages from non-local neighbors, some local neighbors still have dissimilar class labels with the ego nodes. Hence, it is necessary to separate the ego node representations from their neighbor representations, as verified by the work [57]. In this way, heterophilic GNNs could learn the ego node features by discriminatively combining the aggregated neighbor information with themselves at the following update step. At this point, we further modify the uniform message passing scheme at the aggregation step in Eq. (2) as (l−1) (l) v = AGG(l) ({h u m : u ∈ ̄Nk (v)}), k = {1, 2, * * * , K }, (3) where ̄Nk (v) denotes the neighbor set that excludes the ego node v, i.e., removing self-loops in the original graph structure. Diverse Message Passing. Given the extended non-local neighbor set, diverse message-passing scheme is the core of tackling the heterophily on graphs. By distinguishing the information of similar neighbors (likely in the same class) from that of dissimilar neigh- bors (likely in different classes), heterophilic GNNs could aggregate discriminative messages from diverse neighbors. Typically, we de- compose the edge-aware weights auv into homophily-component aho uv and heterophily-component ahe uv on different neighbor repre- uv ; ahe sentations hu , respectively. Hence, we can obtain auv = [aho uv]. Moreover, due to the complexity and variety of heterophily, there might be no adequate prior knowledge of the extent of heterophily on graphs. Certain homophilic aggregation functions, e.g., GAT [35], also have the ability to impose discriminative weights on differ- ent neighbors. Hence, we first introduce ample heterophilic and homophilic aggregation functions for the comprehensiveness of the initial search space design. Adaptively learning a more com- pact search space is postponed to the latter supernet training stage. Specifically, we introduce 18 homophilic and heterophilic aggre- gation functions, denoting as the diverse aggregation function set Table 1: Heterophilic search space details of the proposed Auto-HeG. 'homo.' and 'hete.' indicate homophily-related and heterophily-related aggregation functions, respectively. Search Space Modules Micro-level Neighbors OAGG homo. hete. Macro-level OMAC Operations {A, A2, * * * , AK } { SAGE, SAGE_SUM, SAGE_MAX,GCN, GIN, GAT, GAT_SYM, GAT_COS, GAT_LIN, GAT_GEN_LIN, GeniePATH} { GCNII, FAGCN, GPRGNN, SUPERGAT, GCN_CHEB, APPNP, SGC} l_skip, l_zero, l_concat, l_max, l_lstm OAGG shown in Table 1. In this way, the heterophilic message- passing scheme can be denoted as: v = O (l) (l) m AGG ({a (l−1) l−1 uv h u : u ∈ ̄Nk (v)}), k = {1, 2, ..., K }. (4) In summary, the micro-level design of the proposed heterophilic search space mainly works on diverse message passing with ex- tended local and non-local neighbors, along with separated ego and neighbor node representation learning. And such design encour- ages heterophilic GNNs to adaptively incorporate the heterophily of graphs in each phase of message passing. 3.2.2 Macro-level Design. To integrate local and global information from different layers, combining intermediate layer representations and introducing skip connections have been verified as beneficial layer-wise operations in human-designed GNNs [20, 44, 57] and automated GNNs [17, 38, 48]. In light of this, to enable the flexi- ble GNN architecture design on heterophilic graphs, we introduce the inter-layer connections and combinations into the macro-level search space. In this way, the automated heterophilic GNNs could capture hierarchical information at different layers of network ar- chitectures. In detail, our macro-level space contains 5 candidate operations as OMAC = {l_skip, l_zero, l_concat, l_max, l_lstm}. So that the final output of a heterophilic GNN can be denoted as: hout = OMAC [h(1), h(2), * * * , h(L) ]. With the joint micro-level and macro-level candidate operations, the proposed heterophilic search space significantly enlarges the design scopes and the flexibility in developing GNN architectures on graphs with heterophily. (5) 3.3 Progressive Heterophilic Supernet Training Based on the proposed heterophilic search space, we build a one- shot heterophilic supernet as shown in Fig. 1. Given the heterophilic graph with input feature X ∈ R |V |×d0 and adjacency matrix A ∈ R |V |×|V |, the proposed Auto-HeG supernet first implements a lin- ear layer, i.e., Multi-layer Perceptron (MLP), to obtain the initial node embedding H(0) ∈ R |V |×d1 . Then, the node embedding H(0) and the adjacency matrix A would be fed into the first layer contain- ing micro-level candidate operations with the OAGG set, leading to the output node representation H(1) . Next, H(1) is fed into the macro-level OMAC for the layer-wise connection. Meanwhile, H(1) and the two-hop adjacency matrix A2 would be the inputs of the next micro-level layer. The above process implements repeatedly layer by layer before the final node representations experience the classifier to obtain the predictions of node classes. Auto-HeG: Automated Graph Neural Network on Heterophilic Graphs WWW '23, May 1–5, 2023, Austin, TX, USA Algorithm 1 Progressive Heterophilic Supernet Training Require: Initial heterophilic supernet S0, number of shrinking iterations T , number of candidate operations C to be dropped per iteration t. Ensure: Compact heterophilic supernet Sc . 1: Let Sc ← S0; 2: while t < T do 3: 4: 5: Training Sc for several epochs as Eq. (6) and (7); Ranking the magnitudes of the architecture α ; Dropping C operations from Sc with the smallest C archi- tecture weights; 6: end while Even though the proposed search space contains as many candi- date operations as possible, real-world heterophilic graphs usually show significant differences in complexity and diversity, and we still lack prior knowledge on what heterophilic and homophilic aggregations are beneficial for heterophilic graph learning. The proposed initial search space might be comprehensive but severely challenge the effectiveness of supernet training to automatically derive expressive GNN architectures, especially when heterophily varies on different graphs. In light of this, a possible solution comes: why not let the proposed supernet adaptively keep the beneficial operations and drop the irrelevant counterparts as the process of it- erative learning goes on? This would contribute to a more compact supernet with relevant candidate operations specifically driven by current heterophilic graphs and tasks, leading to more effective heterophilic GNN architecture development. Moreover, considering some operations will never be selected by certain layers in the final architectures mentioned by [41], this solution ensures different layers flexibly customize their own layer-wise candidate operation sets according to heterophily variation, rather than sharing the entire fixed and large search space with all layers. Therefore, to derive a more compact heterophilic one-shot su- pernet for efficient architecture design, we present a progressive training strategy to dynamically shrink the initial search space and adaptively design the candidate operation space in each layer. Specifically, let S0 = (E S ) denotes the initial heterophilic 0 supernet constructed based on the proposed entire search space O, and E S 0 are the edge set and the node set, respectively. We first train S0 (α , w) several steps for stochastic differentiable search based on the bi-level optimization: 0 and N S , N S 0 Lval (cid:0)w∗ (α ), α (cid:1) , (6) min α s.t . w∗ (α ) = argminw Ltrain (w, α ), which conducts iterative learning of the architecture weight α and the model parameter w. Let o ∈ O denotes a certain operation in heterophilic search space O, and a node pair (xi, xj ) denotes the latent vectors from i-th node to j-th node of the supernet, the (cid:110) α (i,j) learned architecture weights α = , and o the operation specific weight vector α (i,j) |o ∈ O, (i, j) ∈ N S 0 can be derived as: (cid:111) (cid:104)(cid:16) exp (cid:205)o′ ∈ O exp (cid:17) o + u (i,j) o + u (i,j) o′ /τ log α (i,j) o (cid:104)(cid:16) log α (i,j) o′ (cid:105) (cid:17) /τ (cid:105) * o (x) (7) ̄o (i,j) (x) = ∑︁ o ∈ O Algorithm 2 Heterophily Guided Architecture Selection Require: Pretrained heterophilic supernet Sc from Algo. 1, edge set E S c and node set N S c of Sc . Ensure: A heterophilic GNN model with the set of selected opera- tions {o∗ 1: while |E S 2: e |e ∈ E S c }. c | > 0 do 3: 4: 5: 6: 7: end while randomly remove an edge ei ∈ E S for all operations o ∈ O on edge ei do c from E S c ; calculate Dhete (\o) when o is removed; end for select the best operation for ei : o∗ e ← arg mino Dhete (\o); where ̄o (i,j) is the mixed operation of edges between (i, j), and u (i,j) = − log (− log (U )) where U ∼ Uniform(0, 1). τ is the tem- o perature factor that controls the extent of the continuous relaxation. When τ is closer to 0, the weights would be closer to discrete one- hot values. To further exploit the relevance and importance of candidate operations to heterophily, we rank the obtained α layer by layer based on its magnitudes and drop the last C irrelevant operations, i.e., cutting C number of edges in each layer at the current super- net training stage. By repeating the above process T iterations, we gradually and dynamically shrink the initial search space and compress the supernet, leading to a compact and effective supernet Sc by customizing layer-wise heterophilic candidate operation set. The overall process of the proposed progressive supernet training strategy is summarized in Algo. 1. 3.4 Heterophily-guided Architecture Selection With the magnitudes of the architecture weights as the metric, Auto-HeG progressively learns a compact supernet with layer-wise search spaces driven by the heterophily variation. Considering an extreme case: the supernet shrinks gradually till every edge of it keeps only one operation. Basically, that is the general strategy used by current graph NAS methods, i.e., argmax-based architecture selection scheme. That means only the operations corresponding to the maximum edge weights in the architecture supernet could be preserved by such an architecture selection scheme to build the ultimate GNNs. However, very recent research [36] has verified the architecture magnitude is not effective enough to indicate the operation strength in the final GNN architecture selection. That is why we only use this strategy as the beginning to generally narrow the scope of candidate operations in the proposed search space. Therefore, to select powerful GNN architectures specifically in- structed by heterophily, we derive a heterophily-aware distance as the criterion to guide heterophilic GNN architecture selection. And inspired by the perturbation-based architecture selection scheme in [36], we implement a leave-one-out manner to directly eval- uate the contribution of each candidate operation to the com- pact supernet performance. Specifically, the proposed heterophily- aware distance Dhete can be defined with the Euclidean distance as Dhete = || ˆH − H ||2, where H and ˆH are the heterophilic matrices WWW '23, May 1–5, 2023, Austin, TX, USA Zheng et al. denoted as: H = (cid:16) YT AY (cid:17) ⊘ (cid:16) YT AE (cid:17) , ˆH = (cid:16) ˆYT A ˆY (cid:17) ⊘ (cid:16) ˆYT AE (cid:17) , (8) where Y ∈ R|V |×p is the ground-truth label matrix of the het- erophilic graph with p classes of nodes, E ∈ R |V |×p is an all-ones matrix, and ⊘ denotes the Hadamard division operation. Concretely, Hi,j indicates the connection probability of nodes [15, 56] between the i-th class and the j-th class with the ground truth labels, and ˆHi,j works in the same way but with the predicted labels ˆY ∈ R|V |×p , i.e., the output of the compact heterophilic supernet. The proposed heterophily-aware distance Dhete explicitly re- stricts the connection possibility of nodes in any two classes pre- dicted by the supernet, to be close to that of the ground truth. And smaller Dhete indicates the better discriminative ability of a certain candidate operation to heterophilic node classes. Taking Dhete as the guidance, we select the optimal heterophilic GNN architecture from the pretrained compact supernet Sc , and the whole process is illustrated in Algo. 2. In summary, Auto-HeG first builds a comprehensive heterophilic search space, and then progres- sively shrinks the initial search space layer by layer, leading to a more compact supernet with Algo. 1. Finally, Auto-HeG selects the ultimate heterophilic GNN architecture with the guidance of the heterophily-aware distance in Algo. 2. Consequently, Auto-HeG could automatically derive powerful and expressive GNN models for learning discriminative node representations on heterophilic graphs effectively. 4 EXPERIMENTS In this section, we first provide the experimental setting details. Then, we compare the proposed Auto-HeG with state-of-the-art human-designed and graph NAS models on the node classification task. Finally, we conduct ablation studies to evaluate the effective- ness of each component in Auto-HeG, including heterophilic search space, progressive heterophilic supernet training, and heterophily- guided architecture selection. 4.1 Experimental Setting Datasets and Baselines. We conduct experiments on seven real- world datasets with different degrees of heterophily (γnode ) de- noted in brackets, where Cornell (0.11), Texas (0.06), and Wis- consin (0.16) are three WebKB web-page dataset [13], and Actor (0.24) is an actor co-occurrence network [33]. These four datasets are with high heterophily from [29]. Furthermore, Cora (0.83) [3], Citeseer (0.71) [31], and Pubmed (0.79) [26] are three citation network datasets with low heterophily. For comparisons on node classification, we take H2GCN-1 and H2GCN-2 [57], MixHop [1], GPR-GNN [7], GCNII [5], Geom-GCN-I, Geom-GCN-P, and Geom- GCN-S [29], FAGCN [2], as well as classical GCN [19], GAT [35], GraphSAGE [14], and SGC [39] as human-designed model baselines for high-heterophily and low-heterophily datasets, respectively. Fur- thermore, we take GraphNAS [12], SNAG [51], and SANE [17] as graph NAS model baselines. To test the performance of simply mod- ifying existing graph NAS search spaces, we develop 'SANE-hete' as another baseline by directly injecting heterophilic aggregation functions into the search space of SANE [17]. Implementation. All experiments run with Pytorch platform on Quadro RTX 6000 GPUs and the core code is built based on PyG library [11]. Following the setting in [17], at the search stage, we search with different random seeds and select the best architecture according to the performance on validation data. At the train from scratch stage, we finetune hyper-parameters on validation data within fixed ranges. For all datasets, we use the same splits as that in Geom-GCN [29] and evaluate the performance of all models on the test sets over provided 10 splits for fair comparisons. We report the mean classification accuracy with standard deviations as the performance metric of node classification. 4.2 Experimental Results on Node Classification The node classification results of the proposed Auto-HeG and com- parison methods on high-heterophily and low-heterophily datasets are shown in Table 2 and Table 3, respectively. And the details of derived architectures on all datasets are provided in Appendix. As shown in Table 2, it can be generally observed that the pro- posed Auto-HeG achieves the best performance when learning on high-heterophily graphs compared with human-designed and graph NAS models. Specifically, Auto-HeG excesses the second- best model, i.e., human-designed H2GCN, with 1.35%, 1.90%, 1.80%, and 1.57% performance improvement on Cornell, Texas, Wisconsin, and Actor datasets, respectively. Compared with graph NAS mod- els, first, Auto-HeG greatly outperforms all existing homophilic graph NAS models over all datasets. We attribute this to the elabo- rate incorporation of heterophily in our Auto-HeG, especially for graphs with high heterophily. Moreover, the superiority of Auto- HeG to SANE-hete verifies that simply injecting the heterophilic aggregation functions into the existing homophilic search space is not an effective solution. This further illustrates the effective- ness of the proposed progressive heterophilic supernet training and heterophily-guided architecture selection in our Auto-HeG. And in- corporating the heterophily into all stages of automatic heterophilic GNN design indeed benefits learning on graphs with heterophily. For comparisons on low-heterophily datasets in Table 3, our Auto-HeG outperforms most human-designed classical GNN mod- els and graph NAS models, further illustrating its ability to analyze graphs even with low heterophily. We attribute these results to two sub-modules in our Auto-HeG: the proposed search space which keeps many homophilic aggregation functions, and the derived pro- gressive supernet training strategy which customizes layer-wise aggregation functions. These components enable the flexible con- struction of GNN architectures, leading to superior performance even with low-heterophily. Therefore, we could conclude that even lacking the prior information on heterophily degrees, the proposed Auto-HeG could progressively and adaptively select appropriate candidate operations along with the variation of heterophily, lead- ing to consistently impressive performance on graphs with high- heterophily and low-heterophily. This reflects the excellent ability of our Auto-HeG to deal with complex and various heterophily. Auto-HeG: Automated Graph Neural Network on Heterophilic Graphs WWW '23, May 1–5, 2023, Austin, TX, USA Table 2: Performance (ACC%±std) of the proposed Auto-HeG compared with human-designed and graph NAS models on high- heterophily datasets. The best results are in bold and the second-best results are underline. Superscript ∗ represents the officially reported results with the same dataset splits, where Geom-GCN and GCNII do not provide the std; And the remains are our reproduced results if official methods do not test under the same dataset splits. Methods Human-designed models Graph NAS models Datasets H2GCN-1∗ H2GCN-2∗ MixHop∗ GPR-GNN GCNII∗ Geom-GCN-I∗ Geom-GCN-P∗ Geom-GCN-S∗ FAGCN GraphNAS SNAG SANE SANE-hete Auto-HeG (ours) Cornell 82.16±4.80 82.16±6.00 73.51±6.34 81.89±5.93 76.49 56.76 60.81 55.68 81.35±5.05 58.11±3.87 57.03±3.48 56.76±6.51 77.84±5.51 83.51±6.56 Texas 84.86±6.77 82.16±5.28 77.84±7.73 83.24±4.95 77.84 57.58 67.57 59.73 84.32±6.02 54.86±6.98 62.70±5.52 66.22±10.62 77.84±7.81 86.76±4.60 Wisconsin 86.67±4.69 85.88±4.22 75.88±4.90 84.12±3.45 81.57 58.24 64.12 56.67 83.33±2.01 56.67±2.99 62.16±4.63 86.67±5.02 83.92±4.28 87.84±3.59 Actor 35.86±1.03 35.62±1.30 32.22±2.34 35.27±1.04 - 29.09 31.63 30.30 35.74±0.62 25.47±1.32 27.84±1.29 33.41±1.41 35.88±1.30 37.43±1.37 Table 3: Performance (ACC%±std) of the proposed Auto-HeG compared with human-designed and graph NAS models on low- heterophily datasets. Methods Human-designed models Graph NAS models Datasets GCN GAT GraphSAGE SGC GCNII∗ Geom-GCN-I∗ Geom-GCN-P∗ Geom-GCN-S∗ GraphNAS SNAG SANE SANE-hete Auto-HeG (ours) Cora 85.69±1.80 86.52±1.41 80.60±3.63 85.88±3.61 88.01 85.19 84.93 85.27 84.10±0.79 81.01±1.31 84.25±1.82 85.05±0.90 86.88±1.10 Citeseer 75.38±1.75 75.51±1.85 67.18±5.46 73.86±1.73 77.13 77.99 75.14 74.71 68.83±2.09 70.14±2.40 74.33±1.54 74.46±1.59 75.81±1.52 Pubmed 86.08±0.64 84.75±0.51 81.18±1.12 84.87±2.81 90.30 90.05 88.09 84.75 82.28±0.64 83.24±0.84 87.82±0.57 88.99±0.42 89.29±0.27 4.3 Ablation Study 4.3.1 Effectiveness of heterophilic search space. We derive three variants of the proposed heterophilic search space to verify its effec- tiveness. Denoting the overall heterophilic search space as Ov0 , we consider the following subsets: (1) (cid:101)Ohomo : only keep homophilic aggregation functions and remove all heterophilic ones from Ov0 , to verify the importance of integrating heterophilic operations; (2) (cid:101)Ohete : only keep heterophilic aggregation functions and remove all homophilic ones from Ov0 , to observe the performance when the search space only contains heterophilic operations; (3) (cid:101)Ohe&ho : randomly remove several heterophilic and homophilic aggrega- tion functions Ov0 , to illustrate the effectiveness of simultaneously involving heterophilic and homophilic operations. Specifically, we randomly sample 20 architectures from each subset and report the max performance and average performance among them in Fig. 2, respectively. Following observations can be obtained: (1) No best results are achieved in (cid:101)Ohomo on all datasets in both max and average cases, which naturally verifies the impor- tance of heterophilic operations to heterophilic graph learning; (2) (cid:101)Ohete and (cid:101)Ohe&ho generally have better performance compared to other search space sets, which illustrates the necessity of involv- ing appropriate homophilic operations. Moreover, this shows that merely involving heterophilic operations is not enough for complex and diverse heterophily learning; (3) The overall search space Ov0 performs the best only on Texas and Actor datasets in the max case. This presents that Ov0 could not achieve consistently best performance under the random sampling scenario, even with the largest number of candidate operations. Moreover, this result also verifies that developing a more compact heterophilic search space is necessary and crucial. At this point, it could be concluded that the proposed progressive supernet training strategy is effective, and we could attribute this to its adaptive and dynamic layer-wise search space shrinking schema. 4.3.2 Effectiveness of progressive supernet training. The compari- son results with and without the layer-wise search space shrinking in the proposed progressive supernet training strategy are listed in Fig. 3. It can be generally observed that, on both high-heterophily and low-heterophily datasets, the performance of the compact su- pernet consistently achieves better performance with the proposed supernet training strategy. For example, the compact supernet with WWW '23, May 1–5, 2023, Austin, TX, USA Zheng et al. Figure 2: Illustration of the effectiveness of the proposed search space by evaluating search space variants. Figure 3: Performance w/ and w/o shrinking (srk) for the proposed progressive supernet training. Table 4: Comparison of the proposed heterophily-guided architecture selection scheme (Heter. Arch. Select.) with other archi- tecture selection methods. Arch. Select. Methods Argmax Arch. Select. Val. Loss Arch. Select. Heter. Arch. Select. (ours) High-heterophily Datasets Low-heterophily Datasets Cornell 79.19±8.38 57.84±3.67 83.51±6.56 Texas 79.46±3.67 71.35±5.30 86.76±4.60 Wisconsin 86.27±4.02 80.59±7.09 87.84±3.59 Actor 37.12±1.12 36.96±1.08 37.43±1.37 Cora 85.33±1.46 84.67±1.64 86.88±1.10 Citeseer 75.43±2.24 73.86±1.11 75.81±1.52 Pubmed 88.52±0.41 88.23±0.53 89.29±0.27 progressive training significantly raises the performance of Cor- nell from 75.68% to 83.51% and Texas from 72.97% to 86.76%. We attribute such impressive improvements to the excellent ability of our Auto-HeG in building the effective and adaptive supernet. Without the progressive training, the initial search space would keep a large number of operations that might be irrelevant and redundant to specific graphs with heterophily, which brings serious challenges to the search strategy for optimizing in such a large supernet. At this point, Auto-HeG progressively shrinks the search space layer-wisely and dynamically narrows the scope of relevant candidate operations, resulting in a more compact and effective supernet for deriving powerful heterophilic GNNs. 4.3.3 Effectiveness of heterophily-guided architecture selection. We compare the proposed heterophily-guided architecture selection with the other two types of architecture selection methods, i.e., architecture weight magnitude based argmax strategy, which is the most commonly used method in existing gradient-based graph NAS [17, 38], and perturbation-based architecture selection method with the validation loss criterion proposed by [36]. The comparison results are listed in Table 4. Generally, our proposed heterophily- guided scheme with the heterophily-aware distance criterion gains the best classification performance on all datasets consistently, il- lustrating its effectiveness in expressive architecture selection. Fur- thermore, we can observe that the architecture weight magnitude based argmax strategy, i.e., 'Argmax Arch. Select.', performs better than that of perturbation-based architecture selection method with the validation loss criterion, i.e., 'Val. Loss Arch. Select.'. Even the work [36] has verified the effectiveness of 'Val. Loss Arch. Select.' over CNN-based NAS in the leave-one-out manner, more impor- tantly, we find that it might not well adapt to GNN-based NAS by implementing the validation loss based criterion straightfor- wardly. This fact further illustrates the effectiveness of the proposed heterophily-aware distance criterion in the leave-one-out-manner for GNN-based NAS with heterophily. 5 CONCLUSION In this paper, we propose a novel automated graph neural network on heterophilic graphs via heterophily-aware graph neural architec- ture search, namely Auto-HeG, which is the first work of automatic heterophilic graph learning. By explicitly incorporating heterophily into all stages, i.e., search space design, supernet training, and archi- tecture selection, Auto-HeG could develop powerful heterophilic GNNs to deal with the complexity and variety of heterophily effec- tively. To build a comprehensive heterophilic GNN search space, Auto-HeG includes non-local neighbor extension, ego-neighbor separation, diverse message passing, and layer-wise combination at both micro-level and macro-level. To develop a compact and effective heterophilic supernet based on the initial search space, Auto-HeG conducts the progressive supernet training strategy to dynamically shrink the scope of candidate operations according to layer-wise heterophily variation. In the end, taking the heterophily- aware distance criterion as the guidance, Auto-HeG selects excellent heterophilic GNN architectures by directly evaluating the contri- bution of each operation in the leave-one-out pattern. Extensive experiments verify the superiority of the proposed Auto-HeG on learning graphs with heterophily to both human-designed models and graph NAS models. Auto-HeG: Automated Graph Neural Network on Heterophilic Graphs WWW '23, May 1–5, 2023, Austin, TX, USA ACKNOWLEDGMENT This work was partially supported by an Australian Research Coun- cil (ARC) Future Fellowship (FT210100097), Guangdong Provincial Natural Science Foundation under grant NO. 2022A1515010129, and the CAS Project for Young Scientists in Basic Research (YSBR-008). REFERENCES [1] Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Nazanin Alipourfard, Kristina Lerman, Hrayr Harutyunyan, Greg Ver Steeg, and Aram Galstyan. 2019. Mixhop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. In International Conference on Machine Learning. PMLR, 21–29. [2] Deyu Bo, Xiao Wang, Chuan Shi, and Huawei Shen. 2021. Beyond Low-frequency Information in Graph Convolutional Networks. In Proceedings of the AAAI Con- ference on Artificial Intelligence. 3950–3957. [3] Aleksandar Bojchevski and Stephan Günnemann. 2017. Deep gaussian embed- ding of graphs: Unsupervised inductive learning via ranking. arXiv preprint arXiv:1707.03815 (2017). [4] Minghao Chen, Jianlong Fu, and Haibin Ling. 2021. One-shot neural ensemble architecture search by diversity-guided search space shrinking. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 16530– 16539. [5] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. 2020. Simple and deep graph convolutional networks. In International Conference on Machine Learning. PMLR, 1725–1735. [6] Xin Chen, Lingxi Xie, Jun Wu, and Qi Tian. 2019. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. In Proceedings of the IEEE/CVF International Conference on Computer Vision. 1294– 1303. [7] Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. 2020. Adaptive Universal Generalized PageRank Graph Neural Network. In International Conference on Learning Representations. [8] Mark Craven, Andrew McCallum, Dan PiPasquo, Tom Mitchell, and Dayne Fre- itag. 1998. Learning to extract symbolic knowledge from the World Wide Web. Technical Report. Carnegie-mellon univ pittsburgh pa school of computer Sci- ence. [9] Yuhui Ding, Quanming Yao, Huan Zhao, and Tong Zhang. 2021. Diffmg: Dif- ferentiable meta graph search for heterogeneous graph neural networks. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining. 279–288. [10] Xuanyi Dong and Yi Yang. 2019. Searching for a robust neural architecture in four gpu hours. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 1761–1770. [11] Matthias Fey and Jan E. Lenssen. 2019. Fast Graph Representation Learning with PyTorch Geometric. In International Conference on Learning Representations Workshop on Representation Learning on Graphs and Manifolds. [12] Yang Gao, Hong Yang, Peng Zhang, Chuan Zhou, and Yue Hu. 2020. Graph Neural Architecture Search.. In International Joint Conferences on Artificial Intelligence, Vol. 20. 1403–1409. [13] Alberto P García-Plaza, Víctor Fresno, Raquel Martínez Unanue, and Arkaitz Zubiaga. 2016. Using fuzzy logic to leverage HTML markup for web page repre- sentation. IEEE Transactions on Fuzzy Systems 25, 4 (2016), 919–933. [14] William L Hamilton, Rex Ying, and Jure Leskovec. 2017. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems. 1025–1035. [15] Dongxiao He, Chundong Liang, Huixin Liu, Mingxiang Wen, Pengfei Jiao, and Zhiyong Feng. 2022. Block Modeling-Guided Graph Convolutional Neural Net- works. In Proceedings of the AAAI Conference on Artificial Intelligence. [16] Yiming Hu, Yuding Liang, Zichao Guo, Ruosi Wan, Xiangyu Zhang, Yichen Wei, Qingyi Gu, and Jian Sun. 2020. Angle-based search space shrinking for neural architecture search. In European Conference on Computer Vision. Springer, 119–134. [17] ZHAO Huan, YAO Quanming, and TU Weiwei. 2021. Search to aggregate neigh- borhood for graph neural network. In International Conference on Data Engineer- ing. IEEE, 552–563. [18] Di Jin, Zhizhi Yu, Cuiying Huo, Rui Wang, Xiao Wang, Dongxiao He, and Ji- awei Han. 2021. Universal Graph Convolutional Networks. Advances in Neural Information Processing Systems 34 (2021). [19] Thomas N Kipf and Max Welling. 2017. Semi-Supervised Classification with Graph Convolutional Networks. In International Conference on Learning Repre- sentations. [20] Guohao Li, Matthias Muller, Ali Thabet, and Bernard Ghanem. 2019. Deep- gcns: Can gcns go as deep as cnns?. In Proceedings of the IEEE/CVF international conference on computer vision. 9267–9276. [21] Xiang Li, Chen Lin, Chuming Li, Ming Sun, Wei Wu, Junjie Yan, and Wanli Ouyang. 2020. Improving one-shot nas by suppressing the posterior fading. In Proceedings of the IEEE/CVF Conference on computer vision and pattern recognition. 13836–13845. [22] Hanxiao Liu, Karen Simonyan, and Yiming Yang. 2018. DARTS: Differentiable Architecture Search. In International Conference on Learning Representations. [23] Yixin Liu, Yizhen Zheng, Daokun Zhang, Vincent Lee, and Shirui Pan. 2023. Beyond Smoothing: Unsupervised Graph Representation Learning with Edge Heterophily Discriminating. In Proceedings of the Association for the Advanced of Artificial Intelligence. [24] Sitao Luan, Chenqing Hua, Qincheng Lu, Jiaqi Zhu, Mingde Zhao, Shuyuan Zhang, Xiao-Wen Chang, and Doina Precup. 2021. Is Heterophily A Real Night- mare For Graph Neural Networks To Do Node Classification? arXiv preprint arXiv:2109.05641 (2021). [25] Jianxin Ma, Chang Zhou, Peng Cui, Hongxia Yang, and Wenwu Zhu. 2019. Learn- ing disentangled representations for recommendation. In Advances in Neural Information Processing Systems. 5711–5722. [26] Galileo Namata, Ben London, Lise Getoor, Bert Huang, and U Edu. 2012. Query- driven active surveying for collective classification. In 10th International Workshop on Mining and Learning with Graphs, Vol. 8. 1. [27] Zheyi Pan, Songyu Ke, Xiaodu Yang, Yuxuan Liang, Yong Yu, Junbo Zhang, and Yu Zheng. 2021. AutoSTG: Neural Architecture Search for Predictions of Spatio-Temporal Graph. In Proceedings of the Web Conference 2021. 1846–1855. [28] Shashank Pandit, Duen Horng Chau, Samuel Wang, and Christos Faloutsos. 2007. Netprobe: a fast and scalable system for fraud detection in online auction networks. In Proceedings of the 16th International Conference on World Wide Web. 201–210. [29] Hongbin Pei, Bingzhe Wei, Kevin Chen-Chuan Chang, Yu Lei, and Bo Yang. 2020. Geom-GCN: Geometric Graph Convolutional Networks. In International Conference on Learning Representations. [30] Hao Peng, Ruitong Zhang, Shaoning Li, Yuwei Cao, Shirui Pan, and Philip Yu. 2022. Reinforced, Incremental and Cross-lingual Event Detection From Social Messages. IEEE Transactions on Pattern Analysis and Machine Intelligence (2022). [31] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. 2008. Collective classification in network data. AI magazine 29, 3 (2008), 93–93. [32] Susheel Suresh, Vinith Budde, Jennifer Neville, Pan Li, and Jianzhu Ma. 2021. Breaking the Limit of Graph Neural Networks by Improving the Assortativity of Graphs with Local Mixing Patterns. In Proceedings of the ACM SIGKDD Conference on Knowledge Discovery & Data Mining. 1541–1551. [33] Jie Tang, Jimeng Sun, Chi Wang, and Zi Yang. 2009. Social influence analysis in large-scale networks. In Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 807–816. [34] Shikhar Vashishth, Soumya Sanyal, Vikram Nitin, and Partha Talukdar. 2019. Composition-based Multi-Relational Graph Convolutional Networks. In Interna- tional Conference on Learning Representations. [35] Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. 2018. Graph Attention Networks. In International Con- ference on Learning Representations. [36] Ruochen Wang, Minhao Cheng, Xiangning Chen, Xiaocheng Tang, and Cho- Jui Hsieh. 2021. Rethinking Architecture Selection in Differentiable NAS. In International Conference on Learning Representation. [37] Tao Wang, Rui Wang, Di Jin, Dongxiao He, and Yuxiao Huang. 2022. Power- ful Graph Convolutioal Networks with Adaptive Propagation Mechanism for Homophily and Heterophily. In Proceedings of the AAAI Conference on Artificial Intelligence. [38] Zhili Wang, Shimin Di, and Lei Chen. 2021. AutoGEL: An Automated Graph Neural Network with Explicit Link Information. Advances in Neural Information Processing Systems 34 (2021). [39] Felix Wu, Amauri Souza, Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Weinberger. 2019. Simplifying graph convolutional networks. In International Conference on Machine Learning. PMLR, 6861–6871. [40] Zonghan Wu, Shirui Pan, Guodong Long, Jing Jiang, Xiaojun Chang, and Chengqi Zhang. 2020. Connecting the dots: Multivariate time series forecasting with graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 753–763. [41] Xin Xia, Xuefeng Xiao, Xing Wang, and Min Zheng. 2022. Progressive Automatic Design of Search Space for One-Shot Neural Architecture Search. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. 2455–2464. [42] Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. 2019. SNAS: stochastic neural architecture search. In International Conference on Learning Representa- tions. [43] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. 2019. How Powerful are Graph Neural Networks?. In International Conference on Learning Representa- tions. [44] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. 2018. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learn- ing. PMLR, 5453–5462. WWW '23, May 1–5, 2023, Austin, TX, USA Zheng et al. [45] Yujun Yan, Milad Hashemi, Kevin Swersky, Yaoqing Yang, and Danai Koutra. 2021. Two Sides of the Same Coin: Heterophily and Oversmoothing in Graph Convolutional Neural Networks. arXiv preprint arXiv:2102.06462 (2021). [46] Liang Yang, Mengzhe Li, Liyang Liu, Chuan Wang, Xiaochun Cao, Yuanfang Guo, et al. 2021. Diverse Message Passing for Attribute with Heterophily. In Advances in Neural Information Processing Systems, Vol. 34. [47] Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. 2018. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD international conference on knowledge discovery & data mining. 974–983. [48] Jiaxuan You, Zhitao Ying, and Jure Leskovec. 2020. Design space for graph neural networks. Advances in Neural Information Processing Systems 33 (2020), 17009–17021. [49] He Zhang, Bang Wu, Xingliang Yuan, Shirui Pan, Hanghang Tong, and Jian Pei. 2022. Trustworthy Graph Neural Networks: Aspects, Methods and Trends. arXiv preprint arXiv:2205.07424 (2022). [50] Yongqi Zhang, Quanming Yao, Wenyuan Dai, and Lei Chen. 2020. AutoSF: Searching scoring functions for knowledge graph embedding. In 2020 IEEE 36th International Conference on Data Engineering. IEEE, 433–444. [51] Huan Zhao, Lanning Wei, and Quanming Yao. 2020. Simplifying Architecture Search for Graph Neural Network. In Proceedings of the CIKM 2020 Workshops co-located with 29th ACM International Conference on Information and Knowledge Management, Stefan Conrad and Ilaria Tiddi (Eds.), Vol. 2699. [52] Xin Zheng, Yixin Liu, Shirui Pan, Miao Zhang, Di Jin, and Philip S Yu. 2022. Graph Neural Networks for Graphs with Heterophily: A Survey. arXiv preprint arXiv:2202.07082 (2022). [53] Xin Zheng, Miao Zhang, Chunyang Chen, Chaojie Li, Chuan Zhou, and Shirui Pan. 2022. Multi-relational Graph Neural Architecture Search with Fine-grained Message Passing. In IEEE International Conference on Data Mining. [54] Yizhen Zheng, Shirui Pan, Vincent Cs Lee, Yu Zheng, and Philip S Yu. 2022. Rethinking and Scaling Up Graph Contrastive Learning: An Extremely Efficient Approach with Group Discrimination. In Advances in Neural Information Process- ing Systems. [55] Kaixiong Zhou, Qingquan Song, Xiao Huang, and Xia Hu. 2019. Auto-gnn: Neural architecture search of graph neural networks. arXiv preprint arXiv:1909.03184 (2019). [56] Jiong Zhu, Ryan A Rossi, Anup B Rao, Tung Mai, Nedim Lipka, Nesreen K Ahmed, and Danai Koutra. 2021. Graph Neural Networks with Heterophily. In Proceedings of the AAAI Conference on Artificial Intelligence. [57] Jiong Zhu, Yujun Yan, Lingxiao Zhao, Mark Heimann, Leman Akoglu, and Danai Koutra. 2020. Beyond Homophily in Graph Neural Networks: Current Limitations and Effective Designs. Advances in Neural Information Processing Systems 33 (2020). Auto-HeG: Automated Graph Neural Network on Heterophilic Graphs WWW '23, May 1–5, 2023, Austin, TX, USA A APPENDIX In this appendix, we provide more analysis and implementation details of the proposed Auto-HeG. Concretely, we first highlight the importance of automated heterophilic graph learning in Web. Then, we present a comprehensive comparison between the proposed Auto-HeG and existing graph NAS methods. Next, we provide more experimental details of dataset statistics, derived architectures, search efficiency, and other complementary details. At last, we point out the limitation and future research directions. A.1 Importance of Automated Heterophilic Graph Learning in Web The World Wide Web related graph learning significantly builds the connection between the massive computer understandable knowl- edge base and graph-structured data [8]. A line of research on Web-related graph neural network has greatly advanced the Web knowledge inference and information retrieve, promoting the de- velopment of Web fundamental infrastructure from the aspects of technologies and applications [7, 15, 29, 57]. However, real-world Web-based graphs are usually diverse and complex. And existing learning methods either develop under the homophily assumption or cost many human efforts with manual model design, incurring se- vere limitations to models' learning ability. Thus, this work mainly focus on a widespread but overlooked property of Web-related graphs, heterophily, whose linked nodes have dissimilar features and different class labels. Heterophily on graphs plays an impor- tant role in various real-world applications in Web [28, 52, 56, 57], such as online social networks and transaction networks, which impressively benefits the evaluating and advance of the Web socio- economic system. We aims to model and learn such heterophily explicitly and automatically via graph neural architecture search, and tackle the critical challenges of the Web by developing the core Web technologies, building the automatic Web graph learning framework, enabling the blossoming of the Web as a fundamental infrastructure for real-world applications. A.2 Technical Comparison We compare the proposed Auto-HeG with other existing graph NAS methods from graph types, search spaces at micro-level and macro-level, and search strategies. As shown in Table A1, it can be observed that our Auto-HeG is the only method targeting heterophilic graphs. Moreover, in terms of search spaces, we consider non-local neighbor extension, ego- neighbor separation, as well as diverse aggregation functions at the micro-level, leading to better incorporation of heterophily. For search strategies, our Auto-HeG introduces the progressive shrink- ing scheme for supernet training and customized heterophily-aware distance metric for architecture selection, such that the supernet learning is guided by specific heterophily. In summary, all these technical differences between the proposed method and existing graph NAS guarantee our Auto-HeG outstanding ability to auto- mated learning on graphs with heterophily. A.3 Auto-HeG Derived Architectures The detailed statistics of datasets with high-heterophily and low- heterophily are listed in Table A2. We randomly split nodes of each class into 10 random splits (48%/32%/20% of nodes per class for train- ing/validation/testing) from [29]. And the derived architectures of all datasets are shown in Fig. A4. As can be observed, different datasets desire different model architecture designs, which is rea- sonable and expected. This further demonstrates the advantage of automated graph learning on heterophilic graphs, i.e., develop- ing customized heterophily-driven GNN architectures for different dataset. A.4 Search Efficiency The search time comparison between the proposed Auto-HeG and other graph NAS models is presented in Table A3. We report the average time of 5 epochs for each model on all high-heterophily datasets. Generally, the proposed Auto-HeG has comparable search time with the state-of-art graph NAS models, illustrating its excel- lent search efficiency. Specifically, Auto-HeG has ∼ 3 times search time than SANE, and such extra time cost mainly comes from the non-local neighbor extension part, since we adopt up to 3-hop neighbors in the proposed framework but SANE only used the 1- hop local neighbors. Note that non-local neighbor extension is the heterophily-specific design with more graph structure information. At this point, this time cost could be acceptable and would not significantly damage the search efficiency. Moreover, the proposed Auto-HeG still has higher search efficiency than GrapNAS model. In addition, although the proposed heterophily-aware architecture selection brings extra time cost, it implements only once and takes only one-round validation time. Hence, this time could be ignored after the all searching progress with many epochs. In summary, the overall comparison verifies the satisfied search efficiency of the proposed Auto-HeG. A.5 More Implementation Details Search Details. For the progressive supernet training, we set a three-round shrinking strategy with 200 epochs per round, and for each shrinking round, we drop the last three candidate operations, i.e., the number of candidate operations C in Algo. 1 (ref. main submis- sion) is 3. After shrinking, we further train the compact supernet for 1000 epochs for further heterophily-guided architecture selection. For the optimization objective of architecture in Eq. (7) (ref. main submission), we set τ as the adaptive value that linearly decays with the number of epochs from maximum 8 to minimum 4. We use the Adam optimizer with elu activation function for architecture learning and model optimization at the search stage. Train-from-scratch Details. Since different searched architectures might have different optimal hyper-parameter spaces, we use the hyperopt tool to seek the proper hyper-parameters of the searched models for 100 iterations. Specifically, the hyper-parameter space contains: the hidden feature size with {16, 32, 64, 128, 256}, the learn- ing rate with uniform sampling from (1e − 3, 1e − 2), the weight decay with uniform sampling from (1e−5, 1e−3), the optimizer with {Adagrad, Adam}, the dropout with {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6}, and the activation with {elu, relu, leakyrelu}. For fair comparison, we use the same space to fine-tune architectures when reproducing other graph NAS models' results in Table. 2 (ref. main submission). WWW '23, May 1–5, 2023, Austin, TX, USA Zheng et al. Table A1: Overall comparison between the proposed Auto-HeG and existing graph NAS methods.('Uni' and 'Div' denote uniform and diverse, respectively.) Methods Graph Types Search Spaces Micro-level Search Strategies Macro-level Shrink. Optim. Arch. Select GraphNAS [12] AGNN [55] SANE [17] SNAG [51] Auto-HeG (ours) homo. homo. homo. homo. hete. Non-local Neigh. ✗ ✗ ✗ ✗ ✓ Ego-neigh. Sep. Agg. ✗ ✗ ✗ ✗ ✓ Uni Uni Uni Uni Div ✗ ✗ ✓ ✓ ✓ ✗ ✗ ✗ ✗ ✓ RL EA+RL Dete. Differ. RL - - Argmax - Stoc. Differ. Hete-metric Figure A4: Derived architectures by the proposed Auto-HeG. Table A2: Statistics of datasets. Dataset # Nodes # Edges # Features # Classes # Hete.γnode High Heterophily Low Heterophily Cornell Texas Wisconsin 183 295 1703 5 0.11 183 309 1703 5 0.06 251 499 1703 5 0.16 Actor 7600 33544 931 5 0.24 Cora 2708 5429 1433 7 0.83 Citeseer Pubmed 3327 4732 3703 6 0.71 19717 44338 500 3 0.79 Table A3: Search time (clock time in seconds) comparison on high-heterophily datasets. Models Cornell Texas Wisconsin Actor GraphNAS [12] SANE [17] Auto-HeG (ours) 27.54 1.09 3.26 55.11 0.79 3.21 50.60 1.15 3.24 50.63 0.98 4.66 Limitation and Future Work. One limitation of this work is con- sistent with the limitation of the current heterophilic graph learning, that is, the proposed Auto-HeG is limited to the node classification task on heterophilic graphs. In future work, an interesting direction would be to extend Auto-HeG to other heterophilic analysis tasks with more fine-grained and more elaborate designs of search spaces and search strategies.
http://arxiv.org/abs/2302.12355v1
2023-02-23T22:39:43
2023-02-23T22:39:43
Fundamental Bounds on Online Strategic Classification
We study the problem of online binary classification where strategic agents can manipulate their observable features in predefined ways, modeled by a manipulation graph, in order to receive a positive classification. We show this setting differs in fundamental ways from non-strategic online classification. For instance, whereas in the non-strategic case, a mistake bound of $\ln|H|$ is achievable via the halving algorithm when the target function belongs to a known class $H$, we show that no deterministic algorithm can achieve a mistake bound $o(\Delta)$ in the strategic setting, where $\Delta$ is the maximum degree of the manipulation graph (even when $|H|=O(\Delta)$). We obtain an algorithm achieving mistake bound $O(\Delta\ln|H|)$. We also extend this to the agnostic setting and obtain an algorithm with a $\Delta$ multiplicative regret, and we show no deterministic algorithm can achieve $o(\Delta)$ multiplicative regret. Next, we study two randomized models based on whether the random choices are made before or after agents respond, and show they exhibit fundamental differences. In the first model, at each round the learner deterministically chooses a probability distribution over classifiers inducing expected values on each vertex (probabilities of being classified as positive), which the strategic agents respond to. We show that any learner in this model has to suffer linear regret. On the other hand, in the second model, while the adversary who selects the next agent must respond to the learner's probability distribution over classifiers, the agent then responds to the actual hypothesis classifier drawn from this distribution. Surprisingly, we show this model is more advantageous to the learner, and we design randomized algorithms that achieve sublinear regret bounds against both oblivious and adaptive adversaries.
[ "Saba Ahmadi", "Avrim Blum", "Kunhe Yang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12355v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12355v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.GT" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 5 5 3 2 1 . 2 0 3 2 : v i X r a Fundamental Bounds on Online Strategic Classification* Saba Ahmadi†, Avrim Blum†, and Kunhe Yang‡ †Toyota Technological Institute at Chicago ‡University of California, Berkeley saba,avrim } { @ttic.edu [email protected] February 27, 2023 Abstract We study the problem of online binary classification where strategic agents can manipulate their observable features in predefined ways, modeled by a manipulation graph, in order to receive a positive classification. We show this setting differs in fundamental ways from classic (non-strategic) online classification. For instance, whereas in the non-strategic case, a mistake bound of ln is achievable via the halving algorithm when the target function belongs to a known class , we show that no deterministic algorithm can achieve a mistake bound o(∆) in the strategic setting, where ∆ is the maximum degree (∆)). We complement this with a general algorithm of the manipulation graph (even when ). We also extend this to the agnostic setting, and show that this achieving mistake bound (∆ ln algorithm achieves a ∆ multiplicative regret (mistake bound of )), and that no deterministic algorithm can achieve o(∆) multiplicative regret. OPT + ∆ |H| |H| |H| |H| (∆ H ln O O O = * * Next, we study two randomized models based on whether the random choices are made before or In the first, fractional model, after agents respond, and show they exhibit fundamental differences. at each round the learner deterministically chooses a probability distribution over classifiers inducing expected values on each vertex (probabilities of being classified as positive), which the strategic agents respond to. We show that any learner in this model has to suffer linear regret. On the other hand, in the second randomized algorithms model, while the adversary who selects the next agent must respond to the learner's probability distribution over classifiers, the agent then responds to the actual hypothesis classifier drawn from this distribution. Surprisingly, we show this model is more advantageous to the learner, and we design randomized algorithms that achieve sublinear regret bounds against both oblivious and adaptive adversaries. 1 Introduction Strategic classification concerns the problem of learning classifiers that are robust to gaming by self-interested agents Br ̈uckner and Scheffer (2011); Hardt et al. (2016). An example is deciding who should be qualified for getting a loan and who should be rejected. Since applicants would like to be approved for getting a loan, they may spend efforts on activities that do not truly change their underlying loan-worthiness but may cause the classifier to label them as positive. An example of such efforts is holding multiple credit cards. Such gaming behaviors have nothing to do with their true qualification but could increase their credit score and therefore their chance of getting a loan. Strategic classification is particularly challenging in the online setting where data points arrive in an online manner. In this scenario, the way that examples manipulate *Authors are ordered alphabetically. 1 depends on the current classifier. Therefore, the examples' behavior changes over time and it may be dif- ferent from examples with similar features observed in the previous rounds. Additionally, there is no useful source of unmanipulated data since there is no assumption that the unmanipulated data is coming from an underlying distribution. Strategic agents are modeled as having bounded manipulation power, and a goal of receiving a posi- tive classification. The set of plausible manipulations has been characterized in two different ways in the literature. The first model considers a geometric setting where each example is a point in the space that can move in a ball of bounded radius (e.g., Dong et al. (2018); Chen et al. (2020); Haghtalab et al. (2020); Ahmadi et al. (2021); Ghalme et al. (2021)). Another model is an abstraction of feasible manipulations us- ing a manipulation graph that first was introduced by Zhang and Conitzer (2021). We follow the second model and formulate possible manipulations using a graph. Each possible feature vector is modeled as a x′ in the manipulation graph implies that an agent with feature node in this graph, and an edge from x vector x may modify their features to x′ if it helps them to receive a positive classification. We consider the problem of online strategic classification given an underlying manipulation graph. Our goal is to minimize the Stackelberg regret which is the difference between the learner's cumulative loss and the cumulative loss of the best-fixed hypothesis against the same sequence of agents, but best-responding to this fixed hypothe- sis. → In this paper, we consider three models with different levels of randomization. First, we consider the scenario where the learner can pick deterministic classifiers. A well-known deterministic algorithm in the context of online learning is the halving algorithm, which classically makes at most O(ln ) mistakes when . First, we show that when agents are strategic, the halving algorithm the target function belongs to class fails completely and may end up making mistakes at every round even in this realizable case. Moreover, we show that no deterministic algorithm can achieve a mistake bound o(∆) in the strategic setting, where ∆ is the maximum degree of the manipulation graph, even when = O(∆). We complement this result with a general algorithm achieving mistake bound O(∆ ln ) in the strategic setting. We further extend this algorithm to achieve O(∆) multiplicative regret bounds in the non-realizable (agnostic) strategic setting, giving matching lower bounds as well. |H| |H| |H| H Our next model is a fractional model where at each round the learner chooses a probability distribution over classifiers, inducing expected values on each vertex (the probability of each vertex being classified as positive), which the strategic agents respond to. The agents' goal is to maximize their utility by reaching a state that maximizes their chance of getting classified as positive minus their modification cost. For this model, we show regret upper and lower bounds similar to the deterministic case. In the last model, the learner again picks a probability distribution over classifiers, but now, while the adversary who selects the next agent must respond to this probability distribution, the agent responds to the actual classifier drawn from this distribution. That is, in this model, the random draw occurs after the adversary's selection of the agent but before the agent responds, whereas in the fractional model the random draw occurs after the agent responds. Surprisingly, we show this model is not only more transparent to the agents, but also more advantageous to the learner than the fractional model. We argue that transparency can make the learner and agents cooperate against the adversary in a way that would be more beneficial to both parties, which is an interesting phenomenon that differentiates the strategic setting from the nonstrategic one. In this model, we design randomized algorithms that achieve sublinear regret bounds against both oblivious and adaptive adversaries. We give a detailed overview of our results in Section 3. 1.1 Related Work Our work builds upon a growing line of research, initiated by Dalvi et al. (2004); Dekel et al. (2008); Br ̈uckner and Scheffer (2011), that studies learning from data provided by strategic agents. Hardt et al. (2016) differentiated the field of strategic classification from the more general area of learning under adver- 2 sarial perturbations; they introduced the problem of strategic classification and modeled it as a sequential game between a jury that deploys a classifier and an agent that best responds to the classifier by modifying their features at a cost. Following the framework of Hardt et al. (2016), recent works have focused on both the offline set- ting where examples come from underlying distributions (Zhang and Conitzer, 2021; Sundaram et al., 2021; Lechner and Urner, 2022; Perdomo et al., 2020) and the online settings where examples are chosen by an adversary in a sequential manner (Dong et al., 2018; Chen et al., 2020; Ahmadi et al., 2021). Milli et al. (2019); Hu et al. (2019) extend the setting considered by Hardt et al. (2016) to the case that heterogeneous sub-populations of strategic agents have different manipulation costs and studied other objectives such as social burden and fairness. A number of other works focus on incentivizing agents to take improve- ment actions that increase their true qualification as opposed to gaming actions (Kleinberg and Raghavan, 2020; Alon et al., 2020; Haghtalab et al., 2020; Ahmadi et al., 2022; Bechavod et al., 2022). The works by Shavit et al. (2020); Perdomo et al. (2020); Bechavod et al. (2021) study causal relationships between ob- servable features and outcomes in strategic classification. Levanon and Rosenfeld (2021) provide a practical learning framework for strategic classification. Recent works relax the assumption that strategic agents best respond to the classifiers and consider alternative assumptions such as noisy response (Jagadeesan et al., 2021), learning agents (Zrnic et al., 2021), and non-myopic agents (Haghtalab et al., 2022). Our work is most closely related to that of Zhang and Conitzer (2021); Lechner and Urner (2022), which captures the set of plausible manipulations using an underlying manipulation graph, where each edge x → x′ represents a plausible manipulation from features x to x′. This formulation is in contrast to a geometric model where agents' features are vectors in a d-dimensional space, with manipulation cost captured by some distance metric. As a result, agents in the geometric setting move in a ball of bounded radius (Dong et al., 2018; Chen et al., 2020; Haghtalab et al., 2020; Ahmadi et al., 2021; Ghalme et al., 2021; Sundaram et al., 2021). However, the work of Zhang and Conitzer (2021); Lechner and Urner (2022) focuses on the offline PAC learning setting. Our work can be considered as generalizations of their model to the online learning setting. Our work is also connected to the line of work that studies randomness and transparency in strategic classification. In terms of classification accuracy in the offline setting, Braverman and Garg (2020) shows that in a one-dimensional feature space, both committed randomness (probabilistic classifiers) and noisy features under deterministic classifiers can improve accuracy, and the optimal randomized classifier has a structure where agents are better off not manipulating. On the other hand, Ghalme et al. (2021) gives suf- ficient conditions under which transparency is the recommended policy for improving predictive accuracy. Our paper combines the insights of both papers in the online setting, where we show that randomness is necessary against the adversary that selects agents, but transparency is more advantageous when it comes to the strategic agents themselves (see Section 6.4 for more discussions). In addition to accuracy, there are also studies about the societal implications of randomization and transparency in the presence of multiple sub- populations, such as information discrepancy (Bechavod et al., 2022) and fairness (Immorlica et al., 2019; Kannan et al., 2019; Frankel and Kartik, 2022; Braverman and Garg, 2020). 2 Model 2.1 Strategic Classification X denote the space of agents' features, and denote the space of labels. We consider Let Y T t=1 that the task of sequential classification where the learner aims to classify a sequence of agents is the true arrive in an online fashion. Here, we assume ut ∈ X label. We call agents with yt = +1 true positives, and the ones with yt = 1 true negatives. Importantly, we make minimum assumptions on the sequence of agents, and our results apply to the case of adversarially +1, { is the true feature set of agent t and yt ∈ Y − ut, yt} { 1 } = − 3 chosen sequences. A hypothesis h : labels to the agents u mistakes made by the learner, compared to the best classifier h⋆ X → Y . Given a hypotheses class ∈ X H : X → Y (also called a classifier or an expert) is a function that assigns , our goal is to bound the total number of in hindsight. To model the gaming behavior in real-life classification tasks, we work with the setting of strategic classification, in which agents have the ability to modify their features at a given cost and reach a new observable state. Formally, strategic classification can be described as a repeated Stackelberg game between the learner (leader) and the agents (followers). At each step t [T ], the learner first publicly commits to a classifier ht. Then, the t-th agent (ut, yt) arrives and responds to ht by modifying their features from ut to vt. As a result of manipulation, only vt (instead of ut) is observable to the learner. ∈ We assume that vt is chosen as a best-response (BR) to the announced rule ht, such that the agent's utility is maximized: ∈ H vt ∈ BRht(ut) , arg max v∈X Value(ht(v)) − Cost(ut, v) i . (1) h Here, Value(ht(v)) indicates the value of outcome ht(v), which is a binary function that takes the value of 1. In Section 5, we consider the generalization of agents best 1 when ht(v) = +1, and 0 when ht(v) = responding to a probability distribution over classifiers, where Value(ht(v)) becomes the induced expecta- tion on node v, i.e., the probability of v getting classified as positive by ht. Equivalently, we refer to ht as a fractional classifier and the induced probabilities as fractions. Cost(ut, v) is a known, non-negative cost function that captures the cost of modifying features from ut to v. It is natural to assume Cost(u, u) = 0 for BRht(ut) to show the best-response of agent ut at time-step t. Ties are broken by all u always preferring features with higher Value(ht( )), and preferring to stay put, i.e. ut = vt, if ut is among * the set of best-responses that achieves the highest value. . We use vt ∈ ∈ X − Learner's Objective: The learner's loss is defined as the misclassification error on the observable state: BRht(ut) and has the highest value of ht( ) according to the tie * = max l(ht, vt, yt) = 1 . Since vt ∈ { breaking rule, we also abuse the notation and write l(ht, BRht(ut), yt) = 1 The learner's goal is to minimize the Stackelberg regret with respect to the best hypothesis h⋆ n sight, had the agents best responded to h⋆: ht(v) : v { = ht(vt) } ∈ ∈ H BRht(ut) } in hind- yt 6 yt 6 . o Regret(T ) , T Xt=1 l(ht, BRht(ut), yt) min h⋆∈H − l(h⋆, BRh⋆(ut), yt). T Xt=1 For notational convenience, we use OPT to denote the optimal loss achieved by the best hypothesis: OPT , min h⋆∈H T t=1 X l(h⋆, BRh⋆(ut), yt). (2) (3) When OPT = 0, we call the sequence of agents realizable, meaning that there exists a perfect classifier that never makes a mistake had agents best responded to it. Otherwise when OPT > 0, we call it unrealizable or agnostic. 2.2 Manipluation Graph , E X ) to characterize the set of plausible manipulations. We use graph G( X captures a plausible manipulation from corresponds to a state (i.e., features), and each edge e = (u, v) u to v. The cost function Cost(u, v) is defined as the sum of costs on the shortest path from u to v, or + if such a path does not exist. We present our results for the case of undirected manipulation graphs and show how they can be extended to the case of directed graphs (Appendix A.3). In graph G, each node in ∈ E ∞ 4 Type of Randomness Manipulation Graph Deterministic Unweighted Upper Bound Lower Bound Realizable Agnostic O(∆ ln |H|) Algorithm 1 (Theorem 4.3) O(∆ * OPT + ∆ ln |H|) Algorithm 2 (Theorem 4.5) Realizable Agnostic ∆ − 1 Theorem 4.6 ∆ * OPT Theorem 4.6 Fractional Classifiers (random choice after agents respond) Free-edges Weighted O(∆ * OPT + ∆ ln |H|) Algorithm 2 (Theorem 4.5) O( ̃∆ * OPT + ̃∆ ln |H|) Proposition 5.5 Randomized Algorithms (random choice before agents respond) Unweighted Oblivious Adaptive 1 2 3 ln 1 3 4 ln 3 |H|(cid:17) O (cid:16)T Algorithm 3 (Theorem 6.1) 4 |H|(cid:17) O (cid:16)T e Algorithm 5 (Theorem A.5) T |H| ln |H|(cid:17) O (cid:16)p e Vanilla EXP3 Algorithm ∆ 2 * OPT Theorem 5.1 ∆ 4 * OPT (cid:16) Theorem 5.2 ̃∆ 4 * OPT (cid:17) Open Table 1: This table summarizes the main results of this paper for the model of deterministic classifiers, fractional clas- sifiers, and randomized algorithms respectively. We use ∆ to denote the maximum degree of the manipulation graph, and ̃∆ to denote the maximum degree of the expanded manipulation graph, which is constructed from a weighted 2 where Cost(u, v) 1. Although the table is presented in terms of graph by connecting all pairs of nodes (u, v) undirected graphs, we remark that all the upper and lower can be extended to the setting of directed graphs, with the de- grees to be replaced by the corresponding out-degrees, see Appendix A.3 for an example in the setting of deterministic classifiers. OPT stands for the optimal number of mistakes achieved by the best hypothesis in class ∈ X ≤ . H ∈ To model the cost of each edge, we consider weighted graphs in which each edge e is associated with [0, 1]. As a special case of the weighted graphs, we also consider unweighted a nonnegative weight w(e) graphs, in which each edge takes unit cost, i.e., w(e) = 1. We remark that in unweighted graphs, agents will move for at most one hop because manipulating the features can increase the value of classification , then agent outcomes by at most 1. To be specific, let N [u] denote the closed neighborhood of state u u respond to classifier h as follows: if h(u) is negative and there exists a neighbor v N [u] with positive h(v), then u will move to v; otherwise, u does not move. As a result, the loss function in unweighted graphs can be equivalently expressed as ∈ X ∈ E ∈ l(h, BRh(u), y) =   1 1 0 v v y = +1, ∀ 1, y = ∃ − otherwise. ∈ ∈ 1; N [u] : h(v) = N [u] : h(v) = +1; − When fractional classifiers are used, we also consider the free-edge manipulation model. In this model, we restrict the agent to only moving one hop, where the cost of moving is zero. Specifically, each pair of nodes (u, v) , otherwise the cost is infinity. When agents best respond to classifier h under this cost function, they will move to a one-hop neighbor of their initial state that has the highest probability of getting classified as positive. 2 has zero manipulation cost if (u, v) ∈ X ∈ E  3 Overview of Results Our work considers three types of randomness: deterministic, fractional classifiers, and randomized algo- rithms. In the deterministic model, the learner is constrained to using deterministic algorithms to output a sequence of deterministic classifiers. In the fractional classifiers model, the learner is allowed to output a 5 probability distribution over classifiers at every round, inducing fractions on every node that represent their probability of being classified as positive. The agents best respond to these fractions before the random labels are realized. In the last randomized algorithms model, the learner outputs a probability distribution over classifiers as in the fractional model, and the adversary may pick ut based on these probabilities, but now the agents respond to the true realized classifier in selecting vt. We summarize our main results in Table 1. Deterministic Classifiers: In the case of deterministic classifiers, we model strategic manipulations by unweighted graphs that have unit cost on all edges. We first consider the realizable setting where the perfect , and show fundamental differences between the non-strategic classifier lies in a finite hypothesis class and strategic settings. In the non-strategic setting, the deterministic algorithm Halving achieves O(ln ) |H| mistake bound. However, in the strategic setting, we show in Example 4.2 that the same algorithm can suffer from an infinite number of mistakes. H In Section 4, we analyze the strategic setting and provide upper and lower bounds of the mistake bound, both characterized by the maximum degree of vertices in the manipulation graph, which we denote with ∆. On the lower bound side, we show in Theorem 4.6 that no deterministic algorithm is able to achieve = O(∆). On the upper bound side, we propose o(∆) mistake bound, and this barrier exists even when Algorithm 1 that achieves mistake bound O(∆ ln ) by incorporating the graph structure into the vanilla Halving algorithm. |H| |H| * OPT+∆ ln We then move to the agnostic strategic setting and propose Algorithm 2 which achieves a mistake bound ), where OPT denotes the minimum number of mistakes made by the best classifier of O(∆ in . This bound is ∆-multiplicative of the bound achieved by the weighted majority vote algorithm in the non-strategic setting. We complement this result with a lower bound showing that no deterministic algorithm OPT) mistake bound. In order to overcome the ∆-multiplicative barrier, we study the use can achieve o(∆ of randomization in the next two models. |H| H * Fractional Classifiers: In this setting, we consider two models of cost function: the free-edges cost model, where traveling one edge is cost-free but the second edge costs infinity, and the weighted graph model, where agents can travel multiple edges and pay for the sum of costs of edges. In the free-edges model, we show that no learner can overcome the mistake lower bound ∆ OPT, and provide an upper ) based on Algorithm 2. In the weighted graph model, we show a mistake bound of O(∆ lower bound of ∆ ), which is obtained by running Algorithm 2 on the expanded manipulation graph ̃G that is constructed by connecting all pairs of nodes 1, and ̃∆ denotes the maximum degree of ̃G. In particular, our construction (u, v) for the lower bound satisfies ̃∆ = ∆, so this result also implies that no learner is able to surpass the ̃∆ 4 - multiplicative regret. OPT, and an upper bound of O( ̃∆ 2 where Cost(u, v) OPT + ̃∆ ln OPT + ∆ ln ∈ X |H| |H| 2 * 4 * ≤ * * Our results in this setting indicate that using fractional classifiers cannot help the learner to achieve OPT) regret. To resolve this issue, we move on to the randomized algorithms model where the learner o(∆ realizes the random choices in transparency to the agents. * Randomized Algorithms: In this setting, the learner uses randomized algorithms that produce probabil- ity distribution over deterministic classifiers at each round. The key difference from the fractional classifiers setting is, although the adversary still chooses agent (ut, yt) based on the distribution, the agent will best respond to the classifier to be used after it is sampled from the distribution. Surprisingly, we show that revealing the random choices to the agents can make the interaction more fruitful for both the agents and the learner, as the learner is now able to achieve vanishing regret without the multiplicative dependency on ∆ or ̃∆. This demonstrates an interesting difference between strategic and non-strategic settings from the learner's perspective: whereas delaying the realization of random bits is helpful in non-strategic settings, it is more helpful to realize the random choices before agents respond in the strategic setting. We refer the readers to Section 6.4 for more discussions about this difference. 6 H gives us a regret upper bound of O As for algorithms and upper bounds in this setting, we first show that the vanilla EXP3 algorithm on , we expert set T design two algorithms that simultaneously observe the loss of all experts by using an all-positive classifier at random time steps to stop the manipulations. In particular, Algorithm 3 achieves regret upper bound of against oblivious adversaries; and Algorithm 5 achieves regret bound of O against general adaptive adversaries. We also extend this algorithmic idea to the linear classification setting (cid:17) where original examples are inseparable and obtain an upper bound in terms of the hinge loss of the original data points, resolving an open problem proposed in Ahmadi et al. (2021). Although, our mistake bound has an extra O(√T ) additive term compared to their bound for the case that original data points are separable. . To improve the dependency on 3 4 ln 2 3 ln (cid:16)p |H| |H| |H| |H| |H| ln O (cid:16) (cid:17) (cid:16) (cid:17) T T e 1 4 1 3 Two Populations: We propose an extension to our model in which agents are divided into two popula- tions with heterogeneous manipulation power: group A agents face a cost of 0.5 on each edge, whereas group B agents face a cost of 1. We assume that group membership is a protected feature, and is observable only af- - ter the classifier is published. In Appendix A.6, we present an algorithm with a min multiplicative regret, where β is the probability that agents are assigned to group B. n β , ∆2 + 2 o ∆ + 1 + 1 4 Deterministic Classifiers 4.1 Realizable Case In the realizable case, we assume that there exists a perfect expert h⋆ This implies that for all time steps t bounding the Stackelberg regret coincides with the mistake bound: with zero mistakes, i.e., OPT = 0. [T ], we have l(h⋆, BRh⋆(ut), yt) = 0. In this case, our goal of ∈ H ∈ Mistake(T ) , T t=1 X l(ht, BRht(ut), yt). (4) with positive labels under h⋆, namely For notational convenience, let S⋆ denote the set of nodes in S⋆ , . Then realizability implies that S⋆ must satisfy two properties: (1) all the true positives can reach S⋆ within no more than one hop; (2) No true negatives can reach S⋆ in one hop. We formalize these two properties in Proposition 4.1. : h⋆(u) = +1 } u { ∈ X X such that S⋆ is a dominating Proposition 4.1. In the realizable case, there exists a subset of nodes S⋆ set for all the true positives ut, i.e. dist(ut, S⋆) 1. Additionally, none of the true negatives ut are ≤ dominated by S⋆, i.e. dist(ut, S⋆) > 1, where dist(u, S⋆) represents the minimum distance from node u to the set S⋆. ⊆ X 4.1.1 The failure of vanilla Halving O (ln In the problem of nonstrategic online classification with expert advice, the well-known Halving algorithm achieves a mistake bound of Mistake(T ) = ). In each iteration, Halving uses the majority vote of remaining experts to make predictions on the next instance, which ends up reducing the number of remaining experts at the beginning and at least one expert experts by at least half on each mistake. Since there are at the end, the total number of mistakes is bounded by ). However, in the following example, we show that when agents are strategic, the vanilla Halving algorithm may suffer from an infinite number of mistakes, as do two extensions of vanilla Halving that consider the best response function before taking majority votes. Moreover, our construction indicates that these algorithms fail even when the sequence of agents is chosen by an oblivious adversary. |H| (ln O |H| |H| 7 − x1 − x∆ x2 − x0 − x3 − x4 − xi + Figure 1: Expert hi Example 4.2. Consider the following manipulation graph G( star that includes a central node x0, and ∆ leaves x1, each hi is h⋆ = hj [∆] unknown to the learner. assigns positive to xi, and negative to all other nodes in for some j ∈ H * * * X E , , x∆. Hypothesis class ) and hypothesis class h1, { ) is a X E , h∆ , where } (see Figure 1). The perfect expert H * * * : G( H = , X ∈ H ∈ Now consider two algorithms: the vanilla Halving algorithm and the variant that performs an expansion of positive region on top of Halving. 1. Vanilla Halving. Consider the following sequence of agents: at every time t, the same agent with initial position ut = x0 and label yt = +1 arrives. We claim that the Halving algorithm makes mistakes on each agent regardless of the total number of rounds executed. First, note that this sequence is realizable with , we have BRhi(x0) = xi and hi(xi) = +1, so each hi classifies respect to class (x0, +1) correctly in isolation. Therefore, any expert in achieves zero mistakes on this sequence of agents. : for all hi ∈ H H H H ∈ X that labels it as positive. Therefore, the majority vote classifier of Now consider the vanilla Halving algorithm. Initially, for each node x , there is at most one expert in labels every node as negative. In response to this all-negative majority vote classifier, the first agent (x0, +1) stays put and gets classified as negative mistakenly. However, we know that each classifier hi predicts correctly on (x0, +1). As a result, none of the experts get discarded. Therefore, a mistake is made by the learner, but no progress is made in terms of shrinking the set . The same agent appears at every round, resulting in the Halving algorithm making mistakes in each round. H H 2. A strategic variant of Halving. = H and u Now consider a different voting rule for taking the majority-vote classifier based on the best-response function: Let h(u) = h(BRh(u)) for all h , and suppose that the learner runs ∈ H , hi(x0) = , h∆ h1, Halving on the hypotheses class { * * * hi(BRhi(x0)) = hi(xi) = +1, therefore the majority-vote classifier predicts positive on x0. On the other hand, the majority vote classifier predicts negative on all the leaves. Now, suppose the adversary [∆] and constructs a sequence in which hj is realizable as follows: at each time secretly chooses j . Note step t, selects an example with true label yt = except hi will classify (ut, yt) correctly. However, the majority vote classifier that all classifiers in will make a mistake because ut can manipulate to x0 and get classified as positive. Once the mistake by is made, had the true location ut = xi been observable, the learner could have shrunk the size of 1 and initial position ut = xi ∈ X \ { . Specifically, for each hi } x0, xj} ∈ H ∈ X H − ∈ H 8 discarding hi. However, ut is hidden from the learner, so the learner would not know which classifier is making a mistake. Therefore, it cannot make progress by excluding at least one expert from in each round. H 3. Another strategic variant of Halving. The positive region of hmaj in the previous variation can be reached by all the nodes in the graph, which makes gaming too easy for the agents. Now, suppose the learner's goal is to shrink the positive region of hmaj and get a new classifier h, such that the positive region of h can only be reached by the true positives under hmaj, but none of the true negatives. We use the same example as above to show the failure of this algorithm because such h does not exist. Recall that the positive region of hmaj contains only the central node x0. Suppose such an h exists, then x0 cannot belong to the positive region of h, because it can be reached by all leaf nodes xi, which are true negatives under hmaj. In addition, no leaf nodes should be included in the positive region of h either. This implies that the positive region of h is empty, which contradicts with the assumption that true positive node x0 can reach it. For this reason, the learner is unable to find an h satisfying this property. Example 4.2 indicates that taking majority votes fails in the strategic setting. One crucial point is that the leaves do not meet the threshold for majority, and therefore they are always negative under the majority vote classifier (whether we consider the best response function or not) and thus indistinguishable, weakening the learner's leverage to identify the optimal expert. In fact, in this example, the only evidence for removing an expert is a false positive agent at the corresponding leaf node, so the learner should classify the leaves as positive in order to make progress. Therefore, one needs to lower the threshold for majority votes to increase the likelihood of false positives and make more room for improvement. In the next section, we propose an algorithm based on the idea of biased majority vote in favor of positive predictions, which provably achieves finite mistake bounds against any adversarial sequence of strategic agents. We show that compared to the nonstrategic setting, the extra number of mistakes made by the learner is closely characterized by the maximum degree of the manipulation graph. 4.1.2 Upper Bound: Biased Majority-Vote Algorithm In this section, we propose a biased version of the majority vote algorithm for the realizable strategic setting. The algorithm proceeds in rounds as follows: At each round t, a new agent arrives and gets observed as vt. From the remaining set of experts, if at least 1/(∆ + 2) fraction of them classify vt as positive, then the algorithm predicts positive. If the algorithm made a mistake, all the experts that predicted positive get removed from . If less than 1/(∆ + 2) fraction of the experts classify vt as positive, the algorithm predicts negative. If the prediction was wrong, then each expert that labeled all the vertices in the neighborhood of . We present this algorithm in Algorithm 1 and analyze its vt, i.e. N [vt], as negative gets removed from mistake bound in Theorem 4.3. H H Theorem 4.3. If there exists at least one perfect expert under manipulation, Algorithm 1 makes at most (∆ + 2) ln mistakes. |H| H Proof. We show whenever a mistake is made, at least 1/(∆ + 2) fraction of the remaining experts get excluded from , but the realizable classifier h⋆ is never excluded. First, consider the case of making mistake on a true negative, i.e. yt = /(∆ + 2) of the experts are predicting positive on vt, and all of them are excluded from |H| hand, according to Proposition 4.1, all neighbors of ut are labeled as negative by h⋆. Since vt ∈ implies that h⋆ must have labeled vt as negative, so h⋆ will not be excluded. In this case, at least . On the other N [ut], this H − 1. 9 ALGORITHM 1: Biased majority-vote algorithm. Input :G( ), hypothesis class do for t = 1, 2, H , X E * * * /* learner commits to a classifier ht that is constructed as follows: */ for v if /(∆ + 2) then do ∈ X h | ∈ H ht(v) : h(v) = +1 +1; ← | ≥ |H| else end ht(v) 1; ← − end /* example vt is observed. */ predict according to ht(vt); /* If there was a mistake: */ if ht(vt) if yt = = yt then 1 then h − H ← H \ { else end end end : h(vt) = +1 ; } ∈ H // at least |H|/(∆ + 2) experts are removed. h H ← H \ { removed. : x ∀ ∈ ∈ H N [vt], h(x) = 1 ; } − // at least |H|/(∆ + 2) experts are Next, consider the case of making a mistake on a true positive, i.e. yt = +1. Since the algorithm is predicting negative on vt, the agent has not moved from a different location to vt to get classified as negative. Hence, it must be the case that vt = ut. Since the agent did not move, none of the vertices in its neighborhood has been labeled positive by the algorithm, which means each of the vertices in N [vt] is /(∆ + 2) of the experts. Since there are at most (∆ + 1) vertices in N [vt], labeled positive by less than at least /(∆ + 2) experts are predicting negative on all vertices in N [vt], all of which will be excluded. On the other hand, by Proposition 4.1 again, ut = vt is dominated by the positive region of h⋆, so at least one vertex in N [ut] is labeled positive by h⋆, which implies that h⋆ will not be excluded from (∆ + 1)/(∆ + 2)) = |H| |H| |H| (1 − . In either case, when a mistake is made, at least 1/(∆ + 2) fraction of the remaining experts get excluded, but the perfect expert never gets excluded. Therefore, the total number of mistakes M = Mistake(T ) can be bounded as follows: H 1 ∆ + 2 1 − (cid:18) M (cid:19) 1 |H| ≥ ⇒ M ≤ (∆ + 2) ln . |H| Improving the Upper Bound In Appendix A.2, we propose a pre-processing step (Algorithm 4) that improves the mistake bound of Algorithm 1 when the underlying manipulation graph is dense, i.e., the minimum degree of all the vertices is large. We achieve the following upper bound: Theorem 4.4 (Improving the number of mistakes). Algorithm 4 makes at most min n { δ and δ is the minimum degree of G( mistakes, where n = ). , δ, 1+∆ min * ln { , n |H| − − |X | X E 1 }} − We leave it open to get a general instance-dependent upper bound that potentially depends on other characteristics of the manipulation graph besides the maximum/minimum degree. 10 6 4.2 Unrealizable Case In the unrealizable (agnostic) case, we remove the assumption that there exists a perfect classifier under manipulation. Our goal is to design an adaptive algorithm that does not make too many mistakes compared to OPT (which is the minimum number of mistakes achieved by any classifier in ), without a priori knowledge of the value of OPT or the optimal classifier that achieves this value. Before presenting our algorithm, we first observe that for any classifier h with positive region Sh, h makes a mistake on a true positive agent u if and only if u cannot reach Sh, and h makes a mistake on a true negative agent u if and only if u can reach Sh. H 4.2.1 Upper Bound: Biased Weighted Majority-Vote Algorithm Next, we propose an algorithm for the unrealizable setting. The algorithm is adapted from the weighted majority vote algorithm, which maintains a weight for each hypothesis in that are initially set to be 1. Similar to Algorithm 1, at each round t, a new example arrives and gets observed as vt. Let W t + and W t − denote the sum of weights of experts that predict vt as positive and negative respectively. Let Wt = W t + + W t Wt/(∆ + 2), the algorithm predicts positive, otherwise it predicts negative. If the algorithm makes a mistake on a true negative, then we decrease the weights of all experts that predicted vt as positive by a factor of γ. If the algorithm makes a mistake on a true positive, then we decrease the weights of all experts that labeled all the vertices in N [vt] as negative by a factor of γ. We formally present this algorithm in Algorithm 2 and its mistake bound guarantee in Theorem 4.5. −. If W t + ≥ H Theorem 4.5. Algorithm 2 makes at most e(∆ + 2)(ln + OPT) mistakes against any adversary. |H| 4.3 Lower Bound In this section, we show lower bounds on the number of mistakes made by any deterministic learner against an adaptive adversary in both realizable and agnostic settings. We present the lower bounds in Theorem 4.6. Theorem 4.6. There exists a manipulation graph G( tive adversary, such that any deterministic learning algorithm has to make at least ∆ realizable setting and ∆ of mistakes made by any classifier in the hypothesis class , and an adap- 1 mistakes in the OPT mistakes in the agnostic setting, where OPT captures the minimum number ), a hypothesis class X → Y − H X E * , : . H , = Proof. Here, we use the same manipulation graph G and expert class manipulation graph G( , h∆ h1, set { X , where each hi } , assigns +1 to xi, and H In the agnostic setting, we construct an adaptive adversary that always can pick a bad example (ut, yt) on observing ht, such that ht fails to classify this example correctly (i.e., l(ht, BRht(ut), yt) = 1), but this example can be successfully classified by all but one expert. The detailed construction is as follows: 1 to all other nodes in G (Figure 1). as shown in Example 4.2. The , x∆. Hypothesis ) is a star that includes a central node x0, and ∆ leaves x1, ∈ H * * * * * * H − E 1. If ht(x0) = +1, then the adversary picks (ut = xj, yt = [∆]. Since ut can move to x0 and get classified as positive by ht, we have l(ht, BRht(ut), yt) = 1. On the other hand, all experts except for hj classify this example correctly. 1) for an arbitrary j − ∈ 2. If ht(x) = 1 for all nodes x − l(ht, BRht(ut), yt) = 1. However, positive classification and therefore l(hi, BRhi(ut), yt) = 0. ∈ H ∈ X ∀ , then the adversary picks (ut = x0, yt = +1). In this case, hi , we have BRhi(ut) = x0, so this example can receive a 1 and there exists j 3. If ht(x0) = xj, yt = experts except for hj will correctly classify it as negative. [∆] such that ht(xj) = +1, then the adversary picks (ut = 1). In this case, ht will classify this example as a false positive. On the other hand, all − − ∈ 11 , ALGORITHM 2: Biased weighted majority-vote algorithm. Input :G( ), Set weights w0(h) Let γ = 1 e ; for t = 1, 2, 1 for all classifiers h H ← ∈ H do X E ; /* the learner commits to a classifier ht that is constructed as follows: */ for v h∈H:h(v)=+1 wt(h), W − h∈H wt(h); t (v) = t (v) = t (v) + W − P h∈H:h(v)=−1 wt(h), and P Wt/(∆ + 2) then P +1; * * * t (v) = ∈ V do Let W + Wt = W + if W + t (v) ht(v) ≥ ← else end ht(v) 1; ← − end /* example vt is observed. */ output prediction ht(vt); /* If there was a mistake: */ if ht(vt) = yt then 1 then if yt = − H ← { else h ∈ H : h(vt) = +1 ; } ′ ′ /* penalize the experts that label vt as positive. */ /* penalize the experts that label all nodes in N [vt] as negative. */ H ← { h : x ∀ ∈ ∈ H N [vt], h(x) = 1 ; } − ′, then wt+1(h) γ * ← ∈ H wt(h); otherwise, wt+1(h) wt(h); ← end if h end end Following the above construction, the learner is forced to make a mistake at all rounds; however, in each round, at most one of the experts makes a mistake, implying that sum of the number of mistakes made by all experts is at most T . Since the number of experts is ∆, by the pigeon-hole principle there exists an expert OPT. that makes at most T /∆ mistakes. Therefore, OPT * 1 time steps, such 1 mistakes, but there exists at least one expert that has not made a 1 steps, the adversary keeps showing that the learner is forced to make ∆ − mistake so far, suppose hi is one of such experts. After the first ∆ the same agent (xi, +1) to the learner, such that expert hi is still realizable. In the realizable setting, we use the same construction but only focus on the first ∆ T /∆, implying a mistake lower bound of ∆ ≤ − − We remark that Theorem 4.6 implies no deterministic algorithm is able to make o(∆) mistakes in the realizable setting and o(∆) multiplicative regret in the agnostic setting. Moreover, the construction shows that any deterministic algorithm is forced to err at every round in the worst-case agnostic setting, resulting in an Ω(T ) regret as long as ∆ 2. ≥ 12 6 5 Fractional Classifiers 5.1 Model In this section, we consider the randomized model where the learner uses a deterministic algorithm to output a probability distribution over classifiers at each round. After the learner commits to a distribution, an agent (ut, yt) (which is chosen by an adversary) best responds to this distribution by selecting vt that maximizes [0, 1] denote the induced probability of ht classifying node v the expected utility. In particular, let Pht(v) as positive, then the agent's best response function can be written as: ∈ Pht (v) h As a result of manipulation, the observable feature vt ∈ suffers an expected loss of BRht(ut) , arg max v∈X vt ∈ − Cost(ut, v) i . (5) BRht(ut) is revealed to the learner, and the learner E [l(ht, vt, yt)] = Pr [yt 6 = ht(vt)] = Pht(vt), 1 ( Pht(vt), − if yt = 1; if yt = +1. − (6) From Equations (5) and (6), we can see that the set of induced probabilities Pht(u) for each u serves as a sufficient statistics for both the learner and the agent. Therefore, instead of committing to a distribution and having the agents calculate the set of induced probabilities, the learner can directly commit to a fractional classifier ht that explicitly specifies the probabilities Pht(u) . Then, after the agent best responds to these fractions and reaches vt, random label ht(vt) is realized according to the proposed probability Pht(vt). [0, 1] for each u ∈ X ∈ X ∈ We remark that deterministic classifiers are special cases of the fractional classifiers where Ph(u) ∈ are all deterministic, the benchmark OPT, which is the minimum number of . Since the experts in 0, 1 { } mistakes achieved by the best expert in hindsight, is still a deterministic value. H In this setting, we consider two cost functions: the weighted-graph cost function, where the manipulation cost from u to v is defined as the total weight on the shortest path from u to v; and the free-edges model, where the first hop is free and the second hop costs infinity. Recall that agents break ties by preferring features with higher expected values, so the agents in the free-edges cost model will move to a neighbor N [ut] with the highest probability of getting classified as positive. vt ∈ In the Section 5.2, we show that the type of randomness is of limited help because they can only reduce the ∆-multiplicative regret by constants. This is evidenced by our lower bounds in Theorems 5.1 and 5.2, which states that any algorithm using this type of randomness needs to suffer ∆ 2 -multiplicative regret in the free-edges model and ∆ 4 -multiplicative regret in the weighted-graph model. We also complement this result by providing nearly-matching upper bounds in Section 5.3. 5.2 Lower Bound OPT mistakes in expectation. Theorem 5.1. In the model of "free edges" cost functions, for any sequence of fractional classifiers chosen by a deterministic algorithm, there exists an adaptive adversary such that the learner must make at least ∆ 2 * Proof. Consider a manipulation graph G( , x∆. assigns positive to xi and negative to all other nodes Hypothesis set ∈ H in G, as shown in Figure 1. We construct an adversary that picks (ut, yt) upon receiving the fractional clas- sifier ht at each round, such that ht makes a mistake with probability at least 0.5 whereas all but one expert predicts correctly. Our detailed construction is as follows: ) that is a star with a central node x0, and ∆ leaves x1, , X , where each hi } h1, { , h∆ * * * * * * H = E 13 0.5, then the adversary picks (ut = xj, yt = [∆]. Since N [ut] and vt is the node in N [ut] that achieves the largest success probability, we have makes a 0.5. On the other hand, only hj 1) for an arbitrary j − ∈ Pht(x0) 1), and all other experts classify it correctly. ≥ ∈ H ≥ 1. If Pht(x0) x0 ∈ E[l(ht, BRht(ut), yt)] = Pht(vt) mistake on (xj, − 2. If Pht(x0) < 0.5 but there exists j ≥ ∈ [∆] such that Pht(xj) xj, yt = E[l(ht, vt, yt)] − ≥ 1). Since the closed neighborhood of xj only contains 0.5. In addition, all experts but hj classify this example correctly. ≥ 0.5, then the adversary picks (ut = , we have vt = ut and xj, x0} { 3. If neither of the above two conditions holds, i.e., Pht(v) < 0.5 for all nodes v , then the adversary picks (ut = x0, yt = +1). In this case, no matter how the agent chooses vt, the probability Pht(vt) cannot exceed 0.5. As a result, the learner suffers an expected loss of E[l(ht, BRht(ut), yt)] = 1 Pht(vt) the corresponding leaf node and get classified as positive. − 0.5. On the other hand, all experts classify this example correctly because x0 can move to ∈ X ≥ As a result, the learner has an expected loss of at least 0.5 on each round, which implies T E[Mistake(T )] = E " l(ht, BRht(ut), yt) # ≥ T /2. t=1 X However, in each round, at most one expert makes a mistake. Following the same arguments as Theorem 4.6, T we conclude that OPT ∆ . Putting all together, the expected number of mistakes made by the learner is at least ≤ E[Mistake(T )] ≥ T 2 = ∆ 2 * T ∆ ≥ ∆ 2 * OPT. Theorem 5.2. In weighted graphs, for any sequence of fractional classifiers chosen by a deterministic algorithm, there exists an adaptive adversary such that the learner must make at least ∆ OPT mistakes in expectation. 4 * * * * , x∆. Assume each edge e Proof. Again, we consider the same graph structure as in Theorem 5.1, where G( ) is a star with central node x0 and leaf nodes x1, has the same weight w(e) = w, where w , 0.5 + ǫ for an infinitesimal constant ǫ. Note that in this graph, no agent has the incentive to travel more than one edge, because it would cost them more than 1. , h∆ H negative to all other nodes in classifier ht as follows, such that ht makes a mistake with probability at least 1 predicts correctly. Our detailed construction is as follows: assigns positive to xi and . We construct an adversary that picks (ut, yt) upon receiving the fractional 4 , whereas all but one expert , assuming each hi } We work with the hypothesis set h1, { ∈ H ∈ E * * * = X X E , Let p = maxx∈X Pht(x) denote the maximum fraction on any node. If p < w, then the adversary can simply pick (ut = x0, yt = +1), such that the learner suffers from an expected loss of E[l(ht, BRht(ut), yt)] = 1 Pht(vt) 1 − ≥ p > 1 − w > − 1 4 . As for the experts, all of them classify this agent correctly. Therefore, it suffices to consider the case of p w for the rest of the proof. We consider two cases depending on where p is achieved: ≥ 1. If p is achieved at a leaf node xi (i.e., Pht(xi) = p) for some j [∆], then the adversary chooses 1). We claim that ut = vt = xi, since the agent is already placed at the node with the (ut = xi, yt = highest fraction, so they do not need to pay a nonnegative cost to reach a node with an even smaller fraction. As a result, we have E[l(ht, BRht(ut), yt)] = Pht(xi) = p 4 . On the other hand, all but expert hi classify this agent correctly. w > 1 ≥ − ∈ 14 2. If p is achieved at the central node x0, i.e., Pht(x0) = p, then every leaf node have fractions no more w. In this case, w > Pht(ut) than p. We first assume at least one leaf node xi (i the adversary chooses (ut = xi, yt = 1). Since Pht (x0) − Cost(ut, ut), the agent will select vt = x0 as the best response, and achieve a success probability of Pht(x0) = p. Therefore, the learner has expected loss E[l(ht, BRht(ut), yt)] = p 4 . On the other hand, all but expert xi labels this agent correctly. [∆]) satisfies Pht(xi) < p Cost(ut, x0) = p w > 1 − − − ≥ − ∈ 3. Now we consider the last case where p is achieved at the central node x0 and all the leaf nodes w. In this case, no agent has the incentive to move regardless of their w, then choose p p; otherwise, choose w. have fractions at least p initial positions. The adversary can select the next agent as follows: if 1 (ut = x0, yt = +1) and make the learner err with probability 1 (ut = xi, yt = In either case, the learner has to suffer from an expected loss of E[l(ht, BRht(ut), yt)] ǫ 2 . As for the experts, at most one of them is making a mistake. p, p [∆] and make the learner err with probability Pht(xi) p Pht (x0) = 1 − 2 = 1 1) for an arbitrary i p ≥ max − 1 { ≥ − 1−w − − ≥ − − − w ∈ − 4 − Putting together all the possible cases and let ǫ } ≥ probability at least 1 4 on each round, i.e., at most one of the experts makes a mistake, implying that OPT the total loss made by the learner is bounded as P T t=1 E[lt(ht, BRht(ut), yt)] ≤ → 0, the learner is forced to make mistakes with T /4. However, in each round, T ∆ as proved in Theorem 4.6. As a result, ≥ E[Mistake(T )] = E The proof is thus complete. T " Xt=1 l(ht, BRht(ut), yt) # ≥ T 4 ≥ ∆ 4 * OPT. Remark 5.3. In a related work, Braverman and Garg (2020) showed that introducing randomization in their classification rule can increase the learner's classification accuracy, and the optimal randomized clas- sifier has the structure that agents are better off not manipulating. In case (3) of the proof of Theorem 5.2, we show that even when learners choose such an "optimal" classifier under which agents have no incentive to manipulate, the adversary is still able to impose a high misclassification error. This example shows the limitations of fractional classifiers. 5.3 Upper Bound In this section, we show how to use the idea of Algorithm 2 to obtain upper bounds in the randomized classifiers model. Proposition 5.4. In the free-edges model, Algorithm 2 achieves a mistake bound of Mistake(T ) e(∆ + 2)(ln + OPT). |H| ≤ Proof. To prove this proposition, it suffices to show that if the learner uses deterministic classifiers as a spe- cial case of fractional classifiers, then the free-edges cost model and unweighted graph cost model result in the same best response functions. In fact, in both models, agents manipulate their features if and only if their original nodes are labeled as negative and there exists a neighbor that is labeled as positive. Therefore, the two cost models yield the same best response behaviors to deterministic classifiers. As a result, Algorithm 2 suffers from the mistake bound of e(∆ + 2)(ln + OPT). |H| Now we consider weighted manipulation graphs. In this setting, we can run Algorithm 2 on the expanded manipulation graph ̃G that is an unweighted graph constructed from G by connecting all pairs u, v of vertices 1. As a result, we obtain mistake bound in terms of ̃∆ instead of ∆, where ̃∆ is in G such that Cost(u, v) ≤ the maximum degree of ̃G. 15 Proposition 5.5. Given a weighted manipulation graph G, running Algorithm 2 on the expanded graph ̃G + OPT), where ̃∆ is the maximum degree of achieves a mistake bound of Mistake(T ) ̃G. e( ̃∆ + 2)(ln |H| ≤ Proof. After constructing ̃G, we can see that under any deterministic classifier, a manipulation from u to v happens in the weighted graph G if and only if the same manipulation happens in the unweighted graph ̃G. Therefore, by running Algorithm 2 on ̃G, we obtain a mistake bound in the original manipulation graph G of e( ̃∆ + 2)(ln + OPT), where ̃∆ is the maximum degree of ̃G. |H| 6 Randomized Algorithms In this section, we propose another model of randomization. Unlike the fractional classifiers model discussed in Section 5, we show that this randomized model induces a different type of manipulation behavior, for which success probabilities (fractions) are no longer sufficient to characterize. In this model, the interaction between the classifier, adversary, and agents proceeds as follows: At each round t, the learner commits to a probability distribution ; and promises to use h : { ht ∼ Dt. Based on this mixed strategy Dt (and before the random classifier ht gets realized), the adversary specifies the next agent to be (ut, yt). Then comes the most important step that differentiates this model from the fractional classifiers setting: the learner samples ht ∼ Dt and releases it to the agent, who then best responds to the true ht by modifying its features from ut to vt. The learner aims to minimize the (pseudo) regret with respect to class Dt over a set of deterministic classifiers X → Y} : H E [Regret(T )] , E T " t=1 X l(ht, BRht(ut), yt) # − T min h⋆∈H " t=1 X l(h⋆, BRh⋆(ut), yt) # . (7) We show that, surprisingly, releasing the random choices to the agents can help the learner to surpass OPT) lower bound. In this model, we propose three algorithms that achieve o(T ) regret, which the Ω(∆ does not depend on OPT or ∆. * 6.1 Between bandit and full-information feedback Before presenting our algorithms, we first investigate the feedback information available to the learner at the end of each round. After the agents respond, the learner observes not only the loss of the realized expert (l(ht, BRht(ut), yt)), but also the best response state vt = BRht(ut) and the true label yt. However, because the original state ut is hidden, the losses of other experts l(h′, BRh′(ut), yt) for h′ = ht are not fully observable. For this reason, the feedback structure is potentially richer than bandit feedback, which only contains l(ht, BRht(ut), yt) for the realized expert ht; but sparser than full-information feedback, which contains l(h′, BRh′(ut), yt) for all h′ . Nevertheless, we remark that the learner is capable of going beyond the bandit feedback using the additional information (vt, yt). For instance, if h′ fully agrees with the realized ht on the entire 2-hop neighborhood of vt, then l(h′, BRh′(ut), yt) = l(ht, BRht(ut), yt). Another scenario is when the agent ends up reporting truthfully (ut = vt), so the learner can explicitly calculate the best response BRh′(ut) and the loss l(h′, BRh′(ut), yt) for all h′ . In Section 6.2, we consider a learning algorithm that discards additional information and only uses , bandit feedback, which achieves |H| we propose a generic algorithmic idea that uses an all-positive classifier at random time steps to encourage the truthful reporting of agents. In this way, the learner can obtain full-information feedback on these time steps, which accelerates the learning process. In Section 6.3, we use this idea to achieve regret. To remove the polynomial dependency on T (cid:16)p |H| |H| ln O 2 3 ln (cid:17) T 1 3 ∈ H ∈ H O (cid:16) |H| (cid:17) 16 6 regret against any oblivious adversary. In Appendix A.4, we extend this idea to the general case of adaptive . We also show that this framework could be useful in adversaries and obtain a bound of other strategic settings as well. For example, in Appendix A.5, we apply it to the setting of strategic online linear classification and obtain a mistake bound in terms of the hinge loss of the original examples when the original data points are not linearly separable. 3 4 ln |H| O (cid:17) (cid:16) T e 1 4 6.2 Algorithm based on bandit feedback As a warmup, we show the learner can use the vanilla EXP3 algorithm (Auer et al., 2002), which is a standard multi-armed bandit algorithm, to obtain sublinear regret. This algorithm works by maintaining a distribution over from which classifier ht is sampled, where the weights of each expert are updated according to H pt+1(h) pt(h) exp * ∝ − (cid:18) l(ht, BRht(ut), yt) pt(h) η * 1 { * h = ht} , h ∀ . ∈ H (cid:19) It is known that running EXP3 with learning rate η = see Auer et al. (2002) for a proof. q 2 ln |H| |H|T will achieve a regret bound of O( T ln ), |H| |H| p 6.3 Algorithm based on full-information acceleration 2 3 log 1 3 n T (cid:16) O In this section, we provide an algorithm with regret against oblivious adversaries. An T t=1 before the interaction starts, ir- oblivious adversary is one who chooses the sequence of agents (cid:17) (ut, yt) } { respective of the learner's decisions during the game. Our algorithm (Algorithm 3) uses a reduction from the partial-information model to the full-information model, which is similar in spirit to Awerbuch and Kleinberg (2004) and Blum and Mansour (2007, Chapter 4.6). The main idea is to divide the timeline 1, , T into * * * , and simulate a full- K consecutive blocks B1, , j(T /K) (j } { information online learning algorithm (Hedge) with each block representing a single step. Within each block Bj, our algorithm uses the same distribution over the experts, except that it will also pick one time- Bj uniformly at random, and assigns an all-positive classifier to τj. The intention for this time step τj ∼ step τj is to prevent the agent from manipulations and simultaneously obtain the loss of every expert. This observed loss then serves as an unbiased loss estimate for the average loss over the same block. In the re- mainder of this section, we formally present this algorithm in Algorithm 3 and provide its regret guarantee in Theorem 6.1. , BK , where Bj = 1)(T /K) + 1, * * * * * * − Theorem 6.1. Algorithm 3 with parameter K = T against any oblivious adversary. 2 3 ln 1 3 |H| achieves a regret bound of Proof. For notational convenience, we denote the average loss over block Bj as ̄lj(h) = , where , lt(h) = l(h, BRh(ut), yt). We first claim that for all h, ˆlj(h) = l(h, BRh(vτj ), yτj )1 for each expert h is an unbiased estimator of the average loss ̄lj(h), i.e., Eτj ∼Bj [ˆlj(h)] = ̄lj(h). This is because the algorithm predicts positive on every state at time τj, so the agent reports truthfully (uτj = vτj ), thus ˆlj(h) = l(h, BRh(uτj ), yτj ) = lτj (h) can be observed for any expert h. Since τj is sampled from Bj uniformly at random, we have ∈ H Eτj ∼Bj [ˆlj(h)] = Eτj ∼Bj [lτj (h)] = ̄lj(h). 1Note that here vτj is the best-response to hτj and BRh(vτj ) is the best-response to h when the agent is at location vτj (which we will show is the same as uτj ). 17 2 3 log 1 3 T O (cid:16) Pt∈Bj |Bj| lt(h) |H| (cid:17) ALGORITHM 3: Randomized algorithm against oblivious adversaries 2 1 3 ; T ← |H| K 3 ln Partition the timeline 1, { T K + 1, (j h 0, 1) Bj = Initialize w1(h) (cid:8) for 1 j Sample τj for t * ← K do ∈ Bj do ≤ ≤ − ∀ , T } , j * ; * * * * * * ∈ H into K consecutive blocks B1, T K ; * * * , BK where (cid:9) Bj uniformly at random; ∈ /* Commit to drawing classifier ht ∼ Dt, with Dt defined as follows: */ if t = τj then t puts all weight on a classifier that labels every node as positive; D else t is a distribution over , where pj( * H D end /* Observe agent (vt, yt). */ ) = wj (*) Wj , Wj = h∈H wj(h); P end /* Update the distribution at the end of Bj */ for h wj (h)e−η*ˆlj (h), where ˆlj(h) = l(h, BRh(vτj ), yτj ); ← do ∈ H wj+1(h) end end Since the choice of τj is sampled independently after the distribution pj is chosen, the above claim implies that for any block Bj and any pj: Therefore, inside each block Bj and conditioning on the history before block Bj, the total loss of Algorithm 3 can be bounded as follows: (cid:2) (cid:3) Eh∼pj ̄lj(h) = Eτj Eh∼pj . (8) ˆlj(h) i h E   Xt∈Bj lt(ht)  =1 ̃yτj 6 (cid:8) 1 +  ≤ = yτj + Eh∼pj [lt(h)] Xt∈Bj , t6=τj (cid:9) Eh∼pj [lt(h)] = 1 + Eh∼pj ̄lj(h) , Bj| * | (cid:2) (cid:3) (9) . ˆlj(h) h i 1 and the loss lt is always nonnegative, and (10) is , τK, we obtain (10) Xt∈Bj T K ̃yτj 6 =1 + Eτj Eh∼pj where the inequality (9) is because 1 because of the claim in (8). Summing over K blocks and taking the expectation over τ1, an upper bound of the expected total loss of Algorithm 3: = yτj ≤ (cid:8) (cid:9) * * * T E " lt(ht) # K = E  lt(ht) K +  ≤ Xj=1  From the regret guarantee of Hedge, we have that over the loss sequence ˆl1, Xt∈Bj Xj=1 t=1 X  K T K Eτ1,*** ,τK   Eh∼pj  ˆlj(h) i  , ˆlK, there is h * * * . (11) K Xj=1 Eh∼pj ˆlj(h) i h min h⋆∈H − K Xj=1 18 ˆlj(h⋆) K ln ≤ O (cid:16)p . (12) |H| (cid:17) Therefore, taking the expectation over τ1, , τK, we obtain * * * K Eτ1,*** ,τK  Xj=1  Eh∼pj ˆlj(h) i h  ≤  ≤ Xj=1 K min h⋆∈H Eτ1,*** ,τK   Eτ1,*** ,τK   ̄lj(h⋆)  min h⋆∈H h⋆∈H  K Xj=1 = min Xj=1 K ˆlj(h⋆)  + O K ln |H| (cid:17) (cid:16)p  ˆlj(h⋆)  + O K ln |H| (cid:17) (cid:16)p  K ln + O (cid:16)p |H| . (cid:17) (13) (14)  In the above equations, (13) is due to Jensen's inequality and (14) is from the unbiasedness property es- tablished in Equation (8). Finally, putting Equations (11) and (14) together, and using the definition of the average loss ̄lj, we conclude that  T E " t=1 X lt(ht) K + # ≤ K T K  min h⋆∈H  ̄lj(h⋆)  + O Xj=1  lt(h⋆) + K ln (cid:16)p |H|  (cid:17)   T O ln |H| K ! r + K. = min h⋆∈H K  Xj=1 Xt∈Bj Set K = T 2 3 ln 1 3 , this gives the final regret bound of |H| O T 2/3 ln1/3 (cid:16) 6.4 Discussion on transparency |H| . (cid:17) In the sections above, we have shown that making random choices fully transparent to strategic agents can provably help the learner to achieve sublinear regret. This is in contrast to the fractional model, where we have lower bound examples showing that keeping random choices fully opaque to the agents leads to linear regret. The contrasting results in these two models reveal a fundamental difference between strategic and non-strategic (adversarial) settings: unlike the adversarial setting where learners benefit more from hiding the randomness, in the strategic setting, the learner benefits more from being transparent. At a high level, this is because the relationship between the learner and strategic agents is not completely opposing: instead, the utility of the learner and agents can align to a certain degree. To be more specific, in our online strategic classification setting, there are three effective players in the game: the learner who selects the classification rule, the adversary who chooses the initial features of agents, and the strategic agents who best respond to the classification rule. From the learner's perspective, the only malicious player is the adversary, whereas the agent has a known, controllable best response rule. In the fractional classifiers model, both the adversary and the agents face the same amount of information (which is the set of fractions). Although the opacity can prevent the adversary from selecting worst-case agents that force the learner to err with probability 1 (as in the lower bound examples of 4.6), it also reduces the learner's control of the strategic behavior of agents. As a result, the potentially rich structure of randomness collapses to the set of deterministic fractional values, resulting in the fact that the learner is still forced to make mistakes with a constant probability. On the contrary, in the randomized algorithms model, the learner can increase her own leverage of controlling the agents' best response behavior, and simultaneously reduces the adversary's ability of using the strategic nature of agents to hide information from the learner. Both are achieved by giving the agents more information (i.e., the realized classifiers). In other words, the learner benefits from "colluding" with the 19 agents and competing against the malicious adversary in unity. This idea is demonstrated by Algorithms 3 and 5, where the learner occasionally uses an all-positive classifier to encourage the truthful reporting of agents, thus making the adversary unable to benefit from hiding the true features from the learner. 7 Conclusion and Open Problems |H| In this paper, we studied the problem of online strategic classification under manipulation graphs. We showed fundamental differences between strategic and non-strategic settings in both deterministic and ran- domized models. In the deterministic model, we show that in contrast to the nonstrategic setting where ) bound is achievable by the simple Halving algorithm, in the strategic setting, mistake/regret O(ln bounds are closely characterized by the maximum degree ∆ even when In the random- ized model, we show that unlike the nonstrategic setting where withholding random bits can benefit the learner, in the strategic setting, hiding the random choices has to suffer Ω(∆)-multiplicative regret, whereas revealing the random choices to the strategic agents can provably bypass this barrier. We also design generic deterministic algorithms that achieve O(∆)-multiplicative regret and randomized algorithms that achieve o(T ) regret against both oblivious and adaptive adversaries. = O(∆). |H| Our work suggests several open problems. The first is to design a deterministic algorithm in the realiz- able setting that achieves a mistake bound in terms of generic characteristics of the manipulation graph other ) and lower bound of Ω(∆) are not than the maximum degree. Recall that our upper bound of O(∆ ln matching, so it would be interesting to tighten either the upper or lower bound in this setting. The second open question is to incorporate the graph structure into randomized algorithms and achieve a o(T ) regret bound that depends on the characterizations of the graph, such as the maximum degree. |H| Acknowledgements This work was supported in part by the National Science Foundation under grant CCF-2212968 and grant CCF-2145898, by the Simons Foundation under the Simons Collaboration on the Theory of Algorithmic Fairness, by the Defense Advanced Research Projects Agency under cooperative agreement HR00112020003, by a C3.AI Digital Transformation Institute grant, and a Berkeley AI Research (BAIR) Commons award. The views expressed in this work do not necessarily reflect the position or the policy of the Government and no official endorsement should be inferred. Approved for public release; distribution is unlimited. References Saba Ahmadi, Hedyeh Beyhaghi, Avrim Blum, and Keziah Naggita. The strategic perceptron. In Proceed- ings of the 22nd ACM Conference on Economics and Computation, pages 6–25, 2021. Saba Ahmadi, Hedyeh Beyhaghi, Avrim Blum, and Keziah Naggita. On Classification of Strategic In L. Elisa Celis, editor, 3rd Symposium on Foun- Agents Who Can Both Game and Improve. dations of Responsible Computing (FORC 2022), volume 218 of Leibniz International Proceedings in Informatics (LIPIcs), pages 3:1–3:22, Dagstuhl, Germany, 2022. Schloss Dagstuhl – Leibniz- Zentrum f ̈ur Informatik. doi: 10.4230/LIPIcs.FORC.2022.3. URL https://drops.dagstuhl.de/opus/volltexte/2022/16526. ISBN 978-3-95977-226-6. Tal Alon, Magdalen Dobson, Ariel Procaccia, Inbal Talgam-Cohen, evaluation mechanisms. Multiagent cial https://ojs.aaai.org/index.php/AAAI/article/view/5543. 34(02):1774–1781, Apr. 2020. In Proceedings of Intelligence, doi: and Jamie Tucker-Foltz. the AAAI Conference on Artifi- URL 10.1609/aaai.v34i02.5543. 20 Peter Auer, Nicolo Cesa-Bianchi, Yoav Freund, and Robert E Schapire. The nonstochastic multiarmed bandit problem. SIAM journal on computing, 32(1):48–77, 2002. Baruch Awerbuch and Robert D Kleinberg. Adaptive routing with end-to-end feedback: Distributed learning In Proceedings of the thirty-sixth annual ACM symposium on Theory of and geometric approaches. computing, pages 45–53, 2004. Yahav Bechavod, Katrina Ligett, Steven Wu, and Juba Ziani. Gaming helps! learning from strategic inter- actions in natural dynamics. In International Conference on Artificial Intelligence and Statistics, pages 1234–1242. PMLR, 2021. Yahav Bechavod, Chara Podimata, Steven Wu, and Juba Ziani. Information discrepancy in strategic learning. In International Conference on Machine Learning, pages 1691–1715. PMLR, 2022. Hans-Dieter Block. The perceptron: A model for brain functioning. i. Reviews of Modern Physics, 34(1): 123, 1962. Avrim Blum and Yishay Mansour. Learning, Regret Minimization, and Equilibria, page 79–102. Cambridge University Press, 2007. doi: 10.1017/CBO9780511800481.006. Mark Braverman and Sumegha Garg. The role of randomness and noise in strategic classification. In Proceedings of the 1st Symposium on Foundations of Responsible Computing, FORC 2020, June 1-3, 2020, Harvard University, Cambridge, MA, USA (virtual conference), volume 156 of LIPIcs, pages 9:1– 9:20. Schloss Dagstuhl - Leibniz-Zentrum f ̈ur Informatik, 2020. doi: 10.4230/LIPIcs.FORC.2020.9. URL https://doi.org/10.4230/LIPIcs.FORC.2020.9. Michael Br ̈uckner and Tobias Scheffer. Stackelberg games for adversarial prediction problems. In Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discov- ery and Data Mining, KDD '11, page 547–555, New York, NY, USA, 2011. Association URL for Computing Machinery. https://doi.org/10.1145/2020408.2020495. 10.1145/2020408.2020495. ISBN 9781450308137. doi: Yiling Chen, Yang Liu, and Chara Podimata. Learning strategy-aware linear classifiers. Advances in Neural Information Processing Systems, 33:15265–15276, 2020. In Proceedings of Nilesh Dalvi, Pedro Domingos, Mausam, Sumit Sanghai, and Deepak Verma. Adversarial clas- the Tenth ACM SIGKDD International Conference on Knowledge sification. Discovery and Data Mining, KDD '04, page 99–108, New York, NY, USA, 2004. Associa- tion for Computing Machinery. URL ISBN 1581138881. https://doi.org/10.1145/1014052.1014066. 10.1145/1014052.1014066. doi: Ofer Dekel, Felix Fischer, and Ariel D Procaccia. Incentive compatible regression learning. In Proceedings of the nineteenth annual ACM-SIAM symposium on Discrete algorithms, pages 884–893, 2008. Jinshuo Dong, Aaron Roth, Zachary Schutzman, Bo Waggoner, and Zhiwei Steven Wu. Strategic clas- In Proceedings of the 2018 ACM Conference on Economics and sification from revealed preferences. Computation, pages 55–70, 2018. Alex Frankel and Navin Kartik. Improving information from manipulable data. Journal of the European Economic Association, 20(1):79–115, 2022. Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an applica- tion to boosting. Journal of computer and system sciences, 55(1):119–139, 1997. 21 Ganesh Ghalme, Vineet Nair, Itay Eilat, Inbal Talgam-Cohen, and Nir Rosenfeld. Strategic classification in the dark. In International Conference on Machine Learning, pages 3672–3681. PMLR, 2021. Nika Haghtalab, Nicole Immorlica, Brendan Lucier, and Jack Z. Wang. Maximizing welfare with In Christian Bessiere, editor, Proceedings of the Twenty- incentive-aware evaluation mechanisms. Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, pages 160–166. International Joint Conferences on Artificial Intelligence Organization, 7 2020. doi: 10.24963/ijcai.2020/23. URL https://doi.org/10.24963/ijcai.2020/23. Main track. Nika Haghtalab, Thodoris Lykouris, Sloan Nietert, and Alexander Wei. Learning in stackelberg games with non-myopic agents. In Proceedings of the 23rd ACM Conference on Economics and Computation, pages 917–918, 2022. Moritz Hardt, Nimrod Megiddo, Christos Papadimitriou, and Mary Wootters. Strategic classification. In Proceedings of the 2016 ACM Conference on Innovations in Theoretical Computer Science, ITCS '16, page 111–122, New York, NY, USA, 2016. Association for Computing Machinery. ISBN 9781450340571. doi: 10.1145/2840728.2840730. URL https://doi.org/10.1145/2840728.2840730. Lily Hu, Nicole Immorlica, and Jennifer Wortman Vaughan. The disparate effects of strategic manipula- tion. In Proceedings of the Conference on Fairness, Accountability, and Transparency, FAT* '19, page 259–268, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450361255. doi: 10.1145/3287560.3287597. URL https://doi.org/10.1145/3287560.3287597. Nicole Immorlica, Katrina Ligett, and Juba Ziani. Access to population-level signaling as a source of inequality. In Proceedings of the Conference on Fairness, Accountability, and Transparency, pages 249– 258, 2019. Meena Jagadeesan, Celestine Mendler-D ̈unner, and Moritz Hardt. Alternative microfoundations for strategic classification. In International Conference on Machine Learning, pages 4687–4697. PMLR, 2021. Sampath Kannan, Aaron Roth, and Juba Ziani. Downstream effects of affirmative action. In Proceedings of the Conference on Fairness, Accountability, and Transparency, pages 240–248, 2019. Jon Kleinberg and Manish Raghavan. How do classifiers induce agents to invest effort strategically? doi: 10.1145/3417742. URL ISSN 2167-8375. ACM Trans. Econ. Comput., 8(4), oct 2020. https://doi.org/10.1145/3417742. Tosca Lechner and Ruth Urner. Learning losses for strategic classification. Conference on Artificial Intelligence, volume 36, pages 7337–7344, 2022. In Proceedings of the AAAI Sagi Levanon and Nir Rosenfeld. Strategic classification made practical. In International Conference on Machine Learning, pages 6243–6253. PMLR, 2021. H Brendan McMahan and Avrim Blum. Online geometric optimization in the bandit setting against an In Learning Theory: 17th Annual Conference on Learning Theory, COLT 2004, adaptive adversary. Banff, Canada, July 1-4, 2004. Proceedings 17, pages 109–123. Springer, 2004. Smitha Milli, John Miller, Anca D. Dragan, and Moritz Hardt. The social cost of strategic classification. In Proceedings of the Conference on Fairness, Accountability, and Transparency, FAT* '19, page 230–239, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450361255. doi: 10.1145/ 3287560.3287576. URL https://doi.org/10.1145/3287560.3287576. 22 Juan Perdomo, Tijana Zrnic, Celestine Mendler-D ̈unner, and Moritz Hardt. Performative prediction. In Hal Daum ́e III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 7599–7609. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/perdomo20a.html. Yonadav Shavit, Benjamin Edelman, and Brian Axelrod. Causal strategic linear regression. In Hal Daum ́e III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 8676–8686. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/shavit20a.html. Ravi Sundaram, Anil Vullikanti, Haifeng Xu, and Fan Yao. Pac-learning for strategic classification. In International Conference on Machine Learning, pages 9978–9988. PMLR, 2021. Hanrui Zhang and Vincent Conitzer. Incentive-aware pac learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 5797–5804, 2021. Tijana Zrnic, Eric Mazumdar, Shankar Sastry, and Michael Jordan. Who leads and who follows in strategic classification? Advances in Neural Information Processing Systems, 34:15257–15269, 2021. A Supplementary Materials A.1 Proof of Theorem 4.5 Theorem 4.5 (Restated). Algorithm 2 makes at most e(∆ + 2)(ln sary. |H| + OPT) mistakes against any adver- (cid:0) (cid:1) Proof. To begin with, we show that if a mistake is made in round t, then the weights get updated such that . Moreover, the algorithm penalizes an expert only if it made a mistake. In Wt+1 ≤ other words, the algorithm never over-penalizes experts who do not make a mistake. γ/(∆ + 2) Wt − 1 (cid:1) (cid:0) 1 Wt γ/(∆ + 2) First, suppose a mistake is made on a true negative. In this case, vt is labeled as positive by ht, so the total weight of experts predicting positive on vt is at least Wt/(∆+2), and each of their weights is decreased . Moreover, for each classifier h that gets by a factor of γ. As a result, we have Wt+1 ≤ − penalized, we have h(vt) = +1, so vt belongs to the positive region Sh, which implies that the initial node N [vt] is able to reach the positive region Sh. Therefore, our previous observation indicates that ut ut ∈ would have ended up being predicted as positive had it best responded to h, so h had also made a mistake. Next, consider the case of making a mistake on a true positive. Similar to the proof of 4.5, we argue that the agent has not moved from a different location to vt to get classified as negative, so vt = ut. Since the agent did not move, none of the vertices in N [vt] was labeled positive by the algorithm, implying that for N [vt], weights of experts labeling x as positive is less than Wt/(∆ + 2). Therefore, taking the each x union of all x N [vt], we conclude that the total weight of experts predicting negative on all x N [vt] = Wt/(∆ + 2). All these experts are making a mistake as vt = ut is at least Wt cannot reach the positive region of any of these experts, so they all end up classifying agent ut as negative. (cid:17) As a result, the algorithm cuts their weight by a factor of γ, resulting in Wt+1 ≤ Let M = Mistake(T ) denote the number of mistakes made by the algorithm. Since the initial weights on each are all set to 1, we have W0 = (γWt)/(∆ + 2). (∆ + 1)/(∆ + 2) . Together with the property that Wt+1 ≤ Wt − γ ∆+2 Wt ∈ 1 − − ∈ ∈ (cid:16) 1 (cid:16) (cid:17) mistake, we have WT ≤ |H| 1 (cid:16) − |H| γ ∆+2 M . (cid:17) 23 Now we show that WT ≥ γOPT. We have proved that whenever the algorithm decreases the weight of an expert, they must have made a mistake. However, it can be the case that an expert makes a mistake, but the algorithm does not detect that. In other words, the algorithm may under-penalize an expert, but it would never over-penalize. Let h⋆ denote the best expert that achieves the minimum number of mistakes ∈ H OPT. Suppose the algorithm detects q of the rounds where h⋆ makes a mistake, then we have q OPT. Therefore, after T rounds, WT ≥ 1. Finally, we have: γOPT, since 0 wT (h⋆) = γq ≤ ≥ ≤ ≤ γ OPT γ OPT M ≤ ⇒ ⇒ ≤ WT ≤ |H| ln ln γ 1 − (cid:18) + M ln γ ∆ + 2 (cid:19) 1 * ≤ ∆ + 2 γ ln |H| |H| − − (cid:16) ln γ(∆ + 2) γ M γ ∆ + 2 OPT ln ≤ |H| − M γ ∆ + 2 (cid:17) By setting γ = 1/e, we bound the total number of mistakes as M e(∆ + 2)(ln + OPT). |H| ≤ A.2 Improving the Upper Bound In this section, we propose a pre-processing step to improve the mistake bound of Algorithm 1 in some cases, depending on the structure of the underlying manipulation graph. We leave it open to get a general mistake bound that depends on other characteristics of the manipulation graph besides the maximum degree. Consider the case where the manipulation graph G( , H = 2|X |. However, Proposition A.1 shows that all the examples includes all possible labelings of (ut, yt) arriving over time get labeled the same: either all positive or all negative. Therefore, the size of the effective hypothesis class is 2. ) is a complete graph, and the hypothesis class , i.e. |H| X X E Proposition A.1. If the manipulation graph G( arriving over time are labeled the same, i.e. all positive or all negative. X E , ) is a complete undirected graph, then all the examples Proof. Consider a hypothesis h that labels at least one node v as positive. Then any example ut arriving at time-step t can reach v and get classified as positive. Hence, h classifies all the examples as positive. On the other hand, if h labels all the nodes v as negative, then it would classify all the examples arriving over time as negative. ∈ X ∈ X Algorithm 1 has a mistake bound of ) in the realizable case. However, when the manipula- tion graph is complete, we can get a mistake bound of 1 as follows: initially starting with an all-positive classifier, if a mistake happens, switch to an all-negative classifier. The case of complete graphs shows that depending on the underlying manipulation graph, there can be a large gap between the upper bound given by Algorithm 1 and the best achievable bound. Algorithm 4 is a pre-processing step to improve this gap. (∆ ln |H| O Algorithm 4 initially starts with an all-positive classifier. When the first mistake happens on a node vt, it means that vt and all its neighbors need to be classified as negative. Hence, we exclude all the hypothesis , we run Algorithm 1 on the h ∈ H H ′. We now restate the guarantee of Algorithm 4 that we presented in Theorem 4.4, and show its new set proof. N [vt] as positive from that classify any node v . After filtering H H ∈ Theorem 4.4 (Restated). Algorithm 4 makes at most min ). where n = and δ is the minimum degree of G( , n { − δ, 1 + ∆ ln min { * , n |H| δ 1 }} − − mistakes, |X | X E 24 ALGORITHM 4: A pre-processing step to improve the mistake bound of Algorithm 1 Input for t = 1, ), hypothesis class , E , T do :G( H X * * * Commit to ht that labels all nodes as positive; /* Observe (vt, yt) */ = ht(vt) then if yt /* when the first mistake happens, remove all the hypotheses that make a mistake */ ′ H Break; ← H \ { end h : v ∃ ∈ N [vt], h(v) = +1 ; } end Run Algorithm 1 on (G, ′); H Proof. After the first mistake happens on vt, Algorithm 4 only keeps the hypotheses that label all the nodes δ + 1, the number of such hypotheses is at most 2n−(δ+1). Therefore, in N [vt] as negative. Since the filtered-out hypothesis set . Therefore, the number of mistakes } H that Algorithm 1 makes on the filtered hypothesis set is at most: ≥ ′ satisfies (cid:12) (cid:12) , 2n−δ−1 N [vt] {|H| min | ≤ |H (cid:12) (cid:12) ′ 1 + ∆ ln( * Suppose that n ′ ) | ≤ |H δ < 1 + ∆ 1 + ∆ * ln min { , n − of N [vt] get flipped, for the remaining graph G \ mistake is observed. Therefore, the total number of mistakes is at most: . After the first mistake happens on vt and the labels 1 − } N [vt], the labels can get flipped one by one whenever a |H| − δ * ln min { , ln(2n−δ−1) = 1 + ∆ |H| min ln { * , n |H| δ 1 } − − min n { − δ, 1 + ∆ min ln { * , n |H| δ 1 }} − − Remark A.2. When the manipulation graph is dense, the mistake bound in Theorem 4.4 can greatly outper- form that given in Theorem 4.3. For instance, in complete graphs where both the minimum degree and the 1, Theorem 4.4 guarantees that Algorithm 4 makes at most one mistake, whereas maximum degree are n Algorithm 1 could end up making n mistakes in total, one on each vertex. − A.3 Extension of the Deterministic Model to Directed Manipulation Graphs Suppose that the manipulation graph G( ) is a directed graph. We show how to modify Algorithms 1 and 2 to work in the case of directed manipulation graphs and get a regret bound that depends on ∆out instead of ∆, where ∆out is the maximum out-degree of all the nodes v X E , . ∈ X Proposition A.3. In the realizable case, Algorithm 1 can be modified to make at most (∆out + 2) ln mistakes. |H| Proof. First, we need to change the threshold of the majority vote for classifying a node as positive from 1/(∆ + 2) to 1/(∆out + 2). Now, if a mistake on a true negative happens, then 1/(∆out + 2) of the remaining hypotheses gets discarded, which are the set of experts that predict the observable node as positive. On the other hand, if a mistake on a true positive happens, it means that the agent was classified as negative and did not move. Therefore, all the nodes in the reachable out-neighborhood were classified as negative by the algorithm. The number of reachable nodes from the starting node is at most ∆out + 1, and for each of them. experts classified them as positive. Therefore, a total of less than (1/(∆out + 2)) 1 |H| 25 |H| − (cid:16) 6 remaining hypotheses are classifying the entire reachable (∆out + 1)/(∆out + 2) set as negative, and they are all making a mistake. As a result, whenever a mistake happens, 1/(∆out + 2) fraction of the hypotheses can get discarded. This results in a mistake bound of (∆ + 2) ln = (1/(∆out + 2)) |H| (cid:17) . |H| Similarly, we can show that Algorithm 2 can be modified to get a mistake bound that depends on ∆out instead of ∆, as shown in the following proposition. Proposition A.4. In the unrealizable case, Algorithm 2 can be modified to make at most e(∆out +2)(ln OPT) mistakes. + |H| A.4 Regret bound of O T 3 4 ln 1 4 (cid:16) |H| (cid:17) against an adaptive adversary In this section, we present an algorithm (Algorithm 5) based on the idea of full-information acceleration, e against general adaptive adversaries in Theorem A.5. The and prove a regret bound of proof of this theorem requires a more careful analysis of the difference between the estimated loss se- quence and the actual loss sequence using martingale difference sequences, which borrows similar ideas from McMahan and Blum (2004). 3 4 ln |H| O (cid:17) (cid:16) T e 1 4 ALGORITHM 5: Randomized algorithm against adaptive adversaries Initialize w1(h) 0, h ; ∀ ← Initialize step size η Let h+ be an all-positive classifier; for t ∈ H 8 ln |H| T [T ] do ← q , exploration coefficient γ T − 1 4 ln 1 4 (T ); |H| ← ∈ /* Commit to a distribution Dt defined as follows, then draw classifier ht ∼ Dt */ for Let specified by probabilities pt(h+) = γ, and pt(h) = (1 h+ γ) wt(h) Wt − t be a distribution over , where Wt = D all h ∈ H H ∪ { } h′∈H wt(h′); */ /* Observe agent (vt, yt). /* Construct an estimated loss vector and use it to update the weights: */ for h P do ∈ H ˆlt(h) ← wt+1(h) ht=h+ l(h,BRh(vt),yt)*1 { γ wt(h)e−η*ˆlt(h). ← ; } end end Theorem A.5. Algorithm 5 achieves a regret of against any adaptive adversary. 3 4 ln 1 4 T O |H| (cid:16) Proof. Similar to the proof of Theorem 6.1, we first show that at every round t and for all experts h , e ∈ H ˆlt(h) is an unbiased estimate of lt(h), where lt(h) = l(h, BRh(ut), yt) is the true loss of h. Since we are dealing with adaptive adversaries, we show that for every h is a Martingale Difference Sequence: let Ft denote the σ-algebra generated by the randomness up to time t, then ˆlt(h) lt(h) ∈ H t=1 − (cid:17) (cid:16) (cid:17) T , E ˆlt(h) h − lt(h) (cid:12) (cid:12) (cid:12) Ft−1 i =E γ (cid:20) l(h, BRh(vt), yt) γ * − l(h, BRh(ut), yt) = 0. (15) Ft−1 (cid:21) Here, the first equality is because ˆlt 6 = 0 only when ht = h+ is an all-positive classifier, which happens with probability γ. The second equality is because the agent would not move under h+, resulting in ut = vt. (cid:12) (cid:12) (cid:12) (cid:12) 26 Moreover, from the definition of ˆlt, the term ˆlt(h) − calculate the expected cumulative loss of Algorithm 5. lt(h) is bounded in absolute value by 1 γ . Now we T E " Xt=1 lt(ht) # =E =E E ≤ T " Xt=1 T " t=1 X T " t=1 X E [lt(ht) |Ft−1] # 1 { * yt 6 = 1 } + (1 γ) * − E h∼ wt(*) Wt E γ (cid:20) γ + Eh∼p′ t [lt(h)] , # [lt(h)] Ft−1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:21)# t(h) , wt(h) Wt where p′ , h ∀ ; ∈ H =γT + E T " Xt=1 Eh∼p′ t + E ˆlt(h) i h # T " Xt=1 Eh∼p′ t lt(h) h − . ˆlt(h) i # (16) (17) (18) In the above equations, Equation (16) is from the tower property of conditional expectations, Equation (17) is because 1 1, where we also use the tower property to remove the conditional { expectations. Finally, Equation (18) is because we add and subtract the second term. 1 and 1 yt 6 } ≤ = 1 − ≤ γ Now, for the third term in (18), note that p′ t is defined on a martingale difference sequence with respect to the filtration ( term is always zero: Ft−1, so Ft)T Eh∼p′ lt(h) ˆlt(h) t − t=1. Again, from the tower property, this i(cid:17) t=1 (cid:16) h T is also T Eh∼p′ t lt(h) E " − ˆlt(h) i # T = E " h t=1 X T are exactly the same as the strategies generated by running Hedge on the estimated loss , ˆlT , and the magnitude of the losses are all bounded by 1 γ , we have the following regret t=1 X ii (cid:12) (cid:12) (cid:12) h h , p′ Since p′ 1, * * * sequence ˆl1, guarantee from Freund and Schapire (1997): * * * E Eh∼p′ t lt(h) ˆlt(h) − Ft−1 # = 0. (19) T E " t=1 X Eh∼p′ t ˆlt(h) h i min h⋆∈H − T t=1 X ˆlt(h⋆) 1 γ T ln . |H| (cid:19) # ≤ O (cid:18) p Putting Equations (18) to (20) together gives us the bound on expected loss: T E " Xt=1 lt(ht) # ≤ E min h⋆∈H " T Xt=1 ˆlt(h⋆) # + O (cid:18) γT + 1 γ p T ln . |H| (cid:19) We define [OPT , min h⋆∈H ˆlt(h⋆), T t=1 X (20) (21) then the above inequality (21) implies E[Regret] = E T " t=1 X lt(ht) − OPT # ≤ − OPT + i γT + O (cid:18) 1 γ p T ln . |H| (cid:19) (22) [OPT E h 27 Now, the last step is to bound the expected difference between [OPT and the true optimal OPT = minh⋆∈H lt(h⋆). We have: [OPT E h − OPT = E i min ˆh max h " T t=1 X ˆlt(ˆh) − lt(h) # ≤ E max h∈H " T t=1 X ˆlt(h) . lt(h) # − Since t=1 inequality together with the union bound to obtain lt(h) − ˆlt(h) (cid:16) (cid:17) T is a martingale difference sequence for any fixed h, we use Azuma-Hoeffding Pr max h∈H " T t=1 X ˆlt(h) lt(h) − ≥ 1 γ s 2T ln 1 δ (cid:18) (cid:19)# ≤ δ . |H| Setting δ = 1 T |H| gives us [OPT E h OPT − i E max h∈H " ≤ T Xt=1 ˆlt(h) − lt(h) # ≤ 1 γ s 2T ln 1 δ (cid:18) (cid:19) + δ T |H| * ≤ O (cid:18) 1 γ p 2T ln (T . ) |H| (cid:19) (23) Finally, by putting Equations (22) and (23) together, and setting γ = T − 1 regret bound: 4 ln 1 4 (T ), we derive the desired |H| E[Regret] = E T " t=1 X lt(ht) − OPT # ≤ O 3 4 ln 1 4 (T T (cid:16) . ) |H| (cid:17) A.5 Strategic online linear classification In this section, we propose an algorithm for the problem of online linear classification in the presence of strategic behavior. In this setting, each original example zt can move for an l2 distance of at most α and reach a new observable state xt; and the examples would move for a minimum distance that results in a positive classification. Ahmadi et al. (2021) propose an algorithm for the case that original examples are linearly separable; in the case of inseparable examples, they get a mistake bound in terms of the hinge loss of manipulated examples, and leave it as an open problem to obtain a mistake bound in terms of the hinge-loss of original examples. In this section, we propose an algorithm for the inseparable case that obtains a bound in terms of the (√T ) additive term com- hinge-loss of original examples. However, our mistake bound has an additional pared to the bound obtained by Ahmadi et al. (2021) in the separable case. The idea behind this algorithm is to use an all-positive classifier at random time steps to observe the un-manipulated examples. Using the un-manipulated examples, the standard Perceptron algorithm suffices to deal with inseparable data. For sim- plicity, we present the algorithm for oblivious adversaries and remark that a similar bound could be obtained for the case of adaptive adversaries using similar techniques as in Appendix A.4. O Theorem A.6. Let S = Algorithm 6 with parameter K = √T R (zt, yt) T t=1 be the set of original data points, where maxt | } { zt| ≤ satisfies w⋆ k k E [Mistake(T )] ≤ 2Lhinge(w⋆, S) + 2√T R w⋆ k , k 28 R. For any w⋆, (24) ALGORITHM 6: Algorithm for online linear strategic classification when original examples are inseparable , T into K consecutive blocks B1, * * * * * * , BK where Bj = [ (j−1)T K + 1, jT K ]; 0; Partition the timeline 1, Initialize w1 ← [K] do for j ∈ Sample τj for t ∈ Bj do ∈ if t = τj then Bj uniformly at random; Use classifier ht else Use classifier ht ← ← h+, where h+(x) = +1 x; ∀ hj, where hj(x) = sgn wT x j |wj | − α ; (cid:19) (cid:18) end /* Observe example (xt, yt) */ end if yτj 6 end = hτj (xτj ) then wj + yτj wj+1 ← xτj ; end where the hinge loss is defined as Lhinge(w⋆, S) , max 0, 1 yt(zT t w⋆) . − X(zt,yt)∈S o to denote the loss of classifier h had agent (zt, yt) best re- n Proof. We use lt(h) = 1 { sponded to h. yt 6 = h(BRh(zt) } yτj 6 In each block Bj, we have l(hτj ) = 1 1 on the all-positive step τj. On the other steps = τj, since hj is obtained by shifting the boundary wj by α, an agent (xt) can reach the positive region (cid:9) t of hj if and only if its original features (zt) have a nonnegative dot product with wj. Thus we have = +1 ≤ (cid:8) lt(hj) = 1 hj(xt) = yt = 1 sgn ( wT xt j wj| | = yt α ! 6 − ) = 1 sgn ( wT zt j wj| ! 6 | = yt ) = 1 sgn wT j zt = yt . n (cid:16) (cid:17) o (cid:8) (cid:9) As a result, we can bound the number of mistakes as follows: K K E [Mistake(T )] =E  Xj=1 Xt∈Bj K  =K + lt(ht)  E ≤   sgn 1  wT j zt Xj=1 lt(hj)     Xt∈Bj 1 +   = yt Xj=1 Xt∈Bj K T K Xj=1 K + ≤ n (cid:16) (cid:17) o Eτj ∼Bj 1 sgn wT j zτj = yτj , (25) (cid:17) where the last step is because τj is sampled uniformly at random from Bj. n (cid:16) o Note that w1, , wK is obtained from running the standard Perceptron algorithm on examples Sτ , , (xτK , yτK ) (xτ1 , yτ1), . Since at each τj, the learner uses an all-positive classifier to stop the agents { } from moving, we have xτj = zτj , and Sτ = , (zτK , yτK ) . From Block (1962), we have } (zτ1 , yτ1), { * * * * * * * * * K 1 sgn wT j zτj = yτj Xj=1 n (cid:16) (cid:17) o R2 w⋆ k 2 + 2Lhinge(w⋆, Sτ ). k ≤ 29 6 6 6 6 6 6 Taking the expectation over τ1, algorithm: * * * , τK, we have the following mistake bound on the standard perceptron T K K Xj=1 Eτj ∼Bj 1 sgn wT j zτj = yτj n (cid:16) (cid:17) o T K T K T K T K ≤ = = = R2 w⋆ k 2 + 2 k R2 w⋆ k 2 + 2 k K Xj=1 K Xj=1 T K T K K Eτj ∼Bj Lhinge(w⋆, (zτj , yτj )) 1 Lhinge(w⋆, (zt, yt)) | Bj| Xt∈Bj Lhinge(w⋆, (zt, yt)) R2 w⋆ k R2 w⋆ k 2 + 2 k Xj=1 Xt∈Bj 2 + 2Lhinge(w⋆, S). k (26) (27) (28) In the above inequalities, Equation (26) follows from the fact that τj is distributed uniformly at random in block Bj, and Equation (27) is because every block has size Now we plug Equation (28) back into (25) and obtain = T K . Bj| | E [Mistake(T )] K + ≤ T K R2 w⋆ k 2 + 2Lhinge(w⋆, S). k Finally, letting K = √T R w⋆ k k yields the desired bound. A.6 Two populations In this section, we study extensions of the unit-edge cost function in our baseline model. We assume there are two populations with different manipulation costs: agents of group A face a cost of 0.5 on each edge, whereas agents of group B face a cost of 1. As a result, in response to deterministic classifiers, agents from group A move within their two-hop distance neighborhood, whereas agents from group B only move inside their one-hop distance neighborhood. We suppose each agent has fixed probabilities of belonging to each group, regardless of the initial posi- tion and the label chosen by the adversary. In other words, at every round t, after the adversary picks the next agent (ut, yt), we assume nature independently assigns this agent to group ct = B with probability β β. The agent's best response to classifier ht is a function of ut and ct: and ct = A with probability α = 1 − BRht(ut, ct) , vt ∈   arg maxv∈X Value(ht(v)) arg maxv∈X h Value(ht(v)) h − − , CostA(ut, v) i CostB(ut, v) i if ct = A , if ct = B. As a result of manipulation, the learner suffers loss l(ht, vt, yt) = l(ht, BRht(ut, ct), yt) and observes (vt, yt) together with group membership ct. The learner's goal is to bound the expected number of mistakes in terms of the optimal number of mistakes in expectation, where the expectations are taken over the random group assignments and the possible randomness in the learning algorithm and the adversary's choices.  T T E[Mistake(T )] = E " l(ht, BRht(ut, ct), yt) # , E[OPT] = min h∈H E " l(h, BRh(ut, ct), yt) # . t=1 X t=1 X We propose Algorithm 7 that is based on the idea of biased weighted majority vote (Algorithm 2), with a group-independent threshold for the biased majority votes, and a group-dependent way of penalizing experts. We state the mistake bound guarantee in Theorem A.7. 30 6 :G( ALGORITHM 7: Biased weighted majority-vote algorithm for two populations. Input X Set initial weights w1(h) Set discount factor γ = 1 1 for all experts h ← e , threshold θ = max 1 ∆2+2 ; ∈ H 1 ∆+1+ 1 β H ), E ; , , for t = 1, 2, do n o /* The learner commits to a classifier ht that is constructed as follows: */ for v h∈H:h(v)=+1 wt(h), W − t (v) = Wt then θ P * +1; t (v) ht(v) t (v) = h∈H:h(v)=−1 wt(h), and Wt = W + t (v) + W − t (v); P * * * ∈ V do Let W + if W + ≥ ← else end ht(v) 1; ← − end /* Unlabeled example vt is observed. */ output prediction ht(vt); /* The true label yt and group membership ct are observed */ /* If there was a mistake: */ if ht(vt) = yt then if ht(vt) = +1 then for all h ∈ H else : h(vt) = +1, wt+1(h) γ * ← wt(h); // false positive if ct = A then ′ h H ← { ∈ H ′ H h ← { ∈ H ′, wt+1(h) ∈ H else end If h end end end : : x ∀ x ∀ ∈ ∈ γ * ← N 2[vt], h(x) = 1 ; } − N [vt], h(x) = 1 } − // N 2[*] is the 2-hop neighborhood wt(h), otherwise wt+1(h) wt(h).; ← // false negative Theorem A.7. In the setting of two populations and population B has probability β, Algorithm 7 achieves an expected mistake bound of the following: E[Mistake(T )] e * ≤ min ∆ + 1 + (cid:26) 1 β , ∆2 + 2 (ln (cid:27) + E[OPT]) . |H| Remark A.8. In Theorem A.7, when all agents can make two hops (i.e., β = 0), the mistake bound re- duces to the guarantee provided Theorem 4.5 with ∆2 as the maximum degree. In this case, Algorithm 7 is G in which every two nodes of equivalent with Algorithm 2 running on the expanded neighborhood graph distance at most two are connected by an edge. Here, ∆2 is an upper bound on the maximum degree of G.In contrast, when all agents can only make one hop (i.e., β = 1), the problem reduces to the baseline model, and Theorem A.7's guarantee becomes the same as that of Theorem 4.5 with the same set of parameters. For values of β between 0 and 1, the mistake bound smoothly interpolates the guarantees of the two extreme cases. e e Proof of Theorem A.7. We show that whenever a mistake is made, we can reduce the total weight of experts (Wt) by a constant fraction in expectation. First, consider the case of a false positive. Since ht(vt) = +1, the total weight of experts that predict Ft be the positive on vt is at least θWt ; and the weight of each of them gets reduced by a factor of λ. Let 31 6 σ-algebra generated by the random variables up to time t, then we have E[Wt+1 | Ft−1, false positive] ≤ Next, consider the case of a false negative. Since ht(vt) = 1, we know that the agent did not move, i.e., vt = ut. The algorithm updates as follows: if ct = B, it reduces the weight of experts who predict negative on all the nodes in the one-hop neighborhood of vt, i.e., N [vt]. if ct = A, then it reduces the weight of experts who predict negative on all the nodes in the two-hop neighborhood of vt, i.e., N 2[vt]. We claim that: − Wt(1 λθ). − (29) Pr(ct = B | Ft−1, false negative) β Pr(ct = B | Ft−1, false negative) ⇒ Pr(ct = A ≥ ≥ β. | Ft−1, false negative) 1 β − To see this, we can use the Bayes law to calculate the conditional probability of group assignments: for X A, B ∈ { , we have } Pr(ct = X | Ft−1, false negative) = Pr(false negative | Ft−1, ct = X) Pr(false negative * | Ft−1) Pr(ct = X | Ft−1) . (30) Since the group membership ct is independently realized after the adversary chooses (ut, yt), we have Pr(ct = B | Ft−1, false negative) 1 β − = Pr(false negative | Ft−1) (cid:16) Pr(false negative 1 β − | Ft−1, ct = B) Pr(ct = A | Ft−1, false negative) Pr(false negative − | Ft−1, ct = A) (cid:17) 0, ≥ where the last step is because agents of population A have more manipulation power, so under every possible classifier, group A is able to get classified as positive whenever group B is; therefore, group A agents are less likely to become false negative. We have thus established the claim. Now we turn to the total weight that is reduced in this scenario. If ct = A, then there are at most (∆2 + 1) nodes in the two-hop neighborhood, in which all of them are predicted negative. Therefore, the θ(∆2 + 1))+. On the other total weight of experts who predict negative on all of them is at least Wt(1 hand, if ct = B, then the total weight of experts who predict negative on the one-hop neighborhood is at least Wt(1 θ(∆ + 1))+. Putting the two cases together and conditioning on the false negative, the total weight that can be reduced is at least − − Pr(ct = B false negative, | + Pr(ct = A * (1 Ft−1) (∆ + 1)θ)+ − false negative, Ft−1) (∆2 + 1)θ)+ (1 * , − | max β(1 ≥ − (∆ + 1)θ)+, (1 − (∆2 + 1)θ)+ (31) (cid:8) where the first term in (31) is due to the claim we just established, and the second term follows from (1 Ft−1) + Pr(ct = A (∆2 + 1)θ)+ together with Pr(ct = B (∆ + 1)θ)+ ≥ − false negative, | E[Wt+1 | Ft−1, false negative] Ft−1) = 1. From Equation (31), we obtain β(1 Wt − (∆ + 1)θ)+, (1 − (∆2 + 1)θ)+ . (32) false negative, max (1 − − ≤ (cid:9) λ 1 * | Finally, we optimize the threshold θ to equalize the decrease in the case of false positive (Equation (29)) and false negative (Equation (32)). As a result, the optimal θ is obtained by solving the following equation: (cid:9)(cid:1) (cid:8) (cid:0) (∆ + 1)θ) , 1 θ f (θ) |{z} = max   β(1 − |  f1(θ) {z 32 (∆2 + 1)θ − f2(θ) . , 0  } | {z }  Since f, f1, and f2 are all linear functions where f1, f2 have a negative slope and f has a positive slope, coincides with the maximum value between the intersection the intersection between f and max of . Moreover, θ = 0 is not a valid solution because the other two intersections have strictly positive values. Thus we obtain f1, f2} { f, f2} { and the intersection of f, f1} { θ , max 1 ∆ + 1 + 1 β , 1 ∆2 + 2 ) . ( Correspondingly, on each mistake, the optimal amount of decrease in the total weight is Wt+1 Wt E (cid:20) Ft−1, mistake min 1 ( ≤ (cid:21) λ ∆ + 1 + 1 β − , 1 − λ ∆2 + 2 ) . (cid:12) (cid:12) (cid:12) (cid:12) By Jensen's inequality, we further obtain that if a mistake is made at time t, then Wt+1 Wt E ln (cid:20) (cid:12) (cid:12) (cid:12) (cid:12) Ft−1, mistake ln E Wt+1 Wt (cid:20) ln min 1 ( ≤ (cid:21) ≤ Ft−1, mistake λ ∆ + 1 + 1 β , 1 (cid:21) (cid:12) (cid:12) (cid:12) (cid:12) − λ − ∆2 + 2 )! . (33) The last step is to telescope Equation (33) over all mistakes. Note that the algorithm only penalizes the γOPT. Thus we have experts that make mistakes, so the same argument as Theorem 4.5 implies that WT ≥ λ ∆ + 1 + 1 β E[ln WT − E[Mistake(T )] ∆2 + 2 )! ] |H| ] |H| E[ln(γ 1 ( min , 1 OPT ln ln ln ≤ − − − ≤ λ ) * . Rearranging the above inequality, setting λ = 1/e and using ln(1 mistake bound of x) − ≤ − x gives us an expected E[Mistake(T )] e * ≤ min ∆ + 1 + (cid:26) 1 β , ∆2 + 2 (ln (cid:27) + E[OPT]) . |H| This completes the proof. 33
http://arxiv.org/abs/2302.12351v1
2023-02-23T22:15:20
2023-02-23T22:15:20
On the Hardness of Robustness Transfer: A Perspective from Rademacher Complexity over Symmetric Difference Hypothesis Space
Recent studies demonstrated that the adversarially robust learning under $\ell_\infty$ attack is harder to generalize to different domains than standard domain adaptation. How to transfer robustness across different domains has been a key question in domain adaptation field. To investigate the fundamental difficulty behind adversarially robust domain adaptation (or robustness transfer), we propose to analyze a key complexity measure that controls the cross-domain generalization: the adversarial Rademacher complexity over {\em symmetric difference hypothesis space} $\mathcal{H} \Delta \mathcal{H}$. For linear models, we show that adversarial version of this complexity is always greater than the non-adversarial one, which reveals the intrinsic hardness of adversarially robust domain adaptation. We also establish upper bounds on this complexity measure. Then we extend them to the ReLU neural network class by upper bounding the adversarial Rademacher complexity in the binary classification setting. Finally, even though the robust domain adaptation is provably harder, we do find positive relation between robust learning and standard domain adaptation. We explain \emph{how adversarial training helps domain adaptation in terms of standard risk}. We believe our results initiate the study of the generalization theory of adversarially robust domain adaptation, and could shed lights on distributed adversarially robust learning from heterogeneous sources, e.g., federated learning scenario.
[ "Yuyang Deng", "Nidham Gazagnadou", "Junyuan Hong", "Mehrdad Mahdavi", "Lingjuan Lyu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12351v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12351v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 1 5 3 2 1 . 2 0 3 2 : v i X r a On the Hardness of Robustness Transfer: A Perspective from Rademacher Complexity over Symmetric Difference Hypothesis Space Yuyang Deng∗ † & Mehrdad Mahdavi The Pennsylvania State University {yzd82,mzm616}@psu.edu Junyuan Hong Michigan State University [email protected] Nidham Gazagnadou∗ & Lingjuan Lyu Sony AI {nidham.gazagnadou,lingjuan.lv}@sony.com Abstract Recent studies demonstrated that the adversarially robust learning under (cid:96)∞ attack is harder to generalize to different domains than standard domain adaptation. How to transfer robustness across different domains has been a key question in domain adaptation field. To investigate the fundamental difficulty behind adversarially robust domain adaptation (or robustness transfer), we propose to analyze a key complexity measure that controls the cross-domain generalization: the adversarial Rademacher complexity over symmetric difference hypothesis space H∆H. For linear models, we show that adversarial version of this complexity is always greater than the non-adversarial one, which reveals the intrinsic hardness of adversarially robust domain adaptation. We also establish upper bounds on this complexity measure. Then we extend them to the ReLU neural network class by upper bounding the adversarial Rademacher complexity in the binary classification setting. Finally, even though the robust domain adaptation is provably harder, we do find positive relation between robust learning and standard domain adaptation. We explain how adversarial training helps domain adaptation in terms of standard risk. We believe our results initiate the study of the generalization theory of adversarially robust domain adaptation, and could shed lights on distributed adversarially robust learning from heterogeneous sources, e.g., federated learning scenario. 1 Introduction Domain adaptation is a key learning scenario where one tries to generalize the model learnt on a source domain to a target domain. How to predict target accuracy using source accuracy has been a longstanding research topic in both theory [3, 30, 2, 23, 4, 37, 38] and application community [21, 31, 36]. From a theoretical perspective, this problem can be attacked by establishing bounds on the generalization of the source-domain-learnt model on target domain, using different complexity measures including the VC-dimension [3, 2, 38] and Rademacher complexity [23, 37]. In particular, the latter works [23, 37] study a loss class defined over symmetric difference hypothesis space (H∆H class for short): Definition 1 (Loss class over symmetric difference hypothesis space). Given a symmetric loss function (cid:96)(*, *) : Y × Y (cid:55)→ R and a hypothesis class H = {hw : X (cid:55)→ Y}, the loss class over symmetric difference hypothesis space ∗Equal contribution. Corresponding authors. †Work done during an internship at Sony AI. 1 is defined as the set: (cid:96) ◦ H∆H := {(cid:96)(hw(x), hw(cid:48)(x)) : hw, hw(cid:48) ∈ H} . (1) This loss class measures the discrepancy over any pair of two hypotheses in H, and in [23, 37], they further define the Rademacher complexity over (cid:96) ◦ H∆H to bound the gap between source and target generalization risks. Definition 2 ( [23]). Let hypothesis space H be a set of real (vector)-valued functions defined over input space X and label space Y: H = {hw : X (cid:55)→ Y} each parameterized by w ∈ W ⊆ Rd, and (cid:96) : Y × Y (cid:55)→ R+ be the loss function. Given a dataset ˆD = {x1, ..., xn} sampled i.i.d. from distribution D defined over X , the empirical Rademacher complexity of H∆H over this dataset is defined as follows: R ˆD((cid:96) ◦ H∆H) = Eσ (cid:34) sup hw,hw(cid:48) ∈H 1 n n (cid:88) i=1 σi(cid:96)(hw(xi), hw(cid:48)(xi)) , (cid:35) (2) where σ1, . . . , σn are i.i.d. Rademacher random variables with P{σi = 1} = P{σi = −1} = 1 2 . Intuitively, above quantity measures how well the loss vector realized by two hypotheses within H correlates with random vectors. The better correlation will imply a richer hypothesis class. However, unlike the classical Rademacher complexity whose loss vector is computed between predictions made by a hypothesis and true labels, Eq. (2) is defined merely over predictions made by two hypotheses. Authors of [23, 37] have shown that this complexity measure controls the domain adaptation generalization bound. Unfortunately, none of those works give the precise analysis of R ˆD((cid:96) ◦ H∆H). To our best knowledge, [18] is the only prior work to analyze R ˆD((cid:96) ◦ H∆H) on linear classifier class, but their analysis is not tight. Due to the importance of such complexity measure, we are interested in characterizing how large this complexity measure can be in terms of model dimension and data diversity, even on some toy model, e.g., linear model. Hence, the first question we investigate in this paper is: for linear models, what quantities control the Rademacher complexity over H∆H function class? Meanwhile, in modern machine learning, practitioners are not only interested in transferring standard model accuracy to another domain, but also in transferring robustness. Consider adversarially robust risk over domain D: (cid:101)Rlabel D (hw, yD) = Ex∼D (cid:20) max (cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw(x + δ), yD(x)) , (cid:21) where yD(*) is the labeling function. In the adversarially robust domain adaptation problem, we are interested in the robust risk when the same model hw is evaluated on a new domain D(cid:48). Unfortunately, as shown empirically [33, 14, 9], robust model learnt on source domain will lose its robustness catastrophically on a different domain. That is, the gap between robust risks on the old domain and new domains can be dramatically huge, compared to the standard risk. This observation naturally leads to the question Why is the robust risk harder to adapt to different domains?, which we aim to examine in this paper. To answer this question, inspired by the Rademacher complexity over H∆H function class, we properly extend this complexity measure to the adversarial learning setting, and propose the adversarial Rademacher complexity over the H∆H class. We show that, the adversarial version complexity is always greater than its non-adversarial counterpart, similar to the results proven in [35] in the single domain setting. Relying on this new complexity measure, we explained by robust domain adaptation is harder than standard one. Even though we show that robust risk transfer is provably hard, we also find that robust training can have benefits in terms of standard domain adaptation. As observed in recent studies [32, 6], the model trained adversarially on the source domain, usually entails better standard accuracy on target domain, compared to the normally trained model. In this paper, We show that given large enough adversarial budget, small source adversarially robust risk will almost guarantee small target domain standard risk, with the residual error controlled by (cid:15). This connection between source robust risk and target standard risk theoretically supports the advantage of performing robust training in domain adaptation tasks. Our contributions are summarized as follows: 2 • We study the Rademacher complexity over H∆H class, and propose the adversarial variant of it, which is a new complexity measure towards better understanding the domain adaptation in adversarial learning. In both linear classification and regression settings, we first show that adversarial Rademacher complexity over H∆H class is greater than its non-adversarial counterpart. We also show that adversarial complexity is bounded by its non-adversarial counterpart plus residual terms polynomially depending on data dimension, model norm and adversarial budget. • We generalize our results to ReLU neural networks, where we derive an upper bound of adversarial H∆H Rademacher complexity of a 2-layer ReLU neural network for binary classification. • Although we proved that robust risk transfer is hard, we discover a positive result when we evaluate target domain standard risk of the robust trained model on source domain. We show that, small source robust risk will imply a small target standard risk with adversarial budget dependent variance. This establish the connection between robust learning and standard domain adaptation, which helps explain the widely-observed phenomena that adversarially trained models can have good generalization performance on different domains. • We support our theoretical analysis by providing experiments illustrating how adversarial training can help domain adaptation, especially with (cid:96)1 regularization. We also highlight numerically the difficulty of transferring adversarial robustness across domains. 2 Related Work Here, we briefly discuss some relevant prior works. But before we would like to highlight the key differences between robust learning, standard domain adaptation, and adversarially robust domain adaptation. In adversarially robust learning, we are interested in the gap between population robust risk and empirical robust risk, on the same domain; while in standard domain adaptation, we consider the gap between the (standard) risk on the target domain and the risk on the source domain on which the model is trained on. In adversarially robust domain adaptation, we examine the relation between adversarially robust risks on target and source domains. Discrepancy Based Domain Adaptation Theory A significant category of the domain adaptation study is discrepancy based generalization analysis. [3] borrowed the A-discrepancy from seminal work [17], and gave the target domain generalization in terms of source domain error and this discrepancy measure. Afterwards, [2] proposed H∆H discrepancy, which is easier to estimate from unlabeled data, and also proved VC-dimenson-based generalization bound. [23] also consider H∆H discrepancy, while their analysis depends on Rademacher complexity over H∆H function class. They claim that in some situations, their learning bound is superior to [2]'s bound. [25] proposed Y-discrepancy which is a labeling function dependent measure, but hence it cannot be estimated from unlabeled data. [18] advocated a source-guided discrepancy and showed that it is a tighter discrepancy measure than H∆H discrepancy. [38] proposed a localized discrepancy measure, where they argued that when defining a discrepancy measure, considering the whole hypothesis class may be too pessimistic, so they chose to incorporate risk level as well into the discrepancy definition. Generalization of Adversarially Robust Learning To characterize the generalization of adversarially robust learning, a line of researches [16, 35, 1] are conducted via Rademacher complexity point of view. [16] is among the first to examine the adversarial Rademacher complexity under (cid:96)∞ attack, and as a concurrent work, [35] characterized the upper and lower bound of it, and claim that adversarially robust is at least as hard as standard ERM learning. [1] further extended [35]'s results to adversary set under arbitrary norm constraint, and analyze the complexity of neural network as well. Another category of generalization studies of robust learning is based on PAC learning framework. [5] proved that empirical robust risk minimization is a successful robust PAC learner. [27] show that the function classes with finite VC dimension are adversarially robustly PAC learnable, with the sample complexity related to dual VC dimension, which could be exponentially larger than vanilla VC dimension. [8] proved the lower sample complexity bound for robust PAC learning under hybrid attack. They show that a 3 sample complexity exponentially in the adversary budget is unavoidable. [11] also studied the hardness of robust classification under PAC learning framework, and proved some impossibility results regarding the adversary budget. [7] investigated different adversarial risk definitions, and proved negative results on the uniform distribution. [29] also analyzed the existing adversarial risk notions, and discovered the difference and connections among them. Robustness Transfer Robustness transfer is a newly initiated research area. [33] discovered that by fine-tuning the network on the target domain, robustness can be inherited by the new model. [14] considered the federated learning scenario, where they wish to transfer robust models from computationally rich users to users that cannot afford adversarial training. They proposed a batch-normalization based method to share robustness among different clients. [9] studied when the robust features learned in contrastive learning can be transferred to different tasks. Another orthogonal line to transfer robustness is continually fine-tuning models on new samples in an unsupervised manner [13], which however cannot defend against adversarial attacks. 3 Problem Setup We adapt the following notations throughout this paper. We use lower case bold letter to denote vector, e.g., w, and use upper case bold letter to denote matrix, e.g., M. We use (cid:107)w(cid:107)p and (cid:107)M(cid:107)p to denote (cid:96)p-norm of vector w and matrix M respectively. We define the (p, q)-group norm as the (cid:107)M(cid:107)p,q := (cid:107)((cid:107)m1(cid:107)p , . . . , (cid:107)mn(cid:107)p)(cid:62)(cid:107)q where the mis are the columns of M. We use D : X (cid:55)→ R to denote a data distribution (domain) defined over instance space X , and ˆD be the empirical distribution with nD samples drawn i.i.d. from D. We let H := {hw : X (cid:55)→ Y} be the hypothesis space, and vector w ∈ W ⊆ Rd denotes the model parametrization of hw. Given a loss function (cid:96) : Y × Y (cid:55)→ R, and a data distribution D, we let RD(hw, hw(cid:48)) := Ex∼D[(cid:96)(hw(x), hw(cid:48)(x))] be the risk of the disagreement between models hw and hw(cid:48) on domain D. Specially, when the second argument of RD(*, *) is the labeling function over D, it becomes the commonly used risk function. We also define two adversarially robust risks: (1) Model-label robust risk as (cid:101)Rlabel D (hw, y) := Ex∼D (cid:20) max (cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw(x + δ), y(x)) (cid:21) and (2) Model-model robust risk1 as (cid:101)RD(hw, hw(cid:48)) := Ex∼D (cid:20) max (cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw(x + δ), hw(cid:48)(x + δ)) . (cid:21) In the domain adaptation scenario, we consider source domain S and target domain T distributions, and let ˆS and ˆT be the empirical source and target distributions with nS and nT samples. A key quantity that controls the generalization in domain adaptation is the following discrepancy measure: Definition 3 (H∆H discrepancy [23, 2]). Given a hypothesis class H, risk function RD(*, *), H∆H discrepancy between distributions S and T is defined by: discH∆H(S, T ) = max hw,hw(cid:48) ∈H |RS (hw, hw(cid:48)) − RT (hw, hw(cid:48))|. (3) The H∆H discrepancy defines a semi-distance over two distributions, and it does not depend on the labeling function of two distributions hence invariant to potential model shift across domains. Another advantage of it, is that it can be efficiently estimated by finite samples, if the Rademacher complexity over H∆H is finite. Hence based on Definitions 2 and 3, [23] derived the following generalization bound among source and target domains. 1 (cid:101)Rlabel D and (cid:101)RD are also called constant-in-ball risk and exact-in-ball risk in [11]. 4 Lemma 1 (Domain adaptation generalization lemma, consequence of Theorem 8 of [23]). Let S and T be respectively source and target distributions, and let ˆS and ˆT be their empirical counterpart with nS and nT samples. Assume that the loss function (cid:96) is symmetric and obeys the triangle inequality. We further assume (cid:96) is bounded by M . Then ∀hw ∈ H , the following holds with probability at least 1 − c: RT (hw, yT ) ≤ RS (hw, hw∗ ) + discH∆H(S, T ) + λ + 2M R ˆS ((cid:96) ◦ H∆H) + 2M R ˆT ((cid:96) ◦ H∆H) S (cid:32) (cid:115) + 3M log(1/c) nS + 3M (cid:115) (cid:33) , log(1/c) nT where yT is the labeling function on target domain, hw∗ hw∗ , hw∗ = arg minh∈H RT (h, yT ), and λ = RT (hw∗ = arg minh∈H RS (h, yS ) and hw∗ S The above bound successfully connects the target risk and source risk, with the help of Rademacher complexity over H∆H and discH∆H distance. It turns out that, RS ((cid:96) ◦ H∆H) and RT ((cid:96) ◦ H∆H) are the key complexity measures that control the generalization between different domains. Hence, to study the generalization of domain adaptation in the adversarial setting, it naturally motivates us to consider the following adversarial robust variant of this measure as defined below. are the best target and source models in H, i.e., ) + RT (hw∗ , yT ). , hw∗ S S T T T T Definition 4 (Adversarial Rademacher complexity over H∆H class). Let H be a set of real-valued hypothesis functions: H = {hw : X (cid:55)→ Y}, and (cid:96)(*, *) : Y × Y (cid:55)→ R be the loss function. Given a dataset ˆD = {x1, ..., xn} sampled from distribution D, the empirical adversarial Rademacher complexity of H∆H over this dataset is defined as follows R ˆD( ̃(cid:96) ◦ H∆H) = Eσ    sup hw,hw(cid:48) ∈H 1 n n (cid:88) i=1 σi ̃(cid:96)(hw(xi), hw(cid:48)(xi))    , (4) where ̃(cid:96) := max(cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw(xi + δ), hw(cid:48)(xi + δ)), σ1, . . . , σn are i.i.d. Rademacher random variables with P{σi = 1} = P{σi = −1} = 1 2 . As we can see, (4) is the adversarial perturbed version of Rademacher complexity of (cid:96) ◦ H∆H. We will see later how this quantity controls the generalization of adversarial domain adaptation. We also generalize H∆H discrepancy to the adversarial setting: Definition 5 (Adversarial H∆H discrepancy). Given a hypothesis class H and an adversarial risk function (cid:101)RD(*, *), the adversarial H∆H discrepancy distance between two distributions S and T is defined by: discadv H∆H(S, T ) := max hw,hw(cid:48) ∈H | (cid:101)RS (hw, hw(cid:48)) − (cid:101)RT (hw, hw(cid:48))| . (5) The definition of adversarial H∆H discrepancy is analogous to standard one, and for linear models can indeed be estimated as a function of the latter. We defer this result to Appendix C, Lemma 19. Lemma 2 (Adversarially robust domain adaptation generalization lemma). Let S and T be respectively source and target distributions, and let ˆS and ˆT be their empirical counterpart with nS and nT samples. Assume that the loss function (cid:96) is symmetric and obeys the triangle inequality. We further assume ̃(cid:96) := max(cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw(xi + δ), hw(cid:48)(xi + δ)) is bounded by M . Then, for any hypothesis w ∈ H , the following holds: (cid:101)Rlabel T (hw, yT ) ≤ (cid:101)Rlabel S (cid:32) (cid:115) + 3M log(1/c) nS + 3M (cid:115) (cid:33) , log(1/c) nT (hw, yS ) + discadv H∆H(T , S) + λ + 2M R ˆS ( ̃(cid:96) ◦ H∆H) + 2M R ˆT ( ̃(cid:96) ◦ H∆H) where yT and yS are labeling functions on target and source domain, hw∗ models in H, i.e., hw∗ ) + (cid:101)Rlabel , hw∗ (cid:101)RT (hw∗ T = arg minh∈H (cid:101)Rlabel (hw∗ (h, yS ) and hw∗ , yT ). S S T T T S T and hw∗ S the best target and source robust = arg minh∈H RT (h, yT ), and λ = (cid:101)Rlabel S (hw∗ S , yS ) + 5 The proof of Lemma 2 is deferred to Appendix B. Here we establish the relation between source adversarially robust risk and target adversarially robust risk. It shows that the adversarial discrepancy and adversarial complexity measure ˆRD( ̃(cid:96) ◦ H∆H) on source and target domains are the two key quantities controlling the deviation between the model's performance on the two domains. Hence, to answer our previously proposed question, why the robust risk is harder to adapt to different domain, it is essential to study the connection between adversarial and non-adversarial Rademacher complexities over H∆H class. 4 Main Results 4.1 Binary Classification Setting We start with the binary classification problem where the labels come from {−1, +1}. Like in Section 4.1 of [35], we introduce the hypothesis class of linear functions with bounded weights: H := {hw : x (cid:55)→ (cid:104)w, x(cid:105) , w ∈ Rd : (cid:107)w(cid:107)p ≤ W } , where p ≥ 1. Moreover, we consider the following loss (cid:96)(hw(x), y) := φ(yhw(x)) where φ is a monotonic non- increasing and Lφ-Lipschitz function. With such a loss φ, the non-adversarial class of loss functions over H∆H becomes (6) (cid:96) ◦ H∆H := x (cid:55)→ (cid:96)(hw(x), hw(cid:48)(x)) : hw, hw(cid:48) ∈ H . (cid:110) (cid:111) However, directly analyzing (cid:96) ◦ H∆H class will be difficult since we do not assume the formula of φ explicitly. Hence, following [35], let us define the following class of functions f ◦ H∆H := (cid:110) x (cid:55)→ hw(x)hw(cid:48)(x) : hw, hw(cid:48) ∈ H (cid:111) . We switch from the study of the Rademacher complexity defined in (2) over the function class introduced in (6), that is for linear classifiers applied to binary classification, to the following formula R ˆD(f ◦ H∆H) = Eσ    sup (cid:107)w(cid:107)p≤W, (cid:107)w(cid:48)(cid:107)p≤W 1 n n (cid:88) i=1 σiw(cid:62)xiw(cid:48)(cid:62)xi    . (7) Indeed, by Ledoux-Talagrand contraction property of Rademacher complexity [20], we have that R ˆD((cid:96) ◦ H∆H) ≤ LφR ˆD(f ◦ H∆H). Thus, in the following lemma we aim at estimating R ˆD(f ◦ H∆H). Lemma 3 (Rademacher complexity for binary classification under linear hypothesis). Consider hypothesis class defined in (6). Assume that a set of data {x1, ..., xn} are draw from D. Let R(f ◦ H∆H) be defined as in (7). Then the following statement holds true for non-adversarial Rademacher complexity : R ˆD(f ◦ H∆H) ≤  (cid:118) (cid:117) (cid:117) (cid:116)2  W 2 n (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 (xix(cid:62) i )2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 log(2d) + where X ∈ Rn×d is the data matrix where i-th row is xi. (cid:107)X(cid:107)2 2,∞ log(2d) 3  * (cid:40) 1, d1−2/p, 1 ≤ p ≤ 2 p > 2 , (8) The proof of Lemma 3 is deferred to the Appendix D.1. Lemma 3 shows that the magnitude of the non- adversarial Rademacher over H∆H class depends on the spectral norm of data covariance matrix. It implies that a more diverse dataset will result in a larger Rademacher complexity, and hence harder to perform domain adaptation. We notice that [18] also gave an estimation of the upper bound of R ˆD(f ◦ H∆H) in their Lemma 5, but our bound is superior to theirs in the following two aspectives: (1) Our bound is tighter in terms of the dependency on covariance matrix, since our bound depends on (cid:13) (cid:13)(cid:80)n while their bound depends on (cid:80)n . (2) We consider that model capacity is controlled by p-norm while they only consider 2-norm. i=1(xix(cid:62) i )2(cid:13) (cid:13)2 (cid:13) (cid:13)(xix(cid:62) i )2(cid:13) 2 (cid:13) F i=1 6 Then, let us specify the class of functions involved in the definition of the adversarial Rademacher complexity of H∆H in (4) as follows: (cid:110) ̃(cid:96) ◦ H∆H:= x (cid:55)→ max (cid:107)δ(cid:107)∞≤(cid:15) and let us define (cid:110) ̃f ◦ H∆H:= x (cid:55)→ min (cid:107)δ(cid:107)∞≤(cid:15) φ(cid:0)hw(x + δ)hw(cid:48)(x + δ)(cid:1) : hw, hw(cid:48)∈H (cid:111) , hw(x + δ)hw(cid:48)(x + δ) : hw, hw(cid:48) ∈ H (cid:111) . (9) (10) With the above notations, we can characterize the adversarial counterpart of (7). Again by Ledoux-Talagrand's property, we get that R ˆD( ̃(cid:96) ◦ H∆H) ≤ LφR ˆD( ̃f ◦ H∆H), where R ˆD( ̃f ◦ H∆H) = Eσ     sup (cid:107)w(cid:107)p≤W, (cid:107)w(cid:48)(cid:107)p≤W 1 n n (cid:88) i=1 σi min (cid:107)δ(cid:107)∞≤(cid:15) w(cid:62)(xi + δ)w(cid:48)(cid:62)(xi + δ)  .    (11) Theorem 1 (Adversarial Rademacher complexity for binary classification under linear hypothesis). Consider hypothesis class defined in (6). Assume a set of data ˆD = {x1, ..., xn} are drawn from D. Let R ˆD(f ◦ H∆H) and R ˆD( ̃f ◦ H∆H) be defined as in (7) and (11), respectively. The following statement holds true for adversarial Rademacher complexity over H∆H function class under linear hypothesis (6): R ˆD( ̃f ◦ H∆H) ≤ R ˆD(f ◦ H∆H) + cW 2(cid:112)d log(n) √ n (cid:15)d1/p∗ (cid:0)(cid:15)d1/p∗ + (cid:107)X(cid:107)p∗,∞ (cid:1) , (12) where p∗ is such that 1/p + 1/p∗ = 1, and X ∈ Rn×d is the data matrix and i-th row of X is xi. Moreover, the following lower bound also holds: R ˆD( ̃f ◦ H∆H) ≥ R ˆD(f ◦ H∆H) + (cid:40) 0, W 2 n (1 − d1−2/p)Eσ (cid:80)n (cid:13) (cid:13) i=1 σixix(cid:62) i 1 ≤ p ≤ 2 p > 2 (cid:13) (cid:13)2 , . (13) √ The proofs for Theorem 1 are deferred to Appendices D.2 and D.3. From (12), we notice that the upper bound of R ˆD( ̃f ◦ H∆H) has the smallest dependence in model dimension d if the weights are constrained by the (cid:96)1-norm (p = 1). This is a similar observation as in [35] where they consider single domain setting. However, in their single domain setting, when p = 1, adversarial Rademacher complexity is dimension free while we still d dependency. This heavier dependence is likely due to the fact that R ˆD( ̃f ◦ H∆H) is defined by coupling have two models and hence enlarges the complexity. The bound achieves the sublinear convergence O(1/ n) over the number of samples n, and quadratic dependence on maximum model weight W . It implies that models with suppressed norm can help adversarially robust domain adaptation since it reduces the Rademacher complexity, as we will see in the experiments. √ The lower bound result in (13) shows that, adversarial Rademacher complexity over H∆H will be always larger than non-adversarial one, which implies that adversarial robust domain adaptation is at least as hard as non-adversarial domain adaptation, and that is why, as we will also see in our experiments, given a model, the gap between its source domain robust risk and target domain robust risk is usually larger than that in terms of standard risk. Moreover, the gap between adversarial and non-adversarial complexity is controlled by the spectral norm of Rademacher variable induced covariance matrix. This dependence reveals that a more diverse dataset would be harder to transfer robustness, compared to the standard domain adaptation. 4.2 Linear Regression Setting In this section we consider linear regression problems. The hypothesis class of linear functions with bounded weights remains the same as in (6). However, we consider the following class of quadratic loss functions (cid:96)(a, b) = (cid:107)a − b(cid:107)2. The following lemma establishes the upper bound of non-adversarial Rademacher complexity over H∆H in the above setting. 7 Lemma 4 (Rademacher complexity for regression under linear hypothesis). Let H be the set of linear functions with bounded weights as defined in (6). Then the following statement holds true for non-adversarial Rademacher complexity over H∆H class: R ˆD((cid:96) ◦ H∆H) ≤ cW 2 n   (cid:118) (cid:117) (cid:117) (cid:116) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 (xix(cid:62) i )2 log(d)+(cid:107)X(cid:107)2 2,∞ log(d) *  (cid:40) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 1 d1−2/p 1 ≤ p ≤ 2 p > 2 , where X ∈ Rn×d is the data matrix whose rows are the xi's. The proof of Lemma 4 is deferred to Appendix E.1. As in the binary classification case presented in Section 4.1, we can relate the non-adversarial Rademacher complexity over H∆H class to the spectral norm of data covariance matrix. Theorem 2 (Adversarial Rademacher complexity for regression under linear hypothesis). Let H be the set of linear functions with bounded weights as defined in (6). Then the following statement holds true for adversarial Rademacher complexity over H∆H function class: R ˆD( ̃(cid:96) ◦ H∆H) ≤ R ˆD((cid:96) ◦ H∆H) + cW 2d(cid:112)log(n) √ n (cid:16) (cid:15) (cid:107)X(cid:107)2,∞+ √ d(cid:15)2(cid:17) * (cid:40) 1, 1 ≤ p ≤ 2 d1−2/p, p > 2 , where X ∈ Rn×d is the data matrix and i-th row of X is xi. Meanwhile, the following lower bound holds as well: R ˆD( ̃(cid:96) ◦ H∆H) ≥ R ˆD((cid:96) ◦ H∆H) + (cid:40) 0, 4W 2 n (1 − d1−2/p)Eσ (cid:13) (cid:13)(cid:80)n i=1 σixix(cid:62) i 1 ≤ p ≤ 2 p > 2 (cid:13) (cid:13)2 , . The proof of Theorem 2 is deferred to Appendices E.2 and E.3. Few comments can be made concerning the above theorem. First, the upper bound of adversarial Rademacher complexity also depends quadratically on W and adversarial budget (cid:15), and super-linearly on model dimension d. Second, for the lower bound, we established the similar gap between R ˆD( ̃(cid:96) ◦ H∆H) and R ˆD((cid:96) ◦ H∆H) as in classification setting, which means the data diversity also affects hardness of adversarially robust domain adaptation in regression setting. 4.3 Technical Novelty Here we explain our technical novelty compared to existing works regarding adversarial Rademacher complexity [35, 1]. Taking classification setting for example, [35, 1] consider the Rademacher complexity over the loss class between model predictions and labels, i.e., E[supw i=1 σi min(cid:107)δ(cid:107)≤∞ w(cid:62)(x + δ)], where the inner minimization problem is linear in w and δ. We consider the loss between predictions among two models, hence the Rademacher i=1 σi min(cid:107)δ(cid:107)≤∞ w(cid:62)(x + δ)w(cid:48)(cid:62)(x + δ)], where the inner problem is quadratic in terms complexity is E[supw,w(cid:48) of w and δ. Hence, the existing techniques for upper bound and lower bound are not applicable. The heart of our proof is in the proof of results on lower bound. For proving lower bound, controlling the magnitude of Rademacher complexity with the inner problem being quadratic objective is significantly harder than linear objective. We derive the (complicated) closed form solution to inner quadratic programming, and leverage the symmetric property of Rademacher random variables to avoid heavy computation. (cid:80)n (cid:80)n 1 n 1 n 5 Extension to Neural Networks with ReLU Activation We next extend our analysis methods to more complicated neural network function class. In this section, we will present our results for two-layer ReLU neural networks. That is, we consider the following hypothesis class H := (cid:40)x (cid:55)→ a(cid:62)ReLU(Wx) : a ∈ Rm, W ∈ Rm×d : (cid:107)a(cid:107)1 ≤ A, (cid:107)w(r)(cid:107)p ≤ W (cid:41) , (14) 8 where w(r)(cid:62) are the rows of W for r = 1, . . . , m. The following theorem establishes the relation between Adversarial Rademacher complexity and non-adversarial version in classification setting. As in Section 4.1, we consider the same classification loss functions of the form (cid:96)(hw(x), y) := φ(yhw(x)) . Theorem 3 (Adversarial Rademacher complexity on ReLU neural network class). Let H be the set of two-layer ReLU neural networks with bounded weights as defined in (14). Then, the following statement holds true for adversarial Rademacher complexity over H∆H function class, with classification loss R ˆD( ̃f ◦ H∆H) ≤ O (cid:32) A2W 2 n (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) (cid:16) i=1 (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 (cid:17)2(cid:112)md log(n) + A2W 2 n max i∈[n] (cid:33) (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 . The proof of Theorem 3 is deferred to Appendix F. As we can see from the above theorem, we get the similar upper bound for ReLU neural network class to what we showed in the linear model case. The upper bound of adversarial Rademacher can be bounded by non-adversarial version plus terms depending on the norm of each layer, and the norm of data points. We leave the lower bound analysis as promising future works. 6 Adversarial Training Helps Transfer to Different Domain Even though robust risk is provably harder to transfer in domain adaptation, adversarially robust model does bring benefits, if we consider standard risk on target domain as criteria. In this section, we will provide a positive result connecting standard ERM learning and adversarially robust learning. As observed by prior works [32, 6], if a model is adversarially trained on the source domain, then its standard accuracy on target domain is sometimes better than if it had been fitted via vanilla ERM on source domain. In this section, we try to explain this phenomena from adversarially robust domain adaptation perspective. We found that, when adversarial budget is large enough, small source adversarial risk almost guarantees the small target domain standard risk. First, we need to introduce the following optimization problem. Definition 6. Let p and p(cid:48) be two vectors on the N -dimensional simplex and let (cid:96) be a 0-1 vector. Let also Λ be an arbitrary subset of [N ] := {1, . . . , N }. The Subset Sum Problem with Structural Objective can be defined as solving the following combinatorial optimization problem:    min ̃(cid:96)∈{0,1}N s.t. (cid:12) (cid:12) (cid:12)p(cid:62) ̃(cid:96) − p(cid:48)(cid:62)(cid:96) (cid:12) (cid:12) (cid:12) ̃(cid:96)i = (cid:96)i, ∀ i ∈ [N ] \ Λ . We denote its optimal value as V ∗(p(cid:48), p, (cid:96), Λ). The above problem is a variant of Subset Sum Problem [12], which is also NP-complete. We look for a subset of coordinates of a simplex vector p, such that their sum is closest to a given goal. The given goal has special structure: it is defined as sum of a subset of coordinates in another simplex vector p(cid:48). If the constraint set Λ(cid:15) has more indices, the optimal value will be smaller since we can determine the value on more coordinates of ̃(cid:96). In the following lemma, we explain how this combinatorial measure helps us to connect adversarially robust and standard risks for the binary classification task. Lemma 5. sign(w(cid:62)x), (cid:107)w(cid:107)p ≤ W } and 0-1 loss function φ(x, y) = 1 function y(x) ∈ {−1, 1}. The following statement holds for any T (cid:48): Consider binary classification task, with sign linear classifier class H = {hw : hw = 2 |x − y|. Assume all domains share the same labeling RT (cid:48)(hw, y) ≤ (cid:101)Rlabel T (hw, y) + V ∗(p(cid:48), p, (cid:96), Λ(cid:15)), 2 | sign(w(cid:62)xi) − y(xi)|, with xi ∈ X . The vectors p, p(cid:48) are probability where (cid:96) is the loss vector such that (cid:96)i = 1 mass vectors of T and T (cid:48), i.e., p(x) = PX∼T (X = x), x ∈ X and p(cid:48)(x) = PX∼T (cid:48)(X = x), x ∈ X Moreover, Λ(cid:15) = {i : |w(cid:62)xi| ≤ (cid:15)(cid:107)w(cid:107)1, xi ∈ X , ∀w, (cid:107)w(cid:107)p ≤ W }. 9 Table 1: Transferred standard (SA %) and robust (RA %) accuracies tested on different domains from the Digits datasets. ∆ indicates the difference between the train and test domain accuracy. Target MNIST Source SA RA MNIST-M RA SA SVHN SA RA SynthDigits RA SA USPS SA RA Standardly-trained models MNIST MNIST-M SVHN SynthDigits USPS MNIST MNIST-M SVHN SynthDigits USPS 7.8 5.9 25.0 34.7 94.1 33.9 16.0 28.5 15.3 49.9 76.7 95.9 98.8 Acc ∆ +0.0 +0.0 −64.1 −80.6 −82.8 −90.1 −73.7 −88.2 −48.9 −68.0 97.2 Acc ∆ +3.1 +48.2 +0.0 +0.0 −60.2 −28.5 −45.0 −26.8 −30.5 −23.2 Acc 22.5 59.6 87.5 ∆ −27.9 +26.7 −40.3 −0.8 +0.0 +0.0 −3.2 +22.4 −22.9 +16.5 Acc 40.4 73.0 ∆ −12.5 −2.8 −38.2 −50.7 −23.2 −56.1 +0.0 +0.0 −13.4 −19.4 Acc 94.1 9.6 ∆ −31.7 −39.8 −73.0 −80.9 −89.2 −89.0 −67.6 −81.0 +0.0 +0.0 54.3 57.0 32.7 28.4 13.1 59.8 82.7 98.7 63.6 64.5 13.1 27.9 83.6 67.0 31.2 49.1 57.9 25.8 47.2 84.3 96.1 9.1 0.0 5.2 6.0 3.8 1.7 5.3 5.1 Adversarially-trained models 32.2 93.0 49.5 19.4 26.9 76.8 31.9 59.7 14.6 17.3 94.5 98.3 99.0 +0.0 +0.0 −49.5 −66.4 −79.6 −83.7 −66.9 −81.0 −39.4 −59.5 96.9 +4.0 +17.7 +0.0 +0.0 −66.1 −65.3 −46.5 −51.4 −26.5 −30.0 56.2 Acc ∆ Acc ∆ Acc 51.3 76.2 ∆ −20.0 +4.0 −32.9 −24.6 +0.0 +0.0 +2.7 +17.6 −9.3 +8.7 Acc 64.8 64.1 ∆ −10.6 −9.2 −37.6 −59.1 −31.5 −66.9 +0.0 +0.0 −13.0 −20.0 97.5 9.7 Acc ∆ −26.6 −31.9 −74.8 −82.2 −89.1 −92.3 −68.8 −80.8 +0.0 +0.0 46.6 65.6 75.6 60.2 84.8 17.9 11.5 42.6 16.8 25.4 66.5 66.8 98.9 82.6 46.8 15.4 18.0 25.8 38.8 84.9 72.3 46.4 58.0 43.3 24.1 95.6 30.1 78.9 5.3 The corresponding proof is given in Appendix G. Lemma 5 shows that, the standard risk on domain T (cid:48) can be bounded by robust risk on domain T , plus the quantity controlled by (cid:15). Since the set Λ(cid:15) stores all indices i such that we can choose to flip ̃(cid:96)i's value between 0 and 1, then if we have larger adversarial budget (cid:15), there will be more indices in Λ(cid:15), which means there are more coordinates in ̃(cid:96) we can play with, and hence smaller value of V ∗. Comparison with ERM model Lemma 5 also apply to standard risk on T , which means (cid:15) = 0: RT (cid:48)(hw, y) ≤ RT (hw, y) + V ∗(p(cid:48), p, (cid:96), Λ0). In this case, V ∗ become large, since for any (cid:15) > 0, we have |Λ(cid:15)| ≥ |Λ0| holding. It turns out that, a small source (standard) risk may not imply a small target risk. Hence the ERM model will yield looser generalization guarantee to different domain, than robust ERM model. 7 Empirical Results In this section, we verify the theoretical implications through empirical studies on a multi-domain dataset, Digits [10]. Digits has 28 × 28 images and includes 5 different domains: MNIST [19], SVHN [28], USPS [15], SynthDigits [10], and MNIST-M [10]. All domain datasets are subsampled to contain 7438 images to eliminate the effect of number of samples in generalization. Given a model hw parameterized by w, we consider two training methods: • Adversarial Training min w 1 n (cid:88)n i=1 max (cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw(xi + δ), y(xi)) , (15) 10 Figure 1: Robust accuracy drops (∆) by varying the (cid:96)1 regularization intensity (μ) and (cid:96)∞ perturbation (cid:15). A linear classifier is adversarially trained on the MNIST and tested on target domains. • Standard Training min w 1 n (cid:88)n i=1 (cid:96)(hw(xi), y(xi)) . (16) To solve the inner maximization in (16), we leverage k-step PGD (projected gradient descent) attack [22] with a constant noise magnitude (cid:15). Following [22], we use (cid:15) = 8/255, k = 7, and attack inner-loop step size 2/255, for training, and adversarial test. Then we use Adam to minimize the losses with 100 epochs and learning rate of 10−2 decaying in a cosine manner. We evaluate the model performance by: (1) standard accuracy (SA): classification accuracy on the clean test set; and (2) robust accuracy (RA): classification accuracy on adversarial images perturbed from the original test set. How does adversarial robustness transfer arcoss domains? In this experiments, we use a convolutional network whose architecture is elaborated in Appendix H. We report the transfer accuracy in Table 1 where models are trained on source domain (first column in each row) and tested on different target domains (the rest columns), as well as the difference between source SA/RA and target SA/RA. The experiment has the following implications: (1) We observe that transfer difference ∆ is more significant on RA than SA. For example, for the model trained on MNIST dataset, no matter trained standardly or adversarially, their testing RAs on all other domains drop dramatically than SAs. It implies that adversarially robust domain adaptation is harder than standard domain adaptation, as illustrated by Theorem 1. (2) The models trained on complicated dataset may gain higher robust accuracy at simple dataset, e.g., SVHN → {MNIST, SynthDigits and USPS} and MNIST-M → MNIST. The increase can be attributed to that the source domain has more complicated features and thus more robust features are learnt. However, exploring the reason behind this interesting phenomena is beyond the scope of this paper. Adversarial training helps domain adaptation. We can see from Table 1 that, sometimes when models are adversarial trained on simple dataset (e.g., MNIST and SynthDigits dataset), it is noticeable the standard accuracy on other datasets are improved. For example, if we do adversarial training on MNIST dataset, we achieve significantly higher SA on other dataset, than standard trained model on MNIST. The same phenomena happens when we choose SynthDigits or USPS as source domain. Such advantages are consistent with our Lemma 5. Does (cid:96)1 regularization help adversarial transfer? Our Theorem 1 shows that the adversarial Rademacher complexity over H∆H class is suppressed the most when the (cid:96)1-norm of the model parameters is controlled. To empirically investigate the relation, we consider a linear model on vectorized images x and solve the following (cid:96)1-regularized problem: minw i=1 max(cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw(xi + δ), y(xi)) + μ (cid:107)w(cid:107)1 , where μ ≥ 0 is the regularization term. In Figure 1, we present the drops of robust accuracy from source domain to target domain RAS − RAT , regarding values of μ. Consistent with our theoretical results, increasing (cid:96)1 regularization (μ > 0) can reduce the transfer accuracy drops on different level of adversarial attacks. (cid:80)n 1 n 11 8 Conclusion In this paper we propose and analyze the adversarial Rademacher complexity over H∆H class, which is proven to be the key factor controlling the generalization of adversarially robust risk to different domains. We theoretically explain why adversarial domain adaptation is harder than standard domain adaptation. We also characterize the standard accuracy of a given model on any target domain, using its adversarial accuracy on the source domain, which helps explaining the recent observation regarding the superiority of adversarially training in standard domain adaptation. Acknowledgement This work was supported in part by NSF grant 1956276. References [1] Pranjal Awasthi, Natalie Frank, and Mehryar Mohri. Adversarial learning guarantees for linear hypotheses and neural networks. In International Conference on Machine Learning, pages 431–441. PMLR, 2020. 3, 8, 25 [2] Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine learning, 79(1):151–175, 2010. 1, 3, 4 [3] Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. Advances in neural information processing systems, 19, 2006. 1, 3 [4] Corinna Cortes, Mehryar Mohri, and Andrés Muñoz Medina. Adaptation algorithm and theory based on generalized discrepancy. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 169–178, 2015. 1 [5] Daniel Cullina, Arjun Nitin Bhagoji, and Prateek Mittal. Pac-learning in the presence of adversaries. Advances in Neural Information Processing Systems, 31, 2018. 3 [6] Zhun Deng, Linjun Zhang, Kailas Vodrahalli, Kenji Kawaguchi, and James Y Zou. Adversarial training helps transfer learning via better representations. Advances in Neural Information Processing Systems, 34:25179–25191, 2021. 2, 9 [7] Dimitrios Diochnos, Saeed Mahloujifar, and Mohammad Mahmoody. Adversarial risk and robustness: General definitions and implications for the uniform distribution. Advances in Neural Information Processing Systems, 31, 2018. 4 [8] Dimitrios I Diochnos, Saeed Mahloujifar, and Mohammad Mahmoody. Lower bounds for adversarially robust pac learning. arXiv preprint arXiv:1906.05815, 2019. 3 [9] Lijie Fan, Sijia Liu, Pin-Yu Chen, Gaoyuan Zhang, and Chuang Gan. When does contrastive learning preserve adversarial robustness from pretraining to finetuning? Advances in Neural Information Processing Systems, 34:21480–21492, 2021. 2, 4 [10] Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In International Conference on Machine Learning, pages 1180–1189. PMLR, June 2015. 10 [11] Pascale Gourdeau, Varun Kanade, Marta Kwiatkowska, and James Worrell. On the hardness of robust classification. The Journal of Machine Learning Research, 22(1):12521–12549, 2021. 4 [12] Juris Hartmanis. Computers and intractability: a guide to the theory of np-completeness (michael r. garey and david s. johnson). Siam Review, 24(1):90, 1982. 9 12 [13] Junyuan Hong, Lingjuan Lyu, Jiayu Zhou, and Michael Spranger. Mecta: Memory-economic continual test-time model adaptation. International Conference on Learning Representations, 2023. 4 [14] Junyuan Hong, Haotao Wang, Zhangyang Wang, and Jiayu Zhou. Federated robustness propagation: Sharing adversarial robustness in federated learning. arXiv preprint arXiv:2106.10196, 2021. 2, 4 [15] Jonathan J. Hull. A database for handwritten text recognition research. IEEE Transactions on Pattern Analysis and Machine Intelligence, 16(5):550–554, May 1994. 10 [16] Justin Khim and Po-Ling Loh. Adversarial risk bounds via function transformation. arXiv preprint arXiv:1810.09519, 2018. 3 [17] Daniel Kifer, Shai Ben-David, and Johannes Gehrke. Detecting change in data streams. In VLDB, volume 4, pages 180–191. Toronto, Canada, 2004. 3 [18] Seiichi Kuroki, Nontawat Charoenphakdee, Han Bao, Junya Honda, Issei Sato, and Masashi Sugiyama. Unsupervised domain adaptation based on source-guided discrepancy. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4122–4129, 2019. 2, 3, 6 [19] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, November 1998. 10 [20] Michel Ledoux and Michel Talagrand. Probability in Banach Spaces: Isoperimetry and Processes. Springer Science & Business Media, 2013. 6 [21] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In International conference on machine learning, pages 97–105. PMLR, 2015. 1 [22] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. International Conference on Learning Representations, 2018. 11 [23] Yishay Mansour, Mehryar Mohri, and Afshin Rostamizadeh. Domain adaptation: Learning bounds and algorithms. arXiv preprint arXiv:0902.3430, 2009. 1, 2, 3, 4, 5 [24] Pascal Massart. Some applications of concentration inequalities to statistics. In Annales de la Faculté des sciences de Toulouse: Mathématiques, volume 9, pages 245–303, 2000. 27, 33, 39 [25] Mehryar Mohri and Andres Muñoz Medina. New analysis and algorithm for learning with drifting distributions. In International Conference on Algorithmic Learning Theory, pages 124–138. Springer, 2012. 3 [26] Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of machine learning. MIT press, 2018. 21 [27] Omar Montasser, Steve Hanneke, and Nathan Srebro. Vc classes are adversarially robustly learnable, but only improperly. In Conference on Learning Theory, pages 2512–2530. PMLR, 2019. 3 [28] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011. 10 [29] Muni Sreenivas Pydi and Varun Jog. The many faces of adversarial risk. arXiv preprint arXiv:2201.08956, 2022. 4 [30] Joaquin Quinonero-Candela, Masashi Sugiyama, Anton Schwaighofer, and Neil D Lawrence. Dataset shift in machine learning. Mit Press, 2008. 1 13 [31] Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum classifier discrepancy for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3723–3732, 2018. 1 [32] Hadi Salman, Andrew Ilyas, Logan Engstrom, Ashish Kapoor, and Aleksander Madry. Do adversarially robust imagenet models transfer better? Advances in Neural Information Processing Systems, 33:3533–3545, 2020. 2, 9 [33] Ali Shafahi, Parsa Saadatpanah, Chen Zhu, Amin Ghiasi, Christoph Studer, David Jacobs, and Tom Goldstein. Adversarially robust transfer learning. arXiv preprint arXiv:1905.08232, 2019. 2, 4 [34] Joel A Tropp et al. An introduction to matrix concentration inequalities. Foundations and Trends® in Machine Learning, 8(1-2):1–230, 2015. 15, 25 [35] Dong Yin, Ramchandran Kannan, and Peter Bartlett. Rademacher complexity for adversarially robust generalization. In International conference on machine learning, pages 7085–7094. PMLR, 2019. 2, 3, 6, 7, 8 [36] Kaichao You, Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Universal domain adaptation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2720–2729, 2019. 1 [37] Yuchen Zhang, Tianle Liu, Mingsheng Long, and Michael Jordan. Bridging theory and algorithm for domain adaptation. In International Conference on Machine Learning, pages 7404–7413. PMLR, 2019. 1, 2 [38] Yuchen Zhang, Mingsheng Long, Jianmin Wang, and Michael I Jordan. On localized discrepancy for domain adaptation. arXiv preprint arXiv:2008.06242, 2020. 1, 3 14 A Useful lemmas In this section, we present necessary lemmas that are used further in the proof of our main results. A.1 Matrix concentration inequality Theorem 4 (Matrix Bernstein inequality, Thm 6.1.1 of [34]). Let us denote by (cid:107).(cid:107)2 the spectral norm of matrix. Consider a finite sequence of n independent, random matrices Zi with common dimension d1 × d2. Assume that E [Zi] = 0 and (cid:107)Zi(cid:107)2 ≤ L, ∀i ∈ [n] . Let Y := (cid:80)n i=1 Zi. Then, E [(cid:107)Y(cid:107)2] = E (cid:34)(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 Zi (cid:35) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 ≤ (cid:112)2Var(Y) log(d1 + d2) + 1 3 L log(d1 + d2) , (17) where the matrix variance is given by Var(Y) := max (cid:8)(cid:13) (cid:13)E (cid:2)YY(cid:62)(cid:3)(cid:13) (cid:40)(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)E (cid:2)Y(cid:62)Y(cid:3)(cid:13) (cid:13)2 , (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13) (cid:13) E (cid:2)ZiZ(cid:62) (cid:3) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 = max n (cid:88) n (cid:88) i=1 i=1 , i (cid:9) E (cid:2)Z(cid:62) i Zi (cid:41) . (cid:13) (cid:13) (cid:3) (cid:13) (cid:13) (cid:13)2 A.2 Basic lemmas Lemma 6 (Basic squared norm inequality). For any vector a, b, we have that (cid:107)a − b(cid:107)2 2 ≤ 2 (cid:107)a(cid:107)2 2 + 2 (cid:107)b(cid:107)2 2 . Lemma 7 (Hölder inequality). Let p ∈ R such that 1 < p < ∞. Let p∗ be its conjugate, that is if 1 < p < ∞, p∗ is such that 1 p∗ = 1. Let v, w ∈ Rd, then the following inequality holds p + 1 If p = 1, we set p∗ = ∞. |(cid:104)v, w(cid:105)| ≤ (cid:107)v(cid:107)p (cid:107)w(cid:107)p∗ . Lemma 8 (Equivalence of p-norms). Let q > p ≥ 1, then for all v ∈ Rd we have (cid:107)v(cid:107)q ≤ (cid:107)v(cid:107)p ≤ d1/p−1/q (cid:107)v(cid:107)q It also holds for q = ∞, that is (cid:107)v(cid:107)∞ ≤ (cid:107)v(cid:107)p ≤ d1/p (cid:107)v(cid:107)∞ Lemma 9 (Maximum dot product over (cid:96)∞ ball). The (cid:96)∞ and (cid:96)1 norms are duals of each other. That is: . . max (cid:107)x(cid:107)∞≤(cid:15) z(cid:62)x = (cid:15) (cid:107)z(cid:107)1 , (18) and this maximum is attained for x∗ = (cid:15)sgn(z), where sgn denotes the element-wise sign function. Proof. Hölder inequality implies that for all z, x ∈ Rp, Finally, we notice this upper bound is reached for x∗ = (cid:15)sgn(z) as z(cid:62)x ≤ |z(cid:62)x| ≤ (cid:107)x(cid:107)∞ (cid:107)z(cid:107)1 ≤ (cid:15) (cid:107)z(cid:107)1 . z(cid:62)x∗ = (cid:15)z(cid:62)sgn(z) = (cid:15) p (cid:88) i=1 zisgn(zi) = (cid:15) (cid:107)z(cid:107)1 . 15 Lemma 10 (Minimum dot product over (cid:96)∞ ball). Let z ∈ Rd, the solution of min (cid:107)x(cid:107)∞≤(cid:15) z(cid:62)x = −(cid:15) (cid:107)z(cid:107)1 , is attained at x∗ = −(cid:15)sgn(z). Proof. Same reasoning as in Lemma 9. Lemma 11 (Lower bound of minimum "quadratic" form over (cid:96)∞ ball). Let z ∈ Rd, the solution of min (cid:107)x(cid:107)∞≤(cid:15) (cid:104)u, x(cid:105)(cid:104)v, x(cid:105) ≥ −(cid:15)2 (cid:107)u(cid:107)1 (cid:107)v(cid:107)1 , (19) (20) Proof. Let x ∈ B∞(0d, (cid:15)) which denotes the (cid:96)∞ centered ball of radius (cid:15) > 0. Hölder's inequality for dual norms applied twice gives us: which directly implies that |(cid:104)u, x(cid:105)(cid:104)v, x(cid:105)| ≤ (cid:107)x(cid:107)2 ∞ (cid:107)u(cid:107)1 (cid:107)v(cid:107)1 ≤ (cid:15)2 (cid:107)u(cid:107)1 (cid:107)v(cid:107)1 , min (cid:107)x(cid:107)∞≤(cid:15) (cid:104)u, x(cid:105)(cid:104)v, x(cid:105) ≥ −(cid:15)2 (cid:107)u(cid:107)1 (cid:107)v(cid:107)1 . Remark 1. We make several comments on the above Lemma 11: • Note that if v = u, then the objective becomes positive and 0 is a simpler and sharp lower bound as it is reached for x = 0d. • Else if v = −u, then applying Lemma 12 implies that the minimum is reached and equals −(cid:15)2 (cid:107)u(cid:107)2 1 means the lower bound in (20) is sharp. which • Else if v⊥u, then one should be able to prove that the minimum is reached at something like x∗ = (cid:15) u−v , which correspond to an objective equaling: (cid:104)u, x∗(cid:105)(cid:104)v, x∗(cid:105) = −(cid:15)2 (cid:107)u(cid:107)2 2(cid:107)v(cid:107)2 (cid:107)u−v(cid:107)2 ∞ 2 Lemma 12 (Maximum squared dot product over (cid:96)∞ ball). We have that max (cid:107)x(cid:107)∞≤(cid:15) (z(cid:62)x)2 = (cid:15)2 (cid:107)z(cid:107)2 1 , (cid:107)u−v(cid:107)∞ . (21) and this maximum is attained for x ∈ {(cid:15)sgn(z), −(cid:15)sgn(z)}, where sgn denotes the element-wise sign function. Proof. Hölder inequality implies that for all z, x ∈ Rp, (z(cid:62)x)2 ≤ (cid:107)x(cid:107)2 ∞ (cid:107)z(cid:107)2 1 ≤ (cid:15)2 (cid:107)z(cid:107)2 1 . Finally, we notice this upper bound is reached for x∗ = ±(cid:15)sgn(z) as (z(cid:62)x∗)2 = (cid:15)2(z(cid:62)sgn(z))2 = (cid:15)2 (cid:107)z(cid:107)2 1 . Lemma 13. Let A be a symmetric matrix, we have that sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W w(cid:62)Aw(cid:48) = (cid:107)A(cid:107)2 . 16 Proof. Let w, w(cid:48) with (cid:96)2−norm smaller than W . By Cauchy-Schwarz's inequality we directly get that w(cid:62)Aw(cid:48) ≤ |(cid:104)w, Aw(cid:48)(cid:105)| Cauchy-Schwarz ≤ (cid:107)A(cid:107)2 (cid:107)w(cid:107)2 (cid:107)w(cid:48)(cid:107)2 ≤ W 2 (cid:107)A(cid:107)2 . (22) We then perform eigendecomposition on A: w(cid:62)Aw(cid:48) = w(cid:62)UΣU(cid:62)w(cid:48) = W 2y(cid:62)Σy(cid:48) , where Σ is a diagonal matrix containing eigenvalues λi's of A, U is an orthogonal matrix since A is symmetric, W U(cid:62)w(cid:48). In this orthogonal basis, let i∗ be the coordinate of the eigenvalue λi∗ with largest y := 1 magnitude in absolute value. We denote by (ei)i∈[d] the canonical basis of Rd. Let y = ei∗ and y(cid:48) = sgn(λi∗ )y, we get W U(cid:62)w and y(cid:48) := 1 y(cid:62)Σy(cid:48) = |λi∗ | = (cid:114) max i∈[d] λi(A)2 = (cid:112)λmax(A2) = (cid:107)A(cid:107)2 . Thus, the upper bound in (22) is attained by inverting the change of variable from y, y(cid:48) to w, w(cid:48). Lemma 14. Let A ∈ Rd×d. Then the following statements hold: sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W w(cid:62)Aw(cid:48) ≤ sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W w(cid:62)Aw(cid:48) * sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W w(cid:62)Aw(cid:48) ≥ sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W w(cid:62)Aw(cid:48) * (cid:40) 1, d1−2/p, (cid:40) d1−2/p, 1, if 1 ≤ p ≤ 2 else if p > 2 if 1 ≤ p ≤ 2 else if p > 2 , . (23) (24) Proof. We begin with proving the first inequality. If 1 ≤ p ≤ 2, we know that: Bp(W ) ⊆ B2(W ). Hence sup(cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W w(cid:62)Aw(cid:48) ≤ sup(cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W w(cid:62)Aw(cid:48). If p > 2, since 1 d1/2−1/p (cid:107)w(cid:107)2 ≤ (cid:107)w(cid:107)p, we know that (cid:107)w(cid:107)p ≤ W implies 1 d1/2−1/p (cid:107)w(cid:107)2 ≤ W . So we have: Bp(W ) := {w : (cid:107)w(cid:107)p ≤ W } ⊆ {w : 1 d1/2−1/p (cid:107)w(cid:107)2 ≤ W } ⊆ B2(W d1/2−1/p). Hence: sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W w(cid:62)Aw(cid:48) ≤ sup (cid:107)w(cid:107)2≤W d1/2−1/p,(cid:107)w(cid:48)(cid:107)2≤W d1/2−1/p w(cid:62)Aw(cid:48) ≤ sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W w(cid:62)Aw(cid:48) * d1−2/p . Now we switch to prove the second inequality. If 1 ≤ p ≤ 2, then (cid:107)w(cid:107)2 ≥ 1 d1/p−1/2 (cid:107)w(cid:107)p, so we know B2(W ) := {w : (cid:107)w(cid:107)2 ≤ W } ⊆ {w : 1 d1/p−1/2 (cid:107)w(cid:107)p ≤ W } = Bp(d1/p−1/2W ). Hence: sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W w(cid:62)Aw(cid:48) ≤ sup (cid:107)w(cid:107)p≤d1/p−1/2W,(cid:107)w(cid:48)(cid:107)p≤d1/p−1/2W w(cid:62)Aw(cid:48) ≤ d2/p−1 sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W w(cid:62)Aw(cid:48) . 17 If p > 2, then we have so we can conclude the relation: B2(W ) ⊆ Bp(W ), sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W w(cid:62)Aw(cid:48) ≤ sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W w(cid:62)Aw(cid:48). Lemma 15 (Partition). Let us define A := {−1, +1}N . Then, there must be an equal partition of A = A+ + A−, such that A− is obtained by multiplying −1 on each vector in A+. That is, |A+| = |A−| and A− = {−a, a ∈ A+}. Proof. We prove by induction. When N = 1, we have A1 = {−1, 1}, and we can partition it as A+ = {1}, and A− = {−1}; The we assume the hypothesis holds for N = k, that is, Ak := {−1, +1}k can be partition as Ak = A+ k }. Now, for N = k + 1, we append all vectors a ∈ A+ by −1, and put [a(cid:62), −1] into A− k+1 k + A− k by 1, and k . It can be verify that, k | = |A− such that |A+ put [a(cid:62), 1] into A+ |A+ k+1| = |A− k+1| and A− k | and A− k = {−a, a ∈ A+ and append all vectors a ∈ A− k k+1 = {−a, a ∈ A+ k+1}. k+1 A.3 Quadratic objective subject to infinite norm constraint Lemma 16. Let w ∈ Rp, a ∈ R and (cid:15) ≥ 0. Let us consider the problem (w(cid:62)δ + a)2 . δ∗ = arg max δ∈Rp:(cid:107)δ(cid:107)∞≤(cid:15) The solution is given by δ∗ = (cid:15)sgn(a)sgn(w) ∈ Rp , (25) where we overload the notation sgn denotes in the mean time a single element and a coordinate wise sign operator, i.e., sgn(a) ∈ R but sgn(w) ∈ Rp. Moreover, the maximum reached is Proof. Let us give a first intuition and proof in dimension one and then extend this to larger dimensions. (wT δ∗ + a)2 = ((cid:15)sgn(a)wT sgn(w) + a)2 = ((cid:15) (cid:107)w(cid:107)1 + |a|)2 . (26) • Case p = 1 (w becomes w). In this setting the problem intuition is clear: one should select δ, with maximal amplitude, that makes δw having the same sign as a. If a and w have the same sign, then δ = (cid:15). Else, δ = −(cid:15). • Case p ∈ N∗. For all w, δ ∈ Rp, Hölder inequality gives that Let δ ∈ Rp such that (cid:107)δ(cid:107)∞ ≤ (cid:15). Then, this implies that on the feasible set |w(cid:62)δ| ≤ (cid:107)δ(cid:107)∞ (cid:107)w(cid:107)1 . Thus, (wT δ + a)2 = (wT δ)2 + 2awT δ + a2 |w(cid:62)δ| ≤ (cid:15) (cid:107)w(cid:107)1 . (27) 1 + 2awT δ + a2 1 + 2|a||wT δ| + a2 (27) ≤ (cid:15)2 (cid:107)w(cid:107)2 ≤ (cid:15)2 (cid:107)w(cid:107)2 (27) ≤ (cid:15)2 (cid:107)w(cid:107)2 = ((cid:15) (cid:107)w(cid:107)1 + |a|)2 . 1 + 2|a|(cid:15) (cid:107)w(cid:107)1 + a2 Finally, one can check that upper bound of the objective is attained for δ∗ given in (25). 18 Lemma 17. Let w ∈ Rp, a ∈ R and (cid:15) ≥ 0. Let us consider the problem δ∗ = arg min δ∈Rp:(cid:107)δ(cid:107)∞≤(cid:15) (wT δ + a)2 . Let I := {i ∈ [p] : wi (cid:54)= 0}. • If (cid:15) (cid:107)w(cid:107)1 ≥ |a|, then a solution is given by (cid:40) δ∗ i = − a (cid:107)w(cid:107)1 δ∗ i = 0 wi |wi| ∀i ∈ I ∀i ∈ [p]\I • Else (cid:15) (cid:107)w(cid:107)1 < |a|, and a the solution is given by (cid:40) δ∗ i = −(cid:15) a |a| δ∗ i = 0 wi |wi| ∀i ∈ I ∀i ∈ [p]\I This solution can be condensed in the following formulation: . .    δ∗ i = −a δ∗ i = 0 wi |wi| min (cid:26) 1 (cid:107)w(cid:107)1 (cid:27) , (cid:15) |a| ∀i ∈ I ∀i ∈ [p]\I . The minimal value is given by: min δ∈Rp:(cid:107)δ(cid:107)∞≤(cid:15) (wT δ + a)2 = a2 (cid:18) (cid:26) 1 − min 1, (cid:27)(cid:19)2 . (cid:15)(cid:107)w(cid:107)1 |a| (28) (29) Remark 2. Note that in general there are an infinite number of solutions to (28) as in (29) one can choose arbitrarily the value of δ∗ i for all i ∈ [p]\I (as soon as it is kept smaller than (cid:15) in absolute value). Proof. Let [p] := {1, . . . , p}. Let us try to build a solution which drives the dot product w(cid:62)δ towards −a. Let I := {i ∈ [p] : wi (cid:54)= 0}. Case 1: If (cid:15) (cid:107)w(cid:107)1 ≥ |a|. Let us δ∗ ∈ Rp such that (cid:40) δ∗ i = − a (cid:107)w(cid:107)1 δ∗ i = 0 wi |wi| ∀i ∈ I ∀i ∈ [p]\I . This vector is in the feasible set as (cid:107)δ∗(cid:107)∞ = maxi∈I |a| (cid:107)w(cid:107)1 |wi| |wi| = |a| (cid:107)w(cid:107)1 ≤ (cid:15), as assumed. Then, wT δ∗ + a = − a (cid:107)w(cid:107)1 (cid:88) i∈I w2 i |wi| + a = 0 . This means that if the entries of vector w are large enough (in absolute value), we can build a feasible vector δ∗ such that the objective in (28) is zero. 19 Case 2: If (cid:15) (cid:107)w(cid:107)1 < |a|. Let us δ∗ ∈ Rp such that (cid:40) δ∗ i = −(cid:15) a |a| δ∗ i = 0 wi |wi| ∀i ∈ I ∀i ∈ [p]\I . This vector is in the feasible set as (cid:107)δ∗(cid:107)∞ = maxi∈I (cid:15) |a| |a| |wi| |wi| = (cid:15), as assumed. Then, wT δ∗ + a = −(cid:15) a |a| (cid:88) i∈I w2 i |wi| (cid:18) + a = a 1 − (cid:15) (cid:107)w(cid:107)1 |a| (cid:124) (cid:123)(cid:122) ∈[0,1] . (cid:19) (cid:125) This means that if the entries of vector w are too small (in absolute value), we can only build a feasible vector δ∗ such that w(cid:62)δ∗ close too −a. And the corresponding objective in (28) becomes a2 (cid:16) 1 − (cid:15) (cid:107)w(cid:107)1 |a| for all δ in the feasible set, which concludes the proof. If a ≥ 0, the computation follows easily, else we can just replace δ ← −δ to get back to the former case. Finally, one just can show with Hölder inequality that (wT δ + a)2 ≥ a2 (cid:16) 1 − (cid:15) (cid:107)w(cid:107)1 |a| (cid:17)2 (cid:17)2 . 20 B Proof of Generalization Lemma (Lemma 2) In this section we provide the proof of Lemma 2. First let us introduce the following helper lemma. Lemma 18. Assume ˆS and ˆT are the sets of data drawn from S and T , with size nS and nT respectively, and the value of ̃(cid:96)(*) is bounded by M . Then we have: |discadv H∆H(S, T )−discadv H∆H( ˆS, ˆT )| ≤ 2M R ˆS ( ̃(cid:96)◦H∆H)+2M R ˆT ( ̃(cid:96)◦H∆H)+  (cid:115) 3M log(1/c) nS + 3M (cid:115)   . log(1/c) nT Proof. Since absolute value satisfies triangle inequality, we have: discadv H∆H(S, T ) (5) = max hw,hw(cid:48) ∈H | (cid:101)RS (hw, hw(cid:48)) − (cid:101)RT (hw, hw(cid:48))| = max hw,hw(cid:48) ∈H | (cid:101)RS (hw, hw(cid:48)) − (cid:101)R ˆS (hw, hw(cid:48)) + (cid:101)R ˆS (hw, hw(cid:48)) − (cid:101)R ˆT (hw, hw(cid:48)) + (cid:101)R ˆT (hw, hw(cid:48)) − (cid:101)RT (hw, hw(cid:48))| ≤ discadv H∆H(S, ˆS) + discadv H∆H( ˆS, ˆT ) + discadv H∆H(T , ˆT ) . According to Rademacher-based generalization bound of [26], we know that discadv H∆H(S, ˆS) = max h,h(cid:48)∈H | (cid:101)RS (h, h(cid:48)) − (cid:101)R ˆS (h, h(cid:48))| ≤ 2M R ˆS ( ̃(cid:96) ◦ H∆H) + 3M (cid:115) log(1/c) nS , and so is for discadv H∆H(T , ˆT ). Proof of Lemma 2. Proof. Since the loss function ̃(cid:96) satisfies triangle inequality, we can split (cid:101)Rlabel T (hw, yT ) into the following terms: (cid:101)Rlabel T (hw, yT ) = Ex∼T ≤ Ex∼T ≤ Ex∼T (cid:20) max (cid:107)δ(cid:107)∞≤(cid:15) (cid:20) max (cid:107)δ(cid:107)∞≤(cid:15) (cid:20) max (cid:107)δ(cid:107)∞≤(cid:15) (cid:21) (cid:96)(hw(x + δ), yT (x)) (cid:96)(hw(x + δ), hw∗ T (x + δ)) + (cid:96)(hw∗ T (x + δ), yT (x)) (cid:21) (cid:96)(hw(x + δ), hw∗ T (x + δ)) (cid:21) + Ex∼T (cid:20) (cid:21) max (cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw∗ T (x + δ), yT (x)) = (cid:101)RT (hw, hw∗ T ) + (cid:101)Rlabel T (hw∗ T , yT ) , where we used the subadditivity of the maximum. By applying again the triangle inequality to the first term, we 21 similarly get (cid:101)Rlabel T (hw, yT ) ≤ (cid:101)RT (hw, hw∗ S ) + (cid:101)RT (hw∗ S , hw∗ T ) + (cid:101)Rlabel T (hw∗ T , yT ) (5) ≤ (cid:101)RS (hw, hw∗ S ) + discadv H∆H(T , S) + (cid:101)RT (hw∗ , hw∗ T ) + (cid:101)Rlabel T (hw∗ T , yT ) S Lemma 18 ≤ (cid:101)RS (hw, hw∗ S ) + discadv H∆H( ˆT , ˆS) + (cid:101)RT (hw∗ , hw∗ T S + R ˆS ( ̃(cid:96) ◦ H∆H) + R ˆT ( ̃(cid:96) ◦ H∆H) + 3M  (cid:115) ) + (cid:101)Rlabel T (cid:115) (hw∗ T , yT )  log(2/c) nS + 3M log(2/c) nT  ≤ Rlabel S (hw, yS ) + (cid:101)Rlabel (hw∗ H∆H( ˆT , ˆS) + (cid:101)RT (hw∗ S S , yS ) , hw∗ T S + discadv + R ˆS ( ̃(cid:96) ◦ H∆H) + R ˆT ( ̃(cid:96) ◦ H∆H) + 3M ) + (cid:101)Rlabel T (cid:115)  (hw∗ T , yT ) log(2/c) nS + 3M (cid:115)   , log(2/c) nT where we plug in Lemma 18 at last step and λ = RT (hw∗ T , hw∗ S ) + RT (hw∗ T , yT ). C Extensions C.1 Estimation of Adversarial Discrepancy from Standard Discrepancy The following Lemma gives the bound if we estimate adversarial H∆H discrepancy from standard H∆H discrepancy. Lemma 19. The following relations between adversarial discrepancy from standard discrepancy holds for linear model class with bounded norm: H = {hw : x (cid:55)→ (cid:104)w, x(cid:105), (cid:107)w(cid:107)p ≤ W }. For Lφ-Lipschitz binary classification loss, we have: discadv H∆H( ˆS, ˆT ) ≤ discH∆H( ˆS, ˆT )  √ + 2W 2Lφ d(cid:15)  1 nT (cid:88) xi∈ ˆT (cid:107)xi(cid:107)2 + 1 nS (cid:88) xi∈ ˆS  (cid:107)xi(cid:107)2  * (cid:40) 1 d1−2/p 1 ≤ p ≤ 2 p > 2 . For (cid:96)2 regression loss, we have: discadv H∆H( ˆS, ˆT ) ≤ discH∆H( ˆS, ˆT ) √ + 8 d(cid:15)W 2   1 nT (cid:88) xi∈ ˆT (cid:107)xi(cid:107)2 + 1 nT (cid:88) xi∈ ˆS  (cid:40) (cid:107)xi(cid:107)2  * 1 d1−2/p 1 ≤ p ≤ 2 p > 2 . Proof. Let Bp(W ) := {w ∈ Rd : (cid:107)w(cid:107)p ≤ W } be the (cid:96)p-norm centered ball with radius W . By the definition of discadv H∆H( ˆS, ˆT ), we have: discadv H∆H( ˆS, ˆT ) (5) = max w,w(cid:48)∈{w:(cid:107)w(cid:107)p≤W } | (cid:101)R ˆT (w, w(cid:48)) − (cid:101)R ˆS (w, w(cid:48))| ≤ max w,w(cid:48)∈Bp(W )2 |R ˆT (w, w(cid:48)) − R ˆS (w, w(cid:48)) + (cid:101)R ˆT (w, w(cid:48)) − R ˆT (w, w(cid:48)) − ( (cid:101)R ˆS (w, w(cid:48)) − R ˆS (w, w(cid:48)))| (3) ≤ discH∆H( ˆS, ˆT ) + max w,w(cid:48)∈Bp(W )2 | (cid:101)R ˆT (w, w(cid:48)) − R ˆT (w, w(cid:48))| + max w,w(cid:48)∈Bp(W )2 | (cid:101)R ˆS (w, w(cid:48)) − R ˆS (w, w(cid:48))| . 22 Now we study the gap maxw,w(cid:48)∈Bp(W )2 | (cid:101)R ˆT (w, w(cid:48)) − R ˆT (w, w(cid:48))| and maxw,w(cid:48)∈Bp(W )2 | (cid:101)R ˆS (w, w(cid:48)) − R ˆS (w, w(cid:48))|. For linear classification, we have: max w,w(cid:48)∈Bp(W )2 | (cid:101)R ˆT (w, w(cid:48)) − R ˆT (w, w(cid:48))| = max w,w(cid:48)∈Bp(W )2 ≤ max w,w(cid:48)∈Bp(W )2 ≤ max w,w(cid:48)∈Bp(W )2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 nT (cid:88) xi∈ ˆT max δ:(cid:107)δ(cid:107)∞≤(cid:15) 1 nT (cid:88) xi∈ ˆT max δ:(cid:107)δ(cid:107)∞≤(cid:15) (φ((cid:104)w, xi + δ(cid:105) * (cid:104)w(cid:48), xi + δ(cid:105)) − φ((cid:104)w, xi(cid:105) * (cid:104)w(cid:48), xi(cid:105))) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Lφ|((cid:104)w, xi + δ(cid:105) * (cid:104)w(cid:48), xi + δ(cid:105)) − ((cid:104)w, xi(cid:105) * (cid:104)w(cid:48), xi(cid:105))| (cid:12) (cid:12) (cid:12) 1 nT (cid:88) xi∈ ˆT max δ:(cid:107)δ(cid:107)∞≤(cid:15) Lφ|w(cid:62) (cid:0)(xi + δ)(xi + δ)(cid:62) − xix(cid:62) i (cid:12) (cid:12) (cid:12) (cid:1) w(cid:48)| (cid:12) (cid:12) (cid:12) ≤ Lφ 1 nT Cauchy-Schwarz ≤ (cid:88) xi∈ ˆT 1 nT Lφ max w,w(cid:48)∈Bp(W )2 (cid:12) (cid:12)w(cid:62) (cid:0)(xi + δ∗ i )(xi + δ∗ i )(cid:62) − xix(cid:62) i (cid:1) w(cid:48)(cid:12) (cid:12) (cid:88) xi∈ ˆT max w,w(cid:48)∈Bp(W )2 (cid:107)w(cid:107)2(cid:107)(xi + δ∗ i )(xi + δ∗ i )(cid:62) − xix(cid:62) i (cid:107)2(cid:107)w(cid:48)(cid:107)2 ≤ Lφ 1 nT (cid:88) xi∈ ˆT max w,w(cid:48)∈Bp(W )2 (cid:107)w(cid:107)2(cid:107)δ∗ i x(cid:62) i + xiδ∗ i (cid:62)(cid:107)2(cid:107)w(cid:48)(cid:107)2 , where δ∗ i is a maximizer of the i-th optimization problem in δ over the (cid:96)∞-ball of radius (cid:15). We know that √ (cid:40) , and (cid:107)δ∗ i x(cid:62) i + xiδ∗ i (cid:62)(cid:107)2 ≤ 2 d(cid:15)(cid:107)xi(cid:107)2, so we have: (cid:107)w(cid:107)2 ≤ W * 1 d1/2−1/p 1 ≤ p ≤ 2 p > 2 max w,w(cid:48)∈Bp(W )2 | (cid:101)R ˆT (w, w(cid:48)) − R ˆT (w, w(cid:48))| ≤ W 2Lφ 1 nT (cid:88) √ 2 xi∈ ˆT d(cid:15)(cid:107)xi(cid:107)2 * (cid:40) 1 d1−2/p 1 ≤ p ≤ 2 p > 2 . which concludes the proof for linear classification setting. Now we switch to regression setting: max w,w(cid:48)∈Bp(W )2 | (cid:101)R ˆT (w, w(cid:48)) − R ˆT (w, w(cid:48))| = max w,w(cid:48)∈Bp(W )2 = max w,w(cid:48)∈Bp(W )2 = max w,w(cid:48)∈Bp(W )2 = max w,w(cid:48)∈Bp(W )2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 nT 1 nT 1 nT (cid:88) xi∈ ˆT (cid:88) xi∈ ˆT (cid:88) xi∈ ˆT max δ:(cid:107)δ(cid:107)∞≤(cid:15) max δ:(cid:107)δ(cid:107)∞≤(cid:15) (cid:107)(cid:104)w, xi + δ(cid:105) − (cid:104)w(cid:48), xi + δ(cid:105)(cid:107)2 2 − (cid:107)(cid:104)w, xi(cid:105) − (cid:104)w(cid:48), xi(cid:105)(cid:107)2 2 (cid:107)(cid:104)w − w(cid:48), xi + δ(cid:105)(cid:107)2 2 − (cid:107)(cid:104)w − w(cid:48), xi(cid:105)(cid:107)2 2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (w − w(cid:48))(cid:62) (cid:2)(xi + δ∗ i )(xi + δ∗ i )(cid:62) − xix(cid:62) i (cid:12) (cid:12) (cid:12) (cid:3) (w − w(cid:48)) (cid:12) (cid:12) (cid:12) (w − w(cid:48))(cid:62) 1 nT (cid:88) (cid:104) xi∈ ˆT δ∗ i x(cid:62) i + xiδ∗ i (cid:62)(cid:105) (cid:12) (cid:12) (cid:12) (w − w(cid:48)) (cid:12) (cid:12) (cid:12) 23 Now, we let v := w − w(cid:48), and re-write the above inequality as: max w,w(cid:48)∈Bp(W )2 | (cid:101)R ˆT (w, w(cid:48)) − R ˆT (w, w(cid:48))| Cauchy-Schwarz ≤ max v:(cid:107)v(cid:107)p≤2W (cid:13)v(cid:62)(cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 1 nT (cid:88) (cid:104) xi∈ ˆT δ∗ i x(cid:62) i + xiδ∗ i (cid:62)(cid:105) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 (cid:107)v(cid:107)2 ≤ (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 1 nT (cid:88) (cid:104) δ∗ i x(cid:62) i + xiδ∗ i (cid:62)(cid:105) xi∈ ˆT (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 4W * (cid:40) 1 d1−2/p p ≤ 2 p > 2 √ ≤ 8 dW 1 nT (cid:88) xi∈ ˆT (cid:107)xi(cid:107)2 * (cid:40) 1 d1−2/p p ≤ 2 p > 2 . where we use norm equivalence (Lemma 8) to bound (cid:107)v(cid:107)2. C.2 Adversarially Robust Domain Adaptation Generalization Bound In this section, we will present the generalizatin bound of adversarially robust domain adaptation, using our upper bound for adversarial Rademacher complexity over H∆H class. An immediate implication of Theorem 2 is the following result. Corollary 1 (Adversarially Robust Domain Adapation Learning Bound, Linear Regression). Assume that the loss function ̃(cid:96) is symmetric and convex. Also let ˆS and ˆT have nS and nT data points, respectively. We further assume ̃(cid:96) is bounded by M . Then, for any hypothesis hw ∈ H , the following holds with probability at least 1 − c: (hw, yT ) ≤ 6 (cid:101)Rlabel (cid:101)Rlabel T H∆H( ˆT , ˆS) + 3 (cid:101)RT (hw∗ + 4discadv  (cid:115) (cid:115) S S S , yS ) (hw∗ ) + 3 (cid:101)Rlabel (hw, yS ) + 6 (cid:101)Rlabel , hw∗ S   + 3 ˆRS ((cid:96) ◦ H∆H) + 3 ˆRT ((cid:96) ◦ H∆H) , yT ) (hw∗ T S T log(2/c) nS + log(2/c) nT + M O  + ̃O (cid:18) W 2 √ nS (cid:16) d(cid:15) (cid:107)XS (cid:107)2,∞ + d3/2(cid:15)2(cid:17) + W 2 √ nT (cid:16) d(cid:15) (cid:107)XT (cid:107)2,∞ + d3/2(cid:15)2(cid:17)(cid:19) × (cid:40) 1, d1−2/p, 1 ≤ p ≤ 2 p > 2 , where XS and XT are the data matrix concatenated by data points from ˆS and ˆT , respectively. Proof. The following proof is almost identical to that of lemma 2, and the only change is that we apply Jensen's inequality instead of triangle inequality here: (cid:101)Rlabel T (hw, yT ) ≤ 3 (cid:101)RT (hw, hw∗ S ≤ 3 (cid:101)RS (hw, hw∗ S ≤ 3 (cid:101)RS (hw, hw∗ S ) + 3 (cid:101)RT (hw∗ ) + 3discadv S ) + 3discadv , hw∗ T ) + 3 (cid:101)Rlabel T (hw∗ T , yT ) H∆H(T , S) + 3 (cid:101)RT (hw∗ H∆H( ˆT , ˆS) + 3 (cid:101)RT (hw∗ S (cid:115)  S , hw∗ T , hw∗ T T (hw∗ ) + 3 (cid:101)Rlabel ) + 3 (cid:101)Rlabel (hw∗ (cid:115) T T T , yT ) , yT ) log(2/c) nS + 3M log(2/c) nT + 3 ˆRS ( ̃(cid:96) ◦ H∆H) + 3 ˆRT ( ̃(cid:96) ◦ H∆H) + 3 3M ≤ 6 (cid:101)Rlabel S + 3discadv (hw, yS ) + 6 (cid:101)Rlabel H∆H( ˆT , ˆS) + 3 (cid:101)RT (hw∗ S (hw∗ , yS ) S , hw∗ T S + 3 ˆRS ( ̃(cid:96) ◦ H∆H) + 3 ˆRT ( ̃(cid:96) ◦ H∆H) + 3 3M 24 ) + 3 (cid:101)Rlabel (hw∗  (cid:115) T T , yT ) log(2/c) nS (cid:115) + 3M log(2/c) nT     where we plug in lemma 18 at last step. Finally plugging in theorem 2 will conclude the proof. D Proofs for Binary Classification D.1 Proof of Lemma 3 Proof. To simplify notations, we omit to specify the fact that the model parameters w and w(cid:48) belong to Rd. We first prove the upper bound results. By definition, we have n (cid:88) σiwT xiw(cid:48)T xi (cid:35) R ˆD(f ◦ H∆H) = Eσ (23) ≤ Eσ Lemma 13= (cid:34) sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W (cid:34) 1 n i=1 (cid:32) 1 n w(cid:62) sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W (cid:34)(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) Eσ i=1 W 2 n σixix(cid:62) i (cid:35) * (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 n (cid:88) (cid:33) (cid:35) (cid:40) σixix(cid:62) i w(cid:48) * 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 i=1 (cid:40) 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 . (30) We now look for a more explicit upper bound of the above Rademacher complexity depending on the dimension d and on a norm of covariance of data points x1, . . . , xn. To do so, we introduce some notations before applying a matrix Bernstein inequality (Theorem 6.1.1 of [34]) recalled in Theorem 4. Let Zi := σixix(cid:62) i ∈ Rd×d for all i ∈ [n]. These random matrices are symmetric, independent, have zero mean and are such that for all i ∈ [n]. Moreover, let Y := (cid:80)n i=1 Zi. For each Zi, we notice that it has bounded spectral norm: (cid:113) (cid:107)Zi(cid:107)2 = λmax(Z2 i ) = (cid:113) λmax(xix(cid:62) i xix(cid:62) i ) = (cid:107)xi(cid:107)2 2 ≤ max j∈[n] (cid:107)xj(cid:107)2 2 = (cid:107)X(cid:107)2 2,∞ , so that according to matrix Bernstein inequality, we get the desired bound ˆR(f ◦ H∆H)   (cid:118) (cid:117) (cid:117) (cid:116)2 (17) ≤ W 2 n (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 (xix(cid:62) i )2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 log(2d) + 1 3  (cid:107)X(cid:107)2 2,∞ log(2d)  × (cid:40) 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 . D.2 Proof of the upper bound of Theorem 1 Alike the analysis of Theorem 7 from [1], the below study uses the notion of coverings. For completeness sake, we recall its definition. Definition 7 (ρ-covering). Let ρ > 0 and let (V, (cid:107).(cid:107)) be a normed space. A set C ⊆ V is an (cid:15)-covering of V if for any v ∈ V , there exists v(cid:48) ∈ C such that (cid:107)v − v(cid:48)(cid:107) ≤ ρ. We also copy Lemma 6 from [1] dealing with the size of coverings of balls. Lemma 20. Let ρ > 0. Let B ⊆ Rd be a the ball of radius R ≥ 0 in a norm (cid:107).(cid:107) and let C be one of the smallest ρ-covering of B w.r.t. (cid:107).(cid:107). Then, |C| ≤ (cid:19)d (cid:18) 3R ρ . Now we are ready to present the proof of upper bound of the adversarial Rademacher complexity for linear binary classification. 25 Proof of the upper bound of Theorem 1. In this proof, we consider the linear hypothesis class were the norm of the models is controlled by a general (cid:96)p-norm for p > 0. Let Bp(W ) := {w ∈ Rd : (cid:107)w(cid:107)p ≤ W }, the hypothesis class defined in (6) then writes H := {hw : x (cid:55)→ (cid:104)w, x(cid:105) : w ∈ Bp(W )} . Similarly, let B∞((cid:15)) := {δ ∈ Rd : (cid:107)δ(cid:107)∞ ≤ (cid:15)}. Recall that we define in (11) ˆRS( ̃f ◦ H∆H) = Eσ (cid:34) = Eσ sup w,w(cid:48)∈Bp(W )2 1 n n (cid:88) i=1 (cid:34) (cid:34) sup w,w(cid:48)∈Bp(W )2 1 n n (cid:88) i=1 σi min δ∈B∞((cid:15)) wT (xi + δ)w(cid:48)T (xi + δ) (cid:35) σi(x(cid:62) i ww(cid:48)(cid:62)xi + min δ∈B∞((cid:15)) δ(cid:62)ww(cid:48)(cid:62)δ + x(cid:62) i (ww(cid:48)(cid:62) + w(cid:48)w(cid:62))δ) (cid:35) ≤ ˆRS(f ◦ H∆H) + Eσ sup w,w(cid:48)∈Bp(W )2 (cid:124) 1 n n (cid:88) i=1 σi min δ∈B∞((cid:15)) (cid:0)δ(cid:62)ww(cid:48)(cid:62)δ + x(cid:62) i (ww(cid:48)(cid:62) + w(cid:48)w(cid:62))δ(cid:1) (cid:123)(cid:122) A (cid:35) . (cid:125) Now we examine the upper bound of the second term A using the notion of covering recalled in Definition 7. Let C be a ρ-covering of the (cid:96)p ball Bp(W ) w.r.t. the (cid:96)p-norm, with ρ > 0. Let us define ψi(w, w(cid:48)) := min δ∈B∞((cid:15)) δ(cid:62)ww(cid:48)(cid:62)δ + x(cid:62) i (ww(cid:48)(cid:62) + w(cid:48)w(cid:62))δ . (31) Thus we can rewrite A as (cid:34) A = Eσ sup w,w(cid:48)∈Bp(W )2 (cid:35) σiψi(w, w(cid:48)) 1 n n (cid:88) i=1  = Eσ     sup w,w(cid:48)∈Bp(W )2 c∈C2 : (cid:107)w−wc(cid:107)p,(cid:107)w(cid:48)−w(cid:48) c(cid:107)p wc,w(cid:48) 1 n n (cid:88) i=1 ≤ρ σi (ψi(wc, w(cid:48) c) + ψi(w, w(cid:48)) − ψi(wc, w(cid:48) c))      , where wc, respectively w(cid:48) c we get , is the closest element to w, resp. w(cid:48), in C. Using the subadditivity of the supremum, (cid:34) A ≤ Eσ sup ̃w, ̃w(cid:48)∈C2 (cid:34) ≤ Eσ sup ̃w, ̃w(cid:48)∈C2 (cid:34) ≤ Eσ sup ̃w, ̃w(cid:48)∈C2 (cid:124) 1 n 1 n 1 n n (cid:88) i=1 n (cid:88) i=1 n (cid:88) i=1 (cid:123)(cid:122) (I) (cid:35) σiψi( ̃w, ̃w(cid:48)) + Eσ (cid:34) sup w,w(cid:48)∈Bp(W )2 1 n n (cid:88) i=1 σi (ψi(w, w(cid:48)) − ψi(wc, w(cid:48) c)) (cid:35) (cid:35) σiψi( ̃w, ̃w(cid:48)) (cid:35) σiψi( ̃w, ̃w(cid:48)) (cid:125) + sup w,w(cid:48)∈Bp(W )2 1 n n (cid:88) i=1 |ψi(w, w(cid:48)) − ψi(wc, w(cid:48) c)| sup w,w(cid:48)∈Bp(W )2 + max i∈[n] (cid:124) |ψi(w, w(cid:48)) − ψi(wc, w(cid:48) c)| . (32) (cid:123)(cid:122) (II) (cid:125) where we recall that wc, resp. w(cid:48) c , is the closest vector to w, resp. w(cid:48), in C. Bounding (I): We first need to bound the left-hand side term (I). We introduce the vector ψ( ̃w, ̃w(cid:48)) := [ψ1( ̃w, ̃w(cid:48)), . . . , ψn( ̃w, ̃w(cid:48))](cid:62) ∈ Rn . 26 By Massart's lemma (Lemma 5.2 of [24]), we are able to control the first term (I) in (32): (cid:34) (I) = Eσ sup ̃w, ̃w(cid:48)∈C2 1 n n (cid:88) i=1 (cid:35) σiψi( ̃w, ̃w(cid:48)) ≤ K(cid:112)2 log(|C|2) n , with K given by the largest (cid:96)2-norm of ψ over the covering C2, that is K 2 = max ̃w ̃w(cid:48)∈C2 (cid:107)ψ(cid:107)2 2 = max ̃w ̃w(cid:48)∈C2 n (cid:88) i=1 ψi( ̃w, ̃w(cid:48))2 . (33) (34) Now we examine the upper and lower bound of ψi( ̃w, ̃w(cid:48)). For upper bound, by taking δ = 0 we know that ψi( ̃w, ̃w(cid:48)) is non-positive. Thus, we only have to control how negative this term can be. Let ̃w, ̃w(cid:48) ∈ C2, we have ψi( ̃w, ̃w(cid:48)) = min δ∈B∞((cid:15)) δ(cid:62) ̃w ̃w(cid:48)(cid:62)δ + x(cid:62) i ( ̃w ̃w(cid:48)(cid:62) + ̃w(cid:48) ̃w(cid:62))δ δ(cid:62) ̃w ̃w(cid:48)(cid:62)δ + min i ( ̃w ̃w(cid:48)(cid:62) + ̃w(cid:48) ̃w(cid:62))δ x(cid:62) ≥ min δ∈B∞((cid:15)) Lemma 10= min δ∈B∞((cid:15)) δ∈B∞((cid:15)) δ(cid:62) ̃w ̃w(cid:48)(cid:62)δ − (cid:15) (cid:13) (cid:13)( ̃w ̃w(cid:48)(cid:62) + ̃w(cid:48) ̃w(cid:62))xi (cid:13) (cid:13)1 . (35) We focus on the first term which is a quadratic optimization problem under infinite norm constraints. For all δ, w, w(cid:48) ∈ B∞((cid:15)) × Bp(W )2, this quadratic form can be lower bounded by calling Hölder's inequality twice and norm equivalence, that is if p∗ ≥ 1 we have (cid:107)v(cid:107)p∗ ≤ d1/p∗ (cid:107)v(cid:107)∞ : δ(cid:62) ̃w ̃w(cid:48)(cid:62)δ ≥ −|δ(cid:62) ̃w ̃w(cid:48)(cid:62)δ| Lemma 7 ≥ Lemma 8 ≥ ∞ (cid:107) ̃w(cid:107)p (cid:107) ̃w(cid:48)(cid:107)p − (cid:107)δ(cid:107)2 (cid:40) −d2/p∗ − (cid:107)δ(cid:107)2 (cid:40) p∗ (cid:107) ̃w(cid:107)p (cid:107) ̃w(cid:48)(cid:107)p (cid:107)δ(cid:107)2 ∞ (cid:107) ̃w(cid:107)1 (cid:107) ̃w(cid:48)(cid:107)1 −d2/p∗ (cid:15)2W 2 −(cid:15)2W 2 if p > 1 else if p = 1 if p > 1 else if p = 1 . δ∈B∞((cid:15)), ̃w, ̃w(cid:48)∈Bp(W )2 ≥ Using the same tools, we now study the second term − (cid:13) (cid:13) ̃w ̃w(cid:48)(cid:62)xi (cid:13) (cid:13)1 = −|(cid:104) ̃w(cid:48), xi(cid:105)| (cid:107) ̃w(cid:107)1 Lemma 7 ≥ Lemma 8 ≥ (cid:107)xi(cid:107)p∗ (cid:107) ̃w(cid:48)(cid:107)p (cid:107) ̃w(cid:107)p − (cid:107)xi(cid:107)p∗ (cid:107) ̃w(cid:48)(cid:107)p (cid:107) ̃w(cid:107)1 (cid:40) −d1/p∗ − (cid:107)xi(cid:107)∞ (cid:107) ̃w(cid:48)(cid:107)1 (cid:107) ̃w(cid:107)1 (cid:40) W 2 (cid:107)xi(cid:107)p∗ if p > 1 else if p = 1 ̃w, ̃w(cid:48)∈Bp(W )2 ≥ −d1/p∗ −W 2 (cid:107)xi(cid:107)∞ (cid:13) = 1 if p = 1 (cid:13) ̃w(cid:48) ̃w(cid:62)xi (cid:13)1 (i.e. p∗ = ∞), we drop the disjunction between p = 1 and p > 1 in what follows. Combining (35) and the above two inequalities, the auxiliary function ψi (31) can be lower bounded after applying the triangle inequality: and symmetrically we get the same bound for − (cid:13) . By taking the convention that d1/p∗ if p > 1 else if p = 1 , So that we get ψi( ̃w, ̃w(cid:48)) ≥ −d2/p∗ (cid:15)2W 2 − 2(cid:15)d1/p∗ W 2 (cid:107)xi(cid:107)p∗ . ψi( ̃w, ̃w(cid:48))2 ≤ (d2/p∗ ≤ (cid:15)2d2/p∗ (cid:15)2W 2 + 2(cid:15)d1/p∗ W 4((cid:15)d1/p∗ W 2 (cid:107)xi(cid:107)p∗ )2 (cid:107)xj(cid:107)p∗ )2 + 2 max j∈[n] = (cid:15)2d2/p∗ W 4((cid:15)d1/p∗ + 2 (cid:107)X(cid:107)p∗,∞)2 . 27 Finally we get the following upper bound for K defined in (34): √ K ≤ n(cid:15)d1/p∗ W 2((cid:15)d1/p∗ + 2 (cid:107)X(cid:107)p∗,∞) , which, jointly with the application of Lemma 20 implies the upper bound for (I): (33) ≤ (I) K(cid:112)2 log |C|2 n ≤ (cid:15)d1/p∗ W 2((cid:15)d1/p∗ √ n + 2 (cid:107)X(cid:107)p∗,∞) (cid:112)4d log(3W/ρ) . (36) Bounding (II). Now we turn to bounding the second term of (32). Let w, w(cid:48) ∈ Bp(W )2 and let wc, resp. w(cid:48) , c be the closest element to w, resp. w(cid:48), in C. Let us define an "implicit" minimizer w.r.t. δ (the objective being c): continuous over a closed ball it is attained) for ψi(wc, w(cid:48) c δc + x(cid:62) δ(cid:62) c wcw(cid:48)(cid:62) i (wcw(cid:48)(cid:62) c + w(cid:48) c )δc . cw(cid:62) (37) δ∗ c := arg min (cid:107)δc(cid:107)∞≤(cid:15) Thus, we have ψi(w, w(cid:48)) − ψi(wc, w(cid:48) c) i (ww(cid:48)(cid:62) + w(cid:48)w(cid:62))δ − (δ∗ δ(cid:62)ww(cid:48)(cid:62)δ + x(cid:62) (37) = min δ∈B∞((cid:15)) c )(cid:62)wcw(cid:48)(cid:62) c δ∗ c − x(cid:62) i (wcw(cid:48)(cid:62) c + w(cid:48) cw(cid:62) c )δ∗ c ≤(δ∗ =(δ∗ =(δ∗ c + x(cid:62) c )(cid:62)ww(cid:48)(cid:62)δ∗ c )(cid:62)(ww(cid:48)(cid:62) − wcw(cid:48)(cid:62) c )(cid:62) (cid:0)w(w(cid:48) − w(cid:48) (cid:0)w(w(cid:48) − w(cid:48) + x(cid:62) i i (ww(cid:48)(cid:62) + w(cid:48)w(cid:62))δ∗ c + x(cid:62) c)(cid:62) − (wc − w)w(cid:48)(cid:62) c c + w(cid:48)(w − wc)(cid:62) − (w(cid:48) c)(cid:62) − (wc − w)w(cid:48)(cid:62) i (ww(cid:48)(cid:62) − wcw(cid:48)(cid:62) (cid:1) δ∗ c δ∗ c − x(cid:62) c + w(cid:48)w(cid:62) − w(cid:48) c )(cid:62)wcw(cid:48)(cid:62) c − (δ∗ c )δ∗ c c + w(cid:48) cw(cid:62) c )δ∗ c i (wcw(cid:48)(cid:62) c )δ∗ cw(cid:62) c c − w(cid:48))w(cid:62) c (cid:1) δ∗ c . We focus on upper bounding a single term of the ones appearing above. By applying Hölder's inequality twice and norm equivalence we get: |(δ∗ c )(cid:62)w(w(cid:48) − w(cid:48) c)(cid:62)δ∗ c | Lemma 7 ≤ (cid:107)w(cid:107)p (cid:107)δ∗ c (cid:107)2 p∗ (cid:107)w(cid:48) − w(cid:48) c(cid:107)p Lemma 8 ≤ ρ(cid:15)2d2/p∗ W , where in the last line we used that (cid:107)w − wc(cid:107)p ≤ ρ, by the definition of the ρ-covering of the ball Bp(W ) w.r.t. the (cid:96)p-norm. Proceeding identically with other terms involving xi we get |x(cid:62) i w(w(cid:48) − w(cid:48) c)(cid:62)δ∗ c | Lemma 7 ≤ (cid:107)xi(cid:107)p∗ (cid:107)w(cid:107)p (cid:107)w(cid:48) − w(cid:48) c(cid:107)p (cid:107)δ∗ c (cid:107)p∗ Lemma 8 ≤ ρ(cid:15)d1/p∗ W (cid:107)xi(cid:107)p∗ , finally get that ψi(w, w(cid:48)) − ψi(wc, w(cid:48) c) ≤ 2ρ(cid:15)2d2/p∗ W + 4ρ(cid:15)d1/p∗ W (cid:107)xi(cid:107)p∗ . Similarly we can prove the same bound holds for other side of the difference (by using an "implicit" minimizer of ψi(w, w(cid:48)). Thus we are able to control (II): (II) (32) = max i∈[n] sup w,w(cid:48)∈Bp(W )2 |ψi(w, w(cid:48)) − ψi(wc, w(cid:48) c)| ≤ 2ρ(cid:15)d1/p∗ W (cid:0)(cid:15)d1/p∗ + 2 (cid:107)X(cid:107)p∗,∞ (cid:1) . (38) And finally, we proved that (36)+(38) ≤ A 2(cid:15)d1/p∗ W ((cid:15)d1/p∗ (cid:32) (cid:114) + 2 (cid:107)X(cid:107)p∗,∞) ρ + W (cid:112)log(3W/ρ) (cid:33) , d n which concludes the first part of the proof if we choose ρ = W/ (cid:19) (cid:18) √ (cid:113) √ A ≤ 2(cid:15) W 2 1 + d log(3 n) d1/p∗ √ n √ n: (cid:0)(cid:15)d1/p∗ + 2 (cid:107)X(cid:107)p∗,∞ (cid:1) . 28 D.3 Proof of the lower bound of Theorem 1 In this subsection we present the proof of lower bound of the adversarial Rademacher complexity for binary classification under linear hypothesis. Proof of the lower bound of Theorem 1. Now we are going to prove the lower bound result of adversarial Rademacher complexity. Recall the definition of non-adversarial Rademacher complexity R ˆD(f ◦ H∆H) = E = 1 n E (cid:34) sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W (cid:34) (cid:35) σiw(cid:62)xix(cid:62) i w(cid:48) 1 n n (cid:88) i=1 (cid:32) n (cid:88) w(cid:62) (cid:33) (cid:35) σixix(cid:62) i w(cid:48) sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W (cid:34) sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤2W (23) ≤ E 1 n Lemma 13= W 2 n E (cid:34)(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 σixix(cid:62) i w(cid:62) (cid:35) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 i=1 (cid:32) n (cid:88) (cid:33) (cid:35) (cid:40) σixix(cid:62) i w(cid:48) × i=1 (cid:40) 1, d1−2/p, × if 1 ≤ p ≤ 2 else if p > 2 , 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 due to equivalence of norms. Now, we denote v∗ such that v∗ = arg max(cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W According to Lemma 13 the maximum value of 1 n i=1 σiw(cid:62)xix(cid:62) (cid:80)n 1 n (cid:80)n i=1 σiw(cid:62)xix(cid:62) i w(cid:48). sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W 1 n n (cid:88) i=1 σiw(cid:62)xix(cid:62) i w(cid:48) = i w(cid:48) is: (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) W 2 n n (cid:88) i=1 σixix(cid:62) i (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 and if we define S(σ) := (cid:80)n (cid:96)2-norm W associated to the largest eigenvalue of S(σ)2. i=1 σixix(cid:62) i Now, we switch to adversarial Rademacher: the maxima is attained when v∗ = W vmax(S(σ)2) is an eigenvector of R ˆD( ̃f ◦ H∆H) (cid:34) sup (cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W = E ≥ E (cid:34) (cid:34) 1 n 1 n n (cid:88) i=1 n (cid:88) i=1 σi min (cid:107)δ(cid:107)∞≤(cid:15) w(cid:62)(xi + δ)(xi + δ)(cid:62)w(cid:48) (cid:35) σi min (cid:107)δ(cid:107)∞≤(cid:15) w(cid:62)(xi + δ)(xi + δ)(cid:62)w(cid:48) × (cid:35) (cid:40) d1−2/p, 1, if 1 ≤ p ≤ 2 else if p > 2 ≥ E sup (cid:107)w(cid:107)2≤W 1 n n (cid:88) i=1 σi min (cid:107)δ(cid:107)∞≤(cid:15) w(cid:62)(xi + δ)(xi + δ)(cid:62)w × (cid:35) (cid:40) d1−2/p, 1, if 1 ≤ p ≤ 2 else if p > 2 where in the first inequality we used that, if 1 ≤ p ≤ 2, then B2(W ) ⊆ Bp(d1/p−1/2W ) and else when p > 2, we simply have that B2(W ) ⊆ Bp(W ). According to Lemma 17, we have: R ˆD( ̃f ◦ H∆H) ≥ E (cid:34) sup (cid:107)w(cid:107)2≤2W 1 n n (cid:88) i=1 σi (cid:18) w(cid:62)xi − w(cid:62)xi min (cid:26) 1, (cid:15)(cid:107)w(cid:107)1 |w(cid:62)xi| (cid:27)(cid:19)2(cid:35) (cid:40) d1−2/p, 1, × if 1 ≤ p ≤ 2 else if p > 2 . Case I: 1 ≤ p ≤ 2. First, to avoid confusion in different Rademacher variables, let us use σ(cid:48) and σ to denote the Rademacher variables in R ˆD( ̃f ◦ H∆H) and R ˆD(f ◦ H∆H). Then, let us define v(cid:48)∗ := W vmax(S(σ(cid:48))2). Then we consider the 29 gap: R ˆD( ̃f ◦ H∆H) − R ˆD(f ◦ H∆H) (cid:34) = Eσ(cid:48) sup (cid:107)w(cid:107)p≤2W (cid:34) (cid:18) 1 n n (cid:88) i=1 σ(cid:48) i w(cid:62)xi − w(cid:62)xi min (cid:27)(cid:19)2(cid:35) (cid:26) 1, (cid:15)(cid:107)w(cid:107)1 |w(cid:62)xi| − Eσ sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W (cid:35) σiw(cid:62)xix(cid:62) i w(cid:48) 1 n n (cid:88) i=1 n (cid:88) (cid:18) σ(cid:48) i v(cid:48)∗(cid:62)xi − v(cid:48)∗(cid:62)xi min (cid:26) 1, ≥ Eσ(cid:48) (cid:34) 1 n = W 2 n Eσ(cid:48) i=1 (cid:34) n (cid:88) (cid:18) σ(cid:48) i + W 2 n Eσ(cid:48) i=1 (cid:34) n (cid:88) i=1 (cid:15)(cid:107)v(cid:48)∗(cid:107)1 |v(cid:48)∗(cid:62)xi| (cid:26) (cid:27)(cid:19)2(cid:35) (cid:34) − Eσ n (cid:88) σiv∗(cid:62)xix(cid:62) i v∗ (cid:35) 1 n i=1 (cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1 |vmax(S(σ(cid:48))2)(cid:62)xi| (cid:27)(cid:19)(cid:35) −2(vmax(S(σ(cid:48))2)(cid:62)xi)2 min 1, (cid:32) σ(cid:48) i (vmax(S(σ(cid:48))2)(cid:62)xi)2 min (cid:26) 1, (cid:15)(cid:107)vmax(S(σ(cid:48))2))(cid:107)1 |vmax(S(σ(cid:48))2)(cid:62)xi| (cid:27)2(cid:33)(cid:35) Let us define and so that I(σ(cid:48)) := (cid:18) n (cid:88) i=1 σ(cid:48) i −2(vmax(S(σ(cid:48))2)(cid:62)xi)2 min (cid:26) 1, (cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1 |vmax(S(σ(cid:48))2)(cid:62)xi| (cid:27)(cid:19) J(σ(cid:48)) := n (cid:88) i=1 σ(cid:48) i (cid:32) (vmax(S(σ(cid:48))2)(cid:62)xi)2 min (cid:26) 1, (cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1 |vmax(S(σ(cid:48))2)(cid:62)xi| (cid:27)2(cid:33) , R ˆD( ̃f ◦ H∆H) − R ˆD(f ◦ H∆H) ≥ W 2 n (Eσ(cid:48) [I(σ(cid:48))] + Eσ(cid:48) [J(σ(cid:48))]) . We are now going to prove that I(σ) + I(−σ) = 0 and J(σ) + J(−σ) = 0. First we know that vmax(S(σ)2) = vmax(S(−σ)2), since S(−σ)2 = (− (cid:80)n i=1 σixix(cid:62) i )2 = S(σ)2. So I(σ) + I(−σ) = n (cid:88) i=1 σ(cid:48) i + n (cid:88) i=1 (cid:18) −2(vmax(S(σ(cid:48))2)(cid:62)xi)2 min (cid:26) 1, (cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1 max(S(σ)2)xi| |v(cid:62) (cid:27)(cid:19) (cid:18) −2(vmax(S(σ(cid:48))2)(cid:62)xi)2 min −σi (cid:26) 1, (cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1 |vmax(S(σ(cid:48))2)(cid:62)xi| (cid:27)(cid:19) Similarly J(σ) + J(−σ) = 0. = 0. According to Lemma 15, we can split {−1, +1}n into A+ and A−, such that |A+| = |A−| and A− = −A+ where − is element-wised negative sign. So we know: Eσ[I(σ)] = (cid:88) σ∈A+ 1 2n I(σ) + (cid:88) σ∈A− 1 2n I(σ) = (cid:88) σ∈A+ 1 2n I(σ) + (cid:88) σ∈A+ 1 2n I(−σ) = 0 Eσ[J(σ)] = (cid:88) σ∈A+ 1 2n J(σ) + (cid:88) σ∈A− 1 2n J(σ) = (cid:88) σ∈A+ 1 2n J(σ) + (cid:88) σ∈A+ 1 2n J(−σ) = 0 Hence we conclude that R ˆD( ̃f ◦ H∆H) ≥ R ˆD(f ◦ H∆H). Case II: p > 2. 30 Similarly we have that R ˆD( ̃f ◦ H∆H) − R ˆD(f ◦ H∆H) (cid:34) = Eσ(cid:48) sup (cid:107)w(cid:107)p≤2W (cid:34) (cid:18) 1 n n (cid:88) i=1 σ(cid:48) i w(cid:62)xi − w(cid:62)xi min (cid:27)(cid:19)2(cid:35) (cid:26) 1, (cid:15)(cid:107)w(cid:107)1 |w(cid:62)xi| (cid:35) − d1−2/pEσ sup (cid:107)w(cid:107)2≤W,(cid:107)w(cid:48)(cid:107)2≤W σiw(cid:62)xix(cid:62) i w(cid:48) 1 n n (cid:88) i=1 (cid:18) v(cid:48)∗(cid:62)xi − v(cid:48)∗(cid:62)xi min (cid:27)(cid:19)2(cid:35) (cid:26) 1, (cid:15)(cid:107)v(cid:48)∗(cid:107)1 |v(cid:48)∗(cid:62)xi| ≥ Eσ(cid:48) (cid:34) 1 n n (cid:88) i=1 σ(cid:48) i (cid:34) − d1−2/pEσ 1 n n (cid:88) i=1 (cid:35) σiv∗(cid:62)xix(cid:62) i v∗ (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 σixix(cid:62) i (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) = W 2 n (1 − d1−2/p)Eσ + + W 2 n W 2 n Eσ(cid:48) Eσ(cid:48) (cid:34) n (cid:88) i=1 (cid:34) n (cid:88) i=1 σ(cid:48) i σ(cid:48) i (cid:18) −2(vmax(S(σ(cid:48))2)(cid:62)xi)2 min (cid:26) 1, (cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1 |vmax(S(σ(cid:48))2)(cid:62)xi| (cid:27)(cid:19)(cid:35) (cid:32) (vmax(S(σ(cid:48))2)(cid:62)xi)2 min (cid:26) 1, (cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1 |vmax(S(σ(cid:48))2)(cid:62)xi| (cid:27)2(cid:33)(cid:35) ≥ W 2 n (1 − d1−2/p)Eσ (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 σixix(cid:62) i (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 . where in the last step we also use the same reasoning as in Case I. E Proofs for Linear Regression E.1 Proof of Lemma 4 In this subsection we are going to present the proof of upper bound of the Rademacher complexity for regression under linear hypothesis. Proof. We first aim at controlling the non-adversarial Rademacher complexity over the H∆H class. We specify its definition given in (2) for the linear regression setting below (cid:34) R ˆD((cid:96) ◦ H∆H) = Eσ sup w,w(cid:48):(cid:107)w(cid:107)p≤W,(cid:107)w(cid:48)(cid:107)p≤W σi(wT xi − w(cid:48)T xi)2 . (cid:35) 1 n n (cid:88) i=1 We introduce the variable change v := w − w(cid:48), which yields to R ˆD((cid:96) ◦ H∆H) = Eσ (cid:34) sup v:(cid:107)v(cid:107)p≤2W 1 n n (cid:88) i=1 (cid:35) σi(v(cid:62)xi)2 . (39) We first derive the upper bound of R ˆD((cid:96) ◦ H∆H). We follow similar steps than in Appendix D.1: we rewrite 31 the supremum as a spectral norm and then apply a matrix Bernstein inequality. We have that R ˆD((cid:96) ◦ H∆H) = Eσ sup v:(cid:107)v(cid:107)p≤2W 1 n (cid:34) (cid:34) n (cid:88) σi(v(cid:62)xi)2 (cid:35) n (cid:88) (cid:33) (cid:35) σixix(cid:62) i v i=1 (cid:32) 1 n (cid:32) v(cid:62) σixix(cid:62) i i=1 n (cid:88) i=1 (cid:35) 1 n (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 v(cid:62) sup v:(cid:107)v(cid:107)p≤2W (cid:34) sup v:(cid:107)v(cid:107)2≤2W (cid:34)(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) Eσ i=1 = Eσ (23) ≤ Eσ = 4W 2 n (cid:33) (cid:35) σixix(cid:62) i v(cid:48) * (cid:40) 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 (cid:40) 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 . × Following exactly the same steps as in Appendix D.1, we apply the matrix Bernstein inequality. Let us denote by i )2 is Zi := σixix(cid:62) a deterministic matrix. These random matrices Zi are symmetric, independent, have zero mean and are such that for all i ∈ [n] i ∈ Rd×d the random matrices we want to apply Theorem 4 to. Then, Z2 i )2 = (xix(cid:62) i (xix(cid:62) i = σ2 (cid:113) (cid:107)Zi(cid:107)2 = λmax(Z2 i ) = (cid:113) λmax(xix(cid:62) i xix(cid:62) i ) = (cid:107)xi(cid:107)2 2 ≤ max j∈[n] (cid:107)xj(cid:107)2 2 = (cid:107)X(cid:107)2 2,∞ . Moreover, let Y := (cid:80)n i=1 Zi. According to matrix Bernstein inequality, we get the desired bound R ˆD((cid:96) ◦ H∆H)  (17) ≤ 4W 2 n (cid:118) (cid:117) (cid:117) (cid:116)2  (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 (xix(cid:62) i )2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 log(2d) + 1 3  (cid:107)X(cid:107)2 2,∞ log(2d)  × (cid:40) 1 d1−2/p p ≤ 2 p > 2 . E.2 Proof of the upper bound of Theorem 2 In this subsection we will present the proof of upper bound of the adversarial Rademacher complexity for regression under linear hypothesis. Proof. We then examine the adversarial Rademacher complexity of linear regression models defined in (4) as R ˆD( ̃(cid:96) ◦ H∆H) = Eσ     sup w:(cid:107)w(cid:107)p≤W w(cid:48):(cid:107)w(cid:48)(cid:107)p≤W 1 n n (cid:88) i=1 σi max δ:(cid:107)δ(cid:107)∞≤(cid:15) (wT (xi + δ) − w(cid:48)T (xi + δ))2     . (40) We start by expressing R ˆD( ̃(cid:96) ◦ H∆H) as a function of R ˆD((cid:96) ◦ H∆H), its non-adversarial counterpart studied 32 in Lemma 4. Let v := w − w(cid:48). We expend this quantity as follows (cid:34) (cid:35) R ˆD( ̃(cid:96) ◦ H∆H) (40) = Eσ sup v:(cid:107)v(cid:107)p≤2W σi max δ:(cid:107)δ(cid:107)∞≤(cid:15) (vT xi + vT δ)2 1 n n (cid:88) i=1 n (cid:88) i=1 (cid:34) = Eσ sup v:(cid:107)v(cid:107)p≤2W 1 n σi max δ:(cid:107)δ(cid:107)∞≤(cid:15) (vT xi)2 + 2vT xivT δ + (vT δ)2 (cid:35) (cid:35) ≤ R ˆD((cid:96) ◦ H∆H) + Eσ = R ˆD((cid:96) ◦ H∆H) + Eσ (cid:124) (cid:34) (cid:34) sup v:(cid:107)v(cid:107)p≤2W sup v:(cid:107)v(cid:107)p≤2W 1 n 1 n n (cid:88) i=1 n (cid:88) i=1 σi max δ:(cid:107)δ(cid:107)∞≤(cid:15) 2vT xiδT v + (vT δ)2 v(cid:62)(2xiδ(cid:62) + δδ(cid:62))v , (41) (cid:35) (cid:125) σi max δ:(cid:107)δ(cid:107)∞≤(cid:15) (cid:123)(cid:122) A where we used the subadditivity of the supremum in to make appear the non-adversarial Rademacher complexity over H∆H class. Now we examine the upper bound of the second term A using the notion of covering recalled in Definition 7. Let C be a covering of the centered (cid:96)p ball of radius 2W , that we denote by Bp(2W ), with (cid:96)p balls of radius ρ > 0. Let us define ζi(v) := max δ:(cid:107)δ(cid:107)∞≤(cid:15) v(cid:62)(2xiδ(cid:62) + δδ(cid:62))v . Thus we can rewrite A as (cid:34) A (42) = Eσ sup v∈Bp(2W ) (cid:35) σiζi(v) 1 n n (cid:88) i=1  = Eσ    sup v∈Bp(2W ) vc∈C : (cid:107)v−vc(cid:107)p≤ρ 1 n n (cid:88) i=1 (cid:0)ζi(vc) + ζi(v) − ζi(vc)(cid:1) σi     ≤ Eσ ≤ Eσ (cid:124) (cid:34) (cid:34) sup ̃v∈C sup ̃v∈C 1 n 1 n n (cid:88) i=1 n (cid:88) i=1 (cid:123)(cid:122) (I) (cid:35) (cid:34) σiζi( ̃v) + Eσ sup v∈Bp(2W ) 1 n n (cid:88) i=1 (cid:35) σi (ζi(v) − ζi(vc)) (cid:35) σiζi( ̃v) + sup v∈Bp(2W ) (cid:124) (cid:125) 1 n n (cid:88) |ζi(v) − ζi(vc)| . i=1 (cid:123)(cid:122) (II) (cid:125) where vc is the closest element to v in C and where we used the subadditivity of the supremum. Bounding (I): We first need to bound the left-hand side term (I). We introduce the vector By Massart's lemma (Lemma 5.2 of [24]), we are able to control the first term (I) in (32): ζ( ̃v) := [ζ1( ̃v), . . . , ζn( ̃v)](cid:62) ∈ Rn . (I) = Eσ (cid:34) sup ̃v∈C 1 n n (cid:88) i=1 (cid:35) σiζi( ̃v) ≤ K(cid:112)2 log |C| n , with K given by the largest (cid:96)2-norm of ζ over the covering C, that is K 2 = max ̃v∈C (cid:107)ζ(cid:107)2 2 = max ̃v∈C n (cid:88) i=1 ζi( ̃v)2 ≤ max v∈Bp(2W ) n (cid:88) i=1 ζi(v)2 . 33 (42) (43) (44) (45) Now we examine the upper bound of K. Note that ζi(v) ≥ 0, then we can upper bound as follows ζi(v) = max δ:(cid:107)δ(cid:107)∞≤(cid:15) (cid:13) (cid:13) v(cid:62)(2xiδ(cid:62) + δδ(cid:62))v (cid:13)2xiδ(cid:62) + δδ(cid:62)(cid:13) (cid:13) (cid:13)2 (cid:13)2xiδ(cid:62)(cid:13) (cid:13) (cid:13)2 (cid:13) (cid:13) max δ:(cid:107)δ(cid:107)∞≤(cid:15) 2 max δ:(cid:107)δ(cid:107)∞≤(cid:15) (cid:18) ≤ (cid:107)v(cid:107)2 ≤ (cid:107)v(cid:107)2 2 + max δ:(cid:107)δ(cid:107)∞≤(cid:15) = (cid:107)v(cid:107)2 2 max δ:(cid:107)δ(cid:107)∞≤(cid:15) (cid:107)δ(cid:107)2 2 (cid:107)xi(cid:107)2 + max δ:(cid:107)δ(cid:107)∞≤(cid:15) (cid:107)δ(cid:107)2 (cid:18) (cid:19) (cid:13) (cid:13) (cid:13)δδ(cid:62)(cid:13) (cid:13) (cid:13)2 (cid:19) (cid:107)δ(cid:107)2≤ d(cid:107)δ(cid:107)∞ √ ≤ (cid:16)√ √ d(cid:15) (cid:107)v(cid:107)2 2 d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:17) , (46) where we applied Cauchy-Schwarz inequality and the definition of operator norm and then the subadditivity of the maximum. Recalling the case disjunction (cid:40) (cid:107)v(cid:107)2 ≤ (cid:107)v(cid:107)p , (cid:107)v(cid:107)2 ≤ (cid:107)v(cid:107)p d1/2−1/p, if 1 ≤ p ≤ 2 else if p > 2 , (47) we are able to upper bound K 2, by using (45) and (46) which leads to K 2 (45) ≤ max v∈Bp(2W ) n (cid:88) i=1 ζi(v)2 (46) ≤ max v∈Bp(2W ) √ (cid:107)v(cid:107)4 2 ( d(cid:15))2 n (cid:88) (cid:16)√ d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:17)2 (47) ≤ max v∈Bp(2W ) √ (cid:107)v(cid:107)4 p ( d(cid:15))2 (cid:16)√ i=1 n (cid:88) i=1 d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:40) (cid:17)2 * 1, (d1−2/p)2, if 1 ≤ p ≤ 2 else if p > 2 = (4W 2)2( √ d(cid:15))2 n (cid:88) (cid:16)√ d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:17)2 * i=1 (cid:40) 1, (d1−2/p)2, if 1 ≤ p ≤ 2 else if p > 2 . Then, by taking the square root in the above we get K ≤ 4W 2 (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) √ d(cid:15) (cid:16)√ i=1 d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:40) (cid:17)2 * 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 . Jointly with the application of Lemma 20, we can conclude that (I) ≤ 4 √ W 2 n d(cid:15) (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) i=1 (cid:16)√ d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:17)2(cid:112)2d log(6W/ρ) × (cid:40) 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 . (48) Bounding (II). Now we turn to bounding the second term of (43) (II) := sup v∈Bp(2W ) 1 n n (cid:88) i=1 |ζi(v) − ζi(vc)| , recalling that ζi(v) := maxδ:(cid:107)δ(cid:107)∞≤(cid:15) v(cid:62)(2xiδ(cid:62) + δδ(cid:62))v. Let i ∈ [n], v ∈ Bp(2W ) and its corresponding closest point in the covering vc ∈ C. Let us define (cid:40) δ∗ := arg max(cid:107)δ(cid:107)∞≤(cid:15) v(cid:62)(2xiδ(cid:62) + δδ(cid:62))v δ∗ c (2xiδ(cid:62) + δδ(cid:62))vc c := arg max(cid:107)δ(cid:107)∞≤(cid:15) v(cid:62) . 34 Also, let M∗ := 2xiδ∗(cid:62) + δ∗δ∗(cid:62). Then, we can make the difference explicit and upper bound it ζi(v) − ζi(vc) = v(cid:62)(2xiδ∗(cid:62) + δ∗δ∗(cid:62))v − v(cid:62) ≤ v(cid:62)(2xiδ∗(cid:62) + δ∗δ∗(cid:62))v − v(cid:62) = v(cid:62)M∗v − v(cid:62) c M∗vc = (v − vc)(cid:62)M∗v + v(cid:62) c M∗(v − vc) (cid:62))vc (cid:62) + δ∗ c (2xiδ∗ c c (2xiδ∗(cid:62) + δ∗δ∗(cid:62))vc c δ∗ c Cauchy-Schwarz ≤ (cid:107)M∗(cid:107)2 (cid:107)v − vc(cid:107)2 ((cid:107)v(cid:107)2 + (cid:107)vc(cid:107)2) √ (cid:40) (cid:16)√ (cid:17) ≤ 4ρW d(cid:15) d(cid:15) + 2 (cid:107)xi(cid:107)2 × 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 , where lastly we used the same arguments leading to (46), the norm transfer in (47) and the inequality (cid:107).(cid:107)2 ≤ √ . Symmetrically, we can show that the above upper bound holds for ζi(vc) − ζi(v). Thus, (II) is upper d (cid:107).(cid:107)∞ bounded by (II) ≤ 4ρW (cid:32)√ √ d(cid:15) d(cid:15) + 2 n n (cid:88) i=1 (cid:33) (cid:107)xi(cid:107)2 × (cid:40) 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 . (49) Let us choose ρ = W/n. We have then proved that (48)−(49) ≤ A   1 n ≤ 4W 2 (I) + (II) (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) d(cid:15) √ (cid:16)√ d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:17)2(cid:112)2d log(6W/ρ) + 4ρW √ d(cid:15) (cid:32)√ d(cid:15) + i=1 × (cid:40) (cid:33)  (cid:107)xi(cid:107)2 2 n n (cid:88) i=1 if 1 ≤ p ≤ 2 else if p > 2 1, d1−2/p,  = 4 √ d(cid:15) W 2 n  √  d(cid:15) + 2 n n (cid:88) i=1 (cid:107)xi(cid:107)2 + (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) (cid:16)√ i=1 d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:17)2(cid:112)2d log(6n)  By combining (41), (43) and the above bound, we are able to finish the proof for the upper bound of the adversarial Rademacher complexity over class H∆H for linear regression. Finally, this gives (cid:40) 1, d1−2/p, × if 1 ≤ p ≤ 2 else if p > 2 . R ˆD( ̃(cid:96) ◦ H∆H) ≤ R ˆD((cid:96) ◦ H∆H) √  √ d(cid:15)  d(cid:15) + (cid:107)xi(cid:107)2 + + 4 W 2 n n (cid:88) 2 n (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) (cid:16)√ d(cid:15) + 2 (cid:107)xi(cid:107)2 (cid:17)2(cid:112)2d log(6n)   i=1 i=1 (cid:40) 1, d1−2/p, × if 1 ≤ p ≤ 2 else if p > 2 . E.3 Proof of the lower bound of Theorem 2 In this subsection we present the proof of lower bound of the adversarial Rademacher complexity for regression under linear hypothesis. 35 Proof. Recall the definition of non-adversarial Rademacher complexity R ˆD((cid:96) ◦ H∆H) (cid:34) (39) = E (cid:35) σi(v(cid:62)xi)2 1 n n (cid:88) i=1 sup (cid:107)v(cid:107)p≤2W (cid:34) E sup (cid:107)v(cid:107)2≤2W Lemma 8 ≤ 1 n n (cid:88) i=1 (cid:35) σi(v(cid:62)xi)2 * (cid:40) 1, d1−2/p, if 1 ≤ p ≤ 2 else if p > 2 , due to equivalence of norms. Now, we denote v∗ such that v∗ = arg max(cid:107)v(cid:107)2≤2W verify that the maximum value of 1 n i=1 σi(v(cid:62)xi)2 is: (cid:80)n 1 n (cid:80)n i=1 σi(v(cid:62)xi)2. One can sup (cid:107)v(cid:107)2≤2W 1 n n (cid:88) σi(v(cid:62)xi)2 = 1 n sup (cid:107)v(cid:107)2≤2W v(cid:62) (cid:32) n (cid:88) i=1 (cid:33) σixix(cid:62) i v ≤ 4W 2 n (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 σixix(cid:62) i (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 i=1 and if we define S(σ) := (cid:80)n Now, we switch to adversarial Rademacher: i=1 σixix(cid:62) i the maxima is attained when v∗ = 2W vmax(S(σ)2). R ˆD( ̃(cid:96) ◦ H∆H) = E (cid:34) Lemma 14 ≥ sup (cid:107)v(cid:107)p≤2W (cid:34) E sup (cid:107)v(cid:107)2≤2W 1 n n (cid:88) i=1 σi max (cid:107)δ(cid:107)∞≤(cid:15) (v(cid:62)(xi + δ))2 (cid:35) 1 n n (cid:88) i=1 σi max (cid:107)δ(cid:107)∞≤(cid:15) (v(cid:62)(xi + δ))2 * (cid:35) (cid:40) d1−2/p, 1, if 1 ≤ p ≤ 2 else if p > 2 According to Lemma 16, we have: R ˆD( ̃(cid:96) ◦ H∆H) = E (cid:34) sup (cid:107)v(cid:107)2≤2W 1 n n (cid:88) i=1 σi((cid:15)(cid:107)v(cid:107)1 + |v(cid:62)xi|)2 * (cid:35) (cid:40) d1−2/p, 1, if 1 ≤ p ≤ 2 else if p > 2 . Case I: 1 ≤ p ≤ 2: First, to avoid confusion in different Rademacher variables, let us use σ(cid:48) and σ to denote the Rademacher variables in R ˆD( ̃(cid:96) ◦ H∆H) and R ˆD((cid:96) ◦ H∆H). Then, let us define v(cid:48)∗ := 2W vmax(S(σ(cid:48))2) R ˆD( ̃(cid:96) ◦ H∆H) − R ˆD((cid:96) ◦ H∆H) (cid:34) (cid:35) (cid:34) 1 n n (cid:88) i=1 = Eσ(cid:48) sup (cid:107)v(cid:107)p≤2W σ(cid:48) i((cid:15)(cid:107)v(cid:107)1 + |v(cid:62)xi|)2 − Eσ sup (cid:107)v(cid:107)2≤2W ≥ Eσ(cid:48) (cid:34) 1 n n (cid:88) i=1 i((cid:15)(cid:107)v(cid:48)∗(cid:107)1 + |v(cid:48)∗(cid:62)xi|)2 σ(cid:48) (cid:35) − Eσ (cid:34) 1 n n (cid:88) i=1 σi(v∗(cid:62)xi)2 (cid:35) σi(v(cid:62)xi)2 1 n n (cid:88) i=1 (cid:35) = 4W 2 n Eσ(cid:48) (cid:34) n (cid:88) i=1 σ(cid:48) i (cid:0)2(cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1|v(cid:62) max(S(σ(cid:48))2)xi| + (cid:15)2(cid:107)vmax(S(σ(cid:48))2)(cid:107)2 1 (cid:35) (cid:1) (cid:1), and we claim that J(σ) + J(−σ) = Let J(σ) = (cid:80)n 0. Now we are going to prove this claim. First we know that vmax(S(σ)2) = vmax(S(−σ)2), since S(−σ)2 = (− (cid:80)n max(S(σ)2)xi| + (cid:15)2(cid:107)vmax(S(σ)2)(cid:107)2 1 (cid:0)2(cid:15)(cid:107)vmax(S(σ)2)(cid:107)1|v(cid:62) i=1 σi i=1 σixix(cid:62) i )2 = S(σ)2. So J(σ) + J(−σ) = n (cid:88) i=1 σi + n (cid:88) i=1 = 0. (cid:0)2(cid:15)(cid:107)vmax(S(σ)2)(cid:107)1|v(cid:62) max(S(σ)2)xi| + (cid:15)2(cid:107)vmax(S(σ)2)(cid:107)2 1 (cid:1) −σi (cid:0)2(cid:15)(cid:107)vmax(S(σ)2)(cid:107)1|v(cid:62) max(S(σ)2)xi| + (cid:15)2(cid:107)vmax(S(σ)2)(cid:107)2 1 (cid:1) 36 According to Lemma 15, we can split {−1, +1}n into A+ and A−, such that |A+| = |A−| and A− = −A+ where − is element-wised negative sign. So we know: Eσ[J(σ)] = (cid:88) σ∈A+ 1 2n J(σ) + (cid:88) σ∈A− 1 2n J(σ) = (cid:88) σ∈A+ 1 2n J(σ) + (cid:88) σ∈A+ 1 2n J(−σ) = 0 Hence we conclude that R ˆD( ̃(cid:96) ◦ H∆H) ≥ R ˆD((cid:96) ◦ H∆H). Case II: p > 2: Similarly we have: (cid:35) (cid:34) i((cid:15)(cid:107)v(cid:107)1 + |v(cid:62)xi|)2 σ(cid:48) − d1−2/pEσ sup (cid:107)v(cid:107)2≤2W i((cid:15)(cid:107)v(cid:48)∗(cid:107)1 + |v(cid:48)∗(cid:62)xi|)2 σ(cid:48) (cid:35) − d1−2/pEσ (cid:34) 1 n n (cid:88) i=1 σi(v∗(cid:62)xi)2 (cid:35) σi(v(cid:62)xi)2 1 n n (cid:88) i=1 (cid:35) (cid:0)(cid:15)(cid:107)vmax(S(σ(cid:48))2)(cid:107)1|v(cid:62) max(S(σ(cid:48))2)xi| + (cid:15)2(cid:107)vmax(S(σ(cid:48))2)(cid:107)2 1 (cid:35) (cid:1) R ˆD( ̃(cid:96) ◦ H∆H) − R ˆD((cid:96) ◦ H∆H) 1 n n (cid:88) i=1 (cid:34) = Eσ(cid:48) sup (cid:107)v(cid:107)p≤2W ≥ Eσ(cid:48) (cid:34) 1 n n (cid:88) i=1 = (1 − d1−2/p) 4W 2 n E + 4W 2 n (cid:34) Eσ(cid:48) 2 n (cid:88) σ(cid:48) i ≥ (1 − d1−2/p) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 σixix(cid:62) i (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 i=1 4W 2 n E (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) n (cid:88) i=1 σixix(cid:62) i (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 , where in the last step we also use the same reasoning as in Case I. F Proof of Neural Network Complexity Bound in the Binary Classifi- cation Setting In this section, we will present the proof of upper bound of the adversarial Rademacher complexity under two-layer neural network hypothesis. We provide the proof for the binary classification setting. Proof of the classification bound of Theorem 3. We recall that Bp(R) stands for the (cid:96)p ball of radius R in vector space Rd. To simplify notations, we denote the coordinate-wise ReLU activation function by g : Rd → Rd, x (cid:55)→ max{0, x}, where max operator is applied coordinate-wisely. So, for an input vector x ∈ Rd, the output of a two-layer neural network can be written as a(cid:62)g(Wx) = (cid:80)m r=1 a(r)g(w(r)(cid:62)x). Using the definition of the ̃f ◦ H∆H class in (10), we upper bound the adversarial Rademacher complexity in the binary classification setting by expressing it as its non-adversarial counterpart plus an additional term. Thus we get R ˆD( ̃f ◦ H∆H) (11) = Eσ     sup a,a(cid:48)∈B1(A)2 W,W(cid:48) : w(r),w(cid:48)(r)∈Bp(W )2 1 n n (cid:88) i=1 σi min (cid:107)δ(cid:107)∞≤(cid:15) a(cid:62)g(W(xi + δ))a(cid:48)(cid:62)g(W(cid:48)(xi + δ))      = Eσ    sup a,a(cid:48)∈B1(A)2 w(r),w(cid:48)(r)∈Bp(W )2 1 n n (cid:88) i=1 σi min (cid:107)δ(cid:107)∞≤(cid:15) (cid:32) m (cid:88) r=1 a(r)g(w(r)(cid:62)(xi + δ)) (cid:33) (cid:32) m (cid:88) r=1 a(r)(cid:48)g(w(cid:48)(r)(cid:62)(xi + δ)) 37 (cid:33)     . As the function δ (cid:55)→ a(cid:62)g(W(xi + δ))a(cid:48)(cid:62)g(W(cid:48)(xi + δ)) is continuous as a composition of continuous function (linear and ReLU), then it reaches a minimum of the compact (cid:96)∞ ball of radius (cid:15) > 0, also denoted by B∞((cid:15)). Let i ∈ arg minδ∈B∞((cid:15)) a(cid:62)g(W(xi + δ))a(cid:48)(cid:62)g(W(cid:48)(xi + δ)). δ∗ i With this notation, we can write an argument of the minima of the latter function, i.e. δ∗     R ˆD( ̃f ◦ H∆H) = Eσ sup a,a(cid:48)∈B1(A)2 w(r),w(cid:48)(r)∈Bp(W )2,∀r∈[d] n (cid:88) i=1 σi (cid:32) m (cid:88) r=1 a(r)g(w(r)(cid:62)(xi + δ∗ i )) (cid:33) (cid:32) m (cid:88) r=1 a(r)(cid:48)g(w(cid:48)(r)(cid:62)(xi + δ∗ i )) (cid:33)     . 1 n Let CA be a ρ1-covering of the (cid:96)p ball B1(A) with ρ > 0, and CW be a ρ2-covering of the (cid:96)p ball Bp(W ) with ρ2 > 0. Let us define ψi(a, a(cid:48), W, W(cid:48)) := min (cid:107)δ(cid:107)∞≤(cid:15) (cid:32) m (cid:88) (cid:32) m (cid:88) r=1 a(r)g(w(r)(cid:62)(xi + δ)) (cid:33) (cid:32) m (cid:88) r=1 a(r)(cid:48)g(w(cid:48)(r)(cid:62)(xi + δ)) (cid:33) = a(r)g(w(r)(cid:62)(xi + δ∗ i )) (cid:33) (cid:32) m (cid:88) a(r)(cid:48)g(w(cid:48)(r)(cid:62)(xi + δ∗ i )) , (50) (cid:33) r=1 r=1 Thus we can rewrite R ˆD( ̃f ◦ H∆H) as  R ˆD( ̃f ◦ H∆H) = Eσ    sup a,a(cid:48)∈B1(A)2 W,W(cid:48) : w(r),w(cid:48)(r)∈Bp(W )2,∀r∈[d]  1 n n (cid:88) i=1 σiψi(a, a(cid:48), W, W(cid:48))                    ≤ Eσ ac,a(cid:48) sup a,a(cid:48)∈B1(A)2 A:(cid:107)a−ac(cid:107)1≤ρ1,(cid:107)a(cid:48)−a(cid:48) c(cid:107)1 c∈C2 W,W(cid:48) : w(r),w(cid:48)(r)∈Bp(W )2 Wc,W(cid:48) c : wc(r),w(cid:48) W : c(r)(cid:107)p c(r)∈C2 (cid:107)w(r)−wc(r)(cid:107)p≤ρ2,(cid:107)w(cid:48)(r)−w(cid:48) ≤ρ1 ≤ρ2 1 n n (cid:88) i=1 σi (ψi(ac, a(cid:48) c, Wc, W(cid:48) c) + ψi(a, a(cid:48), W, W(cid:48)) − ψi(ac, a(cid:48) c, Wc, W(cid:48) c))                 , where wc(r), respectively w(cid:48) c(r), is the closest element to w(r), resp. w(cid:48)(r), in CW , and so is ac, respectively a(cid:48) c 38 the closest element to a, resp. a(cid:48), within CA. Using the subadditivity of the supremum, we get R ˆD( ̃f ◦ H∆H) ≤ Eσ     sup ac,a(cid:48) c∈C2 c : wc(r),w(cid:48) A Wc,W(cid:48) c(r)∈C2 W  1 n n (cid:88) i=1 σiψi(ac, a(cid:48) c, Wc, W(cid:48) c)    1 n n (cid:88) i=1 ≤ρ1 σi (ψi(a, a(cid:48), W, W(cid:48)) − ψi(ac, a(cid:48) c, Wc, W(cid:48) c))                1 n n (cid:88) i=1 ≤ρ1 |ψi(a, a(cid:48), W, W(cid:48)) − ψi(ac, a(cid:48) c, Wc, W(cid:48) c)|                + Eσ     ≤ Eσ ac,a(cid:48) c∈C2 sup a,a(cid:48)∈B1(A)2 A:(cid:107)a−ac(cid:107)1≤ρ1,(cid:107)a(cid:48)−a(cid:48) W,W(cid:48) : w,w(cid:48)∈Bp(W )2 c(r)∈C2 c : wc(r),w(cid:48) (cid:107)w(r)−wc(r)(cid:107)p≤ρ2,(cid:107)w(cid:48)(r)−w(cid:48) Wc,W(cid:48) c(cid:107)1 W : c(r)(cid:107)p ≤ρ2 sup ac,a(cid:48) c∈C2 c : wc(r),w(cid:48) A Wc,W(cid:48) c(r)∈C2 W 1 n n (cid:88) i=1 σiψi(ac, a(cid:48) c, Wc, W(cid:48) c)     + ac,a(cid:48) c∈C2 sup a,a(cid:48)∈B1(A)2 A:(cid:107)a−ac(cid:107)1≤ρ1,(cid:107)a(cid:48)−a(cid:48) W,W(cid:48) : w,w(cid:48)∈Bp(W )2 c(r)∈C2 c : wc(r),w(cid:48) (cid:107)w(r)−wc(r)(cid:107)p≤ρ2,(cid:107)w(cid:48)(r)−w(cid:48)  Wc,W(cid:48) c(cid:107)1 W : c(r)(cid:107)p ≤ Eσ    sup ac,a(cid:48) c∈C2 c : wc(r),w(cid:48) A Wc,W(cid:48) c(r)∈C2 W (cid:124) + max i∈[n] (cid:124) ac,a(cid:48) c∈C2 sup a,a(cid:48)∈B1(A)2 A:(cid:107)a−ac(cid:107)1≤ρ1,(cid:107)a(cid:48)−a(cid:48) W,W(cid:48) : w,w(cid:48)∈Bp(W )2 c(r)∈C2 c : wc(r),w(cid:48) (cid:107)w(r)−wc(r)(cid:107)p≤ρ2,(cid:107)w(cid:48)(r)−w(cid:48) Wc,W(cid:48) c(cid:107)1 W : c(r)(cid:107)p ≤ρ2 σiψi(ac, a(cid:48) c, Wc, W(cid:48) c)     (cid:125) 1 n n (cid:88) i=1 (cid:123)(cid:122) (I) |ψi(a, a(cid:48), W, W(cid:48)) − ψi(ac, a(cid:48) c, Wc, W(cid:48) c)| . (51) ≤ρ1 ≤ρ2 (cid:123)(cid:122) (II) (cid:125) Bounding (I): We first need to bound the left-hand side term (I). We introduce the vector ψ(ac, a(cid:48) c, Wc, W(cid:48) c) := [ψ1(ac, a(cid:48) c, Wc, W(cid:48) c), . . . , ψn(ac, a(cid:48) c, Wc, W(cid:48) c)](cid:62) ∈ Rn . By Massart's lemma (Lemma 5.2 of [24]), we are able to control the first term (I) in (51): (I) = Eσ     sup ac,a(cid:48) c∈C2 c : wc(r),w(cid:48) A Wc,W(cid:48) c(r)∈C2 W 1 n n (cid:88) i=1 σiψi(ac, a(cid:48) c, Wc, W(cid:48) c)     K(cid:112)2 log(|CA|2|CW |2m) n , ≤ (52) 39 with K given by the largest (cid:96)2-norm of ψ over the covering CA and CW , that is K 2 = = ≤ max ac,a(cid:48) c∈C2 c : wc(r),w(cid:48) A Wc,W(cid:48) c(r)∈C2 W max ac,a(cid:48) c∈C2 c : wc(r),w(cid:48) A Wc,W(cid:48) c(r)∈C2 W (cid:107)ψ(cid:107)2 2 n (cid:88) i=1 ψi(ac, a(cid:48) c, Wc, W(cid:48) c)2 max c∈B1(A)2 ac,a(cid:48) Wc,W(cid:48) c : wc(r),w(cid:48) c(r)∈Bp(W )2 n (cid:88) i=1 ψi(ac, a(cid:48) c, Wc, W(cid:48) c)2 . (53) Now we examine the upper bound of K. Let q be such that 1 = 1/p + 1/q. We start by upper bounding ψi as follows |ψi(ac, a(cid:48) c, Wc, W(cid:48) c)| c(r)g(w(cid:48) a(cid:48) c(r)(cid:62)(xi + δ∗ i )) ac(r)g(wc(r)(cid:62)(xi + δ∗ i )) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) * (50) ≤ m (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) r=1 (cid:32) m (cid:88) m (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) r=1 (cid:33) (cid:32) m (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:33) ≤ ≤ |ac(r)||g(wc(r)(cid:62)(xi + δ∗ i ))| |a(cid:48) c(r)||g(w(cid:48) c(r)(cid:62)(xi + δ∗ i ))| r=1 (cid:32) (cid:107)wc(r)(cid:107)p (cid:107)xi + δ∗ i (cid:107)q m (cid:88) r=1 r=1 (cid:33) (cid:32) |ac(r)| (cid:107)w(cid:48) c(r)(cid:107)p (cid:107)xi + δ∗ i (cid:107)q (cid:33) |a(cid:48) c(r)| m (cid:88) r=1 ac,a(cid:48) wc(r),w(cid:48) c∈B1(A)2 c(r)∈Bp(W )2 ≤ A2W 2 (cid:107)xi + δ∗ i (cid:107)2 q (cid:107)δ(cid:107)q≤d1/q(cid:107)δ(cid:107)∞ ≤ 2A2W 2((cid:107)xi(cid:107)2 q + d2/q(cid:15)2) , (54) where we applied Cauchy-Schwarz inequality, the definition of operator norm and then the subadditivity of the maximum. We are able to upper bound K 2, by using (53) and (54) which leads to K 2 (53) ≤ ac,a(cid:48) wc(r),w(cid:48) max c∈B1(A)2 c(r)∈Bp(W )2 n (cid:88) i=1 ψi(ac, a(cid:48) c, Wc, W(cid:48) c)2 (54) ≤ 4A4W 4 n (cid:88) (cid:16) i=1 (cid:107)xi(cid:107)2 q + d2/q(cid:15)2(cid:17)2 . Then, by taking the square root in the above we get K ≤ 2A2W 2 (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) (cid:16) i=1 (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 (cid:17)2 . Jointly with the application of Lemma 20, we can conclude that 2A2W 2 (52) ≤ (I) (cid:114) (cid:80)n i=1 (cid:16) (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 (cid:17)2(cid:112)4m log(3A/ρ1) + 4md log(3W/ρ2) n 40 . (55) Bounding (II). Now we turn to bounding the second term of (51) (II) := max i∈[n] ac,a(cid:48) c∈C2 sup a,a(cid:48)∈B1(A)2 A:(cid:107)a−ac(cid:107)1≤ρ1,(cid:107)a(cid:48)−a(cid:48) W,W(cid:48) : w,w(cid:48)∈Bp(W )2 c : wc(r),w(cid:48) c(r)∈C2 (cid:107)w(r)−wc(r)(cid:107)p≤ρ2,(cid:107)w(cid:48)(r)−w(cid:48) Wc,W(cid:48) c(cid:107)1 W : c(r)(cid:107)p ≤ρ2 |ψi(a, a(cid:48), W, W(cid:48)) − ψi(ac, a(cid:48) c, Wc, W(cid:48) c)| . ≤ρ1 Recalling that ac, resp. wc(r), is ρ1, reps. ρ2, close to a, resp. w(r), in the covering CA, resp. CW . And so are c, w(cid:48) a(cid:48) c(r). Let us define and δ∗ i := arg min (cid:107)δ(cid:107)∞≤(cid:15) δ∗ c,i := arg min (cid:107)δ(cid:107)∞≤(cid:15) (cid:32) m (cid:88) r=1 (cid:32) m (cid:88) r=1 a(r)g(w(r)(cid:62)(xi + δ)) (cid:33) (cid:32) m (cid:88) r=1 a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ)) , (cid:33) ac(r)g(w(r)(cid:62)(xi + δ)) (cid:33) (cid:32) m (cid:88) r=1 c(r)g(w(cid:48)(r)(cid:62)(xi + δ)) a(cid:48) . (cid:33) Then, we can make the difference explicit and upper bound it ψi(a, a(cid:48), W, W(cid:48)) − ψi(ac, a(cid:48) (cid:32) m (cid:88) (50) = a(r)g(w(r)(cid:62)(xi + δ∗ i )) c, Wc, W(cid:48) c) (cid:33) (cid:32) m (cid:88) a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ i )) (cid:33) r=1 (cid:32) m (cid:88) r=1 − ac(r)g(wc(r)(cid:62)(xi + δ∗ c,i)) r=1 (cid:33) (cid:32) m (cid:88) r=1 c(r)g(w(cid:48) a(cid:48) c(r)(cid:62)(xi + δ∗ c,i)) (cid:32) m (cid:88) (56) ≤ a(r)g(w(r)(cid:62)(xi + δ∗ c,i)) (cid:33) (cid:32) m (cid:88) a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) (cid:33) r=1 (cid:32) m (cid:88) r=1 − ac(r)g(wc(r)(cid:62)(xi + δ∗ c,i)) r=1 (cid:33) (cid:32) m (cid:88) r=1 c(r)g(w(cid:48) a(cid:48) c(r)(cid:62)(xi + δ∗ c,i)) (cid:32) m (cid:88) = a(r)g(w(r)(cid:62)(xi + δ∗ c,i)) (cid:33) (cid:32) m (cid:88) a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) (cid:33) (cid:33) (cid:33) r=1 (cid:32) m (cid:88) r=1 (cid:32) m (cid:88) r=1 (cid:32) m (cid:88) r=1 − + − r=1 (cid:34) m (cid:88) r=1 + a(r)g(w(r)(cid:62)(xi + δ∗ c,i)) r=1 (cid:33) (cid:32) m (cid:88) a(r)g(w(r)(cid:62)(xi + δ∗ c,i)) r=1 (cid:33) (cid:32) m (cid:88) c(r)g(w(cid:48) a(cid:48) c(r)(cid:62)(xi + δ∗ c,i)) c(r)g(w(cid:48) a(cid:48) c(r)(cid:62)(xi + δ∗ c,i)) ac(r)g(wc(r)(cid:62)(xi + δ∗ c,i)) r=1 (cid:33) (cid:32) m (cid:88) r=1 c(r)g(w(cid:48) a(cid:48) c(r)(cid:62)(xi + δ∗ c,i)) (cid:33) (cid:33) (cid:33) (cid:32) m (cid:88) = a(r)g(w(r)(cid:62)(xi + δ∗ c,i)) (cid:33) (cid:34) m (cid:88) r=1 a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) − a(cid:48) c(r)g(w(cid:48) c(r)(cid:62)(xi + δ∗ (cid:35) c,i)) a(r)g(w(r)(cid:62)(xi + δ∗ c,i)) − ac(r)g(wc(r)(cid:62)(xi + δ∗ c,i)) (cid:35) (cid:32) m (cid:88) r=1 c(r)g(w(cid:48) a(cid:48) c(r)(cid:62)(xi + δ∗ c,i)) 41 (56) (57) (58) (cid:33) . (59) We examine the first term in the above: (cid:32) m (cid:88) a(r)g(w(r)(cid:62)(xi + δ∗ c,i)) (cid:33) (cid:34) m (cid:88) a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) − a(cid:48) c(r)g(w(cid:48) c(r)(cid:62)(xi + δ∗ c,i)) (cid:35) r=1 ≤ m (cid:88) r=1 r=1 |a(r)||g(w(r)(cid:62)(xi + δ∗ c,i))| m (cid:88) r=1 (cid:12) (cid:12)a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) − a(cid:48) c(r)g(w(cid:48) c(r)(cid:62)(xi + δ∗ c,i))(cid:12) (cid:12) ≤ AW (cid:13) (cid:13)xi + δ∗ c,i (cid:13) (cid:13)q m (cid:88) r=1 (cid:124) (cid:12) (cid:12)a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) − a(cid:48) c(r)g(w(cid:48) c(r)(cid:62)(xi + δ∗ c,i))(cid:12) (cid:12) , (60) (cid:123)(cid:122) Σ (cid:125) where in the first inequality we apply the triangle inequality, and then the Cauchy-Schwartz inequality with the fact that (cid:107)a(cid:107)1 ≤ A and (cid:107)w(r)(cid:107)p ≤ W . Now, we bound Σ as: m (cid:88) r=1 m (cid:88) r=1 = ≤ m (cid:88) r=1 (cid:12) (cid:12)a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) − a(cid:48) c(r)g(w(cid:48) c(r)(cid:62)(xi + δ∗ c,i))(cid:12) (cid:12) |a(cid:48)(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) − a(cid:48) c(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) + a(cid:48) c(r)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) − a(cid:48) c(r)(cid:62)(xi + δ∗ c(r)g(w(cid:48) m (cid:88) c(r)| (cid:12) c,i))(cid:12) |a(cid:48) (cid:12) + c,i))| r=1 |a(cid:48)(r) − a(cid:48) c(r)| (cid:12) (cid:12)g(w(cid:48)(r)(cid:62)(xi + δ∗ (cid:12)g(w(cid:48)(r)(cid:62)(xi + δ∗ c,i)) − g(w(cid:48) c(r)(cid:62)(xi + δ∗ c,i))(cid:12) (cid:12) , where we use the triangle inequality. Now, by using the 1-Lipschitzness of g and applying Cauchy-Schwarz inequality, followed by the fact that w ∈ Bp(W ) and that (cid:107)a(cid:48) − a(cid:48) c(r)| ≤ ρ1 we can bound the left-hand term in the above. For the right-hand side term we use also the 1-Lipschitzness of g and Cauchy-Schwarz inequality, then leverage the fact that (cid:107)w(cid:48)(r) − w(cid:48) r=1 |a(cid:48)(r) − a(cid:48) c(cid:107)1 = (cid:80)m c(r)(cid:107)p ≤ ρ2 and also that a ∈ B1(A) and we have: (cid:13) (cid:13)q Σ ≤ ρ1W (cid:13) (cid:13) (cid:13)xi + δ∗ (cid:13)q c,i = (ρ1W + ρ2A) (cid:13) (cid:13)xi + δ∗ c,i + ρ2A (cid:13) (cid:13)xi + δ∗ c,i (cid:13) . (cid:13)q Plugging the bound for Σ back to (60), and performing the same steps for the second difference term in (59) yields: ψi(a, a(cid:48), W, W(cid:48)) − ψi(ac, a(cid:48) c, Wc, W(cid:48) c) ≤ 2AW (ρ1W + Aρ2) (cid:13) (cid:13)xi + δ∗ c,i ≤ 4AW (ρ1W + Aρ2) ((cid:107)xi(cid:107)2 (cid:13) 2 (cid:13) q q + d2/q(cid:15)2) , where we again use the fact (cid:107)δ(cid:107)q ≤ d1/q (cid:107)δ(cid:107)∞ . By the same means, we can bound the reverse difference: ψi(a, a(cid:48), W, W(cid:48)) − ψi(ac, a(cid:48) c, Wc, W(cid:48) c) ≤ 4AW (ρ1W + Aρ2) ((cid:107)xi(cid:107)2 q + d2/q(cid:15)2) . Thus, (II) is upper bounded by Let us choose ρ1 = A/n and ρ2 = W/n. Then the upper bound of (I) becomes (II) ≤ 4AW (ρ1W + Aρ2) ((cid:107)xi(cid:107)2 q + d2/q(cid:15)2) . (55) ≤ (I) 2 n A2W 2 (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) (cid:16) i=1 (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 (cid:17)2(cid:112)(1 + d)4m log(3n) , 42 (61) (62) and the one of (II) becomes (II) (61) ≤ 8 n A2W 2 (cid:18) max i∈[n] (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 (cid:19) . (63) Finally, we have then proved that R ˆD( ̃f ◦ H∆H) (51) ≤ (I) + (II) (62) & (63) ≤ 2 n A2W 2 (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) (cid:16) i=1 (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 (cid:17)2(cid:112)(1 + d)4m log(3n) + = 2 n A2W 2   (cid:118) (cid:117) (cid:117) (cid:116) n (cid:88) i=1 (cid:16) (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 (cid:17)2(cid:112)(1 + d)4m log(3n) + 4 8 n (cid:18) A2W 2 (cid:18) max i∈[n] (cid:107)xi(cid:107)2 q + d2/q(cid:15)2 (cid:19) max i∈[n] (cid:107)xi(cid:107)2 q + d2/q(cid:15)2  (cid:19)  . G Proof of Lemma 5 In this section we present the proof of Lemma 5. Proof. The proof idea is to show that, by perturbing the standard risk on T within the adversary set, the perturbed risk can approximate the standard risk on T (cid:48) with some error. First, let us define a perturbed risk for any perturbation (64) (65) (66) (67) RT (hw, y, δ) := Ex∼T [(cid:96)(hw(x + δ), y(x)] (cid:88) = p(x) 1 2 | sign(w(x + δ(x)) − y(x)| x∈X (cid:16) = p(cid:62) ̃(cid:96) {δi}|X | i=1 (cid:17) . We then recall the definition of the standard risk on T (cid:48) RT (cid:48)(hw, y) = (cid:88) p(cid:48)(x) x∈X = p(cid:48)(cid:62)(cid:96) . 1 2 | sign(w(cid:62)x) − y(x)| We recall the definition of adversarially robust risk over domain T for the labeling function y(*) (cid:101)Rlabel T (hw, y) = Ex∼T (cid:20) max (cid:107)δ(cid:107)∞≤(cid:15) (cid:96)(hw(w + δ), y(x)) . (cid:21) So, for any δ such that (cid:107)δ(cid:107)∞ ≤ (cid:15), we get that RT (cid:48)(hw, y) − (cid:101)Rlabel T (hw, y) (64)−(67) ≤ RT (cid:48)(hw, y) − RT (hw, y, δ) (65)−(66) = p(cid:48)(cid:62)(cid:96) − p(cid:62) ̃(cid:96)({δi}|X | i=1) . Since the above inequality holds for any δ such that (cid:107)δ(cid:107)∞ ≤ (cid:15), we must have RT (cid:48)(hw, y) − (cid:101)Rlabel T (hw, y) ≤ min (cid:107)δi(cid:107)∞≤(cid:15) |p(cid:48)(cid:62)(cid:96) − p(cid:62) ̃(cid:96)({δi}|X | i=1)| . Now, let's examine the coordinates in Λ. For i-th coordinate, if it is in Λ, we know that −(cid:15)(cid:107)w(cid:107)1 ≤ w(cid:62)xi ≤ (cid:15)(cid:107)w(cid:107)1 , 43 which implies that, there is a δ that can change the sign of sign(w(x + δ)), and hence change the value of ̃(cid:96)i. That is, if w(cid:62)xy(x) ≥ 0, there is a δ∗ = arg min(cid:107)δ(cid:107)∞≤(cid:15) w(cid:62)δy(x), such that w(cid:62)(x + δ∗)y(x) = w(cid:62)xy(x) − (cid:15)(cid:107)w(cid:107)1 ≤ 0 . Similarly, if w(cid:62)xy(x) ≤ 0, there is a δ∗ = arg max(cid:107)δ(cid:107)∞≤(cid:15) w(cid:62)δy(x), such that: w(cid:62)xy(x) + w(cid:62)δ∗y(x) = w(cid:62)xy(x) + (cid:15)(cid:107)w(cid:107)1 ≥ 0 . Finally, we get min (cid:107)δi(cid:107)∞≤(cid:15)   |p(cid:48)(cid:62)(cid:96) − p(cid:62) ̃(cid:96)({δi}|X | i=1)| (cid:12) (cid:12) (cid:12)p(cid:62) ̃(cid:96) − p(cid:48)(cid:62)(cid:96) (cid:12) (cid:12) (cid:12) ̃(cid:96)i = (cid:96)i, ∀ i ∈ [N ] \ Λ min ̃(cid:96)∈{0,1}N s.t.  = = V ∗(p(cid:48), p, (cid:96), Λ) . H Details on Experiments In Table 2, we present the details of the convolutional network. For the convolutional layer (Conv2D or Conv1D), the first argument is the number channel. For a fully connected layer (FC), we list the number of hidden units as the first argument. Layer conv1 bn1 conv2 bn2 conv3 bn3 fc1 bn4 fc2 bn5 fc3 Table 2: Convolutional network architecture. Details feature extractor Conv2D(64, kernel size=5, stride=1, padding=2) BN2D, RELU, MaxPool2D(kernel size=2, stride=2) Conv2D(64, kernel size=5, stride=1, padding=2) BN2D, ReLU, MaxPool2D(kernel size=2, stride=2) Conv2D(128, kernel size=5, stride=1, padding=2) BN2D, ReLU classifier FC(2048) BN1D, ReLU FC(512) BN1D, ReLU FC(10) 44
http://arxiv.org/abs/2302.12349v1
2023-02-23T22:07:33
2023-02-23T22:07:33
Reward Learning as Doubly Nonparametric Bandits: Optimal Design and Scaling Laws
Specifying reward functions for complex tasks like object manipulation or driving is challenging to do by hand. Reward learning seeks to address this by learning a reward model using human feedback on selected query policies. This shifts the burden of reward specification to the optimal design of the queries. We propose a theoretical framework for studying reward learning and the associated optimal experiment design problem. Our framework models rewards and policies as nonparametric functions belonging to subsets of Reproducing Kernel Hilbert Spaces (RKHSs). The learner receives (noisy) oracle access to a true reward and must output a policy that performs well under the true reward. For this setting, we first derive non-asymptotic excess risk bounds for a simple plug-in estimator based on ridge regression. We then solve the query design problem by optimizing these risk bounds with respect to the choice of query set and obtain a finite sample statistical rate, which depends primarily on the eigenvalue spectrum of a certain linear operator on the RKHSs. Despite the generality of these results, our bounds are stronger than previous bounds developed for more specialized problems. We specifically show that the well-studied problem of Gaussian process (GP) bandit optimization is a special case of our framework, and that our bounds either improve or are competitive with known regret guarantees for the Mat\'ern kernel.
[ "Kush Bhatia", "Wenshuo Guo", "Jacob Steinhardt" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12349v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12349v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "stat.ML" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 9 4 3 2 1 . 2 0 3 2 : v i X r a Reward Learning as Doubly Nonparametric Bandits: Optimal Design and Scaling Laws Kush Bhatia Stanford University [email protected] Wenshuo Guo UC Berkeley [email protected] Jacob Steinhardt UC Berkeley [email protected] Abstract 1 Introduction Specifying reward functions for complex tasks like object manipulation or driving is challeng- ing to do by hand. Reward learning seeks to ad- dress this by learning a reward model using hu- man feedback on selected query policies. This shifts the burden of reward specification to the op- timal design of the queries. We propose a theoret- ical framework for studying reward learning and the associated optimal experiment design prob- lem. Our framework models rewards and policies as nonparametric functions belonging to subsets of Reproducing Kernel Hilbert Spaces (RKHSs). The learner receives (noisy) oracle access to a true reward and must output a policy that per- forms well under the true reward. For this set- ting, we first derive non-asymptotic excess risk bounds for a simple plug-in estimator based on ridge regression. We then solve the query design problem by optimizing these risk bounds with re- spect to the choice of query set and obtain a finite sample statistical rate, which depends primarily on the eigenvalue spectrum of a certain linear op- erator on the RKHSs. Despite the generality of these results, our bounds are stronger than previ- ous bounds developed for more specialized prob- lems. We specifically show that the well-studied problem of Gaussian process (GP) bandit opti- mization is a special case of our framework, and that our bounds either improve or are competitive with known regret guarantees for the Matérn ker- nel. Specifying the reward function accurately for a desired objective, or reward engineering, is challenging to per- form by hand, as the consequences of even small er- rors can be drastic (Hadfield-Menell et al., 2017). To ad- dress this, reward learning seeks to learn a predictive model of the reward function from data, which is ob- tained from carefully selected queries to human annota- tors. The learned reward model is then used as the op- timization objective for policy learning. Reward learning has achieved significant empirical success in domains such as text summarization (Stiennon et al., 2020; Böhm et al., 2019), robot locomotion (Daniel et al., 2014), predicting driving styles (Kuderer et al., 2015), and Atari game play- ing (Christiano et al., 2017). Despite their success, reward learning methods still lack theoretical grounding. Moreover, their behavior can be brit- tle even on simple tasks, due to the difficulty of choos- ing appropriate queries and due to feedback loops from adaptive querying (Freire et al., 2020). Indeed, an abla- tion study in Christiano et al. (2017) suggests that random queries can outperform or be competitive with adaptive query procedures. To address these issues, we provide a theoretical framework for analyzing reward learning, fram- ing it as a doubly nonparametric experimental design prob- lem. This framework helps elucidate the role of query se- lection (Chaloner and Verdinelli, 1995) and also enables us to derive scaling laws-how the sizes of the policy and re- ward models affect the query complexity-for reward learn- ing (Kaplan et al., 2020). Proposed framework. In our framework, we suppose we are given a reward class Cr and policy class Cπ. Our goal Cπ that performs well according to is to find a policy ˆπ an unknown true reward r∗ Cr. To do this, we query poli- cies π Cπ, observing noisy estimates of their true reward, and use this information to choose the eventual policy ˆπ. ∈ ∈ ∈ Proceedings of the 26th International Conference on Artificial In- telligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). To be compatible with modern nonparametric learning methods (i.e. neural nets), we view Cr and Cπ as sub- sets of Reproducing Kernel Hilbert Spaces (RKHS). A salient feature of our proposed framework is that the learner Running heading title breaks the line therefore optimizes a nonparametric reward function over a nonparametric space of policies, making the task "dou- bly" nonparametric. In contrast, previous work considers a nonparametric function class or reward class, but typi- cally not both. For instance, nonparametric zeroth order or bandit optimization (Srinivas et al., 2010; Mockus, 2012; Wang et al., 2018) considers a nonparametric function on a finite-dimensional input space. Conversely, nonparametric supervised learning (Wahba, 1990; Hofmann et al., 2008) minimizes a known loss function over a nonparametric in- put space. The doubly nonparametric nature of our task poses new challenges. The (possibly) infinite-dimensional RKHS re- quires the learner to select which subspace to explore given a finite number of queries. Furthermore, the unknown re- ward function makes it challenging for the learner to rea- son about the information gained from the selected query policies. We address these challenges by deriving a risk upper bound for a family of plug-in estimators based on ridge regression, and then optimizing this bound to solve the optimal design task. Our results show that the quality of the output policy depends on how well the query set is aligned with the eigenfunctions of the policy space. Q In addition to the optimal design problem, our framework allows us to study scaling laws with respect to the reward (or policy) class by varying the rate of decay of their corre- sponding eigenspectrum. This decay rate determines the ef- fective dimensionality of a RKHS (Zhang, 2002), and pro- vides a natural proxy for varying the size of the reward or policy class. Qualitatively, our main results show that the excess risk asymptotically vanishes as long as the policy class grows at a slower rate relative to the reward class. Sharpness of analysis. Our risk bounds apply to reward and policy classes of arbitrary or even infinite dimensional- ity. Despite this generality, we show they provide stronger guarantees than previous bounds for the specialized set- tings of compact policy sets and kernel multi-armed ban- dits. In Section 4.3, we look at a special case of our problem when the policy set Cπ is a compact subspace and thus has finite rank. For these instances, we show that our learning β+2 ) versus a algorithm obtains a better excess risk O(n− β−1 rate of O(n− 2(β+1) ) obtained by the adaptive GP-UCB al- gorithm (Srinivas et al., 2010), where β > 0 is a power law decay rate. β In Section 5, we specialize our general results to the well-studied problem of Gaussian process bandit opti- mization (Williams and Rasmussen, 2006), also known as kernel multi-armed bandit (MAB). Specifically, for the class of Matérn kernels with parameter ν in d di- mensions, we show that our algorithm achieves a regret bound of ̃O(T 4ν+d(4d+6) 6ν+d(4d+7) ) which is strictly better than those achieved by the GP-UCB and GP-Thompson Sampling (GP-TS) (Chowdhury and Gopalan, 2017) algorithms and comparable with π-GP UCB (Janz et al., 2020) and supKer- nelUCB (Valko et al., 2013; Vakili et al., 2021); see Table 1 for details. GP-UCB and GP-TS only yield sub-linear re- gret bounds when the smoothness of the kernel ν > d2- thus in high dimensions, these bounds essentially become vacuous. The π-GP UCB algorithm was designed specif- ically to overcome this issue. Our proposed algorithm achieves sublinear regret for all ν > 3/2. Our Contributions. We propose doubly-nonparametric bandits as a framework for theoretically studying the re- ward learning problem. Within this framework, we ob- tain finite sample risk bounds for a ridge regression based plug-in estimator and derive scaling laws for reward learn- ing. From a technical standpoint, we study the optimal de- sign problem for our estimator to select informative query points by showing that the excess risk depends only on the spectral properties of a certain operator of the two RKHSs and the empirical covariance matrix. As a corollary of our risk bounds, we provide sharper regret bounds for a class of kernel MAB problems compared to several existing al- gorithms, showing that the doubly-nonparametric lens of reward learning is fruitful even for "singly-nonparametric" tasks. To obtain these bounds, our reduction carefully con- structs two different RKHSs to embed the input space and reward function into a policy and reward class. 2 Framework: Doubly nonparametric Bandits Our framework considers non-parametric policy learning Hπ de- with non-parametric reward models. We let π Hr denote an arbitrary note an arbitrary policy and r reward function, where Hπ and Hr are Reproducing Ker- nel Hilbert Spaces. For technical reasons, we assume the Kr both satisfy the corresponding kernel functions Hilbert-Schmidt condition (see Appendix A for details). Kπ and ∈ ∈ ∈ R denote the reward obtained by se- We let F (π, r) lecting policy π under reward function r and consider the case where the evaluation functional F is linear in both Hr where π and r. i M : Hπ 7→ Hr is a known linear mapping from the pol- icy space to the reward space. Since Hπ and Hr may be infinite-dimensional, linearity is only a weak restriction– e.g. the map f f (x) is linear in f for any RKHS. In other words, F (π, r) = r, M π h 7→ Hr such that To incorporate problem structure, we let r∗ denote the true reward function and assume that r∗ Cr for some known Hr = 1. We further assume that set Cr ⊆ policies π are restricted to lie in some Cπ which is a sub- set of the unit ball in Hπ (for instance, Cπ might incorpo- rate physical constraints on implementable policies). Thus, given the true reward r∗, the optimal policy (for a compact r∗ ∈ k k Kush Bhatia, Wenshuo Guo, Jacob Steinhardt ∈ argmaxπ Cπ F (π, r∗). This proposed frame- Cπ) is π∗ work, which allows for infinite-dimensional policy as well as reward classes, allows us to study how both the policy and reward space affect the difficulty of learning. ∈ Query access to reward r∗. The true reward function r∗ is unknown to the learner but is accessible via queries to an oracle (e.g. a human expert), which provide noisy zeroth-order (or bandit) evaluations of the reward r∗. When Cπ, the oracle provides a re- queried with a policy π sponse ∈ Oracle Or∗ : π 7→ F (π, r∗) + ǫ with ǫ (0, τ 2) , (1) ∼ N with τ 2 denoting the variance of the response. There are two possible query models: passive queries (Atkinson, 1996; Sebastiani and Wynn, 2000), where the learner and active selects all queries at queries (Bubeck et al., 2011; Lattimore and Szepesvári, 2020), where the learner is allowed to select queries se- quentially. Our focus in this work will be on the passive query model, but in many cases we will outperform exist- ing active query algorithms. the same time, Problem statement. Given passive access to the oracle Or∗ , the objective of the learner is to output a policy ˆπ Cπ that has small excess risk ∆, defined as ∈ ∆(ˆπ; r∗) : = F (π∗, r∗) F (ˆπ, r∗) . (2) − We think of queries to the oracle as expensive, and are in- terested in achieving low excess risk with as few queries as possible. This notion of excess risk is also studied by the term simple regret in pure exploration bandit prob- lems (Lattimore and Szepesvári, 2020). Representations in l2(N). By Mercer's theorem, we can represent any RKHS as a subset of l2(N). Formally, the policy and the reward spaces are isomorphic to the ellip- soids Hπ : = Hr : = ∞ ( j=1 X ∞ ( j=1 X κπ,j φπ,j (κπ,j ) ∞ j=1 ∈ l 2 (N) with (cid:12) (cid:12) (cid:12) (κr,j ) κr,j φr,j ∞ j=1 ∈ l 2 (N) with ∞ j=1 X ∞ κ2 π,j μ2 π,j < ∞ ) κ2 r,j μ2 r,j < ∞ , ) j=1 X (cid:12) (cid:12) (cid:12) for appropriately chosen eigenfunctions φπ,j and φr,j , and corresponding eigenvalues μπ,j and μr,j (Wainwright, 2019). These are defined with respect to a base measure P over the input domain; see Appendix A for details. With a slight abuse of notation, going forward, we will use π and r to denote the corresponding coefficients (κπ,j) and (κr,j) in the expansion above. 1 With this, the inner products 1While the eigenfunctions φπ and φr can be different, this representation can still be used by modifying the map M appro- priately. This is detailed in Appendix A. = Algorithm 1: Policy Learning via Reward Learning Input: Number of queries n, policy set Cπ, oracle Select n policies π1, . . . , πn} reward evaluations yi = Or∗(πi). Estimate ˆr using observed responses using ridge regression (4). Cπ F (π, ˆr). (π1, y1), . . . , (πn, yn) { } Obtain plug-in policy ˆπplug Output: Policy ˆπplug Or∗ and receive noisy argmaxπ Q ∈ { ∈ associated with Hπ and Hr simplify π1, π2i h Hπ : = π1,j π2,j μπ,j ∞ j=1 X , r1, r2i h Hr : = ∞ j=1 X r1,jr2,j μr,j . (3) 1 r,j ) and Sπ : = diag(μ− Also let Sr : = diag(μ− π,j) be di- agonal matrices comprising the inverse of the eigenvalues of Hr and Hπ. With this notation, if we view the map M as a (infinite-dimensional) matrix, its Hermitian adjoint2 is equal to M ∗ = S− π M ⊤Sr. 1 1 Hπ, the operator norm In order for the evaluation functional F (π, r∗) to be finite op must be for all π bounded (see Appendix A). We will see later that the decay of this operator's singular values is closely related to the difficulty of learning in our setting. r M S− π ∈ S k k 1 2 1 2 3 Algorithm: Policy Learning via Reward Learning Q Given the setup above, we now describe a meta-algorithm, policy learning via reward learning (Algorithm 1), for the non-parametric policy learning problem. The algorithm is a three-stage procedure: it (i) selects a subset of poli- cies to query for reward feedback, (ii) uses the re- sponses to learn a reward estimate ˆr, and (iii) optimizes this learnt estimate to output the policy ˆπplug, that is, ˆπplug ∈ Hr . Such general plug-in procedure argminπ i have been studied in the statistics (Van der Vaart, 2000) and the machine learning (Devroye et al., 2013) literature. We analyze the excess risk of this estimator for our doubly- nonparametric setup and use this risk bound to select our query set . We now discuss the two key design choices in our algorithm: the choice of the reward estimation pro- cedure as well as the choice of query set ˆr, M π Cπ h Q ∈ . Q Reward learning via ridge regression. We estimate the reward ˆr via ridge regression in the RKHS Hr (Friedman et al., 2001; Shawe-Taylor et al., 2004). Sup- pose that in the first step of the algorithm, we have already 2Recall the Hermitian adjoint of M satisfies hr, M πiHr = hM ∗r, πiHπ Running heading title breaks the line n i=1 repre- queried the oracle on n policies and let sent the query-response pairs. For a regularization param- eter λreg > 0, the ridge regression estimate of the reward function is (πi, yi) } { ˆr ∈ argmin Hr r ∈ 1 n n i=1 X (yi − h r, M πii Hr )2 + λreg 2 Hr . (4) r k k The parameter λreg, which is usually set as a function of n, controls the bias-variance trade-off in estimating r∗- smaller values of λreg reduce bias while larger values help reduce variance. Excess risk bound for fixed query set. Observe that the ) is implicitly a function of the plug-in estimator ˆπplug( query set which . Ideally, we want to choose the set minimizes the expected risk of the plugin estimator. This requires us to solve the optimization problem Q Q Q Q = argmin n S S: | |≤ E[∆(ˆπplug(S); r∗)] . (5) = However, solving the above precisely requires knowledge about the underlying reward function r∗, and the combi- natorial nature of the optimization problem makes it hard to find an exact solution. To address this, we first upper bound the excess risk of the plug-in policy ˆπplug in terms of the query set . The following theo- π1, . . . , πn} rem3 bounds the excess risk in terms of the spectrum of the spaces Hr and Hπ, as well as the covariance matrix of the queried policies Σ π Theorem 1 (Excess risk of plug-in). For any query set P consisting of n policies and regularization parameter Q λreg > 0, the excess risk of the plug-in estimator ˆπplug is upper bounded as : = 1 n ππ⊤. ∈Q Q { Q E[∆(ˆπplug; r∗)] 2E[ k ≤ M ∗(r∗ ˆr) k − Hπ ] . (6) In addition, letting A = M Σ squared distance is equal to Q M ⊤Sr + λregI, the expected E[ k M ∗(r∗ τ 2 n * + ˆr) k − Hπ ] = λ2 2 tr Sπ(M ∗A− (cid:2) reg * k 1M )Σ M ∗A− 1r∗ (M ∗A− Q 2 Hπ k 1M )⊤ . (7) (cid:3) The proof follows a standard analysis of ridge regression and is deferred to Appendix B. Observe that in the above participates in the excess risk theorem, the query set π only via the covariance Σ . The risk bound is the sum of two term: the first corresponding to the bias and the sec- ond corresponding to the variance. In both these terms, Σ Q which induce appears as part of A− a larger correlation with the map M will generally have 1-thus query sets ∈ Q Q Q 3Throughout the paper, for clarity purposes, we denote by c a universal constant whose value changes across lines. All our proofs in the appendices explicitly track this constant. lower excess risk. Choices of queries which are orthogonal to the right singular vectors of M will have a constant ex- cess risk, since for those directions the matrix A λregI. ≈ As shown later in the appendix, in the special case when the policy set consists of the entire unit ball Cπ = Hπ | k Hπ ≤ by a quadratic factor ∈ , the excess risk bound can be improved π π { k 1 } E[∆(ˆπplug; r∗)] O ≤ k M ∗(r∗ 2 Hπ ˆr) k − . (cid:1) Such an improvement in the excess risk when the un- (cid:0) derlying query set is the complete unit ball in a finite- dimensional space was also observed by Rusmevichientong (Rusmevichientong and Tsitsiklis, 2010). and Tsitsiklis However, the gains in the specific linearly parameterized bandit setup that they considered was logarithmic in nature as compared to our quadratic ones. 4 Query selection and statistical guarantees Q We now show how to select the query set effectively and study the excess risk of the corresponding plug-in estimator ˆπplug obtained via this query set. We will start with the special case where the policy set Cπ is the unit ball in Hπ and the map M is diagonal, and then generalize to arbitrary policy sets. In both cases, low excess risk can be achieved by repeatedly querying (approximations of) the projections of top eigenvectors of M ∗M onto the Hπ space. For the special case when the map M is diagonal, this reduces to querying the top eigenvectors of Hπ. The excess risk will ultimately depend on the the eigen- 1 π , which is sim- spectrum of the operator S− 2 ilar to the operator M ∗M . Additionally, to interpret our results, we instantiate them for a power law spectrum with exponent β > 0, that is, π M ⊤SrM S− 1 2 1 2 σj(S− π M ⊤SrM S− π ) 1 2 j− β , ≍ (8) where σj corresponds to the jth singular value of the corre- sponding operator. 4.1 Warm-up: Cπ = unit ball, M = diagonal In order to get some intuition, we study the special case where the policy set Cπ consists of the entire unit ball in the space Hπ and the map M is diagonal with M = diag(νj). Further, let us denote the operator ̃M = S 1/2 r M S− π 1/2 . For this special case, our sampling algorithm (Algorithm 2) simply selects the top J eigenvectors of the space Hπ to query, for some value J which depends on the decay expo- nent β. To see why, observe that for a diagonal map M , the right singular vectors of the operator ̃M are the same as the eigenvectors of the policy space Hπ. Therefore, the choice of policy πj in our algorithm is simply the scaled eigen- φπ,j. Having selected these J queries, the function √μπ,j * Kush Bhatia, Wenshuo Guo, Jacob Steinhardt algorithm queries each one of the n query set . J times and uses this as Q ∈ Q The intuition for this choice of query set is that since we are in the passive setup with no knowledge of r∗, any pol- Cπ can be an optimal policy. By querying the top icy π J ones out of these, we can obtain a good enough approx- imation to the performance of any policy in the unit ball. The particular choice of the parameter J depends on the number of queries n available. Since the oracle responses are noisy, to reduce variance in the responses along those directions, our algorithm performs multiple queries along the same direction. { dπ i=1, each for J = n dπ If we further consider the special case when the policies and rewards correspond to the unit balls in the finite dimen- sional spaces Rdπ and Rdr respectively, our choice of query num- set queries the directions ei} ber of times. Intuitively, this strategy works well because without any prior over the unknown reward function, the optimal strategy in the passive setup is to explore all direc- tions equally and this is precisely our set of chosen queries. This simple query strategy enjoys the following excess risk bound. Proposition 1 (Risk bound for Cπ = unit ball.). For any n and regularization parameter λreg > 0, consider the J plug-in estimator obtained via the passive sampling algo- rithm which explores the first J eigenfunctions of Hπ. The excess risk satisfies ≤ E[∆(ˆπplug; r∗)] 1 + c * ≤ (cid:18) τ 2 nλ2 reg (cid:19) regJ 2ζj λ2 ζ2 j + λ2 max * sup J j ≤ ( regJ 2 , sup j>J , ζj ) where the quantity ζj = sal constant. ν2 j μπ,j μr,j and c > 0 is some univer- We defer the proof of the above proposition to Appendix B. The choice of the exploration parameter J allows us to trade-off between the two terms inside the maximum. Typ- ically, the second term will be maximized at j = J + 1. For the first term, the supremum depends on the choice of λreg - for small values of λreg, the sup is achieved at j = 1 while for larger values, it is achieved at j = J. In order to gain more intuition about this bound, we instantiate this for the power law decay. Corollary 1 (Risk bound for power-law decay). Suppose that eigenvalues of the policy space Hπ decay as j− βπ , re- ward space Hr as j− βr and the singular values of map βM . This satisfies the power law assumption with M as j− βr. The plug-in estimator exponent β = βπ + βM − β+2 and regularization with exploration parameter J = n β+1 β+2 satisfies λreg = n− 1 E[∆(ˆπplug; r∗)] cn− β β+2 . ≤ The proof of the corollary upper bounds the risk bound with the specific choices of J and λreg. The above bound shows that our algorithm can learn in the framework as long as β > 0 or equivalently βπ + βM > βr, with better rates for larger values of β. Thus, for a fixed size of reward class βr, the learning rate improves as the policy class grows smaller (βπ increases) – this is intuitive since we are required to search over a smaller policy space. On the other hand, for a fixed policy class βπ, our excess risk rate gets better as the reward class grows in size (βr increases) – this is because a larger set of reward functions have similar optimal policies and hence learning gets easier. 4.2 General policy sets Q We now describe our choice of query sets for general pol- icy sets Cπ. Our strategy, described in Algorithm 2, differs from the above special case in that we need to take into ac- count the interaction of the policy space Hπ with the map M . Specifically, we show in Appendix B that the upper bound in Theorem 1 can be diagonalized for this general case via a transformation. Let us denote the operator ̃M = S . Our transfor- mation reveals that the relevant directions to query for this general case corresponds to the columns of ΦπS− π Φ⊤π VM where , then VM are the eigenvectors of the self-adjoint op- erator ̃M ⊤ ̃M – and it is precisely a subset of these direc- tions that our algorithm queries. 1/2 r M S− π 1/2 1/2 In order to be able to query these policies, we require the set Cπ to contain some policies which align well with them. We formally state this regularity assumption below. Assumption 1 (Regularity assumption on Cπ). For any eigenfunction φ ̃M ,j of the operator ̃M ⊤ ̃M , consider the policy πj = ΦπS− π Φ⊤π φ ̃M ,j. There exists a policy ̃πj in policy set Cπ such that for some constant cπ > 0, we have ̃πj ̃π⊤j (cid:23) cππj π⊤j . 1/2 The above assumption requires that for every choice of the policy πj in Algorithm 2, the set Cπ has the another pol- icy ̃πj which is collinear with it. This assumption can be relaxed in various ways (for instance via convexification) but we omit this as it is not needed for our results. Given this assumption, the following theorem, a generalization of Proposition 1, provides a bound on the excess risk for the plug-in estimate for general policy sets Cπ. Theorem 2 (Risk bound for general policy sets Cπ.). For any J n, regularization parameter λreg > 0 and set Cπ satisfying Assumption 1, let ˆπplug be the estimator output ≤ Running heading title breaks the line Algorithm 2: Passive querying strategy Input: Number of queries n, map M , policy set Cπ, exploration parameter J 1 2 r M S− π 1 2 and compute Construct linear map ̃M = S eigenvectors φ ̃M ,j}j of ̃M ⊤ ̃M { 1 2 Set policy πj = ΦπS− π Φ⊤π φ ̃M ,j for all j Cπ such that ̃πj ̃π⊤j (cid:23) Obtain policy ̃πj ∈ , . . . , ̃π(n/J) ̃π(n/J) Form query set = nα 1 } { Q a(b) = repeated b times a, . . . , a { Output: Query set }} J ≤ cππj π⊤j where Q by Algorithm 1. The squared excess risk satisfies (E[∆(ˆπplug; r∗)])2 c * ≤ 1 + (cid:18) τ 2 nλ2 reg (cid:19) regJ 2ζj λ2 ζ2 j + λ2 max * sup J j ≤ ( regJ 2 , sup j>J , ζj ) where the values ζj correspond to the jth eigen values of the operator ̃M ∗ ̃M with ̃M = S r M S π . 1 2 1 2 We defer the proof of this theorem to Appendix B. The proof of this theorem goes via a transformation which di- agonalizes the excess risk bound and reduces the problem to a similar setup as that of Proposition 1. Additionally, Assumption 1 allows us to generalize the results to arbi- trary policy sets Cπ. Note that the above upper bounds the square of the excess risk. As discussed in Section 3, one can obtain a quadratic improvement in this rate if the set Cπ is the entire unit ball in Hπ. We specialize the above bound for the power law decay assumption in the follow- ing corollary. Corollary 2 (Risk bound for power-law decay). Suppose that eigenspectrum of the operator S− sat- isfy the power law assumption with exponent β > 0, that β. The plug-in estima- is, σj(S− j− π M ⊤SrM S− β+2 and regularization tor ˆπplug with parameter J = n β+1 β+2 satisfies λreg = n− π M ⊤SrM S− π π ) ≍ 1 2 1 2 1 2 1 2 1 E[∆(ˆπplug; r∗)] cn− β 2(β+2) . ≤ for some universal constant c > 0. The above bound indicates that for the general case, learn- ing is possible if the spectrum decay has parameter β > 0. To get such a spectrum decay with the operator defined in the above corollary, one sufficient condition is that the map M does not flip the larger eigenvectors of Hπ towards the smaller eigenvectors of Hr, that is, the map M preserves the ordering of the eigenvectors of Hπ when transformed to the space Hr. Such a misaligned scenario would re- quire learning a very accurate representation of the reward to learn a good policy and will make learning harder. It is worth highlighting that while we discuss our bounds with such a power law assumption on the relevant eigenvalues, one can also obtain similar rates for singular values with exponential decay, by optimizing the value of J to trade off the bias and variance terms. 4.3 Comparison with UCB-style adaptive algorithms We next turn to evaluating the sharpness of Theorem 2. Ex- isting frameworks for studying "singly"-nonparametric se- tups require the input domain to be compact. In our doubly- nonparametric setup, the input space is the policy set Cπ which is often non-compact (i.e. the unit ball is not com- pact in infinite dimensions). We address this for singly- nonparametrics algorithm by taking a finite-dimensional approximation. β Even though our proposed method is passive, it achieves better rates than well-known adaptive sampling algorithms. Specifically, in the power law setting of Section 4.1, the analysis of GP-UCB algorithm (Srinivas et al., 2010) pro- β−1 vides a rate of O(n− 2(β+1) ), which is strictly worse than β+1 ) obtained by our analysis in Corollary 1. We the O(n− refer the reader to Proposition 2 in Appendix D for an exact statement. The proof adapts the analysis from Srinivas et al. (2010), which hinges on a quantity called the informa- tion gain, which we bound for our setup. While we are comparing upper bounds for the two algorithms, we be- lieve that our improved bound is due to a better algo- rithm and not an analysis gap. While we expect adap- tive algorithms to perform better than passive ones in gen- eral (Lattimore and Hao, 2021), UCB style algorithms re- quire the construction of confidence intervals around input points, which crucially dictate the regret bounds of such algorithms. In the frequentist setup, the best known such bounds (Vakili et al., 2021) are known to yield suboptimal regret rates and it is an open question as to whether these can be improved. 5 Bounds for kernel multi-armed bandits In the previous subsection, we saw that our passive sam- pling algorithm actually outperforms existing adaptive sam- pling algorithms for the reward learning task we care about. Here we take this a step further-we specialize our algo- rithm to the case of kernel MABs, and show that it outper- forms standard algorithms for that setting and is competi- tive with a specialized algorithm for Matérn kernels. We consider the task of maximizing an unknown function Rd. In the kernel multi- f ∗ : armed bandit (MAB) setup, this unknown function f be- longs to an RKHS H, equipped with a positive-definite ker- R over its domain X 7→ X ⊂ Kush Bhatia, Wenshuo Guo, Jacob Steinhardt Algorithm Regret RT Non-vacuous regime GP-UCB (Srinivas et al., 2010) GP-TS (Chowdhury and Gopalan, 2017) Our work π-GP-UCB (Janz et al., 2020) SupKernelUCB (Vakili et al., 2021) ̃O(T ̃O(T ̃O(T ̃O(T 2ν+d(3d+3) 4ν+d(2d+2) ) 2ν+d(3d+3) 4ν+d(2d+2) ) 4ν+d(4d+6) 6ν+d(4d+7) ) 2ν+d(2d+3) 4ν+d(2d+4) ) ν+d 2ν+d ) ̃O(T ν > d2+d ν > d2+d 2 2 ν > 3 2 ν > 1 ν > 1 Table 1. Our algorithm specializes to the case of kernel multi-armed bandits and yields strong bounds. For a d-dimensional Matérn kernel with smoothness ν, we outperform both GP-UCB and GP-TS unless ν & d2. The only works to achieve better bounds for small ν are π-GP UCB, which was designed specifically for the Matérn kernel and a recent analysis of the SupKernelUCB which achieves near minimax rates. K f ∗ , such that H = 1. Let us further restrict our at- x x k2 ≤ . The learner is allowed to access this function via a noisy nel4 k tention to the space of input points 1 } zeroth-order oracle Rd | k = X ∈ { k Of ∗ : x 7→ f ∗(x) + η where η ∼ N (0, τ 2) . (9) Going forward we will assume that τ = 1. The above Or∗, except that the oracle is similar to the reward oracle query points x belong to a finite dimensional space and f ∗ is a non-linear function of the query point x. The goal in MAB is to minimize the T -step regret RT : = max ∈X x f ∗(x) T − t=1 X f ∗(xt) , (10) is to solve where xt tth the datapoint queried in the There have been several algorithms pro- round. general posed 2010; purpose UCB Chowdhury and Gopalan, 2017), Thompson sampling approaches (Chowdhury and Gopalan, 2017), and special- purpose algorithms for specific kernels (Janz et al., 2020). problem including (Srinivas et al., this algorithms We next show that kernel MAB can be cast as a special case of our non-parametric policy learning framework. The re- sulting regret bounds, derived from an application of The- orem 3, are better than several general purpose algorithms (GP-UCB, IGP-UCB, GP-TS) and comparable to those spe- cialized for the Matérn kernel (π-GP-UCB) and SupKer- nelUCB. In order to reduce kernel MAB to our framework, we need to introduce three elements – the policy space Hπ, the re- ward space Hr and the map M . We would like spaces Hr and Hπ such that (1) the resulting objective F (r, π) is linear in this space, (2) the resulting rewards and policies have unit norm in their respective space, and (3) we have a 4We require that the kernel K be a Mercer's kernel satisfying K(x, x) = c for all x ∈ X . good understanding of the eigenvalues of the resulting oper- ator. This last point ensures that we can employ our upper bounds from Section 4. X Cǫ denote an ǫ-net of the under the l2 norm and denote its size by RNcov Ncov on × (xi, xj) for all Before we define these, we let input space Ncov(ǫ). We define the kernel matrix K points selected in the cover as K(i, j) = (xi, xj) Reward space Hr. Given the RKHS H as well as the el- Cǫ, we view the reward function as a ements of the cover Cǫ to R, or equivalently as a vector in RNcov(ǫ). map from More precisely, letting ̃f = [f (x1), . . . , f (xNcov )] denote the vector of evaluations of a function f , we define ∈ Cǫ × Cǫ. ∈ K ̃f Hr : = span H f } { | 1 ̃f2. Hr : = ̃f ⊤1 K − ̃f1, ̃f2i h ∈ with . (11) With this notation, we define the true reward r∗ : = ̃f ∗ = [f ∗(x1), . . . , f ∗(xNcov )]. Policy Space Hπ. Similarly to rewards, we will embed policies in RNcov . For any point x let kx = ∈ Cǫ, (x, xNcov )] denote the corresponding vec- [ K tor in RNcov obtained by evaluating the kernel over the cover. Then, the space (x, x1), . . . , K K Hπ : = span kx | ∈ Cǫ} { k1, K − Hπ : = k1, k2i h h The choice of the above norm ensures that with x 2k2i (12) . Hπ = 1ki, K − K − ki, kji h h for all (xi, xj ) ∈ Cǫ × Cǫ . 1kji = δi,j Thus in particular, Hπ contains an orthonormal embedding ǫ. of the set of vectors ∈C Map M . Both the reward space Hr and policy space Hπ can be associated with RNcov. Under this transformation, ∈ Cǫ corresponds to the the evaluation f ∗(x) for any x kx}x { standard inner product with 6 Experimental evaluation Running heading title breaks the line F (r∗, πx) = f ∗(x) = ( ̃f ∗)⊤K − 1kx = r∗, kxi h Hr . This indicates that we should take the map M to be the identity. Furthermore, as a simple application of Mercer's theorem it follows that this map M is a bounded linear op- erator. We make an additional assumption on the kernel function , requiring it to be Lipschitz in its input arguments. This K assumption is often satisfied, in particular for the Matérn kernel when ν > 3/2. Assumption 2 (Lipschitz Kernel K ated with the Hilbert space H is L K > 0: to the l2-norm for some L K ). The Kernel associ- -Lipschitz with respect K (x, y) (x, x) L x | ≤ − K − |K Furthermore, the kernel satisfies x Kk . ∈ X y for all x k2 ∈ X (x, x) = 1 for all points ∈ X , y K Applying Theorem 2 under the above assumption, we ob- tain the following excess risk bound for the plug-in estima- tor evaluated on the unknown function f ∗. Theorem 3 (Excess risk for Kernel MAB). Suppose that the eigenvalues of a L satisfy the K β. Let ˆxplug be the output of power-law decay μj ≍ Of ∗ . Then, for Algorithm 1 using n queries to the oracle any value of β > 1 + 2 (0, 1), the excess risk satisfies -Lipschitz kernel K j− d + log( 1 δ ) and ǫ ∈ max x k2≤ k 1 x: f ∗(x) − f ∗(ˆxplug) . N 1 β+2 cov (ǫ) n * −β 2(β+2) 1−β cov (ǫ) + 2 + N ǫ , L K p with probability at least 1 δ. − For Matérn kernels, it is known that the eigenvalues de- cay with parameter β = 1 + 2ν d (Janz et al., 2020). Sub- stituting this along with a bound on the covering number Ncov(ǫ) Corollary 3 (Regret bound for Matérn Kernel). Consider the family of Matérn kernels with parameter ν > 3 2 defined with the Euclidean norm over Rd. The T -step regret of our algorithm is d, we obtain the following corollary. ≍ 1 ǫ (cid:1) (cid:0) Rmat,T = ̃O T 4ν+d(6+4d) 6ν+d(7+4d) . (cid:17) (cid:16) We defer all the proofs as well as a detailed introduction to the family of Matérn kernels to Appendix C. Note that the above bound is for regret, which is an online notion, while our previous results are offline notions. We get from one to the other using a standard batch-to-online conversion bound based on an explore-then-commit strategy. Table 1 compares the above bound to the existing literature. We experimentally evaluate our algorithm via a simulation study. We use these experiments to establish the dimension free nature of our results as well as to conjecture optimality of our bounds. Setup. In the simulation study, we work with d dimen- sional RKHSs Hr and Hπ. In order to simulate the non- parametric regime, we typically use value of n which are less or at most a constant times the dimension d. We set 1) and the the matrices Sπ = diag(j− map M = I. With this, the effective decay parameter βr = 0.75. We further sampled the oracle noise β = βπ − ǫ ∼ N (0, 0.01). All plots were averaged over 10 runs. 1.75), Sr = diag(j− . Observations. Figure 1(a) shows the variation of excess risk as the number of queries n are varied from 256 to 4096 on a log-log plot. Our bounds in Corollary 1 for this setup predict that the excess risk should decay at a rate 0.27). By fitting a linear line through the plot, we O(n− 0.28). This plot found that observed risk to vary as O(n− is suggestive of the fact that our theoretical upper bounds might be tight in a minimax way over choices of decay In Figure 1(b), we plot the excess risk as parameter β. we vary the dimension d from 32 to 8192 for four differ- ent choices of sample size, again, on a log-log scale. In- creasing the number of queries decreases the excess risk for all dimensions consistently. The risk curves tend to asymptote at different error levels for different values of n. This corroborates our theoretical findings that our proposed algorithm provides non-vacuous bounds for the doubly- nonparametric setup when d . → ∞ 7 Discussion In this work, we proposed a new theoretical framework, Doubly Nonparametric Bandits, for studying the reward learning problem. We derived non-asymptotic bounds on the excess risk of a ridge regression based plug-in estima- tor and showed how the well studied GP bandit optimiza- tion problem can be cast as a special case of our rich frame- work. Our current analysis relies on a regularity assump- tion on the policy space Cπ; can we obtain bounds on the excess risk in the absence of this assumption? Going forward, it would be interesting to study the closed loop dynamics between the reward and the policy learning algorithm when the learner actively queries for feedback. Acknowledgements We are grateful to Erik Jones for providing feedback on an early draft of the work. We would like to thank members of the Steinhardt group and InterACT lab for helpful dis- cussions. KB was supported in part by a grant from Long- Term Future Fund (LTFF). Kush Bhatia, Wenshuo Guo, Jacob Steinhardt d = 5000, = 0.75 = 0.75 0.05 0.045 0.04 0.035 0.03 0.025 k s i r s s e c x E Observed risk Linear fit n-0.28 Predicted rate n -0.27 10-2 10-4 k s i r s s e c x E n = 1024 n = 2048 n = 4096 n = 8192 29 210 Number of queries 211 (a) 212 101 102 103 104 Dimension (b) Figure 1. (a) Corroborating upper bound from Corollary 1. Our theoretical bounds predict a rate of n−0.27 and the experiment shows an almost matching rate of n−0.28. (b) As the dimension d is increased, the excess risk curves asymptote at different levels for different n. This shows that our algorithm achieves non-vacuous error for the doubly-nonparametric set in the regime d → ∞. References A. C. Atkinson. The usefulness of optimum experimental designs. Journal of the Royal Statistical Society: Series B (Methodological), 58, 1996. F. Böhm, Y. Gao, C. M. Meyer, O. Shapira, I. Da- gan, and I. Gurevych. Better rewards yield better summaries: Learning to summarise without references. arXiv preprint arXiv:1909.01214, 2019. S. Bubeck, R. Munos, G. Stoltz, and C. Szepesvári. X- armed bandits. Journal of Machine Learning Research, 12(5), 2011. X. Cai and J. Scarlett. On lower bounds for standard and robust gaussian process bandit optimization. In Interna- tional Conference on Machine Learning. PMLR, 2021. K. Chaloner and I. Verdinelli. Bayesian experimental de- Statistical Science, pages 273–304, sign: A review. 1995. X. Chen and Y. Yang. Hanson–wright inequality in hilbert spaces with application to k-means clustering for non- euclidean data. Bernoulli, 27(1):586–614, 2021. S. R. Chowdhury and A. Gopalan. On kernelized multi- armed bandits. In International Conference on Machine Learning, 2017. P. Freire, A. Gleave, S. Toyer, and S. Russell. In Proceed- ings of the Workshop on Deep Reinforcement Learning at NeurIPS, 2020. J. Friedman, T. Hastie, R. Tibshirani, et al. The elements of statistical learning, volume 1. Springer series in statis- tics New York, 2001. D. Hadfield-Menell, S. Milli, P. Abbeel, S. Russell, and arXiv preprint Inverse reward design. A. Dragan. arXiv:1711.02827, 2017. T. Hofmann, B. Schölkopf, and A. J. Smola. Kernel meth- ods in machine learning. The annals of statistics, 36(3): 1171–1220, 2008. D. Janz, D. Burt, and J. González. Bandit optimisation of functions in the matérn kernel rkhs. In International Con- ference on Artificial Intelligence and Statistics, 2020. J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. V. Koltchinskii and K. Lounici. Concentration inequali- ties and moment bounds for sample covariance operators. Bernoulli, 23, 2017. E. Kreyszig. Introductory functional analysis with applica- tions, volume 1. wiley New York, 1978. P. Christiano, J. Leike, T. B. Brown, M. Martic, S. Legg, and D. Amodei. Deep reinforcement learning from human preferences. arXiv preprint arXiv:1706.03741, 2017. M. Kuderer, S. Gulati, and W. Burgard. Learning driving styles for autonomous vehicles from demonstration. In 2015 IEEE International Conference on Robotics and Automation (ICRA), pages 2641–2646. IEEE, 2015. C. Daniel, M. Viering, J. Metz, O. Kroemer, and J. Peters. In Robotics: Science and sys- Active reward learning. tems, volume 98, 2014. T. Lattimore and B. Hao. Bandit phase retrieval. arXiv preprint arXiv:2106.01660, 2021. T. Lattimore and C. Szepesvári. Bandit algorithms. Cam- L. Devroye, L. Györfi, and G. Lugosi. A probabilistic the- ory of pattern recognition, volume 31. Springer Science & Business Media, 2013. bridge University Press, 2020. J. Mercer. Functions of positive and negative type, and their connection with the theory of integral equations. Philo- Running heading title breaks the line sophical Transactions of the Royal Society of London. Se- ries A, Containing Papers of a Mathematical or Physical Character, 209, 1909. J. Mockus. Bayesian approach to global optimization: the- ory and applications, volume 37. Springer Science & Business Media, 2012. P. Rusmevichientong and J. N. Tsitsiklis. Linearly param- eterized bandits. Mathematics of Operations Research, 35, 2010. P. Sebastiani and H. P. Wynn. Maximum entropy sam- pling and optimal bayesian experimental design. Jour- nal of the Royal Statistical Society: Series B (Statistical Methodology), 62, 2000. J. Shawe-Taylor, N. Cristianini, et al. Kernel methods for pattern analysis. Cambridge university press, 2004. N. Srinivas, A. Krause, S. Kakade, and M. W. Seeger. Gaus- sian process optimization in the bandit setting: No regret and experimental design. In International Conference on Machine Learning, 2010. N. Stiennon, L. Ouyang, J. Wu, D. M. Ziegler, R. Lowe, C. Voss, A. Radford, D. Amodei, and P. Christiano. Learning to summarize from human feedback. arXiv preprint arXiv:2009.01325, 2020. S. Vakili, K. Khezeli, and V. Picheny. On information gain and regret bounds in gaussian process bandits. In Inter- national Conference on Artificial Intelligence and Statis- tics, pages 82–90. PMLR, 2021. M. Valko, N. Korda, R. Munos, I. Flaounas, and N. Cristian- ini. Finite-time analysis of kernelised contextual bandits. arXiv preprint arXiv:1309.6869, 2013. A. W. Van der Vaart. Asymptotic statistics, volume 3. Cam- bridge university press, 2000. G. Wahba. Spline models for observational data. SIAM, 1990. M. J. Wainwright. High-dimensional statistics: A non- asymptotic viewpoint, volume 48. Cambridge University Press, 2019. Y. Wang, S. Du, S. Balakrishnan, and A. Singh. Stochastic zeroth-order optimization in high dimensions. In Inter- national Conference on Artificial Intelligence and Statis- tics, pages 1356–1365. PMLR, 2018. C. K. Williams and C. E. Rasmussen. Gaussian processes for machine learning, volume 2. MIT press Cambridge, MA, 2006. T. Zhang. Effective dimension and generalization of kernel learning. In NIPs, volume 4, pages 454–461. Citeseer, 2002. Kush Bhatia, Wenshuo Guo, Jacob Steinhardt A Technical details for proposed framework A.1 RKHS assumption The Hilbert spaces Hπ and Hr are Reproducing Kernel Hilbert Spaces defined by kernel functions respectively defined over a compact instance space . Further, the kernels Kr : [0, 1] Kr satisfy the Hilbert-Schmidt condition X ×X 7→ Kπ, Kπ and X Ki(x, z)2dP(x)dP(z) ZX ×X ≤ ∞ for i = π, r , } { (13) for some distribution P over space ciated set of eigenfunctions (with corresponding eigenvalues) that form an orthonormal basis for L2( version of this theorem below (Wainwright, 2019). . Mercer's theorem (Mercer, 1909) implies that such kernel functions have an asso- , P). We restate a X X Theorem 4 (Mercer's theorem). Suppose that the space satisfies the Hilbert-Schmidt condition (13). Then there exists a sequence of eigenfunctions (φj )∞j=1 that form an orthonormal basis of L2( X , P) and non-negative eigenvalues (μj)∞j=1 such that is compact and the positive semi-definite kernel K X Furthermore, the kernel function has the expansion (x, z)φj (z)dP(z) = μjφj(x) for all j = 1, 2, . . . . K ZX (x, z) = K ∞ j=1 X μjφj(x)φj (z) , where the convergence of the sequence holds absolutely and uniformly. A.2 Conditions for reward boundedness (14) (15) For learning to be feasible in the proposed framework, we would require that the evaluation functional F (π, r∗) is bounded for any policy π π Hπ. Using the fact that 1, we have 1 and r∗ ∈ Hr ≤ k k Hπ ≤ k k F (π, r∗) = r∗, M π h Hr = (r∗)⊤SrM π i ≤ k 1 2 r M S− π S 1 2 op . k Thus one sufficient condition for the reward functional to be bounded is to ensure that the operator norm k finite. In the special case when the map is diagonal with M = diag(νj), the above condition simplifies to S A.3 Regularity assumptions on map M  F (π, r∗) ≤ sup j 1  ≥ νjμ 1 2 π,j 1 2 r,j μ .   (16) 1 2 r M S− π 1 2 op is k (17) We assume that the map M is a compact bounded operator from the policy space Hπ to the reward space Hr. By Schauder's Hπ is a compact self-adjoint operator. theorem, the adjoint M ∗ is also a compact operator. Thus, the map M ∗M : Hπ → This allows us to use the spectral theorem for compact self-adjoint operators which guarantees the existence of eignevalues and eignefunctions for the operator M ∗M and a corresponding singular value decomposition for the map M (Kreyszig, 1978). A.4 Non-aligned RKHSs As mentioned in the Section 2, if the eigenvectors of the spaces Hr and Hπ are not aligned, one can consider the following simple transformation which resolves this. Let Φπ and Φr represent the eigenvectors. ̃r = Φrr, ̃π = Φ⊤π π, and ̃M = Φ⊤r M Φπ . (18) The above transformation implies that ̃r k k Hr ≤ 1 and ̃π k Hπ ≤ k 1. B Proof of main results Running heading title breaks the line In this section we provide the proofs for the main results of this work. Appendix D to follow contains the proofs for the other results. B.1 Proof of Theorem 1 We begin by proving the result for the special case when the policy set Cπ consists of the entire unit ball and then generalize the analysis to arbitrary policy sets. Case 1: Cπ is unit ball in Hπ. For this special case, observe that the the optimal policy π∗ and the plug-in policy ˆπplug for any reward estimate ˆr can be written as π∗ = M ∗r∗ M ∗r∗k k Hπ and ˆπplug = M ∗ˆr M ∗ˆr k Hπ k , (19) where the operator M ∗ is the adjoint of of the map M . To prove a bound on the excess risk using the plug-in estimate, we use the following lemma which bounds this error in terms of deviation of the estimated and true rewards. Lemma 1. Consider any vectors x and y with finite non-zero norm under some inner product , h* . Then, we have *i x, h x x k k − y y k k i ≤ 2 . k x y − y 2 k k k (20) The proof of the above lemma is presented in Section B.1.1. Taking the above as given, we can upper bound the excess risk ∆(ˆπ; r∗) = M ∗r∗, h M ∗r∗ M ∗r∗k k 2 ˆr) Hπ k − M ∗ˆr Hπ k k M ∗(r∗ 2 k ≤ Hπ − M ∗ˆr M ∗ˆr k k Hπ Hπ i . (21) Case 2: Arbitrary set Cπ. For this case, consider the excess risk of plug-in estimator ˆπplug obtained by maximizing reward estimate ˆr ∆(ˆπ; r∗) = = (i) ≤ M ∗r∗, π∗ h M ∗(r∗ h − ˆπplug − ˆr), π∗ Hπ i Hπ + i M ∗ˆr, π∗ h − ˆπplug Hπ + i M ∗(ˆr h − r∗), ˆπplug Hπ i M ∗(r∗ 2 k ˆr) k − Hπ , (22) where the final inequality follows from the fact that ˆπplug maximizes F (π; ˆr) over the set Cπ. Thus, we see that for both the cases above, we can upper bound the excess risk of the plug-in estimator in terms of the Hπ . Next, we evaluate this for the ridge regression based reward estimator for any set of n queries norm = i πiπ⊤i . For any regularization parameter λreg > 0, we have, M ∗(r∗ ˆr) k k − with covariance matrix Σ = 1 π1, . . . , πn} n { Q ˆr = arg min Hr r ∈ 1 n n i=1 X P r, M πii (yi − h Hr )2 + λreg 2 Hr r k k (i) = (M ΣM ⊤Sr + λregI)− 1 1 n * n i=1 X yiM πi = r∗ − λreg(M ΣM ⊤Sr + λregI)− 1r∗ + (M ΣM ⊤Sr + λregI)− 1 M n n i=1 X ǫiπi , ! (23) where and equality (i) follows by substituting the value of yi = F (πi, r∗) + ǫi. Let us denote by matrix A = M ΣM ⊤Sr + Kush Bhatia, Wenshuo Guo, Jacob Steinhardt λregI. Therefore, the error in reward estimation r∗ = λregA− 1r∗ + A− 1 ˆr − n ǫiπi M n ! i=1 X 1M ΣM ⊤A−⊤ ∼ N λregA− 1r∗, (cid:18) τ 2 n A− , (cid:19) (24) where the final distribution follows from our assumption on the noise variables ǫi ∼ N tional form, we have (0, τ 2). Using this above distribu- E[ k M ∗(r∗ ˆr) k − Hπ ] = λ2 2 reg * h M ∗A− 1r∗, M ∗A− 1r∗ Hπ + i τ 2 n * tr SπM ∗A− 1M ΣnM ⊤A−⊤(M ∗)⊤ = λ2 reg * tr (r∗)⊤A−⊤(M ∗)⊤SπM ∗A− 1r∗ (cid:2) + τ 2 n * tr SπM ∗A− 1M ΣM ⊤A−⊤(M ∗)⊤ (cid:3) . (25) (cid:2) (cid:3) (cid:2) The final bound for the general policy set Cπ follows from using the above bound with a an application of Jensen's inequality. In order to convert the above bound to a high probability bound, we require an infinite dimensional analog of the Hanson-Wright concentration inequality. Using Theorem 2.6 from Chen and Yang (2021) along with equation (24), we obtain (cid:3) Pr(∆(ˆπ; r∗) ≥ E[∆(ˆπ; r∗)] + t) 2 exp ≤ − (cid:18) C min t2 2 Γ HS k , Γ (cid:18) k t op (cid:19)(cid:19) k where the covariance matrix Γ = S 1 2 π M ∗A− 1M ΣM ⊤A−⊤(M ∗)⊤S 1 2 π . B.1.1 Proof of Lemma 1 Let the vector y = x + δx for some difference vector δx. Using this, we have i k k k k = − − y y x, h x, h x x k x x k k x = k k x + δxk (cid:18) k k x k k x + δxk (cid:18) k δ2 x , x + δxk where (i) follows from using the inequality √a2 + z ≤ = (i) k k 2 i x + δx x + δxk x + δxk − k x, δxi x k k x k + h x k − x, δxi h x k (cid:19) k δ2 xk x x k − k + k 2 k a + z 2a . This establishes the result. ≤ k − x, δxi h x k (cid:19) k (26) B.2 Proof of Proposition 1 Let us denote the the map M = diag(νj ) and the covariance matrix Σ = diag(σj ). From the upper bound obtained in Theorem 1, we have, E[ k M ∗(r∗ ˆr) k − Hπ ] = λ2 2 reg * k M ∗A− 1r∗ 2 Hπ + k τ 2 n2 * M ∗A− 1M πik 2 Hπ k n i=1 X τ 2 n * (i) ≤ (ii) ≤ λ2 reg * k S λ2 reg * sup j ≥ 1 " 1 2 π M ∗A− 1S− r 1 2 2 op + k ν2 j μr,jμπ,j regμ2 j σ2 ν4 j + λ2 r,j # tr SπM ∗A− 1M ΣM ⊤A−⊤(M ∗)⊤ + τ 2 n * (cid:2) sup j 1 " ≥ j μ2 ν4 π,j regμ2 j + λ2 j σ2 ν4 r,j # (cid:3) , (27) where inequality (i) follows from using the fact that M as well as the fact that each policy πi ∈ Q r∗ k has unit Hπ-norm. Hr ≤ k 1 and inequality (ii) uses the diagonal structure of the map Running heading title breaks the line Recall that the choice of querying strategy queries each scaled eigenfunction √μπ,jφπ,j of the policy space n1 − Therefore the jth entry of the covariance matrix Σ is given by α times. σj = μπ,j nα 0 ( nα for j otherwise ≤ . Plugging the above value of σj into equation (27), we obtain E[ k M ∗(r∗ ˆr) k − 2 Hπ ] ≤ max sup nα j ≤ ( + τ 2 n * max sup nα j ≤ ( This concludes the proof of the proposition. B.3 Proof of Corollary 1 regn2αζj λ2 ζ2 j + λ2 ζj ) j>nα regn2α , sup n2αζ2 j ζ2 j + λ2 regn2α , sup j>nα (28) (29) ζ2 j λ2 reg ) We now derive explicit finial sample rates for the case when the spectrum of the map M ⊤SrM S− decay for some parameter β > 0. In the notation used in Proposition 1, we have the quantity 1 π satisfies a power law Our proof strategy will be to instantiate the bias and variance terms for this setting of ζj and finally select a setting for the exploration parameter α and regularization parameter λreg. j− β. ζj ≍ (30) Bounding Bias. The bias term in the proposition is a max over two terms Bias2 = max sup nα j ≤ ( regn2αζj λ2 ζ2 j + λ2 regn2α , sup j>nα ζj . ) We consider the two terms in the analysis here separately. For the first term, regn2αζj λ2 ζ2 j + λ2 regn2α = λ2 reg sup j ≤ nα " sup nα j ≤ 1 j−β n2α + λ2 regjβ # ≤ λregnα , where the final inequality follows from using a2 + b2 2ab. For the second term, we have ≥ sup nα j ≥ ζj = sup nα j ≥ j− β = n− αβ. Bounding Variance. Recall that the variance term (assuming τ = 1) is given by Variance = 1 n * max sup nα j ≤ ( n2αζ2 j ζ2 j + λ2 regn2α , sup j>nα ζ2 j λ2 reg ) . We again consider both terms of the maximum separately. For the first term, 1 n * sup nα j ≤ n2αζ2 j ζ2 j + λ2 regn2α ≤ n2α − 1 , where the inequality follows from ignoring the term λ2 regn2α in the denominator. For the second variance term, ζ2 j nλ2 reg = sup j>nα 2αβ n− λ2 regn . (31) (32) (33) (34) (35) (36) Kush Bhatia, Wenshuo Guo, Jacob Steinhardt Setting regularization parameter. By setting λreg > n− Similarly, the above setting also implies that the variance term is dominated by n2α have that the expected error is upper bounded by − α, we can have that the bias term is dominated by λregnα. 1. Combing these observations, we − αβ ∆(ˆπplug; r∗) ≤ λregnα + n2α − 1 where λreg > n− αβ α. − Setting λreg = n− α(β+1) and then α = 1 β+2 , we get that ∆(ˆπplug; r∗) n− β β+2 . ≤ (37) (38) This completes the proof of the corollary. B.4 Proof of Theorem 2 In order to prove the general theorem, we exhibit a transformation which allows us to reduce the problem to that with the diagonal structure described in Proposition 1. We will consider orthogonally diagonalizable matrices Sr and Sπ which represent the eigenvectors and eigenvalues of the Hilbert spaces Hr and Hπ. Consider the following set of transformations for any reward r Cr and policy π Cπ. ∈ ∈ With this transformation, we can rewrite the objective function above ̃r = S 1 2 r r, ̃π = S 1 2 π π, ̃M = S 1 2 r M S− π . 1 2 (39) ̃r, ̃M ̃π max ̃π h i s.t. ̃π, ̃π h i = 1 and ̃r, ̃r i h = 1 , where the inner product by ̃r∗ = ̃r. Further, using these above transformations, we can rewrite the adjoint operator denotes the standard l2 inner product. Observe that we have overloaded notation to denote *i h* , M ∗ = S− π M ⊤Sr = S− π (S r M S− π )⊤S 1 1 2 1 2 1 2 1 2 r = S− π 1 2 ̃M ⊤S 1 2 r . Recall from Theorem 1, the matrix A = M ΣM ⊤Sr + λregI = S− r 1 2 ̃M ̃Σ ̃M ⊤ + λregI 1 2 r , S (40) (41) where the covariance matrix ̃Σ = 1 i ̃π ̃π⊤. We have used the fact here that the matrices Sπ and Sr are orthogonally n diagonalizable and hence symmetric. Finally, we will denote the singular value decomposition of the compact map M in the matrix form as P h i ̃M = U ̃M Λ ̃M V ⊤ ̃M . The existence of such a decomposition is guaranteed by the regularity assumptions we consider on the map M in Ap- pendix A. We will now analyze the bias and the variance terms from the upper bound on E[ 2 Hπ ] from Theo- rem 1. M ∗(r∗ ˆr k − k Bound on bias. The squared bias term is given by 2 λ− reg * Bias2 = r⊤A−⊤(M ∗)⊤SπM ∗A− 1r 1 2 1 2 1 2 S r S− r = r⊤S * = ̃r⊤( ̃M ̃Σ ̃M ⊤ + λregI)− = ̃r⊤( ̃M ̃Σ ̃M ⊤ + λregI)− = ̃r⊤U ̃M (Λ ̃M V ⊤ ̃M r ( ̃M ̃Σ ̃M ⊤ + λregI)− 1 ̃M 1 ̃M ̃ΣV ̃M Λ ̃M + λregI)− 1 2 * * 1 2 1 2 1S− r 1 2 1 2 S * 1 2 r r ̃M S− π ( ̃M ̃Σ ̃M ⊤ + λregI)− M ∗A− Sπ * 1r 1 2 * 1S 1 2 r r ̃M ⊤S S π S− π ̃M ⊤( ̃M ̃Σ ̃M ⊤ + λregI)− S− r * 1 ̃r 1Λ2 ̃M (Λ ̃M V ⊤ ̃M ̃ΣV ̃M Λ ̃M + λregI)− 1U ⊤ ̃M ̃r , (42) where we have used the SVD decomposition for the matrix ̃M in the last step. Bound on variance. The variance term is given by Running heading title breaks the line Var = = = τ 2 n * τ 2 n * τ 2 n * tr SπM ∗A− 1M ΣnM ⊤A−⊤(M ∗)⊤ (cid:2) tr tr ̃M ⊤( ̃M ̃Σ ̃M ⊤ + λregI)− h Λ ̃M (Λ ̃M V ⊤ ̃M h ̃ΣV ̃M Λ ̃M + λregI)− 1 ̃M ̃Σ ̃M ⊤( ̃M ̃Σ ̃M ⊤ + λregI)− (cid:3) 1 ̃M 1Λ ̃M V ⊤ ̃M ̃ΣV ̃M Λ ̃M (Λ ̃M V ⊤ ̃M i ̃ΣV ̃M Λ ̃M + λregI)− 1Λ ̃M . (43) i ̃π in equations (42) and (43), we recover back Finally, by making a substitution for reward ̃r = U ⊤ ̃M the bias variance expressions used in the analysis for Proposition 1. What remains to be shown is that our particular choice of query policies correspond to basis vectors in this transformed space. For this, observe that the sampling policies ̃r and policy ̃π = V ⊤ ̃M is such that the transformed policies πj = ∞ i=1 X √μπ,i * h φ ̃M ,j, φπ,ii φπ,i for j ≤ nα , ̃πj = V ⊤ ̃M S 1 2 π πj = V ⊤ ̃M S 1 2 π * 1 2 S− π V ̃M ej = ej , (44) indeed correspond to the basis vector. This finishes the proof of the desired claim. B.5 Proof of Corollary 2 The proof of this corollary follows similar to that of Corollary 1 in terms of bounding the bias and the variance. The final rate follows by an application of Jensen's inequality to conclude The final rate that we get in this case is thus upper bounded by the square root of the rate observed in Corollary 1. This concludes the proof. E[ k M ∗(r∗ Hπ ] ˆr) k − ≤ (E[ k M ∗(r∗ 2 Hπ ]) 1 2 . ˆr) k − (45) C Gaussian process bandit optimization In this section, we discuss in detail the application of our framework to the problem of frequentist Gaussian process bandit optimization, also known as Kernelized multi-armed bandits (MAB) problem. Recall the reduction of the Kernel MAB problem to our setup required us to define three elements. Reward space Hr. Given the RKHS H as well as the elements of the cover from of evaluations of a function f , we define Cǫ, we view the reward function as a map Cǫ to R, or equivalently as a vector in RNcov(ǫ). More precisely, letting ̃f = [f (x1), . . . , f (xNcov)] denote the vector ̃f Hr : = span { ̃f1, ̃f2i h H f } | 1 ̃f2 Hr : = ̃f ⊤1 K − ∈ with , (46) , where [f ∗(x1), . . . , f ∗(xNcov )]. *i h* represents the standard l2 inner product. With this notation, let us define the true reward r∗ : = ̃f ∗ = Policy Space Hπ. For the policy space Hπ in our setup, we let Hπ : = span { kx = [ with The choice of the above norm ensures that (x, x1), . . . , K Hπ : = k1, k2i h K (x, xNcov )] ∈ 2k2i . k1, K − h RNcov x | ∈ Cǫ} (47) ki, kji h Hπ = K − h 1ki, K − 1kji = ei, eji h = δi,j for all (xi, xj) For the policy space Hπ, we have created an orthonormal embedding of the set of vectors . Observe that this policy set that we construct satisfies the regularity Assumption 1 because each vector k is an eigenvector of the space Hπ. ∈C { ∈ Cǫ × Cǫ . kx}x Kush Bhatia, Wenshuo Guo, Jacob Steinhardt Hr. Furthermore, both Hr and Hπ are sub-spaces of RNcov and we can take the map M = INcov. Map M . By our assumption that the kernel vector kx ∈ With these definitions, we now explicitly establish a correspondence between our doubly nonparameteric bandit problem and the Kernel MAB problem. is a Mercer's kernel, we have that Hπ ⊆ Hr, that is, for all x , the ∈ C K (P1) (P2) C.1 Connecting the problems Given an RKHS H with an associated Mercer's kernel with access to oracle f ∗(x) max x ∈X , the objective of the zeroth-order bandit optimization problem is K such that f ∗ k H k ≤ 1 , Equivalently, the objective in our reward learning framework is Of ∗ : x 7→ f ∗(x) + η where η (0, τ 2) . ∼ N r∗, π max Hπh π ∈ Hr i such that r∗ k Hr ≤ k 1 and π k Hπ ≤ k 1 , with the corresponding spaces and inner products are defined in the previous section. The oracle required in our setup responds with Or∗ : π Hπ ≤ k r∗, π Hr + η where η i 7→ h ∼ N (0, τ 2) , 1. Our first lemma below states that obtaining such a n oracle is indeed feasible Hπ such that ∈ for any policy π if we are able to restrict our queries π to include only points kx for which the vector kx ∈ Cǫ. Lemma 2. Given access to oracle query set consists of Of ∗ for a function f ∗, the corresponding oracle π k kx}x { ∈C ǫ. Or∗ can be implemented when the Proof. For any query point k, the oracle the provided query set are exactly identical. Or∗ needs to compute the value r∗, k h Hr = f ∗(x). Thus, these two oracles on i Lemma 3. For any f ∗ Hr ≤ Proof. Observe that an alternate way to define the RKHS norm is given by 1, we have that f ∗ r∗ ≤ ∈ k k k k H H satisfying The fact that r∗ k k Hr is computed on Cǫ ⊂ X k f H : = k S sup ; S f 1 S f |SK − ⊆X | establishes the desired claim. |≤∞ 1. |S . Finally, we turn to establishing a relation between the solutions obtained from solving the relaxed problem (P2) as compared to solving the original problem (P1). We denote the corresponding maximizers for both problems arg max r∗, kxi ǫh x ∈C Hr , (48) ∈ x∗ f ∗(x) arg max x ∈X and x∗π ∈ The following lemma now relates both these maximizers together. Lemma 4. For an RKHS H with kernel x∗ K and x∗π ∈ Cǫ be the maximizers as defined in equation (48), we have ǫ . f ∗(x∗) ∈ X 2cL f ∗(x∗π) satisfying Assumption 2 with constant L Proof. Denote by Π ǫ (x∗) : = arg minx C x∗ ∈C ǫ k f ∗(x∗π) = f ∗(x∗) − K − p ≥ k2 the projection of the point x∗ onto the set x f ∗(x∗π) ǫ (x∗)) ǫ (x∗)) + f ∗(Π f ∗(Π C C − f ∗(x∗) − This completes the proof of the lemma. 2cL ≤ p K − ǫ . > 0 and any function f ∗ K H, let ∈ (49) Cǫ. Then, we have The above lemma shows that solving Problem P2 is equivalent to solving Problem P1 up to an additive factor of √2cL when we are working with an ǫ-cover over the domain space. ǫ K Running heading title breaks the line C.2 Analysis for bandit optimization Recall from the previous section that the quantity which determines the rate of decay is the ratio of eigenvalues ζj = ˆμπ,j ˆμr,j = ˆμ2 r,j ˆμr,j = ˆμr,j , where ˆμr,j is the jth eigenvalue of the kernel matrix K. Let us denote by P denote the uniform distribution over the input and let us suppose that the cover Ncov is formed using random samples from this distribution. Let us denote by space , let us μj} { denote by X the eigenvalues and by φj the corresponding eigen vectors of the Mercer kernel . For every point x ∈ X K the corresponding featurization of the point x. Then, for S : = Ex (cid:0) (cid:1) P[Φ(x)Φ(x)⊤], we have ∼ Φ(x) : = √μjφj (x) j=1 , ∞ [S]j,k = [Ex ∼ P[Φ(x)Φ(x)⊤]]j,k = Ex ∼ P[√μj√μkφj(x)φk(x)] = μjδj,k . (50) Φ(x)Φ(x)⊤ are similar ma- Observe that the kernel matrix K and the (scaled) sample covariance matrix Ncov ∈C trices and thus have the same eigenvalues. The following lemma, adapted from Koltchinskii and Lounici (2017, Theorem 9) relates the eigenvalues of the sample covariance matrix ˆS to those of the underlying kernel P x * . ˆS = Lemma 5. For any λS > 0 and size of the cover satisfying Ncov(ǫ) > c tr(S(S+λS I) −1) * ǫ2 S ˆμj ≤ (1 + ǫS)μj + λSǫS for all j , with probability at least 1 δ. − K + 1 ǫ2 S log 1 δ , we have, (cid:0) (cid:1) (51) The following corollary of Lemma 5 provides us with a way to control the deviation of the eigenvalues ˆμj from the corresponding μj in a multiplicative manner. Corollary 4. For any value of decay parameter β > 1 and γ < β, we have, for all j, the eigenvalues ˆμj ≤ 3 2 μj + γ N − cov 2 , (52) with high probability. Proof. Let us understand the condition Ncov(ǫ) covering number. Lets suppose that the true eigen values μj ≍ sum ≫ ǫ2 S tr(S(S+λS I) −1) j− and see what restrictions it puts on the value of the β and we set the value of λS ≍ cov . Therefore, the N − γ β j− β + λS j− . N γ β cov + 1 γ N − cov β j− γ Xj>N β cov j X . N γ β cov + γ β cov 1 N β − . Thus, if we set ǫS = 1 we get desired bound on the deviation of the empirical eigenvalues from population eigenvalues. 2 , then for any β > 1 and γ < β, the above condition on the covering number will be satisfied and The above corollary is essential to our argument because often times we have a good understanding of the decay of the associated with the RKHS and this allows us to relate the set of empirical eigenvalues to these. eigenvalues of the kernel K We now present a proof of Theorem 3, restated below, which upper bounds the excess risk for this setup. We will then use a batch to online conversion bound to convert this to a regret bound and specialize to the Matérn kernel later. Kush Bhatia, Wenshuo Guo, Jacob Steinhardt Theorem 5 (Restated Theorem 3). Suppose that the eigenvalues of a L P over Then, for any value of γ satisfy the power-law decay μj ≍ ∈ j− log(1/ǫ) log(LK/ǫ2) , β) and ǫ (1 + 1 d X ∈ -Lipschitz kernel β. Let ˆxplug be the output of Algorithm 1 using n queries to the oracle with respect to a distribution Of ∗ . K (0, 1), the excess risk K with high probability. max x f ∗(x) − f ∗(ˆxplug) . N 1 β+2 cov (ǫ) n * −β 2(β+2) + N 1−γ cov (ǫ) + 2 ǫ , L K p Proof. Our strategy, as before, will be to explore nα directions and assume τ 2 = 1. Recall, that for symmetric matrices, Theorem 2, the excess error of the plug-in estimator can be upper bounded as E[∆(ˆπplug; r∗)]2 ≤ λ2 reg sup 1 j ≥    1 + λ2 regμr,j μπ,j ν2 j j σ2 ν2 j μπ,j μr,j + 1 n    Bounding Bias. We will split the analysis into two cases. Case 1: j > nα. For this case, we have that σj = 0 and therefore sup j ≥ 1 " ν4 j μ2 π,j regμ2 j + λ2 j σ2 ν4 r,j # . λ2 reg sup j>nα ˆμπ,j reg ˆμr,j λ2 = sup j>nα Ncov ˆμj . sup j>nα Ncov(μj + N − γ cov ) ≤ Ncovn− αβ + N 1 − cov γ , with the above holding with high probability from an application of Corollary 4 for any 1 < γ < β. Case 2: j ≤ nα. For this case, we have σj = μπ,j nα . The bias can then be upper bounded as 1 + λ2 regμr,j μπ,j ν2 j ν2 j μπ,j n2αμr,j λ2 reg sup j ≤ nα    λregnα , ≤    where the final inequality follows from using a2 + b2 2ab. ≥ Bounding variance. As we did in the section above, let us split the analysis into two cases. Case 1: j > nα. For this case, the variance term simplifies to 1 n sup j>nα " μ2 π,j regμ2 λ2 r,j # = 1 λ2 regn sup j>nα N 2 cov ˆμ2 j N 2 cov λ2 regn ≤ sup j>nα N 2 covn− ˆμ2 j . γ) 2αβ + N 2(1 − cov λ2 regn . (cid:2) nα. For the second case, we can upper bound the variance term (cid:2) (cid:3) (cid:3) Case 2: j ≤ 1 n sup j nα  ≤ j μ2 ν4 π,j ν4 j μ2 n2α + λ2 π,j regμ2 r,j n2α n ,  ≤ where the last inequality follows from ignoring the second term in the denominator.   Setting regularization parameter. From the analysis in the above paragraphs, we have Bias2 Variance max { ≤ max { ≤ Ncovn− N 2 covn− γ αβ + N 1 cov , λregnα − 2αβ + N 2(1 γ) n2α − cov λ2 n } ≤ regn } ≤ , max { max { 2αβ N 2 covn− λ2 regn , Ncovn− αβ, λregnα , γ + N 1 − cov N 2(1 − cov λ2 regn + } n2α n } γ) . For regularization parameter λreg > Ncovn− αβ − α and γ > αβ logn Ncov , we have Bias2 Variance γ , λregnα + N 1 − cov n2α n . ≤ ≤ (53) (54) (55) (56) (57) (58) Excess risk bound. To obtain the final excess risk bound, we set α = 1+logn Ncov β+2 Running heading title breaks the line E[∆(ˆπplug; r∗)]2 ≤ λregnα + + N 1 − cov γ n2α n αβ + n2α 1 + N 1 − cov γ − Ncovn− ≤ (i) . N 2 β+2 cov n −β β+2 + N 1 − cov γ , (59) where inequality (i) follows from our particular choice of α. Combining the above bound with Lemma 4 completes the proof. The following corollary instantiates the above theorem for the case when the input space is the unit ball, that is, satisfy Assumption 2. Then, for any β > 1 + 2 Corollary 5. Let the input space = Bd(1) and the kernel = Bd(1). X d , we have X K max x f ∗(x) Ex ∼ − ˆπplugf ∗(x) . L d β+2+2d −β 2(β+2+2d) . n K Proof. From the bound in Theorem 3, we have, max x f ∗(x) Ex ∼ − ˆπplugf ∗(x) . N 1 β+2 cov (ǫ) −β 2(β+2) + N 1−γ cov (ǫ) + 2 L ǫ K 1 β+2 cov ( N (i) ≤ (ii) ≤ L d β+2 K * n ) * ǫ2 L K 1 ǫ (cid:18) (iii) ≤ L d β+2 K * (cid:18) (cid:19) 1 ǫ (cid:19) −β 2(β+2) + N 1−γ cov ( 2 n * p ǫ2 L K ) + ǫ 2d β+2 2d β+2 −β 2(β+2) + n * L K ǫ2 (cid:18) (cid:19) −β 2(β+2) + 2ǫ , n * d(1−γ) 2 + ǫ (60) (61) where inequality (i) follows from substituting ǫ from using the assumption that β > γ > 1 + 2 d Finally, setting ǫ d β+2+2d n K L ≍ −β 2(β+2+2d) , we get , (ii) follows from the fact that Ncov(ǫ) ǫ2/L → K log(1/ǫ) log(LK/ǫ2) . d, and (iii) follows 1 ǫ ≍ (cid:0) (cid:1) max x f ∗(x) Ex ∼ − ˆπplugf ∗(x) . L d β+2+2d −β 2(β+2+2d) . n K This establishes the desired claim. C.3 Regret bound for Matérn Kernel In this section, we specialize the bound from Theorem 3 for the special class of Matérn kernels. Recall that the Matern , the exact form for the kernel is kernel is a distanced based kernel with y given by (x, y) = f ( k ). Denote by r = − − K x x k k k y Matern,ν(r) = K ν 21 − Γ(ν) √2νr l ! ν Kν √2νr l ! , (62) with parameters ν and l and where Kν is the modified Bessel function of the second kind. Going forward, lets fix the scale parameter l = 1 without loss of generality. The following lemma then bounds the Lipschitz constant for this class of kernels when the distance function is the l2 norm. Lemma 6 (Lipschitz Matérn Kernel). Consider the Matérn kernel with parameter ν > 3 2 . The Lipschitz constant of this kernel is bounded by L K ≤ r [ sup (0,1) ∈ e22 − 1(1) ννKν Γ(ν) − * re− √2νr]. (63) Kush Bhatia, Wenshuo Guo, Jacob Steinhardt Proof. The approach will be to show that the kernel function cover the l2 ball in the d dimensional space appropriately. We now look at the derivative of the function respect to r. Matern,ν is a Lipschitz function of the distance r and then Matern,ν(r) with K K ∂ Matern,ν(r) = K 21 − ν(√2ν)ν Γ(v) 21 − (i) = ν(√2ν)ν Γ(v) νrν 1Kν(√2νr∂r + rν ∂Kν(√2νr − (cid:16) νrν 1Kν(√2νr) − rν √2νKν − − (cid:17) 1(√2νr) + ν√2ν √2νr Kν(√2νr) !! ∂r 21 − ν(√2ν)ν Γ(v) = − rν √2νKν (cid:16) − 1(√2νr) (cid:17) ∂r , Kν 1(z) − − − ν z Kν(z))∂z. where (i) follows from the identity ∂Kν(z) = ( For any ν > 1 2 , we have the inequality Kν(x) Kν(y) Instantiating the above with y = 1 and ν > 3 < expy − x 2 , we have 21 − ν(√2ν)ν Γ(v) y x (cid:16) ν (cid:17) for 0 < x < y. rν √2ν * √2νr e− (√2νr)ν 1 * − eKν − 1(1) ! Matern,ν(r) ∂ | K | ≤ The Lipschitz constant for this case can now be obtained by taking a sup over r (0, 1). ∈ e22 − 1(1) ννKν Γ(ν) − * ≤ re− √2νr . (64) (65) (66) While our upper bound was in terms of sample complexity, in order to compete with the cumulative regret formulation, we adapt an explore-then-commit strategy. The following lemma relates the sample complexity bound to a cumulative regret bound. Lemma 7 (Batch to online conversion). Suppose an algorithm has sample complexity O(n− setup, the explore then commit strategy based on this learning algorithm would have regret O(T α) in the passive learning 1+α ). 1 Proof. For some parameter γ > 0, let the explore then commit algorithm explore for T γ steps and the commit to the T γ time steps. The cumulative regret for such an algorithm is strategy obtained post this exploration for the remaining T − αγ(T RT = T γ + T − T γ + T 1 T γ) αγ . (67) − − ≤ Setting γ = 1 1+α finishes the proof. We now proceed to prove Corollary 3 which instantiates the bound in Theorem 3 for the class of Matérn kernels. Corollary 6 (Restated Corollary 3). Consider the family of Matérn kernels with parameter ν > 3 clidean norm over Rd. The T -step regret of the explore-then-commit algorithm is 2 defined with the eu- with high probability. RMat,T . O L (cid:18) d2 2ν+d(3+2d) K T * 4ν+d(6+4d) 6ν+d(7+4d) . (cid:19) Proof. First, observe that excess risk bound in Corollary 5 can be converted to a corresponding T -step regret bound by an application of Lemma 7 such that * For the class of Matérn kernels, the decay parameter β = 1 + 2ν regret bound, we get, (cid:18) K RT . O L d β+2+2d 2β+4+4d 3β+4+4d T . (cid:19) (68) d (Janz et al., 2020, Theorem 9). Using this wit the above This completes the proof. RMat,T . O L (cid:18) d2 2ν+d(3+2d) K T * 4ν+d(6+4d) 6ν+d(7+4d) . (cid:19) D Adaptive sampling via GP-UCB Running heading title breaks the line In this section, we prove an upper bound on the expected risk of the Gaussian process upper confidence bound algorithm (GP-UCB) algorithm of Srinivas et al. (2010). In order to adapt their algorithm for our setup, consider the function fr(x) : = r, M x Hr i h such that D = x { x k Hπ ≤ 1 . } | k (69) We have used x to denote policies in this setup to be consistent with the notation in Srinivas et al. (2010). Observe that the domain defined above is not compact – a necessary condition for the algorithm to work. One work around this is to truncate the unit ball after a finite number of dimensions and bound this truncation error. The excess risk incurred by this truncation can be made arbitrary small. Going forward, we ignore this truncation. The regret for the UCB algorithm is shown to be upper bounded by ̃O(γT √T ) where γT is the information gain with γT : = max x1,...,xT ∈ D 1 2 log det(I + [ (xi, xj)]T i,j=1) , K (70) (xi, xj) = x M x where we have assumed without loss of generality that the noise variance τ = 1. For our setup, the kernel function Hr . We additionally require that the reward function r belongs to the RKHS spanned by the M xi, M xji h π and suppose that its eigenvalues satisfy a power law decay with } ∈ β. The following lemma upper bounds the information gain for this setup in terms of the power law K set D | σj(S) = ζj = j− parameter β > 0. Lemma 8 (Information Gain.). The information gain γT for the above setup is bounded as . Denote by S = S π M ⊤S− 1 r S { 1 2 1 2 γT = O(log(T ) 1 β+1 ) . T * Proof. The quantity of interest here is the information gain γT : = max x1,...,xT 1 2 log det(I + XSX ⊤) such that j ∀ xjk2 ≤ k 1 , (71) (72) where the matrix X = [x⊤1 ; . . . ; x⊤T ] and we have assumed that the noise variance is 1. From the setup described above, we have that the eigen values of S decay as λj ≍ xt} β. It is easy to see that log det(I + XSX ⊤) Fig( { ) : = (73) 1 2 j− is a monotonic sub-modular function. Thus, the value of γT can be upper bounded by (1 − greedy maximization algorithm. The greedy maximization algorithm is equivalent to picking 1/e)− 1 times the value of the It is easy to see that at each time t, the unit vector xt will be an eigen vector of the matrix S. Given this observation, we can finally upper bound the value of the info gain xt = arg max x Fig(Xt − 1 ∪ { ) . x } γT ≤ c * max m1,...,mT T j=1 X log(1 + mjλj) such that mj ≥ 0 and mj = T. j X Solving the above optimization problem, the optimal choice of the variables mj = max 1 λ − 1 λj , 0 (cid:27) (cid:26) and mj = T . j X (74) β β+1 ensures that there are T 1 β+1 active directions. Substituting the above values of mj in the expression Setting λ = T − for γT , we get log(1 + max( λj λ − 1, 0)) γT ≤ c c ≤ ∞ j=1 X log * * λ1 λ (cid:18) ∞ I[λj > λ] * (cid:19) T j=1 X 1 β+1 ) , (i) = O(log(T ) * Kush Bhatia, Wenshuo Guo, Jacob Steinhardt where (i) follows from setting λ = T − β β+1 . This establishes the required claim. We are now ready to state this our sample complexity bound for GP-UCB for this subclass of problems. Proposition 2 (Sample complexity for GP-UCB). Suppose that the police space Hπ, reward space Hr and the map M satisfy the power law decay assumption with exponent β > 0. The estimator ˆπucb output by the GP-UCB algorithm satisfies E[∆(ˆπucb; r∗)] ≤ ̃O(n− β−1 2(β+1) ) . (75) The proof of the sample complexity bound in Proposition 2 now follows the regret bound of ̃O(γT √T ) along with using the upper bound on the information gain from Lemma 8. E[∆(ˆπplug; r∗)] = ̃O(n 1 β+1 − 1 2 ) = ̃O(n− β−1 2(β+1) ) . (76) More recently, Cai and Scarlett (2021) extended the analysis of Valko et al. (2013) to show that the SupKernelUCB algo- rithm achieves a regret bound ̃O(√γT T ). Using this modified bound, one can improve the above analysis to obtain excess risk E[∆(ˆπplug; r∗)] = ̃O(n 1 2(β+1) − 1 2 ) = ̃O(n− β 2(β+1) ) , (77) which is still worse than those obtained by the bounds by our proposed ridge regression estimator. E Further details on experimental evaluation In the simulation study, we work with d dimensional RKHSs Hr and Hπ. In order to simulate the nonparmeteric regime, we 1.75), typically use value of n which are less or at most a constant times the dimension d. We set the matrices Sπ = diag(j− 1) and the map M = I. This is allowed since the policy space is smaller than the reward space. With this, Sr = diag(j− the effective decay parameter β = βπ − βr = 0.75. We sampled the true reward r∗ uniformly at random from the unit ball in Hr. We further sampled the oracle noise ǫ (0, 0.01). All plots were averaged over 10 runs. ∼ N
http://arxiv.org/abs/2303.16759v1
2023-02-23T21:56:50
2023-02-23T21:56:50
Exploring celebrity influence on public attitude towards the COVID-19 pandemic: social media shared sentiment analysis
The COVID-19 pandemic has introduced new opportunities for health communication, including an increase in the public use of online outlets for health-related emotions. People have turned to social media networks to share sentiments related to the impacts of the COVID-19 pandemic. In this paper we examine the role of social messaging shared by Persons in the Public Eye (i.e. athletes, politicians, news personnel) in determining overall public discourse direction. We harvested approximately 13 million tweets ranging from 1 January 2020 to 1 March 2022. The sentiment was calculated for each tweet using a fine-tuned DistilRoBERTa model, which was used to compare COVID-19 vaccine-related Twitter posts (tweets) that co-occurred with mentions of People in the Public Eye. Our findings suggest the presence of consistent patterns of emotional content co-occurring with messaging shared by Persons in the Public Eye for the first two years of the COVID-19 pandemic influenced public opinion and largely stimulated online public discourse. We demonstrate that as the pandemic progressed, public sentiment shared on social networks was shaped by risk perceptions, political ideologies and health-protective behaviours shared by Persons in the Public Eye, often in a negative light.
[ "Brianna M White", "Chad A Melton", "Parya Zareie", "Robert L Davis", "Robert A Bednarczyk", "Arash Shaban-Nejad" ]
10.1136/bmjhci-2022-100665
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1136/bmjhci-2022-100665", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2303.16759v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2303.16759v1", "@rel": "related", "@type": "application/pdf" } ]
[ "BMJ Health & Care Informatics 2023;30:e100665" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.IR", "cs.LG", "cs.SI", "I.2.7" ]
Open access Original research Exploring celebrity influence on public attitude towards the COVID- 19 pandemic: social media shared sentiment analysis Brianna M White ,1 Chad Melton,2 Parya Zareie,1 Robert L Davis,1 Robert A Bednarczyk,3 Arash Shaban- Nejad 1 To cite: White BM, Melton C, Zareie P, et al. Exploring celebrity influence on public attitude towards the COVID- 19 pandemic: social media shared sentiment analysis. BMJ Health Care Inform 2023;30:e100665. doi:10.1136/ bmjhci-2022-100665 Received 18 August 2022 Accepted 26 December 2022 © Author(s) (or their employer(s)) 2023. Re- use permitted under CC BY- NC. No commercial re- use. See rights and permissions. Published by BMJ. 1College of Medicine, Department of Pediatrics, The University of Tennessee Health Science Center, Memphis, Tennessee, USA 2Bredesen Center for Interdisciplinary Research and Graduate Education, The University of Tennessee Knoxville, Knoxville, Tennessee, USA 3Hubert Department of Global Health, Rollins School of Public Health, Atlanta, Georgia, USA Correspondence to Brianna M White; bwhite66@ uthsc. edu Professor Arash Shaban- Nejad; ashabann@ uthsc. edu ABSTRACT Objectives The COVID- 19 pandemic has introduced new opportunities for health communication, including an increase in the public's use of online outlets for health- related emotions. People have turned to social media networks to share sentiments related to the impacts of the COVID- 19 pandemic. In this paper, we examine the role of social messaging shared by Persons in the Public Eye (ie, athletes, politicians, news personnel, etc) in determining overall public discourse direction. Methods We harvested approximately 13 million tweets ranging from 1 January 2020 to 1 March 2022. The sentiment was calculated for each tweet using a fine- tuned DistilRoBERTa model, which was used to compare COVID- 19 vaccine- related Twitter posts (tweets) that co- occurred with mentions of People in the Public Eye. Results Our findings suggest the presence of consistent patterns of emotional content co- occurring with messaging shared by Persons in the Public Eye for the first 2 years of the COVID- 19 pandemic influenced public opinion and largely stimulated online public discourse. Discussion We demonstrate that as the pandemic progressed, public sentiment shared on social networks was shaped by risk perceptions, political ideologies and health- protective behaviours shared by Persons in the Public Eye, often in a negative light. Conclusion We argue that further analysis of public response to various emotions shared by Persons in the Public Eye could provide insight into the role of social media shared sentiment in disease prevention, control and containment for COVID- 19 and in response to future disease outbreaks. WHAT IS ALREADY KNOWN ON THIS TOPIC ⇒ Many studies have highlighted the persuasive na- ture of celebrity behaviour and messaging-both beneficial and detrimental to public health. As populations grow to trust the influential nature of celebrity activity on social platforms, followers are disarmed and open to persuasion when faced with the dissemination and rapid spread of misinforma- tion. Exposure to large amounts of misinformation can have lasting effects on overall well- being and sociopsychological health. WHAT THIS STUDY ADDS ⇒ In our previous works, our team has successful- ly employed various natural language processing (NLP) models for the analysis of social media shared sentiment. With the utilisation of a fine- tuned DistilRoBERTa NLP model, sentiment and con- tent analysis could uncover a correlation between COVID- 19 related messaging shared by Persons in the Public Eye and public sentiment and discourse direction. HOW THIS STUDY MIGHT AFFECT RESEARCH, PRACTICE OR POLICY ⇒ Our discoveries could aid in better understanding public perception and attitude towards infectious disease mitigation efforts based on social influ- ences, providing officials and policymakers tools to combat mis/disinformation shared via social media platforms and bolster disease prevention, control and containment for COVID- 19 and in response to future disease outbreaks. P r o t e c t e d b y c o p y r i g h t . INTRODUCTION The COVID- 19 pandemic has changed the lives of individuals and societies worldwide. Since its identification by the WHO in late 2019, the USA alone has since seen more than 87 million confirmed cases and 1 million virus- related deaths.1 With millions of people forced out of public spaces, conversations surrounding the pandemic have taken place online, with a vast majority via social media networks.2 3 People in the Public Eye (PIPE) such as news anchors, politicians, athletes and entertainers have taken this opportunity to discuss diverse topics with their platform followers, including their own experiences and opinion about health issues3 such as COVID- 19, COVID- 19 vaccines and other public health measures. These shared expe- riences and opinions by PIPE often give way to public discourse, with many reacting to polarising statements by liking, commenting and resharing. As populations grow to trust the influential nature of celebrity activity on social platforms, followers are disarmed and open to persuasion when faced with false 1 B M J H e a l t h C a r e I n f o r m : f i r s t p u b l i s h e d a s 1 0 . 1 1 3 6 / j b m h c i - 2 0 2 2 - 1 0 0 6 6 5 o n 2 1 F e b r u a r y 2 0 2 3 . l D o w n o a d e d f r o m h t t p : / / i n f o r m a t i c s . b m j . c o m / o n F e b r u a r y 2 3 , 2 0 2 3 a t U T H S C L b r a r y . i White BM, et al. BMJ Health Care Inform 2023;30:e100665. doi:10.1136/bmjhci-2022-100665 Open access information, creating opportunities for dissemination and rapid spread of misinformation and disinforma- tion.4 5 Exposure to large amounts of misinformation can have lasting effects on overall well- being and sociopsycho- logical health.6 We argue this threat to population health should create a sense of urgency and warrants public health response to identify, develop and implement inno- vative mitigation strategies. Background As social media use has sustainably grown amid the COVID- 19 pandemic, public health researchers have capitalised on the potential for data mining of shared messages on social platforms.7 Ease of access and rapid collection of data permits researchers to follow pandemic progression alongside online sentiment, providing tools for niche discovery and exploration of the emotion behind health decision making. For example, mining tweets from a specified period allows for parallel analysis of general public opinion during major events (ie, the release of new treatments such as vaccines or the death of a celeb- rity post- COVID- 19 infection). Regarding COVID- 19 vaccination specifically, researchers have used this recent increase in opinion sharing to measure overall sentiment and vaccine hesitancy or acceptance.8–11 Moreover, many studies published over the past two decades highlight the persuasive nature of celeb- rity behaviour and messaging-both beneficial and detrimental to public health.12–15 Others have used emotional diffusion networks to investigate the correlation between messaging shared by govern- mental agencies on social platforms and subsequent sentiment shared in response by the general public.16 All present strong evidence in support of impacts on health- related perception, emotion and behaviour as a result of sentiment shared by those with societal influence or authority. Sentiment analysis is the prac- tice of extrapolating the sentiment of a subject, idea, event or phenomenon by classification of written texts as some value of polarity (ie, positive or negative).17 In our previous works,18–20 our team has successfully employed various natural language processing (NLP) models for the analysis of social media shared senti- ment. The application of such analytic tools could allow for time- expanded retrospective analysis of online sentiment in correlation with the progression of the ongoing pandemic. This targeted approach could provide tools for niche discovery and explora- tion of the emotions behind health decision making throughout the COVID- 19 pandemic era and enhance preparedness, response and recovery efforts for future health crises. Herein, we argue that, with the utilisation of a fine- tuned DistilRoBERTa NLP model,18 sentiment and content analysis could uncover a correlation between COVID- 19 vaccine- related messaging shared by PIPE and public sentiment and discourse direction. This discovery 2 could aid in better understanding public perception and attitude towards vaccination based on social influences, providing officials and policymakers tools to combat mis/ disinformation shared via social media platforms moving forward. METHODS Data Our study compared COVID- 19 vaccine- related Twitter posts (tweets) that co- occurred with mentions of PIPE ranging from 1 January 2020 to 1 March 2022. PIPE representatives were chosen due to publicly made state- ments that were either antivaccine in nature or identified as misinformation, as well as propagated misinforma- tion. These individuals included Joe Rogan (JR), Tucker Carlson (TC), Nicki Minaj (NM), Aaron Rodgers (AR), Novak Djokovic (ND), Eric Clapton (EC), Rand Paul (RP), Phil Valentine (PV), Donald Trump (DT), Ted Cruz (TeC), Candace Owens (CO) and Ron DeSantis (RD). To evaluate and analyse differences in sentiment related to various figures, we divided the chosen PIPE representa- tives into three subgroups: (1) athletes/entertainers, (2) politicians, and (3) news personnel. We harvested approxi- mately 13 million tweets with the Python library, Snscrape. For data cleaning, tweets by suspected bots, highly repet- itive news media, highly repetitive- high frequency users or duplicates were removed. The data were then queried for the presence of COVID- 19 vaccine- related terms and PIPE together. After the cleaning and querying process, our final data set consisted of 45 255 tweets composed of 34 407 unique authors. The Tweets contained a total of 16.32 million likes with a maximum of 70228, an average of 45.76 an IQR of 2.0 and a median of zero. Sentiment classification The sentiment was calculated for each tweet using a fine- tuned DistilRoBERTa model10 that was created for a previous sentiment analysis study.18 Pretrained models such as BERT, RoBERT and DistilRoBERTa are readily available as a free resource to researchers from platforms such as huggingface. co. This level of access and ability for rapid data collection determined our use of DistilRoBERTa, considering many other models take several days on dozens of tensor processing units (TPUs) to learn.21 22 The model was trained by label- ling approximately 4000 tweets as positive or nega- tive. These labelled Tweets were then used with the method of back translation to create an augmented dataset of approximately 50 k tweets. The fine- tuning process achieved accuracy and an F1 score of approxi- mately 0.96. After our model was fine- tuned, our data were processed with the Hugging Face pipeline for sentiment analysis. The model reported polarity (ie, positive or negative) as well as a probabilistic confi- dence score from [0,1]. Results will be discussed in terms of per cent positive (ie, n=positive tweets/total P r o t e c t e d b y c o p y r i g h t . B M J H e a l t h C a r e I n f o r m : f i r s t p u b l i s h e d a s 1 0 . 1 1 3 6 / j b m h c i - 2 0 2 2 - 1 0 0 6 6 5 o n 2 1 F e b r u a r y 2 0 2 3 . l D o w n o a d e d f r o m h t t p : / / i n f o r m a t i c s . b m j . c o m / o n F e b r u a r y 2 3 , 2 0 2 3 a t U T H S C L b r a r y . i White BM, et al. BMJ Health Care Inform 2023;30:e100665. doi:10.1136/bmjhci-2022-100665 Open access P r o t e c t e d b y c o p y r i g h t . Figure 1 An abstract representation of the average sentiment shared by People in the Public Eye (PIPE) via the social media platform, Twitter, from 1 January 2020 to 1 March 2022. tweets) and per cent negative (ie, n=negative tweets/ total tweets). Negative tweets mentioning NM had an overall mean score of 0.93 and positive tweets' mean score was 0.87 (see figure 2). RESULTS As shown further, our study findings reflect public senti- ment towards COVID- 19 vaccines and vaccination in relation to messaging shared by chosen PIPE subgroups. Overall, though oscillatory over our specified period, the related sentiment was found to be overall more negative than positive (see figure 1). Athletes/entertainers The maximum positive sentiment for tweets mentioning ND was 0.44 in February 2021, with a minimum of 0.1 in July 2021 and a mean of 0.25. There was a total of 29 210 likes on tweets mentioning ND, with a mean of 46.63. The average confidence score for all negative tweets mentioning ND was 0.96, while the positive tweets' score was 0.88. AR's sentiment maximum of 0.30 in December 2021, a minimum of 0.17 in February 2022 and a mean of 0.25. Tweets mentioning AR had a maximum of 29 210 likes with a mean of 59.56. Negative tweets mentioning AR had a mean confidence score of 0.95, while positive ones had a mean of 0.87. In June 2021, the EC's sentiment reached a max of 0.19, a min of 0.07 and a mean of 0.12. A total of 7327 people liked tweets EC was mentioned in and the mean was 23.82. Tweets mentioning EC labelled as negative had a mean score of 0.97, whereas the ones labelled as positive had a mean score of 0.84. NM senti- ment maximum of 0.66 in May 2021, a minimum of 0.10 in February 2022 and a mean of 0.44. Tweets mentioning NM had a maximum of 16 165 likes and a mean of 39.19. Politicians When querying for social media posts related to poli- ticians, results were noted to have large gaps in shared attitudes throughout our specified period. To begin, DT had a total of 11 195 tweets in our dataset. The maximum positive sentiment for DT occurred in February 2020, at 0.83 per cent positive, but saw a sharp decline a month later to 0.23 per cent positive, before remaining consis- tently low throughout the pandemic. The overall mean sentiment related to DT was determined to be 0.369, and tweets containing DT's name obtained a maximum of 52 650 likes, with a mean of 31.14. The dataset contained a total of 1520 tweets mentioning TeC. TeC- associated sentiment reached a maximum during May 2020 at 0.22, a minimum in January 2021 at 0.12 and a mean score of 0.287. Tweets mentioning TeC had a maximum of 70 228 likes and a mean of 74.51. References to RD occurred 3885 times in our dataset. Sentiments associ- ated with RD reached a maximum during June 2021 at 0.966, a minimum of 0.25 in June 2020 and a mean of 0.168. Tweets mentioning RD had a maximum of 17 560 likes and a mean of 74.79. Lastly, Tweets mentioning RP totaled 2892 in our dataset, with a maximum sentiment of 0.6 in March 2020, a minimum of 0.16 in December 2021 and a mean of 0.290. Tweets mentioning RP had a maximum of 23 749 likes and a mean of 36.74 (see figure 3) 3 B M J H e a l t h C a r e I n f o r m : f i r s t p u b l i s h e d a s 1 0 . 1 1 3 6 / j b m h c i - 2 0 2 2 - 1 0 0 6 6 5 o n 2 1 F e b r u a r y 2 0 2 3 . l D o w n o a d e d f r o m h t t p : / / i n f o r m a t i c s . b m j . c o m / o n F e b r u a r y 2 3 , 2 0 2 3 a t U T H S C L b r a r y . i White BM, et al. BMJ Health Care Inform 2023;30:e100665. doi:10.1136/bmjhci-2022-100665 Open access Figure 2 Polarity per cent positive versus time. The blue line represents tweets mentioning Nicki Manaj. The orange line represents tweets mentioning Aaron Rodgers. The green line represents tweets mentioning Novak Djakovic. The red line represents tweets mentioning Eric Clapton. News personnel For news media personalities (NMP), JR had a total of 6136 tweets in our dataset. The maximum positive senti- ment for JR occurred in January 2021 but quickly reversed to reach a minimum in February 2021. The overall mean positive sentiment was determined to be 0.295. The mention of JR in a tweet received the maximum like count of 49 929 and a mean of 62.11. References to TC occurred 4843 times in our dataset. Positive sentiments associated with TC reached a maximum during April 2021 at 0.355, a minimum of 0.074 in August 2020 and a mean of 0.249. Tweets mentioning TC had a maximum of 24 586 likes and P r o t e c t e d b y c o p y r i g h t . B M J H e a l t h C a r e I n f o r m : f i r s t p u b l i s h e d a s 1 0 . 1 1 3 6 / j b m h c i - 2 0 2 2 - 1 0 0 6 6 5 o n 2 1 F e b r u a r y 2 0 2 3 . l D o w n o a d e d f r o m h t t p : / / i n f o r m a t i c s . b m j . c o m Figure 3 Polarity per cent positive versus time. The blue line represents tweets mentioning Donald Trump. The orange line represents tweets mentioning TED cruz. The green line represents tweets mentioning Ron DeSantis. The red line represents tweets mentioning Rand Paul. 4 / o n F e b r u a r y 2 3 , 2 0 2 3 a t U T H S C L b r a r y . i White BM, et al. BMJ Health Care Inform 2023;30:e100665. doi:10.1136/bmjhci-2022-100665 Open access Figure 4 Polarity percent positive versus time. The blue line represents tweets mentioning Joe Rogan. The orange line represents tweets mentioning Tucker Carlson. The green line represents tweets mentioning Candace Owens. The red line represents tweets mentioning Phil Valentine. a mean of 39.35. PV had 1264 mentioning his name and reached his maximum sentiment of 0.4 in,23 a minimum of 0.107 in December 2021 and a mean of 0.257. Tweets mentioning PV had a maximum of 12 264 likes and a mean of 62.75. Lastly, CO reached her maximum senti- ment of 0.43 in January 2022, a minimum score of 0.038 in October 2021 and a mean of 0.229. Tweets mentioning CO displayed a maximum of 7195 likes and a mean of 38.60. CO occurred 996 times in our dataset. It is worth mentioning that occurrences of these personalities in tweets were not constant throughout the pandemic. TC and PV both were first mentioned in July 2020, JR in October 2020 and CO in November 2020 (see figure 4). Sentiment change analysis Correlating changes in sentiment with real- world events can be challenging in large corpora without using compu- tational topic modelling and/or semantic analysis. It is conceivable that some insight can be gained by noting the occurrence of sentimental shifts within a similar timeframe. With our data set, the majority of maximum or minimum sentiment occurred during different months. However, 3 months contained two occurrences of achieving a maximum or minimum sentiment (1 pos, 2 neg). NM and EC (both entertainers) achieved their maximum sentiment in June 2021. Following the approval of the Pfizer vaccine for ages 12–15 years, the only other major development was the detection of the delta variant. Two politicians (TeC and RP) expressed their most nega- tive sentiment in December 2021. Many significant events occurred in December 2021 including the first detection of the COVID- 19 omicron variant in the USA (1 December P r o t e c t e d b y c o p y r i g h t . 2021), the Centers for Disease Control and Prevention (CDC) and FDA expanding booster recommendations to include everyone 16 years and older (9 December 2021), the reported death toll in the USA surpasses 800 000 (one in every 100 people ages 65+ years has died) (15 December 2021), the Pfizer- BioNTech or Moderna offi- cially recommended over Johnson & Johnson vaccine (16 December 2021), the Omicron variant found to be 1.6 times more transmissible than Delta (20 December 2021) and the recommended isolation period shortened to 5 days on 27 December 2021. Two entertainers achieved their lowest sentiment in February 2022 (NM and AR). The only major events of February 2022 were related to a 30% rise in the death rate due to omicron infections. Furthermore, February 2022 was several months after NM and AR comments regarding vaccines. That being, it could be argued that sentiment related to entertainers or sports figures might not purely be driven by major devel- opments in the pandemic. DISCUSSION Our study examined the role of messaging shared by PIPE in determining general public discourse direction and the nature of sentiment shared via social media networks. Drawing on messaging shared by our three subgroups of influential users, findings suggest the presence of consis- tent patterns of emotional content shared by PIPE for the first 2 years of the COVID- 19 pandemic influenced public opinion and largely stimulated online public discourse. 5 B M J H e a l t h C a r e I n f o r m : f i r s t p u b l i s h e d a s 1 0 . 1 1 3 6 / j b m h c i - 2 0 2 2 - 1 0 0 6 6 5 o n 2 1 F e b r u a r y 2 0 2 3 . l D o w n o a d e d f r o m h t t p : / / i n f o r m a t i c s . b m j . c o m / o n F e b r u a r y 2 3 , 2 0 2 3 a t U T H S C L b r a r y . i White BM, et al. BMJ Health Care Inform 2023;30:e100665. doi:10.1136/bmjhci-2022-100665 Open access When comparing the overall mean score between nega- tive and positive comments for individuals in the athletes/ entertainers' subgroup, it can be concluded that related sentiment holds a more negative tone than positive. For this subgroup, the highest number of negative comments were associated with AR and NM, with a combined mean of 0.95. Regarding EC, it is interesting that he had very few positive tweets, the least in the group and the highest score difference. This fact implies that EC has been largely criticised by the public and was the least favourite figure of the subgroup. As evidence of this argument, the tweet with the highest like count mentioning EC states, 'Strongly disagree with [EC]...take on Covid and the vaccine and disgusted by his previous white supremacist comments. But if you reference the death of his son to criticize him, you are an ignorant scumbag'. The theme of overarching negative sentiment continues when examining findings within the poli- ticians' subgroup. DT and TeC were found to have the most substantial impact within the subgroup, with a large number of combined likes totaling more than 122 000, with a monthly- based mean of 0.33. A substantial portion of tweets related to this subgroup was aimed at ques- tioning whether politicians hold sufficient expert public health knowledge to advise constituents on medical deci- sion making. This is reflected in the most liked tweet mentioning TeC, a user sharing, 'I called Ted Cruz's office asking to make an appointment to talk with the Senator about my blood pressure. They told me that the Senator was not quali- fied to give medical advice and that I should call my doctor. So I asked them to stop advising about vaccines'. It became increas- ingly clear that this subgroup was the most tumultuous. The spread, reaction and engagement by the public to posts made by politicians online was indicative of a strong level of influence, suggesting politicians play key roles in ensuring population health and should be committed to promoting health- protective behaviours rather than sensational falsehoods. As mentioned reviously, though sentiment related to the subgroup of news media personalities was shown to be oscillatory throughout the pandemic, emotion shared was overall more negative than positive. More- over, tweets referencing this group were typically more related to antivaccine controversy or death (ie, death of PV) rather than news about vaccine development. Though the sentiment for the subgroup was overwhelm- ingly negative on average, a more interesting story begins to appear with the inspection of tweet content. For example, the most liked tweet associated with JR was 'I love how the same people who don't want us to listen to Joe Rogan, Aaron Rodgers about the covid vaccine, want us to listen to Big Bird & Elmo', clearly a vaccine- hesitant or antivaccine statement. Notably, it is interesting to compare the number of tweets with the total number of maximum likes. This combined set of news media personalities had a total of 14 017 with 93 974 associated highest like count. The high number of likes displayed within these tweets shows that a much higher number of 6 users are involved in reading tweets and are therefore potentially influenced by the content. impacts on Public health implications We argue the application of our findings could have meaningful the public health sector, bolstering currently available surveillance tools for preci- sion health promotion,24 management of the ongoing COVID- 19 pandemic and preparing for the next crisis. As we have demonstrated, messaging shared by influen- tial members of society can have considerable effects on the directionality of public emotion and shared health decision making. Both negative and positive online social endorsement of prevention strategies such as vaccination are key in determining population- wide compliance and uptake success. However, threats of the spread of misin- formation and disinformation by those with influence stand to undermine programmes supporting protective measures such as vaccination. As misinformation poses a range of psychological and psychosocial risks (anxiety, fear, etc), public health institutions hold some responsi- bility for the continued development and sustainability of low human effort surveillance systems optimised for generating responses to waves of falsities shared via social media platforms. Discernment of the dynamic levels of population sentiment shared via social media would allow public health officials to design catered mitigation and communication strategies. Social campaigns aimed at directing users with COVID- 19 related inquiries to high- quality sources such as the CDC and other trusted public health institutions for evidence- based recommendations and instruction. Furthermore, public health and research institutions could be more proactive in creating collab- orations with PIPE to share more positive messaging regarding vaccination. Moreover, there is room for intel- ligent algorithmic systems that identify patterns and anomalies in shared messaging, tasked with boosting messaging from social influencers who stand in affirma- tion of COVID- 19 mitigation strategies; however, there is a need for a broader understanding of the potential negative implications, including ethical and legal issues.23 Limitations It is important to note some study limitations should be considered in unison with our findings. Sentiment analysis of social media shared messaging has long been challenging due to the ambiguity of natural language. Though language models such as BERT help to mitigate many of these challenges, the difficulty lies in the true detection of sarcasm, humour and complex inferences. As such, models currently available are unable to distinguish sentiment expressed towards different targets. As such, sentiment cannot be individually mined for two separate topics if shared within a short tweet. For example, if a user were to positively mention the name of a politician in support of COVID- 19 vaccination while simultaneously sharing negative emotions toward communities in oppo- sition, current language models may label the overall P r o t e c t e d b y c o p y r i g h t . B M J H e a l t h C a r e I n f o r m : f i r s t p u b l i s h e d a s 1 0 . 1 1 3 6 / j b m h c i - 2 0 2 2 - 1 0 0 6 6 5 o n 2 1 F e b r u a r y 2 0 2 3 . l D o w n o a d e d f r o m h t t p : / / i n f o r m a t i c s . b m j . c o m / o n F e b r u a r y 2 3 , 2 0 2 3 a t U T H S C L b r a r y . i White BM, et al. BMJ Health Care Inform 2023;30:e100665. doi:10.1136/bmjhci-2022-100665 sentiment as negative. Though the negative emotion was not targeted to the mentioned politician, the model was limited in differentiating sentiment within the messaging. Moreover, though messaging shared by suspected bots, highly repetitive news media, highly repetitive high frequency users or duplicates were removed, it is possible a small amount could have still slipped through the data cleaning process. CONCLUSION While faint differences in sentiment were observed across the subgroups, a broadly polarised negative tone was established. We demonstrate that as the pandemic progressed, public sentiment shared on social networks was shaped by risk perceptions, political ideologies and health- protective behaviours shared by PIPE. The risk of severe negative health outcomes increases with failure to comply with health- protective behaviour recommen- dations set forth by public health officials, such as vacci- nation, and our findings suggest that polarised messages from societal elites may downplay these risks, unduly contributing to an increase in the spread of COVID- 19. In particular, we believe messaging shared by politicians and news personnel could be most strongly correlated with public health events; however, further experiments are needed. In the future, we plan to further explore the correlation of PIPE- shared sentiment with monu- mental events during the COVID- 19 pandemic, such as the release of vaccinations or mask mandate liftings. Establishing a more thorough correlation between social media shared sentiment and health outcomes could help revolutionise public health responses to future infectious disease outbreaks. Contributors BMW conceptualised and supervised the study and drafted, reviewed and edited the manuscript. CM and PZ conceptualised the study and drafted, reviewed and edited the manuscript. RLD reviewed and edited the manuscript. RAB reviewed and edited the manuscript. AS- N drafted, reviewed and edited the manuscript, supervised the study acting as guarantor, and acquired funding. Funding This work was partially supported by National Cancer Institute (NCI) grant number #1R37CA234119- 01A1. Competing interests None declared. Patient consent for publication Not applicable. Ethics approval Not applicable. Provenance and peer review Not commissioned; externally peer reviewed. Data availability statement Data are available on reasonable request. Open access This is an open access article distributed in accordance with the Creative Commons Attribution Non Commercial (CC BY- NC 4.0) license, which permits others to distribute, remix, adapt, build upon this work non- commercially, and license their derivative works on different terms, provided the original work is properly cited, appropriate credit is given, any changes made indicated, and the use is non- commercial. See: http://creativecommons.org/licenses/by-nc/4.0/. ORCID iDs Brianna M White http://orcid.org/0000-0001-7576-5874 Arash Shaban- Nejad http://orcid.org/0000-0003-2047-4759 Open access REFERENCES 1 Johns Hopkins Coronavirus Resource Center. COVID- 19 Dashboard; 2020. https://coronavirus.jhu.edu/map.html [Accessed 18 Jan 2022]. 2 Wahbeh A, Nasralah T, Al- Ramahi M, et al. Mining physicians' opinions on social media to obtain insights into COVID- 19: mixed methods analysis. JMIR Public Health Surveill 2020;6:e19276. 3 Abdukhamidov E, Juraev F, Abuhamad M, et al. Sentiment analysis of users' reactions on social media during the pandemic. Electronics 2022;11:1648. 4 Hoffman SJ, Mansoor Y, Natt N, et al. Celebrities' impact on health- related knowledge, attitudes, behaviors, and status outcomes: protocol for a systematic review, meta- analysis, and meta- regression analysis. Syst Rev 2017;6:13. 5 Gisondi MA, Barber R, Faust JS, et al. A deadly Infodemic: social media and the power of covid- 19 misinformation. J Med Internet Res 2022;24:e35552. 6 Yoosefi Lebni J, Irandoost SF, Mehedi N. The role of celebrities during the COVID- 19 pandemic in Iran: opportunity or threat? Disaster Med Public Health Prep 2020:1–2. 7 Abbas J, Wang D, Su Z, et al. The role of social media in the advent of COVID- 19 pandemic: crisis management, mental health challenges and implications. Risk Manag Healthc Policy 2021;14:1917–32. 8 Melton C, Olusanya OA, Shaban- Nejad A. Network analysis of COVID- 19 vaccine misinformation on social media. Stud Health Technol Inform 2021;287:165–6. 9 Puri N, Coomes EA, Haghbayan H, et al. Social media and vaccine hesitancy: new updates for the era of COVID- 19 and globalized infectious diseases. Hum Vaccin Immunother 2020;16:2586–93. 10 Baines A, Ittefaq M, Abwao M. #Scamdemic, #Plandemic, or #Scaredemic: what parler social media platform tells Us about COVID- 19 Vaccine. Vaccines 2021;9:421. 11 Jennings W, Stoker G, Bunting H, et al. Lack of trust, conspiracy beliefs, and social media use predict COVID- 19 vaccine hesitancy. Vaccines 2021;9:593. 12 Cohen EL, Knight J, Mullin M. Loving to hate the kardashians: examining the interaction of character liking and hate- watching on the social influence of a reality TV show. Psychology of Popular Media 2020. 13 Hoffner CA, Cohen EL. Mental health- related outcomes of robin williams' death: the role of parasocial relations and media exposure in stigma, help- seeking, and outreach. Health Commun 2018;33:1573–82. 14 Rahmani G, McArdle A, Kelly JL. The hugh jackman effect- the impact of celebrity health disclosure on skin cancer awareness. Dermatol Surg 2018;44:1039–40. 15 Brown WJ, Basil MD. Parasocial interaction and identification: social change processes for effective health interventions. Health Commun 2010;25:601–2. 16 Xi H, Zhang C, Zhao Y, et al. Public emotional diffusion over COVID- 19 related Tweets posted by major public health agencies in the United States. Data Intell 2022;4:66–87. 17 Liu Y, Ott M, Goyal N. Roberta: a robustly optimized bert pretraining approach. arXiv 2019;1907:11692. 18 Melton CA, White BM, Davis RL, et al. Fine- tuned sentiment analysis of COVID- 19 vaccine- related social media data: comparative study. J Med Internet Res 2022;24:e40408. 19 Melton CA, Bae J, Olusanya OA. Semantic network analysis of COVID- 19 vaccine related text from reddit. In: Shaban- Nejad A, Michalowski M, Bianco S, eds. Multimodal AI in healthcare: a paradigm shift in health intelligence. Studies in computational intelligence, 1060. Springer, Cham, 2022: 257–66. 20 Melton CA, Olusanya OA, Ammar N, et al. Public sentiment analysis and topic modeling regarding COVID- 19 vaccines on the reddit social media platform: a call to action for strengthening vaccine confidence. J Infect Public Health 2021;14:1505–12. 21 Beddiar DR, Jahan MS, Oussalah M. Data expansion using back translation and paraphrasing for hate speech detection. Online Soc Netw Media 2021;24:100153. 22 Sanh V, Debut L, Chaumond J. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv 2019. 23 Khemasuwan D, Colt HG. Applications and challenges of AI- based algorithms in the COVID- 19 pandemic. BMJ Innovations 2021;7:387–98. 24 Shaban- Nejad A, Michalowski M, Peek N, et al. Seven pillars of precision digital health and medicine. Artif Intell Med 2020;103:101793. P r o t e c t e d b y c o p y r i g h t . 7 B M J H e a l t h C a r e I n f o r m : f i r s t p u b l i s h e d a s 1 0 . 1 1 3 6 / j b m h c i - 2 0 2 2 - 1 0 0 6 6 5 o n 2 1 F e b r u a r y 2 0 2 3 . l D o w n o a d e d f r o m h t t p : / / i n f o r m a t i c s . b m j . c o m / o n F e b r u a r y 2 3 , 2 0 2 3 a t U T H S C L b r a r y . i White BM, et al. BMJ Health Care Inform 2023;30:e100665. doi:10.1136/bmjhci-2022-100665
http://arxiv.org/abs/2302.12347v1
2023-02-23T21:56:42
2023-02-23T21:56:42
MetaLDC: Meta Learning of Low-Dimensional Computing Classifiers for Fast On-Device Adaption
Fast model updates for unseen tasks on intelligent edge devices are crucial but also challenging due to the limited computational power. In this paper,we propose MetaLDC, which meta-trains braininspired ultra-efficient low-dimensional computing classifiers to enable fast adaptation on tiny devices with minimal computational costs. Concretely, during the meta-training stage, MetaLDC meta trains a representation offline by explicitly taking into account that the final (binary) class layer will be fine-tuned for fast adaptation for unseen tasks on tiny devices; during the meta-testing stage, MetaLDC uses closed-form gradients of the loss function to enable fast adaptation of the class layer. Unlike traditional neural networks, MetaLDC is designed based on the emerging LDC framework to enable ultra-efficient on-device inference. Our experiments have demonstrated that compared to SOTA baselines, MetaLDC achieves higher accuracy, robustness against random bit errors, as well as cost-efficient hardware computation.
[ "Yejia Liu", "Shijin Duan", "Xiaolin Xu", "Shaolei Ren" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12347v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12347v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 7 4 3 2 1 . 2 0 3 2 : v i X r a MetaLDC: Meta Learning of Low-Dimensional Computing Classifiers for Fast On-Device Adaption Yejia Liu UC Riverside [email protected] Xiaolin Xu Northeastern University [email protected] Shijin Duan Northeastern University [email protected] Shaolei Ren UC Riverside [email protected] ABSTRACT Fast model updates for unseen tasks on intelligent edge devices are crucial but also challenging due to the limited computational power. In this paper, we propose MetaLDC, which meta-trains brain- inspired ultra-efficient low-dimensional computing classifiers to enable fast adaptation on tiny devices with minimal computational costs. Concretely, during the meta-training stage, MetaLDC meta trains a representation offline by explicitly taking into account that the final (binary) class layer will be fine-tuned for fast adaptation for unseen tasks on tiny devices; during the meta-testing stage, MetaLDC uses closed-form gradients of the loss function to enable fast adaptation of the class layer. Unlike traditional neural networks, MetaLDC is designed based on the emerging LDC framework to enable ultra-efficient on-device inference. Our experiments have demonstrated that compared to SOTA baselines, MetaLDC achieves higher accuracy, robustness against random bit errors, as well as cost-efficient hardware computation. KEYWORDS High-dimensional computing, low-dimensional computing, meta learning, fast adaption, scalability ACM Reference Format: Yejia Liu, Shijin Duan, Xiaolin Xu, and Shaolei Ren. 2023. MetaLDC: Meta Learning of Low-Dimensional Computing Classifiers for Fast On-Device Adaption. In Proceedings of tinyML Research Symposium (tinyML Research Symposium'23). ACM, New York, NY, USA, 8 pages. 1 INTRODUCTION Deep neural networks (DNNs) have become the backbone of intelli- gent applications in a wide range of domains from computer vision to natural language processing [1, 5, 25]. Meanwhile, compared to cloud-based inference, on-device inference has numerous advan- tages, including better privacy preservation and anytime inference without relying on network connections. Nonetheless, despite the recent progress [27, 35], directly running DNN inference and adapt- ing the model to unseen tasks on the edge are still challenging due to the conflict between high computational demand of DNNs and Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s). tinyML Research Symposium'23, March 2023, San Francisco, CA © 2023 Copyright held by the owner/author(s). the low resource availability of edge devices, especially tiny devices such as microcontrollers and Internet-of-Things (IoT) devices. In response to the excessive resource demand of DNNs, hyperdi- mensional computing (HDC) has emerged as an alternative towards efficient on-device inference [19]. The key idea of HDC is to encode data into (binary) hypervectors each with dimensions of thousands or even more, and then perform cosine/Hamming distance sim- ilarity for inference using bit-wise binary operations in parallel. Owning to its hardware friendliness and efficiency, HDC classifiers have been adopted to an increasingly broader range of inference tasks for resource-constrained devices [6, 10]. Nonetheless, there are still fundamental limitations that prohibit the applicability of HDC for tiny devices with extremely limited resources. First, the orders of megabyte of memory required by HDC to support its hyperdimensional data representation can be too costly for tiny devices [11, 18]. Second, compared to today's DNNs, the HDC training process is extremely rudimentary (e.g., simply taking the average of inputs, plus some semi-blind heuristic adjustments, without loss functions), resulting in low inference accuracy. Last but not least, each HDC training process can only fit into one data distribution, which means that HDC training does not scale to a large number of tiny devices, each having potentially different distributions. While the recent brain-inspired low-dimensional computing (LDC) classifiers outperform HDC by utilizing ultra-low dimen- sional vectors and principled training based on an equivalent neu- ral network to improve the inference efficiency and accuracy [11], it cannot support fast model adaptation to unseen tasks on tiny devices. More concretely, LDC trains an individual model for each device, and hence the total training cost can be labor-intensive when there are many tiny devices deployed in heterogeneous environ- ments each with different data distributions[24]. Additionally, fast adaption to unseen tasks with only a handful of data points presents substantial challenges for tiny devices, due to their constrained com- puting resources that prohibit traditional model updates based on gradients and backpropagation. While some studies have proposed to train a collaborative (DNN) model in a distributed manner to facilitate knowledge transfer between edge devices [24], the com- munication latency among edge nodes and complicated local neural network computation make this approach still too expensive for a tiny device. In the presence of heterogeneous tiny devices each with a dif- ferent data distribution, we propose MetaLDC, a new LDC-based meta learning approach that achieves fast model adaptation to an tinyML Research Symposium'23, March 2023, San Francisco, CA Liu, et al. Figure 1: Overview of MetaLDC. Our MetaLDC is based on the ultra-lightweight LDC network and composed of two stages: meta-training and fast adaption. The meta parameter θ keeps learned knowledge from heterogeneous data distributions, while the task-specific parameter φ is used to quickly adapt to unseen tasks from a new tiny device. unseen task and ultra-efficient inference on tiny devices. Specif- ically, MetaLDC meta trains an LDC-equivalent neural network, in which the first few layers are non-binary values specifically for LDC data encoding and the last layer has binary weights (denoted by φ) for classification. Crucially, given the difficulty in calculating gradients and performing backpropagation over the entire LDC- equivalent neural network on resource-constrained tiny devices, we only treat the last layer φ as task-specific: the LDC data encoding part is explicitly learned to fit heterogeneous distributions, while only the classification layer φ is adapted using a simple closed-form gradient expression to each tiny device for fast and inexpensive model update with minimal on-device computational costs. Thus, unlike the standard meta learning technique (e.g., MAML [12]), MetaLDC meta trains the first few layers in the LDC-equivalent neural network by explicitly considering that these layers will be fixed without updates on tiny devices. Our experimental results have empirically shown that MetaLDC can significantly outperform state-of-the-art (SOTA) baselines in- cluding SOTA HDC [20] and pretrained LDC model on both vision and non-vision datasets in terms of accuracy, robustness against the random bit errors on hardware, as well as cost efficiency including energy consumption, latency and model size. 2 BACKGROUND Hyper-dimensional computing (HDC): The HDC is a brain- inspired, cognitive computing architecture built on a unique data type, referred to as the hypervectors. The dimensionality of the hypervectors can be from a thousand to tens of thousands. By ma- nipulating these hypervectors, the HDC aims to perform cognitive tasks via hardware-efficient operations like element-wise additions and dot products. In the general supervised classification based on HDC, the fea- tures of the input sample would be encoded into hypervectors Fi s, together with their corresponding value hypervectors Vfi s, pre-stored in the item memory. By binding F and V via: ∑︁ sgn( Fi × Vfi ), i we can obtain the encoded input sample H . In training, all H s belonging to the same class would be summed and averaged to obtain the class hypervectors, stored in the associative memory. In the inference stage, the testing data would be transformed into the query hypervectors using the same encoder. Then a similarity checker like the Hamming distance would be applied in the asso- ciative memory between each trained class hypervectors and the query hypervector. The class label with the closest distance would be returned. Due to the simplicity of bitwise operations, the HDC has achieved success on platforms like FPGA and ASIC [6]. However, the large model size resulted from the ultra-high di- mensions of the data representation in the HDC compromise its wide adoption on tiny devices, which are usually under severe resource consumption constraints. On the other hand, although numerous endeavors have been put into improving the accuracy of the HDC classifier [20], there is still a large accuracy gap between the HDC models and a simple modern neural network model like the Multi-Layer Perceptron (MLP). Low-Dimensional Computing (LDC): To overcome the fun- damental limitations of low accuracy and inference efficiency in HDC, the low-dimensional computing (LDC) classifiers are pro- posed as a brain-inspired substitute of HDC classifiers with higher accuracy and order-of-magnitude better on-device inference effi- ciency, especially for tiny devices with intelligent needs. Unlike HDC, LDC classifiers offer a systematic training procedure, where the value vectors Vs and feature vectors F s are explicitly opti- mized rather than being randomly generated. On the other hand, the required order of magnitude of the involved vectors dimension size in the LDC is only a few to tens to achieve a higher accuracy compared to the state-of-the-art HDC, e.g. 87.38% w/ D = 8, 000 vs. 91.22% w/ D = 4/64 on the MNIST dataset [11]. The blue and orange boxes with dashed lines in Figure 1 pro- vides an overview of the LDC model architecture. The ValueBox is an encoding network. It maps the feature values Fi s of an input sample into a bipolar value vector Vfi . Followed is the feature layer, which is essentially a sparse binary neural network to bind the bipolar feature values Vfi with the corresponding feature vectors Fi through the Hadamard product. The last class layer equivalently performs similarity checking, where the weights of the layer are collections of all class vectors. This layer outputs the score product for each class, and the class label with the highest score is taken as the classification result ˆy. It is worth noting that the inference in an LDC classifier is fully binary as the non-binary weights of ValueBox is not needed after training. Compared to HDC, LDC ValueBoxFeature Layer-1 1 -1 ... 1-1 -1 1 ... 11 1 ... -1 1-1 1 -1 ... 1...Class LayerFeature VectorValue VectorModel ArchitectureOnly updated in the outer loop of meta-trainingPhase 1. Meta-trainingPhase 2. Fast adaptionUpdated in both inner and outer loop of meta-training......Output A new deviceFrozenUpdatedOutput MetaLDC: Meta Learning of Low-Dimensional Computing Classifiers for Fast On-Device Adaption tinyML Research Symposium'23, March 2023, San Francisco, CA classifiers have been demonstrated as a more promising alternative due to its lightweight model and high inference accuracy to support intelligent agents in the tiny devices. 3 PROBLEM SETUP We focus on the few-shot supervised learning in this work. Super- vised learning learns a model that maps input data points x ∈ X which have a true label y ∈ Y to predictions ̃y. A task Ti is com- posed of (X, Y, L, q), where L is the task-specific loss function and q is the data distribution of Ti . We assume all data points are drawn i.i.d. from q. Given the distributions over a set of tasks p (T ), we aim at learn- ing a general representation function f (*; θ ) using a handful of data points from each class. The f (*; θ ) is essentially a representation learning network parameterized by θ , which can then fast adapt to previously unseen tasks in new devices by learning another adaption function g(f (θ ); φ) with little local data examples and (closed-form) gradient updates on φ with minimal computation. In a nutshell, we propose to train the LDC backbone as a reusable template to fast adapt to new tasks on tiny devices in the end. With the goal of obtaining a good initialization, we train the LDC model in a meta-learning manner. Our MetaLDC consists of two phases: meta-training and meta-testing (also referred to as fast adaption). We meta-train on m tasks Si ∼ p (T ), i = 1, * * * , m to learn the representation, and meta-test on a different task T ∼ p (T ). In the training process of MetaLDC, we introduce two updating loops as shown in our Algorithm 1. In a nutshell, the inner loop updates model parameters with respect to an individual task using K data points by one (or few) gradients steps, while the outer loop updates the entire model's parameters with regard to the loss after the inner loop updates. In the fast adaption stage, we apply M-shot N -way evaluation, where N is the number of classes per task. We would use M data examples from each class of the new task to update the partial model, and then carry out the evaluation on the testing dataset from the new task. 4 THE DESIGN OF METALDC In this section, we present our architecture, referred to as the Met- aLDC. It uses a carefully-crafted interleaved training algorithm to train the LDC classifier. The primary objective is to achieve fast adaption to unseen (but related) tasks on edge tiny devices by updat- ing partial learned model parameters with minimal computational cost. We provide an overview of the MetaLDC in Figure 1. 4.1 Meta Training The original MAML [12] takes the training-and-fine-tuning pipeline, which optimizes θ and φ together in both meta-training and fast adaption. But, updating the non-binary weights θ can be too compu- tationally expensive for tiny devices. Thus, in MetaLDC, we instead use the training-and-probing pipeline. The key idea of MetaLDC is to separate the representation function f (*; θ ) and the prediction function g(*; φ) for meta-training and fast adaption on tiny devices. Thus, we only optimize the representation function f (*; θ ) in the meta-training, and optimize the prediction function g(*; φ) in fast adaption. Specifically, in the meta-training, for each update step, we first learn a randomly initialized prediction function g(*; φ) to classify examples based on a given representation f (*; θ ). An updated pa- rameter φi is obtained using K examples from the sampled tasks Si through one (or more) gradient steps w.r.t. the loss on the sampled tasks. We then resample K new examples from each class in Si and optimize the whole model w.r.t. (θ, φ) across those tasks from p (T ). The full algorithm is outlined in the Algorithm 1, where α, β repre- sent tunable step size. Intuitively, the φ serves as the task-specific embedding, which modulates the behaviour of the model. In the outer loop updates, by considering how the errors on specific task changes with respect to the updated model parameters, we expect to obtain a model initialization such that small changes in the model parameters could lead to substantial performance improvement for any task. This improvement has been empirically attested in our evaluations of section 5. Algorithm 1 MetaLDC- Training Input: T : the whole task set; t: number of outer gradient steps; m: Number of inner gradient steps (i.e., number of sampled meta-training tasks); α, β: step size parameters. Output: θ , φ 1: Randomly initialize parameters θ, φ 2: for j in 1, 2, ..., t do 3: for i in 1, 2, ..., m do Sample batches Bi ⊲ outer loop ⊲ inner loop ⊲ each batch Bi contains K examples for each class in Si ∼ p (T ) Derive task-specific φ ′ i : φ ′ Re-sample another batch B′ i ← φ − α∇φ L(Bi ; θ, φ) i of the same batch size end for Update both parameters θ , φ: i ; θ, φ ′ i ) L(B′ β∇θ,φ (cid:205)m i=1 (θ, φ) ← (θ, φ) − 4: 5: 6: 7: 8: 9: end for 10: Return θ , φ It is also worth noting that as the meta training involves poten- tially many tasks to learn a good initialization, the whole process of meta-training can be done on either the GPU or a powerful CPU. In contrast, adaptation is performed on local tiny devices with minimal computation cost as we explained in the subsequent subsections. 4.2 Fast Adaption Given the learned initialization, we can fast adapt to a new task Ti under a M-shot N -way setup. To adapt to a new task on each tiny device, we freeze the parameters of the representation network θ and only update the class layer's parameter φ by using only a few samples. By this means, we preserve the broad knowledge learned from various tasks in the representation network f (*; θ ). Moreover, updating the last layer φ rather than the entire model is far less costly and therefore more affordable for tiny devices which are usually with stringent resource constraints. Furthermore, we use the hinge loss instead of the commonly used cross-entropy for gradient updates, as the former requires less complicated arithmetic operations. Instead of requiring the model to compute gradients by itself, we feed the gradients of the hinge loss in a closed-form to the model directly, via Eqn. (1): tinyML Research Symposium'23, March 2023, San Francisco, CA Liu, et al. Algorithm 2 MetaLDC - Fast adaption to a new task T Input: θ , φ: learned model parameters; t: Number of gradient steps; γ: step size parameters. Output: φ 1: Sample M examples for each class of T 2: for j in 1, 2, ..., t do 3: 4: end for 5: Return φ Update φ by: φ ← φ − γ ∇φ L(*; θ, φ) ∇wj Li = (cid:40)− (cid:205)j ≠yi 1(wT 1(wT j xi − wT yi j xi − wT xi + Δ > 0) * xi, yi xi + Δ > 0), j = yi j ≠ yi, (1) where Δ is the desired margin; wyi is the parameters corresponding to the correct class; w j is the rest of parameters, and xi is the vector representation for the data example i. We outline the fast adaption process in the Algorithm 2. Interestingly, compared to fine-tuning entire parameters of all layers in the fast adaption, our experiments results have shown the accuracy achieved by the MetaLDC, which only updates last layer's parameters, is not lower. This can be attributed to the alleviated meta over-fitting issue, as updating the entire model using a few data points from a task in the adaption stage can easily cause the model to overfit to this partial data distribution. 5 EVALUATION In this section, we empirically evaluate the performance of Met- aLDC compared to several baselines on both vision and non-vision datasets. We have considered various performance perspectives, including adaption accuracy on unseen tasks with a small amount of data points, robustness against hardware random bit errors, the latency and hardware energy consumption, as well as the change of model's accuracy w.r.t. the hyperparameters values selection. Additionally, we have also evaluated the efficacy of the learned representation f (*; θ ). 5.1 Setup We describe the datasets and tasks, baselines, as well as implemen- tation details here. Datasets. We use two benchmarking lightweight datasets, for both vision and non-vision applications, to evaluate MetaLDC on tiny devices. One is the Rotated MNIST, which is originated from MNIST [7]. In Rotated MNIST, each image contains the digit rotated by a certain degree. The other is referred to as Split ISOLET, derived from the UCI ISOLET dataset [31]. The ISOLET contains 26 classes in total, and we divide them into separate tasks, where each task contains 4 unique randomly sampled classes. Training and Evaluation Tasks. In the Rotated MNIST, the ro- tation degree of tasks we use to train the methods are between [10◦, 20◦). The learned models are then evaluated on the testing dataset of Rotated MNIST with rotation degree from {0◦, 2◦, 4◦, 6◦, 8◦}. For the Split ISOLET, we use 20 classes from the ISOLET to generate the training tasks, while the remaining classes form the candidate classes pool to produce evaluation tasks. Baselines. We compare MetaLDC with both HDC methods and other LDC-based models. In the Pretrained LDC method, we pre- train the LDC model with standard supervised learning using the whole training datasets from the training tasks. Then we also use the Algorithm 2 for fine-tuning. Another baseline we designed is the MetaLDC-full. The training algorithm of MetaLDC-full is the same as MetaLDC, as shown in the Algorithm 1. The difference is in the fine-tuning stage, where we update the parameters of the entire model, not only the last layer for the MetaLDC-full. Note that MetaLDC-full is prohibitively expensive for tiny devices, as it requires keeping the entire weights of the LDC model and full backpropagation calculations throughout the fast adaptation pro- cess. Besides the LDC variants, we also compare with a SOTA HDC method, the HDC with retraining. The HDC w/ retraining would give more weights to a misclassified sample in its correct class hypervector and subtracted from the wrong class hypervector in training to improve the HDC classification accuracy [18]. We set D = 8, 000 for the HDC models in our experiments following the setup of [11]. In addition, we put the multi-layer perceptrons (MLP) here as an upper bound, although it is not feasible to be deployed on extremely resource-constrained tiny devices. In the MLP, we use Algorithm 1 for training and Algorithm 2 for fast adaption. Implementation Details. In the meta training stage, for the Ro- tated MNIST, we train the model for 60 epochs with a batch size of 10. In the Split ISOLET, we use 30 epochs w.r.t. its smaller dataset size. In the Rotated MNIST experiments, we used K = {1, 5} for gradient updates in the meta learning involved methods, while set- ting K = 1 in the Split ISOLET. We train all models with the Adam optimizer [22] except the HDC classifier, which is not feasible to fit in any standard training optimizer. In the fast adaption stage, we set M = 10 for the Rotated MNIST and M = 5 in Split ISOLET, to update φ. To ensure fair comparison, the same data points are used across different methods. Note that we don't fine-tune the HDC classifier as there seems no feasible way to update the learned hypervectors which are essentially composed of zeros and ones for the new incoming data examples. 5.2 Testing Accuracy We show our evaluation results on the Rotated MNIST in Figure 2. From Figure 2, we can see that MetaLDC outperforms other base- lines across all evaluation tasks. We observe that MetaLDC has achieved higher accuracy compared to the MetaLDC-full, which updates the entire model parameters to adapt to a new task in the fine-tuning stage. We attribute this to over-fitting, as the entire model focuses on learning a very small amount of data from the task. In comparison, MetaLDC, which only updates the last layer while keeping the former layers untouched, has alleviated this over-fitting issue to certain extent. We can also observe that as the rotation degree of the evaluation data becomes larger, the testing accuracy of the MetaLDC also increases due to higher similarity between the training and the evaluation tasks. For the Split ISOLET, the evaluation results are reported in the Figure 2. Based on Figure 2, the accuracy achieved by MetaLDC is MetaLDC: Meta Learning of Low-Dimensional Computing Classifiers for Fast On-Device Adaption tinyML Research Symposium'23, March 2023, San Francisco, CA Methods HDC w/ retraining Pretrained LDC MetaLDC-full MetaLDC Upper Bound - - T4 : 6◦ T2 : 2◦ K-shot T1 : 0◦ Evaluation Tasks T5 : 8◦ T3 : 4◦ 76.74±0.74 77.75±0.65 77.01±0.57 77.87±0.44 79.13±0.53 78.25±2.37 78.26±3.03 78.67±2.97 79.25±2.50 80.89±1.76 K = 1 80.03±0.84 81.01±0.57 82.37±0.81 84.04±0.47 85.34±0.23 K = 5 80.35±0.66 81.78±0.53 83.25±0.57 84.97±0.18 86.31±0.05 K = 1 82.78±0.97 82.99±1.07 84.84±1.22 86.33±0.55 87.97±0.42 K = 5 82.83±0.71 83.11±0.58 85.74±0.83 86.54±0.23 88.01±0.36 K = 1 87.00±0.54 87.69±0.42 88.77±0.33 90.19±0.33 92.94±0.19 K = 5 87.53±0.43 87.74±0.39 89.01±0.27 90.87±0.29 93.11±0.11 Figure 2: Left: Accuracy of MetaLDC compared to other methods on the Rotated MNIST. Right: Accuracy of MetaLDC compared to other approaches on the Split-ISOLET. Red marks the results of the highest accuracy, and blue marks the results of the second highest. 5.4 Inference Cost on Hardware Here, we evaluate the inference efficiency of MetaLDC and HDC w/ retraining following the same hardware pipeline setup as in the [11]. The hardware platform we use is the Zynq UltraScale+, where we transform the bipolar values {1, -1} to {0, 1} in the implementation. In the experiment, we limit the resource usage (e.g., lookup table (LUT) < 10k) to approach the common practice in tiny devices. We report the numerical results in the Table 1. From the Ta- ble 1, we can see that the LDC models are at least 100x faster than HDC w/ retraining classifiers. The model size based on LDC is 150x smaller than the HDC ones. The energy consumption of the MAML LDC (tiny) are less than 100nJ in the evaluation datasets, which has demonstrated great improvement on hardware acceleration compared to the HDC-based models. Note we don't measure the MLP-based model cost here, as its inference requires matrix mul- tiplication via floating-point operators rather than simple binary arithmetic, making it too resource-intensive to run on a tiny device. On top of that, the MLP architecture cannot be trivially supported by the FPGA platform due to the floating point computation [13], and inter-platform comparison of algorithm performance is con- sidered neither instructive or fair. Even though there is MLP with the fix-point format which could be implemented on FPGA, the required utilization of DSP and other resources are still tremen- dous to carry out the involved matrix multiplication, far above the resource budget of a tiny device. Table 1: Inference cost comparison between MetaLDC and the HDC w/ retraining on the Zynq UltraScale+. DataSet Model Size (KB) Latency (us) Energy (nJ) R-MNIST S-ISOLET MetaLDC HDC MetaLDC HDC 6.48 1050 5.10 877 3.99 499 3.13 388 64 36926 38 29488 Figure 3: Bit error robustness of different models on the MNIST testing dataset. the highest on different tasks. The second highest is the MetaLDC- full, which is not as computationally efficient as the MetaLDC for tiny devices. 5.3 Robustness against Hardware Bit Errors One of the most appreciated merits of the HDC-based models is the robustness against random bit errors on the hardware. The plain LDC model has been shown that it can achieve comparable robustness by the uniformly distributed information in the compact vector representation, given the largely reduced dimensionality [11]. Our empirical results in Figure 3 have shown that MetaLDC exhibits even stronger robustness than the pretrained-then-finetuned LDC model. This can be attributed to a more general representation learned via our meta training algorithm. The broad prior knowledge stored in the reusable template helps in adapting to tasks with noise perturbations and fighting against the random bit errors. Compared to the other methods, MetaLDC has also shown slower decline of accuracy. AccuracyTask 1Task 2Task 384.1788.81Pretrained LDCHDC w/ retrainingMetaLDCMetaLDC-full 79.1781.7782.8183.3184.1187.71Task 482.2878.7479.0181.0690.5189.3487.6385.48Accuracy tinyML Research Symposium'23, March 2023, San Francisco, CA Liu, et al. (a) (b) (c) (d) Figure 4: Hyper-paramters ablation study on different datasets w.r.t. K, the number of examples sampled from each class in the meta-training; and M, the number of examples sampled from each class of a new task in the fast adaption. 5.5 Hyper-parameter Ablation Studies To showcase the performance of MetaLDC with different choice of hyperparameters, we conduct the ablation study for K, the number of data examples to train the model; and M, the number of samples we used from each class of a new task to update φ in the fast adaption stage. Depending on different dataset size, for the Rotated MNIST, we set the K = {1, 5, 10, 20, 40}, while K = {1, 2, 3, 4, 5} for the Split-ISOLET dataset. The M is set as {10, 50, 100, 150} in the Rotated MNIST, and {1, 5, 10, 15} in the Split ISOLET, respectively. The evaluation dataset we used in the Rotation MNIST is the the original MNIST, while the images in the training data have rotation degree in [10, 20). In the Split-ISOLET, we use the Task 1 as the evaluation task. The results are provided in Figure 4. We observe that as the values of K and M increase, the accuracy of both MetaLDC and MetaLDC-full has improved. We also notice that the accuracy gap between MetaLDC-full and MetaLDC become smaller as K or M increase, especially on the Split ISOLET dataset. We attribute the performance increases of MetaLDC-full to larger percentage of data points sampled from the task to update the model, which gradually diminishes the over-fitting effect. 5.6 Effectiveness of the Learned Representation To study the efficacy of learned representation by our meta-training process, we have designed another method, referred to as the MetaLDC-NonFineTuning (MetaLDC-NFT). In this method, we use the Algorithm 1 to train the LDC model. We then test its accuracy on the new task without any fine-tuning. As shown in the Figure 5, we can see that the accuracy gap between MetaLDC-NFT and Met- aLDC is within 5% on the Split ISOLET and 10% on the Rotated MNIST, which has reflected our Algorithm 1 has produced a good initialization to some extent. 6 RELATED WORKS Meta learning. By distilling the learning experience from a broad set of related tasks, MAML [12] has achieved great success in the fast adaption regime [8, 14, 32, 36, 40]. The [24, 39] have proposed distributed collaborative frameworks to leverage knowledge be- tween edge nodes via MAML. To reduce the computational cost, Figure 5: Accuracy comparison between MetaLDC and MetaLDC-NFT on S-ISOLET and R-MNIST with K = 1. the [38] has presented a divide-and-conquer approach where the linear approximation is utilized to estimate the Hessian, while [30] has discussed using MAML with synthetic gradients in a feed for- ward manner for deep neural networks. However, most approaches are still quite costly, not viable for tiny devices with severe resource constraints. Hyper-dimensional computing. HDC has been known as an efficient alternative to expensive deep neural networks for tiny devices [3, 4, 9, 10, 15, 17, 29, 37]. The study [9] has proposed to use vector quantization to further reduce the model size. Besides, some works have optimized HDC's encoding and training to improve its accuracy on a single data distribution [19]. Nonetheless, the required HDC model size to obtain an acceptable accuracy is still prohibitive large for tiny devices. More recently, LDC has been studied to significantly improve the efficiency of HDC [11], where the encoded vectors are only tens, yet the accuracy is even higher. Nevertheless, fast adaption problems to unseen but related tasks have not been well addressed in either HDC or LDC. On-device learning. The fast adaption issue has become even more pressing for edge tiny devices due to their low latency tol- erance and limited computational power [2, 26, 28, 33, 34]. For example, FSCL [21] and subsequent C-FSCIL [16] also utilize the frozen meta-learned network structure for adaption. However, they focus on addressing the catastrophic forgetting issue by storing the hyperdimensional prototypes of past classes in the online class incremental setting, rather than efficient edge device computing or adaption. Meanwhile, their replay buffer composed of hyper- dimensional vectors is costly if deployed to tiny devices. In [23], the 12345K8485868788AccuracyS-ISOLETMetaLDCMetaLDC-full010203040K808182838485AccuracyR-MNISTMetaLDCMetaLDC-full51015M84858687AccuracyS-ISOLETMetaLDCMetaLDC-full50100150M8081828384AccuracyR-MNISTMetaLDCMetaLDC-fullMetaLDCMetaLDC-NFT MetaLDC: Meta Learning of Low-Dimensional Computing Classifiers for Fast On-Device Adaption tinyML Research Symposium'23, March 2023, San Francisco, CA MCUNet is proposed to find the optimal neural architecture by neu- ral architecture search with resource constraints of heterogeneous tiny devices, whereas our MetaLDC does not require additional search efforts but provides a reusable lightweight template for un- seen tasks. 7 CONCLUSION In this paper, we propose MetaLDC, a LDC-based approach to fast adapt to unseen tasks via interleaved meta training for resource- constrained tiny devices. In MetaLDC, the LDC architecture is first trained across a set of different tasks, where we separately train the task-specific parameters φ in the inner loop of the meta-training algorithm. The learned model can then fast adapt to a new task by only updating the last layer using a handful of data points, while preserving learned prior knowledge in the former layers. Our empirical results have shown that our method has achieved higher accuracy compared to the HDC methods and pretrained LDC classifiers. Limitations & Future Work Our work has made the first step towards leveraging a novel low-dimensional classifier in on-device transfer learning for tiny gadgets and appliances. Further investi- gation on the feasibility of using other low complexity non-LDC NNs on tiny devices, as well as a more comprehensive comparison between them and the MetaLDC are desired in future works. Be- sides, extending MetaLDC to the unsupervised learning setting is a natural future direction to explore. REFERENCES [1] Neena Aloysius and M. Geetha. A review on deep convolutional neural networks. In 2017 International Conference on Communication and Signal Processing (ICCSP), pages 0588–0592, 2017. [2] Colby Banbury, Chuteng Zhou, Igor Fedorov, Ramon Matas Navarro, Urmish Thakker, Dibakar Gope, Vijay Janapa Reddi, Matthew Mattina, and Paul N. What- mough. Micronets: Neural network architectures for deploying tinyml applica- tions on commodity microcontrollers, 2020. [3] Toygun Basaklar, Yigit Tuncel, Shruti Yadav Narayana, Suat Gumussoy, and Umit Y Ogras. Hypervector design for efficient hyperdimensional computing on edge devices. arXiv preprint arXiv:2103.06709, 2021. [4] Simone Benatti, Fabio Montagna, Victor Kartsch, Abbas Rahimi, Davide Rossi, and Luca Benini. Online learning and classification of emg-based gestures on a parallel ultra-low power platform using hyperdimensional computing. IEEE Transactions on Biomedical Circuits and Systems, 13(3):516–528, 2019. [5] Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th International Conference on Machine Learning, ICML '08, page 160–167, New York, NY, USA, 2008. Association for Computing Machinery. [6] Sohum Datta, Ryan Albert Antonio, Aldrin Rolf Ison, and Jan M. Rabaey. A programmable hyper-dimensional processor architecture for human-centric iot. IEEE Journal on Emerging and Selected Topics in Circuits and Systems, 9:439–452, 2019. [7] Li Deng. The mnist database of handwritten digit images for machine learning research. IEEE Signal Processing Magazine, 29(6):141–142, 2012. [8] Shumin Deng, Ningyu Zhang, Zhanlin Sun, Jiaoyan Chen, and Huajun Chen. When low resource nlp meets unsupervised language model: Meta-pretraining then meta-learning for few-shot text classification (student abstract). Proceedings of the AAAI Conference on Artificial Intelligence, 34(10):13773–13774, Apr. 2020. [9] Cameron Diao, Denis Kleyko, Jan M. Rabaey, and Bruno A. Olshausen. Gen- eralized learning vector quantization for classification in randomized neural networks and hyperdimensional computing. In 2021 International Joint Confer- ence on Neural Networks (IJCNN). IEEE, jul 2021. [10] Shijin Duan, Yejia Liu, Shaolei Ren, and Xiaolin Xu. Lehdc: Learning-based hyperdimensional computing classifier. arXiv preprint arXiv:2203.09680, 2022. [13] Nikhil B. Gaikwad, Varun Tiwari, Avinash Keskar, and N. C. Shivaprakash. Effi- cient fpga implementation of multilayer perceptron for real-time human activity classification. IEEE Access, 7:26696–26706, 2019. [14] Ning Gao, Hanna Ziesche, Ngo Anh Vien, Michael Volpp, and Gerhard Neumann. What matters for meta-learning vision regression tasks? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 14776–14786, June 2022. [15] Lulu Ge and Keshab K. Parhi. Classification using hyperdimensional computing: A review, 2020. [16] Michael Hersche, Geethan Karunaratne, Giovanni Cherubini, Luca Benini, Abu Sebastian, and Abbas Rahimi. Constrained few-shot class-incremental learning, 2022. [17] Chi-Tse Huang, Cheng-Yang Chang, Yu-Chuan Chuang, and An-Yeu (Andy) Wu. Pq-hdc: Projection-based quantization scheme for flexible and efficient hyperdimensional computing. In Ilias Maglogiannis, John Macintyre, and Lazaros Iliadis, editors, Artificial Intelligence Applications and Innovations, pages 425–435, Cham, 2021. Springer International Publishing. [18] Mohsen Imani, Samuel Bosch, Sohum Datta, Sharadhi Ramakrishna, Sahand Salamat, Jan M. Rabaey, and Tajana Simunic Rosing. Quanthd: A quantization framework for hyperdimensional computing. IEEE Transactions on Computer- Aided Design of Integrated Circuits and Systems, 39:2268–2278, 2020. [19] Mohsen Imani, Justin Morris, Samuel Bosch, Helen Shu, Giovanni De Micheli, and Tajana Rosing. Adapthd: Adaptive efficient training for brain-inspired hyperdimensional computing. In 2019 IEEE Biomedical Circuits and Systems Conference (BioCAS), pages 1–4, 2019. [20] Mohsen Imani, Xunzhao Yin, John Messerly, Saransh Gupta, Michael Niemier, Xiaobo Sharon Hu, and Tajana Rosing. Searchd: A memory-centric hyperdimen- sional computing with stochastic training. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 39(10):2422–2433, 2020. [21] Geethan Karunaratne, Michael Hersche, Jovin Langenegger, Giovanni Cheru- bini, Manuel Le Gallo-Bourdeau, Urs Egger, Kevin Brew, Sam Choi, INJO OK, Mary Claire Silvestre, Ning Li, Nicole Saulnier, Victor Chan, Ishtiaq Ahsan, Vijay Narayanan, Luca Benini, Abu Sebastian, and Abbas Rahimi. In-memory realiza- tion of in-situ few-shot continual learning with a dynamically evolving explicit memory, 2022. [22] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2014. [23] Ji Lin, Wei-Ming Chen, Yujun Lin, john cohn, Chuang Gan, and Song Han. Mcunet: Tiny deep learning on iot devices. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 11711–11722. Curran Associates, Inc., 2020. [24] Sen Lin, Guang Yang, and Junshan Zhang. A collaborative learning framework via federated meta-learning. In 2020 IEEE 40th International Conference on Distributed Computing Systems (ICDCS), pages 289–299. IEEE, 2020. [25] Weibo Liu, Zidong Wang, Xiaohui Liu, Nianyin Zeng, Yurong Liu, and Fuad E. Alsaadi. A survey of deep neural network architectures and their applications. Neurocomputing, 234:11–26, 2017. [26] Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Oct 2017. [27] MG Sarwar Murshed, Christopher Murphy, Daqing Hou, Nazar Khan, Ganesh Ananthanarayanan, and Faraz Hussain. Machine learning at the network edge: A survey. ACM Computing Surveys (CSUR), 54(8):1–37, 2021. [28] Davide Nadalini, Manuele Rusci, Giuseppe Tagliavini, Leonardo Ravaglia, Luca Benini, and Francesco Conti. Pulp-trainlib: Enabling on-device training for risc-v multi-core mcus through performance-driven autotuning. In Alex Orailoglu, Marc Reichenbach, and Matthias Jung, editors, Embedded Computer Systems: Architectures, Modeling, and Simulation, pages 200–216, Cham, 2022. Springer International Publishing. [29] Fateme Rasti Najafabadi, Abbas Rahimi, Pentti Kanerva, and Jan M. Rabaey. Hyperdimensional computing for text classification, 2016. [30] Robby Neven, Marian Verhelst, Tinne Tuytelaars, and Toon Goedemé. Feed- forward on-edge fine-tuning using static synthetic gradient modules. In Adrien Bartoli and Andrea Fusiello, editors, Computer Vision – ECCV 2020 Workshops, pages 131–146, Cham, 2020. Springer International Publishing. [31] D.J. Newman, S. Hettich, C.L. Blake, and C.J. Merz. Uci repository of machine learning databases, 1998. [32] Binh D. Nguyen, Thanh-Toan Do, Binh X. Nguyen, Tuong Do, Erman Tjiputra, and Quang D. Tran. Overcoming data limitation in medical visual question answering. In Dinggang Shen, Tianming Liu, Terry M. Peters, Lawrence H. Staib, Caroline Essert, Sean Zhou, Pew-Thian Yap, and Ali Khan, editors, Medical Image Computing and Computer Assisted Intervention – MICCAI 2019, pages 522–530, Cham, 2019. Springer International Publishing. [11] Shijin Duan, Xiaolin Xu, and Shaolei Ren. A brain-inspired low-dimensional [33] Haoyu Ren, Darko Anicic, and Thomas Runkler. Tinyol: Tinyml with online- computing classifier for inference on tiny devices. In tinyML, 2022. learning on microcontrollers, 2021. [12] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning (ICML), 2017. [34] Ramon Sanchez-Iborra and Antonio F. Skarmeta. Tinyml-enabled frugal smart IEEE Circuits and Systems Magazine, objects: Challenges and opportunities. 20(3):4–18, 2020. tinyML Research Symposium'23, March 2023, San Francisco, CA Liu, et al. [35] Mingxing Tan and Quoc Le. EfficientNet: Rethinking model scaling for convo- lutional neural networks. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 6105–6114. PMLR, 09–15 Jun 2019. [36] Ting Wang, Zongkai Wu, and Donglin Wang. Visual perception generalization IEEE Transactions on for vision-and-language navigation via meta-learning. Neural Networks and Learning Systems, pages 1–7, 2021. [37] Tao Yu, Yichi Zhang, Zhiru Zhang, and Christopher De Sa. Understanding hyperdimensional computing for parallel single-pass learning, 2022. [38] Sheng Yue, Ju Ren, Jiang Xin, Sen Lin, and Junshan Zhang. Inexact-admm based federated meta-learning for fast and continual edge learning. In Proceedings of the Twenty-Second International Symposium on Theory, Algorithmic Foundations, and Protocol Design for Mobile Networks and Mobile Computing, MobiHoc '21, page 91–100, New York, NY, USA, 2021. Association for Computing Machinery. [39] Liang Zhang, Chuanting Zhang, and Basem Shihada. Efficient wireless traffic prediction at the edge: A federated meta-learning approach. IEEE Communications Letters, 26(7):1573–1577, 2022. [40] Cong Zhao, Xinyue Sun, Shusen Yang, Xuebin Ren, Peng Zhao, and Julie McCann. Exploration across small silos: Federated few-shot learning on network edge. IEEE Network, 36(1):159–165, 2022.
http://arxiv.org/abs/2302.12343v2
2023-10-19T18:16:57
2023-02-23T21:23:06
CHiLL: Zero-shot Custom Interpretable Feature Extraction from Clinical Notes with Large Language Models
We propose CHiLL (Crafting High-Level Latents), an approach for natural-language specification of features for linear models. CHiLL prompts LLMs with expert-crafted queries to generate interpretable features from health records. The resulting noisy labels are then used to train a simple linear classifier. Generating features based on queries to an LLM can empower physicians to use their domain expertise to craft features that are clinically meaningful for a downstream task of interest, without having to manually extract these from raw EHR. We are motivated by a real-world risk prediction task, but as a reproducible proxy, we use MIMIC-III and MIMIC-CXR data and standard predictive tasks (e.g., 30-day readmission) to evaluate this approach. We find that linear models using automatically extracted features are comparably performant to models using reference features, and provide greater interpretability than linear models using "Bag-of-Words" features. We verify that learned feature weights align well with clinical expectations.
[ "Denis Jered McInerney", "Geoffrey Young", "Jan-Willem van de Meent", "Byron C. Wallace" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12343v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12343v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG" ]
CHiLL: Zero-shot Custom Interpretable Feature Extraction from Clinical Notes with Large Language Models Denis Jered McInerney Northeastern University [email protected] Geoffrey Young Brigham and Women's Hospital [email protected] Jan-Willem van de Meent University of Amsterdam [email protected] Byron C. Wallace Northeastern University [email protected] 3 2 0 2 t c O 9 1 ] L C . s c [ 2 v 3 4 3 2 1 . 2 0 3 2 : v i X r a Abstract We propose CHiLL (Crafting High-Level La- tents), an approach for natural-language speci- fication of features for linear models. CHiLL prompts LLMs with expert-crafted queries to generate interpretable features from health records. The resulting noisy labels are then used to train a simple linear classifier. Gener- ating features based on queries to an LLM can empower physicians to use their domain exper- tise to craft features that are clinically meaning- ful for a downstream task of interest, without having to manually extract these from raw EHR. We are motivated by a real-world risk predic- tion task, but as a reproducible proxy, we use MIMIC-III and MIMIC-CXR data and standard predictive tasks (e.g., 30-day readmission) to evaluate this approach. We find that linear mod- els using automatically extracted features are comparably performant to models using refer- ence features, and provide greater interpretabil- ity than linear models using "Bag-of-Words" features. We verify that learned feature weights align well with clinical expectations. 1 Introduction LLMs have greatly advanced few- and zero-shot ca- pabilities in NLP, reducing the need for annotation. This is especially exciting for the medical domain, in which supervision is often scant and expensive. However, given the high-stakes nature of clinical work and the challenges associated with developing models (e.g., long-tail data distributions, weakly informative supervision), predictions can rarely be trusted blindly. Clinicians therefore tend to favor simple models with interpretable predictors over opaque LLMs that rely on dense learned represen- tations. Risk prediction tools are often linear mod- els with handcrafted features. Such models have the advantage of associating features with weights; these can be inspected to ensure clinical tenability and may avoid undesired fragilities of large neural models. However, a downside to relying on inter- Figure 1: We propose to allow domain experts to specify high-level features for simple linear predictive models in natural language, and then extract these zero-shot (without supervision) using large language models. pretable features is that one often has to manually extract them from patient records. This can be particularly difficult when features are high-level and must be inferred from unstructured (free-text) fields within EHR. In this work we investigate the potential of zero- shot extraction for definition and abstraction of interpretable features from unstructured EHR to use as inputs for simple (linear) models (Figure 1). Recent work (Agrawal et al., 2022) has shown that LLMs are capable zero-shot extractors of clin- ical information, i.e., they can extract structured information from records without explicitly being trained to do so. These can be high-level features specified in natural language, which allows prac- titioners to define features that they hypothesize may be relevant to a downstream task. Such fea- tures, even if noisy, are likely to be more inter- pretable than low-level features such as Bag-of- Words (BoW) representations. The motivation of this work is to evaluate the viability of training small linear models over high-level features auto- matically extracted via LLMs-without explicit supervision-from unstructured data in EHR. A secondary concern that this paper seeks to ad- dress is any reliance on closed-source LLMs for healthcare, which is undesirable for a number of Patient has symptoms of ... and history indicates type II diabetes ......BP 133/81 | Wt 190 lbs...Referal(s): ...Read the following text from a clinical note: <notes>Does this patient have a chronic illness?Raw patient notesPrompt LLM (Flan-T5)[0 0 ... 1 ... 0 1]chronic illness indicator xxYesLinear model over high-level featuresp(y=1|x)=(✓*)<latexit sha1_base64="pL8OLL62kcKoVP/6HwrYJbyYgrQ=">AAACF3icbVDLSgNBEJz1bXxFPXoZDEK8LLtR0UtA9OIxgkmEbAizk04yZGZ3mekVw5q/8OKvePGgiFe9+TdOHgdfBQ1FVTfdXWEihUHP+3RmZufmFxaXlnMrq2vrG/nNrZqJU82hymMZ6+uQGZAigioKlHCdaGAqlFAP++cjv34D2og4usJBAk3FupHoCM7QSq28mxQHZf/udp+WaWBEV7FigD1ARgPejpEGPZMwDpnnHoEa7rfyBc/1xqB/iT8lBTJFpZX/CNoxTxVEyCUzpuF7CTYzplFwCcNckBqwC/qsCw1LI6bANLPxX0O6Z5U27cTaVoR0rH6fyJgyZqBC26kY9sxvbyT+5zVS7Jw0MxElKULEJ4s6qaQY01FItC00cJQDSxjXwt5KeY9pxtFGmbMh+L9f/ktqJdc/cEuXh4XTs2kcS2SH7JIi8ckxOSUXpEKqhJN78kieyYvz4Dw5r87bpHXGmc5skx9w3r8AZtCeNw==</latexit>x<latexit sha1_base64="QXWNndi5NRieIutz8eBLFzeTjJc=">AAAB6XicbVBNS8NAEJ34WetX1aOXxSJ4KkkV9Fj04rGK/YA2lM120y7dbMLuRCyl/8CLB0W8+o+8+W/ctDlo64OBx3szzMwLEikMuu63s7K6tr6xWdgqbu/s7u2XDg6bJk414w0Wy1i3A2q4FIo3UKDk7URzGgWSt4LRTea3Hrk2IlYPOE64H9GBEqFgFK10/1TslcpuxZ2BLBMvJ2XIUe+Vvrr9mKURV8gkNabjuQn6E6pRMMmnxW5qeELZiA54x1JFI278yezSKTm1Sp+EsbalkMzU3xMTGhkzjgLbGVEcmkUvE//zOimGV/5EqCRFrth8UZhKgjHJ3iZ9oTlDObaEMi3srYQNqaYMbThZCN7iy8ukWa1455Xq3UW5dp3HUYBjOIEz8OASanALdWgAgxCe4RXenJHz4rw7H/PWFSefOYI/cD5/ABwajRQ=</latexit>x<latexit sha1_base64="QXWNndi5NRieIutz8eBLFzeTjJc=">AAAB6XicbVBNS8NAEJ34WetX1aOXxSJ4KkkV9Fj04rGK/YA2lM120y7dbMLuRCyl/8CLB0W8+o+8+W/ctDlo64OBx3szzMwLEikMuu63s7K6tr6xWdgqbu/s7u2XDg6bJk414w0Wy1i3A2q4FIo3UKDk7URzGgWSt4LRTea3Hrk2IlYPOE64H9GBEqFgFK10/1TslcpuxZ2BLBMvJ2XIUe+Vvrr9mKURV8gkNabjuQn6E6pRMMmnxW5qeELZiA54x1JFI278yezSKTm1Sp+EsbalkMzU3xMTGhkzjgLbGVEcmkUvE//zOimGV/5EqCRFrth8UZhKgjHJ3iZ9oTlDObaEMi3srYQNqaYMbThZCN7iy8ukWa1455Xq3UW5dp3HUYBjOIEz8OASanALdWgAgxCe4RXenJHz4rw7H/PWFSefOYI/cD5/ABwajRQ=</latexit>x<latexit sha1_base64="QXWNndi5NRieIutz8eBLFzeTjJc=">AAAB6XicbVBNS8NAEJ34WetX1aOXxSJ4KkkV9Fj04rGK/YA2lM120y7dbMLuRCyl/8CLB0W8+o+8+W/ctDlo64OBx3szzMwLEikMuu63s7K6tr6xWdgqbu/s7u2XDg6bJk414w0Wy1i3A2q4FIo3UKDk7URzGgWSt4LRTea3Hrk2IlYPOE64H9GBEqFgFK10/1TslcpuxZ2BLBMvJ2XIUe+Vvrr9mKURV8gkNabjuQn6E6pRMMmnxW5qeELZiA54x1JFI278yezSKTm1Sp+EsbalkMzU3xMTGhkzjgLbGVEcmkUvE//zOimGV/5EqCRFrth8UZhKgjHJ3iZ9oTlDObaEMi3srYQNqaYMbThZCN7iy8ukWa1455Xq3UW5dp3HUYBjOIEz8OASanALdWgAgxCe4RXenJHz4rw7H/PWFSefOYI/cD5/ABwajRQ=</latexit> reasons. First, such models are inherently opaque, precluding interpretability analysis which is espe- cially important in healthcare. Second, EHR data is sensitive, and so submitting this to an API (e.g., as provided by OpenAI) is potentially problematic. In this work we show that despite the specialized do- main, Flan-T5 (Chung et al., 2022; Wei et al., 2022) variants-which can fit on a single GPU and be run locally-can perform zero-shot feature extraction from EHR with reasonable accuracy. Our contributions are as follows. (1) We propose and evaluate a method for extracting high-level in- terpretable features from clinical texts using Flan- T5 given corresponding prompts, and we evaluate the how well these extracted features align with ground truth. (2) We demonstrate that we can ex- ploit LLM calibration to improve performance, al- lowing models that use inferred features to perform comparably to those using reference features. (3) We show that the resulting linear models' weights align with clinician-annotated notions of how fea- tures should impact a prediction. (4) We investigate the data- and feature- efficiency of our approach and find that it can achieve similar results with much less data and utilizes features efficiently. Our promising initial results suggest several av- enues for further exploration, e.g., modeling cor- relations between inferred features, probing the degree to which such predictors provide useful and reliable interpretability, and modifying trained lin- ear models directly based on expert judgement. 2 Methods We consider binary classification of patients on the basis of free text from their EHR data. A now stan- dard approach to such tasks would entail adopting a neural language encoder E to induce a fixed- length d-dimensional distributed representation of an input x-e.g., the [CLS] embedding in BERT (Devlin et al., 2018; Alsentzer et al., 2019) models- and feeding this forward to a linear classification head to yield a logit: p(y = 1 | x) = σ(wT E[CLS](x)) (1) ∈ ∈ , x ∈ { 0, 1 } RL×V , and w Rd. (For where y BERT, d = 768.) A drawback of this approach is that it is not amenable to inspection. The prediction is made on the basis of a dense learned representa- tion from a pre-trained network, and it is unclear which patient attributes give rise to the prediction. A simpler and (at least arguably) more interpretable approach is to use a linear model defined over Bag- of-Words (BoW) representations: x) = σ(wT xBoW). pBoW(y = 1 | (2) This approach operates over (transformations of) token counts, and therefore the learned w has a natural correspondence to words in the vocabulary. Linear models that operate over tens of thousands of word predictors occupy an intermediate space between the interpretability afforded by simpler, smaller models defined over high-level features and neural models which use opaque representations. For some clinical tasks, however, BoW with large vocabularies can be competitive with respect to downstream performance. In this paper, we use instruction-tuned LLMs to perform zero-shot inference of intermediate, high- RN using N expert-specified level, features f prompt templates t1, ..., tN : ∈ f binary n = I[argmaxz(LLM(z tn(x))) = vyes] | (3) where tn(x) denotes the prompt obtained by popu- lating the template tn with x, z represents the next token after the prompt and vyes represents the index of the token "yes" in the vocabulary. We then use a RN ) over simple linear model (with weights w these predicted features to predict the target: ∈ p(y = 1) = σ(wT f binary). (4) Predictions from the LLM for the high-level bi- nary features will be imperfect, and are naturally associated with a confidence under the LLM: The probability of the token "yes" normalized by the mass assigned to either "yes" or "no". As a sim- ple means of incorporating uncertainty in extracted features, we can use this continuous value in place of binary feature indicators. For feature n (elicited using template tn), the feature value f cont is: n LLM(z = vyes | LLM(z = vyes tn(x)) | tn(x)) + LLM(z = vno . tn(x)) | (5) Inspired by previous work (Zhang et al., 2020), we split text into chunks of a particular maximum length and take the maximum (per-feature) of the feature values of the chunks as the final features. 3 Evaluation To evaluate the proposed approach, we consider four tasks on publicly available MIMIC data to permit reproducibility. We start with standard clinical predictive tasks in MIMIC-III (Johnson et al. 2016b,a; Goldberger et al. 2000, Section 3.1): Readmission, mortality, and phenotype prediction. For these we treat ICD codes as proxies for high- level features.1 This allows us to evaluate the accu- racy of the zero-shot extraction component, and to compare the performance of a linear model defined over the true ICD codes as compared to the same model when operating over inferred features. We then consider X-ray report classification using the MIMIC-CXR dataset (Johnson et al. 2019b,a,c; Johnson et al.; Goldberger et al. 2000; Section 3.2). In this setting, we elicited queries for intermediate feature descriptions from a radiolo- gist co-author. Queries take the form of questions that a radiologist might a priori believe to be rele- vant to the report classification categories defined in CheXpert (e.g., "Does this patient have a normal cardiac silhouette?"; see Appendix Table B for all examples). This demonstrates the flexibility of the approach-and the promise of allowing domain experts to specify features in natural language- but we are limited in our ability to evaluate the extraction performance directly in this case. 3.1 Clinical predictive tasks on MIMIC-III For the three standard clinical prediction tasks we consider, we use ICD codes as proxies for high- level, interpretable features that one might want to infer. While this task is somewhat artificial, it allows us to evaluate how well the inferred features agree with the "true" features (i.e., ICD-code in- dicators). We use the top 10 most common ICD codes in the training set as features.2 We ask the LLM: "Does this mean the patient has <code>?", where we replace <code> with the long descrip- tion of the ICD code. To illustrate the flexibility of the approach, we also consider two custom fea- tures which one might expect to be informative: (1) Does the patient have a chronic illness? (2) Is the condition life-threatening? Readmission prediction For 30-day readmission, we follow the task definition, setup, and data pre- processing outlined in (Huang et al., 2019). 1In practice one could of course use ICD codes directly as predictors; but this serves as an exemplary task using publicly available data to show the potential of the proposed approach in a way that also allows us to evaluate models that have access to "ground-truth" high-level features, i.e., the ICD codes. 2In preliminary experiments we found that including >10 ICD codes as predictors in linear models did not appreciably improve AUROC for the three tasks considered. In-hospital Mortality prediction This task in- volves predicting if a patient will pass during a hospital stay with notes from the first 48 hours. We adapt preprocessing code from (Zhang et al., 2020). Phenotype prediction Zhang et al. (2020) also de- rive various phenotypes using ICD codes, and use these to define a phenotype prediction task which we also consider. (We again adapt their preprocess- ing code for this task.) 3.2 Chest X-ray report classification We next consider chest X-ray report classifica- tion.3 This allows us to draw upon the exper- tise of the radiologist co-author. We use the MIMIC-CXR dataset (Johnson et al., 2019b,a,c; Johnson et al.; Goldberger et al., 2000) with CheX- pert labels (Irvin et al., 2019)-again to ensure reproducibility-and evaluate performance on a 12-label classification task. Given that these labels can be automatically de- rived, the predictive task considered here is not in and of itself practically useful, but it is illustrative of how domain experts (here, a radiologist) can craft bespoke features for a given task. We use outputs of the CheXpert automated report labeler as "labels". We omit two downstream labels from our results-Consolidation and Pleural Effusion- because we included these as intermediate features instead under the advisement of our radiologist co- author, and it does not make sense to include labels for which there exists an exactly corresponding fea- ture.4 (The names of the 12 labels we predict are shown in Table 2.) To infer intermediate features, we asked the ra- diologist co-author to provide natural binary ques- tions they would ask to categorize radiology reports into the given classes (Appendix B). We refer to these questions as queries, and use them as prompts for the LLM to extract corresponding indicators (or probabilities) for each answer. Because these are novel predictors specified by a domain expert, we do not have "reference" features to compare to (as we did above where we treated ICD codes as high- level features). However, in Section 4.3 a domain expert assesses the degree to which learned coeffi- cients for features align with clinical judgement. 3We discard the images in this setting and only use text. 4We did use these extra two labels in training, but this only affects BERT, which was trained in a 'multi-task' way with a shared encoder used (and updated) across all labels. We think it unlikely that this would impact performance much. Figure 2: Feature extraction performance for the readmission prediction task. AUROC for continuous ICD code features (left) and F1 for binary ICD code features (right), compared to reference ICD codes. 3.3 Experimental details To extract features, we use FLAN-T5-XXL (Roberts et al., 2022) with fp16 enabled (for speed) on a Quadro RTX 8000 with 46G of memory. We use a maximum chunk size of 512 (as de- scribed in section 2) and use a maximum of 4 chunks. To fit logistic regression models, we use the sklearn (Pedregosa et al., 2011) package's SGDClassifier with the logistic loss and the the default settings (this includes adding an intercept and an l2 penalty). We show the full prompt tem- plate used for getting the features in appendix A. 4 Results We aim to address the following research questions. Feature extraction (4.1) How accurate are zero- shot extracted features, as compared to reference (manually extracted) predictors? Downstream classification performance (4.2) How does classification based on exper our ap- proach compare to black box and simple models on the ultimate downstream classification? Interpretability (4.3) Do the inferred features per- mit intuitive interpretation, and do the resultant coefficients align with clinical expectations? Data and feature efficiency (4.4) Do these fea- tures offer additional benefits in terms of data and/or feature efficiency? 4.1 Feature extraction We first measure the accuracy of automatically in- ferred high-level features. In the case of ICD-code proxy features, we evaluate this directly using the actual ICD codes as reference labels with which to calculate precision, recall, and F1 for binary features, and AUROC for our continuous features (although we cannot do this for the two custom features considered). We present these metrics for Figure 3: Feature inference performance on labeled Chest X-ray data. Histograms are over features. For continuous feature AUROCs, we omit features that do not have any positive labels in the 50 labeled examples. For F1 of binary features, we omit features that corre- spond to ill-defined precision (no positive predictions) and/or recall (no positive labels) scores are set to 0. the readmission task in Figure 2. For the radiology task, we have no reference features to use for evaluation. Therefore, our radi- ologist co-author annotated 50 test example reports with a set of features applicable to each report. This allows us to create binary labels for each feature and report, in turn allowing evaluation with the same metrics used above for binary and continuous feature encodings. There are 105 features-too many to present individually-so we report the feature scores in violin plots (Figure 3). Zero-shot (feature) extraction performs reason- ably well here in general, as suggested by prior work (Agrawal et al. 2022; although they used GPT- 3, not Flan-T5). Scores are well above chance for MIMIC-III features. Given the zero-shot setting, they are not on par with supervised approaches for ICD code prediction (Mullenbach et al., 2018), but this may be partially due to a limitation of the ICD code reference features: ICD codes are known to be noisy (Kim et al., 2021; Boag et al., 2022), so even correctly inferred features may not align well 0.40.60.81.0AUROC...Chr. kidney disease...HyperlipidemiaDiabetes mellitus......Use of anticoagulantsAcute kidney failureAcute respiratory failureCoronary Atherosclerosis...Atrial fibrillation...Heart Failure...Hypertention...Chr. kidney disease...HyperlipidemiaDiabetes mellitus......Use of anticoagulantsAcute kidney failureAcute respiratory failureCoronary Atherosclerosis...Atrial fibrillation...Heart Failure...HypertentionContinuousBinary0.00.20.40.6F1 ScoreAUROC0.40.50.60.70.80.91.0.92ContinuousF1 ScorePrecisionRecall0.00.20.40.60.81.0.21.19.34Binary IDF) features with varying vocabulary sizes. We report AUROCs for phenotyping and X-ray report classification, macro-averaged over labels. To evaluate the degree to which zero-shot feature inference degrades performance, we also report results for a logistic regression model defined over reference ICD codes ("Ground Truth") for MIMIC tasks. And finally, we compare against direct zero- shot prediction of the downstream classification using FLAN-T5-XXL (Roberts et al., 2022). Figure 4 demonstrates that across all tasks, the model variants with continuous intermediate fea- tures have significant signal (i.e., AUROC is sig- nificantly above chance 0.5).5 Our method also performs comparably to or better than "Ground Truth" features for all tasks except Phenotyping, where the ICD code features (real more-so than inferred6) have an advantage because the pheno- types considered were derived from ICD codes.7 We also see that the addition of just two custom queries does improve performance to varying de- grees for MIMIC-III tasks relative to models that solely employ ICD-code queries, indicating that there is indeed a benefit that can be derived from employing natural language queries to predict in- termediate features. That said, making downstream predictions using these features performs worse than BERT and TF- IDF (30k) models. This is not surprising given that the number of features for our method is in the range of 10-105 as compared with 30k for TF-IDF and 100k+8 for ClinicalBERT. Zero-shot prediction of the downstream task per- forms worse than (supervised) linear models on top of inferred features on Readmission prediction and Chest X-ray report classification, equivalently on Phenotyping, and slightly better on Mortality pre- diction. However, such predictions are completely blackbox (see Section 5 for discussion around inter- pretability of zero-shot extracted features.) Finally, we also find that using binary features instead of continuous features degrades performance signifi- cantly (Table 1); calibrating (un)certainty helps. When manually inspecting some example radi- ology reports, it became apparent that downstream labels are often verbalized in the radiology report. 5Expanded set of results in Apppendix Table C.1. 6Inferred codes are not expected to fully align with noisy ICD codes (see section 4.1). 7Performance is not 100% because only a subset of the ICD codes used for phenotyping were used as features. 8approximately, after the embedding layer Figure 4: Downstream classification performance. We compare variants that use inferred continuous features with models that use "ground truth" features (here, ICD codes), and models that perform zero-shot prediction directly. We also show the performance of TF-IDF and BERT models (dashed horizontal lines) and 95% CIs. with the labels. In contrast, our radiologist's direct annotation of the Chest X-ray report features reveal much higher AUROCs for continuous features. A novel aspect of this work, in contrast to (Agrawal et al., 2022), is that in the case of the chest X- ray task the features are extracted using custom queries, specified as natural language questions provided by a domain expert (radiologist). While far from perfect, our results suggest that modern large instruction-tuned LMs are capable of infer- ring arbitrary clinically salient high-level features from EHR with some fidelity. 4.2 Downstream classification performance Classification performance in and of itself is not our primary objective; rather, our aim is to design a method which allows for flexible construction of small and interpretable models using high-level fea- tures, with minimal expert annotation effort. But to contextualize the predictive performance of the models evaluated we also consider several base- lines that offer varying degrees of "interpretability". Specifically, we evaluate fine-tuned variants of (a) Clinical BERT (Alsentzer et al., 2019), and (b) a logistic regression model defined over BoW (TF- w/ Custom Pheno. -.054 -.050 ✗ ✔ Readmis. Mort. CXR Class. -.052 -.088 - -.060 -.025 -.023 Table 1: Difference in AUROC between using Binary and Continuous features. PhenotypingReadmission PredictionMortality Prediction0.40.50.60.70.80.91.0AUROCMIMIC-III TasksBERTTF-IDF (30k)Ground TruthInferred ContinuousInferred Continuous w/ CustomZero-Shot Downstream PredictionChest X-rayClassification Figure 5: Linear model coefficients for readmission prediction. Blue and red indicate features that support or refute the label, respectively, and "const" refers to the values of the intercept. Though many feature weights (e.g. "Hypertensive Chronic Kidney Disease") make a lot of sense in the context of readmission prediction, "Coronary atherosclerosis [...]," which we see in the inferred features, does not make sense as a top feature. We suspect this is due to imperfect feature inference as it is not a top feature when using the ground truth features. No Finding Enlar. Cardiom. Cardiomegaly Edema Pneumonia Atelectasis Pneumothorax Fracture Lung Lesion Lung Opacity Pleural Other Support Devices Average P@1 P@5 P@10 P@20 AUC 0.62 0.20 1.00 1.00 0.10 1.00 0.61 0.60 1.00 0.62 0.30 0.00 0.64 0.20 0.00 0.69 0.20 0.00 0.84 0.30 1.00 0.74 0.30 1.00 0.80 0.40 0.00 0.29 0.00 0.00 0.73 0.40 0.00 0.49 0.30 0.00 0.67 0.27 0.42 0.10 0.05 0.35 0.20 0.10 0.10 0.15 0.15 0.25 0.00 0.20 0.30 0.16 0.40 0.20 0.80 0.20 0.20 0.20 0.60 0.40 0.60 0.00 0.20 0.40 0.35 Table 2: Precisions and AUCs of learned feature rank- ings on the Chest X-ray classification task, evaluated against a priori relevancy judgements per class pro- vided by our radiologist collaborator. The model was not trained to rank features but nevertheless implicitly learned feature importance that aligns with intuition. This makes sense given that the CheXpert labeler needs to extract these from the report, and interme- diate features are therefore not explicitly modeled. This gives TF-IDF and BERT models a particu- lar advantage over inferred feature models that is unlikely to exist for natural tasks (which are not defined by an automated labeler, and where inter- mediate features will probably be important). 4.3 Interpretability our primary motivation offer to Given interpretability-specifically via small linear models over a small number of high-level features-we next investigate how well learned coefficients align with domain expert judgement. The radiologist who specified features for the chest X-ray dataset also indicated for which task(s) Figure 6: Linear model coefficients for predicting At- electasis in the Chest X-ray Dataset using the top 15 continuous features. "const" represents a constant bias feature and is therefore not annotated. ✔ and ✗ denote post-hoc annotations of the feature coefficient as align- ing or not aligning with clinical expectations, respec- tively. Most features (both with negative and positive coefficients) do align. they judged each feature to be predictive. Conse- quently, we have a label for each of the 105 features that indicates whether the domain expert believed the feature to be likely supportive of, or likely not relevant to, each of the 12 classes defined in the chest X-ray task. We use these "feature labels" to measure the degree to which the learned weights agree with the domain knowledge that they are intended to encode. In particular, we rank each feature by coefficient and compute precision at k and AUC for all 12 classes (Table 2). For all la- bels except Lung Opacity and Support Devices, the rank of features in terms of relevance consistently agrees with expert judgement (AUC > .5). As further evidence of the greater interpretability afforded by the proposed approach, we report the top features for readmission prediction in Figure 5. Coronary atherosclerosis of unspecified type of vesselHypertensive chronic kidney diseaseAcute respiratory failurecustom_has_chronicconstCongestive heart failureOther and unspecified hyperlipidemiaUnspecified essential hypertensionAcute kidney failureLong-term (current) use of anticoagulantsDiabetes mellitus without mention of complicationAtrial fibrillationcustom_is_lifethreateningInferred Continuous w/ CustomtrachoshnoesrddialysishdvariceshemodialysisrehabcomfortsubduraltracheostomymetforminlineoverdoseTF-IDF (30k)Hypertensive chronic kidney diseaseAcute respiratory failureconstLong-term (current) use of anticoagulantsCoronary atherosclerosis of unspecified type of vesselAcute kidney failureCongestive heart failureAtrial fibrillationDiabetes mellitus without mention of complicationUnspecified essential hypertensionOther and unspecified hyperlipidemiaGround Truthbulging fissuresstags antler signdecreased lung volumesalveolar filling processconvex left atrial appendagecollapse of lungreticular opacitydense op air filling with pus water bloodthickening of the fissuresconstindistinct basilar opacityincrease subcarinal angleapical lucencyprominent right atrial contourperibronchiolar cuffingContinuous Feature Coefficients (Atelectasis)✔✔✔✔✔✔✗ ✗ ✗ ✗ ✔✔✔✔ Figure 7: Qualitative example of features and feature influence for predicting Edema in the case of an ostensible "false positive". We selected this example because on cursory inspection Edema would seem to be applicable here. We presented this to our radiologist co-author who confirmed that this report should in fact be labeled positive for Edema. We show the report and the downstream reference and predicted labels on the left. In the middle, we report top raw feature values, and on the right we show the top scores, i.e., feature values times the corresponding coefficients for Edema. Bolded features were confirmed by the radiologist as aligning with clinical judgement. Here we compare the top-ranked features in linear models using TF-IDF (left), reference ICD codes (the "ground truth" high-level features here; center), and inferred high-level features (right). The top positive inferred high-level features align with the top positive reference ICD code features. For high-level features, coefficient magnitude mass is concentrated on the very top features, whereas in the TF-IDF case mass is more uniformly distributed. This held across many of the tasks and labels (see Appendix Table C.2), and is likely an artifact of having many more TF-IDF features. It renders such models difficult to interpret. We also see that the custom "has_chronic" feature is among the top features and the "is_lifethreatening" feature is at the bottom, aligning with intuition. We also consider the coefficients for chest X-ray report classification, enlisting our radiologist co- author to annotate these. It is important to do this analysis post-hoc because the initial feature annota- tions used for the metrics in Table 2 are not neces- sarily exhaustive. Figure 6 reports assessments for the linear model coefficients for "atelectasis". Most of the feature influences agree with expectations. Interestingly, this analysis indicates the pres- ence of certain known reporting biases present in the reports. For example, the feature "apical lu- cency" specifically indicates possible pneumoth- orax, a cause of passive atelectasis, and so ratio- nally should support the 'atelectasis' label, but is weighted to refute the label. We speculate that this reflects 'satisfaction of search' bias, and other closely aligned reporting biases; pneumothorax is such a critically important condition that radiolo- gists reporting pneumothorax will in many cases not spend time searching for, or reporting the asso- ciated atelectasis, which in this case is a secondary feature of far lower independent importance. Figure 6 shows an example illustrating how a clinician might inspect a classification. Because the predicted "edema" label disagreed with the CheX- pert labeler, our radiologist collaborator reviewed this case to determine which features led to this ostensible "false positive". While inspecting the features for a source of error, they determined that the top positive features ("alveolar filling process", "alveolar fluid") accurately described the report and could support Edema, but more commonly indicate pneumonia or other causes. Subsequently, while reviewing the report, the radiologist concluded that the model prediction of edema was actually cor- rect; the CheXpert label was a false negative. In this case, the inferred features did correctly influ- ence the 'edema/no edema' classification. Appendix Figure C.2 shows an example where a feature influenced the model incorrectly, even though the model made the correct prediction. These examples illustrate two of many ways in which our approach might facilitate model interpre- tation and debugging. 4.4 Data- and feature- efficiency Finally, we consider how our model fares compared to baselines in terms of data efficiency. Specifically, we construct learning curves by increasing the per- cent of the available data used to train models. In Figure 8, we see that the performance of small models plateaus with relatively minimal supervi- sion. At low levels of supervision such models are competitive with-and in some cases better Targets(CheXpert Labeler)ModelPredictionsSupport DevicesLung OpacityEdemaEdemaShould be a target!Clinical Judgement:Support DevicesCardiomegalyCardiomegalyLung OpacityHISTORY: Intubated, evaluate ET tube. FINDINGS: The ET tube is 3.5 cm above the carina. The NG tube tip is off the film, at least in the stomach. Right IJ Cordis tip is in the proximal SVC. The heart size is moderately enlarged. There is ill-defined vasculature and alveolar infiltrate, right greater than left. This is markedly increased compared to the film from two hours prior and likely represents fluid overload.endotracheal tubetubeenlarged heartenlarged cardiac silhouettealveolar fluidalveolar filling processesophageal tubenasogastric tubegastric tubeenlarged cardiomediastinal silhouetteTop Continuous Featuresconstalveolar filling processalveolar fluidperipheral lucencyenlarged heartupper lobe pulmonary venous engorgementhazy perihilar opacitygastric tubeesophageal tuberounded left heart border✔✔Top Decision-Impacting Features (Edema) Figure 9: Feature ablation for Chest X-ray classifica- tion. After training, we explore how pruning features randomly (left) or based on coefficient magnitudes (av- eraged over all classes) affects performance. enced the output for a given instance (e.g., Figure 7). This is in stark contrast to deep neural net- work models (like Clinical BERT; Alsentzer et al. 2019), which operate over dense learned embed- dings. However, in healthcare high-level features must often be manually extracted from unstruc- tured EHR. In this work we proposed to allow do- main experts to define high-level predictors with natural language queries that are used to infer fea- ture values via LLMs. We then define small linear models over the resulting features. The promise of this approach is that it enables one to capitalize on LLMs while still building mod- els that provide interpretability. Our approach al- lows domain experts to craft features that align with questions a clinician might seek to answer in order to make a diagnosis and then use the coefficients from a trained linear model to determine which features inform predictions. Using such "abstract" features in place of word frequency predictors con- fers greater interpretability (Figure 5). 6 Conclusions We have proposed using large language models (LLMs) to infer high-level features from unstruc- tured Electronic Health Records (EHRs) to be used as predictors in small linear models. These high- level features can be specified in arbitrary natural language queries composed by domain experts, and extracted using LLMs without explicit supervision. On three clinical predictive tasks, we showed that this approach yields performance comparable to that achieved using "reference" high-level fea- tures (here, ICD codes). On a fourth task (X-ray re- port classification), we enlisted a radiologist collab- orator to provide high-level features in natural lan- Figure 8: Learning curves for different methods. than-larger models (e.g., based on Clinical BERT representations), which benefit more from addi- tional supervision. We again emphasize, however, that using more complex representations comes at the expense of interpretability; this is true even for TF-IDF (see Figure 5). We also explore the distribution of information among the features by pruning features from our continuous model after training in Figure 9. If we prune features randomly, we see a curve that indi- cates that we have not saturated our performance, and adding additional features will likely increase performance further. In fact, while annotating 50 examples on the test set, our radiologist co-author noted many features that were not included that would likely increase performance. If we prune features with the smallest-magnitude coefficients first, we see that-in contrast to the model using binary features-the continuous fea- ture model has a much more rounded curve, indi- cating that there are a large number of features that are actively contributing to a performance increase. We also note that we use dramatically fewer in- ferred features compared to TF-IDF. Indeed, as we report in Appendix Table C.1, if we limit TF-IDF to a vocabulary size of 100, using continuous inferred features outperforms TF-IDF on all tasks. 5 Discussion Small linear models over well-defined features of- fer transparency in that one can read off coeffi- cients for predictors and inspect which most influ- Train Data Percentage (of 24457)0.50.60.70.80.91.0AUROCPhenotypingTrain Data Percentage (of 26245)Readmission PredictionFeature TypeBERTGround TruthInferred ContinuousInferred Continuous w/ CustomTF-IDF (30k)1%3%10%30%100%Train Data Percentage (of 12681)0.50.60.70.80.91.0AUROCMortality Prediction1%3%10%30%100%Train Data Percentage (of 20000)Chest X-ray Classification020406080100Number of Features0.550.600.650.700.750.800.85AUROCPrune Randomly (10 runs)020406080100Number of FeaturesPrune by CoefficientFeature TypeInferred Binary w/ CustomInferred Continuous w/ CustomChest X-Ray Feature Ablation guage. We showed a model using these features as automatically extracted via an LLM realized strong predictive performance, and-more importantly- provided varieties of model transparency which we confirmed aligned with clinical judgement, and which provided insights to the domain expert. This work demonstrates the promise of using LLMs as high-level feature extractors for small linear models, which may admit varieties of inter- pretability. However, this is complicated by the issues discussed in the Limitations section, below. We believe that more research into this hybrid ap- proach is therefore warranted. the degree to which the LLM inferences align with the domain experts' intent regarding the respective features. This suggests that one might want to design queries for high-level features that, whenever pos- sible, are easily verifiable upon inspection of the EHR. Asking if a patient is at risk of death is not directly verifiable, because it is necessarily a pre- diction; asking if the patient has an "enlarged heart" (for example) probably is. However, even using verifiable features does not guarantee that clini- cians will hastily confirm or remain unbiased by unverified features in practice. Limitations While the initial results reported above are encour- aging, they also raise several questions as to how one should design queries to yield intermediate features that are interpretable, informative, and ver- ifiable. One limitation of using LLMs to gener- ate high-level features is that inference for these features remains opaque. This inherent limitation suggests a few immediate research questions for future work. The slippery "interpretability" of inferred fea- tures; Is there a trade-off between interpretabil- ity and predictive power? Not every query in- formative of the downstream prediction task will necessarily aid interpretability. For example, when predicting mortality, the response to the query "Is the patient at risk of death?" will likely corre- late strongly with the downstream task (as can be seen in Figure 4, which reports performance for zero-shot prediction). But this query essentially paraphrases the original downstream task, and so does little to aid interpretability. It instead simply shifts the problem to explaining what elements of the EHR give rise to the predicted "feature". This suggests that expert queries should be written to elicit features that correlate with, but are distinct from, the prediction task. How do we know whether predicted features are faithful to their queries? A related compli- cation to this approach is that zero-shot feature extraction will not be perfect. While results for ICD code proxies indicate good correlation, we will in general not be able to easily verify whether the indicator that is extracted by an LLM is in fact predicting the feature intended. The interpretabil- ity of the resultant model will therefore depend on Can we manually intervene when a model learns a counter-intuitive dependency? Because we exploit features that have a direct relationship to domain expert knowledge, it might be possible to draw upon their judgement to intervene when a model learns a dependence on a predictor in way that does not align with expectations (e.g. Figures 6 and C.2). This may happen because either: (1) the feature itself was incorrectly inferred, (2) there exists some spurious correlation in the data that does not hold in general. A less likely possibility is that (3) the expert prior was simply incorrect. Future work might study if pruning this feature to "correct" the model improves generalization. Ethics Statement Our approach raises ethical concerns because the extracted features may be incorrect. Though this work does show promise in terms of the interpre- tations aligning with clinical expectations, it is far from ready to deploy because there is a danger that clinicians will make incorrect assumptions even if warned of the model's potential for making mis- takes both in producing features. Just because the explanation of the model makes sense clinically does not mean the underlying features for an in- stance are factual. Models like this may also play into clinician bias given that the model is trained data produced by clinicians. Therefore, we present this work only for scientific exploration, and it is not intended to be used in a deployed system in its current form. Acknowledgements We acknowledge partial funding for this work by National Library of Medicine of the National In- stitutes of Health (NIH) under award numbers R01LM013772 and R01LM013891. The work was also supported in part by the National Science Foundation (NSF) grant 1901117. The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH or the NSF. References Monica Agrawal, Stefan Hegselmann, Hunter Lang, Yoon Kim, and David Sontag. 2022. Large language models are zero-shot clinical information extractors. In Proceedings of Empirical Methods in Natural Lan- guage Processing (EMNLP). Emily Alsentzer, John Murphy, William Boag, Wei- Hung Weng, Di Jin, Tristan Naumann, and Matthew McDermott. 2019. Publicly available clinical BERT embeddings. In Proceedings of the 2nd Clinical Nat- ural Language Processing Workshop, pages 72–78, Minneapolis, Minnesota, USA. Association for Com- putational Linguistics. William Boag, Mercy Oladipo, and Peter Szolovits. 2022. EHR Safari: Data is Contextual. In Proceed- ings of the 7th Machine Learning for Healthcare Conference, pages 391–408. PMLR. Hyung Won Chung, Le Hou, Shayne Longpre, Bar- ret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. 2022. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understand- ing. arXiv preprint arXiv:1810.04805. Ary L Goldberger, Luis AN Amaral, Leon Glass, Jef- frey M Hausdorff, Plamen Ch Ivanov, Roger G Mark, Joseph E Mietus, George B Moody, Chung-Kang Peng, and H Eugene Stanley. 2000. Physiobank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals. circulation, 101(23):e215–e220. Kexin Huang, Jaan Altosaar, and Rajesh Ranganath. 2019. Clinicalbert: Modeling clinical notes and pre- dicting hospital readmission. arXiv:1904.05342. Jeremy Irvin, Pranav Rajpurkar, Michael Ko, Yifan Yu, Silviana Ciurea-Ilcus, Chris Chute, Henrik Marklund, Behzad Haghgoo, Robyn Ball, Katie Shpanskaya, et al. 2019. Chexpert: A large chest radiograph dataset with uncertainty labels and expert comparison. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 590–597. A Johnson, T Pollard, R Mark, S Berkowitz, and S Horng. 2019a. Mimic-cxr database (version 2.0.0). physionet. Alistair Johnson, Matt Lungren, Yifan Peng, Zhiyong Lu, Roger Mark, Seth Berkowitz, and Steven Horng. Mimic-cxr-jpg-chest radiographs with structured la- bels. Alistair E. W. Johnson, Tom J. Pollard, Seth J. Berkowitz, Nathaniel R. Greenbaum, Matthew P. Lungren, Chih-ying Deng, Roger G. Mark, and Steven Horng. 2019b. MIMIC-CXR, a de-identified publicly available database of chest radiographs with free-text reports. Scientific Data, 6(1):317. Alistair E. W. Johnson, Tom J. Pollard, and Roger G. Mark. 2016a. MIMIC-III clinical database (version 1.4). Alistair EW Johnson, Tom J Pollard, Nathaniel R Green- baum, Matthew P Lungren, Chih-ying Deng, Yifan Peng, Zhiyong Lu, Roger G Mark, Seth J Berkowitz, and Steven Horng. 2019c. Mimic-cxr-jpg, a large publicly available database of labeled chest radio- graphs. arXiv preprint arXiv:1901.07042. Alistair E.W. Johnson, Tom J. Pollard, Lu Shen, Li- wei H. Lehman, Mengling Feng, Mohammad Ghas- semi, Benjamin Moody, Peter Szolovits, Leo An- thony Celi, and Roger G. Mark. 2016b. MIMIC-III, a freely accessible critical care database. Scientific Data, 3(1):160035. Youngwoo Kim, Cheng Li, Bingyang Ye, Amir Tah- masebi, and Javed Aslam. 2021. Supervised Learn- ing in the Presence of Noise: Application in ICD-10 Code Classification. ArXiv:2103.07808 [cs]. James Mullenbach, Sarah Wiegreffe, Jon Duke, Jimeng Sun, and Jacob Eisenstein. 2018. Explainable predic- tion of medical codes from clinical text. In Proceed- ings of the 2018 Conference of the North American Chapter of the Association for Computational Lin- guistics: Human Language Technologies, Volume 1 (Long Papers), pages 1101–1111, New Orleans, Louisiana. Association for Computational Linguis- tics. F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duch- esnay. 2011. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830. Adam Roberts, Hyung Won Chung, Anselm Levskaya, Gaurav Mishra, James Bradbury, Daniel Andor, Sha- ran Narang, Brian Lester, Colin Gaffney, Afroz Mohiuddin, Curtis Hawthorne, Aitor Lewkowycz, Alex Salcianu, Marc van Zee, Jacob Austin, Se- bastian Goodman, Livio Baldini Soares, Haitang Hu, Sasha Tsvyashchenko, Aakanksha Chowdh- ery, Jasmijn Bastings, Jannis Bulian, Xavier Gar- cia, Jianmo Ni, Andrew Chen, Kathleen Kenealy, Jonathan H. Clark, Stephan Lee, Dan Garrette, James Lee-Thorp, Colin Raffel, Noam Shazeer, Marvin Ritter, Maarten Bosma, Alexandre Passos, Jeremy Maitin-Shepard, Noah Fiedel, Mark Omernick, Bren- nan Saeta, Ryan Sepassi, Alexander Spiridonov, Joshua Newlan, and Andrea Gesmundo. 2022. Scal- ing up models and data with t5x and seqio. arXiv preprint arXiv:2203.17189. Jason Wei, Maarten Paul Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, An- drew Mingbo Dai, and Quoc V. Le. 2022. Finetuned language models are zero-shot learners. Haoran Zhang, Amy X. Lu, Mohamed Abdalla, Matthew McDermott, and Marzyeh Ghassemi. 2020. Hurtful words: Quantifying biases in clinical con- In Proceedings of the textual word embeddings. ACM Conference on Health, Inference, and Learn- ing, CHIL '20, page 110–120, New York, NY, USA. Association for Computing Machinery. A Full Prompt Table A.1: The full prompts incorporate the input text and the questions, described in section 3 and appendix Table B according to the following templates. MIMIC Tasks Read the following text from a clinical note: ----– <input> ----– <question> Chest X-ray Classification Task Read the following Chest X-ray report: ----– <input> ----– <question> B Hand-crafted Feature Queries for Chest X-ray Dataset Table B.2: Features grouped by the labels they may support. (Features may be written under more than one label.) No Finding normal clear lungs normal cardiac silhouette sharp costophrenic angles Enlarged Cardiomediastinum enlarged cardiomediastinal silhouette Cardiomegaly enlarged cardiomediastinal silhouette increased cardiothoracic ratio prominent right atrial contour enlarged heart globular cardiac silhouette rounded left heart border uplifted cardiac apex double density splaying of carina increase subcarinal angle convex left atrial appendage Is this patient normal? Does this patient have clear lungs? Does this patient have a normal cardiac silhouette? Does this patient have sharp costophrenic angles? Does this patient have an enlarged cardiomediasti- nal silhouette? Does this patient have an enlarged cardiomediasti- nal silhouette? Does this patient have an increased cardiothoracic ratio? Does this patient have a prominent right atrial con- tour? Does this patient have an enlarged heart? Does this patient have a globular cardiac silhou- ette? Does this patient have a rounded left heart border? Does this patient have an uplifted cardiac apex? Does this patient have a double density? Is there splaying of the carina? Does this patient have an increased subcarinal an- gle? Does this patient have a convex left atrial ap- pendage? Does this patient have a third mogul sign? left mainstem bronchus? third mogul sign superior displacement of left mainstem bronchus Does this patient have superior displacement of rounded cardiac apex shmoo sign hoffman rigler sign Edema upper lobe pulmonary venous engorgement stags antler sign bilateral opacity symmetric perihilar opacity bat wing opacity enlarged cardiac silhouette increased cardiothoracic ratio peribronchiolar cuffing hazy perihilar opacity septal thickening kerley b lines thickening of the fissures fluid in the fissures pleural effusion Pneumonia reticular opacity hazy opacity consolidation segmental opacity lobar opacity bulging fissures cavitation Atelectasis subsegmental linear basilar opacity linear basilar opacity subsegmental crescentic basilar opacity crescentic basilar opacity decreased lung volumes indistinct basilar opacity Pneumothorax apical lucency peripheral lucency collapse of lung visible visceral pleura Fracture lucency in a rib or clavicle deformity of a rib or clavicle wedge deformity of a vertebra Does this patient have a rounded cardiac apex? Does this patient have a shmoo sign? Does this patient have a Hoffman-Rigler sign? Does this patient have upper lobe pulmonary ve- nous engorgement? Does this patient have a stag's antler sign? Does this patient have bilateral opacity? Does this patient have a symmetric perihilar opac- ity? Does this patient have a bat wing opacity? Does this patient have an enlarged cardiac silhou- ette? Does this patient have an increased cardiothoracic ratio? Does this patient have peribronchiolar cuffing? Does this patient have a hazy perihilar opacity? Does this patient have septal thickening? Does this patient have Kerley B lines? Is there a thickening of the fissures? Does this patient have fluid in the fissures? Does this patient have a pleural effusion? Does this patient have a reticular opacity? Does this patient have a hazy opacity? Does this patient have consolidation? Does this patient have a segmental opacity? Does this patient have a lobar opacity? Does this patient have bulging fissures? Does this patient have cavitation? Does this patient have a subsegmental linear basi- lar opacity? Does this patient have a linear basilar opacity? Does this patient have a subsegmental crescentic basilar opacity? Does this patient have a crescentic basilar opacity? Does this patient have decreased lung volumes? Does this patient have indistinct basilar opacities? Does this patient have an apical lucency? Does this patient have a peripheral lucency? Is there a collapse of a lung? Does this patient have visible visceral pleura? Does this patient have a lucency in a rib or clavi- cle? Does this patient have a deformity of a rib or clav- icle? Does this patient have a wedge deformity of a vertebra? step off of a rib or clavicle Lung Lesion rounded opacity pulmonary calcification cavitation abnormal high density opacity with indistinct borders spiculated opacity hazy opacity Lung Opacity alveolar blood alveolar fluid Pleural Other pleural empyema hemothorax pleural tumor pleural thickening calcificied pleural plaques foreign body in pleural space Support Devices surgical clip metallic density curvilinear density foreign body metal lead wire tube stent endotracheal tube chest tube central venous catheters picc line tracheal stent coronary stent aortic stent arterial stent pacemaker icd aortic balloon pump lvad clamshell closure device SVC stent IVC stent IVC filter Other Features alveolar hemorrhage dense op air filling with pus water blood esophageal tube Does this patient have a step-off of a rib or clavi- cle? Does this patient have a rounded opacity? Does this patient have an pulmonary calcification? Does this patient have cavitation? Does this patient have an abnormal high density? Does this patient have an opacity with indistinct borders? Does this patient have a spiculated opacity? Does this patient have a hazy opacity? Is there alveolar blood? Is there alveolar fluid? Is there pleural empyema? Does the patient have hemothorax? Is there pleural tumor? Is there pleural tumor? Does this patient have a calcified pleural plaque? Is there a foreign body in the pleural space? Does this patient have a surgical clip? Does this patient have a metallic density? Does this patient have a curvilinear density? Does this patient have a foreign body? Does this patient have a metal lead? Does this patient have a wire? Does this patient have a tube? Does this patient have a stent? Does this patient have an endotracheal tube? Does this patient have a chest tube? Does this patient have a central venous catheter? Does this patient have a PICC line? Does this patient have a tracheal stent? Does this patient have a coronary stent? Does this patient have an aortic stent? Does this patient have an arterial stent? Does this patient have a pacemaker? Does this patient have an ICD? Does this patient have an aortic balloon pump? Does this patient have an lvad? Does this patient have a clamshell closure device? Does this patient have an SVC stent? Does this patient have an IVC stent? Does this patient have an IVC filter? Is there alveolar hemorrhage? Does this patient have a dense opacity that sug- gests the airspace filling with pus, water, or blood? Does this patient have an esophageal tube? g-tube gastric tube loculated pleural effusion nasogastric tube Does this patient have a g-tube? Does this patient have a gastric tube? Is there a loculated pleural effusion? Does this patient have a nasogastric tube? Phenotyping 0.820 ± 0.024 BERT 0.624 ± 0.031 TF-IDF (30) 0.697 ± 0.030 TF-IDF (100) 0.813 ± 0.025 TF-IDF (1k) 0.830 ± 0.024 TF-IDF (30k) 0.798 ± 0.027 Ground Truth 0.651 ± 0.031 Inferred Binary 0.669 ± 0.031 Inferred Binary w/ Custom 0.705 ± 0.029 Inferred Continuous Inferred Continuous w/ Custom 0.719 ± 0.029 0.711 ± 0.030 Zero-Shot Downstream Readmission 0.661 ± 0.019 0.573 ± 0.020 0.613 ± 0.020 0.668 ± 0.019 0.694 ± 0.019 0.645 ± 0.019 0.589 ± 0.020 0.603 ± 0.020 0.614 ± 0.020 0.626 ± 0.020 0.579 ± 0.020 Mortality 0.874 ± 0.025 0.692 ± 0.034 0.787 ± 0.031 0.863 ± 0.025 0.872 ± 0.024 0.697 ± 0.037 0.699 ± 0.035 0.719 ± 0.033 0.752 ± 0.032 0.806 ± 0.029 0.816 ± 0.030 Chest X-ray 0.991 ± 0.008 0.760 ± 0.033 0.881 ± 0.027 0.952 ± 0.014 0.952 ± 0.013 - - 0.828 ± 0.034 - 0.889 ± 0.026 0.800 ± 0.030 Table C.1: Expanded results of Downstream Classification Performance with 95% Confidence Intervals. Phenotype Readmission Mortality Chest X-ray TF-IDF (30) TF-IDF (100) TF-IDF (1k) TF-IDF (30k) Ground Truth Inferred Binary Inferred Binary w/ Custom Inferred Continuous Inferred Continuous w/ Custom 3.05 3.84 4.63 9.50 1.30 1.96 2.03 1.65 1.75 3.41 4.54 6.84 10.30 2.39 2.39 2.56 2.31 2.51 1.00 2.67 6.24 10.27 2.00 1.85 1.50 1.97 1.13 1.98 1.79 1.86 4.17 - - 3.98 - 3.08 Table C.2: How is the magnitude mass distributed across coefficients? We report the entropy of the distribution )) where c represents the vector of coefficients for a model described by the coefficient magnitudes: H(softmax( and takes the absolute value of each element. (Entropy is averaged over labels in the case of Phenotype and Chest X-ray tasks.) This measure gives some insight into how uniform the coefficient magnitudes are. TF-IDF (30k) has much higher entropy across the board indicating that many more features have high magnitude in this model. c | | * | | C Extra Figures and Tables Figure C.1: Using a set of features annotated as supporting a particular label, we plot the AUROC obtained by using the coefficient values (from the continuous features model) to predict this feature list for each label. No FindingEnlarged CardiomediastinumCardiomegalyEdemaPneumoniaAtelectasisPneumothoraxFractureLung LesionLung OpacityPleural OtherSupport Devices0.00.20.40.60.81.0AUROCFeature Alignment with Clinical Expectations Table C.3: AUC per Phenotyping label. BERT TF-IDF Ground Truth (30k) 0.663 0.873 0.856 0.809 0.874 0.863 0.846 0.819 0.870 Conduction Disorders Pneumonia That (Except Caused By Tuberculosis Or Sexually Transmitted Disease) Disorders Of Lipid Metabolism 0.785 0.867 Acute Myocardial Infarction 0.696 Other Lower Respiratory Dis- ease Pleurisy; Pneumothorax; Pul- monary Collapse Any-Chronic Diabetes Mellitus With Compli- cations Cardiac Dysrhythmias Any-Acute Coronary Atherosclerosis And Other Heart Disease Hypertension With Complica- tions And Secondary Hyperten- sion Septicemia (Except In Labor) Respiratory Failure; ciency; Arrest (Adult) Any-Disease Congestive Heart Failure; Non- hypertensive Chronic Obstructive Pulmonary Disease And Bronchiectasis Complications Of Surgical Pro- cedures Or Medical Care Acute And Unspecified Renal Failure Shock Other Upper Respiratory Dis- ease Fluid And Electrolyte Disorders Other Liver Diseases Gastrointestinal Hemorrhage Diabetes Mellitus Without Com- plication Acute Cerebrovascular Disease Essential Hypertension Chronic Kidney Disease 0.734 0.828 0.855 0.700 0.907 0.729 0.857 0.873 0.831 0.874 0.882 0.903 0.837 Insuffi- 0.712 0.830 0.777 0.847 0.834 0.712 0.744 0.763 0.862 0.719 1.000 0.785 0.684 0.722 0.583 0.867 0.867 0.838 0.834 0.868 0.951 0.652 0.905 0.819 0.964 0.870 0.864 0.883 0.884 0.897 0.830 0.748 0.985 0.934 0.979 0.789 0.670 0.756 0.589 0.848 0.956 0.872 0.833 0.760 0.855 0.887 0.723 0.936 0.720 0.869 0.756 0.642 0.691 0.661 0.583 0.971 0.677 0.996 0.830 Inferred Zero-Shot Inferred Continuous Continuous Downstream w/ Custom 0.676 0.713 0.758 0.733 0.678 0.709 0.705 0.788 0.580 0.593 0.779 0.774 0.797 0.715 0.820 0.749 0.732 0.787 0.812 0.767 0.658 0.569 0.703 0.715 0.686 0.648 0.641 0.628 0.719 0.628 0.627 0.736 0.723 0.796 0.630 0.627 0.784 0.776 0.799 0.726 0.838 0.769 0.728 0.784 0.826 0.770 0.670 0.581 0.714 0.726 0.698 0.650 0.669 0.636 0.720 0.709 0.634 0.771 0.639 0.805 0.649 0.661 0.659 0.831 0.793 0.515 0.801 0.670 0.782 0.780 0.632 0.704 0.716 0.701 0.646 0.694 0.737 0.618 0.730 0.779 0.638 0.841 0.588 0.817 Table C.4: AUC per CheXpert label. BERT TF-IDF (30k) Atelectasis Cardiomegaly Edema Enlarged Cardiom. Support Devices Pneumothorax Fracture Pneumonia Pleural Other No Finding Lung Opacity Lung Lesion 0.997 0.997 0.997 0.988 0.996 0.990 0.999 0.982 0.995 0.987 0.994 0.976 0.968 0.957 0.961 0.904 0.965 0.950 0.987 0.921 0.965 0.944 0.944 0.965 Inferred Zero-Shot Continuous Downstream w/ Custom 0.888 0.913 0.910 0.764 0.925 0.911 0.948 0.795 0.804 0.906 0.899 0.862 0.944 0.876 0.954 0.592 0.826 0.868 0.977 0.799 0.566 0.230 0.858 0.804 Figure C.2: Qualitative Example of Features and Feature Influence for Pneumonia. (Similar to Figure 7.) This seems to correctly predict Pneumonia, but this happens in spite of consolidation being incorrectly identified by the linear model as not supporting Pneumonia. These plots make clear that this is not a mistake of the feature extractor at inference time because consolidation is among the top Features. The mistake comes from the linear model having a negative coefficient for consolidation. FINDINGS: Two images of the chest shows a small consolidation at the right base, most consistent with pneumonia. There are no other consolidations. There is no evidence of interstitial edema. There are no pleural effusions. The heart size is at the upper limits of normal. The mediastinal contours are normal. There are sternotomy wires in place. IMPRESSION: Consolidation in the right base is most consistent with pneumonia. TargetsPredictionsCardiomegalyCardiomegalyPneumoniaPneumoniaconsolidationwirelobar opacityalveolar filling processdense op air filling with pus water bloodnormal cardiac silhouettedense oplvadopacity with indistinctbordersrounded opacityTop Continuous Featuresconstdense opopacity with indistinct borderslobar opacity✔✗ alveolar filling processconsolidationdense op air filling with pus water bloodrounded cardiac apexnormalnormal cardiac silhouetteTop Decision-Impacting Features (Pneumonia)
http://arxiv.org/abs/2302.12341v1
2023-02-23T21:19:23
2023-02-23T21:19:23
Rank-Based Causal Discovery for Post-Nonlinear Models
Learning causal relationships from empirical observations is a central task in scientific research. A common method is to employ structural causal models that postulate noisy functional relations among a set of interacting variables. To ensure unique identifiability of causal directions, researchers consider restricted subclasses of structural causal models. Post-nonlinear (PNL) causal models constitute one of the most flexible options for such restricted subclasses, containing in particular the popular additive noise models as a further subclass. However, learning PNL models is not well studied beyond the bivariate case. The existing methods learn non-linear functional relations by minimizing residual dependencies and subsequently test independence from residuals to determine causal orientations. However, these methods can be prone to overfitting and, thus, difficult to tune appropriately in practice. As an alternative, we propose a new approach for PNL causal discovery that uses rank-based methods to estimate the functional parameters. This new approach exploits natural invariances of PNL models and disentangles the estimation of the non-linear functions from the independence tests used to find causal orientations. We prove consistency of our method and validate our results in numerical experiments.
[ "Grigor Keropyan", "David Strieder", "Mathias Drton" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12341v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12341v1", "@rel": "related", "@type": "application/pdf" } ]
[ "PMLR 206:7849-7870, 2023" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG", "stat.ME", "62H22, 62D20" ]
Rank-Based Causal Discovery for Post-Nonlinear Models Grigor Keropyan Technical University of Munich David Strieder Technical University of Munich Munich Center for Machine Learning Mathias Drton Technical University of Munich Munich Center for Machine Learning 3 2 0 2 b e F 3 2 ] L M . t a t s [ 1 v 1 4 3 2 1 . 2 0 3 2 : v i X r a Abstract Learning causal relationships from empirical ob- servations is a central task in scientific research. A common method is to employ structural causal models that postulate noisy functional relations among a set of interacting variables. To ensure unique identifiability of causal directions, re- searchers consider restricted subclasses of struc- tural causal models. Post-nonlinear (PNL) causal models constitute one of the most flexible options for such restricted subclasses, containing in par- ticular the popular additive noise models as a fur- ther subclass. However, learning PNL models is not well studied beyond the bivariate case. The existing methods learn non-linear functional re- lations by minimizing residual dependencies and subsequently test independence from residuals to determine causal orientations. However, these methods can be prone to overfitting and, thus, difficult to tune appropriately in practice. As an alternative, we propose a new approach for PNL causal discovery that uses rank-based methods to estimate the functional parameters. This new ap- proach exploits natural invariances of PNL mod- els and disentangles the estimation of the non- linear functions from the independence tests used to find causal orientations. We prove consistency of our method and validate our results in numer- ical experiments. 1 INTRODUCTION Discovering the causal structure of complex systems is an important question in various disciplines such as biology, economics, clinical medicine, or neuroscience (Opgen- Rhein and Strimmer, 2007; Glymour et al., 2019; Moneta Proceedings of the 26th International Conference on Artificial Intelligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). et al., 2013). The gold standard approach to exploration of causal relations is to perform controlled experiments in which researchers externally intervene in the system and observe the resulting changes to variables of interest. How- ever, in many applications controlled experiments are not In such feasible due to high cost or for ethical reasons. cases, causal discovery based on only observational data can be a useful tool (Spirtes and Zhang, 2016). A common tool for modeling causal relations are Structural In their general form, SEMs Equation Models (SEMs). postulate noisy functional relationships between a set of interacting variables. In the fully general setting, causal discovery methods such as constraint-based and score- based methods can identify the underlying causal struc- ture only up to Markov equivalence classes (Spirtes et al., 2000). Thus, the literature has also considered many re- stricted subclasses that enable unique identification (Dr- ton et al., 2011; Hoyer et al., 2008; Peters et al., 2014; Zhang and Hyv ̈arinen, 2009). In this realm, post-nonlinear (PNL) causal models constitute one of the most general ap- proaches. They are identifiable from the joint distribution under mild assumptions (Zhang and Hyv ̈arinen, 2009; Pe- ters et al., 2014) and yet offer a rather flexible framework for modeling complex non-linear causal systems. Existing methods for bivariate PNL causal discovery are based on estimating the functional relations by minimizing independence criteria (HSIC, mutual information, etc.) be- tween the noise and potential parents in a first step, and per- forming independence tests to determine the causal struc- ture in a second step (Zhang and Hyv ̈arinen, 2009; Ue- mura and Shimizu, 2020). However, minimizing depen- dence to subsequently test for independence leads to poten- tial overfitting and thus limits the PNL approach. Another approach considered by Tu et al. (2022) employs Optimal Transport theory for bivariate post-nonlinear and additive noise causal discovery, but it is not evident how to general- ize their method to multivariate models. To our knowledge the only work that deals with multivariate PNL models is Uemura et al. (2022), where the authors generalize the bi- variate method from Uemura and Shimizu (2020) based on minimizing dependence and subsequently testing for inde- pendence. Rank-Based Causal Discovery for Post-Nonlinear Models 2 In this article we present a new method for multivariate causal discovery in PNL models that disentangles the two tasks of learning the functional relations and learning the causal structure. Our method continues to learn the latter with the help of independence tests, but it employs rank- based methods to learn the functional relations and, in this way, avoids overfitting issues. The remainder of the paper is organized as follows. In Section 2 we introduce the PNL rank regression methods that we use to learn the functional relations. We study the special case of linearity in the inner function and show consistency of our proposed rank-based functional param- eter estimates. This special case includes general nonlinear functions using basis expansions. In Section 3 we discuss the causal order learning routine using our proposed rank- based estimates in a recursive process that finds sink nodes by independence testing. Furthermore, we show consis- tency of the causal order estimation for PNL models and present the results of a simulation study in Section 4, where we compare our method to existing causal learning meth- ods. Section 5 concludes the paper. 2 PNL RANK REGRESSION In this section we introduce the rank-based estimators that we use in the first step of our proposed causal learning al- gorithm. The goal is to employ these rank-based estimators to infer the functional relations among the variables and to obtain estimates of the stochastic noise terms in the model. In the second step, we use the estimated noise terms to test for independence. Suppose we observe a sample of n independent copies (X1, Y1), . . . , (Xn, Yn) of a random vector (X, Y ). We assume the data generating process follows a PNL model, that is, the response variable Y ∈ R is given by h(Y ) = g(X) + ε, (1) where X ∈ Rm is a continuous random vector and the stochastic error term ε has mean zero with unknown con- tinuous distribution, independent of X. Furthermore, we assume that the function h : R → R is continuous and strictly increasing (thus, invertible) whereas g : Rm → R may be an arbitrary function. Under similar assumptions, Zhang and Hyv ̈arinen (2009) suggested to estimate the noise ε = h(Y ) − g(X) by repre- senting h and g with Multi-layer Perceptrons (MLPs) and minimizing mutual information with X via gradient-based methods. However, the main drawback of their methodol- ogy is that this model can fit perfectly to any data by learn- ing constant functions h and g. The estimated noise will be constant and thus always independent from X. To overcome this problem Uemura and Shimizu (2020) implemented an additional auto-encoding structure in the minimization problem that enforces invertibility of the function h. While this circumvents the problem of con- stant estimation of the function h, there are further chal- lenges that arise from minimizing dependence and subse- quent testing for independence. Indeed, the complexity of the function class assumed for g needs to be balanced very carefully with the available sample size. Otherwise, g can be fitted perfectly such that g(X) = h(Y ), in which case the functional estimates cancel and the estimated noise is always independent of X. Uemura and Shimizu (2020) used a fixed architecture for the function classes of g and h. As a result, especially for small sample sizes (compared to the complexity of the function class of g), their method is prone to overfitting and canceling the effect of the func- tion h. Such overfitting may then entail erroneous results in independence tests for causal structure learning. To avoid the noted overfitting issues, we propose the fol- lowing two-stage method to learn the functional relations. In the first stage, we leverage rank statistics to separately estimate the function g, without any appeal to measures of dependence between the noise and the predictor X. The strictly increasing function h preserves the ranks of Y and thus, using rank-based methods, we can avoid estimating h at this stage. This circumvents the problem of g matching h. In the second step, we estimate the functional relation h at all observed data points to obtain the required estimates of the noise. In order to simplify the concept and a theoretical analysis of our proposed method, we assume in the following linearity of the function g, i.e. g(X) = X T β0 for β0 ∈ Rm. This can also be seen as a first order Taylor approximation of an arbitrary functional relation. Remark 2.1. Our framework and the idea of disentan- gling learning and testing by employing rank-based objec- tive functions can be easily extended to the nonlinear case. By employing basis expansions, MLPs or any paramet- ric function class in combination with the proposed rank- based scores to learn the functional relations one can trace the steps of the presented linear case. For instance, con- sider the basis functions {bl(*) : l = 1, . . . , an}, where an → ∞ sufficiently slowly, similar to B ̈uhlmann et al. (2014). Then we can represent the (nonlinear) function g by (cid:80)an l=1 αlbl(*), where αl ∈ R for all l = 1, . . . , an, and employ our proposed framework. The simulations in Sec- tion 4 include an example. We start by studying the special case of model (1) under the assumption of Gaussian noise and derive a computationally efficient algorithm for estimating the functional parame- ters. Further, in Subsection 2.2 we consider the general case without restricting the noise distribution. The main idea of our approach is to leverage rank likelihoods, how- ever, using the full marginal rank likelihood is not computa- tionally tractable. A common approach to circumvent cal- culating the full marginal rank likelihood is to employ ap- Grigor Keropyan, David Strieder, Mathias Drton 3 proximate Monte Carlo methods, e.g., considered by Dok- sum (1987). However, we observed that this approach does not work well in practice for values of β0 larger than one. Thus, in our proposed framework we employ pairwise rank likelihoods to approximate the full marginal rank likeli- hood (in the Gaussian case) or the rank correlation function (in the general noise case). 2.1 Gaussian Case We assume that the data generating process follows the model h(Y ) = X T β0 + ε, (2) with some unknown β0 ∈ Rm. Furthermore, we assume that the noise ε is standard normal distributed and propose the following computationally fast algorithm to estimate the functional relations. The idea of this method is based on Yu et al. (2021). We exploit the fact that h is a strictly increasing function and therefore preserves the ranks of {Yi}n i=1. The normal- ity assumption yields εi − εj ∼ N (0, 2) and we obtain P(Yj > Yi|Xj, Xi) = P(h(Yj) > h(Yi)|Xj, Xi) = P(εi − εj < (Xj − Xi)T β0|Xj, Xi) (cid:17) (cid:16) (Xj −Xi)T β0 √ = Φ , 2 where Φ is the cumulative distribution function of the stan- dard normal distribution. The normalized log pairwise rank likelihood function is then given by (cid:96)prl(β) := (cid:18)n 2 (cid:19)−1 (cid:88) i<j 1{Yj > Yi} log Φ (cid:16) (Xj −Xi)T β √ 2 (cid:17) + 1{Yj ≤ Yi} log Φ (cid:16) (Xi−Xj )T β √ 2 (cid:17) . (3) We estimate β0 by maximizing (cid:96)prl, that is, ˆβprl := arg max β∈Rm (cid:96)prl(β). This defines a concave optimization problem, which leads to a computationally fast estimation routine for β0 without precise knowledge or estimation of the function h. Proposition 2.1. The log pairwise rank likelihood function (cid:96)prl(β) defined in (3) is concave. Moreover, if we assume that n > m, then (cid:96)prl(β) is strictly concave. The proof can be found in Appendix B. Furthermore, the proposed estimator is consistent. Theorem 2.1. As n → ∞ (and in particular n > m), it holds that ˆβprl − β0 = oP (1). For a proof we refer the reader to Appendix C. In order to obtain an estimate of the noise, we estimate the transformation function h in a second step. We employ the following computationally fast and consistent estima- tion routine proposed by Cuzick (1988). In his proposal, Cuzick (1988) considers non-random covariates, however, the results are applicable to our setup conditional on the observed data {Xi}n i=1. The method exploits the normality assumption as well as knowledge of the ranks of {Yi}n i=1 and thus of {h(Yi)}n Let ˆF (z) be the adjusted empirical distribution function of Zi := h(Yi), that is i=1. ˆF (z) := 1 n + 1 n (cid:88) i=1 1{Zi ≤ z}. Remark 2.2. Note that we only require the ranks of i=1 to obtain the estimate ˆF (h(Yi)). Since h is {h(Yi)}n a strictly increasing function, the ranks of {h(Yi)}n i=1 are given by the ranks of {Yi}n i=1. We denote the cumulative distribution function of a ran- domly chosen Zi by Fβ(z), that is Fβ(z) := 1 n n (cid:88) i=1 Φ(z − X T i β). (4) Then an estimator for the functional relation h at the sample points {Yi}n i=1 is given by ˆhG(Yi) := F −1 ˆβprl ( ˆF (h(Yi))), i = 1, . . . , n. (5) By extending this estimator to a step function on R, and un- der some additional assumptions, Cuzick (1988) show that this estimator converges to h almost surely at all continuity points of the function h. Remark 2.3. In our setup, we assume h is continuous. Furthermore, the additional assumptions that ensure con- sistency in the setting from Cuzick (1988) are mainly smoothness and moment conditions on the distributions of X and ε. In the considered Gaussian setting most of them are already satisfied. For a detailed list of the assumptions, we refer the reader to Appendix A. 2.2 General Case The problem of estimating the parameter β0 without ad- ditional assumptions on the distribution of the noise in model (2) is extensively studied in the literature, see i.e. Doksum (1987); Han (1987); Sherman (1993); Abrevaya (1999a,b, 2003); Cavanagh and Sherman (1998); Zhang (2013). Without any restriction on expectation or variance of the noise the function h is not unique, since it can be re- placed by location or scale transformations. Thus, to ensure unique identification, we assume that there exists a known Rank-Based Causal Discovery for Post-Nonlinear Models 4 y0 such that h(y0) = 0 and we scale the last element of β0 to 1, that is, β0 = (θ0, 1). To simplify the optimization, we employ a method intro- duced by Lin and Peng (2013) that utilizes the rank-based objective function S(β) := (cid:19)−1 (cid:18)n 2 (cid:88) i<j 1{Yj > Yi}Φ (cid:0)√ (cid:16) n(Xj − Xi)T β(cid:1) + 1{Yj ≤ Yi}Φ (cid:0)√ n(Xi − Xj)T β(cid:1) (cid:17) . Remark 2.4. Lin and Peng (2013) used the assumption (cid:107)β0(cid:107)2 = 1 to ensure unique identification, which is equiv- alent to our assumption β0 = (θ0, 1) up to rescaling. To obtain a sparse solution the authors focused on a penal- ized version of S(β). However, as we are only interested in estimating the residuals and do not necessarily need spar- sity, we adapted their analysis for the following simplified non-penalized estimator ˆβ := (ˆθ, 1), where ˆθ := arg max θ∈Rm−1 S(θ, 1), by setting their penalty term to zero. Under some additional assumptions that mainly ensure smoothness of the distributions of X and ε, Lin and Peng (2013) prove the existence of a local maximizer ˆθ of S(θ, 1) with (cid:13) ˆθ − θ0 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 = OP (cid:16) n− 1 2 (cid:17) and, thus, ˆβ defines a consistent estimator for β0. This es- timator uses only the rank information without requiring concrete knowledge of h. A detailed list of the additional assumptions that ensure consistency can be found in Ap- pendix A. In a second step we estimate the function h in order to subsequently obtain an estimate of the noise. We used the method introduced in Chen (2002) based on the rank cor- relation. To simplify the complex optimization of discrete objective functions, we employ a smoothed version intro- duced by Zhang (2013). The smoothed rank correlation objective function is defined by Q(z, y, ˆβ) := 1 n(n − 1) (cid:88) [(djy − diy0) i(cid:54)=j √ × Φ( n((Xj − Xi)T ˆβ − z))], where djy := 1(Yj ≥ y) and diy0 := 1(Yi ≥ y0). Then we define an estimator of the function h at y via ˆh(y) := arg max Q(z, y, ˆβ) , (6) z∈Ωh where Ωh is an appropriate compact set. √ In Theorem 4.1, Zhang (2013) establish consistency of the proposed estimator for h under a few assumptions, that in- n-consistency of the involved estimator ˆβ and strict clude monotonicity of the function h, as well as some additional regularity assumptions. A detailed list of the additional as- sumptions can be found in Appendix A. Without restricting the optimization space by Ωh the prob- lem (6) is ill-posed in the sense that ˆh(y) → ∞ for y = max{Yi}n i=1. To circumvent the issue of choosing a proper compact set Ωh, we added an L2 regularization term and optimized over R, that is, i=1 and ˆh(y) → −∞ for y = min{Yi}n ˆh(y) := arg max z∈R {Q(z, y, ˆβ) − λz2}. In the experiments we used the regularization parameter λ = 10−3, which turned out to be small enough to not af- fect the estimated values significantly and at the same time bounded the objective function for the observed extremes. 3 LEARNING PNL MODELS By combining the previously introduced rank-based esti- mators of the functional relations in PNL models we obtain estimates of the stochastic error terms. Using these rank- based estimated error terms, we propose a routine to learn the underlying causal structure by recursively identifying sink nodes via independence testing. Further, we show that our proposed routine consistently recovers a valid causal ordering under identifiability assumptions. Suppose we observe data in form of n indepen- dent copies X1, . . . , Xn from a random vector X := (X (1), . . . , X (m)). We assume that X follows a PNL causal model, that is, the data generating process is defined by the structural equations X (k) = f (k) (cid:16) X (PAk)(cid:17) k = 1, . . . , m, + ε(k)(cid:17) g(k) (cid:16) , where PAk, called the parents of X (k), are a subset of {1, . . . , m}\{k}. The causal perspective stems from view- ing those equations as making assignments. Each vari- able on the left-hand side is assigned the value specified on the right-hand side, given by the value of its parents and a stochastic error term. The causal structure inherent in such structural equations is naturally represented by a directed graph G0, where edges indicate which other vari- ables each variable causally depends upon. As in related work, we assume the corresponding directed graph to be acyclic (DAG). The noise variables {ε(k)}m k=1 are assumed to be mutually independent and ε(k) ⊥⊥ X (PAk) for each k = 1, . . . , m. The main ansatz for inferring the causal structure is to leverage the independence structure of the stochastic noise ε(k) and a correctly specified parent set, that is, ε(k) is independent of all X (j) that precede X (k) in at least one true causal ordering of the underlying graph. Grigor Keropyan, David Strieder, Mathias Drton 5 We focus on inferring the causal ordering to reduce the computational burden, however, the framework can easily be adapted to infer the specific causal graph structure by pruning redundant edges. The causal ordering of a graph G0 is given by a permutation π of {1, . . . , m}, such that, if there exists a directed edge from node π(i) to node π(j) in the graph then i < j. We emphasize that the causal or- dering for a given graph is not necessarily unique but each causal ordering π corresponds to a unique, fully connected DAG Gπ, where Gπ has a directed edge from node π(i) to node π(j) if and only if i < j. Thus, similar to B ̈uhlmann et al. (2014), we can define the set of true causal orderings Π0 for any DAG G0 as the set of all causal orderings π that correspond to fully connected DAGs Gπ which contain G0 as a sub-graph, that is Π0 := {π : Gπ is a super-graph of G0}. Remark 3.1. In general Π0 contains more than one ele- ment and all elements correspond to valid causal orderings of the DAG G0 (e.g. in the extreme case of an empty graph, all permutations are true causal orderings). In order to apply the previously introduced rank-based re- gression methods, we assume that all functions f (k) in the data generating PNL causal model are continuous and strictly increasing, and thus, we can define their inverse via h(k) := (f (k))−1. Further, we assume that all g(k) are lin- ear and the distribution of every stochastic error ε(k) is as- sumed to be continuous. We emphasize again, our method is applicable to nonlinear functional relations by means of basis expansions. Put together, each structural equation, i.e. each cause-effect relation, corresponds to a PNL regression model (1) as in- troduced in the previous section. That is, the data generat- ing process follows X (k)(cid:17) h(k) (cid:16) X (NDk)(cid:17)T k = 1, . . . , m, β(k) + ε(k), = (cid:16) where the non-descendants NDk are given by all nodes that precede node k in at least one true causal ordering and ε(k) is independent of X (NDk). Note that the entries in β(k) which do not correspond to parents of node k are simply zero. To leverage the independence ε(k) ⊥⊥ X (NDk), we define X (−k) := (X (1), . . . , X (k−1), X (k+1), . . . , X (m)). For every sink node k in the graph, we have NDk = {1, . . . , m}\{k}, and, thus, for every sink node k the noise ε(k) is independent of X (−k). Moreover, if node k is not a sink node in the graph, then the noise ε(k) is not inde- pendent of X (−k), since X (−k) contains at least one child of k. Thus, we can recursively identify a sink node using the HSIC (Gretton et al., 2005) measure of independence between the estimated noise ˆε(k) and the remaining nodes X (−k). We propose the following routine to learn one of the valid causal orderings of the graph. First, we utilize the rank- based estimators ˆh(k) and ˆβ(k), introduced in the previous section, and estimate the noise via ˆε(k) j := ˆh(k) (cid:16) X (k) j (cid:17) (cid:16) − X (−k) j (cid:17)T ˆβ(k), j = 1, . . . , n. We repeat this noise estimation for all remaining nodes k ∈ {1, . . . , m} and subsequently calculate the HSIC test statistic between the estimated noises and the observed val- ues of the remaining nodes X (−k), that is tk := HSIC({X (−k) j , ˆε(k) j }n j=1), k = 1, . . . , m. We determine the node which leads to the minimal test statistic as a sink node, that is, our proposed sink node es- timator is defined by ˆπ(m) := arg min k {tk} . In the next step we remove ˆπ(m) from the set {1, . . . , m} and repeat the sink node identification procedure to esti- mate ˆπ(m − 1). Thus, recursively we obtain an estimate for the causal ordering ˆπ = (ˆπ(1), . . . , ˆπ(m)). In the following Theorem we prove consistency of our pro- posed estimation routine for the causal ordering. It is clear that if at any step our method fails to correctly identify a remaining sink node, then it fails to estimate a valid causal ordering. Thus, we must require sink node identifiability from the joint distribution in order to ensure consistency of the estimated causal order. The following assumption (A) formalizes this intuition. (A) For each k ∈ [1, m] and A ⊂ [1, m] \ {k} that contains at least one child of X (k) as well as for all strictly increas- ing, continuous functions h : R → R and for all β ∈ R|A|, there exists a constant ξ > 0, such that HSIC (cid:16) PN,X (A)(cid:17) > ξ, where N := h (cid:16) X (k)(cid:17) − (cid:16) X (A)(cid:17)T β. Theorem 3.1. Under assumption (A) and consistency of the employed estimators ˆh(k) and ˆβ(k) we have P(ˆπ ∈ Π0) → 1 as n → ∞. The proof can be found in Appendix D. Remark 3.2. Location and scale transformations of the noise variables can be matched by transformations in the functions h(k), however, these transformations do not change the dependence structure and thus without loss of generality, we can assume that the location and scale as- sumptions in Section 2 are satisfied. Rank-Based Causal Discovery for Post-Nonlinear Models 6 4 SIMULATIONS In this section we present the results of a simulation study with the aim to compare the performance of our algorithm to existing causal learning methods on various simulated data sets and validate the consistency results experimen- tally. If necessary in the specific application, our method can be easily extended to infer the full causal graph struc- ture, however, this vastly increases the computation time, similar to the related existing methods. Since the main dif- ferences of the algorithms already come into play during the causal order estimation procedure, we compared the performance on this task alone. Our experiments were de- signed as follows. We randomly sampled a causal structure with m (m = 4 and m = 7) nodes from Erd ̋os–R ́enyi di- m−1 . Thus, the rected acyclic graphs with edge probability expected total number of edges in the graph is m. We gen- erated data according to the corresponding post-nonlinear model using the following structural relations 2 X (k) = (cid:16) (cid:88) j∈PAk β1jX (j) + β2j(X (j))2 + εk (cid:17)1/3 for k = 1, . . . , m, with different noise distributions (stan- dard Normal N (0, 1), standard Gumbel Gumbel(0, 1) or standard Logistic Logistic(0, 1)). Further, β1j and β2j are sampled from a uniform distribution with either a low range from −10 to 10, representing a weak signal setting (low signal-to-noise ratio (SNR)), or a higher range from −100 to 100, representing a strong signal setting (high SNR). Remark 4.1. We highlight that the inner function g(k) is quadratic in the parents of X (k). In the experiments, we used polynomial basis expansions of order two to linearly model the inner function by specifying not only parents but also their squares. Using this process, we generated 100 independent data sets and estimated the causal ordering. We compared our re- sults with the classical RESIT method for additive noise models (Peters et al., 2014) and the AbPNL method for post-nonlinear models (Uemura et al., 2022) restricted to the respective causal order estimation parts. The causal or- dering of a given DAG is not necessarily unique, thus, as a measure of performance for an estimated causal ordering ˆπ we report the number of directed edges ˆπ(i) → ˆπ(j) in the true graph G with j < i, that is #{(i, j) : ˆπ(i) → ˆπ(j) ∈ G and j < i}. This measure equals zero when ˆπ is a valid causal ordering and achieves its maximum, the number of edges in G, when ˆπ is a reversed causal ordering. Figure 1 shows the performance of the Gaussian method introduced in Subsection 2.1, named RankG, compared to RESIT and AbPNL on 4- and 7-dimensional causal graphs in settings with Gaussian, Gumbel (standard extreme value distribution) and Logistic noise. Dashed lines indicate the weak signal setting and solid lines depict the strong signal setting. We plot the mean of our performance measure, the number of wrongly oriented edges in the fully connected DAG corresponding to the estimated causal ordering, over all 100 data sets against the sample size. Our proposed RankG method outperforms the competition in almost all considered settings, especially in the low SNR setting. We emphasize that it might seem counterintuitive that the RankG method performs better in a low SNR set- ting than in a high SNR setting, however, the noise drives the identification in the rank-based learning procedure in PNL models. Thus, higher noise in comparison to the sig- nal strengths induces more changes in the ranks that propa- gate through the graph, and thus, better performance of the rank-based estimation methods. Furthermore, in the low SNR setting our computational results support the theoretical consistency results and our method seems to recover a valid causal ordering even in moderate sample sizes. The results in Figure 1 display that even under noise mis- specification, that is, in the Gumbel and Logistic noise cases, the RankG method performs best. This might in- dicate some robustness of our proposed method for causal order estimation, even though we do not recover the true noise under misspecification (see Figure 6). We conducted similar experiments to compare the perfor- mance of our proposed general method introduced in Sub- section 2.2, named RankS, however with lower sample sizes for computational reasons. Figure 2 shows the results of the different competitors RankS, RankG, RESIT and AbPNL for 4-dimensional graphs with Gaussian, Gumbel and Logistic noise. Our proposed method RankS performs best in all considered sample sizes and all noise cases, ex- cept for the weak signal settings where RankG performs better. This might stem from the fact that the pairwise rank likelihood used in RankG better approximates the marginal rank likelihood. In additional experiments, we investigated the behavior of the introduced methods for more complex functional rela- tions g, namely a polynomial of degree 4. Similar to the experiments before, we sampled data from Erd ̋os–R ́enyi DAGs, however, with the structural relations X (k) = (cid:16) (cid:88) β1jX (j) + β2j(X (j))2 j∈PAk + β3j(X (j))3 + β4j(X (j))4 + εk (cid:17)1/3 for k = 1, . . . , m, with different noise distributions and β1j, β2j, β3j and β4j sampled with low or high SNR. Fig- ure 3 shows the resulting mean performance measures for the different methods RankS, RankG, RESIT and AbPNL over 100 data sets. As expected, the task becomes more Grigor Keropyan, David Strieder, Mathias Drton 7 Figure 1: Performance of RankG, AbPNL and RESIT causal order estimation methods in different dimensions (4,7) against sample size. Figure 2: Performance of RankS, RankG, AbPNL and RESIT causal order estimation methods in dimension 4 against sample size. GaussianGumbelLogistic4 nodes7 nodes500100015002000500100015002000500100015002000012340246sample sizeerrorMethodsRankGAbPNLRESITSignalweakstrongGaussianGumbelLogistic1001502002503001001502002503001001502002503001234sample sizeerrorMethodsRankSRankGAbPNLRESITSignalweakstrong Rank-Based Causal Discovery for Post-Nonlinear Models 8 Figure 3: Performance of RankS, RankG, AbPNL and RESIT causal order estimation methods in dimension 4 against sample size, where function g is 4 degree polynomial. challenging by increasing the complexity of the functional parameters, since it is difficult to estimate the functional re- lations in the first place. However, even in the considered low sample sizes, our proposed RankS method seems to detect some causal structure and outperform the competi- tion. Further, we analysed the behaviour of the used functional estimators introduced in Section 2 by performing the fol- lowing experiments. We generated 100 independent data sets of sample size 500 according to model (2) with a 3- dimensional predictor X, standard Gaussian or Gumbel noise, cubic function h(y) = y3 and linear parameters β0 = (10, 5, 1). Then we estimated the functional param- eter β0 and the function h with the introduced rank-based methods. Figure 4 shows the estimation of the function h for one rep- resentative result across the 100 replications. The red lines indicate the true value of the function h, while the black dots indicate the pointwise estimates. We notice that the es- timation of the function h with the rank-based method that relies on the normality assumption (used in RankG) fails to correctly estimate the functional relation at extremes under Gumbel noise. This is due to the misspecified tail proba- bility structure. In contrast, the general estimation method employed in RankS is not influenced by the specific under- lying noise distribution. However, in the Gaussian noise case we notice small estimation bias, which can be regu- lated with the hyperparameter λ in the estimation proce- dure. Further, from the results across all 100 data sets, we noticed that the variance of the functional estimate across the data sets is higher using the general estimation methods in RankS. Figure 5 shows the estimation of the first two entries of β0. Recall that in the general RankS method we fixed the last entry in our estimation of β0. The box plots show the esti- mated values of β0 across the 100 data sets and red dots in- dicate the true values. We see again that RankG estimates the parameter β0 with a bias in the misspecified Gumbel noise setting, similar to the estimation of the function h. However, in the Gaussian setting the RankG method es- timation of β0 has a lower variance than RankS and in all other cases the median estimate corresponds to the true value. Figure 4: Estimation of the function h. Figure 6 shows the estimated noise by combining both es- timation results. We plot the estimated noise against the true values for one representative data set (similar to Fig- GaussianGumbelLogistic100150200250300100150200250300100150200250300123sample sizeerrorMethodsRankSRankGAbPNLRESITSignalweakstrongGaussianGumbelRankGRankS−202−202−2502550−2502550yh(y) Grigor Keropyan, David Strieder, Mathias Drton 9 proposed routine is less susceptible to overfitting issues ex- hibited by the existing methods that rely on minimizing de- pendence and subsequently testing for independence. We introduced PNL rank regression methods to learn the functional relations in PNL models and subsequently es- timate the residuals. As a special case, we first consid- ered Gaussian noise and used pairwise rank likelihoods in a computationally fast algorithm, whereas, for the gen- eral noise case, we employed a smoothed version of rank correlations to obtain estimates of the functional relations. While our presentation focused on linearity in the inner functional relation to simplify the theoretical analysis, the framework includes nonlinear relations by means of basis expansions. Employing the introduced estimators of the functional relations, we proposed a causal learning routine to recursively identify sink nodes based on independence tests with the estimated residuals. Further, we prove con- sistent causal order recovery of our proposed routine un- der identifiability assumptions and consistency of the em- ployed functional estimators. We validated our theoretical findings in a simulation study that showed that our proposed routine outperforms the competition and is able to recover a valid causal ordering even in moderate sample sizes. Acknowledgements This project has received funding from the European Re- search Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No. 83818), the German Federal Ministry of Education and Research, and the Bavarian State Ministry for Science and the Arts. The authors of this work take full responsibility for its content. References Abrevaya, J. (1999a). Computation of the maximum rank correlation estimator. Economics Letters, 62(3):279– 285. Abrevaya, J. (1999b). Leapfrog estimation of a fixed- effects model with unknown transformation of the de- pendent variable. Journal of Econometrics, 93(2):203– 228. Abrevaya, J. (2003). Pairwise-difference rank estimation of the transformation model. Journal of Business & Eco- nomic Statistics, 21(3):437–447. B ̈uhlmann, P., Peters, J., and Ernest, J. (2014). CAM: Causal additive models, high-dimensional order search The Annals of Statistics, and penalized regression. 42(6):2526 – 2556. Cavanagh, C. L. and Sherman, R. P. (1998). Rank estima- tors for monotonic index models. Journal of Economet- rics, 84:351–381. Figure 5: Estimation of β0. Figure 6: Estimation of the noise ε. ure 4). Red lines correspond to a perfect estimation. The RankG method inherits the behaviour from both estima- tion parts and fails to correctly estimate the extreme noise cases. However, it outperforms the RankS method in the Gaussian setting. 5 CONCLUSION We proposed a new routine for causal discovery in mul- tivariate post-nonlinear structural equation models. Our method disentangles the two tasks of estimating the func- tional relations and learning the causal structure by em- ploying rank-based methods for the first task. Thus, our GaussianGumbelRankGRankSb0(1)b0(2)b0(1)b0(2)5101551015b0GaussianGumbelRankGRankS−20246−20246−8−404−8−404true noiseestimated noise Rank-Based Causal Discovery for Post-Nonlinear Models 10 Chen, S. (2002). Rank estimation of transformation mod- els. Econometrica, 70(4):1683–1697. Spirtes, P., Glymour, C., and Scheines, R. (2000). Causa- tion, Prediction, and Search. MIT press, 2nd edition. Spirtes, P. and Zhang, K. (2016). Causal discovery and in- ference: concepts and recent methodological advances. Applied Informatics. Teran Hidalgo, S. J., Wu, M. C., Engel, S. M., and Kosorok, M. R. (2018). Goodness-of-fit test for nonparametric regression models: Smoothing spline anova models as example. Computational Statistics & Data Analysis, 122:135–155. Tu, R., Zhang, K., Kjellstrom, H., and Zhang, C. (2022). Optimal transport for causal discovery. In International Conference on Learning Representations. Uemura, K. and Shimizu, S. (2020). Estimation of post- nonlinear causal models using autoencoding structure. In ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3312–3316. Uemura, K., Takagi, T., Takayuki, K., Yoshida, H., and Shimizu, S. (2022). A multivariate causal discovery based on post-nonlinear model. In First Conference on Causal Learning and Reasoning. Yu, T., Li, P., Chen, B., Yuan, A., and Qin, J. (2021). Max- imum pairwise-rank-likelihood-based inference for the semiparametric transformation model. arXiv e-prints, page arXiv:2103.13435. Zhang, J. (2013). Estimation and testing methods for monotone transformation models. PhD thesis, Columbia University. Zhang, K. and Hyv ̈arinen, A. (2009). On the identifiabil- ity of the post-nonlinear causal model. UAI'09, page 647–655. Cuzick, J. (1988). Rank regression. The Annals of Statis- tics, 16(4):1369–1389. Doksum, K. A. (1987). An Extension of Partial Likeli- hood Methods for Proportional Hazard Models to Gen- eral Transformation Models. The Annals of Statistics, 15(1):325 – 345. Drton, M., Foygel, R., and Sullivant, S. (2011). Global identifiability of linear structural equation models. The Annals of Statistics, 39(2):865 – 886. Glymour, C., Zhang, K., , and Spirtes, P. (2019). Review of causal discovery methods based on graphical models. Front. Genet. Gretton, A., Bousquet, O., Smola, A., and Sch ̈olkopf, B. (2005). Measuring statistical dependence with hilbert- schmidt norms. In Proceedings of the 16th International Conference on Algorithmic Learning Theory, ALT'05, page 63–77, Berlin, Heidelberg. Springer-Verlag. Han, A. K. (1987). Non-parametric analysis of a general- ized regression model: The maximum rank correlation estimator. Journal of Econometrics, 35(2):303–316. Hoyer, P., Janzing, D., Mooij, J. M., Peters, J., and Sch ̈olkopf, B. (2008). Nonlinear causal discovery with additive noise models. In Advances in Neural Informa- tion Processing Systems, volume 21. Curran Associates, Inc. Lin, H. and Peng, H. (2013). Smoothed rank correlation of the linear transformation regression model. Computa- tional Statistics & Data Analysis, 57(1):615–630. Moneta, A., Entner, D., Hoyer, P. O., and Coad, A. (2013). Causal Inference by Independent Component Analysis: Theory and Applications. Oxford Bulletin of Economics and Statistics, 75(5):705–730. Okamoto, M. (1973). Distinctness of the eigenvalues of a quadratic form in a multivariate sample. The Annals of Statistics, 1(4):763–765. Opgen-Rhein, R. and Strimmer, K. (2007). From correla- tion to causation networks: a simple approximate learn- ing algorithm and its application to high-dimensional plant gene expression data. BMC Systems Biology. Peters, J., Mooij, J. M., Janzing, D., and Sch ̈olkopf, B. (2014). Causal discovery with continuous additive noise models. Journal of Machine Learning Research, 15(58):2009–2053. Serfling, R. J. (1980). Approximation Theorems of Mathe- matical Statistics. John Wiley and Sons. Sherman, R. P. (1993). The limiting distribution of the maximum rank correlation estimator. Econometrica, 61(1):123–137. Grigor Keropyan, David Strieder, Mathias Drton 11 A ADDITIONAL ASSUMPTIONS In this section, we list all additional assumptions that are mentioned in the main paper in detail. Cuzick (1988) employs the following 4 (additional) assumptions to ensure the consistency of ˆhG defined in (5). Thus, the following assumptions together with the modelling assumptions and assumption (A) in the main paper ensure the consistency of the proposed RankG method. AG1 Let Gn(x) := 1 n (cid:80)n j=1 1{Xj ≤ x}. Assume Zn has distribution Gn, then |Zn|t is uniformly integrable for some t which is specified in the next assumption (at least t > 4). AG2 For Fβ(z) defined in (4), there exists finite K such that F −1 β (u) + u(1 − u)(F −1 β (u))(cid:48) ≤ K ((u(1 − u)))α , ∀ u ∈ (0, 1), for all n and β ∈ B, where B is a neighborhood of β0 and α + t−1 < 1 2 . AG3 The function Z(β) := E[X|X T (β − β0) = 0] is L2 continuous as β → β0. AG4 The following inequality holds E[X(X − Z(β0)] > 0. The main assumptions above essentially correspond to moment conditions on the distribution of X. Following Lin and Peng (2013) (AS1-AS4) and Zhang (2013) (AS5-AS9), we list the additional assumptions that are required to ensure consistency of the estimators in Section 2.2. Thus, in combination with the modelling assumptions and assumption (A) in the main paper, the RankS method is consistent. AS1 Let g be the density function of (Xj − Xi)T β0 and F the distribution function of εj − εi. Define the functions Γ(s) := E[(Xj − Xi)T |(Xj − Xi)β 0 = s] and Ω(s) := F (s)Γ(s)g(s). Then Ω(cid:48)(0) is nonsingular. AS2 The density g is positive with a continuous second derivative on its corresponding compact support. AS3 The function F has a continuous second derivative on its corresponding support. AS4 The random variable X is bounded with a compact support. AS5 The true parameter θ0 is an interior point of a compact subset Θ ⊂ Rm−1. AS6 The support of X is not contained in a linear subspace of Rm. Moreover, conditional on the first m − 1 components of X, the last component of X has a density function with respect to the Lebesgue measure. AS7 Define and let τ (y, x, θ) := E[1{y > Y }1{(x − X)T (θT , 1)T > 0} + 1{y < Y }1{(x − X)T (θT , 1)T < 0}] |∇m|τ (y, x, θ) = (cid:88) i1,...,im (cid:12) (cid:12) (cid:12) (cid:12) ∂mτ (y, x, θ) ∂θi1 . . . ∂θim (cid:12) (cid:12) (cid:12) (cid:12) . There exists a neighborhood N of θ0 such that for each pair of (y, x) in the support of (Y, X) the following hold • The second derivatives of τ (y, x, θ) with respect to θ exist in N . • There exists an integrable function M (y, x) such that for all θ in N (cid:107)∇2τ (y, x, θ) − ∇2τ (y, x, θ0)(cid:107) ≤ M (y, x)|θ − θ0|. • E[(|∇1|τ (Y, X, θ0))2] < ∞. • E[|∇2|τ (Y, X, θ0)] < ∞. • The matrix E[∇2τ (Y, X, θ0)] is strictly negative definite. Rank-Based Causal Discovery for Post-Nonlinear Models 12 AS8 There exists (cid:15)∗ > 0 and y1, y2 in the support of Y such that [h(y1 − (cid:15)∗), h(y2 + (cid:15)∗)] is contained in a compact interval. AS9 For ω1 = (x1, y1), ω2 = (x2, y2) and W = (X, Y ) we define f z(ω1, ω2, z, y, β) := (1{y1 ≥ y} − 1{y2 ≥ y0})1{(x1 − x2)T β ≥ z}. Further, we define then τ (ω, z, y, β) := E[f z(ω, W, z, y, β) + f z(W, ω, z, y, β)], V z(y) := E (cid:20) ∂2τ (W, h(y), y, β0) ∂z2 (cid:21) is negative for each y ∈ [y1, y2] and uniformly bounded away from 0. Zhang (2013) show uniform consistency on the interval [y1, y2] defined in the assumptions AS8-AS9. B PROOF OF PROPOSITION 2.1 To prove Proposition 2.1 we employ the following two Lemmas. Lemma B.1. For all z ∈ R we have φ(cid:48)(z)Φ(z) − (φ(z))2 < 0, where Φ and φ denote the CDF and PDF of the standard normal distribution. Proof. With h(z) := φ(cid:48)(z)Φ(z) − (φ(z))2, we show that h(z) < 0. Substituting the derivative of φ we have h(z) = −zφ(z)Φ(z) − (φ(z))2 = φ(z)(−zΦ(z) − φ(z)). Since φ(z) > 0 for all z ∈ R it remains to show that g(z) := −zΦ(z) − φ(z) < 0. For z ≥ 0 this is clear. Thus we consider the case z < 0. We have for the derivative of g Therefore, g is a strictly decreasing function. The limit of g(z) for z → −∞ is given by g(cid:48)(z) = −Φ(z) − zφ(z) + zφ(z) = −Φ(z) < 0. lim z→−∞ g(z) = lim z→−∞ (−zΦ(z) − φ(z)) = − lim z→−∞ Φ(z) 1 z = lim z→−∞ φ(z) 1 z2 = lim z→−∞ 1 √ 2π z2 ez2/2 = 0, and the claim follows. Lemma B.2. The function f (x) := log Φ(cT x), x ∈ Rm is concave, where Φ is the CDF of the standard normal distribution and c ∈ Rm is a nonzero constant. Moreover, vT ∇2f (x)v = 0 for a vector v ∈ Rm and Hessian matrix ∇2f (x) if and only if vT c = 0. Proof. The function f is twice differentiable, and thus for the first part of the Lemma it is enough to show that the Hessian of f (x) is negative semi-definite. The gradient of f is given by ∇f (x) = φ(cT x) Φ(cT x) c, where φ is the PDF of the standard normal distribution. Thus, the Hessian is ∇2f (x) = φ(cid:48)(cT x)Φ(cT x) − (φ(cT x))2 (Φ(cT x))2 * ccT . Grigor Keropyan, David Strieder, Mathias Drton 13 So, for any v ∈ Rm we have vT ∇2f (x)v = vT φ(cid:48)(cT x)Φ(cT x) − (φ(cT x))2 (Φ(cT x))2 * ccT v = = φ(cid:48)(cT x)Φ(cT x) − (φ(cT x))2 (Φ(cT x))2 φ(cid:48)(cT x)Φ(cT x) − (φ(cT x))2 (Φ(cT x))2 * vT ccT v * (vT c)2 ≤ 0, where the last step follows from Lemma B.1 and the fact that (vT c)2 ≥ 0. Moreover, vT ∇2f (x)v = 0 if and only if vT c = 0, which completes the proof. Employing the Lemmas we can prove Proposition 2.1. Proof. From (3) we have (cid:96)prl(β) = (cid:18)n 2 (cid:19)−1 (cid:88) i<j 1(Yj > Yi) log Φ (cid:18) (Xj − Xi)T β √ 2 (cid:19) + 1(Yj ≤ Yi) log Φ (cid:18) (Xi − Xj)T β √ 2 (cid:19) . Thus, with Lemma B.2 we know that (cid:96)prl(β) is a sum of concave functions. Since sums preserve the concavity (cid:96)prl(β) is concave. We show strict concavity by contradiction and thus assume that (cid:96)prl(β) is not strictly concave. This implies that there exists a vector v such that vT ∇2(cid:96)prl(β)v = 0 for the Hessian matrix ∇2(cid:96)prl(β) of (cid:96)prl(β). The Hessian operator is linear, thus, ∇2(cid:96)prl(β) is a sum of Hessians, that is ∇2(cid:96)prl(β) = (cid:19)−1 (cid:18)n 2 (cid:88) i<j 1(Yj > Yi)∇2 log Φ (cid:18) (Xj − Xi)T β √ 2 (cid:19) + 1(Yj ≤ Yi)∇2 log Φ (cid:18) (Xi − Xj)T β √ 2 (cid:19) . (cid:16) (Xj −Xi)T β √ (cid:17) v = 0 if and only if vT (Xj − Xi) = 0. Since for each i, j, either one of Lemma B.2 gives that vT ∇2 log Φ 1(Yj > Yi) or 1(Yj ≤ Yi) is 1, vT ∇2(cid:96)prl(β)v = 0 implies that vT (Xj − Xi) = 0 for all i and j. Therefore, X T j v = c for a constant c ∈ R for all j. Let X (i) = (X (i) n ) be the sample vector of the i−th component of X and define the matrix X := [1, X (1), . . . , X (m)] ∈ Rn×m+1. Then X does not have full column rank, i.e. taking u = (−c, vT )T implies Xu = 0. 1 , . . . , X (i) 2 However, if we take any arbitrary square sub-matrix in X and compute the determinant, we obtain a non-zero polynomial of some X (1), . . . , X (m). The Lemma in (Okamoto, 1973) states that such a polynomial is zero only on the Lebesgue measure zero. Therefore, the rank of X is min{n, m + 1} = m + 1, which contradicts the equality Xu = 0 and, thus, completes the proof. C PROOF OF THEOREM 2.1 To keep the formulas readable, we define Uij := Xi−Xj√ 2 . This gives (cid:96)prl(β) = (cid:19)−1 (cid:18)n 2 (cid:88) i<j 1(Yj > Yi) log Φ (cid:0)U T jiβ(cid:1) + 1(Yj ≤ Yi) log Φ (cid:0)U T ij β(cid:1) . For the proof, we use the Taylor expansion of (cid:96)prl( ˆβP RL) around β0 and use properties of the gradient of (cid:96)prl(β) at β0, which are established in the following Lemmas. Rank-Based Causal Discovery for Post-Nonlinear Models 14 Lemma C.1. The gradient ∇β(cid:96)prl(β0) converges to zero almost surely, that is ∇β(cid:96)prl(β0) a.s.→ 0. Proof. The gradient ∇β(cid:96)prl(β0) = (cid:19)−1 (cid:18)n 2 (cid:88) i<j 1(Yj > Yi) φ (cid:0)U T Φ (cid:0)U T jiβ0 jiβ0 (cid:1) (cid:1) * Uji + 1(Yj ≤ Yi) φ (cid:0)U T Φ (cid:0)U T ij β0 ij β0 (cid:1) (cid:1) * Uij, is a U-statistic with kernel ψ((X1, Y1), (X2, Y2)) := 1(Y2 > Y1) φ (cid:0)U T Φ (cid:0)U T 21β0 21β0 (cid:1) (cid:1) * U21 + 1(Y2 ≤ Y1) φ (cid:0)U T Φ (cid:0)U T 12β0 12β0 (cid:1) (cid:1) * U12. Note that ψ((X1, Y1), (X2, Y2)) is symmetric as there are no ties in Yi's (Y has a continuous distribution). We use the generalization of the classical Strong Law of Large Numbers (SLLN) for U-statistics (e.g. Theorem A in (Serfling, 1980) Section 5.4). The expectation of the kernel ψ is E[ψ((X1, Y1), (X2, Y2))] (cid:34) = E 1(Y2 > Y2) φ (cid:0)U T Φ (cid:0)U T 21β0 21β0 (cid:1) (cid:1) * U21 + 1(Yj ≤ Yi) (cid:35) φ (cid:0)U T Φ (cid:0)U T 12β0 12β0 (cid:1) (cid:1) * U12 (cid:34) EY [1(Yj > Yi)|X] = EX (cid:34) P(Yj > Yi|X) = EX (cid:1) (cid:1) * U21 + EY [1(Yj ≤ Yi)|X] φ (cid:0)U T 21β0 Φ (cid:0)U T 21β0 (cid:1) (cid:1) * U21 + P(Yj ≤ Yi|X) φ (cid:0)U T 12β0 Φ (cid:0)U T 12β0 (cid:35) (cid:1) (cid:1) * U12 (cid:35) (cid:1) (cid:1) * U12 (cid:1) φ (cid:0)U T Φ (cid:0)U T 21β0 21β0 φ (cid:0)U T 21β0 Φ (cid:0)U T 21β0 (cid:1) (cid:1) * U21 + Φ (cid:0)U T (cid:1) * U12 Xi − Xj√ 2 (cid:1) * U21 + φ (cid:0)U T (cid:20) Xj − Xi√ (cid:1) * 2 12β0 + (cid:1) φ (cid:0)U T Φ (cid:0)U T (cid:2)φ (cid:0)U T 12β0 12β0 21β0 12β0 (cid:3) = EX (cid:21)(cid:21) = EX [0] = 0, 12β0 12β0 φ (cid:0)U T Φ (cid:0)U T (cid:1) (cid:1) * U12 (cid:35) (cid:34) Φ (cid:0)U T 21β0 21β0 (cid:2)φ (cid:0)U T (cid:20) φ (cid:0)U T 21β0 = EX = EX = EX (cid:1) * [U21 + U12](cid:3) where the first equalities follow from the linearity of the expectation and the tower rule of the expectation, i.e. E[Q(X, Y )] = E[E[Q(X, Y )|X]] for any function Q. The third equality is a classical porperty of the indicator func- tion. The fourth equality uses the monotonicity of the function h. The fifth step is just a cancellation of the equal members in the fractions. Finally, the sixth equality follows from the fact that φ(x) = φ(−x) for the probability density function φ of the standard normal distribution. We show that the absolute value of the kernel ψ has a finite expectation, since (cid:34) ≤ E 1(Y2 > Y2) E[|ψ((X1, Y1), (X2, Y2))|] φ (cid:0)U T 21β0 Φ (cid:0)U T 21β0 (cid:1) φ (cid:0)U T 21β0 Φ (cid:0)U T 21β0 2 * |Xi − Xj| √ 2 = φ (cid:0)U T Φ (cid:0)U T = EX 12β0 21β0 (cid:1) * (cid:34) < ∞, (cid:1) (cid:1) * |U21| + 1(Yj ≤ Yi) (cid:1) (cid:1) * |U21| + Φ (cid:0)U T 12β0 12β0 12β0 φ (cid:0)U T Φ (cid:0)U T (cid:1) φ (cid:0)U T Φ (cid:0)U T 12β0 12β0 (cid:35) (cid:1) (cid:1) * |U12| (cid:35) (cid:1) (cid:1) * |U12| where we used the triangle inequality for the absolute value in the first step and the other steps are similar to the calculation for the expectation of the kernel ψ. The last quantity is finite since the probability density function of the standard normal distribution is bounded. Thus, the SLLN yields which completes the proof of the Lemma. ∇β(cid:96)prl(β0) a.s.→ 0, Grigor Keropyan, David Strieder, Mathias Drton 15 Lemma C.2. Let a > 0. For all β ∈ Rm, such that (cid:107)β − β0(cid:107)2 = a, and n > m we have P((cid:96)prl(β) < (cid:96)prl(β0)) → 1. Proof. The taylor expansion of (cid:96)prl(β) around β0 gives (cid:96)prl(β) − (cid:96)prl(β0) = (β − β0)T ∇β(cid:96)prl(β0) + 1 2 (β − β0)T ∇2 β(cid:96)prl(β∗)(β − β0), where (cid:107)β∗ − β0(cid:107)2 ≤ (cid:107)β − β0(cid:107)2 = a, i.e., β∗ is in the closed ball around β0 with radius a. Clearly, ∇2 continuous with respect to β∗. Moreover, from Proposition 2.1 we know that the maximum eigenvalue of ∇2 negative. Thus, there exist a maximum eigenvalue λmax < 0 of ∇2 β(cid:96)prl(β∗) is β(cid:96)prl is β(cid:96)prl within the closed ball with center β0 and radius a. Therefore, we have 1 2 (β − β0)T ∇2 β(cid:96)prl(β∗)(β − β0) ≤ λmax 2 (cid:107)β − β0(cid:107)2 2 . Using the previous Lemma C.1 the remaining term (β − β0)T ∇β(cid:96)prl(β0) asymptotically vanishes in probability and thus the claim follows. In the following we prove Theorem 2.1., i.e. ˆβprl − β0 = oP (1). Proof. From Lemma C.2 we know that for any fixed a > 0, there exists a maximum of (cid:96)prl(β) within the closed ball around β0 with radius a with probability tends to 1. However, ˆβprl maximizes (cid:96)prl(β), and thus P (cid:16)(cid:13) ˆβprl − β0 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)2 (cid:17) < a → 1 as n → ∞, which completes the proof. D PROOF OF THEOREM 3.1 To prove the Theorem we employ the following Lemma. Lemma D.1. Under the assumption (A) we have • If node k is not a sink node, then • If node k is a sink node, then tk > ξ + oP (1). tk → 0 as n → ∞. Proof. First, assume that k is not a sink node. Denoting ˆε := ˆh(X (k)) − (cid:0)X (−k)(cid:1)T ˆβ(k), assumption (A) gives that HSIC(PX (−k),ˆε) > ξ. On the other hand, Theorem 3 in Gretton et al. (2005) gives that for all δ > 0, with probability at least 1 − δ we have |HSIC({X (−k) j where α and C are constants. Thus, , ˆε(k) j }n j=1) − HSIC(PX (−k),ˆε)| ≤ (cid:114) log6/δ α2n + C n , tk − ξ = HSIC({X (−k) > HSIC({X (−k) j j , ˆε(k) , ˆε(k) j }n j }n j=1) − ξ j=1) − HSIC(PX (−k),ˆε) = oP (1). Second, assume that k is a sink node. Then {X (k) , X (−k) }n j=1 is an i.i.d. sample from the PNL regression model (1). j Using the (point-wise) consistency of the estimators, we have j ˆhk(X (k) 1 ) − h(X (k) 1 ) = oP (1) and (cid:16) X (−k) 1 (cid:17)T ˆβ(k) − (cid:16) X (−k) 1 (cid:17)T β(k) = oP (1). Rank-Based Causal Discovery for Post-Nonlinear Models 16 Thus, we obtain 1 − ε(k) ˆε(k) 1 = ˆhk(X (k) 1 ) − h(X (k) 1 ) − (cid:18)(cid:16) X (−k) 1 (cid:17)T ˆβ(k) − (cid:16) X (−k)(cid:17)T β(k) (cid:19) = oP (1) − oP (1) = oP (1). (7) From the definition of tk and the decomposition of the HSIC, we have tk := HSIC({X (−k) j , ˆε(k) j }n j=1) = 1 n2 n (cid:88) i,j=1 Kij ˆLij + 1 n4 n (cid:88) i,j,q,r=1 Kij ˆLij − 2 n3 n (cid:88) i,j,q=1 Kij ˆLij = ˆQ1 + ˆQ2 − ˆQ3, where (cid:18) Kij := exp − and ˆQ1 := 1 n2 (cid:80)n i,j=1 Kij ˆLij, ˆQ2 := 1 n4 i,j,q,r=1 Kij ˆLij, , − X (−k) j (cid:19) , (cid:13) 2 (cid:13) (cid:13) 2 i (cid:13) (cid:13)X (−k) (cid:13) (cid:80)n ˆLij := exp(−(ˆε(k) i − ˆε(k) j )2), ˆQ3 := 2 n3 (cid:80)n i,j,q=1 Kij ˆLij. Similar to the proof of Theorem 2 in Teran Hidalgo et al. (2018) we will show that tk − HSIC(PX (−k),εk Lemma 1 in Gretton et al. (2005) we have ) = oP (1). From HSIC(PX (−k),εk ) = Q1 + Q2 − Q3, where Lij := exp(−(ε(k) i − ε(k) [E and Q3 := 2E X (−k) 1 ε(k) ,ε(k) 1 1 We show that ˆQ1 − Q1 = oP (1). We have )2), Q1 := E [K12]E [L12]]. X (−k) 1 j X (−k) 1 ,ε(k) 1 ,X (−k) 2 [K12L12], Q2 := E X (−k) 1 ,ε(k) 2 ,X (−k) 2 [K12]E 1 ,ε(k) ε(k) 2 [L12] ˆQ1 − Q1 = 1 n2 n (cid:88) i,j=1 Kij ˆLij − E[K12L12] = 1 n2 n (cid:88) i(cid:54)=j Kij ˆLij − E[K12L12] + 1 n = = 1 n(n − 1) 1 n(n − 1) n (cid:88) i(cid:54)=j n (cid:88) i(cid:54)=j Kij ˆLij − E[K12L12] + 1 n − 1 n2(n − 1) n (cid:88) i(cid:54)=j Kij ˆLij Kij ˆLij − E[K12 ˆL12] + E[K12 ˆL12] − E[K12L12] + 1 n − 1 n2(n − 1) n (cid:88) i(cid:54)=j Kij ˆLij, (8) where we used Kjj = ˆLjj = 1 in the second equality. For δ > 0, the Markov inequality gives P (cid:12)  (cid:12) (cid:12) (cid:12)  (cid:12) (cid:12) = 1 n(n − 1) n (cid:88) i(cid:54)=j  (cid:12) (cid:12) (cid:12) Kij ˆLij − E[K12 ˆL12] (cid:12) (cid:12) (cid:12) 1 n2(n − 1)2δ2 ≥ δ  ≤ 1 n(n − 1)δ2 V ar(K12 ˆL12) + (cid:20)(cid:16) E 1 n(n−1) (cid:80)n i(cid:54)=j Kij ˆLij − E[K12 ˆL12] (cid:17)2(cid:21) δ2 (cid:88) (cid:88) i(cid:54)=j p(cid:54)=q Cov(Kij ˆLij, Kpq ˆLpq) = O(1) 1 n(n − 1) + O(1) 1 n Cov(K12 ˆL12, K13 ˆL13) + O(1)Cov(K12 ˆL12, K34 ˆL34). (9) Here, we used that Kij and ˆLij are bounded by 1, thus, their variances are bounded. The number of terms in the quadruple sum that have exactly three different indices are of order n3, but the denominator is of order n4, which leads to the second O(1) term. The last O(1) comes from the fact that the number of terms in the quadruple sum that have exactly four different indices are of order n4. Using (7) and the continuous mapping theorem we obtain and since ˆL12 is bounded, it is uniformly integrable and we obtain K12 ˆL12 − K12L12 = oP (1), E[K12 ˆL12] − E[K12L12] = o(1). Grigor Keropyan, David Strieder, Mathias Drton 17 In a similar way, we obtain E[K12 ˆL12K34 ˆL34] − E[K12L12K34L34] = o(1). Using the fact that K12L12 is independent from K34L34 and employing the two equalities above , we have Cov(K12 ˆL12, K34 ˆL34) = E[K12 ˆL12K34 ˆL34] − E[K12 ˆL12]E[K34 ˆL34] = E[K12L12K34L34] − E[K12L12]E[K34L34] + oP (1) = oP (1). (cid:80)n Thus, all terms in (9) are oP (1). Moreover, from the above arguments we have E[K12 ˆL12] − E[K12L12] = o(1) and i(cid:54)=j Kij ˆLij = o(1) as Kij ˆLij is bounded and the denominator is of order n3. So, in (8) all the terms are oP (1), 1 n2(n−1) which gives ˆQ1 − Q1 = oP (1). In the same fashion, one can show that ˆQ2 − Q2 = oP (1) and ˆQ3 − Q3 = oP (1), which put together proves that tk − HSIC(PX (−k),εk ) = 0, since X (k) is a sink node and thus the noise εk is independent from the remaining nodes X (−k). Thus, ) = oP (1). Moreover, HSIC(PX (−k),εk tk → 0 as n → ∞ if k is a sink node, which completes the proof of the Lemma. Now we can prove Theorem 3.1. For any set A ⊆ {1, 2, . . . , m} we denote the sub-graph of G0 over the nodes A as G0 A. Then P(ˆπ ∈ Π0) = P(∀k ∈ {1, 2, . . . m} : ˆπ(k) is a sink node in G0 {ˆπ(1),...,ˆπ(k)}) = 1 − P(∃k ∈ {1, 2, . . . m} : ˆπ(k) is not a sink node in G0 {ˆπ(1),...,ˆπ(k)}) ≥ 1 − m (cid:88) k=1 P(ˆπ(k) is not a sink node in G0 {ˆπ(1),...,ˆπ(k)}). The proof of Theorem 3.1 is completed if we show that P(ˆπ(k) is a sink node in G0 {ˆπ(1),...,ˆπ(k)}) → 1 as n → ∞ ∀k ∈ {1, 2, . . . , m}, (10) since this implies P(ˆπ(k) is not a sink node in G0 {ˆπ(1),...,ˆπ(k)}) → 0 as n → ∞ ∀k ∈ {1, 2, . . . , m}. Using assumption (A) and the recursive construction of ˆπ it is enough to prove (10) for k = m, that is P(ˆπ(m) is a sink node in G0) → 1 as n → ∞. By Lemma D.1 we know that tk goes to zero in probability for sink nodes and is a least ξ for other nodes. Thus, P(ˆπ(m) is a sink node in G0) = P(arg min {tk} is a sink node in G0) → 1 as n → ∞. This completes the proof of the Theorem. E NUMERICAL RESULTS In this Section we provide the concrete simulation results in tabular form and additionally provide the empirical standard deviations if the results. Tables 1, 2, 3 and 4, 5, 6 show the results of RankG, AbPNL and RESIT methods for 4-dimensional graphs with strong and weak signal settings, for Gaussian, Gumbel and Logistic noises, respectively. Tables 7, 8, 9 and 10, 11, 12 show the results for 7-dimensional graphs. In both cases the sample sizes are 100, 500, 1000, 1500, and 2000, respectively. Moreover, Tables 13, 14, 15 and 16, 17, 18 show the results of RankS, RankG, AbPNL and RESIT methods for 4- dimensional graphs with strong and weak signal settings, respectively. Tables 19, 20, 21 and 22, 23, 24 show the results of RankS, RankG, AbPNL and RESIT methods for 4-dimensional graphs where the function g is polynomial of degree 4 with strong and weak signal settings, respectively. In both cases the sample sizes are 100, 150, 200, 250, and 300. Rank-Based Causal Discovery for Post-Nonlinear Models 18 - - 100 500 1000 1500 2000 RankG 2.51 ± 1.26 1.86 ± 1.31 1.61 ± 1.15 1.66 ± 1.35 1.63 ± 1.17 Gaussian noise AbPNL 3.94 ± 1.09 3.46 ± 1.08 3.14 ± 1.14 3.28 ± 1.18 3.23 ± 1.12 RESIT 2.4 ± 1.16 2.41 ± 1.23 2.43 ± 1.16 2.62 ± 1.36 3.15 ± 1.51 Table 1: Results of RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Gaussian noise (100 repetitions). - - 100 500 1000 1500 2000 RankG 2.86 ± 1.36 2.34 ± 1.45 1.8 ± 1.28 1.68 ± 1.1 1.37 ± 1.14 Gumbel noise AbPNL 3.98 ± 1.36 3.07 ± 1.24 3.31 ± 1.11 3.06 ± 1.03 3.17 ± 1.18 RESIT 2.3 ± 1.18 2.49 ± 1.2 2.43 ± 1.28 3.04 ± 1.31 3.02 ± 1.41 Table 2: Results of RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Gumbel noise (100 repetitions). - - 100 500 1000 1500 2000 RankG 2.61 ± 1.35 2.06 ± 1.34 1.85 ± 1.37 1.68 ± 1.38 1.79 ± 1.18 Logistic noise AbPNL 3.89 ± 1.11 3.32 ± 1.24 3.41 ± 1.1 3.27 ± 1.2 3.29 ± 1.16 RESIT 2.31 ± 1.1 2.36 ± 1.13 2.66 ± 1.24 2.92 ± 1.32 3.44 ± 1.38 Table 3: Results of RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Logistic noise (100 repetitions). - - 100 500 1000 1500 2000 RankG 1.21 ± 1.23 0.21 ± 0.56 0.15 ± 0.59 0.04 ± 0.24 0.05 ± 0.3 Gaussian noise AbPNL 3.7 ± 1.28 2.8 ± 1.01 3.18 ± 1.08 3.06 ± 1.08 3.26 ± 1.17 RESIT 2.72 ± 1.2 2.69 ± 1.12 2.73 ± 1.08 2.9 ± 1.06 3.1 ± 1.29 Table 4: Results of RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Gaussian noise (100 repetitions). - - 100 500 1000 1500 2000 RankG 1.44 ± 1.26 0.42 ± 0.91 0.13 ± 0.39 0.15 ± 0.54 0.08 ± 0.37 Gumbel noise AbPNL 3.47 ± 1.13 2.61 ± 1.1 2.88 ± 1.15 2.76 ± 1.14 2.83 ± 1.21 RESIT 2.86 ± 1.26 2.62 ± 1.19 2.75 ± 1.15 2.98 ± 1.2 3.29 ± 1.26 Table 5: Results of RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Gumbel noise (100 repetitions). Grigor Keropyan, David Strieder, Mathias Drton 19 - - 100 500 1000 1500 2000 RankG 1.05 ± 1.3 0.39 ± 0.79 0.14 ± 0.47 0 ± 0 0 ± 0 Logistic noise AbPNL 3.82 ± 1.15 2.84 ± 1.02 3.01 ± 1.14 2.95 ± 1.18 2.69 ± 1.17 RESIT 2.5 ± 1.24 2.46 ± 1 2.53 ± 1.11 2.98 ± 1.05 3.28 ± 1.21 Table 6: Results of RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Logistic noise (100 repetitions). - - 100 500 1000 1500 2000 RankG 4.65 ± 2.21 3.75 ± 2.11 3.29 ± 2.03 2.94 ± 2.13 3.35 ± 2.09 Gaussian noise AbPNL 6.72 ± 2.13 5.4 ± 1.88 5.46 ± 1.96 5.4 ± 1.87 5.49 ± 1.84 RESIT 3.89 ± 1.85 4.1 ± 1.76 4.27 ± 1.95 4.34 ± 1.88 5.02 ± 2.09 Table 7: Results of RankG, RESIT and AbPNL methods on 7 nodes with β ∼ U (−100, 100) for Gaussian noise (100 repetitions). - - 100 500 1000 1500 2000 RankG 4.74 ± 2.12 3.68 ± 1.97 3.4 ± 1.98 3.33 ± 2.05 3.47 ± 2.61 Gumbel noise AbPNL 6.33 ± 2.26 5.41 ± 1.83 5.39 ± 1.92 5.96 ± 2.12 5.26 ± 1.7 RESIT 3.95 ± 2.09 3.95 ± 1.75 3.78 ± 1.92 4.66 ± 1.99 5.07 ± 2.41 Table 8: Results of RankG, RESIT and AbPNL methods on 7 nodes with β ∼ U (−100, 100) for Gumbel noise (100 repetitions). - - 100 500 1000 1500 2000 RankG 4.56 ± 2.1 3.65 ± 2.13 3.88 ± 2.42 2.93 ± 1.98 3.39 ± 1.97 Logistic noise AbPNL 6.45 ± 2.08 5.52 ± 1.49 5.35 ± 1.96 5.37 ± 1.8 5.1 ± 1.64 RESIT 4.01 ± 1.96 3.86 ± 1.85 4.18 ± 1.88 4.42 ± 2.01 4.96 ± 2.17 Table 9: Results of RankG, RESIT and AbPNL methods on 7 nodes with β ∼ U (−100, 100) for Logistic noise(100 repetitions). - - 100 500 1000 1500 2000 RankG 2.44 ± 1.69 1.11 ± 1.46 0.28 ± 0.75 0.19 ± 0.6 0.19 ± 0.69 Gaussian noise AbPNL 6.71 ± 2.47 5.06 ± 1.75 5.08 ± 1.87 5.18 ± 2 5.26 ± 1.55 RESIT 4.15 ± 1.75 4.4 ± 1.84 4.47 ± 1.88 4.35 ± 1.79 4.69 ± 2 Table 10: Results of RankG, RESIT and AbPNL methods on 7 nodes with β ∼ U (−10, 10) for Gaussian noise (100 repetitions). Rank-Based Causal Discovery for Post-Nonlinear Models 20 - - 100 500 1000 1500 2000 RankG 3.13 ± 2.02 0.88 ± 1.4 0.38 ± 0.93 0.37 ± 0.97 0.14 ± 0.55 Gumbel noise AbPNL 6.11 ± 2.22 4.32 ± 1.65 4.7 ± 1.87 4.88 ± 1.78 4.81 ± 1.94 RESIT 4.17 ± 1.76 4.41 ± 1.74 4.22 ± 1.97 4.88 ± 1.87 5.02 ± 2.06 Table 11: Results of RankG, RESIT and AbPNL methods on 7 nodes with β ∼ U (−10, 10) for Gumbel noise (100 repetitions). - - 100 500 1000 1500 2000 RankG 2.65 ± 2 0.68 ± 1.09 0.45 ± 1.01 0.34 ± 0.98 0.2 ± 0.68 Logistic noise AbPNL 6.83 ± 2.2 4.87 ± 1.82 5.08 ± 1.79 4.89 ± 1.87 4.43 ± 1.69 RESIT 4.03 ± 1.54 4.12 ± 1.77 4.27 ± 1.8 4.55 ± 1.76 4.56 ± 1.81 Table 12: Results of RankG, RESIT and AbPNL methods on 7 nodes with β ∼ U (−10, 10) for Logistic noise (100 repetitions). - - 100 150 200 250 300 Gaussian noise RankS 2.23 ± 1.42 1.73 ± 1.49 1.63 ± 1.34 1.56 ± 1.27 1.49 ± 1.29 RankG 2.51 ± 1.26 2.75 ± 1.25 2.24 ± 1.32 2.3 ± 1.16 2.24 ± 1.35 AbPNL 3.94 ± 1.09 2.6 ± 1.2 2.87 ± 1.19 3.07 ± 1.15 2.97 ± 1.02 RESIT 2.4 ± 1.16 2.47 ± 1.13 2.3 ± 1.02 2.4 ± 1.22 2.54 ± 1.1 Table 13: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Gaussian noise (100 repetitions). - - 100 150 200 250 300 Gumbel noise RankS 1.69 ± 1.36 1.76 ± 1.28 1.77 ± 1.38 1.73 ± 1.27 1.84 ± 1.23 RankG 2.86 ± 1.36 2.56 ± 1.4 2.78 ± 1.3 2.44 ± 1.18 2.4 ± 1.43 AbPNL 3.98 ± 1.36 2.88 ± 1.34 2.77 ± 1.17 3.04 ± 1.13 3.11 ± 1.12 RESIT 2.3 ± 1.18 2.37 ± 1.1 2.38 ± 1.25 2.45 ± 1.16 2.35 ± 1.1 Table 14: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Gumbel noise (100 repetitions). - - 100 150 200 250 300 Logistic noise RankS 2.02 ± 1.32 1.8 ± 1.26 1.63 ± 1.28 1.45 ± 1.23 1.61 ± 1.32 RankG 2.61 ± 1.35 2.58 ± 1.39 2.5 ± 1.4 2.21 ± 1.3 2.3 ± 1.23 AbPNL 3.89 ± 1.11 2.84 ± 1.26 3.17 ± 1.25 3.32 ± 1.23 3 ± 1.04 RESIT 2.31 ± 1.1 2.7 ± 1.23 2.55 ± 1.25 2.3 ± 1.25 2.4 ± 1.17 Table 15: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Logistic noise (100 repetitions). Grigor Keropyan, David Strieder, Mathias Drton 21 - - 100 150 200 250 300 Gaussian noise RankS 1.72 ± 1.45 1.54 ± 1.36 1.37 ± 1.37 1.37 ± 1.28 1.21 ± 1.27 RankG 1.21 ± 1.23 1.11 ± 1.48 0.71 ± 1.09 0.77 ± 1.14 0.48 ± 0.89 AbPNL 3.7 ± 1.28 2.3 ± 1.41 2.52 ± 1.29 2.55 ± 1.07 3.1 ± 1.28 RESIT 2.72 ± 1.2 2.69 ± 1.2 2.72 ± 1.05 2.78 ± 1.22 2.57 ± 1.17 Table 16: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Gaussian noise (100 repetitions). - - 100 150 200 250 300 Gumbel noise RankS 1.73 ± 1.43 1.63 ± 1.37 1.41 ± 1.31 1.48 ± 1.26 1.72 ± 1.42 RankG 1.44 ± 1.26 1.22 ± 1.33 0.81 ± 1.02 0.62 ± 1.08 0.69 ± 1.05 AbPNL 3.47 ± 1.13 2.04 ± 1.19 2.5 ± 1.08 2.38 ± 1.25 2.44 ± 1.19 RESIT 2.86 ± 1.26 2.64 ± 1.28 2.7 ± 1.32 2.58 ± 1.24 2.76 ± 1.12 Table 17: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Gumbel noise (100 repetitions). - - 100 150 200 250 300 Logistic noise RankS 1.78 ± 1.4 1.44 ± 1.34 1.55 ± 1.27 1.3 ± 1.14 1.38 ± 1.43 RankG 1.05 ± 1.3 0.74 ± 1.02 0.57 ± 1.02 0.36 ± 0.72 0.33 ± 0.75 AbPNL 3.82 ± 1.15 2.86 ± 1.25 3.18 ± 1.24 3.14 ± 1.25 3.23 ± 1.15 RESIT 2.5 ± 1.24 2.56 ± 1.16 2.37 ± 1.17 2.28 ± 1.09 2.51 ± 1.11 Table 18: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Logistic noise (100 repetitions). - - 100 150 200 250 300 Gaussian noise RankS 1.24 ± 0.92 1.42 ± 1.07 1.37 ± 1.1 1.78 ± 1.18 1.63 ± 1 RankG 3.33 ± 1.41 2.96 ± 1.5 3.26 ± 1.54 2.8 ± 1.55 3.32 ± 1.59 AbPNL 3.7 ± 1.32 3.1 ± 1.49 3.37 ± 1.34 3.35 ± 1.23 3.52 ± 1.23 RESIT 2.75 ± 1.31 2.56 ± 1.21 2.42 ± 1.32 2.33 ± 1.12 2.64 ± 1.31 Table 19: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Gaussian noise and quartic polynomial g (100 repetitions). - - 100 150 200 250 300 Gumbel noise RankS 1.11 ± 0.92 1.51 ± 1.01 1.56 ± 0.96 1.63 ± 0.93 1.86 ± 0.98 RankG 3 ± 1.37 3.14 ± 1.37 3.29 ± 1.41 3.52 ± 1.41 3.41 ± 1.44 AbPNL 3.33 ± 1.36 2.7 ± 1.27 3.22 ± 1.22 3.34 ± 1.08 3.61 ± 1.15 RESIT 2.59 ± 1.23 2.78 ± 1.2 2.81 ± 1.26 2.94 ± 1.29 2.73 ± 1.25 Table 20: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Gumbel noise and quartic polynomial g (100 repetitions). Rank-Based Causal Discovery for Post-Nonlinear Models 22 - - 100 150 200 250 300 Logistic noise RankS 2.02 ± 1.32 1.8 ± 1.26 1.63 ± 1.28 1.45 ± 1.23 1.61 ± 1.32 RankG 2.61 ± 1.35 2.58 ± 1.39 2.5 ± 1.4 2.21 ± 1.3 2.3 ± 1.23 AbPNL 3.52 ± 1.24 3.23 ± 1.18 3.47 ± 1.09 3.35 ± 1.07 3.45 ± 1.41 RESIT 2.31 ± 1.1 2.7 ± 1.23 2.55 ± 1.25 2.3 ± 1.25 2.4 ± 1.17 Table 21: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−100, 100) for Logistic noise and quartic polynomial g (100 repetitions). - - 100 150 200 250 300 Gaussian noise RankS 2.01 ± 1.38 2.34 ± 1.29 2.44 ± 1.42 2.53 ± 1.49 2.48 ± 1.57 RankG 2.92 ± 1.66 2.75 ± 1.72 2.7 ± 1.62 2.42 ± 1.65 2.79 ± 1.8 AbPNL 3.64 ± 1.28 2.64 ± 1.43 3.19 ± 1.35 3.57 ± 1.27 3.7 ± 1.2 RESIT 2.63 ± 1.17 2.8 ± 1.29 2.81 ± 1.32 2.63 ± 1.24 2.58 ± 1.34 Table 22: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Gaussian noise and quartic polynomial g (100 repetitions). - - 100 150 200 250 300 Gumbel noise RankS 1.85 ± 1.17 2.15 ± 1.21 2.43 ± 1.37 2.51 ± 1.33 2.32 ± 1.35 RankG 2.99 ± 1.49 2.68 ± 1.56 2.69 ± 1.59 2.9 ± 1.61 3.03 ± 1.38 AbPNL 3.55 ± 1.13 2.54 ± 1.43 2.71 ± 1.27 3.2 ± 1.26 3.1 ± 1.18 RESIT 2.83 ± 1.23 2.84 ± 1.39 2.87 ± 1.3 3.05 ± 1.45 2.94 ± 1.32 Table 23: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Gumbel noise and quartic polynomial g (100 repetitions). - - 100 150 200 250 300 Logistic noise RankS 2.12 ± 1.17 2.29 ± 1.39 2.4 ± 1.36 2.34 ± 1.34 2.48 ± 1.44 RankG 2.97 ± 1.45 2.93 ± 1.42 2.91 ± 1.54 2.81 ± 1.5 2.76 ± 1.72 AbPNL 3.49 ± 1.36 3.09 ± 1.39 3.5 ± 1.17 3.34 ± 1.23 3.29 ± 1.19 RESIT 2.61 ± 1.38 2.63 ± 1.19 2.45 ± 1.2 2.53 ± 1.15 2.59 ± 1.24 Table 24: Results of RankS, RankG, RESIT and AbPNL methods on 4 nodes with β ∼ U (−10, 10) for Logistic noise and quartic polynomial g (100 repetitions).
http://arxiv.org/abs/2302.12337v1
2023-02-23T21:08:02
2023-02-23T21:08:02
On the Limitations of Physics-informed Deep Learning: Illustrations Using First Order Hyperbolic Conservation Law-based Traffic Flow Models
Since its introduction in 2017, physics-informed deep learning (PIDL) has garnered growing popularity in understanding the evolution of systems governed by physical laws in terms of partial differential equations (PDEs). However, empirical evidence points to the limitations of PIDL for learning certain types of PDEs. In this paper, we (a) present the challenges in training PIDL architecture, (b) contrast the performance of PIDL architecture in learning a first order scalar hyperbolic conservation law and its parabolic counterpart, (c) investigate the effect of training data sampling, which corresponds to various sensing scenarios in traffic networks, (d) comment on the implications of PIDL limitations for traffic flow estimation and prediction in practice. Detailed in the case study, we present the contradistinction in PIDL results between learning the traffic flow model (LWR PDE) and its variation with diffusion. The outcome indicates that PIDL experiences significant challenges in learning the hyperbolic LWR equation due to the non-smoothness of its solution. On the other hand, the architecture with parabolic PDE, augmented with the diffusion term, leads to the successful reassembly of the density data even with the shockwaves present.
[ "Archie J. Huang", "Shaurya Agarwal" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12337v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12337v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "math.AP" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 7 3 3 2 1 . 2 0 3 2 : v i X r a ON THE LIMITATIONS OF PHYSICS-INFORMED DEEP LEARNING: ILLUSTRATIONS USING FIRST ORDER HYPERBOLIC CONSERVATION LAW-BASED TRAFFIC FLOW MODELS A PREPRINT Archie J. Huang , Shaurya Agarwal UrbanITY Lab∗ Civil, Environmental & Construction Engineering Department University of Central Florida Orlando, FL 32816, USA [email protected], [email protected] ABSTRACT Since its introduction in 2017, physics-informed deep learning (PIDL) has garnered growing popular- ity in understanding the evolution of systems governed by physical laws in terms of partial differential equations (PDEs). However, empirical evidence points to the limitations of PIDL for learning certain types of PDEs. In this paper, we (a) present the challenges in training PIDL architecture, (b) contrast the performance of PIDL architecture in learning a first order scalar hyperbolic conservation law and its parabolic counterpart, (c) investigate the effect of training data sampling, which corresponds to various sensing scenarios in traffic networks, (d) comment on the implications of PIDL limitations for traffic flow estimation and prediction in practice. Detailed in the case study, we present the contradistinction in PIDL results between learning the traffic flow model (LWR PDE) and its variation with diffusion. The outcome indicates that PIDL experiences significant challenges in learning the hyperbolic LWR equation due to the non-smoothness of its solution. On the other hand, the architec- ture with parabolic PDE, augmented with the diffusion term, leads to the successful reassembly of the density data even with the shockwaves present. Keywords Physics-informed deep learning * Neural network training * Partial differential equations * Transportation models * Scalar conservation laws 1 INTRODUCTION AND MOTIVATION Traffic states such as vehicle velocity v, density ρ, and flow f depict the condition of traffic operations on road infrastructures. An important task in transportation management is accurately capturing the current traffic state conditions to implement control measures such as ramp metering and tidal lanes during rush hours [1, 2]. The practice of obtaining traffic state measurements is bounded by several constraints [3, 4]. Firstly, sensing traffic state requires the installation of equipment along the roadway to detect the presence of vehicles. Costs of installation, calibration, and maintenance occur and limit this sensing application to a few selected locations in a complex road network. Secondly, inaccuracy and measurement noise is inherent in the process of acquiring traffic states through sensing devices. Considering the reliability of observed traffic data and handling missing values are common requirements to process traffic state measurement [5]. The observation data of traffic states can be harvested through another channel - connected vehicles (CV) [6]. In this approach, traffic conditions are perceived via the ubiquitous onboard sensors in connected vehicles zooming through traffic. CV has the potential of vastly broadening the detection area of traffic state on roadways [7]. However, this application scenario, in reality, is also restricted in several ways. Traffic states obtained through CV need to be broadcast and stored by roadside units or edge devices in a computing network [8]. The current penetration rates of both CV and ∗The code accompanying this manuscript can be found in the GitHub repository at github.com/Urbanity-Lab/PIDL-Limitations On the Limitations of Physics-informed Deep Learning A PREPRINT the compatible communication system are insufficient to make it a reliable practice for procuring data on traffic states. Besides, the communication between CV and data infrastructure generates elevated demand for network resources in pursuit of robust on-site computing capability and low-latency data exchange [9]. The estimation of traffic states, therefore, becomes an important practice for traffic planners and policy practitioners [10]. It pertains to the inference of traffic state using data that is partially available, secured either through sensing devices or CV. A variety of traffic operations rely on this crucial assessment of traffic states [11, 12]. Tasks as minute as determining the length of traffic cycles and as substantial as adding additional lanes on a highway all rely on the outcome of traffic state estimation (TSE). A variety of TSE methods exist in the literature and can be categorized into three groups: model-based, data-based, and streaming-data-based [10]. Model-based approaches [13–16] rely on a calibrated traffic flow model to estimate traffic states in unobserved areas. Data-based approaches [17–21] utilize the insights derived from historical data and apply statistical or machine learning techniques to reconstruct and predict traffic states. The third category of streaming-data-based approaches [22, 23] contains methods that do not necessitate a priori knowledge of historical observation, instead take advantage of real-time data, with a weak assumption of traffic relationship acquired from empirical evidence. The restraints on obtaining traffic state data call for the adoption of TSE models that can exploit a limited amount of observed data for training and produce a precise estimation of traffic states. Among the available approaches, deep learning (DL) neural network is a powerful machine learning method increasingly used in many TSE applications [24–26]. However, DL neural network also comes with shortcomings, such as the high requirement of training data and computing power, over-fitting, and transferability issues, limiting its appeal for time-critical applications, which calls for the role of physics in aiding the training process of a neural network in TSE [27, 28]. Physics-informed deep learning (PIDL), also referred to as physics-informed neural network (PINN), arms a neural network with the governing equations of a physical system [29]. It empowers the deep learning neural network with knowledge of the underlying relationship in observed data to efficiently use the limited data input for estimation and prediction tasks [30]. Since the introduction of its architecture [30], PIDL has been adopted in the field of traffic state estimation (TSE) [31, 32]. Researchers have experimented with PIDL to estimate both the traffic state and the fundamental diagram depicting the relationship between traffic states [25]. Second-order traffic models have also been considered in the application of PIDL for TSE [33]. A diverse range of mechanical engineering and computational science applications have also been proposed, signifying its advantage in utilizing the governing equation to accurately capture the physical system. Among its diverse implementations in the mathematical domain, the PIDL approach has been adopted for solving the free boundary problems [34], high-dimensional PDE [35], uncertainty quantification [36], and time-dependent stochastic PDE [37]. In the field of fluid dynamics, PIDL is employed to model the velocity and pressure fields [38], vortex-induced vibration [39], and fluid flows without the use of simulation data [40]. And on the engineering side, the modeling of cardiovascular flow [41], nano-optics [42], and proxy modeling in solid mechanics [43] have all witnessed the effectiveness of the PIDL approach. Variants of PIDL have been proposed to learn the solution of partial differential equations (PDEs). For instance, Galerkin method-based hp-VPINN was introduced to solve PDEs with non-smooth solutions [44]. A Bayesian approach to PINN is presented for forward and inverse problems [45], and the idea of physics-informed adversarial training to solve PDE is proposed [46]. Particle swarm optimization is also put forward to PIDL training [47]. Amid the PIDL applications that have been demonstrating encouraging results, the focal point is to use the neural network to learn the solutions of deterministic PDE commanding a physical system. As the PIDL model ciphers the underlying relationship between state variables, it incorporates the governing equation as a priori knowledge into calculating cost. If the PDE of interest is smooth and has a strong solution, at the same time, is paired with an adequate number of collocation points where the physics cost is optimized, then PIDL accordingly is capable of achieving good accuracy in learning the solution to the PDE. However, recent research points to the limitations of PIDL for learning certain types of PDEs, such as hyperbolic conservation laws. Scalar Conservation Laws in Traffic Flow Theory: Lighthill-Whitham-Richards (LWR) is a one-dimensional scalar conservation law and a commonly-used transportation model. No strong solution exists to LWR, given it is a hyperbolic PDE [1]. Certain classes of partial differential equations, including the LWR model, can be solved by the method of characteristics (details in Section 2). In our previous work [31, 48], equipped with a realistic choice of data sampling on the interior traffic data (either Lagrangian data that come from connected vehicles (CV) or Eulerian data from roadside sensors and loop detectors), we have shown that PIDL can successfully and accurately learn the onerous task of reconstructing LWR PDE. However, no empirical evidence exists that PIDL can learn an LWR PDE with acceptable accuracy given only boundary and initial condition data, which is the default experimental setup for a variety of reconstruction problems in transportation and other domains [25, 29, 30, 33]. 2 On the Limitations of Physics-informed Deep Learning A PREPRINT Goals and Objectives: The goal of this research is to understand the limitations of PIDL in traffic state estimation applications and initiate a dialogue on possible remedies in light of current literature. We aim to achieve the goal by addressing the following research questions: • Which form of the LWR model, hyperbolic PDE or parabolic PDE, is learned better by the PIDL algorithm? • What are the factors behind the disparity in learning results? • What is the effect of a diffusion term, which transforms the hyperbolic LWR PDE to a parabolic variation, in alleviating the weakness of PIDL? • What are the inherent architectural issues in PIDL that inhibit it from working with hyperbolic conservation law? The research is divided into the following tasks: (a) exhibiting the contradistinction in terms of reconstruction accuracy between learning a commonly-used conservation law (LWR) in traffic flow theory, which is a first order hyperbolic PDE, and its second order parabolic counterpart by using a synthetic ring road density dataset, (b) further illustrating the limitations of PIDL in TSE with only the initial and boundary observations from the realistic field data (NGSIM), (c) understanding the impact of discontinuity in PDE solution, and the effect of a diffusion term on PIDL learning, (d) discussing the findings from the experimental results in light of existing literature and putting forward suggestions to improve PIDL results in TSE with the LWR PDE. Key features and contributions: 1. We design a series of experiments by creating a circular testbed and by using realistic field (NGSIM) data to understand the performance of PIDL in TSE while incorporating the hyperbolic and parabolic versions of the physics. 2. We showcase the effect of the additional second order diffusion term in the LWR PDE on PIDL learning using only the initial and boundary observations from a ring road testbed. 3. We further investigate the contrast between PIDL learning the hyperbolic LWR PDE and its parabolic variant using a mix of Eulerian and Lagrangian training inputs (non-boundary data). 4. Using the realistic NGSIM field data, we shed light on the limitations of PIDL in TSE and demonstrate that, on occasions, a numerical PDE solver outperforms PIDL. 5. Finally, we discuss the reasoning behind the difficulties encountered when training a PIDL neural network with the LWR conservation law and list suggestions for improving the performance. Outline The rest of the manuscript is organized as follows: Section 2 gives the mathematical background of the scalar conservation laws, including the LWR model, strong and weak solutions, and method of characteristics. Section 3 introduces the preliminaries of physics-informed deep learning (PIDL) for learning the conservation law-based traffic flow models. Section 4 sets up a case study to reveal the challenges of PIDL with the first order hyperbolic LWR PDE. Section 5 further illustrates the limitations of PIDL with field data from the NGSIM dataset. Section 6 discusses the implications from results and Section 7 concludes the paper with suggestions on future work. 2 SCALAR CONSERVATION LAWS In one dimension, a general form of the scalar conservation law is described by (1) where f (u) is the flux function depending on the location x and time t. The conserved variable is u = u(x, t). Equation (1) becomes a Cauchy problem when the initial condition u(x, 0) = u0(x) is provided [49]. The flux function f (u) can take many forms, the linear advection equation is a basic example of the scalar conservation law where the flux function f (u) takes the form of f (u) = λu with a constant λ, shown in (2). ∂xf (u) + ∂tu = 0, x ∈ R, t ≥ 0 (1) An initial value problem for the linear advection equation is given by (3) and its solution is exhibited in (4). λ∂xu + ∂tu = 0, x ∈ R, t ≥ 0 ∂xf (u) + ∂tu = 0, x ∈ R, t ≥ 0 u(x, 0) = u0(x) = f (x0), x ∈ R 3 (2) (3) On the Limitations of Physics-informed Deep Learning A PREPRINT u(x, t) = u0(x − λt), t ≥ 0 (4) A simple nonlinear particle differential equation is the Burgers' equation, and it is one of the commonly used models as the scalar conservation law. The classical form of Burgers' equation is presented in (5) where the (cid:15)∂xxu is the viscosity term. When (cid:15) = 0, (5) becomes the inviscid Burgers' equation, and the flux function takes the form of f (u) = u2/2, shown in (6). Plugging λ = u into (4) we get the solution of the inviscid Burgers' equation in (7). u∂xu + ∂tu − (cid:15)∂xxu = 0, x ∈ R, t ≥ 0 (5) ∂x(u2/2) + ∂tu = u∂xu + ∂tu = 0, x ∈ R, t ≥ 0 u(x, t) = u0(x − ut), t ≥ 0 (6) (7) The viscosity term is a diffusion term that flattens discontinuities and ensures a smooth solution. 2.1 PHYSICS OF TRAFFIC FLOW Macroscopically, traffic flow is expressed using variables such as the mean velocity v(x, t), a function of location x and time t, traffic flow q(x, t), and vehicle density ρ(x, t). Spacing s is the headway distance, which is the inverse of density ρ. Traffic flow is considered a continuum flow with a density profile associated with a compressible liquid [50]. The traffic flow velocity is related to the density profile, time, and location. LWR conservation law is a continuity equation, which holds for all macroscopic models, and formulates the conserva- tion of traffic flow. This equation relates the change of density with the gradient of flow. When the flow is considered as a static function (portrayed by a fundamental diagram), it leads to a first order continuity equation, also referred to as Lighthill-Whitham-Richards (LWR) model [51] - which is a hyperbolic partial differential equation (PDE). Given a location x between the start point x0 and endpoint xn, a timestamp t between the initial time t0 and the end time tm, cumulative flow N (x, t) depicts the number of vehicles that have reached location x at time t. The flow q(x, t) is the partial differential of N (x, t) with respect to time t. Likewise, density ρ(x, t) is the partial differential of N (x, t) with respect to location x. The formulation of the LWR conservation law in the Eulerian coordinate system is shown in (8). It is worth noting that data provided by connected vehicles (CV), such as vehicle velocity v(n, t) and spacing s(n, t) with respect to the vehicle identifier n and time t, would be in Lagrangian coordinates [52]. The Lagrangian formulation of the conservation law is shown in (9). For (x, t) ∈ [ x0, xn] × [ t0, tm], For (n, t) ∈ [ n0, ni] × [ t0, tm], ∂q(x, t) ∂x + ∂ρ(x, t) ∂t = 0 ∂v(n, t) ∂n + ∂s(n, t) ∂t = 0 2.2 STRONG AND WEAK SOLUTIONS Given the initial value problem (10), ∂xf (u) + ∂tu = 0, x ∈ R, t ≥ 0 u(x, 0) = u0(x), x ∈ R (8) (9) (10) If u0(x) ∈ C 1(R), then the initial condition u0(x) is continuously differentiable and (10) becomes (11) by virtue of the chain rule. f (cid:48)(u)∂xu + ∂tu = 0, x ∈ R, t ≥ 0 u(x, 0) = u0(x), x ∈ R 4 (11) On the Limitations of Physics-informed Deep Learning A PREPRINT In domain Ω ∈ R, a solution to (11) is a strong solution (also referred to as "classical solution") if it satisfies (10), and is continuously differentiable on the domain Ω. When no strong solution to (10) exists, the smoothness requirement can be relaxed to find weak solutions, even if these solutions are not differentiable or even continuous. Weak solutions (12) eliminate the derivative terms of u and f (u) to ease the smoothness requirement. Multiplying the scalar conservation law (1) with a function ψ : R × R+ → R, and given the initial condition u(x, 0) = u0(x), we have (12). (cid:90) ∞ (cid:90) ∞ 0 −∞ (∂xf (u) + ∂tu)ψdxdt = (cid:90) ∞ (cid:90) ∞ 0 −∞ (f (u)ψx + uψt)dxdt + (cid:90) ∞ −∞ u(x, 0)ψ(x)dx = 0 (12) Notice in (12), the requirement on smoothness is lessened as there are no derivative terms of u and f . If (12) satisfies all ψ(x), then u(x, t) is the weak solution of (10). It is worth noting that there is no strong solution to the LWR conservation law. Nevertheless, a diffusive term can be added to avoid breakdown and ensure a strong solution by making the hyperbolic conservation equation become a parabolic PDE. We will further discuss this in Section 6. 2.3 METHOD OF CHARACTERISTICS The method of characteristics is used to solve quasilinear partial differential equations, converting the PDEs into ordinary differential equations (ODEs). Consider (1) and its solution f (u) = u(x, t), let x = x(t) solve the ODE in (13): From (13) observe that, ̇x(t) = u(x(t), t) d dt u(x(t), t) = dx dt ux + ut (13) (14) Combining (1) and (14), we reach (15) that can propagate the solution u(x(t), t) with the initial condition u0(x). A simple discontinuous solution of the conservation law (10) is given by (16). du dt = 0, dx dt = u u(x, t) = (cid:26) uL, x < λt, uR, x ≥ λt, (15) (16) If uL (cid:54)= uR, (16) is termed a shock wave. With the shock speed λ, it connects uL to the value of uR. Consider the following scalar Riemann problem (17) where ρL < ρR: vf (1 − ρ(x, t) ρm ) ∂ρ(x, t) ∂x + = 0 ∂ρ(x, t) ∂t (cid:26) ρL, x < 0, ρR, x ≥ 0, ρ(x, 0) = (17) The characteristic speed at t = 0 is given in (18). As ρL < ρR, the characteristic speed λ(ρL) on the left is greater than the right λ(ρR) and develops a shock curve, shown in Fig. 1a. λ(ρ) = f (cid:48)(ρ) = vf (1 − 2 ρ ρm ) (18) If we modify the problem in (17) with the initial condition that ρL > ρR, the value of the characteristic speed on the left λ(ρL) will be smaller than the value of speed on the right λ(ρL). One of the possible solutions to (17) with ρL > ρR is 5 On the Limitations of Physics-informed Deep Learning A PREPRINT (a) Shockwave solution (b) Rarefaction solution Figure 1: Ring Road Vehicle Density Experimental Data the symmetry rarefaction solution, which is stable to perturbation to the initial data. The solution is given in (19), and shown in Fig. 1b. ρ(x, t) =    ρL, λ(ρR)−λ(ρL) ρR−ρL ρR, x x t < λ(ρL), t , λ(ρL) ≤ x λ(ρR) ≤ x t t < λ(ρR), (19) 3 PHYSICS-INFORMED DEEP LEARNING Development in deep learning (DL) neural networks has made it a suitable tool in the computational modeling of a physical system, which is often governed by complex non-linear functions [53]. When mean square error (MSE) is used as the measurement of cost in a DL neural network, the cost function can be formulated as (20), in which N is the number of outputs, and ˆu(x, y, z, t) is the prediction of the variable u(x, y, z, t). J = M SE(ˆu(x, y, z, t), u(x, y, z, t)) = 1 N N (cid:88) k=1 |u(x, y, z, t) − ˆu(x, y, z, t)|2 (20) Automatic differentiation (AD) computes a state variable's partial derivatives with respect to its spatial and temporal independent variables [54]. Through the layers of a neural network, an output u(x, y, z, t) can be presented as a nested function of input variables x, y, z, and t. By applying the chain rule, automatic differentiation yields accurate derivatives of the training cost with respect to the parameters of the neural network [55]. To evaluate the outputs from the neural network in terms of compliance with the governing physical laws, the physics cost is computed at a set of spatiotemporal points (x, y, z, t), termed as collocation points, which can be chosen by Latin hypercube sampling (LHS) [56]. To differentiate the deep learning cost (DL-cost) in (20) and the physics-cost, we use JDL to depict the DL-cost, and JP HY as the penalty of incompliance to the physics. JDL and JP HY are computed individually in (21). Nu symbolizes the number of training samples, and Nf is the number of collocation points.    JDL = 1 Nu Nu(cid:88) k=1 |u(x, y, z, t) − ˆu(x, y, z, t)|2 JP HY = 1 Nf Nf (cid:88) k=1 |f (x, y, z, t)|2 (21) In (21), cost function f (x, y, z, t) is configured to quantify the non-compliance of the physics. As in the exemplary Fig. 2, which outlines the architecture of a PIDL neural network, the cost function of JP HY is given as f = λ1u + λ2ux + λ3uxy + λ4uzz + λ5ut. The cost terms ux, uxy, uzz, and ut are partial derivatives of the output ˆu(x, y, z, t) with respect to a few combinations of input coordinates (x, y, z, t). The λ parameters represent the weights of cost terms. 3.1 PIDL FOR TRAFFIC STATE ESTIMATION This section provides details of the PIDL approach for traffic state estimation (TSE) by using LWR PDE and Green- shield's fundamental diagram. Other physical models, such as second order flow models or discretized first order models 6 On the Limitations of Physics-informed Deep Learning A PREPRINT Figure 2: Architecture of a Physics-informed Deep Learning (PIDL) Neural Network can be obtained by following the steps laid out in this section. PIDL empowers a DL neural network with the system's governing physical laws as priori knowledge [29]. The fundamental diagram of traffic flow and the conservation law serve as meaningful know-how in training a neural network to recognize the underlying relationship between traffic variables. Several fundamental diagrams exist and are used accordingly depending on the situation. The commonly-used ones are: piece-wise affine speed-density relationship [14], triangular fundamental diagram [57], etc. Greenshield's fundamental diagram [58], is one of the most utilized and simplest models in traffic flow theory. It makes an untangling assumption that the mean velocity has a linear relationship with the density. The relationship between traffic variables is described in (22), where ρm is the maximum density, sm is the minimum spacing, and vf is the free-flow speed.    (cid:18) q(x, t) = ρ(x, t) vf 1 − (cid:18) v(x, t) = vf 1 − ρ(x, t) ρm (cid:19) ρ(x, t) ρm (cid:19) (22) Plugging the relationship between variables ρ, v, and q from (22) into the Eulerian formulation of conservation law in (8), the physical law can be written as (23) and (24). For (x, t) ∈ [ x0, xn] × [ t0, tm], (cid:18) ρm 1 − 2v(x, t) vf (cid:19) ∂v(x, t) ∂x − ρm vf ∂v(x, t) ∂t = 0 For (x, t) ∈ [ x0, xn] × [ t0, tm], (cid:18) vf 1 − 2ρ(x, t) ρm (cid:19) ∂ρ(x, t) ∂x + ∂ρ(x, t) ∂t = 0 (23) (24) Observe that both the equations provide the same physical law - the only difference is their dependent variable. Equation (23) formulates the law in terms of velocity v(x, t), whereas (24) formulates it in terms of density ρ(x, t). Both (23) and (24) are hyperbolic PDEs. A second order diffusive term can be added to make the PDE become parabolic and secure a strong solution. For example, (24) will become (25) where (cid:15) is a constant of a small value. For (x, t) ∈ [ x0, xn] × [ t0, tm], (cid:18) vf 1 − 2ρ(x, t) ρm (cid:19) ∂ρ(x, t) ∂x + ∂ρ(x, t) ∂t = (cid:15) ∂2ρ(x, t) ∂x2 (25) 7 xytzu OutputYesNo, Repeat OptimizationDeep Learning Neural NetworkPhysical LawsGoverning Equation CostThreshold On the Limitations of Physics-informed Deep Learning A PREPRINT The second order diffusion term ensures the solution of PDE is continuous and differentiable, avoiding the breakdown and discontinuity in the solution to the PDE. 3.2 TRAINING DATA AND COST FUNCTIONS The cost function of a PIDL neural network reconstructing a density-field ρ(x t) is written as (26), where JDL is computed at observation points O = {(xj o)|j = 1, 2, * * * , No}, and JP HY is obtained at the collocation points C = {(xj c)|j = 1, 2, * * * , Nc}. o, tj c, tj    JDL = 1 No No(cid:88) j=1 (cid:12) (cid:12)ρ(xj o, tj o) − ˆρ(xj o, tj 2 o)(cid:12) (cid:12) JP HY = 1 Nc Nc(cid:88) j=1 ) ∂ ˆρ(xj c, tj c) ∂x 2ˆρ(xj c, tj (cid:12) c) (cid:12) (cid:12)vf (1 − ρm ∂ ˆρ(xj c, tj (cid:12) c) 2 (cid:12) (cid:12) ∂t + (26) Weights can be assigned to the cost terms of JDL and JP HY in constituting the cost function of PIDL, as composed in (27). J = μ1 ∗ JDL + μ2 ∗ JP HY (27) where weight parameters μ1 and μ2 adjust the scales of the DL-cost and the physics-cost. 3.3 TRAINING APPROACHES There are many optimization algorithms to train a neural network, here we provide brief information on the following training approaches we used in this work. 3.3.1 L-BFGS-B Limited memory, boundary constraints Broyden–Fletcher–Goldfarb–Shanno algorithm [59] is one of the default optimizers of scipy.optimize.minimize in the scientific computing library SciPy [60]. Under the default setting, the optimization process terminates when the difference of cost f tol between iterations is less than 2.22e-16. 3.3.2 Adam Adaptive moment estimation (Adam) [61] takes the advantages in the Momentum [62] and the RMSProp [63] optimiza- tion algorithms by monitoring the accumulation of both the gradient and the squared gradient, using β1 and β2 as the decay terms shown in (28). ∆θi,t = ∇J (θi,t) Gi,t = β1Gi,t−1 + (1 − β1)∆θi,t Ei,t = β2Ei,t−1 + (1 − β2)(∆θi,t)2 Ei,t Gi,t + (cid:15) θi,t+1 = θi,t − α ∆θi,t (28) 3.4 ERROR METRIC Relative L2 Error - To evaluate the inaccuracy of a trained neural network, we establish the relative L2 error term, which is defined in (29), using vehicle density ρ(x, t) as the exemplary dependent variable. 8 On the Limitations of Physics-informed Deep Learning A PREPRINT Lerror 2 = = (cid:13) (cid:13) (cid:13)F (cid:13) (cid:13)P − ˆP (cid:13) (cid:107)P(cid:107)F (cid:113)(cid:80)N1*N2 j=1 (cid:12)ˆρ(x(j), t(j)) − ρ(x(j), t(j))(cid:12) (cid:12) (cid:12) (cid:12)ρ(x(j), t(j))(cid:12) (cid:12) (cid:12) (cid:113)(cid:80)N1*N2 2 j=1 2 (29) where P is the matrix form of ρ(x, t), and ˆP is the neural network's estimation of P. After discretizing the density field ρ(x, t) in time and space, N1 is the number of temporal bins and N2 is the number of spatial bins. 4 CASE STUDY I - INSIGHTS FROM TESTBED In this case study, we compare the PIDL reconstruction accuracy between learning the LWR conservation law (hyper- bolic) and its parabolic form. The datasets used in this case study are synthetic vehicle density datasets generated on a ring road (represented by Fig. 3). We configure all the neural networks with the same learning architecture (equal numbers of layers, same number of neurons on each layer, etc.). 10000 collocation points are assigned in the density field to compute the physics-cost. The learning rate of Adam is set to 0.001, and the number of training iterations is set to 8000. Figure 3: Ring Road Configuration of the Datasets 4.1 DATASET The datasets for this case study simulate vehicular traffic on a ring road. The location x and time t are normalized as x, t ∈ [0, 1.0] × [0, 3.0]. The road is evenly divided into 240 spatial units with ∆x = 1/240, and time is similarly separated into 960 units and each timestep represents the progression of ∆t = 1/320. The traffic state variable of interest in this case study is the vehicle density ρ(x, t). The assumed physical model is LWR conservation law, paired with Greenshield's fundamental diagram (FD) formulated in (22). The values of the free flow speed vf and the maximum density ρm are normalized as well as both are set to 1. We first generate the dataset shown in Fig. 4a, by using the LWR conservation law (hyperbolic PDE) in (24). Based on the same initial and boundary conditions, and only adding a diffusion term to the LWR PDE to make it parabolic, as explained in (25), we are able to configure the dataset illustrated in Fig. 4b by the parabolic form of LWR PDE. The relative mean squared value of the difference between these two datasets in Fig. 4 is 0.35%, indicating almost identical density values of the datasets. 4.2 SELECTION OF LEARNING DATA INSTANCES The sampling of available data for learning is an important aspect of machine learning. Data collection and sensing may introduce potential biases, often due to human factors and sensing limitations. These biases can persist in the models that are trained on the data, highlighting the importance of selecting appropriate subsets of the data to minimize these biases. However, in many instances, the selection of training instances is limited by the availability and positions of the sensors. E.g. for traffic sensing, the sensors are either fixed on the roadside at fixed intervals (e.g., loop detectors) or they are moving with the traffic stream (probe vehicles, CVs). Fig. 5 demonstrates the sampling cases of traffic state data. Numerical PDE solvers such as Lax-Friedrichs' numerical scheme [64] can be used as a state reconstruction 9 On the Limitations of Physics-informed Deep Learning A PREPRINT (a) Dataset with hyperbolic conservation law (b) Dataset with parabolic conservation law Figure 4: Ring Road Vehicle Density Experimental Data tool; however, it requires the complete information on the initial and boundary conditions as shown in Fig. 5a which is not practically feasible. On the other hand, the PIDL approach can utilize any given amount of inputs from the boundaries for training; in Fig. 5b, 20% of the initial and boundary data are shown as an exemplar training setting. Fig. 5c represents the Eulerian traffic data that can be gathered from roadside sensors or loop detectors installed at predetermined locations along the road infrastructure (shown at x = 0, 0.25, 0.5, 0.75, 1.0 in this instance). Finally, Fig. 5d exhibits the Lagrangian traffic data that can be collected by connected vehicles, which can muster traffic state information at various locations along the vehicle trajectories. Notice the gaps between the Eulerian data in Fig. 5c; these represent the occasional sensor failures or malfunctions, resulting in data loss in this scenario. (a) Lax–Friedrichs', All Boundary & Initial Observations (b) PIDL, 20% Boundary & Initial Observations (c) Eulerian Observations (d) Lagrangian Observations Figure 5: Selection of Learning Data Instances Given the sampling choices, we designate two subsets of training data inputs about the vehicle density ρ(x, t): (1) initial and boundary condition data inputs and (2) interior data inputs. The interior data of the density field can be collected by either roadside detectors (Eulerian) or connected vehicles (Lagrangian). In the case study, we select the Lagrangian data from CV as the interior data. 1. Initial condition data are the vehicle density values ρ(x, 0) as t = 0, x ∈ [0, 1.0]. Boundary condition data include vehicle density values at the first location ρ(0, t), t ∈ [0, 3.0], and at the last location ρ(1.0, t), t ∈ [0, 3.0]. 2. Interior data (CV data in the case study) ρ(x, t) comes from the CV fleet in the traffic. They can be gathered at any randomly selected location along the vehicle trajectory and reflect the density value ρ(x, t), given x ∈ [0, 1.0] and t ∈ [0, 3.0] . The initial condition data on vehicle density can be registered through a still image, recorded by devices such as roadside video cameras or drones. The boundary condition data can be obtained from a stationary detector deployed along a freeway at the start location x = 0, and the end location x = 1.0 (normalized). 10 0.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [Hyperbolic PDE Dataset]0.250.500.750.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [Parabolic PDE Dataset]0.250.500.750.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [Lax–Friedrichs]0.250.500.750.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [20% Boundary Observations]0.250.500.750.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [Eulerian Observations]0.250.500.750.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [Lagrangian Observations]0.250.500.75 On the Limitations of Physics-informed Deep Learning A PREPRINT 4.3 RECONSTRUCTION WITH INITIAL AND BOUNDARY INPUTS We first evaluate the PIDL results based only on training inputs about the initial and boundary conditions. We select four levels of available training inputs (10%, 20%, 50%, and 90% of the total numbers of initial and boundary data), and use both L-BFGS-B and Adam optimizers to reconstruct the hyperbolic LWR PDE and its parabolic variation with the diffusion term. The results are shown in Table 1 (best results are shown in bold). The reconstructed density fields, trained with 10% initial and boundary inputs, are shown in Fig. 6. Table 1: Density Reconstruction Results (with Initial and Boundary Inputs), Relative L2 Error Initial and Boundary Inputs No1 10% 20% 50% 90% L-BFGS-B (parabolic) 1.64e-02 3.68e-03 5.47e-03 4.77e-03 Relative L2 Error L-BFGS-B (hyperbolic) 3.09e-01 3.03e-01 2.52e-01 2.85e-01 Adam (parabolic) 6.30e-02 4.73e-02 8.07e-02 3.61e-02 Adam (hyperbolic) 3.03e-01 2.98e-01 2.86e-01 2.83e-01 Among all training settings, we observe that PIDL models achieved much higher accuracy (lower relative L2 error) in reconstructing the parabolic PDE with the diffusion term compared to the ones with the hyperbolic LWR PDE. Trained with the L-BFGS-B optimizer and 10% boundary and initial observations, the relative L2 error of PIDL reconstruction is 0.0164, which is merely 5.3% of the 0.309 error of the same metric in reconstructing the hyperbolic LWR PDE. We also take several snapshots of the reconstruction at time t = 0, 0.5, 1.0, 1.5, 2.0, 2.5 for comparison. From Fig. 6b, we notice that PIDL learning the hyperbolic PDE encountered difficulties in reconstructing the density state at locations where the discontinuity of density data occurs. However, in Fig. 6a, equipped with the diffusion term in the parabolic PDE, the reconstruction result is smoothed and closely aligned with the ground truth. 4.4 RECONSTRUCTION WITH INITIAL, BOUNDARY, AND INTERIOR INPUTS Subsequently, here we evaluate the reconstruction accuracy under the scenarios in which varying levels of data on the initial and boundary conditions and the interior conditions (CV inputs) are available. We pick two levels of available inputs No1 on the initial and boundary conditions: (1) No1 = 108 inputs, representing 5% of initial and boundary data; and (2) No1 = 432 inputs, representing 20% of the available data. For the number of CV inputs No2, we also choose two settings: No2 = 1146 and No2 = 4584, accounting for 0.5% and 2% of the interior of the density field, respectively. The reconstruction result, measured by the relative L2 error defined in (29) is shown in Table 2 (again, best results are tabulated in bold). The reconstruction results with 20% initial and boundary inputs (No1 = 432), and 2% CV inputs (No2 = 4584) are shown in Fig. 7. Table 2: Density Reconstruction Results (with Initial and Boundary Inputs & CV Inputs), Relative L2 Error Initial and Boundary Inputs No1 CV Inputs No2 5% 5% 20% 20% 0.5% 2% 0.5% 2% L-BFGS-B (parabolic) 8.33e-03 6.05e-03 4.50e-03 3.88e-03 Relative L2 Error L-BFGS-B (hyperbolic) 2.45e-01 2.37e-01 2.23e-01 2.25e-01 Adam (parabolic) 7.65e-02 1.41e-01 4.29e-02 1.24e-01 Adam (hyperbolic) 2.53e-01 2.66e-01 2.48e-01 2.47e-01 Comparing to the results in Table 1, we find the inclusion of CV inputs in the training inputs of PIDL slightly improves the reconstruction accuracy with the hyperbolic PDE. However, the learning performances of PIDL architecture with the parabolic PDE are still far superior. With 20% initial and boundary observations, and 2% CV inputs, the PIDL model with L-BFGS-B optimizer achieves a relative L2 error of 0.00388 for reconstructing the parabolic PDE, which is 1.72% of the relative L2 error with the hyperbolic PDE, at 0.225. 11 On the Limitations of Physics-informed Deep Learning A PREPRINT (a) Learning parabolic conservation law using L-BFGS-B optimizer, relative L2 error: 0.0164 (b) Learning hyperbolic conservation law using L-BFGS- B optimizer, relative L2 error: 0.309 (c) Learning parabolic conservation law using Adam op- timizer, relative L2 error: 0.0630 (d) Learning hyperbolic conservation law using Adam op- timizer, relative L2 error: 0.303 Figure 6: Density Reconstruction, Trained with 10% Initial and Boundary Inputs 12 0.00.51.01.52.02.53.0Time t0.00.51.0Location xDensity Reconstruction ρ(x,t), [L-BFGS-B, Parabolic]0.250.500.750.00.51.0x0.000.250.500.751.00ρ(x,t)t=00.00.51.0x0.000.250.500.751.00ρ(x,t)t=0.50.00.51.0x0.000.250.500.751.00ρ(x,t)t=1.00.00.51.0x0.000.250.500.751.00ρ(x,t)t=1.50.00.51.0x0.000.250.500.751.00ρ(x,t)t=2.00.00.51.0x0.000.250.500.751.00ρ(x,t)t=2.5Ground TruthReconstruction0.00.51.01.52.02.53.0Time t0.00.51.0Location xDensity Reconstruction ρ(x,t), [L-BFGS-B, Hyperbolic]0.250.500.750.00.51.0x0.000.250.500.751.00ρ(x,t)t=00.00.51.0x0.000.250.500.751.00ρ(x,t)t=0.50.00.51.0x0.000.250.500.751.00ρ(x,t)t=1.00.00.51.0x0.000.250.500.751.00ρ(x,t)t=1.50.00.51.0x0.000.250.500.751.00ρ(x,t)t=2.00.00.51.0x0.000.250.500.751.00ρ(x,t)t=2.5Ground TruthReconstruction0.00.51.01.52.02.53.0Time t0.00.51.0Location xDensity Reconstruction ρ(x,t), [Adam, Parabolic]0.250.500.750.00.51.0x0.000.250.500.751.00ρ(x,t)t=00.00.51.0x0.000.250.500.751.00ρ(x,t)t=0.50.00.51.0x0.000.250.500.751.00ρ(x,t)t=1.00.00.51.0x0.000.250.500.751.00ρ(x,t)t=1.50.00.51.0x0.000.250.500.751.00ρ(x,t)t=2.00.00.51.0x0.000.250.500.751.00ρ(x,t)t=2.5Ground TruthReconstruction0.00.51.01.52.02.53.0Time t0.00.51.0Location xDensity Reconstruction ρ(x,t) [Adam, Hyperbolic]0.250.00.51.0x0.000.250.500.751.00ρ(x,t)t=00.00.51.0x0.000.250.500.751.00ρ(x,t)t=0.50.00.51.0x0.000.250.500.751.00ρ(x,t)t=1.00.00.51.0x0.000.250.500.751.00ρ(x,t)t=1.50.00.51.0x0.000.250.500.751.00ρ(x,t)t=2.00.00.51.0x0.000.250.500.751.00ρ(x,t)t=2.5Ground TruthReconstruction On the Limitations of Physics-informed Deep Learning A PREPRINT (a) L-BFGS-B with parabolic conservation law, relative L2 error: 0.00388 (b) L-BFGS-B with hyperbolic conservation law, relative L2 error: 0.225 (c) Adam with parabolic conservation law, relative L2 error: 0.124 (d) Adam with hyperbolic conservation law, relative L2 error: 0.247 Figure 7: Density Reconstruction, 20% Initial and Boundary Inputs & 2% CV Inputs 5 CASE STUDY II - INSIGHTS FROM FIELD DATA In this section, we will further shed light on the topic using field data. We examine the limitation with PIDL and compare it with Lax-Friedrichs' numerical scheme [65] in learning the traffic density using the "Next Generation SIMulation" (NGSIM) dataset [66]. 5.1 NGSIM DATASET The NGSIM dataset records traffic conditions using video cameras and processes the traffic state variables such as velocity and vehicle density through vehicle trajectories identified in the video recordings [67]. The vehicle density data used, illustrated in Fig. 8, contains vehicle density for 45-minute on a 2060-foot segment of U S − 101 freeway. Shockwaves of vehicles stopping due to traffic congestion, which back-propagates in space and forward-propagates in time, can be observed in the plot of vehicle density. This freeway segment has five lanes, one on-ramp and one off-ramp. An additional lane is attached to the freeway between the locations of the on-camp and the off-ramp. The data used was collected from 7:50 a.m. to 8:35 a.m. in Los Angeles, California, on June 15th, 2005. During the first 12 minutes of the data, a free-flow zone is observed in the post-off-ramp area, while the areas before the off-ramp are experiencing stop-and-go wave traffic [68]. Figure 8: Vehicle Density on US-101 Highway Segment, between 7:50 am and 8:35 am, NGSIM 13 0.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [L-BFGS-B, Parabolic]0.250.500.750.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [L-BFGS-B, Hyperbolic]0.250.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [Adam, Parabolic]0.000.250.500.00.51.01.52.02.53.0Time t0.00.51.0Location xρ(x,t), [Adam, Hyperbolic]0.000.250600120018002400Time t (s)0400800120016002000Location x (ft.)Density ρ(x,t) (veh./ft.)0.050.100.150.200.25 On the Limitations of Physics-informed Deep Learning A PREPRINT 5.2 FIELD DATA RECONSTRUCTION USING PIDL WITH HYPERBOLIC PDE The density dataset is tabulated with spatiotemporal bins of ∆x = 20f t and ∆t = 5s. At t = 0, the initial condition contains 104 data points along the 2060-ft road segment (x = 0, 20, ..., 2060). The lower bound condition at x = 0 and the upper bound condition at x = 2060 each has 540 boundary condition points (t = 0, 5, ..., 2695). Together, the initial and boundary condition data of vehicle density ρ(x, t) are all used as training inputs of PIDL with the L-BFGS-B optimizer. The governing physical equation of the PIDL architecture is the hyperbolic LWR conservation law paired with Greenshield's fundamental diagram. The estimated value of maximum density ρm is 0.12 vehicle per foot (sum of all traffic lanes), and the free-flow speed vf is estimated at 80 feet per second (54.54 miles per hour). The reconstruction result with PIDL is shown in Fig. 9. Figure 9: Reconstruction with PIDL, Relative L2 Error: 0.345 The relative L2 error of PIDL reconstruction is 0.345. From the snapshots of t = 0, 450, 900, 1350, 1800, 2250, PIDL tries to mimic the evolution of the density field between the lower boundary x = 0 and the upper boundary x = 2060; however, it cannot overcome the challenge in learning the stochastic perturbation of the density state. It is also evident in the reconstruction plot of ρ(x t) that the PIDL architecture overly generalizes the output and fails to capture any traffic patterns, such as the shockwaves present in the dataset. 5.3 FIELD DATA RECONSTRUCTION USING PIDL WITH PARABOLIC PDE For NGSIM US-101 data, the diffusion coefficient (cid:15) in Eqn. (25) is estimated to be 0.13 for regular motor vehicles [69]. We select a range of values at 0.05, 0.1, 0.13, 0.15, 0.20 for (cid:15) and reconstruct the density dataset using the LWR PDE with the addition of the diffusion term as the physics of PIDL. The reconstruction result with (cid:15) = 0.13 is shown in Fig. 10. We observe that with the realistic NGSIM dataset, the addition of the diffusion term only slightly improves the accuracy, landing a relative L2 error at 0.319. Similar to the troubles the PIDL neural network with hyperbolic LWR PDE encountered, the stochastic nature of traffic disturbance overcomes the PIDL's ability to accurately capture the traffic 14 0600120018002400Time t (s)0400800120016002000Location x (ft.)Reconstruction of ρ(x,t) (veh./ft.) in NGSIM [L-BFGS-B, Hyperbolic LWR PDE]0.05010002000x−0.050.000.050.100.150.200.25ρ(x,t)t=0010002000x50.050.000.050.100.150.200.25ρ(x,t)t=450s010002000x50.050.000.050.100.150.200.25ρ(x,t)t=900s010002000x50.050.000.050.100.150.200.25ρ(x,t)t=1350s010002000x50.050.000.050.100.150.200.25ρ(x,t)t=1800s010002000x50.050.000.050.100.150.200.25ρ(x,t)t=2250sGr−2,d Tr21(Rec−,01r2c1)−, On the Limitations of Physics-informed Deep Learning A PREPRINT Figure 10: Reconstruction with PIDL, (cid:15) = 0.13, Relative L2 Error: 0.319 state, with only boundary and initial observations. Our previous work [31] demonstrates that the inclusion of Lagrangian observations, such as CV data, will significantly improve PIDL performances in this case. We also conduct the sensitivity analysis on the diffusion coefficient (cid:15), and the results are presented in Table 3. With varying values of the diffusion coefficient (cid:15), the conclusion from this analysis is unwavering: although the diffusion term smooths out the reconstruction in areas where state discontinuity is present, it cannot accurately estimate the traffic state with only initial and boundary observations. Table 3: Relative L2 Error with Choices of Diffusion Coefficient (cid:15) Value of (cid:15) 0.05 0.10 0.13 0.15 0.20 Relative L2 Error 3.44e-01 3.23e-01 3.19e-01 3.10e-01 3.24e-01 5.4 RECONSTRUCTION USING LAX-FRIEDRICHS' NUMERICAL SCHEME The vehicle density dataset from NGSIM can also be reconstructed by using the Lax-Friedrichs' differencing method [70] with the complete initial and boundary conditions. The reconstruction is pictured in Fig. 11. Along with a smaller relative L2 error, the most significant improvement in the reconstruction result by the Lax- Friedrichs' method is the capability to capture and rebuilds the pattern of shockwaves in the dataset, based only on the inputs from the initial and boundary condition. The advantage of the numerical scheme resides in the ability to propagate the discontinuity in the density field based on the method of characteristics, while the PIDL architecture struggles with the reconstruction task. 15 0600120018002400Time t (s)0400800120016002000Location x (ft.)Reconstruction of ρ(x,t) (veh./ft.) in NGSIM [L-BFGS-B, Parabolic LWR ε=0.13]0.05010002000x−0.050.000.050.100.150.200.25ρ(x,t)t=0010002000x00.050.000.050.100.150.200.25ρ(x,t)t=450s010002000x00.050.000.050.100.150.200.25ρ(x,t)t=900s010002000x00.050.000.050.100.150.200.25ρ(x,t)t=1350010002000x00.050.000.050.100.150.200.25ρ(x,t)t=1800010002000x00.050.000.050.100.150.200.25ρ(x,t)t=2250Gro.)d Tr.−hReco),−r.c−io) On the Limitations of Physics-informed Deep Learning A PREPRINT Figure 11: Reconstruction with Lax-Friedrichs' Numerical Scheme, Relative L2 Error: 0.231 6 DISCUSSION ON RESULTS Recent examinations have elucidated the training limitations and drawbacks of data representation in PIDL. In several instances, unstable convergence occurs in the gradient-descent-based PIDL training, especially when the underlying PDE solution has high-frequency features [36]. This pathological behavior observed in PIDL training is due to the multi-scale interactions between the cost terms in optimizing the neural network cost [71]. It leads to stiffness in the gradient flow dynamics, ultimately inducing a severe constraint on the learning rate and adding detriment to the stability of the training process. PIDL, which often deploys fully-connected hidden layers, faces the challenge termed "spectral bias" that cannot reasonably assimilate a nonlinear hyperbolic PDE when its solution involves shocks in the field of data [72]. For a one-dimensional hyperbolic PDE with a non-convex flux function, its analytical solution can be depicted by a simple piecewise continuous function, and the stability of its solution can be significantly improved by adding a diffusion term to the inherent PDE. With smoothing around the shock by the diffusion, the neural network can recuperate the actual scale and location of the shock, solves the PDE in its parabolic form, and this leads to precise approximation results [73]. Suggestions on improvement: As we observe the physics-informed deep learning neural networks encounter struggles with approximating the vehicle density where localized non-linear discontinuity exists in the data, artificial dissipation should be added in order to improve the learning result of the hyperbolic conservation law [74, 75], and increased number of observations along the shock trajectories should be included in the training of the neural network [76]. Common practices assume the coefficient (cid:15) to be zero when fitting a realistic traffic dataset with LWR conservation law [25, 77], leaving out the diffusion effect. From Fig. 6a and Fig. 6b in Section 4, the inclusion of the diffusion term significantly improved the reconstruction accuracy of a PIDL neural network. The deficiency of PIDL with hyperbolic LWR PDE is not rooted in the learning architecture of the neural network or the hyperparameter selection [73]. The diffusion term enhances the stability of the gradient optimization process in training the neural network around the areas with state discontinuity and shockwaves. Based on the results in Section 5, PIDL with the parabolic variant of LWR PDE cannot overcome the random perturbation in the traffic dataset and accurately estimate the traffic density based on pure observation of the initial and boundary conditions. Our previous work suggests the benefit of including Lagrangian observation in this setting for the task of TSE [31]. In practice, the task of TSE involves realistic traffic data in which a diffusion term is inherent - drivers will gradually slow down the speed of their vehicles in participation of congestion or when a slowdown is visually perceivable. Therefore when adopting physics-informed deep learning for TSE, this nature of smoothness around shockwaves should be considered as part of the "physics", which illustrates the underlying relationship between traffic states. Recall the diffusion term in the parabolic form of LWR PDE is weighted by the parameter (cid:15). The value of (cid:15) is associated with drivers' behavior (reaction time to press the brake, for example) and should be tuned according to the traffic dataset before plugging in the conservation equation for the realistic reconstruction of the traffic data. Other approaches that transportation planners and agency practitioners can adopt is to include Lagrangian sensing data [31, 32], increasing the number of observation samples in the shockwave areas [76], and domain decomposition and projection onto the space of high-order polynomials [44]. 7 CONCLUSION In this work, we exhibited the difficulties of training a physics-informed deep learning (PIDL) neural network to reconstruct a certain type of partial differential equation (PDE) - the hyperbolic PDE for which a strong solution cannot be obtained. The non-smooth weak solution to conservation law-based traffic flow models (such as the LWR PDE) 16 0600120018002400Time t (s)0400800120016002000Location x (ft.)Density ρ(x,t) (veh./ft.)0.050.100.15 On the Limitations of Physics-informed Deep Learning A PREPRINT causes PIDL failure in capturing the scale and location of the discontinuity. Through the case study, we showcased the stark differences between the learning result using PIDL with the first order hyperbolic LWR PDE and its parabolic counterpart, in which the additional diffusion term secures a strong solution and leads to pinpoint approximation. When the PDE solution contains multi-scale features of high-frequency terms, it oftentimes causes severeness in calculating the gradients in the fully connected learning structure of a PIDL neural network [72], making the optimization process unstable and ultimately leads to inaccurate predictions [36, 78]. We observe that the deep learning neural network fails to approximate the nonlinear relationship of a hyperbolic PDE in areas where shockwaves are present, whereas the diffusion term in the parabolic PDE ensures improved data estimation in these areas and thus ameliorates the reconstruction result. Besides reconstructing using only the initial and boundary conditions, we list the possible sampling choices of traffic flow and use a diverse combination of Eulerian and Lagrangian data to ensure the reliability and validity of the results. Moreover, with the field data from the NGSIM traffic dataset, we further highlight the limitation of PIDL in the presence of shockwaves. Future work includes analysis of the cost evolution (over time) in reconstructing hyperbolic and parabolic PDEs to understand the interaction between the cost terms of the PIDL neural network and interpret its pathological behavior in learning conservation law-based models. ACKNOWLEDGMENT The authors wish to thank Dr. Rongye Shi at Columbia University for providing the ring road data for the case study, Dr. Animesh Biswas at the University of Nebraska at Lincoln for the LWR reconstruction of the data, and Dr. Pushkin Kachroo at the University of Nevada Las Vegas for the suggestions and discussions on the topic. References [1] Shaurya Agarwal, Pushkin Kachroo, Sergio Contreras, and Shankar Sastry. Feedback-coordinated ramp control of consecutive on-ramps using distributed modeling and godunov-based satisfiable allocation. IEEE Transactions on Intelligent Transportation Systems, 16(5):2384–2392, 2015. [2] Qing-Jie Kong, Zhipeng Li, Yikai Chen, and Yuncai Liu. An approach to urban traffic state estimation by fusing multisource information. IEEE Transactions on Intelligent Transportation Systems, 10(3):499–511, 2009. [3] Shaurya Agarwal, Pushkin Kachroo, and Sergio Contreras. A dynamic network modeling-based approach for traffic observability problem. IEEE Transactions on Intelligent Transportation Systems, 17(4):1168–1178, 2015. [4] Dong-wei Xu, Yong-dong Wang, Li-min Jia, Yong Qin, and Hong-hui Dong. Real-time road traffic state prediction based on arima and kalman filter. Frontiers of Information Technology & Electronic Engineering, 18(2):287–302, 2017. [5] Haibo Chen, Susan Grant-Muller, Lorenzo Mussone, and Frank Montgomery. A study of hybrid neural network approaches and the effects of missing data on traffic forecasting. Neural Computing & Applications, 10(3):277–286, 2001. [6] Néstor Cárdenas-Benítez, Raúl Aquino-Santos, Pedro Magaña-Espinoza, José Aguilar-Velazco, Arthur Edwards- Block, and Aldo Medina Cass. Traffic congestion detection system through connected vehicles and big data. Sensors, 16(5):599, 2016. [7] Elisabeth Uhlemann. Introducing connected vehicles [connected vehicles]. IEEE vehicular technology magazine, 10(1):23–31, 2015. [8] Yuheng Du, Mashrur Chowdhury, Mizanur Rahman, Kakan Dey, Amy Apon, Andre Luckow, and Linh Bao Ngo. A distributed message delivery infrastructure for connected vehicle technology applications. IEEE Transactions on Intelligent Transportation Systems, 19(3):787–801, 2017. [9] Pengbo Si, Yu He, Haipeng Yao, Ruizhe Yang, and Yanhua Zhang. Dave: Offloading delay-tolerant data traffic to connected vehicle networks. IEEE Transactions on Vehicular Technology, 65(6):3941–3953, 2016. [10] Toru Seo, Alexandre M Bayen, Takahiko Kusakabe, and Yasuo Asakura. Traffic state estimation on highway: A comprehensive survey. Annual reviews in control, 43:128–151, 2017. [11] Martin Greguri ́c, Miroslav Vuji ́c, Charalampos Alexopoulos, and Mladen Mileti ́c. Application of deep reinforce- ment learning in traffic signal control: An overview and impact of open traffic data. Applied Sciences, 10(11):4011, 2020. [12] Johannes Klepsch, Claudia Klüppelberg, and Taoran Wei. Prediction of functional arma processes with an application to traffic data. Econometrics and Statistics, 1:128–149, 2017. 17 On the Limitations of Physics-informed Deep Learning A PREPRINT [13] Carlos F Daganzo. The cell transmission model: A dynamic representation of highway traffic consistent with the hydrodynamic theory. Transportation Research Part B: Methodological, 28(4):269–287, 1994. [14] Laura Muñoz, Xiaotian Sun, Roberto Horowitz, and Luis Alvarez. Piecewise-linearized cell transmission model and parameter calibration methodology. Transportation Research Record, 1965:183–191, 2006. [15] Harold J Payne. Model of freeway traffic and control. Mathematical Model of Public System, pages 51–61, 1971. [16] AATM Aw and Michel Rascle. Resurrection of" second order" models of traffic flow. SIAM journal on applied mathematics, 60(3):916–938, 2000. [17] Li Li, Yuebiao Li, and Zhiheng Li. Efficient missing data imputing for traffic flow by considering temporal and spatial dependence. Transportation research part C: emerging technologies, 34:108–120, 2013. [18] Weihao Yin, Pamela Murray-Tuite, and Hesham Rakha. Imputing erroneous data of single-station loop detectors for nonincident conditions: Comparison between temporal and spatial methods. Journal of Intelligent Transportation Systems, 16(3):159–176, 2012. [19] Nicholas Polson and Vadim Sokolov. Bayesian particle tracking of traffic flows. IEEE Transactions on Intelligent Transportation Systems, 19(2):345–356, 2017. [20] Abdelhadi Azzouni and Guy Pujolle. A long short-term memory recurrent neural network framework for network traffic matrix prediction. arXiv preprint arXiv:1705.05690, 2017. [21] Dongjie Wang, Yan Yang, and Shangming Ning. Deepstcl: A deep spatio-temporal convlstm for travel demand prediction. In 2018 international joint conference on neural networks (IJCNN), pages 1–8. IEEE, 2018. [22] Nikolaos Bekiaris-Liberis, Claudio Roncoli, and Markos Papageorgiou. Highway traffic state estimation with mixed connected and conventional vehicles. IEEE Transactions on Intelligent Transportation Systems, 17(12):3484–3497, 2016. [23] Tony Z Qiu, Xiao-Yun Lu, Andy HF Chow, and Steven E Shladover. Estimation of freeway traffic density with loop detector and probe vehicle data. Transportation Research Record, 2178(1):21–29, 2010. [24] Dongwei Xu, Chenchen Wei, Peng Peng, Qi Xuan, and Haifeng Guo. Ge-gan: A novel deep learning framework for road traffic state estimation. Transportation Research Part C: Emerging Technologies, 117:102635, 2020. [25] Rongye Shi, Zhaobin Mo, and Xuan Di. Physics-informed deep learning for traffic state estimation: A hy- brid paradigm informed by second-order traffic models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 540–547, 2021. [26] Zhaobin Mo, Rongye Shi, and Xuan Di. A physics-informed deep learning paradigm for car-following models. Transportation research part C: emerging technologies, 130:103240, 2021. [27] Matthieu Barreau, Miguel Aguiar, John Liu, and Karl Henrik Johansson. Physics-informed learning for identifica- tion and state reconstruction of traffic density. In 2021 60th IEEE Conference on Decision and Control (CDC), pages 2653–2658. IEEE, 2021. [28] Felix Rempe, Allister Loder, and Klaus Bogenberger. Estimating motorway traffic states with data fusion and physics-informed deep learning. In 2021 IEEE International Intelligent Transportation Systems Conference (ITSC), pages 2208–2214. IEEE, 2021. [29] Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part i): Data-driven solutions of nonlinear partial differential equations. arXiv preprint arXiv:1711.10561, 2017. [30] Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part ii): Data-driven discovery of nonlinear partial differential equations. arXiv preprint arXiv:1711.10566, 2017. [31] Archie J Huang and Shaurya Agarwal. Physics-informed deep learning for traffic state estimation: Illustrations with lwr and ctm models. IEEE Open Journal of Intelligent Transportation Systems, 3:503–518, 2022. [32] Archie J Huang and Shaurya Agarwal. Physics informed deep learning for traffic state estimation. In 2020 IEEE 23rd International Conference on Intelligent Transportation Systems (ITSC), pages 1–6. IEEE, 2020. [33] Rongye Shi, Zhaobin Mo, and Xuan Di. Physics-informed deep learning for traffic state estimation: A hy- brid paradigm informed by second-order traffic models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 540–547, 2021. [34] Sifan Wang and Paris Perdikaris. Deep learning of free boundary and stefan problems. Journal of Computational Physics, 428:109914, 2021. [35] Jiequn Han, Arnulf Jentzen, and Weinan E. Solving high-dimensional partial differential equations using deep learning. Proceedings of the National Academy of Sciences, 115(34):8505–8510, 2018. 18 On the Limitations of Physics-informed Deep Learning A PREPRINT [36] Yinhao Zhu, Nicholas Zabaras, Phaedon-Stelios Koutsourelakis, and Paris Perdikaris. Physics-constrained deep learning for high-dimensional surrogate modeling and uncertainty quantification without labeled data. Journal of Computational Physics, 394:56–81, 2019. [37] Dongkun Zhang, Ling Guo, and George Em Karniadakis. Learning in modal space: Solving time-dependent stochastic pdes using physics-informed neural networks. SIAM Journal on Scientific Computing, 42(2):A639– A665, 2020. [38] Maziar Raissi, Alireza Yazdani, and George Em Karniadakis. Hidden fluid mechanics: Learning velocity and pressure fields from flow visualizations. Science, 367(6481):1026–1030, 2020. [39] Maziar Raissi, Zhicheng Wang, Michael S Triantafyllou, and George Em Karniadakis. Deep learning of vortex- induced vibrations. Journal of Fluid Mechanics, 861:119–137, 2019. [40] Luning Sun, Han Gao, Shaowu Pan, and Jian-Xun Wang. Surrogate modeling for fluid flows based on physics- constrained deep learning without simulation data. Computer Methods in Applied Mechanics and Engineering, 361:112732, 2020. [41] Georgios Kissas, Yibo Yang, Eileen Hwuang, Walter R Witschey, John A Detre, and Paris Perdikaris. Machine learning in cardiovascular flows modeling: Predicting arterial blood pressure from non-invasive 4d flow mri data using physics-informed neural networks. Computer Methods in Applied Mechanics and Engineering, 358:112623, 2020. [42] Yuyao Chen, Lu Lu, George Em Karniadakis, and Luca Dal Negro. Physics-informed neural networks for inverse problems in nano-optics and metamaterials. Optics express, 28(8):11618–11633, 2020. [43] Ehsan Haghighat, Maziar Raissi, Adrian Moure, Hector Gomez, and Ruben Juanes. A physics-informed deep learning framework for inversion and surrogate modeling in solid mechanics. Computer Methods in Applied Mechanics and Engineering, 379:113741, 2021. [44] Ehsan Kharazmi, Zhongqiang Zhang, and George Em Karniadakis. hp-vpinns: Variational physics-informed neural networks with domain decomposition. Computer Methods in Applied Mechanics and Engineering, 374:113547, 2021. [45] Liu Yang, Xuhui Meng, and George Em Karniadakis. B-pinns: Bayesian physics-informed neural networks for forward and inverse pde problems with noisy data. Journal of Computational Physics, 425:109913, 2021. [46] Simin Shekarpaz, Mohammad Azizmalayeri, and Mohammad Hossein Rohban. Piat: Physics informed adversarial training for solving partial differential equations. arXiv preprint arXiv:2207.06647, 2022. [47] Caio Davi and Ulisses Braga-Neto. Pso-pinn: Physics-informed neural networks trained with particle swarm optimization. arXiv preprint arXiv:2202.01943, 2022. [48] Archie J. Huang and Shaurya Agarwal. Physics informed deep learning for traffic state estimation. In 2020 IEEE 23rd International Conference on Intelligent Transportation Systems (ITSC), pages 1–6, 2020. [49] Baver Okutmu ̧stur. Scalar conservation laws. In Advanced Computational Fluid Dynamics for Emerging Engineering Processes-Eulerian vs. Lagrangian. IntechOpen, 2019. [50] Puneet Lakhanpal. Numerical simulations of traffic flow models. 2014. [51] Michael James Lighthill and Gerald Beresford Whitham. On kinematic waves ii. a theory of traffic flow on long crowded roads. Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences, 229(1178):317–345, 1955. [52] Sergio Contreras, Pushkin Kachroo, and Shaurya Agarwal. Observability and sensor placement problem on highway segments: A traffic dynamics-based approach. IEEE Transactions on Intelligent Transportation Systems, 17(3):848–858, 2015. [53] Justin Sirignano and Konstantinos Spiliopoulos. Dgm: A deep learning algorithm for solving partial differential equations. Journal of computational physics, 375:1339–1364, 2018. [54] Atılım Günes Baydin, Barak A Pearlmutter, Alexey Andreyevich Radul, and Jeffrey Mark Siskind. Automatic differentiation in machine learning: a survey. The Journal of Machine Learning Research, 18(1):5595–5637, 2017. [55] Chengping Rao, Hao Sun, and Yang Liu. Physics informed deep learning for computational elastodynamics without labeled data. arXiv preprint arXiv:2006.08472, 2020. [56] Michael D McKay, Richard J Beckman, and William J Conover. A comparison of three methods for selecting values of input variables in the analysis of output from a computer code. Technometrics, 42(1):55–61, 2000. [57] GB Whitham. Linear and nonlinear waves john wiley & sons. Inc., New York, 1974. 19 On the Limitations of Physics-informed Deep Learning A PREPRINT [58] BD Greenshields, Ws Channing, Hh Miller, et al. A study of traffic capacity. In Highway research board proceedings, volume 1935. National Research Council (USA), Highway Research Board, 1935. [59] Dong C Liu and Jorge Nocedal. On the limited memory bfgs method for large scale optimization. Mathematical programming, 45(1):503–528, 1989. [60] Pauli Virtanen, Ralf Gommers, Travis E Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, et al. Scipy 1.0: fundamental algorithms for scientific computing in python. Nature methods, 17(3):261–272, 2020. [61] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [62] Ning Qian. On the momentum term in gradient descent learning algorithms. Neural networks, 12(1):145–151, 1999. [63] Tijmen Tieleman, Geoffrey Hinton, et al. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26–31, 2012. [64] Lawrence F Shampine. Two-step lax–friedrichs method. Applied Mathematics Letters, 18(10):1134–1136, 2005. [65] Joseph M Powers. Numerical solutions to scalar conservation laws. 2020. [66] US Department of Transportation. "fhwa, 2008a. ngsim – next generation simulation" accessed may 24, 2021, 2021. [67] Allan M Avila. Applications of Koopman Operator Theory to Highway Traffic Dynamics. University of California, Santa Barbara, 2017. [68] Allan M Avila and I Mezi ́c. Data-driven analysis and forecasting of highway traffic dynamics. Nature communic- ations, 11(1):1–16, 2020. [69] Tu Xu and Jorge Laval. Driver reactions to uphill grades: inference from a stochastic car-following model. Transportation research record, 2674(11):343–351, 2020. [70] Randall J LeVeque and Randall J Leveque. Numerical methods for conservation laws, volume 214. Springer, 1992. [71] Sifan Wang, Yujun Teng, and Paris Perdikaris. Understanding and mitigating gradient flow pathologies in physics-informed neural networks. SIAM Journal on Scientific Computing, 43(5):A3055–A3081, 2021. [72] Sifan Wang, Xinling Yu, and Paris Perdikaris. When and why pinns fail to train: A neural tangent kernel perspective. Journal of Computational Physics, 449:110768, 2022. [73] Olga Fuks and Hamdi A Tchelepi. Limitations of physics informed machine learning for nonlinear two-phase transport in porous media. Journal of Machine Learning for Modeling and Computing, 1(1), 2020. [74] Cedric G Fraces, Adrien Papaioannou, and Hamdi Tchelepi. Physics informed deep learning for transport in porous media. buckley leverett problem. arXiv preprint arXiv:2001.05172, 2020. [75] Cedric Fraces Gasmi and Hamdi Tchelepi. Physics informed deep learning for flow and transport in porous media. arXiv preprint arXiv:2104.02629, 2021. [76] Ruben Rodriguez-Torrado, Pablo Ruiz, Luis Cueto-Felgueroso, Michael Cerny Green, Tyler Friesen, Sebastien Matringe, and Julian Togelius. Physics-informed attention-based neural network for hyperbolic partial differential equations: application to the buckley–leverett problem. Scientific reports, 12(1):1–12, 2022. [77] Shimao Fan and Benjamin Seibold. Data-fitted first-order traffic models and their second-order generalizations: Comparison by trajectory and sensor data. Transportation research record, 2391(1):32–43, 2013. [78] Maziar Raissi. Deep hidden physics models: Deep learning of nonlinear partial differential equations. The Journal of Machine Learning Research, 19(1):932–955, 2018. 20
http://arxiv.org/abs/2302.12336v1
2023-02-23T21:07:00
2023-02-23T21:07:00
Physics Informed Deep Learning: Applications in Transportation
A recent development in machine learning - physics-informed deep learning (PIDL) - presents unique advantages in transportation applications such as traffic state estimation. Consolidating the benefits of deep learning (DL) and the governing physical equations, it shows the potential to complement traditional sensing methods in obtaining traffic states. In this paper, we first explain the conservation law from the traffic flow theory as ``physics'', then present the architecture of a PIDL neural network and demonstrate its effectiveness in learning traffic conditions of unobserved areas. In addition, we also exhibit the data collection scenario using fog computing infrastructure. A case study on estimating the vehicle velocity is presented and the result shows that PIDL surpasses the performance of a regular DL neural network with the same learning architecture, in terms of convergence time and reconstruction accuracy. The encouraging results showcase the broad potential of PIDL for real-time applications in transportation with a low amount of training data.
[ "Archie J. Huang", "Shaurya Agarwal" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12336v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12336v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.NA", "math.NA" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 6 3 3 2 1 . 2 0 3 2 : v i X r a PHYSICS INFORMED DEEP LEARNING: APPLICATIONS IN TRANSPORTATION A PREPRINT Archie J. Huang , Shaurya Agarwal UrbanITY Lab Civil, Environmental & Construction Engineering Department University of Central Florida Orlando, FL 32816, USA [email protected], [email protected] ABSTRACT A recent development in machine learning - physics-informed deep learning (PIDL) - presents unique advantages in transportation applications such as traffic state estimation. Consolidating the benefits of deep learning (DL) and the governing physical equations, it shows the potential to complement traditional sensing methods in obtaining traffic states. In this paper, we first explain the conservation law from the traffic flow theory as "physics", then present the architecture of a PIDL neural network and demonstrate its effectiveness in learning traffic conditions of unobserved areas. In addition, we also exhibit the data collection scenario using fog computing infrastructure. A case study on estimating the vehicle velocity is presented and the result shows that PIDL surpasses the performance of a regular DL neural network with the same learning architecture, in terms of convergence time and reconstruction accuracy. The encouraging results showcase the broad potential of PIDL for real-time applications in transportation with a low amount of training data. Keywords Traffic State Estimation * Physics-informed Deep Learning * Traffic Flow Theory * Conservation law 1 Introduction and Motivation Development in deep learning (DL) neural networks [1] [2] benefits a wide range of engineering applications. The learning capability of a DL neural network helps practitioners in numerous fields such as transportation engineering and has been widely adopted in projects on object detection, autonomous driving, and estimations of system conditions. Traffic state estimation (TSE) is a crucial task for transportation planners in understanding travel demand and road infrastructure's level of service (LOS). Due to the cost constraints associated with installing sensing devices along freeways and arterial roads, traffic observations can solely be obtained at predetermined locations, leaving areas where traffic conditions are unperceived. Traffic states such as vehicle speed v, density ρ, and flow f in the unobserved regions need to be approximated by using the collected measurements of traffic at sparse locations [3]. Take loop detectors as an example: the signal indicating the passage of a vehicle can only be obtained at predetermined locations where the electrically conducting loops are planted. The number of detectors deployed considerably affects the quantity of traffic data collected from a highway system [4]. The task of TSE is further impeded by issues such as the measurement noise in detectors and data loss due to sensor malfunctions [5] [6] [7]. The inaccuracy in recorded traffic data and the limited data resolution during signal processing contribute to the challenges in precise TSE [8] [9]. Fig. 1 illustrates the process of traffic state data acquisition: sensing devices collect information such as speed v and headway T at designated locations and broadcast the information to central cloud infrastructure for data processing and storage. Note that the location of sensors (loop detectors, radars, or roadside units (RSUs) only provides sparse measurement, and traditionally model-based methods such as Kalman filter have been used to estimate traffic conditions PIDL Applications in Transportation A PREPRINT Figure 1: Process of Traffic State Data Acquisition in regions without observed data. However, the model-driven approaches are restricted by the accuracy of the model and its chosen parameters. Development in DL such as long short-term memory (LSTM) and recurrent neural networks (RNNs) have successfully captured the underlying relationships among traffic states [10], showing promise in TSE. Nevertheless, the DL approaches are data-hungry and computationally intensive. Readers are redirected to [11] for a detailed discussion on state-of-the-art TSE approaches. Given the sparse observation of traffic, it may also be prone to the overfitting issue. Research questions: A careful analysis of the aforementioned literature prompts the following research question: can governing physical equations come to aid the data-hungry DL neural network, and improve its estimation accuracy by preempting overfitting? This paper presents details of physics-informed deep learning (PIDL), which integrates the cost terms of a regular neural network with the underlying relationship between state variables, and displays PIDL application in TSE using the Lighthill-Whitham-Richards (LWR) conservation law. The work is inspired by the development of training DL neural networks with the aid of governing differential equations [12] [13] and built upon our previous research on traffic state estimation [11] [14]. The results show great potential in TSE applications to obtain traffic conditions in unperceived areas. Here is how the rest of the paper organized: Section 2 examines traffic flow theory and furnishes knowledge on deep neural networks. Section 3 explains how to add physics into the training process of a DL neural network for TSE. Section 4 discusses the scenario of traffic data collection. Section 5 explores a case study with velocity data to test the performance of PIDL. Finally, section 6 concludes the paper and proposes future directions. 2 Physics of Traffic Flow and Deep Learning 2.1 Traffic Flow Fundamentals Traffic state variables describe the spatial-temporal knowledge of road conditions. Lighthill-Whitham-Richards (LWR) model [15] portrays the relationship between three traffic state variables - the cumulative count of vehicles N (x, t), density ρ(x, t) and flow q(x, t). If N (x, t) is differentiable with respect to both location x and time t, the conservation law of traffic flow is given by (1). ∂q(x, t) ∂x + ∂ρ(x, t) ∂t = ∂2N (x, t) ∂t∂x − ∂2N (x, t) ∂x∂t = 0 (1) 2 Road SideSensing UnitsCloud Infrastructure for DataProcessing & Storage PIDL Applications in Transportation A PREPRINT Greenshields' fundamental diagram (FD) depicts the relationship between speed v, density ρ, and flow q [16]. The connection between traffic state variables is formulated in (2), in which ρmax is the maximum density and vf ree is the maximum speed (also known as the free-flow speed). Greenshields' FD is shown in Fig. 2. (cid:18) q(ρ) = vf ree 1 − (cid:18) v(ρ) = vf ree 1 − ρ (cid:19) (cid:19) ρ ρmax ρ ρmax (2) Figure 2: Greenshields' Fundamental Diagram 2.2 Deep Learning Neural Network A deep learning (DL) neural network includes several layers of computation neurons. To measure the disagreement between the prediction or estimation produced by a DL neural network and the ground truth, a cost function is configured and minimizing the cost is the objective in training a DL neural network. Adopting mean square error (MSE) as the cost measure, we can build a cost function of the neural network, termed as the DL-cost JDL. The DL-cost is written in (3), in which ˆv(x, t) is the estimation of the velocity v(x, t) at location x and time t. N1 is the number of spatial bins on the road segment, and N2 is the number of temporal bins of time t. JDL = M SE(ˆv(x,t),v(x,t)) = 1 N1 * N2 N1(cid:88) N2(cid:88) |ˆv(x(i), t(j)) − v(x(i), t(j))|2 i=1 j=1 (3) As the training process drives to minimize cost, the accuracy of the neural network is assessed based on the accuracy of the state estimation output. The Frobenius norm is selected to build a normalized error measurement E . It is shown as (4), in which V is the matrix form of velocity v(x, t), and ˆV is the neural network output (estimation) of V. E normalizes the cost JDL and represents the relative estimation error. N1 and N2 are the numbers of discretized spatial and temporal bins of the velocity field. (cid:13) (cid:13) (cid:13)F (cid:13) (cid:13)V − ˆV (cid:13) (cid:107)V(cid:107)F E = × 100% = (cid:113)(cid:80)N1 i=1 (cid:80)N2 (cid:113)(cid:80)N1 j=1|ˆv(x(i), t(j)) − v(x(i), t(j))|2 (cid:80)N2 j=1|v(x(i), t(j))|2 i=1 × 100% (4) 3 SpeedSpacing SpeedSpeedFlowDensityFlowDensity PIDL Applications in Transportation A PREPRINT 3 Physics-informed Deep Learning The LWR conservation law is a partial differential equation (PDE). Since fundamental diagrams relate the traffic state variables, we can use the equations of Greenshields' FD in (2) to transform LWR in (1) to (5), which contains only one independent variable, velocity v(x, t). (cid:18) ρmax 1 − 2v(x, t) vf ree (cid:19) ∂v(x, t) ∂x − ρmax vf ree ∂v(x, t) ∂t = 0 (5) We establish two measures: (a) DL-cost, JDL, for the estimation error between the output and the ground truth, and (b) physics-cost, JP HY , for the noncompliance of conservation law. Adopting the LWR conservation law in (5) as "physics", these two cost terms are formulated in (6). The number of observed data is denoted as N0, and Nc is the number of the collocation points where the measurement of non-compliance of physics - JP HY is assessed. JDL = JP HY = 1 No 1 Nc No(cid:88) |v(xj o, tj o) − ˆv(xj o, tj o)|2 j=1 Nc(cid:88) |ρmax(1 − j=1 2ˆv(xj c, tj c) vf ree ) c, tj ∂ˆv(xj c) ∂x − ρmax vf ree c, tj ∂ˆv(xj c) ∂t |2 (6) By adding the physics-cost JP HY to the cost function, the LWR conservation law in (1) is integrated into the training process of the neural network. Now the neural network is able to use the governing physical equations as the "knowledge of traffic flow". The physics aids in the process of finding the best-fitting parameters of the neural network and prevents overfitting, leads to better performance on TSE. The physics-cost term can be adjusted by introducing a weight hyperparameter α. The entire cost function is given as (7). J = JDL + α ∗ JP HY (7) The architecture of a PIDL neural network is shown in Fig. 3. It equips a regular DL neural network with a training process that involves minimizing the combined cost of JDL and JP HY , given in (7). By minimizing the combined cost J , the neural network learns to calibrate its parameters based on the observed data and the physics. Once J is smaller than the predetermined threshold, it gives the fine-tuned output as the final estimation. Figure 3: Architecture of a PIDL Neural Network 4 DL Cost FunctionxytzuOutputYesNo, Optimize againDeep Neural Network Initial andBoundaryConditionsu(x,y,z,t)Automatic DifferentiationGoverning EquationsPhysics Cost Function PIDL Cost Function Physical Laws PIDL Applications in Transportation A PREPRINT 4 Data Collection Scenario In this section, we paint the picture of traffic data collection scenario. On a transportation corridor, there is abundant processing power untapped or generally under-utilized in on-site edge nodes, also known as cloudlets [17] or fog nodes [18]. They are placed at the edge of the communication network and in close proximity to the end devices where traffic data originate [19]. Edge devices such as local traffic controllers, roadside units can receive and record traffic data reported by detectors along the road or smart onboard devices in connected vehicles (CV) regarding vehicle location and velocity. If deployed intermittently, edge devices such as RSUs may not locate within the communication range, restricting data sharing between the devices. Fog infrastructure provides a fitting solution to this obstacle by connecting the otherwise isolated RSUs. It harnesses the data collection capability of the RSUs and serves as an intermediate layer between edge devices and the cloud server. Figure 4: Data Collection Scenario using Fog Architecture In other words, edge computing pushes the brainpower and communication capabilities into the end device via programmable logic controllers and programmable automation controllers. The concept of fog computing was developed to harness the data collection, storage, and computing power of end devices and serve as an intermediate layer between edge layer and cloud servers - thus decreasing network latency and improving system response time [20]. An application scenario employing fog infrastructure is illustrated in Fig. 4. 5 Case Study A DL neural network and a PIDL neural network with the same learning architecture are created for the case study. Using the Lax-Hopf method [21], a synthetic traffic dataset is created under no upstream and downstream flow conditions. The value of velocity v(x, t) is simulated at x ∈ [0, 5000] meters and during t ∈ [0, 240] seconds. The road segment is evenly divided into 500 spatial bins (δx = 10m) and time t is evenly divided into 240 units (δt = 1s). The upstream flow at x = 0 and the downstream flow at x = 5000 are set to zero. In the synthetic dataset, the pileup of vehicular traffic is back-propagating in space and forward-propagating in time. The maximum density ρmax is set as 0.05 vehicles per meter, and free-flow speed vf ree is 25 meters per second. The resulting velocity dataset of v(x, t) is shown in Fig. 5. Both the PIDL and DL neural networks in this study are constructed with the exact learning architecture as they share identical numbers of layers and neurons. The physics of traffic flow is the unique prior knowledge that PIDL possesses. We assume that loop detectors are installed at 5 locations on the 5000-meter road segment. That means the training dataset of vehicle velocity consists of sensing measurements from 5 locations throughout the 5000-meter road segment. As the temporal resolution of the dataset is 1-second, 240 × 5 = 1200 data points are available at these 5 locations during the 240-second case study. Accounting for the occasional data loss during signal transmission and data storage, 5 PIDL Applications in Transportation A PREPRINT Figure 5: Dataset of Vehicle Velocity v(x, t) 250 samples from the 1200 data points are randomly selected as the training dataset. Note that it is an extreme data loss scenario in which only 20.8% of the data collected is broadcast and transmitted for processing. It makes the estimation task for both the DL and PIDL neural networks significantly more challenging. Fig. 6 shows the estimation result, in which the 250 training samples are also marked. Figure 6: PIDL & DL Estimation Result The result produced by the PIDL neural network exhibits matching patterns shown in Fig. 5 of the original dataset. With the priori knowledge of physics, PIDL neural network is capable of utilizing limited training samples for TSE. In contrast, DL neural network is not able to generate a meaningful estimation of traffic density. Table 1 details the computation time and accuracy of the two neural networks for comparison. The improved results of PIDL are highlighted in bold. Next, we examine the impact of the training sample size. Using a varying training size from 500 to 1000 (given at maximum 1200 datapoints are available at the five sensing locations), which represents 0.416% to 0.832% of data in the velocity field, the results of estimation accuracy of PIDL and DL are listed in Table 2. Similarly, the better outcomes are highlighted in bold. The results indicate that PIDL outperforms DL in terms of accuracy at all sample levels. 6 050100150200Timet(s)010002000300040005000Locationx(m)VehicleVelocityv(x,t)(m/s)0510152025050100150200Timet(s)020004000Locationx(m)PIDLEstimationv(x,t)(m/s)01020050100150200Timet(s)020004000Locationx(m)DLEstimationv(x,t)(m/s)01020 PIDL Applications in Transportation A PREPRINT Table 1: PIDL & DL Performance Comparison Computation Time (s) Accuracy PIDL DL 8.24 41.18 75.2% 24.3% Table 2: PIDL & DL Performance Comparison with Varying Training Size Sample Size % Data Accuracy PIDL DL 500 750 1000 0.416% 81.65% 31.24% 0.625% 83.32% 35.72% 0.832% 82.79% 29.18% 6 Conclusion In this paper, we showcase PIDL for transportation applications such as for traffic state estimation. The case study shows the capability of PIDL in encoding the physical laws of traffic flow to make accurate and timely velocity estimations with limited and sparsely located measurements. The results are encouraging and pose several future research directions. For instance, how can this approach be adapted to suit the developing countries' situation with mixed traffic conditions (and a nonexplicit traffic flow law)? How can this approach be incorporated into an arterial network with signalized intersections? Future work should also consider integrating higher-order traffic flow models and demonstrate the applicability to field data. References [1] Rongye Shi, Zhaobin Mo, and Xuan Di. Physics-informed deep learning for traffic state estimation: A hy- brid paradigm informed by second-order traffic models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 540–547, 2021. [2] Rongye Shi, Zhaobin Mo, and Xuan Di. Physics-informed deep learning for traffic state estimation: A hy- brid paradigm informed by second-order traffic models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 540–547, 2021. [3] Toru Seo, Alexandre M Bayen, Takahiko Kusakabe, and Yasuo Asakura. Traffic state estimation on highway: A comprehensive survey. Annual reviews in control, 43:128–151, 2017. [4] Juan C Herrera and Alexandre M Bayen. Incorporation of lagrangian measurements in freeway traffic state estimation. Transportation Research Part B: Methodological, 44(4):460–481, 2010. [5] Nikolaos Bekiaris-Liberis, Claudio Roncoli, and Markos Papageorgiou. Highway traffic state estimation with mixed connected and conventional vehicles. IEEE Transactions on Intelligent Transportation Systems, 17(12):3484–3497, 2016. [6] Sergio Contreras, Shaurya Agarwal, and Pushkin Kachroo. Quality of traffic observability on highways with lagrangian sensors. IEEE Transactions on Automation Science and Engineering, 15(2):761–771, 2017. [7] Sergio Contreras, Pushkin Kachroo, and Shaurya Agarwal. Observability and sensor placement problem on highway segments: A traffic dynamics-based approach. IEEE Transactions on Intelligent Transportation Systems, 17(3):848–858, 2015. [8] Shaurya Agarwal, Pushkin Kachroo, and Sergio Contreras. A dynamic network modeling-based approach for traffic observability problem. IEEE Transactions on Intelligent Transportation Systems, 17(4):1168–1178, 2015. [9] Shaurya Agarwal and Pushkin Kachroo. Controllability and observability analysis for intelligent transportation systems. Transportation in Developing Economies, 5(1):2, 2019. [10] Rezaur Rahman and Samiul Hasan. Short-term traffic speed prediction for freeways during hurricane evacuation: a deep learning approach. In 2018 21st International Conference on Intelligent Transportation Systems (ITSC), pages 1291–1296. IEEE, 2018. 7 PIDL Applications in Transportation A PREPRINT [11] Archie J Huang and Shaurya Agarwal. Physics-informed deep learning for traffic state estimation: Illustrations with lwr and ctm models. IEEE Open Journal of Intelligent Transportation Systems, 3:503–518, 2022. [12] Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part i): Data-driven solutions of nonlinear partial differential equations. arXiv preprint arXiv:1711.10561, 2017. [13] Maziar Raissi, Paris Perdikaris, and George E Karniadakis. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational physics, 378:686–707, 2019. [14] Archie J Huang and Shaurya Agarwal. Physics informed deep learning for traffic state estimation. In 2020 IEEE 23rd International Conference on Intelligent Transportation Systems (ITSC), pages 1–6. IEEE, 2020. [15] Paul I Richards. Shock waves on the highway. Operations research, 4(1):42–51, 1956. [16] BD Greenshields, Ws Channing, Hh Miller, et al. A study of traffic capacity. In Highway research board proceedings, volume 1935. National Research Council (USA), Highway Research Board, 1935. [17] Mahadev Satyanarayanan, Paramvir Bahl, Ramón Caceres, and Nigel Davies. The case for vm-based cloudlets in mobile computing. IEEE pervasive Computing, 8(4):14–23, 2009. [18] Tom H Luan, Longxiang Gao, Zhi Li, Yang Xiang, Guiyi Wei, and Limin Sun. Fog computing: Focusing on mobile users at the edge. arXiv preprint arXiv:1502.01815, 2015. [19] Mahadev Satyanarayanan. The emergence of edge computing. Computer, 50(1):30–39, 2017. [20] Flavio Bonomi, Rodolfo Milito, Jiang Zhu, and Sateesh Addepalli. Fog computing and its role in the internet of things. In Proceedings of the first edition of the MCC workshop on Mobile cloud computing, pages 13–16, 2012. [21] Pierre-Emmanuel Mazaré, Ahmad H Dehwah, Christian G Claudel, and Alexandre M Bayen. Analytical and grid-free solutions to the lighthill–whitham–richards traffic flow model. Transportation Research Part B: Methodological, 45(10):1727–1748, 2011. 8
http://arxiv.org/abs/2302.12334v2
2023-08-14T12:37:30
2023-02-23T20:57:47
Using Automated Algorithm Configuration for Parameter Control
Dynamic Algorithm Configuration (DAC) tackles the question of how to automatically learn policies to control parameters of algorithms in a data-driven fashion. This question has received considerable attention from the evolutionary community in recent years. Having a good benchmark collection to gain structural understanding on the effectiveness and limitations of different solution methods for DAC is therefore strongly desirable. Following recent work on proposing DAC benchmarks with well-understood theoretical properties and ground truth information, in this work, we suggest as a new DAC benchmark the controlling of the key parameter $\lambda$ in the $(1+(\lambda,\lambda))$~Genetic Algorithm for solving OneMax problems. We conduct a study on how to solve the DAC problem via the use of (static) automated algorithm configuration on the benchmark, and propose techniques to significantly improve the performance of the approach. Our approach is able to consistently outperform the default parameter control policy of the benchmark derived from previous theoretical work on sufficiently large problem sizes. We also present new findings on the landscape of the parameter-control search policies and propose methods to compute stronger baselines for the benchmark via numerical approximations of the true optimal policies.
[ "Deyao Chen", "Maxim Buzdalov", "Carola Doerr", "Nguyen Dang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12334v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12334v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.NE" ]
Using Automated Algorithm Configuration for Parameter Control Deyao Chen University of St Andrews St Andrews, United Kingdom Carola Doerr Sorbonne Université, CNRS, LIP6 Paris, France Maxim Buzdalov Aberystwyth University Aberystwyth, United Kingdom Nguyen Dang University of St Andrews St Andrews, United Kingdom 3 2 0 2 g u A 4 1 ] G L . s c [ 2 v 4 3 3 2 1 . 2 0 3 2 : v i X r a ABSTRACT Dynamic Algorithm Configuration (DAC) tackles the question of how to automatically learn policies to control parameters of algo- rithms in a data-driven fashion. This question has received consid- erable attention from the evolutionary community in recent years. Having a good benchmark collection to gain structural understand- ing on the effectiveness and limitations of different solution meth- ods for DAC is therefore strongly desirable. Following recent work on proposing DAC benchmarks with well-understood theoretical properties and ground truth information, in this work, we suggest as a new DAC benchmark the controlling of the key parameter λ in Genetic Algorithm for solving OneMax problems. the We conduct a study on how to solve the DAC problem via the use of (static) automated algorithm configuration on the benchmark, and propose techniques to significantly improve the performance of the approach. Our approach is able to consistently outperform the default parameter control policy of the benchmark derived from previous theoretical work on sufficiently large problem sizes. We also present new findings on the landscape of the parameter- control search policies and propose methods to compute stronger baselines for the benchmark via numerical approximations of the true optimal policies. λ, λ + ( )) 1 ( CCS CONCEPTS • Computing methodologies Randomized search. → KEYWORDS evolutionary computation, algorithm configuration, parameter con- trol, genetic algorithms, benchmarking 1 INTRODUCTION Evolutionary algorithms and similar randomized search heuris- tics have a number of parameters that allow to fine-tune their behavior to the problem at hand and to the current stage of the optimization process. However, despite a long series of works study- ing which parameters work well for which algorithms and which problem scenarios, the question how to control these parameters in an automated fashion is wide open. Concepts such as hyper- heuristics [12], parameter control [23, 29, 36], and adaptive opera- tor selection [31] dominate research on this topic in evolutionary computation (EC). More recently, approaches based on machine learning (ML), and in particular based on reinforcement learning (RL), propose to explicitly train control policies. That is, where EC assumes that a given problem instance has to be solved instantly, the ML-approaches focus on settings in which similar problem in- stances need to be solved, and an explicit training is possible. This setting was first studied in [47] and later named dynamic algorithm configuration (DAC) in [10]. It quickly became a very active area of research [1, 11, 30, 46, 48, 49, 51]. A parallel research direction in the hyper-heuristic community is on automated algorithm design, which focuses on leveraging deep RL approaches for training poli- cies to select the best algorithm components based on the search states [52–54]. Regardless of whether adopting the EC view or whether con- sidering the DAC setting, it is highly desirable to have access to benchmarks that support a sound investigation of the proposed methods. As in other branches of computer science, benchmark- ing helps to compare the efficiency of different algorithms and to investigate their strengths and weaknesses. Benchmarking has a long tradition in EC, and has undoubtedly helped our community mature [7, 33]. In difference to competitive testing, where the main focus is on the performance of the solvers, benchmarking relies on settings that are sufficiently well understood to help us gain insight into the working principles that drive this performance – knowl- edge that not only supports the improvement of the algorithms but also leads to a better deployment of the existing approaches in practice. The idea of leveraging settings with well-understood theoretical properties and using them for benchmarking DAC approaches was recently promoted in [11]. The paper adopted the (1+1) Random- ized Local Search for solving variants of the LeadingOnes problem with configurable problem dimension and action spaces, where the action space corresponds to the portfolio of the parameters that the DAC policies are allowed to choose from. Notably, the paper [11] extended previously known theoretical results from [21, 28] to set- tings with restricted portfolio. Using these provably optimal "ground truth" policies, their work demonstrated that an off-the-shelf RL- based learning mechanism can work very well if both the number of parameter values to choose from and the problem dimension are rather small. As soon as either of them increases beyond some rela- tively moderate threshold, the observed performance deteriorated quickly. Our contributions. Following the approach in [11], in this pa- per we propose a new DAC benchmark derived from EC theory. An essential property of a DAC benchmark is the clear discrepancy between static configuration and dynamic control policies. To that end, we adopt the setting proposed in [24], which involves con- trolling the population size parameter λ in the Genetic Algorithm (GA) for the OneMax problem. As in the LeadingOnes benchmarks, the goal is to minimize the expected running time of λ, λ + ( )) 1 ( the algorithm, i.e., the total number of evaluations that the algo- rithm performs before it reaches an optimal solution. The setting also comes with an asymptotically optimal parameter control policy with linear expected runtime [24], which will be used as a baseline for our DAC experiments in this paper. 1 The new benchmark has a number of interesting properties com- pared to the LeadingOnes. First, the performance gain obtained by an optimally controlled parameter setting over the best possible , i.e., it grows more than a constant factor as the static setting is ω problem dimension increases, while the advantage of an optimally controlled policy for LeadingOnes is "only" a constant factor, i.e., . Second, as we will show in our analysis (Section 4.2), the Θ parameter search space has an unusual landscape with frequent abrupt changes across the whole area, making it potentially chal- lenging for DAC approaches. 1 ( ( ) ) It is worth to note that deep RL is not the only solution method for DAC. An alternative approach is to formulate DAC as a (meta- )optimization problem, where we search in the policy space directly via black-box optimization methods [1]. Our second contribution is on this direction: we investigate the potential of using automated algorithm configuration techniques to solve DAC problems. More specifically, we formulate a policy of our benchmark as a static parameter setting and configure it using the automated algorithm configuration tool irace [41]. As will be detailed in Section 3, a naive application of irace does not work well, especially when the problem size is over 200, which is considered rather small for OneMax problems. This can be accounted to the large number of parameters the tuning has to deal with and the complicated landscape of the parameter search space. We then propose a binning approach to reduce the search space, and a cascading application of the tuning. A combination of those two strategies results in significant improvement in performance. The tuning is able to find policies that consistently outperform the theory-derived policy in [24]. Our last contribution involves expanding our understandings on the proposed DAC benchmark. We extend recent works on numeri- cally computing optimal control policies for concrete dimensions via dynamic programming. Originally proposed in [13] and later refined in [6, 15], this approach allows us to approximate the opti- mal control policy of our new benchmark with very good precision. In this work, we compute the approximations of both the generally optimal policies and the optimal binning policies, which show that there is a consistent but small gap between the two. Apart from serving us as new baselines for our tuning-based approach and for other DAC methods in general, our work also reveals some facts GA that we expect to be of interest in the about the context of running time analysis, parameter setting, and algorithm design. Indeed, search landscapes associated with parameter setting problems are usually thought to be rather smooth [42, 43], but our findings suggest that it is not always true, and in particular not for parameter control settings. This finding reinforces a similar obser- vation made in [6] for landscape of parameter control policies for the much simpler -type evolutionary algorithms. We consider such insights on (un)structured parameter control landscapes very valuable for further algorithm design – whether in the context of DAC or in the classic black-box optimization setting. λ, λ + ( )) + λ 1 1 ( ) ( Deyao Chen, Maxim Buzdalov, Carola Doerr, and Nguyen Dang Availability of code and data. To adhere to reproducibility standards discussed in [40], our code and data are available at [18]. 2 CONTROLLING THE POPULATION SIZE OF THE 1 λ, λ GA ON ONEMAX ≤ ≤ + ( )) ( Notation. We always denote by n the dimension of the search space. For a search point x . For 0, 1 x1, . . . , xn the set of all integers two real number a and b we denote by k that satisfy a k n we write x = } a..b [ ∈ { b. ] ( ) ] ( ( } { 1 }| )) )) , x ] | + ( + ( ∈ { λ, λ λ, λ 0, 1 → [ 0..n n } n } i ↦→ |{ fz { xi = zi OneMax. In this work, we are interested in minimizing the expected optimization time of the GA on OneMax. OneMax is one of the most important benchmark problems in the analysis of evolutionary algorithms (EAs). It denotes the collection 0, 1 of functions with fz : z | ∈ , the function that counts in how many positions 1..n [ the solution candidate x agrees with the secret target string z. As it was discussed in [26], OneMax can be seen as the Mastermind problem with two colors, 0 and 1. The name "OneMax" originates in the fact that for analyzing the performance of so-called unbi- ased algorithms, it suffices to study their behavior on the function , see [27, 39] for detailed explanations. This is also the case f 1,...,1 ) ( GA introduced below. Despite its simplicity, the 1 for the OneMax problem is highly relevant for understanding the behav- ior of EAs in regimes in which we have a good fitness-distance correlation. That is, OneMax helps us understand how algorithms perform in environments in which they are not misled by search points that have better fitness value than another while at the same time being farther away from the optimum. GA. The GA was orig- )) inally introduced in [24] to formally prove that the use of crossover can be beneficial even for optimizing rather simple functions such as OneMax. It later started to play an important role in the analysis of parameter control mechanisms. Already in [24] it was shown that a fitness-dependent setting of the key parameter λ can lead to expected running times that are asymptotically better than that of the best static setting. Later works showed that a simple one- fifth success rule, as adopted to the discrete setting in [37], leads to best possible linear running time. This result inspired a number of follow-up works on parameter control [23]. More recently, the GA plays another important role for the study of un- 1 ( usual mutation operators such as the heavy-tailed "fast" mutation operators introduced in [25]; see [3] for a recent example. Finally, the GA has also been studied in other contexts, see [4] for work on LeadingOnes, [14, 32] for applications to satisfiability problems, and [5] for more results and further references. Background on the λ, λ λ, λ λ, λ λ, λ + ( + ( +( +( )) )) )) 1 1 1 ( ( ( )) )) + ( λ, λ The 1 ( λ, λ GA. Alg. 1 presents the pseudo-code of the + ( GA version analyzed in this work. The algorithm is 1 ( initialized by sampling and evaluating a search point chosen from n uniformly at random (u.a.r.). It then proceeds in rounds, 0, 1 { } consisting of one mutation phase and one crossover phase each. In new solution candidates ("offspring") the mutation phase, Λ = are sampled, where < 0.5 and λ λ λ ⌉ ⌈ ⌋ otherwise. Each offspring is sampled by inverting the bits in l position that are chosen u.a.r.. Here, l is a random number that is kept fixed throughout one iteration and that is sampled from that performs the resampling binomial distribution Bin>0 λ ⌊ ⌉ := if λ − ⌊ n, λ := λ λ ⌉ ⌊ ⌊ ⌋ ⌊ ⌉ n / ) ( Using Automated Algorithm Configuration for Parameter Control 1 Algorithm 1: The paper. Input : problem size n ( + ( GA variant analyzed in this λ, λ )) a parameter control policy π : 1 Initialization: Sample x 2 Optimization: for t = 1, 2, 3, . . . do x 3 0, 1 ∈ { f ; 0..n 1; n − n u.a.r. and evaluate f } 1 ] → [ [ ] x ( ; ) 4 5 6 7 8 9 10 11 12 13 14 15 16 ; Evaluate f i x ( ; ) ) ( x ( ) with Λ x ( u.a.r.; ) )} i ; 1 ( ( ( ( )) ) ; ⌉ flipl ) } , . . . , f Let λ = π ( Mutation phase: Sample l from Bin>0 n n, λ / Set population size Λ as λ ⌊ for i = 1, . . . , Λ do x ( ) ← Choose x ′ ∈ { Λ ), . . . , x ( x ( 1 = max x ( f x ′) f ) ) { Crossover phase: for i = 1, . . . , Λ do cross1 y ( λ ) ← / i if y ( x, x ′} ) ∉ { Choose y′ ∈ { y ( ) } = max y ( , . . . , f f y′) f ( { ( Selection and update step: if f x ′) ( if f x ) ( ), . . . , y ( 1 y ( ) ) ( y′) ( y ) ≥ ( then y then x > f f ← Λ ( 1 ; i x, x ′) ( then evaluate f y ( ( i ; ) ) u.a.r.; with Λ ) )} y′ else y ← y; x ′; ← λ / x, x ′) n trials with success rate λ n each and resamples i.i.d. until a value / greater than 0 is found. The best of these Λ offspring (ties broken u.a.r.), referred to as x ′ in Alg. 1, is selected to participate in the crossover phase. In the crossover phase, another Λ search points are generated, each sampled from a uniform crossover between the original parent x and the selected mutant x ′. The crossover operator treats each position independently and sets yi = x ′i cross1 ( with probability 1 λ and it sets yi = xi otherwise. The so-created / "crossover offspring" are only evaluated if they are different from both parents, and they are not further taken into consideration otherwise. For y′ denoting the best of the samples generated in the crossover phase (ties broken again u.a.r.), we then let y = y′ if y′ is strictly better than x ′ and we let y = x ′ otherwise. Finally, y replaces x as parent for the next iteration if it is at least as good, i.e., if f x f . Parameter settings. In the static version of the GA, the value of λ is fixed throughout the whole run, i.e., the control policy π in Alg. 1 is constant. In the dynamic version, λ can take different values at different stages of the optimization process. λ, λ + ( )) 1 ( y ( ) ≥ ( ) The default dynamic control policy that we compare our re- sults against, namely theory, assigns to each fitness value i the parameter value π . It was used in [24, Theorem 8] i − to prove an asymptotic super-constant speedup over the best static choice of λ. := √︁n /( n ( ) ) i ] [ 1 − 0..n as a static automated algorithm configuration, where the number of parameters is equal to the problem size n: each parameter corre- spond to the λ value of a fitness value in the range of . We use the automated algorithm configuration tool irace [41] to solve this task. We apply this dynamic tuning approach, namely tuned, on various problem sizes from 10 to 2000. The tuning budget is set as 50000 runs. Since the performance metric is runtime related, the adaptive capping feature of irace is enabled as it has been shown to significantly improve the tuning performance in various cases [17, 20]. As we are interested in optimizing expected running time, we set irace's statistical test to be the Student t-test. More- over, to account for the noisy nature of the benchmark, the firstTest parameter (the number of instances/seeds being evaluated at the beginning of each irace's iteration before the first statistical test is applied) is increased from 5 (default) to 10. All other parameters of irace are set as default. For comparison, we also apply irace on a static version of the GA where λ is fixed during the )) whole run. This version is named tuned_static, and the tuning n, 20000) runs. The final configuration budget is set as min(100 found by each tuning experiment is evaluated across 500 different random seeds, and their performances are presented in Figure 1. λ, λ + ( × 1 ( It is clear that the dynamic tuning approach does not scale well with problem sizes: the expected runtime of tuned is much higher 200. 1 than both theory and tuned_static, especially when n The differences in performance (i.e., tuned vs theory and tuned vs tuned_static) are statistically significant 2 for n 50 according to the Wilcoxon rank sum test with a confidence level of 99.9%. One possible explanation for the bad performance of tuned is due to the large number of numerical parameters irace has to deal with. In fact, automated algorithm configuration scenarios often either: (i) involves a few dozens parameters at most, or in some cases, up to 200 parameters; or (ii) has a large number of categorical parameters with only a few possible values [35]. ≥ ≥ [ ] 0..n To reduce the parameter space, we define a binning approach where we partition the objective space into k consecutive bins {B1, B2, .., Bk }, and only tune one λ parameter for all fitness values in the same bin, i.e., the number of parameters is now reduced from n to k. In many optimization problems, the closer we get to the optimal, the harder it is to optimize. Therefore, we define the bins so that their sizes are gradually reduced as the objective values ) increased. More concretely, we set Bi = ] − n where ai = n . Figure 3 1, k 2i illustrates how the bins are created with different k values. We name this approach tuned_bin. From this point onward, we will focus on sufficiently large problem sizes (n 500) as those are the cases where the discrepancy between the static and the dynamic policies is obvious. The tuning budget is set as 5000, 10000, 20000, and 21000 for n equals to 500, 1000, 2000, and 3000, respectively. ai ..ai 1 [ + , and Bk = (i 1 − ] ak ..n [ ∈ [ ] i ⌋ ∀ 1, k ∈ [ − ⌊ ≥ 1 ] − 1 A larger number of bins results in more flexibility in the tuning and better quality of the best possible parameter-control policy, but it may also lead to more difficulty in searching in such space 3 CONFIGURING CONTROL POLICIES GA as We represent a parameter control policy for the a mapping from a current fitness to a specific λ value. The problem of finding the best parameter control policy therefore can be stated λ, λ + ( )) 1 ( 1for n = 10, the average performance of tuned_static is better than both theory and tuned. But this is likely due to the problem size being too small to see the impact of dynamic parameter control. 2In this paper, whenever multiple statistical tests are conducted, the Bonferroni cor- rection is applied. Deyao Chen, Maxim Buzdalov, Carola Doerr, and Nguyen Dang irace has to deal with. However, we observe the opposite. To check whether the counter-intuitive performance is due to the instability of the tuning, we repeat both tuning experiments 5 times. And in fact, the average runtime of tuned_bin6 reduces from 6446 to 4921, while the runtime of tuned_bin7 increases from 5589 to 6043. + To improve the tuning further, we propose a cascading strategy, where the final configuration of the tuning with k bins is given as an initial configuration for the tuning with k 1 bins. The cascading gives each tuning a head start by leveraging results of the previ- ous step. The new tuning experiments are named tuned_cas_bin, and their results are shown in Figure 2. The tuning performance is improved drastically. And the final configuration (found with the largest number of bins) for each problem size even statistically sig- nificantly outperforms theory (both original and binned versions) for n 1000 according to the Wilcoxon rank sum test with a confi- dence level of 99.9%. Note that for n = 500, the two configurations are not statistically significantly different. ≥ One may argue that the good performance of the cascading approach may come from the fact that the total tuning budget is larger than each individual tuned_bin experiment, since with cascading, the tunings are executed sequentially until we reach the largest number of bins. To investigate this point further, we re- 500, 1000 with 10 run the last tuned_bin experiments for both n times of their original budget (which is roughly the same as the total budget for all tuned_cas_bin experiments of the same problem size). We observe some improvement in performance for n = 500: average runtime of the final configuration reduces from 7988 to 5818, but there is still a large gap compared to the tuned_cas_bin with an average runtime of 3234. Interestingly, for n = 1000, the new configuration is even worse than before (original runtime: 11468, new runtime: 15109, tuned_cas_bin: 6492). Again, this can be accounted to the instability of dynamic tuning without cascading. Those observation confirms the clear advantage that cascading offers to the tuning performance. ∈ )) + ( λ, λ The results of this section indicates the potential of applying automated algorithm configuration for the dynamic tuning of the GA on OneMax. Our binning and cascading strategies 1 ( help to find configurations that are better than the best known control policy derived from theory. This is particularly encouraging, given that the tuning does not have access to theory. The next question would be: has the tuning been able to find the best possible policies, or is there still room for improvement? To answer such question, in the next section, we will describe a method to compute stronger baselines for this benchmark. 4 EXACT COMPUTATIONS In this section we describe an algorithm of computing the exact expected running time of the GA on OneMax provided + ( we are given the mapping from the parent fitness f to the parameter value λ = λ . Based on that, we perform some basic landscape analysis and propose a way to closely approximate the best baseline policies (the truly best policy and the best one among the binned policies) using numeric minimization. λ, λ )) 1 ( ) ( f Figure 1: Performance of a naive dynamic tuning with irace (tuned), a static tuning (tuned_static), and the default pol- icy derived from theory (theory), evaluated across 500 ran- dom seeds. 1.. due to its size. To study the effect of this choice, we conduct exper- iments with all possible numbers of bins (k ). The performance of the final configurations are presented in Figure 2. We also conducted another baseline for the comparison: the binned versions of the theory, namely binned_theory, where the fitness range is split into bins, and all λ values belonging to the same bin are derived from theory at the start(S), the middle (M), or the end(E) of the bin (for the middle case, if the number of elements in a bin is even, we choose the smaller point). log2 n ⌈ log2 n ∈ [ ⌉] ⌈ ⌉ Results in Figure 2 clearly indicates a trade-off between the num- ber of bins and the tuning performance. Starting from one bin, the tuning performance generally improves when the number of bins is increased until it reaches a certain limit (around 5 or 6). The tuning results after such point not only drastically degrades, but are also unstable. Consider, for example, the case of n = 500, we have both tuned_bin6 and tuned_bin7 performing quite badly compared to the cases with smaller numbers of bins, indicating degradation of the tuning performance, and we would expect tuned_bin7 to be worse than tuned_bin6 due to the larger number of parameters tuned_dyntheory_dyntuned_static10100200n = 10tuned_dyntheory_dyntuned_static100300600n = 50tuned_dyntheory_dyntuned_static10008001600n = 100tuned_dyntheory_dyntuned_static100030006000n = 200tuned_dyntheory_dyntuned_static100002000040000n = 500tuned_dyntheory_dyntuned_static10000100000200000n = 1000tuned_dyntheory_dyntuned_static10000100000300000600000n = 2000 Using Automated Algorithm Configuration for Parameter Control Figure 2: Performance (in terms of function evaluations) of dynamic tuning with binning (tuned_bin), and with binning and cascading (tuned_cas_bin). The number at the end of each configuration represents the number of bins. Other baselines include: theory and its binned versions, and the static tuning (tuned_static). All configurations are evaluated across 500 random seeds. λ 4.1 Computing Runtime for Given Parameters Let the current parent's OneMax fitness be f , and the current parameter be λ. Let Λ be the derived population size; the actual , but we are going to use different values algorithm uses Λ = GA is elitist and during landscape analysis. As the λ, λ all parents with the same fitness produce stochastically identical behavior, we can use the dynamic programming approach similar to the one used in previous works [6, 13, 15, 16]. Basically, we compute the remaining runtimes backwards from the optimum: assuming that Tf is the expected time to reach the optimum when the parent's fitness is f , we note that Tn = 0 and for every f the + ( )) 1 ⌉ ⌊ ( value of Tf depends only on Tf fitness. + 1,Tf + 2 and other values for higher 1 λ, λ To process the fitness value f , our algorithm essentially con- siders all possible event chains that the GA performs, computes their probabilities and saves the computational effort when possible. Since most of the probabilities are fractions formed by binomial coefficients, each of which may be small or large, we use the standard trick of computing logarithms of those quanti- ties (which are aggressively cached to avoid calling the expensive logarithm function) and taking an exponent of them only when summing. + ( )) ( 200040006000800010000120001400016000theorytuned_statictuned_cas_bin1tuned_cas_bin2tuned_cas_bin3tuned_cas_bin4tuned_cas_bin5tuned_cas_bin6tuned_cas_bin7tuned_cas_bin8tuned_cas_bin9binned_theory(S)binned_theory(E)binned_theory(M)tuned_bin1tuned_bin2tuned_bin3tuned_bin4tuned_bin5tuned_bin6tuned_bin7tuned_bin8tuned_bin9n = 500500010000150002000025000theorytuned_statictuned_cas_bin1tuned_cas_bin2tuned_cas_bin3tuned_cas_bin4tuned_cas_bin5tuned_cas_bin6tuned_cas_bin7tuned_cas_bin8tuned_cas_bin9tuned_cas_bin10binned_theory(S)binned_theory(E)binned_theory(M)tuned_bin1tuned_bin2tuned_bin3tuned_bin4tuned_bin5tuned_bin6tuned_bin7tuned_bin8tuned_bin9tuned_bin10n = 1000100002000030000400005000060000theorytuned_statictuned_cas_bin1tuned_cas_bin2tuned_cas_bin3tuned_cas_bin4tuned_cas_bin5tuned_cas_bin6tuned_cas_bin7tuned_cas_bin8tuned_cas_bin9tuned_cas_bin10tuned_cas_bin11binned_theory(S)binned_theory(E)binned_theory(M)tuned_bin1tuned_bin2tuned_bin3tuned_bin4tuned_bin5tuned_bin6tuned_bin7tuned_bin8tuned_bin9tuned_bin10tuned_bin11n = 200020000400006000080000100000120000140000160000theorytuned_statictuned_cas_bin1tuned_cas_bin2tuned_cas_bin3tuned_cas_bin4tuned_cas_bin5tuned_cas_bin6tuned_cas_bin7tuned_cas_bin8tuned_cas_bin9tuned_cas_bin10tuned_cas_bin11tuned_cas_bin12binned_theory(S)binned_theory(E)binned_theory(M)tuned_bin1tuned_bin2tuned_bin3tuned_bin4tuned_bin5tuned_bin6tuned_bin7tuned_bin8tuned_bin9tuned_bin10tuned_bin11tuned_bin12n = 3000 Deyao Chen, Maxim Buzdalov, Carola Doerr, and Nguyen Dang Figure 4: Example runtimes for n = 500, fixed binned policy and different values of the last λ offspring equal to either of its parents. The final runtime of the policy is obtained from all Tf , given that the algorithm is initialized with fitness f with the probability (cid:0)n f 2n. The overall runtime of the whole process can be estimated as assuming a straightforward implementation. However, we O n perform certain optimizations in order to be able to work with problem sizes as large as n = 2000 in reasonable time. / ( ) 4 (cid:1) 2 δ [ Implementation detail 1. Note that the probabilities P l, g ] do not depend on the current fitness, but do depend on both λ and Λ. For this reason, they can be computed once and stored for later re-use. Since the probabilities for a tuple are computed in ) to store and use, such caching may g Θ ) ( improve the overall computation time by a factor up to O . For certain scenarios the overall size of cached probabilities exceeds the amount of memory available, so we use the adaptive cache that retains only the most expensive entries w.r.t. computation time. time and take only Θ l, g, λ, Λ g ( n ( ) ) ( | Implementation detail 2. To improve the computation time further, we ignore the events as long as their probability does not change the existing sum of probabilities in the machine precision when added to it, that is, whenever p δp = p in the 64-bit floating point type commonly known as double. Where possible, we reor- ganize computations so that the major contributions are evaluated first to further accelerate computation. + 4.2 Landscape Analysis The algorithm outlined in the previous section makes it possible to conduct a simplified form of the landscape analysis. Our first setting uses n = 500 and employs binning to assign parameter values to fitness values. For all but the last bin we use the following sequence of values: [1.0, 1.0, 1.0, 1.0, 6.5, 8.5, 11.5, 16.5], which, as we show later, is the best known binned policy for this problem size. For the last bin, which corresponds to the Figure 3: An illustration of the division of the bins for n = 20. We start with considering how many bits are flipped in the mutation phase. The probability of flipping exactly l bits follows from the fact that l . Let g be the number of "good" n / ∼ bits in the best offspring, that is, how many out of the l bits are can be computed flipped from 0 to 1 in x ′. The probability P g [ as follows: let Pm be the (easily computed) probability to have i "good" bits in one offspring, then Bin>0 n, λ l ) ( ] ( ) i | (cid:16)∑︁g (cid:17)Λ (cid:16)∑︁g 1 i=0 Pm − (cid:17)Λ | i ( ) ] l P = − g [ i=0 Pm i ) ( by combinatorial arguments. Hence, the crossover phase starts with x ′ being different from the parent x in l bits, g of which are "good". Each crossover offspring is obtained from the parent x by con- sidering the l bits that are different between x and x ′ and flipping δg of those bits from 0 to 1, and δb bits from 1 to 0. Again, remem- bering that only g of these l bits have the value 1 in x ′, it holds that 0 l, g ] − ≤ can again be computed by combinatorial arguments. The fitness of δb . Since the algorithm's state changes such an offspring is f only when the fitness improves, and because the best mutation offspring, x ′, can also replace the parent, we are rather interested in the truncated fitness change, e.g. δ = max . Let be the probability of obtaining such truncated fitness change Pc of i in one crossover offspring, then g. The probability P δg, δb [ g and 0 x ′) − f , δg 0, f i ( δb δb δg δg ≤ ≤ ≤ − − + { } l ( ) | 1 i=0 Pc − (cid:18)∑︁δ (cid:19)Λ (cid:18)∑︁δ (cid:19)Λ | ] P = − l, g δ [ i=0 Pc i ( ) similarly to the above. If δ = 0, we consider the iteration a failure. Otherwise the algorithm updates the fitness of the parent, for which we already computed the runtime Tf δ . We sum up these remaining + expected times, weighed by the probabilities of all the preceding events to happen, as well as these probabilities themselves. ) ( i Getting back to the current fitness value f , we obtain the prob- ability of improving the parent pi and the conditioned remaining expected time ti . Denote the expected iteration cost, in fitness eval- uations, to be τλ. Then, Tf = τλ Tf , which resolves to pi + ( ) * + pi . The value of τλ is a sum of a well-known solution Tf = ti τλ )/ + ( l ) l Λ evaluations in the mutation phase and Λ λ / evaluations in the crossover phase that do not produce a crossover λ / − ( − ( * ( pi − − ti 1 1 1 1 1 ) ) 2 bins3 bins4 bins5 bins1 bin0101519f(x)0102030403,0003,500LastparametervalueλRunningtime222324252627282,9262,9282,930LastparametervalueλRunningtime Using Automated Algorithm Configuration for Parameter Control Figure 5: Example runtimes for n = 500, fixed binned policy, and different values of the last λ and population size Λ − 1 = 499, we test all possible values in the range fitness value of n with a step of 0.1. Additionally, for every half-integer value 1; 40 [ ] (that is, x 1) we also use the largest value that is smaller than it and is representable in the machine precision (such a value rounds to x). 0.5 for an integer x, which rounds to x + + The plot of the resulting expected runtimes, computed as detailed in the previous section, is shown in Figure 4. One can easily observe the saw-like shape of the plot, which introduces multiple local optima and a complicated search space even when looking for one parameter. Note that the abrupt changes happen at the half-integer values, which correspond to the points when the population size, which is , changes as the parameter λ increases by a negligible amount. Note that a similar thing happens for every other bin value, and even if an arbitrary-shaped policy is sought for. λ ⌊ ⌉ 13; 18 ] To investigate this effect further, we consider the similar setting, but this time we vary both λ and the population size Λ indepen- dently. Figure 5 shows a closeup to the region of λ and population sizes Λ . One can see that when the popula- 13..18 ] ∈ [ tion size Λ is fixed, the plot is smooth with respect to λ as expected. are considered, it However, when only the combinations Λ = can happen that the best λ is at either of the interval endpoints or somewhere in the middle (all these cases are covered in Figure 5). All in all, this effect makes it complicated to compute optimal policies, either numerically or analytically. What is more, it may contribute significantly to the difficulty for the parameter tuning problem observed in Section 3 for irace. ∈ [ λ ⌉ ⌊ Our final setting investigates the effect of interaction between parameter values. Different to the first one, we consider changing the parameter values for the two last bins. The result is represented as a heatmap in Figure 6 for parameters close to the optimal ones, which features a clear grid pattern. While within each cell one can observe gradual color change in directions that are not parallel to coordinate axes, indicating nonlinear interactions between the parameters that might be hard to capture, it is also clear that the effects from rounding - that is, multidimensional ruggedness of the landscape - are at least as large. Figure 6: Example runtimes for n = 500, fixed binned policy, and different values of last two λ values f 4.3 Computing the Best Policies In order to compute the best mapping λ from fitness values to parameters values, given the problem size n, we modify the dynamic programming approach detailed in Section 4.1 to compute the best λ for a given fitness f assuming this has been done for all higher fitness values. This is done in line with the previous research [13, 15], however, due to the nature of the dependency on parameters found in Section 4.2, a more complicated optimization problem needs to be solved for each fitness value. ) ( ] [ x − − n [ 0.5; x 0.5; n Based on the preliminary computations involving smaller prob- 0.5 for lem sizes, we consider intervals of the form ) + 1; 1.5 integer x, with an exception of the first and last intervals ) and . The intervals open from the above are treated as closed intervals with the upper boundary replaced by the largest 64- bit floating-point value strictly smaller than that boundary. Within each interval ε, 8 to determine whether the optimum is on the λ2 with ε = 10− boundary or within the interval. In the latter case, we run a variant of ternary search suitable for parallel evaluation to find the best value numerically. Finally, to save computational efforts further, we reduce the number of intervals checked by observing that the optimum is in one of the intervals corresponding to: , we evaluate four values λ1, λ1 ε, λ2 λ1, λ2 − + ] [ [ • • • population size 1 or 2; the end of a sequence of population sizes, starting from 2 upwards, such that the runtimes decrease, which is tested if the runtime for population size 3 is smaller than for pop- ulation size 2 (this case is typical for large fitness values); the end of a sequence of population sizes, starting from n downwards, such that the runtimes decrease, which is tested if the runtimes for population sizes n, n 4, n n / typical for small fitness values less than n − 2 are not monotonically decreasing (this case is 8, n / 3). − − n n / / Figure 7 shows the best dynamic policy for n = 1000. There are clearly two regions with non-trivial best parameter values. The one closer to the optimum (which is on the left) is quite close to the theoretic value, √︁n , which is also illustrated subse- x )) quently in Figure 8. All the best parameters that are greater than one are half-integer in this case (the ones that round up). The other region that is far from the optimum does not contribute much to the expected running time. It is clearly the result of accepting the best mutation offspring if it is better than the parent. In this region, /( − n ( f 1314151617182,9402,9502,9602,9702,980LastparametervalueλRunningtimeΛ=13Λ=14Λ=15Λ=16Λ=17Λ=18Λ=bλe202224262830121416182022LastλNext-to-lastλ2,9302,9402,950 Deyao Chen, Maxim Buzdalov, Carola Doerr, and Nguyen Dang Table 1: Expected running time of the numerically approxi- mated baseline policies, rounded to two digits after the deci- mal comma n 500 1000 best 2916.94 5975.81 best binned 2925.52 5994.89 2000 12157.62 12197.66 bin values 1, 1, 1, 1, 6.5, 8.5, 11.5, 16.5, 24.5 1, 1, 1, 1, 6.5, 8.5, 11.5, 16.5, 23.5, 35.5 1, 1, 1, 1, 6.5, 8.5, 11.5, 16.5, 22.5, 32.5, 49.5 Table 2: Expected runtime of the best approximated policies, the default one and the best dynamic-tuning one n 500 1000 2000 3000 best 2916.94 5975.81 12157.62 18375.48 best binned 2925.52 5994.89 12197.66 18435.71 default 3224.89 6586.67 13386.44 20128.97 tuned 3249.09 6512.32 12703.88 19411.0 Figure 7: Best dynamic policy for n = 1000 half-integer values (here, the ones that round down) are also typical, but there are also many occurrences of less trivial values, which signifies the necessity of performing proper optimization within the intervals. It may be tempting to use dynamic programming in a similar way to compute also the best binned policies. However, this time it is not so straightforward. Indeed, if we consider the i-th bin and assume that bins i 1 up are solved, we can fix some λ and compute the expected runtime starting from each fitness value belonging to the i-th bin. However, the choice of parameters for the previous bins may affect the probability that the algorithm first hits the i-th bin at certain fitness value f , which would influence the most efficient choice of λ. As a result, we need to optimize all the parameters simultaneously. + For that reason, we use the ideas from [16] and employ a nu- meric optimizer, namely separable CMA-ES [44], to find the suitable parameter values for the bins. Based on the insights from Section 4.2, we represent each parameter λ as two variables, λi and λf , such that . These new values are box- λ = max n, { constrained, 0 λi, λf < 1. This approach makes the optimization ≤ landscape smoother, resulting in more stable convergence. 1, min 0.5 ⌉ + }} λf λi − n { ⌊ * The best results of our optimization attempts for both kinds of policies are presented in Table 1 together with the obtained parameter values for the bins. Though, strictly speaking, we have no optimality guarantees, we are still pretty confident that the presented values are not just the upper bounds, but rather represent the truly optimal policies up to available precision. 5 FINAL COMPARISON Table 2 shows the exact expected running times of the best known policies obtained from Section 4.3 for both unrestricted (best) and binned versions (best binned), the final configuration found by the dynamic tuning with binning and cascading with the largest num- ber of bins (tuned), and theory (default). The tunings outperform the default policy for n 1000, this is consistent with our empirical evaluations in Section 3. However, there is still a rather large gap to the best policies found by our problem-specific customized search methods, which indicates room for further improvement in our tuning approach. ≥ f ) ( / x x n ) ≥ Figure 8 shows the policies of those four settings. We only plot 2 as this is the most interesting region (a λ values for f / ( 2). The x-axis is random initial solution often has fitness around n plotted in logarithmic scale of n to allow zoom-in effect on − the more difficult regions of the objective function. A noticeable observation is that theory almost always underestimates the best λ values in those more difficult areas of the search, and that may be the reason for its worse performance compared to the others. The dynamic tuning, on the other hand, is able to produce policies that are generally close to the best binned policies up until a point. When the fitness is close to the optimal, the tuned policies start diverging from the best λ values, indicating the limitation of irace in detecting the importance of those last few bins in order to tune them properly. 6 INSIGHTS INTO FUTURE WORK The ruggedness of the parameter search landscape highlighted in Section 4.2, and particularly the algorithmic features that cause it, made us believe that there is a rich field for future work considering the design principles of evolutionary algorithms. Rather than just outlining our thoughts, in this section we consider to perform a small series of illustrative experiments that highlight them better. 6.1 Tunability Similarly to the concept of testability in engineering disciplines, we want to bring to the focus the concept of tunability of evolutionary algorithms. Many design choices (such as whether or not the best mutation offspring is compared to the parent, or whether or not we can sample an offspring which is equal to the parent) look rather innocent and straightforward, and are often done to improve the performance, but they can promptly turn the parameter landscape from a smooth to a complicated rugged surface. For this reason, we think that new evolutionary algorithms should be designed with care about how friendly they are to tuning procedures, that is, with GA, tunability in their design. In the context of the λ, λ 1 ( + ( )) 9909951,0009909951,000020406080010203040n−f(x)Bestλ8009001,000010203040 Using Automated Algorithm Configuration for Parameter Control Figure 8: The best approximated policies (best and best_binned), the default one and the best dynamic one found by the tuning. any deterministic rounding of the parameter λ to obtain the integer population size Λ is likely to be very disruptive to parameter tuning, and some other procedures may be sought for. To illustrate this point, we compare the version of the 1 ( ⌋ )) ⌉ − λ ⌈ λ ⌈ + GA studied in this paper with one of the versions from [8], λ, λ ( is taken with which employs stochastic rounding. Here, Λ = λ ⌊ otherwise. We use the problem λ and Λ = probability ⌉ size n = 100, the binning policy, and optimize the parameter values for the bins using separable CMA-ES [44], but in a straightforward way unlike Section 4.3, that is, each decision variable corresponds to the parameter value. The population size of CMA-ES is 100, and we run optimization for 200 iterations, or until the internal vari- ables of CMA-ES degenerate. Figure 9 shows the convergence plots with regards to the fitness value, whereas Figure 10 does it for the Euclidean distance to the optimum. Clearly, stochastic rounding shows a much "cleaner" convergence without getting stuck in local optima. It also seems somewhat less sensitive with respect to the parameter values around the optimum. We expect that designing algorithms with tunability in mind can bring them similar benefits. Figure 9: Convergence of parameter optimization for differ- ent roundings in GA in terms of fitness values. 10 + ( runs has been executed for each rounding. λ, λ )) 1 ( ( 1 )) + ( λ, λ 6.2 Control of multiple parameters De-coupling of the parameters of the GA is interesting from both a theoretical and an empirical point of view. Following the approaches suggested in [8, 19, 22], for example, one could explicitly ask to control the population size for the mutation phase, the mutation strength, the population size for the crossover phase, the crossover bias, etc. The method proposed in Section 4.1 can be used to model this as well. In a small experiment, we tune the parameter λ that controls the mutation strength and the crossover bias, and another parameter Λ that defines the population size for both the mutation and the crossover phases. Just as above, we use Figure 10: Convergence of parameter optimization for differ- ent roundings in GA in terms of distance to the )) optimum. 10 runs has been executed for each rounding. λ, λ + ( 1 ( 110100n - f(x)01020lambdan = 500defaulttunedbestbest_binned110100n - f(x)0102030lambdan = 10001101001000n - f(x)02040lambdan = 20001101001000n - f(x)02040lambdan = 300005010015020010−1210−710−2103NumberofiterationsFitnessaboveoptimumRoundingtonearestStochasticrounding05010015020010−910−510−1NumberofiterationsDistancetooptimumRoundingtonearestStochasticrounding Table 3: Optimal policies for n = 100 and three approaches to coupling parameters in the to four digits after the decimal point 1 ( λ, λ )) + ( GA. All numbers are rounded Deyao Chen, Maxim Buzdalov, Carola Doerr, and Nguyen Dang Coupling Rounding to nearest Runtime 534.3011 Stochastic rounding Decoupled parameters 540.7504 488.9785 Param λ Λ λ, Λ λ Λ [ 0; 50 ] 1.0 1 1.0 83.9611 3 [ 51; 75 ] 1.0 1 1.0 1.0 1 [ 76; 88 ] 1.0 1 1.0 1.0 1 [ Bin 89; 94 ] 3.5 4 4.0 1.4670 5 [ 95; 97 ] 5.5 6 6.0 3.0433 8 [ 98; 99 ] 7.5 8 8.0688 4.8120 12 100 10.5 11 11.2628 6.9308 19 n = 100, the binning policy, and optimize the parameters using separable CMA-ES. thorough study on deep-RL for the benchmark is beyond the scope of this present work. We leave it as a future research question. ( 1 )) + ( λ, λ Table 3 shows the results and compares them with the previously discussed configuration. While rounding to the nearest integer per- forms slightly better than stochastic rounding in terms of the run- time of the GA, it appears to be that it happens because of λ and Λ being coupled, and the decoupled version wins by a large margin. Note that the decoupled version favors much larger population sizes Λ and much smaller variation strengths λ towards the optimum. However, it benefits from small population sizes and large mutation strength of almost 0.84 in the first bin, which can essentially flip all the bits at once. Note that it is impossible to benefit from this behavior with tightly coupled parameters. ( 1 )) + ( λ, λ 7 CONCLUSION AND OUTLOOK In this work, we have evaluated some basic properties of population size control of the GA solving OneMax as a DAC bench- mark. We empirically evaluated the effectiveness of an automated algorithm configuration approach using irace as a DAC solving method. Our results suggest that such approach has the potential of learning well-performing parameter control policies, but it has to be implemented carefully. More concretely, a naive implementation would completely fail to get anywhere close to a good policy on our benchmark, but an improved version with binning and cascading can help to boost the performance considerably. Our work introduces an alternative way to train control policies in DAC settings, a problem that was previously studied predomi- nantly from the viewpoint of reinforcement learning (RL) [9, 11, 47] or (in numerical optimization) using exploratory landscape analy- sis [38]. We believe that each one of them has different strengths and weaknesses. Having a rich collection of DAC benchmarks with well-understood ground-truth information allows proper investi- gation of the potential and the limitations of each family of DAC approaches. Our work contributes to such benchmarks. We did not compare our results with the RL-based approaches in [11, 47] as the RL algorithms used in those work (DDQN [50]) assume a discrete action space where every action value is treated as categorical, while in our setting the parameter being controlled (λ) is numerical. We did, however, conduct some preliminary exper- iments with PPO [45], a well-known RL approach that works with both discrete and continuous action spaces, but the results were rather disappointing. This may not be too surprising, as deep-RL algorithms are often known to be non-trivial to use and various de- sign choices may have strong impact on their performance [2, 34]. A )) + ( λ, λ From the perspective of analysis and design of evolutionary computation methods, our numerical approximations of the op- timal control policies raise a number of interesting questions. It appears that the design choice in the considered version of the GA, namely deterministic rounding of a real-valued 1 ( parameter to obtain population size, led to a rugged landscape of the parameter search space, which not only complicated the nu- merical minimization, but probably had an effect on the application of irace. A rather simple change, switching to stochastic rounding, made the parameter tuning problem much simpler, but so did opti- mizing two parameters (the original λ and the population size Λ) separately. As a result of these exercises, we propose considering tunability of evolutionary algorithms when designing them, and note that sometimes tuning more parameters is easier. With this in hand, we can also construct new DAC benchmarks that require to control not only one, but several parameters at the same time [51] – a largely under-explored challenge [1, 36]. ACKNOWLEDGMENTS Nguyen Dang is a Leverhulme Early Career Fellow. We used the Cirrus UK National Tier-2 HPC Service at EPCC (http://www. cirrus.ac.uk) funded by the University of Edinburgh and EPSRC (EP/P020267/1). Deyao Chen is supported by the St Andrews Re- search Internship Scheme (StARIS). We furthermore acknowledge financial support by ANR-22-ERCS-0003-01 project VARIATION. REFERENCES [1] Steven Adriaensen, André Biedenkapp, Gresa Shala, Noor Awad, Theresa Eimer, Marius Lindauer, and Frank Hutter. 2022. Automated Dynamic Algorithm Configuration. Journal of Artificial Intelligence Research 75 (2022), 1633–1699. https://doi.org/10.1613/jair.1.13922 [2] Marcin Andrychowicz, Anton Raichuk, Piotr Stańczyk, Manu Orsini, Sertan Girgin, Raphaël Marinier, Leonard Hussenot, Matthieu Geist, Olivier Pietquin, Marcin Michalski, et al. 2021. What matters for on-policy deep actor-critic meth- ods? a large-scale study. In International conference on learning representations. [3] Denis Antipov, Maxim Buzdalov, and Benjamin Doerr. 2022. Fast Mutation in Crossover-Based Algorithms. Algorithmica 84, 6 (2022), 1724–1761. https: //doi.org/10.1007/s00453-022-00957-5 1 λ, λ [4] Denis Antipov, Benjamin Doerr, and Vitalii Karavaev. 2019. A tight runtime GA on LeadingOnes. In Proc. of Foundations of Genetic analysis for the Algorithms (FOGA'19). ACM, 169–182. https://doi.org/10.1145/3299904.3340317 [5] Denis Antipov, Benjamin Doerr, and Vitalii Karavaev. 2022. A Rigorous Runtime Analysis of the (1 + (λ , λ )) GA on Jump Functions. Algorithmica 84, 6 (2022), 1573–1602. https://doi.org/10.1007/s00453-021-00907-7 + ( ) ) ( [6] Kirill Antonov, Maxim Buzdalov, Arina Buzdalova, and Carola Doerr. 2021. Blend- ing Dynamic Programming with Monte Carlo Simulation for Bounding the Run- ning Time of Evolutionary Algorithms. In Proc. of IEEE Congress on Evolutionary Computation (CEC'21). IEEE, 878–885. https://doi.org/10.1109/CEC45853.2021. 9504775 Free version available at https://arxiv.org/abs/2102.11461. Using Automated Algorithm Configuration for Parameter Control [7] Thomas Bartz-Beielstein, Carola Doerr, Jakob Bossek, Sowmya Chandrasekaran, Tome Eftimov, Andreas Fischbach, Pascal Kerschke, Manuel López-Ibáñez, Katherine M. Malan, Jason H. Moore, Boris Naujoks, Patryk Orzechowski, Vanessa Volz, Markus Wagner, and Thomas Weise. 2020. Benchmarking in Optimization: Best Practice and Open Issues. CoRR abs/2007.03488 (2020). arXiv:2007.03488 https://arxiv.org/abs/2007.03488 [8] Anton Bassin and Maxim Buzdalov. 2020. An Experimental Study of Operator Choices in the Genetic Algorithm. In Proceedings of the International Conference on Mathematical Optimization Theory and Operations Research. Num- ber 1275 in Communications in Computer and Information Science. 320–335. https://doi.org/10.1007/978-3-030-58657-7_26 λ, λ + ( ) ) 1 ( [9] André Biedenkapp. 2022. Dynamic algorithm configuration by reinforcement learning. Ph. D. Dissertation. University of Freiburg, Germany. https://freidok. uni-freiburg.de/data/230869 [10] André Biedenkapp, H. Furkan Bozkurt, Theresa Eimer, Frank Hutter, and Marius Lindauer. 2020. Dynamic Algorithm Configuration: Foundation of a New Meta- Algorithmic Framework. In Proc. of European Conference on Artificial Intelligence (ECAI'20) (Frontiers in Artificial Intelligence and Applications, Vol. 325). IOS Press, 427–434. https://doi.org/10.3233/FAIA200122 [11] André Biedenkapp, Nguyen Dang, Martin S. Krejca, Frank Hutter, and Carola Doerr. 2022. Theory-inspired parameter control benchmarks for dynamic algo- rithm configuration. In Proc. of Genetic and Evolutionary Computation Conference (GECCO). ACM, 766–775. https://doi.org/10.1145/3512290.3528846 [12] Edmund K. Burke, Michel Gendreau, Matthew R. Hyde, Graham Kendall, Gabriela Ochoa, Ender Özcan, and Rong Qu. 2013. Hyper-heuristics: a survey of the state of the art. J. Oper. Res. Soc. 64, 12 (2013), 1695–1724. https://doi.org/10.1057/jors. 2013.71 [13] Nathan Buskulic and Carola Doerr. 2021. Maximizing Drift Is Not Optimal for Solving OneMax. Evol. Comput. 29, 4 (2021), 521–541. https://doi.org/10.1162/ evco_a_00290 [14] Maxim Buzdalov and Benjamin Doerr. 2017. Runtime Analysis of the 1 λ, λ ) ) + ( Genetic Algorithm on Random Satisfiable 3-CNF Formulas. In Proc. of Genetic and Evolutionary Computation Conference (GECCO'17). ACM, 1343–1350. ( [15] Maxim Buzdalov and Carola Doerr. 2020. Optimal Mutation Rates for the 1 λ ) + EA on OneMax. In Proc. of Parallel Problem Solving from Nature (PPSN'20) (LNCS, Vol. 12270). Springer, 574–587. https://doi.org/10.1007/978-3-030-58115-2_40 ( [16] Maxim Buzdalov and Carola Doerr. 2021. Optimal static mutation strength evolutionary algorithm on OneMax. In Proc. of distributions for the Genetic and Evolutionary Computation Conference (GECCO'21). ACM, 660–668. https://doi.org/10.1145/3449639.3459389 + λ 1 ( ) [17] Leslie Pérez Cáceres, Manuel López-Ibáñez, Holger Hoos, and Thomas Stützle. 2017. An experimental study of adaptive capping in irace. In Learning and Intelligent Optimization: 11th International Conference, LION 11, Nizhny Novgorod, Russia, June 19-21, 2017, Revised Selected Papers. Springer, 235–250. [18] Deyao Chen, Maxim Buzdalov, Carola Doerr, and Nguyen Dang. 2023. Code and data repository of this paper. https://github.com/de0ch/OLL. + ( λ, λ [19] Nguyen Dang and Carola Doerr. 2019. Hyper-parameter tuning for the GA. In Proc. of Genetic and Evolutionary Computation Conference 1 ( (GECO'19). ACM, 889–897. https://doi.org/10.1145/3321707.3321725 [20] Marcelo de Souza, Marcus Ritt, and Manuel López-Ibáñez. 2022. Capping methods for the automatic configuration of optimization algorithms. Comput. Oper. Res. 139 (2022), 105615. https://doi.org/10.1016/j.cor.2021.105615 ) ) [21] Benjamin Doerr. 2019. Analyzing randomized search heuristics via stochastic domination. Theoretical Computer Science 773 (2019), 115–137. https://doi.org/ 10.1016/j.tcs.2018.09.024 [22] Benjamin Doerr and Carola Doerr. 2018. Optimal Static and Self-Adjusting Parameter Choices for the (1+(λ,λ)) Genetic Algorithm. Algorithmica 80 (2018), 1658–1709. https://doi.org/10.1007/s00453-017-0354-9 [23] Benjamin Doerr and Carola Doerr. 2020. Theory of Parameter Control Mech- anisms for Discrete Black-Box Optimization: Provable Performance Gains Through Dynamic Parameter Choices. In Theory of Evolutionary Computation: Recent Developments in Discrete Optimization. Springer, 271–321. [24] Benjamin Doerr, Carola Doerr, and Franziska Ebel. 2015. From black-box com- plexity to designing new genetic algorithms. Theoretical Computer Science 567 (2015), 87 – 104. [25] Benjamin Doerr, Huu Phuoc Le, Régis Makhmara, and Ta Duy Nguyen. 2017. Fast genetic algorithms. In Proc. of Genetic and Evolutionary Computation Conference (GECCO'17). ACM, 777–784. https://doi.org/10.1145/3071178.3071301 [26] Benjamin Doerr and Carola Winzen. 2014. Playing Mastermind with Constant- Size Memory. Theory of Computing Systems 55 (2014), 658–684. [27] Carola Doerr. 2020. Complexity Theory for Black-Box Optimization Heuris- tics. In Theory of Evolutionary Computation: Recent Developments in Discrete Optimization. Springer, 133–212. [28] Carola Doerr and Markus Wagner. 2018. Simple on-the-fly parameter selection mechanisms for two classical discrete black-box optimization benchmark prob- lems. In Proc. of Genetic and Evolutionary Computation Conference (GECCO'18). ACM, 943–950. https://doi.org/10.1145/3205455.3205560 [29] Agoston Endre Eiben, Robert Hinterding, and Zbigniew Michalewicz. 1999. Parameter control in evolutionary algorithms. IEEE Transactions on Evolutionary Computation 3 (1999), 124–141. [30] Theresa Eimer, André Biedenkapp, Maximilian Reimer, Steven Adriaensen, Frank Hutter, and Marius Lindauer. 2021. DACBench: A Benchmark Library for Dy- namic Algorithm Configuration. In Proc. of International Joint Conference on Artificial Intelligence (IJCAI'21). ijcai.org, 1668–1674. https://doi.org/10.24963/ ijcai.2021/230 [31] Álvaro Fialho, Luís Da Costa, Marc Schoenauer, and Michèle Sebag. 2010. Analyz- ing bandit-based adaptive operator selection mechanisms. Annals of Mathematics and Artificial Intelligence 60 (2010), 25–64. https://doi.org/10.1007/s10472-010- 9213-y [32] Brian W. Goldman and William F. Punch. 2015. Fast and Efficient Black Box Optimization Using the Parameter-less Population Pyramid. Evolutionary Com- putation 23 (2015), 451–479. [33] Nikolaus Hansen, Anne Auger, Raymond Ros, Olaf Mersmann, Tea Tušar, COCO: a platform for comparing con- Optimization Methods and https://doi.org/10.1080/10556788.2020.1808977 and Dimo Brockhoff. 2020. tinuous optimizers in a black-box setting. Software (2020), 1–31. arXiv:https://doi.org/10.1080/10556788.2020.1808977 [34] Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. 2018. Deep reinforcement learning that matters. In Proceedings of the AAAI conference on artificial intelligence, Vol. 32. [35] Frank Hutter, Manuel López-Ibánez, Chris Fawcett, Marius Lindauer, Holger H Hoos, Kevin Leyton-Brown, and Thomas Stützle. 2014. AClib: A benchmark library for algorithm configuration. In Learning and Intelligent Optimization: 8th International Conference, Lion 8, Gainesville, FL, USA, February 16-21, 2014. Revised Selected Papers 8. Springer, 36–40. [36] Giorgos Karafotias, Mark Hoogendoorn, and A.E. Eiben. 2015. Parameter Con- trol in Evolutionary Algorithms: Trends and Challenges. IEEE Transactions on Evolutionary Computation 19 (2015), 167–187. [37] Stefan Kern, Sibylle D. Müller, Nikolaus Hansen, Dirk Büche, Jiri Ocenasek, and Petros Koumoutsakos. 2004. Learning probability distributions in continuous evolutionary algorithms - a comparative review. Natural Computing 3 (2004), 77–112. [38] Ana Kostovska, Anja Jankovic, Diederick Vermetten, Jacob de Nobel, Hao Wang, Tome Eftimov, and Carola Doerr. 2022. Per-run Algorithm Selection with Warm- starting using Trajectory-based Features. In Parallel Problem Solving from Nature (PPSN) (LNCS, Vol. 13398). Springer, 46–60. https://doi.org/10.1007/978-3-031- 14714-2_4 Free version available at https://arxiv.org/abs/2204.09483. [39] Per Kristian Lehre and Carsten Witt. 2012. Black-Box Search by Unbiased Variation. Algorithmica 64 (2012), 623–642. [40] Manuel López-Ibáñez, Jürgen Branke, and Luís Paquete. 2021. Reproducibility in Evolutionary Computation. ACM Trans. Evol. Learn. Optim. 1, 4 (2021), 14:1–14:21. https://doi.org/10.1145/3466624 [41] Manuel López-Ibáñez, Jérémie Dubois-Lacoste, Leslie Pérez Cáceres, Mauro Birattari, and Thomas Stützle. 2016. The irace package: Iterated racing for automatic algorithm configuration. Operations Research Perspectives 3 (2016), 43–58. [42] Yasha Pushak and Holger H. Hoos. 2018. Algorithm Configuration Landscapes: - More Benign Than Expected?. In Proc. of Parallel Problem Solving from Nature (LNCS, Vol. 11102). Springer, 271–283. https://doi.org/10.1007/978-3-319-99259- 4_22 [43] Yasha Pushak and Holger H. Hoos. 2022. AutoML Loss Landscapes. ACM Trans. Evol. Learn. Optim. 2, 3 (2022), 10:1–10:30. https://doi.org/10.1145/3558774 [44] Raymond Ros and Nikolaus Hansen. 2008. A simple modification in CMA-ES achieving linear time and space complexity. In Parallel Problem Solving from Nature – PPSN X. Number 5199 in Lecture Notes in Computer Science. 296–305. John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal Policy Optimization Algorithms. CoRR abs/1707.06347 (2017). http://arxiv.org/abs/1707.06347 [45] [46] Gresa Shala, André Biedenkapp, Noor Awad, Steven Adriaensen, Marius Lindauer, and Frank Hutter. 2020. Learning Step-Size Adaptation in CMA-ES. In Proc. of Parallel Problem Solving from Nature (PPSN'20) (LNCS, Vol. 12270). Springer, 691–706. [47] Mudita Sharma, Alexandros Komninos, Manuel López-Ibáñez, and Dimitar Kaza- kov. 2019. Deep Reinforcement Learning-Based Parameter Control in Differ- ential Evolution. In Proc. of Genetic and Evolutionary Computation Conference (GECCO'19). ACM, 709–717. https://doi.org/10.1145/3321707.3321813 [48] David Speck, André Biedenkapp, Frank Hutter, Robert Mattmüller, and Marius Lindauer. 2021. Learning Heuristic Selection with Dynamic Algorithm Configu- ration. In Proc. of International Conference on Automated Planning and Scheduling (ICAPS). AAAI Press, 597–605. https://ojs.aaai.org/index.php/ICAPS/article/ view/16008 [49] Michele Tessari and Giovanni Iacca. 2022. Reinforcement learning based adap- tive metaheuristics. In Proceedings of the Genetic and Evolutionary Computation Conference Companion. 1854–1861. [50] Hado Van Hasselt, Arthur Guez, and David Silver. 2016. Deep reinforcement learning with double q-learning. In Proceedings of the AAAI conference on artificial intelligence, Vol. 30. [51] Ke Xue, Jiacheng Xu, Lei Yuan, Miqing Li, Chao Qian, Zongzhang Zhang, and Yang Yu. 2022. Multi-agent Dynamic Algorithm Configuration. In Advances in Neural Information Processing Systems 35 (NeurIPS'22). New Orleans, LA. [52] Wenjie Yi, Rong Qu, and Licheng Jiao. 2023. Automated algorithm design us- ing proximal policy optimisation with identified features. Expert Systems with Applications 216 (2023), 119461. [53] Wenjie Yi, Rong Qu, Licheng Jiao, and Ben Niu. 2022. Automated Design of Metaheuristics Using Reinforcement Learning within a Novel General Search Framework. IEEE Transactions on Evolutionary Computation (2022). [54] Yuchang Zhang, Ruibin Bai, Rong Qu, Chaofan Tu, and Jiahuan Jin. 2022. A deep reinforcement learning based hyper-heuristic for combinatorial optimisation with uncertainties. European Journal of Operational Research 300, 2 (2022), 418– 427. Deyao Chen, Maxim Buzdalov, Carola Doerr, and Nguyen Dang
http://arxiv.org/abs/2302.12333v1
2023-02-23T20:56:18
2023-02-23T20:56:18
Auditing for Spatial Fairness
This paper studies algorithmic fairness when the protected attribute is location. To handle protected attributes that are continuous, such as age or income, the standard approach is to discretize the domain into predefined groups, and compare algorithmic outcomes across groups. However, applying this idea to location raises concerns of gerrymandering and may introduce statistical bias. Prior work addresses these concerns but only for regularly spaced locations, while raising other issues, most notably its inability to discern regions that are likely to exhibit spatial unfairness. Similar to established notions of algorithmic fairness, we define spatial fairness as the statistical independence of outcomes from location. This translates into requiring that for each region of space, the distribution of outcomes is identical inside and outside the region. To allow for localized discrepancies in the distribution of outcomes, we compare how well two competing hypotheses explain the observed outcomes. The null hypothesis assumes spatial fairness, while the alternate allows different distributions inside and outside regions. Their goodness of fit is then assessed by a likelihood ratio test. If there is no significant difference in how well the two hypotheses explain the observed outcomes, we conclude that the algorithm is spatially fair.
[ "Dimitris Sacharidis", "Giorgos Giannopoulos", "George Papastefanatos", "Kostas Stefanidis" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12333v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12333v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CY", "cs.DB" ]
Auditing for Spatial Fairness Dimitris Sacharidis [email protected] Université Libre de Bruxelles Brussels, Belgium George Papastefanatos [email protected] IMSI/Athena Research Center Athens, Greece Giorgos Giannopoulos [email protected] IMSI/Athena Research Center Athens, Greece Kostas Stefanidis [email protected] Tampere University Tampere, Finland 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 3 3 3 2 1 . 2 0 3 2 : v i X r a ABSTRACT This paper studies algorithmic fairness when the protected at- tribute is location. To handle protected attributes that are continu- ous, such as age or income, the standard approach is to discretize the domain into predefined groups, and compare algorithmic outcomes across groups. However, applying this idea to location raises concerns of gerrymandering and may introduce statistical bias. Prior work addresses these concerns but only for regularly spaced locations, while raising other issues, most notably its inability to discern regions that are likely to exhibit spatial un- fairness. Similar to established notions of algorithmic fairness, we define spatial fairness as the statistical independence of out- comes from location. This translates into requiring that for each region of space, the distribution of outcomes is identical inside and outside the region. To allow for localized discrepancies in the distribution of outcomes, we compare how well two competing hypotheses explain the observed outcomes. The null hypothe- sis assumes spatial fairness, while the alternate allows different distributions inside and outside regions. Their goodness of fit is then assessed by a likelihood ratio test. If there is no significant difference in how well the two hypotheses explain the observed outcomes, we conclude that the algorithm is spatially fair. 1 INTRODUCTION Algorithmic fairness refers to the notion that the algorithm (e.g., the machine, an ML model, an AI system) should not discrimi- nate against individuals. Typically, discrimination is defined over groups of people that are considered protected, such as race or gender minorities. Abstractly, fairness requires that each pop- ulation group, determined by a specific value to the protected attribute (e.g., race, gender), is on average treated or affected by the algorithm in the same manner. To make this requirement concrete, one first needs to define a measure to appropriately quantify the behavior, performance, etc. of the algorithm. Then, algorithmic fairness is achieved when the measure is statistically independent of the protected attribute. In practice, this mandates that the measure is distributed equally among protected groups. Fairness notions differ in how they define the measure. For ex- ample, statistical parity considers the positive rate (how often the algorithm assigns the positive/desirable class) as the measure, whereas equal opportunity [5] considers the true positive rate (how often the algorithm correctly assigns the positive/desirable class). Motivation. In many cases, it is important to ensure that the algorithm does not discriminate against individuals on the ba- sis of their location (place of origin, home address, etc.). That is, we consider location as the protected attribute and we want the algorithm to exhibit spatial fairness. For example, consider an algorithm that decides whether mortgage loan applications are accepted or not.1 It is desirable that its decisions do not dis- criminate on the basis of the home address of the applicant. This could be to avoid redlining, i.e., indirectly discriminating based on ethnicity/race due to strong correlations between the home address and certain ethnic/racial groups, or to avoid gentrification, e.g., when applications in a poor urban area are systematically rejected to attract wealthier people. As another example, con- sider crime forecasting, where an algorithm predicts how likely a crime is to occur in a particular area. It is desirable that the algorithm is spatially fair in terms of its accuracy. That is, we require the predicted crime rate to not differ greatly than the observed crime rate in all areas. This could be to avoid under- and over-policing, and the sense of injustice they are typically associated with. In cases like these, there is the common need for a principled method to audit an algorithm for spatial fairness, i.e., examine its outcomes and answer the question "is it fair?". More importantly, if this answer is negative, the method should credibly testify, i.e., provide as evidence a region that is most likely to suffer from discrimination, and thus answer the question "where is it unfair?". Challenges. Unlike typical protected attributes, such as race and gender, location is a continuous attribute. The group-based definition of fairness does not apply, in a straightforward manner, to continuous protected attributes. Rather, the standard approach is to first discretize the continuous domain to create groups, e.g., age or income groups, and then compare the outcomes for each group. The same idea can be applied to location, by defining non-overlapping spatial partitions (e.g., city blocks, zipcodes, districts), and computing the measure in each. This leads to a partitioning-based definition, according to which an algorithm is spatially fair if the measures per partition are equal.2 However, this simple partitioning-based definition has two drawbacks. Location is highly susceptible to gerrymandering [7, 16], which is the act of purposefully defining a partitioning of the space (via setting the partition boundaries, extents, shapes) so that the partition measures appear non-discriminatory. Moreover, conclusions drawn from comparing spatial aggregates highly depend on the shape and scale of the partitions (the areal units), © 2023 Copyright held by the owner/author(s). Published in Proceedings of the 26th International Conference on Extending Database Technology (EDBT), 28th March-31st March, 2023, ISBN 978-3-89318-092-9 on OpenProceedings.org. Distribution of this paper is permitted under the terms of the Creative Commons license CC-by-nc-nd 4.0. 1In practice, an algorithm would compute a "credit score", based on which a human would take the decision. In that case, we would like these scores to be spatially fair. 2A note on terminology: a partitioning of the space consists of a set of non- overlapping regions, called partitions, that collectively cover the space. uniformly (b) Spatially unfair-by-design outcomes dis- tributed; left half has twice more positive outcomes than right half. (a) Spatially fair-by-design out- comes distributed in Florida; each outcome has 0.5 probabil- ity of being positive. Figure 1: Two spatial distributions each with n = 10, 000 outcomes among which p = 5, 000 are positive. Accord- ing to [16], the fair-by-design distribution is less fair than the unfair-by-design distribution (MeanVar of 0.0522 vs. 0.0431). a well-known source of statistical bias termed the modifiable areal unit problem (MAUP) [16]. A better partitioning-based measure of spatial fairness that tries to address these two drawbacks is proposed in [16]. Briefly, the idea is to superimpose a high-resolution grid over the space, and consider all possible rectangular, grid-aligned partitionings of the space. In each partitioning, the variance of the measure in the partitions is computed. Then, the mean variance across all partitionings, hereafter denoted as MeanVar, is computed. Lower values of MeanVar suggest lower variance across the partitions in all partitionings and hence more fairness. Note that MeanVar is designed to assess the spatial fairness of outcomes that are regularly distributed in space: in each cell of the superimposed grid (or equivalently in each partition of the partitioning with the highest resolution) there is roughly the same number of outcomes. As a consequence, computing MeanVar in the general case of outcomes arbitrarily distributed in space leads to counter-intuitive results. Concretely, MeanVar cannot reliably audit an algorithm for spatial fairness. To illustrate this, consider the example presented in Figure 1. The algorithm producing the SemiSynth dataset depicted on the left is spatially fair by design as positive/desirable (resp. negative/undesirable) outcomes are randomly assigned to each location with a prob- ability of 0.5, and are indicated as green (resp. red) points. The algorithm producing the Synth dataset depicted on the right is spatially unfair by design, as the left half of the area contains twice as many positive outcomes as the right half does. However, if we assess spatial fairness according to [16], we find that the unfair-by-design algorithm has a lower MeanVar of 0.0431 and is thus considered more fair than the fair-by-design algorithm with a higher MeanVar of 0.0522. This occurs because the spatial distribution of outcomes in Figure 1(a) is non-regular, and thus the number of outcomes within partitions varies greatly. Despite the fact that the ratio of positives is on average the same in each partition (by design), there exist several sparse partitions with few outcomes that are predominantly positive or negative, and which increase the variance of the measure. The example demon- strates that it is impossible to set a threshold for MeanVar such that it distinguishes a fair from an unfair algorithm. Therefore, MeanVar cannot answer the "is it fair?" question. (b) A region in California that testifies for spatial unfairness according to our framework (p- value < 0.005). (a) A suspicious region in Iowa that makes the largest contri- bution to MeanVar. Figure 2: Regions most likely to be unfair according to dif- ferent spatial fairness definitions for the LAR dataset de- scribed in Section 4.1. Depicted are the the number of ob- servations (n), the number of positive outcomes (p), and the local positive rate (ρ); the overall positive rate is 0.62. Even if MeanVar cannot discern fairness, one may wonder if it can be utilized to identify suspicious regions, i.e., regions that are likely to exhibit discrimination. The obvious way to search for suspicious regions is to consider the partitions that contribute the most to the MeanVar value. These are the partitions whose measures are the farthest away from the partitioning mean and thus take extreme values. For the reasons discussed before, these partitions are likely to be sparse and predominantly positive or negative. An example is given in Figure 2(a), where the depicted partition with just five negative outcomes ties for the largest contribution to MeanVar. On a first look, this appears to suggest an area of discrimination. However, this result is not statistically significant: it is not that uncommon to find a region that contains at least five negatives and no positives by chance (see Figure 6). Therefore, even though MeanVar can identify regions with ex- treme measures, arguably it cannot meaningfully answer the "where is it unfair?" question. Our Solution. In this work, we propose a practical definition for spatial fairness that enables auditing and testifying, i.e., that can answer both important questions regarding the algorithm, "is it fair?" and if not "where is it unfair?". The definition applies to the most general case and does not assume regularly distributed observations. Recall that algorithmic fairness is when some measure quanti- fying the behavior or performance of the algorithm is statistically independent of the protected attribute. In our setting, location is the protected attribute, so we naturally consider an algorithm to be spatially fair, if the measure is independent of location. This implies that for any region of the space, the distribution of the measure inside and outside the region should be the same. To operationalize this definition, there are several challenges. The most complicating is how to determine the distribution of the measure within a region. If the region covers many observations, the observed (empirical) distribution of the measure is a good proxy for the actual distribution. Otherwise, what we observe in a sparse or small region might differ dramatically from what we observe outside it. Note that this issue does not manifest itself in categorical protected attributes (e.g., gender), simply because the number of observations per protected group (e.g., number of women and men) are typically very large. To address this issue, instead of looking at the observed dis- tribution, we want to express how likely it is to observe such a distribution if the algorithm was fair. Intuitively, we should expect to find a region with only four negative points clustered together even when the algorithm is fair. Conversely, we should not expect to find a region that contains thirty negative points alone - observing such a region should be a stronger indication that the algorithm is not fair. Inspired by the work in spatial scan statistics [6, 9, 15], we form two hypotheses and seek to quantify which one is a better fit for the data observed. The null hypothesis is that of spatial fairness, i.e., there is a single distribution that controls how the measure is distributed in the space, or mnemonically inside = outside. The alternate hypothesis states that there is a difference in the distribution inside and outside a region, or inside ≠ outside. Given the observed data, we can determine the maximum likelihood for each hypothesis, compute their ratio, and test whether this likelihood ratio is statistically significant at a desired level. The remainder of this paper is organized as follows. Section 2 reviews important concepts from algorithmic fairness and scan statistics. Section 3 introduces our definition of fairness and the auditing framework. Section 4 presents some results of our frame- work on several datasets. Section 5 concludes this work. 2 RELATED WORK 2.1 Algorithmic Fairness Algorithmic fairness has seen various definitions [12]. One impor- tant distinction [2] is between individual fairness definitions are based on the premise that similar entities should be treated simi- larly, and group fairness definitions group entities based on the value of one or more protected attributes and ask that all groups are treated similarly. In this work, we consider the definition of the latter category. Note that fairness by unawareness, where the protected attribute is not considered by the algorithm is not sufficient in many cases, due to the presence of other attributes that might be correlated with them. Let X denote a set of features that describe an individual, and let A denote the protected attribute(s); for ease of presentation assume that A is a binary valued attribute, where A = 1 indicates the protected group. For what follows we assume that the algo- rithm is a binary classification model. Therefore, let Y denote the actual class of the individual (the ground truth), with the positive class Y = 1 denoting the desirable/favorable class. For example, the positive class might correspond to the acceptance of a loan application, the hiring of a candidate, the granting of parole, etc. Moreover, let ˆY denote the predicted output of the algorithm; note that although we do not explicitly show it, ˆY depends on X . Statistical approaches to group fairness can be distinguished as [4]: base rates approaches that use only the output ˆY of the algorithm, and accuracy approaches that use both the output ˆY of the algorithm and the ground truth Y . Base rate fairness compares the probability P ( ˆY = 1|A = 1) that one individual receives the favorable outcome when they belong to the protected group with the corresponding probability P ( ˆY = 1|A = 0) that one receives the favorable outcome when they belong to the non- protected group. To compare the two, we may take their ratio [3] or their difference [1]. When the probabilities of a favorable outcome are equal for the two groups, we have a special type of fairness termed statistical parity. Statistical parity preserves the input ratio, that is, the demographics of the individuals receiving a favorable outcome are the same as the demographics of the underlying population. Statistical parity is a natural way to model equity: members of each group have the same chance of receiving the favorable output. Accuracy-based fairness warrants that various types of clas- sification errors (e.g., true positives, false positives) are equal across groups. Depending on the type of classification errors con- sidered, the achieved type of fairness takes different names [5]. For example, the case in which we ask that P ( ˆY = 1|Y = 1, A = 1) = P ( ˆY = 1|Y = 1, A = 0) (i.e., the case of equal true positive rate for the two groups) is called equal opportunity. Similarly, the case in which both the true positive rate and the false positive rate are equal for the two groups, is called equal odds. These notions can be generalized under a common idea. Let M indicate the event/resource that is to be distributed fairly among individuals. In the case of statistical parity, the resource is positive rate and the event is M = ˆY . In equal opportunity, the resource is true positive rate and thus the event is M = ˆY |Y = 1. Equal odds considers the true positive rate and the false positive rate, which is modeled as M = ˆY |Y = 0. Then these fairness notion can be expressed as the requirement that P (M |A = 1) = P (M |A = 0), or equivalently that M is independent of A, i.e., P (M |A) = P (M). More recently, there have been approaches that define fairness from a causal perspective [8, 10, 11]. For example, we might require that A does not cause M, rather than simply requiring that M is independent of A. 2.2 Spatial Fairness The problem of spatial fairness has received little attention. As location is a continuous attribute, the standard approach is to discretize locations and apply the standard definitions [14]. This discretization approach may be susceptible to gerrymandering. To avoid this, [16] considers all possible grid-based rectangular partitionings of the space into regions. Given a partitioning, the algorithm is considered fair if it exhibits roughly the same perfor- mance in each region. This is quantified as the variance of some performance metric M across partitions. The algorithm is (per- fectly) fair with respect to a partitioning if there is zero variance. The algorithm is (perfectly) fair if it is fair with respect to every partitioning, among a predefined set. In essence, this definition takes a brute-force approach to the problem: it applies the group- based approach, which is susceptible to gerrymandering, to each possible partition to eliminate the likelihood of gerrymandering. [16] defines an unfairness measure as the mean variance across partitionings. This measure is then used as an additional optimiza- tion goal in a learning process to produce classification models that do not exhibit spatial unfairness in this sense. As discussed in the previous section, and as we illustrate in Section 4, the defi- nition in [16] has several shortcomings making it less meaningful in real-life applications where the observations are not regularly distributed in space. 2.3 Scan Statistics Our notion of spatial fairness is inspired by the work in spatial scan statistics. For a 1d domain like time, scan statistics answer questions such as whether there exists an unusually high con- centration of events in some time period. In the spatial case, scan statistics answer similar questions, e.g., is there an unusually high concentration of a particular virus variant in some spatial area. Spatial scan statistics have been proposed for various un- derlying spatial processes, such as Bernoulli and Poisson [9], and multinomial distributions [6]. Our work is directly related to the former type. Moreover, there is another line of work on detect- ing mixture areas [13, 15], e.g., areas that contain a low or high diversity of point categories. 3 A SPATIAL FAIRNESS FRAMEWORK We consider binary classification tasks concerning individuals. Let X denote a set of features that describe an individual. Among them, location L is considered the protected attribute. Let R de- note a spatial region, and let n(R) denote the number of individu- als whose location falls in the region. Moreover, let Y denote the true class of the individual, with the positive class Y = 1 denoting the desirable class. Further, consider a classification model ˆY that takes as input the features X of an individual and predicts their class ˆY (X ). A summary of the important notation is in Table 1. In what follows, we define spatial fairness in terms of statis- tical parity, i.e., we quantify the positive rate of the model; the definitions can be adapted to the cases of equal opportunity and equal odds by replacing ˆY with ˆY |Y = 1 to account for the true positive and ˆY |Y = 0 for the false positive rates. Let ρ = Pr ( ˆY = 1) denote the positive rate (pr ) of the model, i.e., the probability that the models predicts the positive class. Restricting focus to a particular spatial region R, we define the local positive rate as ρ (R) = Pr ( ˆY = 1|L ∈ R), which is the pr taking into account only individuals within the region R. We now formulate an idealized notion of spatial statistical parity, by requiring that every local positive rate is equal to the positive rate of the model, i.e., ρ (R) = ρ for all R; equivalently, all local positive rates should be equal. This definition is impractical as it can only be satisfied by trivial classifiers that predict either 0 or 1. Thus, we must relax the definition to allow the local positive rates to differ from each other and the overall pr . The question is to what extent they can differ before we declare the model to be spatially unfair. To answer this, we define a statistical test, based on the Bernoulli spatial scan statistic [9], that decides whether the positive rate is homogeneous across the space. First, observe that we can interpret a positive rate ρ as the prob- ability that the model assigns an individual to the positive class; i.e., a Bernoulli trial with success probability ρ. Now, consider the group of people within a region R. The number of positive labels the model assigns follows the Binomial distribution with n(R) trials and success probability ρ, denoted as p (R) ∼ B(n(R), ρ). We now define two hypotheses and use a statistical test to de- termine which explains the observed data better. The discussion that follows is based on the multinomial spatial scan statistic; an important difference is that we do not care for the direction of change of the statistic inside and outside a region. The null hypothesis H0 states that in every region R the number of posi- tive labels, p (R), follows the Binomial distribution B(n(R), ρ0), where R, ρ0 are the parameters of the null hypothesis. The alter- native hypothesis H1 states that there is a region R such that p (R) follows B(n(R), ρ0), while the number of positive labels outside R follows a Binomial with a different success probability ρ1 ≠ ρ0, i.e., B(N − n(R), ρ1). The alternate hypothesis has three parameters R, ρ0, ρ1. To quantify which hypothesis explains the observed data bet- ter, we derive their maximum likelihoods, and compute the like- lihood ratio. Let us first consider the null hypothesis. The like- lihood of H0 is given by L0 (R, ρ0) = ρp (R) (1 − ρ0)n (R)−p (R) , where n(R) (resp. p (R)) denotes the number of individuals (resp. with positive labels) in a region R. For any region R, observe that the maximum likelihood is when ρ0 = p (R)/n(R). Across all regions, the likelihood takes the maximum value when R is the entire space. Therefore, the maximum likelihood value of the = ρP (1 − ρ)N −P . null hypothesis is Lmax 0 0 Table 1: Important Notation Symbol Meaning X L Y ˆY N P ρ = N P R n (R) p (R) ρ (R) = n (R) p (R) features of an individual location of an individual actual outcome/class model prediction number of individuals num. of indiv. predicted to be in the positive class model's positive rate a spatial region number of individuals in R num. of indiv. in R predicted to be in the pos. class model's local positive rate in R 1 0 (1 − ρ0)n (R)−p (R) ρP −p (R) Consider now the alternative hypothesis. Its likelihood is the product of two binomials, one for inside and one for outside the region R, each having a different success probability: L1 (R, ρ0, ρ1) = ρp (R) (1 − ρ1)N −n (R)−(P −p (R)) First, we maximize the likelihood for a given R. Recall that H1 requires that ρ0 ≠ ρ1. If the observed positive rate inside the region, p (R)/n(R), is different from that outside the region, (P − p (R))/(N − n(R)), then the likelihood takes its maximum value when ρ0 and ρ1 take the values of the observed positive rates inside and outside the region, respectively. Otherwise, it cannot exceed the likelihood when ρ0 = ρ1 = ρ. Concretely, we have: , P −p (R) N −n (R) ) P −p (R) N −n (R) , (1) Lmax 1 (R) = if p (R) n (R) ≠ otherwise. (cid:40)L1 (R, p (R) n (R) Lmax 0 We refer to the value in Eq. 1 as the spatial unfairness likelihood, and denote it as SUL. The next step is to identify the region that maximizes Eq. 1. This is achieved by going over a predetermined set of regions R. Let R∗ ∈ R be the region that maximizes Eq. 1. We compute the likelihood ratio test statistic of the alternative over the null hypothesis as τ = we compute and determine the difference of log-likelihoods. . Note, that in practice, Lmax 1 Lmax 0 (R∗) To determine how significant the test statistic τ value is, we need to perform a Monte Carlo simulation to determine its distri- bution, as also performed in [9, 15]. Specifically, the simulation goes as follows. We create alternate worlds assuming that the N individuals are located as in our data, but their label is determined by a Bernoulli trial with success probability ρ. This mirrors the process generating the examples in Figure 6. For each alternate world, we compute the τ statistic. Suppose we simulate w − 1 worlds, and the τ statistic of the real world ranks at the k-th highest position among all worlds. Then, the p-value of the real world's statistic is k/w. We declare an algorithm as spatially fair if the p-value of the aforementioned likelihood ratio test statistic is below some predefined significance level α. In this case, the observed data are just as likely to be generated under the spatial fairness null hypothesis as under the alternate hypothesis. Otherwise, we have to reject the spatial fairness hypothesis. In this case, we may offer evidence that support the hypothesis that the algorithm is unfair. Providing evidence is the identification process. We consider all examined regions that have a statistically significant likelihood ratio, and we rank them in decreasing order of their likelihood ratio. We then return the top-k regions as evidence. The computational complexity of our auditing framework is O (M * N * Q), where N is the number of regions to scan, Q the average cost of a spatial range-count query, and M − 1 is the number of Monte Carlo simulations. 4 EXPERIMENTS Our experimental study investigates two research questions. R1. In a setting compatible with prior work [16], does our spatial fairness definition present more meaningful results compared to prior work? R2. Does our method identify regions that can be considered as potentially exhibiting spatial unfairness? Sec- tion 4.1 describes the dataset used, while Sections 4.2 and 4.3 answer the two research questions. The code and datasets are available in GitHub.3 4.1 Datasets In our experiments, we use two real, one semi-synthetic, and one synthetic datasets. The first real dataset concerns about mort- gage loan applications. Thanks to the Home Mortgage Disclosure Act, financial institutions in the US are required to publicly dis- close information about mortgages. We download the modified loan/application register (LAR) records4 for Bank of America for the year 2021. The dataset contains information about over 300 thousand applications, including whether they were denied and the census tract of the applicant, which is a geographic region roughly corresponding to cities and towns. We preprocess the dataset to keep records for loan applications approved or denied. Further, we use the Gazetteer files provided by the US Census Bureau5 to associate each census tract with the coordinates of its center. In the end, we obtain a dataset, denoted as LAR, with 206,418 applications, among which 127,286 were granted (i.e., 0.62 positive rate), geographically distributed along 50,647 loca- tions, depicted in Figure 7. We use LAR to audit spatial fairness when the measure of interest is the positive rate, i.e., in the statis- tical parity sense. That is we want to investigate if all areas have the same chance of being granted a mortgage loan. The overall positive rate is 0.62. The second real dataset is about crime incidents in the city of Los Angeles from 2010–20196. The data contains several at- tributes including an approximate location of the incident. We consider the incident code, which we binarize into serious and non-serious crimes, as the label. We train a random forest clas- sifier to predict the "seriousness" of the incident; the positive class is the serious crimes, while the negative the non-serious. As features, we select 7 attributes: time, code of police precinct, victim's age, sex and descent, the type of the incident location, and the weapon used. After removing entries with missing val- ues, there are 711,852 incidents split into train/test sets with a 70%:30% ratio. We collect the predictions and the true labels for the incidents in the test set, and construct our dataset, denoted as Crime. The accuracy of the model is 0.78. We use Crime to audit spatial fairness where the measure of interest is the true positive rate. That is, in the equality of opportunity sense, we want to investigate if the algorithm's accuracy for serious crimes is independent of location. Therefore, to apply the framework of [16] and ours, we retain the predictions for the true positive la- bels, which results in 61,266 entries, and the overall true positive rate is 0.58. Crime is depicted in Figure 8. The semi-synthetic dataset, denoted as SemiSynth and de- picted in Figure 1(a), contains 10,000 outcomes for locations that are randomly selected in Florida from the LAR dataset. The posi- tive and negative are randomly assigned to each location with a 3https://github.com/dsachar/AuditSpatialFairness 4https://ffiec.cfpb.gov/data-publication/modified-lar/2021 5https://www.census.gov/geographies/reference-files/time-series/geo/ gazetteer-files.2021.html 6https://data.lacity.org/Public-Safety/Crime-Data-from-2010-to-2019/63jg-8b9z probability of 0.5. Hence, SemiSynth is spatially fair by design. The measure of interest is positive rate. The synthetic dataset, denoted as Synth and depicted in Fig- ure 1(b), contains 10,000 outcomes for locations selected uni- formly at random within a rectangular area. The area is split into two halves, each containing 5,000 outcomes. However, the left half has twice as many positive outcomes as the right half does. Therefore, the positive rate in the left half is about 0.67, while in the right half is 0.33. 4.2 Results on Partitionings In the first round of experiments, we consider a setting appro- priate for the MeanVar measure of spatial unfairness proposed in [16]. Therefore, we consider rectangular partitionings of the space. To compare our methodology with MeanVar, we restrict our methodology to only audit for fairness the partitions that belong to the partitionings. Is it Fair? The first experiment is to test whether the two meth- ods can correctly audit for fairness, i.e., answer the "is it fair" question. For this we use the SemiSynth and Synth datasets that we have designed to be fair and unfair, respectively. We construct 100 rectangular partitionings, where the number of horizontal and vertical splits of the space is randomly selected between 10 to 40. As discussed in the context of Figure 1, MeanVar is 0.0522 for the fair-by-design SemiSynth and 0.0431 for the unfair-by-design Synth; recall that lower MeanVar values suggest more fairness. Therefore, MeanVar fails to discern fairness. In contrast, our method finds that SemiSynth is fair while Synth is unfair at the 0.005 statistical significance level. Where is it Unfair? In the second set of experiments, we par- tition the space into a regular grid of various granularities, and investigate whether the methods can meaningfully identify par- titions that potentially exhibit spatial unfairness. For MeanVar, we identify the partitions that make the largest contribution to the MeanVar value. As discussed, in Section 1, these are the partitions with extreme measures that differ greatly from the partitioning mean. We rank partitions according to their con- tribution to MeanVar. For our method, we fix the statistical significance level at 0.005, and identify all partitions that exhibit spatial unfairness at that significance level. We rank partitions according to their SUL value (Eq. 1). We first examine spatial fairness in terms of positive rate (i.e., statistical parity) and use the LAR dataset. Intuitively, we want to identify partitions where the algorithm assigns the posi- tive/desirable class differently from the global mean. We consider a partitioning of high resolution 100×50. Our framework declares the outcomes as spatially unfair and identifies 59 statistically sig- nificant partitions depicted in Figure 3(a). The partition that has the highest SUL value is displayed in Figure 2(b), and concerns a region in northern California that covers almost 8,000 outcomes, among which 84% are positive. Our framework identifies mostly dense regions that have statistically significant different local positive rates compared to the global. In contrast, we display the top-50 partitions according to MeanVar in Figure 3(b). It is easy to observe that they are all very sparse partitions that contain only negative outcomes. The largest of them with 5 outcomes is displayed in Figure 2(a). Comparing the results of highest MeanVar and SUL in Fig- ure 2, we find that the partition in California has a non-extreme local positive of 0.84, compared to 0 for the partition in Iowa, (a) Spatial Fairness: the 59 statistically significant unfair parti- tions (a) Spatial Fairness: the 5 statistically significant unfair partitions (b) MeanVar-Based Fairness: top-50 partitions of highest Mean- Var Figure 3: LAR: Results for a high-resolution partitioning of 100 × 50. whereas the former has a much higher and significant log-likelihood difference of about 1000 compared to 0.96 for the latter (in this experiment log-likelihood differences beyond 9.6 are significant at the 0.005 level). As expected, MeanVar identifies partitions with extreme measures, whereas SUL identifies partitions that have abnormal (in the statistical likelihood sense) measures. We now examine spatial fairness in terms of true positive rate (i.e., equal opportunity) and use the Crime dataset. Intuitively, we want to identify partitions where the prediction accuracy is different from the overall prediction accuracy of the algorithm. We consider a partitioning of low resolution 20 × 20. Our frame- work declares the outcomes as spatially unfair and identifies 5 statistically significant partitions depicted in Figure 4(a). One of the partitions with the highest SUL value is located in Hollywood, and covers almost 3,000 outcomes, where only 51% of them are predicted to be serious crimes. Contrasting this to the global true positive rate of 0.58, we see that the algorithm tends to classify incidents as non-serious in this area, more so than in other areas. In contrast, we display the top-5 partitions according to Mean- Var in Figure 4(b). All of them concern very sparse areas with a single false positive, and are thus not interesting for the auditor. 4.3 Results for Unrestricted Regions In this set of experiments, we only study our framework and can thus examine arbitrarily sized regions. Specifically, we consider square regions with 20 different side lengths ranging from 0.1 up to 2 degrees (roughly 10 to 200 kilometers). The centers of square regions are placed in 100 locations defined as the centers of a k-means clustering of the observation locations. In total, we scan 2,000 square regions. Their centers and their smallest and largest shape are shown in Figure 10. Applying our framework at a significance level of 0.005, we identify 700 unfair regions. As these regions intersect each other, we select a set of non-overlapping regions. We examine centers in sequence, and for each center we keep the region with the high- est value of the statistic. Fig 5 displays the 28 non-overlapping (b) MeanVar-Based Fairness: top-5 partitions of highest Mean- Var Figure 4: Crime: Results for a partitioning of 20 × 20. Figure 5: LAR: The 28 non-overlapping unfair regions regions. The important observation is that our framework identi- fies regions of varying area size and observation size. For example an area near Tampa, FL is the smallest radius of 0.1 degrees with the largest number, 473, of observations, while a nearby area centered in Orlando, FL is the largest, with a radius of 1 degrees, and 4,783 observations. In conclusion, the regions returned as evidence from our methodology that the algorithm is unfair are non-trivial (espe- cially, compared to those discovered by MeanVar), and can be used from the auditor to further investigate whether the observed unfairness is justified or not. 5 CONCLUSION This paper introduces a generally applicable definition of spatial fairness. It includes a concrete framework to audit an algorithm for spatial fairness, and the ability to identify regions that are very likely to be spatially unfair with statistical significance. The intuition is that for any region, the distribution of outcomes inside and outside the region should be similarly distributed. The statistical test examines if the spatial fairness assumption is more likely than the alternative that allows for regions with different outcome distributions inside and outside. Acknowledgement: The authors were partially supported by the EU's Horizon Programme call, under Grant Agreements No. 101093164 (ExtremeXP) and No. 101070568 (AutoFair). REFERENCES [1] Toon Calders and Sicco Verwer. 2010. Three naive Bayes approaches for discrimination-free classification. Data Min. Knowl. Discov. 21, 2 (2010), 277– 292. [2] Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard S. Zemel. 2012. Fairness through awareness. In Innovations in Theoretical Com- puter Science 2012. ACM, 214–226. [3] Michael Feldman, Sorelle A. Friedler, John Moeller, Carlos Scheidegger, and Suresh Venkatasubramanian. 2015. Certifying and Removing Disparate Impact. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, 259–268. [4] Sorelle A. Friedler, Carlos Scheidegger, Suresh Venkatasubramanian, Sonam Choudhary, Evan P. Hamilton, and Derek Roth. 2019. A comparative study of fairness-enhancing interventions in machine learning. In Proceedings of the Conference on Fairness, Accountability, and Transparency, FAT* 2019. ACM, 329–338. [5] Moritz Hardt, Eric Price, and Nati Srebro. 2016. Equality of Opportunity in Supervised Learning. In NIPS. 3315–3323. [6] Inkyung Jung, Martin Kulldorff, and Otukei John Richard. 2010. A spatial scan statistic for multinomial data. Statistics in medicine 29, 18 (2010), 1910–1918. [7] Michael Kearns, Seth Neel, Aaron Roth, and Zhiwei Steven Wu. 2018. Prevent- ing Fairness Gerrymandering: Auditing and Learning for Subgroup Fairness. In Proceedings of the 35th International Conference on Machine Learning (Proceed- ings of Machine Learning Research, Vol. 80), Jennifer Dy and Andreas Krause (Eds.). PMLR, 2564–2572. https://proceedings.mlr.press/v80/kearns18a.html [8] Niki Kilbertus, Mateo Rojas-Carulla, Giambattista Parascandolo, Moritz Hardt, Dominik Janzing, and Bernhard Schölkopf. 2017. Avoiding Discrimination through Causal Reasoning. In NIPS. 656–666. [9] Martin Kulldorff. 1997. A spatial scan statistic. Communications in Statistics- Theory and methods 26, 6 (1997), 1481–1496. [10] Matt J. Kusner, Joshua R. Loftus, Chris Russell, and Ricardo Silva. 2017. Coun- terfactual Fairness. In NIPS. 4066–4076. [11] Razieh Nabi and Ilya Shpitser. 2018. Fair Inference on Outcomes. In AAAI. AAAI Press, 1931–1940. [12] Evaggelia Pitoura, Kostas Stefanidis, and Georgia Koutrika. 2022. Fairness in rankings and recommendations: an overview. VLDB J. 31, 3 (2022), 431–458. [13] Dimitrios Skoutas, Dimitris Sacharidis, and Kostas Patroumpas. 2021. Discov- ering Mixture-Based Best Regions of Arbitrary Shapes. In Proceedings of the 29th International Conference on Advances in Geographic Information Systems. 468–479. [14] Leonard Weydemann, Dimitris Sacharidis, and Hannes Werthner. 2019. Defining and measuring fairness in location recommendations. In Local- Rec@SIGSPATIAL. ACM, 6:1–6:8. [15] Yiqun Xie, Han Bao, Yan Li, and Shashi Shekhar. 2020. Discovering spatial mixture patterns of interest. In Proceedings of the 28th International Conference on Advances in Geographic Information Systems. 608–617. [16] Yiqun Xie, Erhu He, Xiaowei Jia, Weiye Chen, Sergii Skakun, Han Bao, Zhe Jiang, Rahul Ghosh, and Praveen Ravirathinam. 2022. Fairness by "Where": A Statistically-Robust and Model-Agnostic Bi-level Learning Framework. In AAAI. AAAI Press, 12208–12216. Figure 7: LAR dataset depicting the locations and out- comes of mortgage loan applications; green indicates ac- ceptance, red denial. Figure 8: Crime dataset depicting the locations of crime incidents; green indicates serious crimes, red non-serious crimes. (a) Spatial Fairness: the 22 statistically significant unfair parti- tions (b) MeanVar-Based Fairness: top-20 partitions of highest Mean- Var Figure 9: LAR: Results for a low-resolution partitioning of 25 × 12. Figure 6: Four examples of 1,000 positive/negative out- comes of a spatially fair algorithm with the same positive rate 50% and with the same spatial distribution. In all ex- amples, it is easy to identify a region with at least five neg- ative and no positive outcomes, drawn as a blue circle. A EXAMPLE OF SPATIAL FAIR BY DESIGN ALGORITHM Consider an algorithm that produces two outcomes, positive and negative, displayed as green and red points, respectively. For each location, there is the same probability ρ = 0.5 that the point is positive, independent of the location. Thus, the algorithm is spatially fair by design. Figure 6 shows examples of possible outcomes of this spatially fair algorithm. If we look at the regions highlighted in blue, we observe at least five negative and no positive outcomes. There is a clear discrepancy between the observed positive rate inside (0) and outside (roughly ρ) the region, and we might be tempted to claim that the algorithm is not fair. However, this event is quite likely to appear by chance. All four examples in Figure 6 have the same underlying spatial distribution (locations are the same across ex- amples) but different outcome distributions (colors change across examples). In all examples, it is easy to identify "red" clusters. B ADDITIONAL EXPERIMENTS We next present some additional experiments. B.1 Additional Results on Paritionings We consider a partitioning of low resolution 25 × 12. Figure 9(a) depicts the 22 statistically significant partitions, while Figure 9(b) shows the top-20 partitions based on the partitioning-based score. Our framework mostly identifies dense partitions as unfair, while the opposite holds for MeanVar. Nonetheless, the latter now also returns some dense areas, and also identifies the most spatially unfair region in northern California according to our definition. B.2 Additional Results for Unrestricted Regions We identify regions that are unfair in the sense that there are significantly less positive outcomes inside the region compared to outside. Figure 11 displays the 27 non-overlapping predominantly "red" regions. The most unfair red region is the one around Miami, FL with 6,281 outcomes among which only 43% are positive. We look for unfair regions such that there are significantly more positive outcomes inside the region compared to outside. Figure 11 displays the 27 non-overlapping "green" regions. The Figure 10: LAR: The centers of the square regions scanned, and their smallest and largest shape Figure 11: LAR: The 27 non-overlapping unfair regions ex- hibiting lower positive rate inside than outside, i.e., "red" regions Figure 12: LAR: The 17 non-overlapping unfair regions exhibiting higher positive rate inside than outside, i.e., "green" regions most unfair green region is the one around San Jose, CA with 17,875 outcomes among which 83% are positive.
http://arxiv.org/abs/2302.12320v1
2023-02-23T20:34:01
2023-02-23T20:34:01
Dynamic Regret Analysis of Safe Distributed Online Optimization for Convex and Non-convex Problems
This paper addresses safe distributed online optimization over an unknown set of linear safety constraints. A network of agents aims at jointly minimizing a global, time-varying function, which is only partially observable to each individual agent. Therefore, agents must engage in local communications to generate a safe sequence of actions competitive with the best minimizer sequence in hindsight, and the gap between the two sequences is quantified via dynamic regret. We propose distributed safe online gradient descent (D-Safe-OGD) with an exploration phase, where all agents estimate the constraint parameters collaboratively to build estimated feasible sets, ensuring the action selection safety during the optimization phase. We prove that for convex functions, D-Safe-OGD achieves a dynamic regret bound of $O(T^{2/3} \sqrt{\log T} + T^{1/3}C_T^*)$, where $C_T^*$ denotes the path-length of the best minimizer sequence. We further prove a dynamic regret bound of $O(T^{2/3} \sqrt{\log T} + T^{2/3}C_T^*)$ for certain non-convex problems, which establishes the first dynamic regret bound for a safe distributed algorithm in the non-convex setting.
[ "Ting-Jui Chang", "Sapana Chaudhary", "Dileep Kalathil", "Shahin Shahrampour" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12320v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12320v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.OC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.OC", "cs.LG", "cs.SY", "eess.SY" ]
Dynamic Regret Analysis of Safe Distributed Online Optimization for Convex and Non-convex Problems Ting-Jui Chang, Sapana Chaudhary, Dileep Kalathil and Shahin Shahrampour 3 2 0 2 b e F 3 2 ] C O . h t a m [ 1 v 0 2 3 2 1 . 2 0 3 2 : v i X r a Abstract- This paper addresses safe distributed online op- timization over an unknown set of linear safety constraints. A network of agents aims at jointly minimizing a global, time-varying function, which is only partially observable to each individual agent. Therefore, agents must engage in lo- cal communications to generate a safe sequence of actions competitive with the best minimizer sequence in hindsight, and the gap between the two sequences is quantified via dynamic regret. We propose distributed safe online gradient descent (D-Safe-OGD) with an exploration phase, where all agents estimate the constraint parameters collaboratively to build estimated feasible sets, ensuring the action selection safety during the optimization phase. We prove that for convex functions, D-Safe-OGD achieves a dynamic regret bound of O(T 2/3√ T ), where C ∗ T denotes the path-length of the best minimizer sequence. We further prove a dynamic regret bound of O(T 2/3√ T ) for certain non- convex problems, which establishes the first dynamic regret bound for a safe distributed algorithm in the non-convex setting. log T + T 2/3C ∗ log T + T 1/3C ∗ I. INTRODUCTION Online learning (or optimization) is a sequential decision- making problem modeling a repeated game between a learner and an adversary [1]. At each round t, t ∈ [T ] (cid:44) {1, . . . , T }, the learner chooses an action xt in a convex set X ⊆ Rd using the information from previous observations and suffers the loss ft(xt), where the function ft : X → R is chosen by the adversary. Due to the sequential nature of the problem, a commonly used performance metric is regret, defined as the difference between the cumulative loss incurred by the learner and that of a benchmark comparator sequence. When the comparator sequence is fixed, this metric is called static regret, defined as follows Regs T (cid:44) T (cid:88) t=1 ft(xt) − min x∈X T (cid:88) t=1 ft(x). (1) Static regret is well-studied in the online optimization lit- erature. In particular, it is well-known that online gradient descent (OGD) achieves a O( T ) (respectively, O(log T )) static regret bound for convex (respectively, exp-concave and strongly convex) problems [2], [3], and these bounds are optimal in the sense of matching the lower bound of regret in the respective problems [1]. √ For non-convex problems, however, we expect that the standard regret notion used in the convex setting may not be a tractable measure for gauging the algorithm performance. For and Chang of T.J. partment Northeastern email:{chang.tin,s.shahrampour}@northeastern.edu. Shahrampour and Boston, are Industrial MA S. Mechanical De- Engineering, USA. University, 02115, with the S. Chaudhary and D. Kalathil are with the Department of Electrical and Computer Engineering, Texas A&M University, College Station, TX 77843, USA. email:{sapanac,dileep.kalathil}@tamu.edu. example, in the context of online non-convex optimization, [4] quantified the regret in terms of the norm of (projected) gradients, consistent with the stationarity measure in offline optimization. More recently, [5] showed that under certain geometric and smoothness conditions, OGD applied to non- convex functions is an approximation of online mirror de- scent (OMD) applied to convex functions under reparam- eterization. In view of this equivalence, OGD achieves a O(T 2/3) static regret defined in (1). A more stringent benchmark for measuring the perfor- mance of online optimization algorithms is the dynamic regret [6], [7], defined as Regd T (cid:44) T (cid:88) t=1 ft(xt) − T (cid:88) t=1 ft(x∗ t ), (2) (cid:44) argminx∈X ft(x). It is well-known that dynamic where x∗ t regret scales linearly with T in the worst-case scenario, when the function sequence fluctuates drastically over time. Therefore, various works have adopted a number of variation measures to characterize the dynamic regret bound. We provide a detailed review of these measures in Section II and describe the safe distributed online optimization in the next section. A. Safe Distributed Online Optimization There are two distinctive components that make "safe distributed online optimization" more challenging than the standard online optimization: (i) Distributed Setting: Distributed online optimization has been widely applied to robot formation control [8], tracking [9], and localization in sensor distributed target networks [10]. In this setting, a network of m agents aims at solving the online optimization problem collectively. The main challenge is that the time-varying function sequence is only partially observable to each individual agent. Each agent j ∈ [m] receives (gradient) information about the "local" function fj,t(*), but the objective is to control the dynamic regret of each agent with respect to the global function ft(*) = (cid:80)m i=1 fi,t(*), i.e., ft(xj,t) − T (cid:88) t=1 ft(x∗ t ) Regd j,T (cid:44) = T (cid:88) t=1 T (cid:88) m (cid:88) fi,t(xj,t) − T (cid:88) t=1 ft(x∗ t ). (3) t=1 i=1 Therefore, despite availability of only local information, the action sequence of agent j is evaluated in the global function, and is compared to the global minimizer sequence. It is evident that agents must communicate with each other (subject to a graph/network constraint) to approximate the global function, which is common to distributed problems. The network structure and communication protocols are provided in Section III-C. (ii) Safety Constraints: The literature on distributed online optimization has mostly focused on problems where the constraint set X is known, and less attention has been given to problems with unknown feasible sets (see Sec- tion II for a comprehensive literature review). However, in many real-world applications, this set represents certain safety constraints that are unknown in advance. Examples include voltage regulation constraints in power systems [11], transmission bandwidth in communication networks due to human safety considerations [12] and stabilizing action set in robotics applications [13]. In these scenarios, one needs to perform parameter estimation to learn the safety constraints while ensuring that the regret is as small as possible. B. Contributions In this work, we address the problem of distributed on- line optimization with unknown linear safety constraints. In particular, the constraint set X s = {x ∈ Rd : Ax ≤ b} is linear, where A is unknown and must be learned by agents to subsequently choose their actions from this set. The superscript s in X s alludes to safety. Our specific objective is to study dynamic regret (2) for both convex and non- convex problems when the set X s is unknown to agents. Our contributions are three-fold: 1) We propose and analyze safe distributed online gradient descent (D-Safe-OGD) algorithm, which has two phases (exploration and optimization). In the exploration phase, agents individually explore and jointly estimate the con- straint parameters in a distributed fashion. Then, each agent constructs a feasible set with its own estimate, which ensures the action selection safety with high probability (Theorem 2). Since the estimates are only local, in the optimization phase, agents apply distributed OGD projected to different feasible sets, which brings forwards additional technical challenges. 2) We analyze D-Safe-OGD in the convex setting. Due to the challenge discussed in the previous item, we cannot directly apply existing results on distributed online optimization with a common feasible set. We tackle this problem by leveraging the geometric prop- erty of linear constraints when agents' estimates are close enough to each other. Then, we strike a trade- off between the exploration and optimization phases and prove (in Theorem 3) a dynamic regret bound of O(T 2/3√ log T + T 1/3C ∗ T ), where C ∗ T (cid:44) T (cid:88) t=2 (cid:13) (cid:13)x∗ t − x∗ t−1 (cid:13) (cid:13) , (4) is the path-length, defined with respect to the global minimizer sequence [7], [14]. If the problem is cen- tralized (single agent) and the comparator sequence is fixed, i.e., x∗ t = x, our result recovers the static regret bound of [15]. 3) We further analyze D-Safe-OGD in the non-convex setting. We draw up on the idea of the algorithmic equivalence between ODG and OMD [5] to establish that in certain problem geometries (Assumptions 5- 6), D-Safe-OGD can be approximated by a distributed OMD algorithm applied to a reparameterized "convex" problem. We prove that the dynamic regret is upper bounded by O(T 2/3√ T ) in Theorem 5, which is the first dynamic regret bound for a safe distributed algorithm in the non-convex setting. If the problem is centralized (single agent) and the comparator sequence is fixed, i.e., x∗ t = x, our result recovers the static regret bound of [5]. log T + T 2/3C ∗ The proofs of our results are provided in the Appendix. II. RELATED LITERATURE is well-known that a) I) Centralized Online Optimization:: For static re- gret, it the optimal regret bound is √ O( T ) (respectively, O(log T )) for convex (respectively, exp-concave and strongly convex) problems [1]. For dynamic regret, various regularity measures have been considered. A commonly used measure is the path-length with respect to a general comparator sequence {ut}T t=1, defined as CT (u1, . . . , uT ) (cid:44) T (cid:88) t=2 (cid:107)ut − ut−1(cid:107) . (5) √ [2] first showed that for convex functions, OGD attains an upper bound of O( T (1 + CT )) for dynamic regret, later improved to O((cid:112)T (1 + CT )) using expert advice [16]. For strongly convex and smooth functions, [14] showed a regret bound of O(C ∗ T ) for OGD. The notion of higher- (cid:44) (cid:80)T t − x∗ order path-length C ∗ has also p,T been considered by several works. When the minimizer t=1 is uniformly bounded, O(C ∗ sequence {x∗ p,T ) implies O(C ∗ q,T ) for q < p. [17] proved that with multiple gradi- ent queries per round, the dynamic regret is improved to O(min{C ∗ (cid:13) (cid:13)x∗ t }T (cid:13) p (cid:13) t−1 t=2 T , C ∗ 2,T }). Other regularity measures include the function variation VT (cid:44) (cid:80)T t=2 supx∈X |ft(x) − ft−1(x)| [6], the predic- T (u1, . . . , uT ) (cid:44) (cid:80)T tive path-length C (cid:48) t=2 (cid:107)ut − Ψt(ut−1)(cid:107) [18], where Ψt is a given dynamics, and the gradient vari- ation DT (cid:44) (cid:80)T t=1 (cid:107)∇ft(xt) − mt(cid:107)2 [19], where mt is a predictable sequence computed by the learner. [6] proposed a restarting OGD and showed that when the learner only has access to noisy gradients, the expected dynamic regret is bounded by O(T 2/3(VT + 1)1/3) and O((cid:112)T (1 + VT )) for convex and strongly convex functions, respectively. The above measures are not directly comparable to each other. In this regard, [7] provided a dynamic regret bound in terms of C ∗ T , DT and VT for the adaptive optimistic OMD algorithm. Also, [20] revisited OGD with multiple queries in the unconstrained setup and established the regret bound of O(min{VT , C ∗ 2,T }) for strongly convex and smooth functions. Dynamic regret has also been studied for functions with a parameterizable structure [21] as well as composite convex functions [22]. T , C ∗ √ √ b) II) Distributed Online Optimization:: [23] studied distributed OGD for online optimization and proved a static T ) (respectively, O(log T )) for convex regret bound of O( (respectively, strongly-convex) functions. Distributed online optimization for time-varying network structures was then considered in [10], [24], [25]. [9] proposed a distributed OMD algorithm with a dynamic regret bound of O( T (1 + C ∗ T )). [26] considered time-varying network structures and showed that distributed proximal OGD achieves a dynamic regret of O(log T (1 + C ∗ T )) for strongly convex functions. [27] developed a method based on gradient tracking and derived a regret bound in terms of C ∗ T and a gradient path- length. More recently, [28] showed that dynamic regret for strongly convex and smooth functions can be improved to O(1 + C ∗ T ) using both primal and dual information boosted with multiple consensus steps. The non-convex case is also recently studied in [29], where the regret is characterized by first-order optimality condition. Nevertheless, the works mentioned in (I) and (II) do not consider neither long-term nor safety constraints, which are discussed next. √ c) III) Constrained Online Optimization:: Practical systems come with inherent system imposed constraints on the decision variable. Some examples of such constraints are inventory/budget constraints in one-way trading problem [39] and time coupling constraints in networked distributed energy systems [40]. For a known constraint set, projecting the decisions back to the constraint set is a natural way to incorporate constraints in OCO with projected OGD for general cost functions achieving O( T ) static regret. However, for complex constraints, projection can induce computational burden. An early work by [41] in this space, solves the constrained optimization problem by replacing the quadratic convex program with simpler linear program using Frank-Wolfe. For understanding the following references better, let X = {x ∈ X ⊆ Rd : g(x) ≤ 0n} where g(x) = (g1(x), g2(x), . . . , gn(x))(cid:62) is vector formed by n convex constraints, and X is a closed convex set. The work by [31] proposed to use a simpler closed form projection in place of true desired projection attaining O( T ) static regret with (cid:80)T t=1 gi (xt) ≤ O(T 3/4) constraint violation ∀i ∈ [n]. Thus, their method achieves optimal regret with lesser computation burden at the cost incurring constraint violations. The follow up work by [32], proposed adaptive step size variant of [31] with O (cid:0)T max{β,1−β}(cid:1) static regret and O (cid:0)T 1−β/2(cid:1) constraint violation for β ∈ (0, 1). These bounds were further improved in [30] with a static regret T ) and constraint violation bound of O(T 1/4). bound of O( Here, the constraint violation is further reduced to O(1) when gi(x) satisfy Slater condition. The work by [33] considers stricter 'cumulative' constraint violations of the form (cid:80)T t=1 [gi (xt)]+ ∀i ∈ [n] and proposes algorithms with O (cid:0)T max{β,1−β}(cid:1) static regret and O (cid:0)T 1−β/2(cid:1) 'cu- mulative' constraint violation for β ∈ (0, 1). For strongly convex functions, [33] gives O(log(T )) static regret and constraint violations of respective forms is O((cid:112)log(T )T ). the work by [34] proposed an algorithm More recently, (cid:13) with O (cid:0)T max{β,1−β}(cid:1) regret and (cid:80)T (cid:13) ≤ O (cid:0)T (1−β)/2(cid:1) 'cumulative' constraint violation. For strongly (cid:13) (cid:13)[g (xt)]+ t=1 √ √ convex functions, [34] reduce both static regret and con- straint violation bounds to O(log(T )). Further, [34] give dynamic bounds of O((cid:112)T (1 + CT )) for regret and O( T ) 'cumulative' constraint violation. The algorithms in [30]– [34] employ some flavour of online primal-dual algorithms. A series of recent works [42]–[47] have also dealt with time- varying constraints. [45] specifically works with 'stochastic' time varying constraints. √ √ i=1 t=1 j=1 (cid:80)n (cid:80)m (cid:2)a(cid:62) i xj,t t=1 gi (xj,t)]+, More recently works in [35]–[38] have looked at dis- tributed OCO with long term constraints. The work by [35] proposes a consensus based primal-dual sub-gradient algorithm with O(T 1/2+β0) regret and O(T 1−β0/2) con- straint violation for β0 ∈ (0, 0.5). Single constraint func- tion is considered in [35] and constraint violation is of the form [(cid:80)T i = 1, ∀j ∈ [m]. In [36], the authors propose algorithms for distributed online T ) regret and O(T 3/4) con- linear regression with O( straint violation. Here, constraint violation takes the form (cid:3) (cid:80)T +, where ai, i ∈ [n] is a con- straint vector. Another primal-dual algorithm is presented in [37] with O(T max{1−β,β}) regret and O(T 1−β/2) con- straint violation of the form (cid:80)T i=1 [gi (xj,t)]+ for β ∈ (0, 1). In all of [35]–[37] constraint functions are known a priori. Most recently, [38] propose algorithms for distributed OCO with time-varying constraints, and for stricter 'network' constraint violation metric of the form (cid:13) (cid:13) 1 (cid:13) (cid:13) (cid:13)[gt (xi,t)]+ (cid:13). The algorithm in [38] gives t=1 m a dynamic regret of O((α2 0T 1−β + T β(1 + CT ))/α0) with O((cid:112)(α0 + 1)T 2−β) constraint violation for α0 > 1 and β ∈ (0, 1). Additionally, constrained distributed OCO with coupled inequality constraints is considered in [48], [49]; with bandit feedback on cost function is considered in [50]; with partial constraint feedback in studied in [51]. For more references in this problem space, please see the survey in [52]. (cid:80)m (cid:80)m (cid:80)n (cid:80)T j=1 t=1 i=1 d) IV) Safe Online Optimization:: Safe optimization is a fairly nascent field with only a few works studying per- time safety in optimization problems. In [53], [54] study the problem of safe linear bandits giving O(log(T ) T ) regret with no constraint violation, albeit under an assumption that a lower bound on the distance between the optimal action and safe set's boundary is known. Without knowledge such a lower bound, [53] show O(log(T )T 2/3) regret. Safe convex and non-convex optimization is studied in [55], [56]. Safety in the context of online convex optimization is studied in [15] with a regret of O((cid:112)log(T )T 2/3). √ Remark 1: Different from the works listed above, we study the problem of safe distributed online optimization with unknown linear constraints. We consider both convex and non-convex cost functions. TABLE I: Related works on centralized and distributed constrained online optimization for general functions with regret and constraint violation (CV) guarantees. Let g(x) = (g1(x), g2(x), . . . , gn(x))(cid:62) is vector formed by n convex constraints. Let β ∈ (0, 1), α0 > 1 and [a]+ = max{0, a}. Problem type 'C' stands for centralized, 'D' stands for distributed (or decentralized), 'CNX' stands for convex cost functions, and 'N-CNX' stands for non-convex cost functions. Notes: † : The CV bound in [30] can be further reduced to O(1) under a Slater's condition assumption. Reference Regret Type (cid:80)T (cid:80)T (cid:80)T CV Type t=1 gi (xt) ∀i ∈ [n] t=1 maxi∈[n] gi (xt) t=1 [gi (xt)]+ ∀i ∈ [n] (cid:80)T t=1 (cid:107) [g (xt)]+ (cid:107) (cid:80)T t=1 (cid:107) [g (xt)]+ (cid:107) t=1 gi (xt) ∀i ∈ [n] (cid:80)T (cid:104)(cid:80)T (cid:105) t=1 gi (xj,t) (cid:80)T (cid:80)T (cid:80)m (cid:80)m j=1 t=1 t=1 (cid:80)m j=1 (cid:80)T 1 m i=1 (cid:80)T , i = 1, ∀j ∈ [m] (cid:3) i xj,t + (cid:2)a(cid:62) (cid:80)n i=1 + (cid:80)n i=1 [gi (xj,t)]+ (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)[gt (xi,t)]+ (cid:13) t=1 t=1 (cid:107)Axt − b(cid:107) (cid:80)m (cid:80)m j=1 (cid:107)Axj,t − b(cid:107) j=1 (cid:107)Axj,t − b(cid:107) (cid:80)T (cid:80)T t=1 t=1 Problem C, CNX C, CNX C, CNX C, CNX C, CNX C, CNX D, CNX D, CNX D, CNX D, CNX [31] [32] [33] [34] [34] [30] [35] [36] [37] [38] C, CNX D, CNX D, N-CNX [15] This work This work Static Static Static Static Dynamic Static Static Static Static Dynamic Static Dynamic Dynamic Regret Bound √ O( T ) O(T max{β,1−β}) O(T max{β,1−β}) O(T max{β,1−β}) O((cid:112)T (1 + CT )) √ O( T ) O(T 1/2+β/2) √ O( T ) O(T max{β,1−β}) CV Bound O(T 3/4) O(T 1−β/2) O(T 1−β/2) O(T (1−β)/2) √ O( T ) O(T 1/4)† O(T 1−β/4) O(T 3/4) O(T 1−β/2) O((α2 0T 1−β + T β (1 + CT ))/α0) O((cid:112)(α0 + 1)T 2−β ) O((cid:112)log(T )T 2/3) O (cid:0)T 2/3√ O (cid:0)T 2/3√ log T + T 1/3C∗ T log T + T 2/3C∗ T (cid:1) (cid:1) 0 0 0 III. PRELIMINARIES A. Notation [m] (cid:107)*(cid:107)F (cid:107)*(cid:107)V ΠX [*] [A]ij [A]:,j 1 ei Jf (x) The set {1, 2, . . . , m} for any integer m Frobenius norm of a matrix √ x(cid:62)Vx, for x ∈ Rd and a positive-definite V The operator for the projection to set X The entry in the i-th row and j-th column of A The j-th column of A The vector of all ones The i-th basis vector The Jacobian of a mapping f (*) at x B. Strong Convexity and Bregman Divergence Definition 1: A function f : X → R is μ-strongly convex (μ > 0) over the convex set X if f (x) ≥ f (y) + ∇f (y)(cid:62)(x − y) + μ 2 (cid:107)x − y(cid:107)2 , ∀x, y ∈ X . the Definition 2: For a strongly convex function φ(*), Bregman divergence w.r.t. φ(*) over X is defined as Dφ(x, y) (cid:44) φ(x) − φ(y) − ∇φ(y)(cid:62)(x − y), x, y ∈ X . C. Network Structure The underlying network topology is governed by a sym- metric doubly stochastic matrix P, i.e., [P]ij ≥ 0, ∀i, j ∈ [m], and each row (or column) is summed to one. If [P]ij > 0, agents i and j are considered neighbors, and agent i assigns the weight [P]ij to agent j when they communicate with each other. We assume that the graph structure captured by P is connected, i.e., there is a (potentially multi-hop) path from any agent i to another agent j (cid:54)= i. Each agent is considered as a neighbor of itself, i.e., [P]ii > 0 for any i ∈ [m]. These constraints on the communication protocol implies a geometric mixing bound for P [57], such that (cid:80)m mβk, for any i ∈ [m], where β is the second largest singular value of P. For a connected graph, DG, the graph diameter, is defined as the number of the links of the longest of the shortest paths connecting any two agents (DG is at most m − 1). (cid:12)[Pk]ji − 1/m(cid:12) (cid:12) (cid:12) ≤ j=1 √ Remark 2: In all of the algorithms proposed in the paper, we will see P as an input. This does not contradict the de- centralized nature of the algorithms, as agent i only requires the knowledge of [P]ji > 0 for any j in its neighborhood. The knowledge of P is not global, and each agent only has local information about it. IV. SAFE SET ESTIMATION In our problem setup, the algorithm receives noisy obser- vations of the form ˆxi,t = Axi,t + wi,t ∀i ∈ [m] at every timestep t, where the nature of noise wi,t is described below. Here A ∈ Rn×d, b ∈ Rn and n is the number of constraints. Note that all agent updates are synchronous. A. Assumptions To study the problem of safe distributed online optimiza- tion, we make the following assumptions common to both the convex and the non-convex problem settings. Assumption 1: The set X s is a closed polytope, hence, convex and compact. Also, (cid:107)x(cid:107) ≤ L, ∀x ∈ X s, and maxi∈[n] (cid:107)ai(cid:107)2 ≤ LA, where ai denotes the i-th row of A. Assumption 2: The constraint noise sequence {wi,t, t ∈ [T ]} is R-sub-Gaussian with respect to a filtration {Fi,t, t ∈ [T ]}, i.e., ∀t ∈ [T ], ∀i ∈ [m], E[wi,t|Fi,t−1] = 0 and for any x ∈ Rd, (cid:104)x, wi,t(cid:105) is R (cid:107)x(cid:107) sub-Gaussian: E[exp(σx(cid:62)wi,t) | Ft−1] ≤ exp(σ2(R (cid:107)x(cid:107))2/2). Assumption 3: Every agent has knowledge of a safe base- line action xs ∈ X s such that Axs = bs < b. The agents are aware of xs and bs and thus, the safety gap ∆s = mini∈[n](bi − bs i ) denotes the i-th element of b (respectively, bs). i ), where bi (respectively, bs The first two assumptions are typical to online optimiza- tion. The third assumption stems from the requirement to be absolutely safe at every time step. The assumption warrants need for a safe starting point which is readily available in most practical problems of interest. Similar assumptions can be found in previous literature on safe linear bandits [53], [54], safe convex and non-convex optimization [55], [56], and safe online convex optimization [15]. B. Explore and Estimate In this section we present an algorithmic subroutine, Alg. 1, for agents to obtain sufficiently good local estimates of X s before beginning to perform OGD. For the first T0 timesteps, each agent safely explores around the baseline action xs. Each exploratory action is a γ-weighted combination of the baseline action and an i.i.d random vector ζi,t. Here, for the agent i ∈ [m] at timestep t ∈ [T0], γ ∈ [0, 1) and ζi,t is zero mean i.i.d random vector with (cid:107)ζi,t(cid:107) ≤ L and Cov(ζi,t) = σ2 ζ I. Performing exploration in this manner ensures per time step safety requirement as noted in the Lemma 1. Lemma 1: Let Assumptions 1 and 3 hold. With γ = ∆s , LLA Axi,t ≤ b for each xi,t = (1 − γ)xs + γζi,t ∀i ∈ [1, m], t ∈ [1, T0]. local functions t=1 (cid:107)Axi,t − ˆxi,t(cid:107)2 + λ Once the exploration phase is finished, agents con- the form li(A) (cid:44) li(A) of struct (cid:80)T0 m (cid:107)A(cid:107)2 F . Then, for timesteps t ∈ [T0 + 1, T0 + T1], Alg. EXTRA [58] is used to solve the global Least Squares (LS) estimation problem (cid:80)m i=1 li(A) in a distributed fashion. α is chosen based on EXTRA. Lemma 2: Suppose Assumptions 1 and 2 hold. By run- ning Algorithm 1 with T0 = Θ( L2 δ )) for data collection and T1 = O(log T ρ) where ρ is a positive constant, then with probability at least (1 − 2δ), we have ∀k ∈ [n] and ∀i, j ∈ [m] log( d mγ2σ2 ζ (cid:13) (cid:13)ˆai k − ak (cid:13) (cid:13) ≤ 1 T ρ + (cid:113) R √ (cid:1) + λLA d log (cid:0) 1+mT0L2/λ (cid:113) δ/n mγ2σ2 ζ T0 , (6) k (cid:13) (cid:13) (cid:13) ≤ k − ˆaj 2 T ρ , (cid:13) (cid:13)ˆai (cid:13) where ˆai the true parameters A, respectively. k and ak are the k-th rows of agent i's estimate and Let us now define the estimated safe sets for each agent i ∈ [m]. Let the parameter estimate for agent i ∈ [m] returned by EXTRA at the end of T0 + T1 timestep be denoted by (cid:98)Ai. For each row k ∈ [n] of (cid:98)Ai, a ball centered at ˆai k with a radius of Br can be defined as follows Ci,k (cid:44) {ak ∈ Rd : (cid:13) (cid:13) (cid:13) ≤ Br}, (cid:13)ak − ˆai k (7) (cid:114) R d log (cid:0) 1+mT0L2 /λ δ/n (cid:1)+ √ λLA where Br = 1 T ρ + (cid:113) 1 parameter ak lies inside the set Ci,k with a high probability of (1 − δ/n). Now, using (7), safe estimated set for agent i ∈ [m] can be constructed as follows: 2 mγ2σ2 ζ T0 . The true (cid:98)X s i (cid:44) {x ∈ Rd : ̃a(cid:62) k x ≤ bk, ∀ ̃ak ∈ Ci,k, ∀k ∈ [n]}. (8) V. DYNAMIC REGRET ANALYSIS FOR THE CONVEX SETTING that without During the T0 + T1 steps in Algorithm 1 agents do not expend any effort to minimize the regret. This is due to the knowledge of the feasible set, the fact they cannot perform any projection. In this section, we propose D-Safe-OGD, which allows agents to carry out a safe distributed online optimization, and we analyze D-Safe- OGD in the convex setting. Algorithm 1 Distributed Constraint Parameter Estimation 1: Require: number of agents m, doubly stochastic matrix P ∈ Rm×m, ̃P (cid:44) I+P 2 , hyper-parameters α, γ and λ, data-collection duration T0, constraint-estimation dura- tion T1, a strictly feasible point xs. for i = 1, 2, . . . , m do 2: Explore around baseline action: 3: for t = 1, 2, . . . , T0 do 4: 5: 6: 7: 8: end for 9: Form local functions using explored data: Select action xi,t = (1 − γ)xs + γζi,t Receive noisy observation ˆxi,t = Axi,t + wi,t end for li(A) (cid:44) T0(cid:88) t=1 (cid:107)Axi,t − ˆxi,t(cid:107)2 + λ m (cid:107)A(cid:107)2 F . to solve global LS problem 10: Use EXTRA [58] i=1 li(A): (cid:80)m 11: Randomly generate (cid:98)A0 = (cid:80)m 12: ∀i ∈ [m], (cid:98)AT0+1 i 13: for t = T0, . . . , T0 + T1 − 2 do for i = 1, 2, . . . , m do 14: 15: = (cid:80)m (cid:98)At+2 i α[∇li( (cid:98)At+1 i ) − ∇li( (cid:98)At i)]. end for 16: 17: end for i ∈ Rn×d for all i ∈ [m]. j − α∇li( (cid:98)A0 j=1[P]ji (cid:98)A0 i ). j=1 2[ ̃P]ji (cid:98)At+1 j − (cid:80)m j=1[ ̃P]ji (cid:98)At j − D-Safe-OGD is summarized in Algorithm 2, where in the exploration phase, all agents collaboratively estimate the constraint parameters based on Algorithm 1, and then each agent constructs the feasible set based on its own estimate. In the optimization phase, the network applies distributed OGD, where all agents first perform gradient descent with their local gradients, and then they communicate their iterates with neighbors based on the network topology imposed by P. We note that the projection operator of each agent is defined w.r.t. the local estimated feasible set (line 8 of Algorithm 2), thereby making the feasible sets close enough but slightly different from each other. Therefore, previous regret bounds for distributed online optimization over a common feasible set (e.g., [9], [23], [25], [28]) are not immediately applicable. We tackle this challenge using the geometric property of linear constraints [56], and we present an upper bound on the dynamic regret in terms of the path-length regularity measure. We adhere to the following standard assumption in the context of OCO: Assumption 4: The cost functions fi,t are convex ∀i ∈ [m] and ∀t ∈ [T ], and they have a bounded gradient, i.e., (cid:107)∇fi,t(x)(cid:107) ≤ G for any x ∈ X s. (cid:16)(cid:0) L2 Theorem 3: Suppose Assumptions 1-3 and 4 hold and . By running Algorithm 2 with mγ2σ2 ζ , η = Θ(T −1/3), T0 = Θ(T 2/3) and T1 = T = Ω γ ≤ ∆s LLA Θ(log T ρ), we have with probability at least (1 − 2δ) δ )(cid:1)3/2(cid:17) log( d xi,t ∈ X s, ∀i ∈ [m], t ∈ [T ], and Regd i,T = O (cid:18) β (1 − β) T 2/3(cid:112)log T + T 1/3C ∗ T (cid:19) , ∀i ∈ [m]. Theorem 3 establishes a dynamic regret bound for D-Safe- OGD that is at least O(T 2/3√ log T ), and for a large enough path-length the bound becomes O(T 1/3C ∗ T ). We can also see the impact of network topology through β, the second largest singular value of P. When the network connectivity is stronger (i.e., β is smaller), the regret bound is tighter. Corollary 4: Suppose that the comparator sequence is fixed over time, i.e., x∗ t = x∗, ∀t ∈ [T ]. Then, the individual regret bound is O(T 2/3), which recovers the static regret bound of the centralized case in [15] in terms of order. Remark 3: Note that when A is known, there is no estimation error, and the trade-off in terms of η and T0 no longer exists. In other words, the agents do not incur the initial regret of T0 + T1 = O(T 2/3), caused by estimation. Then, by choosing η = Θ( 1√ ), the resulting bound is T O( T ), which recovers the result of [9] in the order sense. T (1 + C ∗ √ Algorithm 2 Distributed Safe OGD with linear constraints 1: Require: number of agents m, doubly stochastic matrix P ∈ Rm×m, hyper-parameters γ, η, δ, λ, time horizon T , a strictly feasible point xs. 2: Specify T0 and T1 based on given hyper-parameters and run Algorithm 1 to learn agents estimates { ˆAi}i∈[m] in a distributed fashion. 3: For all i ∈ [m], construct the safe set (cid:98)X s i from the estimate (cid:98)Ai. 4: Distributed online gradient descent over different feasible sets: 5: Let Ts (cid:44) (T0 + T1 + 1). 6: for t = Ts, . . . , T do 7: 8: for i = 1, 2, . . . , m do yi,t = Π (cid:98)X s i [xi,t − η∇fi,t(xi,t)] . end for For all i ∈ [m], 9: 10: 11: 12: end for xi,t+1 = m (cid:88) j=1 [P]jiyj,t. VI. DYNAMIC REGRET ANALYSIS FOR THE NON-CONVEX SETTING In this section, we study the non-convex setting for safe distributed online optimization. Even for offline optimiza- tion in the non-convex setting, the standard metric for the convergence analysis is often stationarity, i.e., characterizing the decay rate of the gradient norm. In online optimization, we can also expect that standard regret notions, used in the convex setting, may not be tractable for understanding the algorithm performance. However, in a recent work by [5], the authors studied an algorithmic equivalence property between OGD and OMD for certain problem geometries (Assumptions 5-6), in the sense that OGD applied to non- convex problems can be approximated by OMD applied to convex functions under reparameterization, using which a sub-linear static regret bound is guaranteed. More specifically, for a centralized problem, suppose that there is a non-linear mapping q, such that ft(x) = ̃ft(q(x)), where ̃ft(*) is convex, and consider the OGD and OMD updates OGD: xt+1 = argminx∈X OMD: (cid:110) ∇ft(xt)(cid:62)(x − xt) + 1 2η (cid:107)x − xt(cid:107)2(cid:111) , (9) (cid:111) (cid:110) ∇ ̃ft(ut)(cid:62)(u − ut) + 1 η Dφ(u, ut) ut+1 = argminu∈X (cid:48) , (10) where ut = q(xt) and X (cid:48) is the image of X under the mapping q. By quantifying the deviation (cid:107)ut+1 − q(xt+1)(cid:107) between OGD and OMD, [5] proved a sublinear static regret bound for the online non-convex optimization using OGD. In this work, we establish this equivalence for "distributed" variants of OGD and OMD under the additional complexity that the constraint set is unknown, and it can only be approx- imated via Algorithm 1. We also point out that as opposed to the convex case, for the non-convex algorithm we apply max-consensus [59] after the exploration phase, where at each communication step, each agent keeps the estimate with the maximum norm among the estimates collected from its neighbors (including its own estimate). In [59], it was shown that for a connected graph, it takes DG communication steps for all agents to reach consensus on the estimate. Then, all agents construct the feasible set based on that estimate, which changes line 4 of Algorithm 2 to a distributed OGD on a common feasible set. For the technical analysis of the non- convex setting, we use the following assumptions. Assumption 5: There exists a bijective mapping q : X s → X s(cid:48) such that [∇2φ(u)]−1 = Jq(x)Jq(x)(cid:62) where u = q(x). Examples that satisfy Assumption 5 are provided in Section 3.1 of [5]. For example, if φ is the negative entropy (re- spectively, log barrier), we can use quadratic (respectively, exponential) reparameterization for q. [60] showed that in the continuous-time setup when Assumption 5 holds, the mirror descent regularization induced by φ can be transformed back to the Euclidean regularization by q−1, which implies the equivalence between OMD for convex functions and OGD for non-convex functions. Though in the discrete-time case, the exact equivalence does not hold, [5] showed that OGD for non-convex functions can still be approximated as OMD for convex functions, and the corresponding static regret bound is O(T 2/3). Assumption 6: Properties of the mapping q(*): • There exists a mapping q(*) such that fi,t(x) = ̃fi,t(q(x)), where ̃fi,t(*) is convex. • q(*) is a C 3-diffeomorphism, and Jq(x) is diagonal. • For any X ⊂ X s which is compact and convex, X (cid:48) (cid:44) q(X ) is convex and compact. We again refer the reader to Section 3.1 of [5] for examples related to Assumption 6. In general, Assumptions 5-6 provide sufficient conditions for the analysis. In this work, the focus is on analyzing the effect of (i) the constraint estimation as well as (ii) the distributed setup in non-convex online learning, and we also generalize the analysis of [5] to the dynamic regret. Assumption 7: Let W > 1 be a constant. Assume that q(*) is W -Lipschitz, φ(*) is 1-strongly convex and smooth with its first and third derivatives upper bounded by W . The first and second derivatives of q−1(*) are also bounded by W . For all u ∈ X s(cid:48), Dφ(u, *) is W -Lipschitz over X s(cid:48). (cid:13) (cid:13) (cid:13) ≤ GF for all u ∈ X s(cid:48) and (cid:13) (cid:13)∇ ̃fi,t(u) (cid:13) supu,z∈X s(cid:48) Dφ(u, z) ≤ D(cid:48). Assumption 8: Assumption 9: Let x and {yi}m i=1 be vectors in Rd. The Bregman divergence satisfies the separate convexity in the following sense Dφ(x, m (cid:88) i αiyi) ≤ m (cid:88) i αiDφ(x, yi), where α ∈ ∆m is on the m−dimensional simplex. This assumption is satisfied by commonly used Bregman divergences, e.g., Euclidean distance and KL divergence. We refer interested readers to [9], [61] for more information. In the following theorem, we prove that with high probability, the dynamic regret bound of D-Safe-OGD is O(T 2/3√ log T + T 2/3C ∗ (cid:16)(cid:0) L2 Theorem 5: Suppose Assumptions 1-3 and 5-9 hold and . By running Algorithm 2 with mγ2σ2 ζ , η = Θ(T −2/3), T0 = Θ(T 2/3) and T1 = T = Ω γ ≤ ∆s LLA Θ(log T ρ), we have with probability at least (1 − 2δ) log( d T ). δ )(cid:1)3/2(cid:17) xi,t ∈ X s, ∀i ∈ [m], t ∈ [T ], i,T = O(T 2/3(cid:112)log T + T 2/3C ∗ Regd and T ), ∀i ∈ [m]. Corollary 6: Suppose that static over time, i.e., x∗ regret bound becomes O(T 2/3√ static regret bound of [5] up to log factor. the comparator sequence is t = x∗, ∀t ∈ [T ]. Then, the individual log T ), which recovers the It is worth noting that though in the convex case, the estimation of unknown constraints exacerbates the regret bound (due to O(T 2/3) time spent on exploration), for the non-convex case, the resulting bound still matches the static regret of [5], where there is no estimation error. In other words, there is no trade-off in this case as the static regret (without estimation error) is O(T 2/3) [5]. CONCLUSION In this work, we considered safe distributed online opti- mization with an unknown set of linear constraints. The goal of the network is to ensure that the action sequence selected by each agent, which only has partial information about the global function, is competitive to the centralized minimizers in hindsight without violating the safety constraints. To ad- dress this problem, we proposed D-Safe-OGD, where starting from a safe region, it allows all agents to perform exploration to estimate the unknown constraints in a distributed fashion. Then, distributed OGD is applied over the feasible sets formed by agents estimates. For convex functions, we proved a dynamic regret bound of O(T 2/3√ T ), which recovers the static regret bound of [15] for the centralized log T +T 1/3C ∗ log T + T 2/3C ∗ the dynamic regret case (single agent). Then, we showed that for the non- is upper bounded by convex setting, O(T 2/3√ T ), which recovers the static regret bound of [5] for the centralized case (single agent) up to log factor. Possible future directions include improving the regret using adaptive techniques and/or deriving comprehensive regret bounds in terms of other variation measures, such as VT . REFERENCES [1] E. Hazan, "Introduction to online convex optimization," Foundations and Trends in Optimization, vol. 2, no. 3-4, pp. 157–325, 2016. [2] M. Zinkevich, "Online convex programming and generalized in- finitesimal gradient ascent," in Proceedings of the 20th International Conference on Machine Learning, 2003, pp. 928–936. [3] E. Hazan, A. Agarwal, and S. Kale, "Logarithmic regret algorithms for online convex optimization," Machine Learning, vol. 69, no. 2-3, pp. 169–192, 2007. [4] E. Hazan, K. Singh, and C. Zhang, "Efficient regret minimization in non-convex games," in International Conference on Machine Learning (ICML). PMLR, 2017, pp. 1433–1441. [5] U. Ghai, Z. Lu, and E. Hazan, "Non-convex online learning via algorithmic equivalence," arXiv preprint arXiv:2205.15235, 2022. [6] O. Besbes, Y. Gur, and A. Zeevi, "Non-stationary stochastic optimiza- tion," Operations research, vol. 63, no. 5, pp. 1227–1244, 2015. [7] A. Jadbabaie, A. Rakhlin, S. Shahrampour, and K. Sridharan, "Online optimization: Competing with dynamic comparators," in Artificial Intelligence and Statistics, 2015, pp. 398–406. [8] R. Dixit, A. S. Bedi, R. Tripathi, and K. Rajawat, "Online learning with inexact proximal online gradient descent algorithms," IEEE Transactions on Signal Processing, vol. 67, no. 5, pp. 1338–1352, 2019. [9] S. Shahrampour and A. Jadbabaie, "Distributed online optimization in dynamic environments using mirror descent," IEEE Transactions on Automatic Control, vol. 63, no. 3, pp. 714–725, 2018. [10] M. Akbari, B. Gharesifard, and T. Linder, "Distributed online convex optimization on time-varying directed graphs," IEEE Transactions on Control of Network Systems, vol. 4, no. 3, pp. 417–428, 2015. [11] R. Dobbe, P. Hidalgo-Gonzalez, S. Karagiannopoulos, R. Henriquez- Auba, G. Hug, D. S. Callaway, and C. J. Tomlin, "Learning to control in power systems: Design and analysis guidelines for concrete safety problems," Electric Power Systems Research, vol. 189, p. 106615, 2020. [12] N. C. Luong, D. T. Hoang, S. Gong, D. Niyato, P. Wang, Y.-C. Liang, and D. I. Kim, "Applications of deep reinforcement learning in communications and networking: A survey," IEEE Communications Surveys & Tutorials, vol. 21, no. 4, pp. 3133–3174, 2019. [13] K. J. ̊Astr ̈om and R. M. Murray, Feedback systems. Princeton university press, 2010. [14] A. Mokhtari, S. Shahrampour, A. Jadbabaie, and A. Ribeiro, "Online optimization in dynamic environments: Improved regret rates for strongly convex problems," in IEEE 55th Conference on Decision and Control (CDC), 2016, pp. 7195–7201. [15] S. Chaudhary and D. Kalathil, "Safe online convex optimization with unknown linear safety constraints," Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), vol. 36, no. 6, pp. 6175– 6182, 2022. [16] L. Zhang, S. Lu, and Z.-H. Zhou, "Adaptive online learning in dynamic environments," in Advances in neural information processing systems, 2018, pp. 1323–1333. [17] L. Zhang, T. Yang, J. Yi, R. Jin, and Z.-H. Zhou, "Improved dynamic regret for non-degenerate functions," in Advances in Neural Informa- tion Processing Systems, 2017, pp. 732–741. [18] E. Hall and R. Willett, "Dynamical models and tracking regret in online convex programming," in International Conference on Machine Learning. PMLR, 2013, pp. 579–587. [19] A. Rakhlin and K. Sridharan, "Online learning with predictable PMLR, 2013, pp. sequences," in Conference on Learning Theory. 993–1019. [20] T.-J. Chang and S. Shahrampour, "On online optimization: Dynamic regret analysis of strongly convex and smooth problems," Proceedings of the AAAI Conference on Artificial Intelligence, vol. 35, no. 8, pp. 6966–6973, 2021. approach to proactive network resource allocation," IEEE Transactions on Signal Processing, vol. 65, no. 24, pp. 6350–6364, 2017. [44] M. J. Neely and H. Yu, "Online convex optimization with time-varying constraints," arXiv preprint arXiv:1702.04783, 2017. [45] H. Yu, M. Neely, and X. Wei, "Online convex optimization with stochastic constraints," Advances in Neural Information Processing Systems, vol. 30, 2017. [46] X. Cao and K. R. Liu, "Online convex optimization with time-varying constraints and bandit feedback," IEEE Transactions on automatic control, vol. 64, no. 7, pp. 2665–2680, 2018. [47] Q. Liu, W. Wu, L. Huang, and Z. Fang, "Simultaneously achieving sublinear regret and constraint violations for online convex optimiza- tion with time-varying constraints," ACM SIGMETRICS Performance Evaluation Review, vol. 49, no. 3, pp. 4–5, 2022. [48] X. Yi, X. Li, L. Xie, and K. H. Johansson, "Distributed online convex optimization with time-varying coupled inequality constraints," IEEE Transactions on Signal Processing, vol. 68, pp. 731–746, 2020. [49] X. Yi, X. Li, T. Yang, L. Xie, T. Chai, and K. H. Johansson, "Distributed bandit online convex optimization with time-varying cou- pled inequality constraints," IEEE Transactions on Automatic Control, vol. 66, no. 10, pp. 4620–4635, 2020. [50] J. Li, C. Gu, Z. Wu, and T. Huang, "Online learning algorithm for distributed convex optimization with time-varying coupled constraints and bandit feedback," IEEE transactions on cybernetics, 2020. [51] P. Sharma, P. Khanduri, L. Shen, D. J. Bucci, and P. K. Varshney, "On distributed online convex optimization with sublinear dynamic regret and fit," in 2021 55th Asilomar Conference on Signals, Systems, and Computers. IEEE, 2021, pp. 1013–1017. [52] X. Li, L. Xie, and N. Li, "A survey of decentralized online learning," arXiv preprint arXiv:2205.00473, 2022. [53] S. Amani, M. Alizadeh, and C. Thrampoulidis, "Linear stochastic bandits under safety constraints," Advances in Neural Information Processing Systems, vol. 32, 2019. [54] K. Khezeli and E. Bitar, "Safe linear stochastic bandits," Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, no. 06, pp. 10 202–10 209, 2020. [55] I. Usmanova, A. Krause, and M. Kamgarpour, "Safe convex learning under uncertain constraints," in The 22nd International Conference on Artificial Intelligence and Statistics. PMLR, 2019, pp. 2106–2114. [56] M. Fereydounian, Z. Shen, A. Mokhtari, A. Karbasi, and H. Hassani, "Safe learning under uncertain objectives and constraints," arXiv preprint arXiv:2006.13326, 2020. [57] J. S. Liu, Monte Carlo strategies in scientific computing. Springer Science & Business Media, 2008. [58] W. Shi, Q. Ling, G. Wu, and W. Yin, "Extra: An exact first-order algorithm for decentralized consensus optimization," SIAM Journal on Optimization, vol. 25, no. 2, pp. 944–966, 2015. [59] B. M. Nejad, S. A. Attia, and J. Raisch, "Max-consensus in a max- plus algebraic setting: The case of fixed communication topologies," in 2009 XXII international symposium on information, communication and automation technologies. IEEE, 2009, pp. 1–7. [60] E. Amid and M. K. Warmuth, "Reparameterizing mirror descent as gradient descent," Advances in Neural Information Processing Systems, vol. 33, pp. 8430–8439, 2020. [61] H. H. Bauschke and J. M. Borwein, "Joint and separate convexity of the bregman distance," in Studies in Computational Mathematics. Elsevier, 2001, vol. 8, pp. 23–36. [62] Y. Abbasi-Yadkori, D. P ́al, and C. Szepesv ́ari, "Improved algorithms for linear stochastic bandits," Advances in neural information process- ing systems, vol. 24, 2011. [63] J. A. Tropp et al., "An introduction to matrix concentration inequali- ties," Foundations and Trends® in Machine Learning, vol. 8, no. 1-2, pp. 1–230, 2015. √ [21] R. J. Ravier, A. R. Calderbank, and V. Tarokh, "Prediction in online convex optimization for parametrizable objective functions," in IEEE 58th Conference on Decision and Control (CDC), 2019, pp. 2455– 2460. [22] A. Ajalloeian, A. Simonetto, and E. Dall'Anese, "Inexact online proximal-gradient method for time-varying convex optimization," in American Control Conference (ACC), 2020, pp. 2850–2857. [23] F. Yan, S. Sundaram, S. Vishwanathan, and Y. Qi, "Distributed autonomous online learning: Regrets and intrinsic privacy-preserving properties," IEEE Transactions on Knowledge and Data Engineering, vol. 25, no. 11, pp. 2483–2493, 2012. [24] D. Mateos-N ́unez and J. Cort ́es, "Distributed online convex optimiza- tion over jointly connected digraphs," IEEE Transactions on Network Science and Engineering, vol. 1, no. 1, pp. 23–37, 2014. [25] S. Hosseini, A. Chapman, and M. Mesbahi, "Online distributed convex optimization on dynamic networks," IEEE Transactions on Automatic Control, vol. 61, no. 11, pp. 3545–3550, 2016. [26] R. Dixit, A. S. Bedi, K. Rajawat, and A. Koppel, "Distributed online learning over time-varying graphs via proximal gradient descent," in 2019 IEEE 58th Conference on Decision and Control (CDC). IEEE, 2019, pp. 2745–2751. [27] Y. Zhang, R. J. Ravier, M. M. Zavlanos, and V. Tarokh, "A distributed online convex optimization algorithm with improved dynamic regret," in 2019 IEEE 58th Conference on Decision and Control (CDC). IEEE, 2019, pp. 2449–2454. [28] N. Eshraghi and B. Liang, "Improving dynamic regret in distributed online mirror descent using primal and dual information," in Learning for Dynamics and Control Conference. PMLR, 2022, pp. 637–649. [29] K. Lu and L. Wang, "Online distributed optimization with nonconvex objective functions: Sublinearity of first-order optimality condition- based regret," IEEE Transactions on Automatic Control, vol. 67, no. 6, pp. 3029–3035, 2021. [30] H. Yu and M. J. Neely, "A Low Complexity Algorithm with O( T ) Regret and O(1) Constraint Violations for Online Convex Optimiza- tion with Long Term Constraints," Journal of Machine Learning Research, vol. 21, no. 1, pp. 1–24, 2020. [31] M. Mahdavi, R. Jin, and T. Yang, "Trading regret for efficiency: online convex optimization with long term constraints," The Journal of Machine Learning Research, vol. 13, no. 1, pp. 2503–2528, 2012. [32] R. Jenatton, J. Huang, and C. Archambeau, "Adaptive algorithms for online convex optimization with long-term constraints," in Interna- tional Conference on Machine Learning. PMLR, 2016, pp. 402–411. [33] J. Yuan and A. Lamperski, "Online convex optimization for cumulative constraints," Advances in Neural Information Processing Systems, vol. 31, 2018. [34] X. Yi, X. Li, T. Yang, L. Xie, T. Chai, and K. Johansson, "Regret and cumulative constraint violation analysis for online convex optimization with long term constraints," in International Conference on Machine Learning. PMLR, 2021, pp. 11 998–12 008. [35] D. Yuan, D. W. Ho, and G.-P. Jiang, "An adaptive primal-dual subgradient algorithm for online distributed constrained optimization," IEEE transactions on cybernetics, vol. 48, no. 11, pp. 3045–3055, 2017. [36] D. Yuan, A. Proutiere, and G. Shi, "Distributed online linear regres- sions," IEEE Transactions on Information Theory, vol. 67, no. 1, pp. 616–639, 2020. [37] --, "Distributed online optimization with long-term constraints," IEEE Transactions on Automatic Control, vol. 67, no. 3, pp. 1089– 1104, 2021. [38] X. Yi, X. Li, T. Yang, L. Xie, T. Chai, and H. Karl, "Regret and cumulative constraint violation analysis for distributed online constrained convex optimization," IEEE Transactions on Automatic Control, 2022. [39] Q. Lin, H. Yi, J. Pang, M. Chen, A. Wierman, M. Honig, and Y. Xiao, "Competitive online optimization under inventory constraints," Pro- ceedings of the ACM on Measurement and Analysis of Computing Systems, vol. 3, no. 1, pp. 1–28, 2019. [40] S. Fan, G. He, X. Zhou, and M. Cui, "Online optimization for net- worked distributed energy resources with time-coupling constraints," IEEE Transactions on Smart Grid, vol. 12, no. 1, pp. 251–267, 2020. [41] E. Hazan and S. Kale, "Projection-free online learning," in Interna- tional Coference on International Conference on Machine Learning (ICML), 2012, pp. 1843–1850. [42] W. Sun, D. Dey, and A. Kapoor, "Safety-aware algorithms for ad- versarial contextual bandit," in International Conference on Machine Learning. PMLR, 2017, pp. 3280–3288. [43] T. Chen, Q. Ling, and G. B. Giannakis, "An online convex optimization In this section, we provide the proofs of our theoretical results. In Section A, we state the results we use in our analysis. Section B includes the proof of estimation error bound in Theorem 2. In Sections C and D, we provide the proofs for Theorem 3 (convex case) and Theorem 5 (non-convex case), respectively. APPENDIX A. Preliminaries: Theorem 7: (Theorem 2 in [62]). Let {Ft}∞ t=1 be a real-valued stochastic process. Here wt is t=1 be an Rd-valued stochastic process such Ft-measurable and wt is conditionally R-sub Gaussian for some R ≥ 0. Let {xt}∞ that xt is Ft−1-measurable. Let VT (cid:44) (cid:80)T t=1 ytxt is the l2-regularized least squares estimate of a. Assume (cid:107)a(cid:107) ≤ LA and (cid:107)xt(cid:107) ≤ L, ∀t. Then for any δ > 0, with probability (1 − δ), the true parameter a lies in the following set: t + λI where λ > 0. Define yt as a(cid:62)xt + wt, then ˆaT = V−1 T t=0 be a filtration. Let {wt}∞ t=1 xtx(cid:62) (cid:80)T (cid:40) a ∈ Rd : (cid:107)a − ˆaT (cid:107)VT ≤ R (cid:114) d log (cid:0) 1 + T L2/λ δ √ (cid:1) + (cid:41) λLA , for all T ≥ 1. Theorem 8: (Theorem 5.1.1 in [63]). Consider a finite sequence {Xt} of independent, random and positive semi-definite matrices ∈ Rd×d. Assume that λmax(Xt) ≤ L, ∀t. Define Y (cid:44) (cid:80) t Xt and denote λmin(E[Y]) as μ. Then we have Definition of a shrunk polytope: P(λmin(Y) ≤ (cid:15)μ) ≤ d exp (cid:0) − (1 − (cid:15))2 μ 2L (cid:1), for any (cid:15) ∈ (0, 1). in = {x ∈ Rd : a(cid:62) Lemma 9 (Lemma 1 in [56]): Consider a positive constant τin such that X s k x + τin ≤ bk, ∀k ∈ [n]}, for some τin > 0. X s in is non-empty. Then, for any x ∈ X s, (cid:107)ΠX s in (x) − x(cid:107) ≤ √ dτin C(A, b) , (11) (12) where C(A, b) is a positive constant that depends only on the matrix A and the vector b. B. Safe Distributed Set Estimation Proof: [Proof of Lemma 2] Let VT0 i,t and V = VT0 + λI. Let (cid:98)A be the solution of i=1 li(A). Let ˆak and ak be the k-th rows of (cid:98)A and A, respectively. Based on Theorem 7, we have with (cid:80)m i=1 t=1 xi,tx(cid:62) (cid:44) (cid:80)m (cid:80)T0 argminA probability at least (1 − δ), (cid:115) (cid:107)ˆak − ak(cid:107)V ≤ R d log (cid:0) 1 + mT0L2/λ √ (cid:1) + λLA, ∀k ∈ [n]. (13) δ/n Knowing that ∀i ∈ [m], ∀t ∈ [T0], xi,t = (1−γ)xs +γζi,t, we have λmax(xi,tx(cid:62) γ2σ2 ζ I. Therefore, we have ζ I (cid:23) γ2σ2 i,t) ≤ L2 and E[xi,tx(cid:62) i,t] = (1−γ)2xsxs(cid:62) + λmin(E[VT0]) = λmin( m (cid:88) T0(cid:88) E[xi,tx(cid:62) i,t]) ≥ mT0γ2σ2 ζ . i=1 t=1 Based on Equation (14) and Theorem 8, we have P(λmin(VT0) ≤ (cid:15)mT0γ2σ2 ζ ) ≤ d exp (cid:0) − (1 − (cid:15))2 mT0γ2σ2 ζ (cid:1). 2L2 By setting (cid:15) = 1 2 and T0 ≥ 8L2 mγ2σ2 ζ log( d δ ), from Equation (15), we have P(cid:0)λmin(V) ≥ 1 2 mT0γ2σ2 ζ (cid:1) ≥ P(cid:0)λmin(VT0) ≥ mT0γ2σ2 ζ (cid:1) ≥ (1 − δ). 1 2 Combining Equations (13) and (16), we have with probability at least (1 − 2δ), (cid:113) R (cid:107)ˆak − ak(cid:107) ≤ d log (cid:0) 1+mT0L2/λ (cid:113) 1 δ/n 2 mγ2σ2 ζ T0 √ (cid:1) + λLA , ∀k ∈ [n]. (14) (15) (16) (17) Let agent i's local estimate of A at time t ∈ [T0 + 1, T0 + T1] returned by the EXTRA algorithm [58] be denoted by (cid:98)Ai,t. i=1 li(A) and (cid:98)Ai,t based on Theorem 3.7 in [58] as follows. Next we upper bound the distance between (cid:98)A = argminA There exists 0 < τ < 1 such that (cid:80)m (cid:13) (cid:13)ˆai k,t − ˆak (cid:13) (cid:13) ≤ ντ (t−T0), ∀i ∈ [m], k ∈ [n], t ∈ [T0 + 1, . . . , T0 + T1] (18) where ν is a constant. Based on (17), (18) and our choice of T1 (T1 = (− log τ )−1 log(νT ρ)), for k ∈ [n], t ∈ [T0 + 1, . . . , T0 + T1] and i, j ∈ [m], we have (cid:13) (cid:13)ˆai k,t − ak and Lemma 10: Define (cid:13) ≤ (cid:13) (cid:13) (cid:13)ˆai k,t − ˆak (cid:13) (cid:13) + (cid:107)ˆak − ak(cid:107) ≤ 1 T ρ + (cid:113) R d log (cid:0) 1+mT0L2/λ (cid:113) 1 δ/n 2 mγ2σ2 ζ T0 √ (cid:1) + λLA , (cid:13) (cid:13)ˆai (cid:13) k,t − ˆaj k,t (cid:13) (cid:13) ≤ (cid:13) (cid:13)ˆai (cid:13) k,t − ˆak (cid:13) (cid:13) + (cid:13) (cid:13)ˆak − ˆaj (cid:13) k,t (cid:13) (cid:13) (cid:13) ≤ 2 T ρ . (cid:113) R Br (cid:44) 1 T ρ + d log (cid:0) 1+mT0L2/λ (cid:113) 1 δ/n 2 mγ2σ2 ζ T0 √ (cid:1) + λLA . (19) (20) For each agent i, construct (cid:98)X s 1 with user-specified T0 and T1 = O(log T ρ), we have, with probability at least (1 − 2δ), i based on Equation (8) with Ci,k which follows Equation (7) with Br. By running Algorithm (cid:13) (cid:13) (cid:13)Π (cid:98)X s j (xi) − xi (cid:13) (cid:13) (cid:13) ≤ √ dLBr 2 C(A, b) , ∀i, j ∈ [m], (21) where xi ∈ (cid:98)X s i . Proof: [Proof of Lemma 10] First we show that there exists a mutual shrunk polytope (see Definition 11) subset X s in i , ∀i ∈ [m]. Based on Lemma 2, with probability at least 1 − 2δ, we have for any x ∈ X s in, (τin = 2BrL) for (cid:98)X s k x + Br (cid:107)x(cid:107) = a(cid:62) ˆai(cid:62) ≤ a(cid:62) ≤ a(cid:62) k − ak)(cid:62)x + Br (cid:107)x(cid:107) k − ak k x + (ˆai k x + (cid:13) (cid:13)ˆai k x + 2Br (cid:107)x(cid:107) ≤ a(cid:62) (cid:13) (cid:13) (cid:107)x(cid:107) + Br (cid:107)x(cid:107) k x + 2BrL ≤ bk, ∀k ∈ [n] and ∀i ∈ [m], (22) which implies that X s and any xi ∈ (cid:98)X s i in ⊂ (cid:98)X s i , ∀i. Based on Lemma 9 and the fact that X s in ⊂ (cid:98)X s i and (cid:98)X s i ⊂ X s, ∀i, we have that ∀i, j ∈ [m] (cid:13) (cid:13) (cid:13)Π (cid:98)X s j (xi) − xi (cid:13)ΠX s (cid:13) (cid:13) ≤ (cid:13) (cid:13) ≤ max xi∈ (cid:98)X s i in (cid:13) (cid:13) (xi) − xi (cid:13) (cid:13)ΠX s in (xi) − xi (cid:13) (cid:13) ≤ max x∈X s (cid:13) (cid:13)ΠX s in (x) − x(cid:13) (cid:13) ≤ √ dBrL 2 C(A, b) , where the first and third inequalities are due to the facts that X s in ⊂ (cid:98)X s i and (cid:98)X s i ⊂ X s, respectively. C. Convex Part Lemma 11: Let Algorithm 2 run with step size η > 0 and define xt (cid:44) 1 m Assumptions 1 to 4, we have that ∀i ∈ [m] (cid:80)m i=1 xi,t and yt (cid:44) 1 m (23) (cid:80)m i=1 yi,t. Under (cid:107)xt − xi,t(cid:107) ≤ ( √ 2 dLBr C(A, b) + 2ηG) √ mβ 1 − β = O(cid:0)η + Br (cid:1) and (cid:107)yt − yi,t(cid:107) ( √ 2 dLBr C(A, b) + 2ηG) √ m 1 − β , where Br follows the definition in Lemma 10. Proof: For the sake of simplicity, we define the following matrices Xt (cid:44) [x1,t, . . . , xm,t], Yt (cid:44) [y1,t, . . . , ym,t], Gt (cid:44) [∇f1,t(x1,t), . . . , ∇fm,t(xm,t)], and Rt (cid:44) [r1,t, . . . , rm,t], where ri,t−1 = yi,t−1 − (cid:0)xi,t−1 − η∇fi,t−1(xi,t−1)(cid:1). Then the update can be expressed as Xt = Yt−1P = (cid:0)Xt−1 − ηGt−1 − Rt−1 (cid:1)P. Expanding the update recursively, we have Xt = XTsP(t−Ts) − η t−Ts(cid:88) l=1 Gt−lPl − t−Ts(cid:88) l=1 Rt−lPl. (24) Since P is doubly stochastic, we have Pk1 = 1 for all k ≥ 1. Based on the geometric mixing bound of P and Equations (24), we get (cid:107)xt − xi,t(cid:107) = (cid:13) (cid:13) (cid:13) (cid:13) Xt( 1 m 1 − ei) ≤ (cid:13) (cid:13)xTs − XTs [P(t−Ts)]:,i (cid:13) t−Ts(cid:88) ≤ √ (ηG) mβl + t−Ts(cid:88) l=1 √ 2 dLBr C(A, b) ≤( + 2ηG) l=1 √ mβ 1 − β , (cid:13) (cid:13) (cid:13) (cid:13) t−Ts(cid:88) (cid:13) (cid:13) (cid:13) + η √ dLBr 2 C(A, b) l=1 ( (cid:13) (cid:13) (cid:13) (cid:13) Gt−l( 1 m (cid:13) (cid:13) 1 − [Pl]:,i) (cid:13) (cid:13) + t−Ts(cid:88) l=1 (cid:13) (cid:13) (cid:13) (cid:13) Rt−l( 1 m 1 − [Pl]:,i) (cid:13) (cid:13) (cid:13) (cid:13) √ + ηG) mβl where (cid:13) Lemma 10, (cid:13)xTs − XTs[Pt−Ts]:,i (cid:13) (cid:13) = 0 by the identical initialization (of all agents with the same action at Ts) and based on ≤ (cid:88) (cid:13)yi,t − (cid:0)xi,t − η∇fi,t(xi,t)(cid:1)(cid:13) (cid:107)ri,t(cid:107) = (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) j √ dLBr 2 C(A, b) [yj,t−1] − (cid:0) (cid:88) [P]jiΠ + ηG. (cid:98)X s i ≤ j [P]jiyj,t−1 − η∇fi,t(xi,t)(cid:1) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) Following the same manner, it can be shown that (cid:107)yt − yi,t(cid:107) ≤ ( √ 2 dLBr C(A, b) + 2ηG) √ m 1 − β . Proof: [Proof of Theorem 3] First, we decompose the individual regret of agent j into three terms: (cid:88) (cid:88) t i fi,t(xj,t)− (cid:88) t ft(x∗ t ) = Ts−1 (cid:88) (cid:88) i t=1 (cid:124) fi,t(xj,t) − fi,t(x∗ t ) + T (cid:88) (cid:88) fi,t(xj,t) − fi,t( ̃x∗ t ) + (cid:123)(cid:122) Term I i t=Ts (cid:124) (cid:125) (cid:123)(cid:122) Term II (cid:125) T (cid:88) t=Ts (cid:124) ft( ̃x∗ t ) − ft(x∗ t ) , (25) (cid:123)(cid:122) Term III (cid:125) where ̃x∗ in Lemma 10. t is the projection of x∗ t on X s in, which is a mutual subset of { (cid:98)X s i }i∈[m] with τin = 2BrL based on Equation (22) The upper bound of Term I: Here we note that by choosing γ ≤ ∆s LLA , we have ∀i ∈ [m] and t ∈ [1, . . . , T0 + T1] k xi,t = a(cid:62) a(cid:62) k ((1 − γ)xs + γζi,t) ≤ (1 − γ)bs k + ∆s ≤ (1 − γ)bs k + (bk − bs k) < bk, which implies the safeness of the action. Based on the Lipschitz property of the function sequence, we have Ts−1 (cid:88) (cid:88) t=1 i fi,t(xj,t) − fi,t(x∗ t ) ≤ Ts−1 (cid:88) (cid:88) t=1 i G (cid:107)xj,t − x∗ t (cid:107) ≤ 2GLm(T0 + T1). The upper bound of Term II: (26) (27) Based on the update rule, ∀i ∈ [m] and t ∈ [Ts, . . . , T ] we have fi,t(xi,t) − fi,t( ̃x∗ t ) ≤∇fi,t(xi,t)(cid:62)(xi,t − ̃x∗ t ) η2 (cid:107)∇fi,t(xi,t)(cid:107)2 + = η2 (cid:107)∇fi,t(xi,t)(cid:107)2 + 1 η 1 η     1 2 1 2 η2 (cid:107)∇fi,t(xi,t)(cid:107)2 + η2 (cid:107)∇fi,t(xi,t)(cid:107)2 + 1 η 1 η (cid:20) 1 2 (cid:20) 1 2  ≤ = ≤ 1 2 1 2 1 2 1 2 (cid:107)xi,t − ̃x∗ t (cid:107)2 − (cid:107)xi,t − ̃x∗ t (cid:107)2 − 1 2 1 2 (cid:107)xi,t − ̃x∗ t − η∇fi,t(xi,t)(cid:107)2 (cid:21) (cid:21) (cid:107)yi,t − ̃x∗ t (cid:107)2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) j [P]jiyj,t−1 − ̃x∗ t (cid:13) 2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) − [P]ji (cid:107)yj,t−1 − ̃x∗ t (cid:107)2 − (cid:88) j (cid:107)yi,t − ̃x∗ t (cid:107)2     (cid:107)yi,t − ̃x∗ t (cid:107)2  , 1 2 1 2 (28) where the second inequality is due to the projection such that (cid:107)yi,t − ̃x∗ inequality is due to the convexity of the square function. t (cid:107) ≤ (cid:107)xi,t − η∇fi,t(xi,t) − ̃x∗ t (cid:107) and the third Based on Equation (28) and Lemma 11, we have fi,t(xj,t) − fi,t( ̃x∗ t ) =fi,t(xj,t) − fi,t(xi,t) + fi,t(xi,t) − fi,t( ̃x∗ t ) ≤G (cid:107)xj,t − xi,t(cid:107) + fi,t(xi,t) − fi,t( ̃x∗ t ) ≤2G(cid:0)( √ 2 dLBr C(A, b) √ + 2ηG) mβ 1 − β (cid:1) + 1 2 η (cid:107)∇fi,t(xi,t)(cid:107)2 + 1 2η (cid:88) [P]ji (cid:107)yj,t−1 − ̃x∗ t (cid:107)2 − j (29) 1 2η (cid:107)yi,t − ̃x∗ t (cid:107)2 . Summing Equation (29) over i, we get (fi,t(xj,t) − fi,t( ̃x∗ t )) (cid:88) i ≤2mG(cid:0)( =2mG(cid:0)( √ 2 dLBr C(A, b) √ dLBr 2 C(A, b) + 2ηG) + 2ηG) √ mβ 1 − β √ mβ 1 − β (cid:1) + (cid:1) + η 2 η 2 (cid:88) i (cid:88) i (cid:107)∇fi,t(xi,t)(cid:107)2 + (cid:107)∇fi,t(xi,t)(cid:107)2 + 1 2η 1 2η (cid:107)yj,t−1 − ̃x∗ t (cid:107)2 − (cid:88) j 1 2η (cid:88) i (cid:107)yi,t − ̃x∗ t (cid:107)2 (30) (cid:107)yi,t−1(cid:107)2 − (cid:107)yi,t(cid:107)2 + 2(yi,t − yi,t−1)(cid:62) ̃x∗ t (cid:17) . (cid:88) (cid:16) i Summing Equation (30) over t ∈ [Ts, . . . , T ], we have T (cid:88) (cid:88) (fi,t(xj,t) − fi,t( ̃x∗ t )) t=Ts T (cid:88) i (cid:88) ≤ η 2 i t=Ts +2T mG(cid:0)( (cid:107)∇fi,t(xi,t)(cid:107)2 + 1 2η √ dLBr 2 C(A, b) + 2ηG) √ mβ 1 − β i (cid:1). (cid:88) (cid:107)yi,Ts−1(cid:107)2 + 1 η (cid:0) (cid:88) i i,T ̃x∗ y(cid:62) T − i,Ts−1 ̃x∗ y(cid:62) Ts (cid:1) + 1 η (cid:88) i T −1 (cid:88) (cid:88) ( ̃x∗ t − ̃x∗ t+1)(cid:62)yi,t t=Ts i The upper bound of Term III: Based on Lemma 9, we have for any x∗ t ∈ X s and its projection to X s in: ̃x∗ t T (cid:88) (cid:88) t=Ts i (fi,t( ̃x∗ t ) − fi,t(x∗ t )) ≤ T (cid:88) (cid:88) t=Ts i G (cid:107) ̃x∗ t − x∗ t (cid:107) ≤ mT G √ 2 dLBr C(A, b) . (31) (32) Substituting Equations (27), (31) and (32) into Equation (25), we get (cid:88) (cid:88) t i (fi,t(xj,t) − fi,t(x∗ t )) ≤O(T0 + T1) + ηmT G2 2 + +2T mG(cid:0)( √ 2 dLBr C(A, b) + 2ηG) (cid:88) i 1 2η √ mβ 1 − β (cid:0) (cid:88) 1 η (cid:107)yi,Ts−1(cid:107)2 + √ 2 dLBr C(A, b) (cid:1) + mT G i , i,T ̃x∗ y(cid:62) T − i,Ts−1 ̃x∗ y(cid:62) Ts (cid:1) + 1 η (cid:88) i T −1 (cid:88) (cid:88) ( ̃x∗ t − ̃x∗ t+1)(cid:62)yi,t (33) t=Ts i which is O(T0 + T1 + 1 η and T0. η + 1 η C ∗ T + βT (1−β) log T0 √ T0 √ + βηT (1−β) ) and the final regret bound is derived by substituting the choices of D. Non-convex Part Lemma 12: Let Algorithm 2 run with step size η > 0 and the max-consensus step after the exploration phase. Under Assumptions 1 to 4, we have that ∀i ∈ [m] (cid:107)xt − xi,t(cid:107) ≤ 2ηG √ mβ 1 − β , where xt (cid:44) 1 m (cid:80)m i=1 xi,t. Proof: Similar proof as Lemma 11. The only difference is that since the estimated feasible set is common over agents based on the max-consensus step, (cid:107)ri,t(cid:107) is upper-bounded as follows: (cid:13)yi,t − (cid:0)xi,t − η∇fi,t(xi,t)(cid:1)(cid:13) (cid:107)ri,t(cid:107) = (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) ≤ ηG. [P]jiyj,t−1 − (cid:0) (cid:88) (cid:88) ≤ j j [P]jiyj,t−1 − η∇fi,t(xi,t)(cid:1) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) By following the similar proof in Lemma 11 based on the expression above, the result is approved. Lemma 13 (Lemma 4 in [5]): Suppose Assumptions 5 to 8 hold and ut = q(xt), then (cid:107)q(xt+1) − ut+1(cid:107) = O(W 4G3/2 F η3/2) based on the following update rule: ut+1 = argminu∈X s(cid:48) (cid:26) ∇ ̃ft(ut)(cid:62)u + Dφ(u, ut) (cid:26) (cid:27) , (cid:27) 1 η 1 2η ∇ft(xt)(cid:62)x + Theorem 14 (Theorem 7 in [5]): Given a convex and compact domain X ⊂ X s, and not necessarily convex loss ft(*) satisfying Assumption 8. When Assumption 6 is met, there exists an OMD object with convex loss ̃ft(*), a convex domain and a strongly convex regularization φ satisfying Assumption 5. xt+1 = argminx∈X s (cid:107)x − xt(cid:107)2 . Lemma 15: Suppose Assumptions 5 to 8 hold and ui,t = q(xi,t), ∀i ∈ [m], then (cid:107)q(xi,t+1) − ui,t+1(cid:107) = O(η3/2) based on the following update rule: (cid:26) ∇ ̃fi,t(ui,t)(cid:62)u + (cid:27) Dφ(u, ui,t) , 1 η zi,t = argminu∈ (cid:98)X s(cid:48) (cid:88) [P]jizj,t, ui,t+1 = j yi,t = argminx∈ (cid:98)X s (cid:88) xi,t+1 = [P]jiyj,t. (cid:26) ∇fi,t(xi,t)(cid:62)x + (cid:107)x − xi,t(cid:107)2 (cid:27) , 1 2η j Proof: We first upper bound (cid:107)q(xi,t+1) − ui,t+1(cid:107) as follows (cid:107)q(xi,t+1) − ui,t+1(cid:107) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) [P]jizj,t − (cid:88) (cid:88) j j ≤ [P]jiq(yj,t) + [P]jiq(yj,t) − q( [P]jiyj,t) (cid:88) . (34) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) j j (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) To bound (cid:13) of {yi,t}i: (cid:80) j[P]jiq(yj,t) − q((cid:80) (cid:13) (cid:13) (cid:13), we consider the Taylor expansion of q(y) w.r.t. a point ˆy in the convex hull j[P]jiyj,t) [P]ji (cid:18) q(ˆy) + Jq(ˆy)(yj,t − ˆy) + O(cid:0)(yj,t − ˆy)2(cid:1) (cid:19) − (cid:18) q(ˆy) + Jq(ˆy)( (cid:88) [P]jiyj,t − ˆy) + O(cid:0)( (cid:88) [P]jiyj,t − ˆy)2(cid:1) j j (cid:19) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (35) [P]jiq(yj,t) − q( [P]jiyj,t) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:88) j j (cid:88) (cid:88) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)D2 (cid:13) (cid:88) j j ≤ ≤ ≤2 {yi,t}i (cid:13) (cid:13) (cid:13) , [P]jiO(cid:0)(yj,t − ˆy)2 (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) + (cid:13) (cid:13) (cid:13) O(cid:0)( (cid:13) (cid:13) (cid:13) (cid:88) j [P]jiyj,t − ˆy)2(cid:1) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) where D{yi,t} denotes the diameter of the convex hull of {yi,t} and is upper bounded as follows D{yi,t}i = max (i,j) = max (i,j) ≤ max (i,j) √ 4 (cid:107)yi,t − yj,t(cid:107) (cid:0)xi,t − η∇fi,t(xi,t)(cid:1) − Π (cid:13) (cid:13)Π (cid:98)X s (cid:0)xi,t − η∇fi,t(xi,t)(cid:1) − (cid:0)xj,t − η∇fj,t(xj,t)(cid:1)(cid:13) (cid:13) (cid:13) (cid:13) (cid:98)X s (cid:0)xj,t − η∇fj,t(xj,t)(cid:1)(cid:13) (cid:13) ≤ mβG 1 − β η + 2Gη = O(η), where the last inequality is based on Lemma 12 and the Lipschitz continuity of the function sequence. Substituting Equations (35), (36) into Equation (34) and based on Lemma 13, we have (cid:107)q(xi,t+1) − ui,t+1(cid:107) ≤ [P]jizj,t − (cid:88) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) j ≤O(W 4G3/2 (cid:88) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) F η3/2) + O(η2) = O(η3/2), [P]jiq(yj,t) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) + j (cid:88) [P]jiq(yj,t) − q( (cid:88) [P]jiyj,t) j j (36) (37) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) when η is small enough. Algorithm 3 Distributed online mirror descent 1: Distributed online mirror descent: 2: Let Ts (cid:44) (T0 + T1 + DG + 1). 3: for t = Ts, . . . , T do 4: 5: for i = 1, 2, . . . , m do zi,t = argmaxz∈ (cid:98)X s(cid:48)∇ ̃fi,t(ui,t)(cid:62)(z − ui,t) + Dφ(z, ui,t), (cid:16) ̃fi,t(u) = ̃fi,t (cid:17) (cid:0)q(x)(cid:1), ui,t = q(xi,t). 1 η 6: 7: end for For all i ∈ [m], 8: end for u(cid:48) i,t+1 = m (cid:88) [P]jizj,t. j=1 Proof: [Proof of Theorem 5] As the proof of Theorem 3, we decompose the individual regret into three terms: (cid:88) (cid:88) t i fi,t(xj,t)− (cid:88) t ft(x∗ t ) = Ts−1 (cid:88) (cid:88) i t=1 (cid:124) fi,t(xj,t) − fi,t(x∗ t ) + T (cid:88) (cid:88) fi,t(xj,t) − fi,t( ̃x∗ t ) + (cid:123)(cid:122) Term I i t=Ts (cid:124) (cid:125) (cid:123)(cid:122) Term II (cid:125) T (cid:88) t=Ts (cid:124) ft( ̃x∗ t ) − ft(x∗ t ) , (38) (cid:123)(cid:122) Term III (cid:125) t is the projection of x∗ where ̃x∗ in, which is a subset of (cid:98)X s with τin = 2BrL based on Equation (22). (By applying the max-consensus step with a finite number of iterations, (cid:98)X s is constructed using the estimate with the maximum norm over agents' estimates.) t on X s The upper bound of Term I: Likewise, during the estimation phase, γ is chosen to be less than ∆s LLA based on the Lipschitz property we have to ensure the safeness of each agent's action, and (cid:80)Ts−1 t=1 (cid:80) i fi,t(xj,t) − fi,t(x∗ t ) = (cid:80)Ts−1 t=1 (cid:80) i ̃fi,t (cid:0)q(xj,t)(cid:1) − ̃fi,t (cid:0)q(x∗ t )(cid:1) ≤ (cid:80)Ts−1 t=1 (cid:80) i GF W (cid:107)xj,t − x∗ t (cid:107) ≤ 2GF W Lm(T0 + T1 + DG). (39) The upper bound of Term II: Define (cid:98)X s(cid:48) (cid:44) {q(x)|x ∈ (cid:98)X s}, (same for X s in and X s). Then for any q( ̃x∗ t ) = ̃u∗ t ∈ X s(cid:48) in , based on Algorithm 3 we have η (fi,t(xi,t) − fi,t( ̃x∗ t )) = η (cid:16) ̃fi,t(ui,t) − ̃fi,t( ̃u∗ t ) ≤ η∇ ̃fi,t(ui,t)(cid:62)(ui,t − ̃u∗ t ) (cid:17) (cid:16) = ∇φ(ui,t) − ∇φ(zi,t) − η∇ ̃fi,t(ui,t) (cid:17)(cid:62) ( ̃u∗ t − zi,t) + (∇φ(zi,t) − ∇φ(ui,t))(cid:62) ( ̃u∗ ≤ (∇φ(zi,t) − ∇φ(ui,t))(cid:62) ( ̃u∗ t , ui,t) − Dφ( ̃u∗ = Dφ( ̃u∗ ≤ Dφ( ̃u∗ t , ui,t) − Dφ( ̃u∗ ≤ Dφ( ̃u∗ t , ui,t) − Dφ( ̃u∗ = Dφ( ̃u∗ t , ui,t) − Dφ( ̃u∗ t − zi,t) + η∇ ̃fi,t(ui,t)(cid:62)(ui,t − zi,t) t − zi,t) + η∇ ̃fi,t(ui,t)(cid:62)(ui,t − zi,t) t , zi,t) − Dφ(zi,t, ui,t) + η∇ ̃fi,t(ui,t)(cid:62)(ui,t − zi,t) 1 t , zi,t) − Dφ(zi,t, ui,t) + 2 (cid:13) (cid:13) 2 (cid:13)∇ ̃fi,t(ui,t) (cid:13) (cid:13) (cid:13) t , u(cid:48) η2 2 i,t) + Dφ( ̃u∗ (cid:107)ui,t − zi,t(cid:107)2 + i,t) − Dφ( ̃u∗ t , zi,t) + t , zi,t) + t , u(cid:48) η2 2 (cid:13) (cid:13) 2 (cid:13)∇ ̃fi,t(ui,t) (cid:13) (cid:13) (cid:13) ≤ Dφ( ̃u∗ t , ui,t) − Dφ( ̃u∗ t , u(cid:48) i,t) + [P]jiDφ( ̃u∗ (cid:88) j η2 2 t , zj,t−1) − Dφ( ̃u∗ (cid:13) (cid:13) 2 (cid:13)∇ ̃fi,t(ui,t) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13)∇ ̃fi,t(ui,t) (cid:13) t , zi,t) + η2 2 (cid:13) 2 (cid:13) (cid:13) , (40) where the second inequality is based on the optimality of zi,t; the fourth inequality is due to the strong convexity of φ(*) and the fifth inequality is based on Assumption 9. Based on Theorem 14, Lemma 15, and the Lipschitz assumption on Dφ, we have (cid:13) (cid:13)Dφ( ̃u∗ t , ui,t) − Dφ( ̃u∗ t , u(cid:48) i,t)(cid:13) (cid:13) ≤ W (cid:13) (cid:13)ui,t − u(cid:48) i,t (cid:13) (cid:13) ≤ O(W η3/2). And based on Lemma 12, we get max i,j∈[m] (cid:107)ui,t − uj,t(cid:107) = max i,j∈[m] (cid:107)q(xi,t) − q(xj,t)(cid:107) = O(cid:0)W η(cid:1). With Equations (40), (41) and (42), we derive ̃fi,t(uj,t) − ̃fi,t( ̃u∗ t ) = ̃fi,t(uj,t) − ̃fi,t(ui,t) + ̃fi,t(ui,t) − ̃fi,t( ̃u∗ t ) ≤ GF (cid:107)ui,t − uj,t(cid:107) + O(η1/2W ) 1 η [P]jiDφ( ̃u∗ t , zj,t−1) − (cid:88) 1 η + ≤ O(cid:0)GF W η(cid:1) + O(η1/2W ) [P]jiDφ( ̃u∗ (cid:88) t , zj,t−1) − + 1 η j j Dφ( ̃u∗ t , zi,t) + 1 η Dφ( ̃u∗ t , zi,t) + (cid:13) (cid:13) 2 (cid:13)∇ ̃fi,t(ui,t) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) 2 (cid:13)∇ ̃fi,t(ui,t) (cid:13) (cid:13) (cid:13) . η 2 η 2 (41) (42) (43) Based on the definition of Bregman divergence, we have the following relationship Dφ( ̃u∗ t , zi,t−1) − Dφ( ̃u∗ t , zi,t) = (∇φ(zi,t) − ∇φ(zi,t−1))(cid:62) ( ̃u∗ = (∇φ(zi,t) − ∇φ(zi,t−1))(cid:62) ̃u∗ t − zi,t) + Dφ(zi,t − zi,t−1) t + (cid:0)φ(zi,t) − ∇φ(zi,t)(cid:62)zi,t (cid:1) − (cid:0)φ(zi,t−1) − ∇φ(zi,t−1)(cid:62)zi,t−1 (44) (cid:1) Summing Equation (43) over i, then based on Equation (44) we get ̃fi,t(uj,t) − ̃fi,t( ̃u∗ t ) (cid:88) i ≤O(cid:0)mGF W η(cid:1) + O(mη1/2W ) + (cid:13) (cid:13) 2 (cid:13)∇ ̃fi,t(ui,t) (cid:13) (cid:13) (cid:13) η 2 (cid:88) i + 1 η (cid:88) (cid:104) i (∇φ(zi,t) − ∇φ(zi,t−1))(cid:62) ̃u∗ t + (cid:0)φ(zi,t) − ∇φ(zi,t)(cid:62)zi,t (cid:1) − (cid:0)φ(zi,t−1) − ∇φ(zi,t−1)(cid:62)zi,t−1 (cid:1)(cid:105) . Then by summing Equation (45) over [Ts, . . . , T ], we have T (cid:88) (cid:88) t=Ts i ̃fi,t(uj,t) − ̃fi,t( ̃u∗ t ) ≤O(cid:0)mT GF W η(cid:1) + O(mT η1/2W ) + T (cid:88) (cid:88)   T (cid:88) t=Ts ( ̃u∗ t − ̃u∗ t+1)(cid:62) t=Ts (cid:33) ∇φ(zi,t) + (cid:32) (cid:88) i i (cid:32) + + 1 η 1 η (cid:13) (cid:13) 2 (cid:13)∇ ̃fi,t(ui,t) (cid:13) (cid:13) (cid:13) η 2 (cid:33)(cid:62) ∇φ(zi,T ) ( ̃u∗ T ) − (cid:32) (cid:88) i ∇φ(zi,Ts−1) (cid:33)(cid:62)  ( ̃u∗ Ts )  (cid:88) i (cid:2)(cid:0)φ(zi,T ) − ∇φ(zi,T )(cid:62)zi,T (cid:1) − (cid:0)φ(zi,Ts−1) − ∇φ(zi,Ts−1)(cid:62)zi,Ts−1 (cid:1)(cid:3) . (cid:88) i The upper bound of Term III: Based on Lemma 9, we have for any x∗ t ∈ X s and its projection to X s in: ̃x∗ t T (cid:88) (cid:88) t=Ts i (cid:16) ̃fi,t(q( ̃x∗ t )) − ̃fi,t(q(x∗ t )) T (cid:88) (cid:88) (cid:17) ≤ t=Ts i GF W (cid:107) ̃x∗ t − x∗ t (cid:107) ≤ mT GF W √ 2 dLBr C(A, b) . Substituting Equations (39), (46) and (47) into Equation (38), the final regret bound is as (cid:88) (cid:88) t=1 i (fi,t(xj,t) − fi,t(x∗ t )) ≤O(cid:0)mT GF W η(cid:1) + O(mT η1/2W ) + T (cid:88) (cid:88)   T (cid:88) t=Ts ( ̃u∗ t − ̃u∗ t+1)(cid:62) t=Ts (cid:33) ∇φ(zi,t) + (cid:32) (cid:88) i i (cid:32) + + 1 η 1 η (cid:88) i (cid:13) (cid:13) 2 (cid:13)∇ ̃fi,t(ui,t) (cid:13) (cid:13) (cid:13) η 2 (cid:33)(cid:62) ∇φ(zi,T ) ( ̃u∗ T ) − (cid:32) (cid:88) i (cid:33)(cid:62)  ∇φ(zi,Ts−1) ( ̃u∗Ts)  (cid:88) i (48) √ 2 dLBr C(A, b) (cid:2)(cid:0)φ(zi,T ) − ∇φ(zi,T )(cid:62)zi,T (cid:1) − (cid:0)φ(zi,Ts−1) − ∇φ(zi,Ts−1)(cid:62)zi,Ts−1 (cid:1)(cid:3) + O(T0 + T1) + mT GF W =O(T0 + T1 + T √ η + T √ log T0 √ T0 + 1 η + 1 η T (cid:88) t=Ts (cid:13) (cid:13) ̃u∗ t − ̃u∗ t+1 (cid:13) (cid:13)), where the final regret bound is proved by applying the specified η and T0. (45) (46) (47)
http://arxiv.org/abs/2302.12317v2
2023-06-30T17:43:40
2023-02-23T20:26:58
Fact or Artifact? Revise Layer-wise Relevance Propagation on various ANN Architectures
Layer-wise relevance propagation (LRP) is a widely used and powerful technique to reveal insights into various artificial neural network (ANN) architectures. LRP is often used in the context of image classification. The aim is to understand, which parts of the input sample have highest relevance and hence most influence on the model prediction. Relevance can be traced back through the network to attribute a certain score to each input pixel. Relevance scores are then combined and displayed as heat maps and give humans an intuitive visual understanding of classification models. Opening the black box to understand the classification engine in great detail is essential for domain experts to gain trust in ANN models. However, there are pitfalls in terms of model-inherent artifacts included in the obtained relevance maps, that can easily be missed. But for a valid interpretation, these artifacts must not be ignored. Here, we apply and revise LRP on various ANN architectures trained as classifiers on geospatial and synthetic data. Depending on the network architecture, we show techniques to control model focus and give guidance to improve the quality of obtained relevance maps to separate facts from artifacts.
[ "Marco Landt-Hayen", "Willi Rath", "Martin Claus", "Peer Kröger" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12317v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12317v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV" ]
3 2 0 2 n u J 0 3 ] G L . s c [ 2 v 7 1 3 2 1 . 2 0 3 2 : v i X r a FACT OR ARTIFACT? REVISE LAYER-WISE RELEVANCE PROPAGATION ON VARIOUS ANN ARCHITECTURES∗ Marco Landt-Hayen GEOMAR Helmholtz Centre for Ocean Research Kiel, Germany [email protected] Willi Rath GEOMAR Helmholtz Centre for Ocean Research Kiel, Germany [email protected] Martin Claus Christian-Albrechts-Universität Kiel, Germany [email protected] Peer Kröger Christian-Albrechts-Universität Kiel, Germany [email protected] ABSTRACT Layer-wise relevance propagation (LRP) is a widely used and powerful technique to reveal insights into various artificial neural network (ANN) architectures. LRP is often used in the context of image classification. The aim is to understand, which parts of the input sample have highest relevance and hence most influence on the model prediction. Relevance can be traced back through the network to attribute a certain score to each input pixel. Relevance scores are then combined and displayed as heat maps and give humans an intuitive visual understanding of classification models. Opening the black box to understand the classification engine in great detail is essential for domain experts to gain trust in ANN models. However, there are pitfalls in terms of model-inherent artifacts included in the obtained relevance maps, that can easily be missed. But for a valid interpretation, these artifacts must not be ignored. Here, we apply and revise LRP on various ANN architectures trained as classifiers on geospatial and synthetic data. Depending on the network architecture, we show techniques to control model focus and give guidance to improve the quality of obtained relevance maps to separate facts from artifacts. Keywords Artificial Neural Networks * Image Classification * Layer-wise Relevance Propagation * Geospatial Data * Explainable AI. 1 Introduction Image classification refers to assigning one or more class labels to a two-dimen-sional image. Here, we focus on binary classification problems and have only two distinct classes. Instead of having a discrete class label, one often assigns some continuous target value to each sample. The class label is then derived from the target value by defining certain thresholds. Like this, the initial classification problem becomes a regression problem. The task is then to predict some continuous target value from all input pixels. Generally, the relationship between inputs and targets is highly nonlinear. Artificial neural networks (ANNs) are state-of-the-art for this task. In this work, we will revise the use of various ANN architectures for image classification. In particular, we work with multilayer perceptrons (MLPs), convolutional neural networks (CNNs) and Echo State Networks (ESNs). MLP models have frequently been used for image classification [1, 2, 3]. CNN architectures aim to detect objects and structures in the underlying samples and are powerful tools for image classification [4, 5], object detection [6] or semantic segmentation [7]. With their inherent shared weights philosophy, CNNs need less trainable parameters, compared to MLPs. ESNs differ from MLPs and CNNs, as they are a special type of recurrent neural networks (RNNs), originally designed for time series forecasting [8, 9]. To use ∗This work was supported by the Helmholtz School for Marine Data Science (MarDATA) funded by the Helmholtz Association (Grant HIDSS-0005). two-dimensional images as inputs, samples may be sliced column- or row-wise, respectively. Like this, either the x− or the y−dimension is turned into a time dimension, as done in [10]. As input data, we use real world geospatial data. In particular, we choose a well-understood Earth System Variability, the El Niño Southern Oscillation (ENSO). The current ENSO phase can be detected from spatially averaged sea surface temperature (SST) anomalies in the so-called Niño 3.4 region in the Tropical Pacific. But ENSO is a complex phenomenon and is related to climate anomalies over large distances, also referred to as teleconnections. ENSO leaves its footprint outside the Tropical Pacific, e.g. at the African West coast near Angola [11]. Here, we use ANN models as ENSO detectors on two-dimensional samples of SST anomalies. The two classes are either "El Niño" or "La Niña", which can be associated with unusual warm or cold sea surface temperature in the Niño region, respectively. While all models perfectly perform on this simple classification task, our aim is not to find a superior classifier. Here, we are interested in getting a deeper understanding of how the models come to their conclusions and explain the reasoning of the models' classification engine by using ENSO as a toy problem. A variety of techniques from the domain of explainable artificial intelligence (xAI) exists to open the black box of ANNs. In backward optimization [12], the inputs for a trained model are modified to maximize the network's confidence in the obtained output. The goal is to generate some optimal input. A saliency map [13] aims to highlight areas in a given input sample that show strongest support towards a given class. Other techniques compute the gradient of a prediction with respect to the input pixels in a sensitivity analysis [14], to reveal insights in how sensitive the model output depends on slight modifications of input values. Our purpose is more general. We want to find each input pixel's contribution to the model output. This can be achieved by layer-wise relevance propagation (LRP). The concept of LRP has been introduced by Bach et al. [15]. The model prediction is taken as final relevance and is then traced back through all layers until reaching the input space to assign individual relevance scores to each input pixel. LRP has been extended from a practical point of view by Montavon et al. [16]. In their work, they provide a set of concrete propagation rules for tracing relevance back through the layers. Toms et al. [1] recently applied LRP to MLP models trained as ENSO detector. They show mean relevance maps obtained from all El Niño samples. Significant relevance is only found in the Niño region, as one might expect on the first sight. There are no other spots of high relevance outside this area. In our earlier work [10], we proposed to use ESN models on the same task and also performed LRP on ENSO. We found mean relevance maps for El Niño samples with a far more subtle structure, also highlighting Niño region but highest relevance is found on the passage between South Africa and Antarctica. Moreover, the leak rate in the reservoir transition of an ESN determines the reservoir memory and hence is a crucial parameter [10]. Here, we give a heuristic for setting the leak rate in relation to the number of time steps. In addition to MLP and ESN models, we also apply LRP to CNN models in this work. For MLPs and CNNs used for image classification, regularization of weights is found to be essential. We can force MLP and CNN models to focus only on a very narrow spot in the Tropical Pacific to discriminate El Niño from La Niña, by driving small weights to zero to favor sparse weight matrices in the training process [17]. To get a deeper understanding, we step back and first apply MLP, CNN and ESN models to synthetic samples, where we exactly know the relationship between inputs and outputs by design. Only with a sound understanding of pitfalls related to LRP, we can use this powerful technique on unknown problems to help domain experts to explain their models, gain trust in models' predictions and avoid misinterpretations. Like this, LRP bears good prospects to help finding new relationships and understanding unknown teleconnections [18, 19, 20]. Our main contributions are as follows: • We revise LRP on various ANN architectures used for image classification. • We show how to control the model focus of MLP and CNN networks by weight regularization. • For ESNs, we find the leak rate to be the crucial parameter and give a heuristic to choose it appropriately. • Some of the additional spots of high relevance found in mean relevance maps from ESN models are identified as artifacts. Furthermore, we propose a technique to erase these artifacts. The rest of this work is structured as follows: In Section 2 we briefly introduce synthetic and real world data used for our experiments. Section 3 outlines the concept of LRP customized to MLP, CNN and ESN models. The application of LRP to synthetic and real world ENSO patterns is presented in Section 4. A detailed discussion and conclusion is found in Section 5, followed by technical details, remarks on availability of data and annotated code in the Appendix. 2 2 Data In this section, we introduce SST anomaly fields related to ENSO used as real world data. After that, we describe the design of our synthetic samples. In this work, we use two-dimensional monthly mean SST anomaly fields for the years 1880 through 2021 as real world inputs. Raw SST data is provided by the NOAA Physical Sciences Laboratory [21]. Input samples consist of 89 × 180 grid points on a 2° by 2° latitude-longitude grid. Several indices are used to monitor ENSO activity based on SST anomalies in the Tropical Pacific [22]. Morrow et al. [23] define in their work an index from the Niño 3.4 region (5°N–5°S, 120–170°W), which we use as target in this work. El Niño and La Niña events are characterized by positive and negative SST anomalies in the Niño 3.4 region, referred to index values ≥ 0.5 and ≤ −0.5, respectively. Neutral states in between, are not considered for classification, here. The total number of 1,041 samples is split, using the first 80% as training data (832 samples) and the remaining 20% for validation (209 samples). The upper part of Figure 1 shows composite average SST anomaly fields for El Niño and La Niña. As synthetic data, we create quadratic samples of dimension 100 × 100 pixels and define two distinct classes, class 1 and class 2, respectively. On the right-hand side of each sample, we have a vertically centered square of value +1, identical for both classes. The left-hand side also contains a vertically centered square of values +1 and -1 for classes 1 and 2, respectively, as equivalent for SST anomalies in the Niño region in real world samples. Classes can be uniquely discriminated by the square on the left-hand side, while the other only serves as an additional but irrelevant feature. We add random noise to all samples, drawn from a uniform distribution in the interval [−0.5, 0.5]. In addition to that, we include some vertical regions of invalid grid points with a small gateway to all samples, similar to land masses in real world samples, where SST anomalies are not defined. Target values are +1 and -1 for classes 1 and 2, respectively. Training data consists of 400 samples, 200 for each class, while validation data consists of 100 samples, 50 for each class. The lower part of Figure 1 shows single samples for both classes as example. 3 Methods and Models In this section, we briefly recap the ANN architectures and sketch the concept of LRP customized to MLP, CNN and ESN models. MLPs are feedforward networks and consist of a specified number of layers. The input layer is connected to the input samples. This requires the number of input units to equal the number of input pixels. Two-dimensional samples are therefore transformed into a one-dimensional vector. CNNs are also feedforward networks. The convolution Figure 1: Upper part: Composite average SST anomaly patterns for El Niño (left-hand side) and La Niña (right-hand side) events. A black rectangle highlights Niño 3.4 region. Lower part: Exemplary samples for classes 1 (left-hand side) and 2 (right-hand side) of synthetic data. 3 is done by specified kernels scanning the input image and producing so-called feature maps. After a desired number of convolutions and optionally pooling operations, we obtain the final feature maps. Here, we flatten these final feature maps and stack fully connected dense layers on top of the underlying CNN part. The basic form of an ESN model consists of an input and an output layer and a reservoir of sparsely connected units in between. Once randomly initialized, the input and reservoir weights and biases are kept fixed. We then feed a certain number of input features for a specified number of time steps into the model and record the final reservoir states. Only the output weights and bias are trained by regressing final reservoir states onto targets. There is no backpropagation of errors in the training process, as for MLPs or CNNs. Equation 1 states the initial reservoir states x(t = 1) for our ESN model. We have a leaky reservoir with leak rate α ∈ [0, 1], as discussed in [24]. For larger leak rates, the reservoir states react faster to new inputs. u(t) denote current time step's inputs, Win and bin are input weights and biases, respectively. x(t = 1) = α act[Winu(t = 1) + bin] (1) Reservoir state transition for subsequent time steps is outlined in Equation 2. A fraction (1 − α) of the previous reservoir states x(t − 1) is kept and combined with the term inside the activation act(.), here tanh. Wresx(t − 1) + bres denotes the recurrence inside the reservoir, with reservoir weights and biases Wres and bres, respectively. x(t) = (1 − α) x(t − 1) + α act[Winu(t) + bin + Wresx(t − 1) + bres] (2) Toms et al. [1] describe in their work, how LRP can be applied to MLP and CNN models, as both are feedforward networks. The model output Y is taken as final relevance and is then traced back through all layers until reaching the input space to assign relevance scores R(1) n to each of the n input pixels, as stated in Equation 3. Y = (cid:88) R(1) n n (3) Starting with model output Y , relevance is distributed back from the output layer through lower layers until we reach the input layer. To preserve total relevance in each layer, we have a second constraint, as stated in Equation 4. Y = ... = (cid:88) R(l+1) j = (cid:88) R(l) i = ... = (cid:88) R(1) n j i n (4) Samples of class 1 have positive target values by design. For this reason, we consider only positive contributions of pre-activations as propagation rule. Assume we have j units in layer (l + 1) with known relevance scores R(l+1) , the relevance R(l) ij = max(aiwi:j, 0). Here, ai denotes i=i0 activation of units i of layer (l) and wi:j denotes the weight connecting unit i from layer (l) with unit j from layer (l + 1). For class 2 samples, we have negative targets. We start with absolute prediction values as final relevance, since relevance is defined to be positive, and only consider negative contributions of pre-activations. for unit i0 of layer (l) is obtained by Equation 5, using z+ j R(l) i=i0 = (cid:88) j z+ i0j (cid:80) i z+ ij R(l+1) j (5) This LRP concept needs to be modified for our ESN models, as described in great deatail in [10], since we have a recurrence in time. Reservoir transition needs to be unfolded. Each time step is equivalent to one layer. A fraction of the total relevance is attributed to each time step's inputs. Remaining relevance is passed on until we reach the initial input. Finally, all relevance scores attributed to all time step's inputs can be composed to obtain a relevance map with same dimensions as the input sample. 4 Results In this section, we present results from LRP experiments with MLP, CNN and ESN models on synthetic and real world data. By design, we know that our synthetic samples can uniquely be discriminated by looking at the left square. Figure 2 shows mean relevance maps for class 1 obtained from MLP (upper part) and CNN models (lower part) with and without regularization of hidden layer's weights. Without regularization, we find blurry mean relevance maps for both models with highest relevance on both squares. By adding regularization terms, we successfully force both models to focus on the left square. For the CNN we find artifacts in form of quadratic patches in mean relevance maps. 4 Figure 2: Mean relevance maps for MLP (upper part) and CNN (lower part) on class 1 for different weight regularization. A, B, C: MLP without regularization, L1=0.001 and L1=0.01, respectively. D, E, F: CNN without regularization, L1=0.001 and L1=0.01, respectively. For ESN models, only the output weights are trained by regressing final reservoir states onto targets. This limits the use of weight regularization. However, for ESN models the leak rate α determines reservoir dynamics and memory. Figure 3 shows mean relevance maps for ESN models, feeding class 1 samples column-wise into the model, starting with the leftmost column. For α = 0.005, we find an equal amount of summed relevance over both squares. But highest relevance is found on the gateway in the barrier of invalid grid points. With increasing leak rate (α = 0.05) the reservoir's memory starts to fade, summed relevance on the left square is decreased. Still, the model succeeds to classify all samples correctly. At some point (α = 0.2) the reservoir loses its memory of the left half. All relevance is bundled rightmost and classification accuracy for validation samples drops to random guessing. In this case, α = 0.005 is a suitable choice for the leak rate, since it guarantees all time steps' inputs to be equally considered. With that choice of the leak rate, we compare various techniques to use two-dimensional input samples for ESN models. Figure 4 shows mean relevance maps for ESN models, feeding class 1 samples column- or row-wise into the model. We find horizontal and vertical stripes, respectively. We don't find increased relevance on the gateway when feeding samples row-wise into the model. As third approach, we propose to split input samples into equal-sized pieces, considering only valid grid points. The resulting mean relevance map for class 1 samples is also shown in Figure 4. We find a perfectly Figure 3: Mean relevance maps for ESN on class 1, feeding samples column-wise into the model. Fading memory experiment with various leak rates. A: α = 0.005, B: α = 0.05, C: α = 0.2. 5 Figure 4: Mean relevance maps for class 1 samples from ESN models using different techniques to feed two-dimensional inputs into the models. A: column-wise, B: row-wise, C: piecewise. equal amount of summed relevance over both squares. Besides that, there are no artifacts in form of stripes and we don't find any increased relevance on the gateway. Switching to real world samples, the upper part of Figure 5 shows mean relevance maps for El Niño, obtained from the MLP and CNN model with regularization (L1=0.01). We find strong and only focus inside Niño region. The lower part of Figure 5 shows MLP results without regularization. We find two complementary modes on the exact same parameter setting. Figure 6 compares mean relevance maps for El Niño, obtained from ESN models, feeding samples column-wise and as equal-sized pieces, respectively. In both cases, we find high relevance inside the Tropical Pacific. However, feeding samples column-wise, highest relevance is found on the passage between South Africa and Antarctica and we find horizontal stripes. 5 Discussion and Conclusion In this section, we will discuss all results from the previous section in detail and give an outlook on future research. We have shown, that our MLP and CNN models can be successfully forced to focus mainly on the left square of our Figure 5: Mean relevance maps for El Niño using MLP and CNN models with different weight regularization. A: MLP, L1=0.01, B: CNN, L1=0.01, C and D: MLP 1st and 2nd mode, respectively, no regularization. 6 Table 1: Evaluation metrics for selected models trained on synthetic samples: mse on training and validation data, the ratio of summed mean relevance over both squares in relation to total relevance, the relative amount of summed mean relevance over the left square in relation to both squares, and the number of trainable parameters. msetrain mseval rel / (cid:80) total rel / (cid:80) both sq (cid:80) both sq (cid:80) lef t sq trainable parameters rel rel MLP no reg. MLP L1=0.01 CNN L1=0.01 ESN piecewise 0.01 0.053 7% 48% 0.001 0.002 92% 100% 19,205 19,205 0.005 0.008 40% 98% 2,223 0.001 0.180 7% 50% 301 synthetic samples, which is sufficient to fulfill the classification task. For our CNN model we find artifacts in form of quadratic patches in mean relevance maps, due to shared kernel weights. When it's L1 weight regularization found to be the key to force MLP and CNN models to focus, we find the leak rate to be crucial for ESN models to determine reservoir memory. Leak rate needs to be chosen appropriately, to equally take all time steps' inputs into account, since we don't know in advance, which time steps contain most relevant information. Using two-dimensional inputs column- or row-wise, we find horizontal and vertical stripes, respectively, which slightly differ for individual training runs. Input samples don't show any stripes. This, and the fact, that we find stripes to depend on how we feed sample into the model, clearly unmasks these stripes to be artifacts, stemming from random initialized input weights. Highest relevance for ESN models is found on the small gateway only, when we feed samples column by column. This effect of squeezed relevance is caused by the varying number of valid grid points for different columns. The number of valid grid points per row also varies, but the effect is much smaller and can hardly be recognized. As a solution, we propose a new technique of considering only valid grid points. These grid points are transformed to a one-dimensional vector, permuted and split into equal-sized pieces. Like this, stripes disappear and we no longer find elevated relevance on the gateway. However, both squares are found to be equally relevant, since we cannot apply weight regularization on ESN models. From a practical point of view, the model choice in combination with parameter setting is a tradeoff between ex- plainability and performance. Table 1 shows evaluation metrics for selected models trained on synthetic samples. While all models perfectly perform the classification task with 100% accuracy, the mean squared error (mse) of model predictions compared to true targets and the model focus varies. MLP with weight regularization shows lowest mse and focuses completely on the left square. This leads to high performance in terms of efficiently discriminating classes but low explainability, since all features with minor relevance are suppressed. The ESN model with feeding samples as equal-sized pieces comes with a higher mse on validation samples compared to MLP and CNN models and thus lower performance on the classification task. However, mean relevance maps from ESN models highlight all features involved in the underlying input samples, that could reveal valuable insights into existing teleconnections and thus offer higher explainability. Trained on real world data, our MLP and CNN models with weight regularization act as a very efficient classifier and only focus on a narrow spot in the Niño region. Without regularization, the MLP model reveals more structure in mean relevance maps. Moreover, we find two complementary modes, due to random initialization of weights and biases and the stochastic nature of the learning algorithm. The first mode shows strong focus on the Niño region, while the second Figure 6: Mean relevance maps for El Niño from ESN models using different techniques to feed inputs into the model. A: column-wise, B: piecewise. 7 mode completely ignores the very same region. With this second mode, the MLP still successfully discriminates ENSO patterns by encountering information from outside Tropical Pacific. Using real world samples column-wise for training our ESN model, we again find horizontal stripes in the obtained mean relevance map, that have already been identified as artifacts in experiments on synthetic data. Highest relevance is found in the region between South Africa and Antarctica. Since SST input data is only defined over the ocean, the number of valid grid points is smallest for these columns, forcing relevance to be compressed onto the remaining valid grid points. Again, splitting input samples into equal-sized pieces erases both artifacts in mean relevance maps obtained from ESN models. Like this, our proposed method enhances the explainability for ESN models. Overall, neither model is found to be superior for image classification with LRP. While MLP and CNN models appear to be efficient in focusing on most relevant features, mean relevance maps of ESNs reveal valuable information on existing teleconnections. It is also worth to mention that ESN models come with a significantly lower number of trainable parameters, allowing these models to be trained on less training data without overfitting. With this advantage, ESNs have good prospects for further use on geospatial data and could also be used in combination with LRP in the context of time series prediction, when we replace two-dimensional inputs by a number of e.g. climate indices. This approach could then serve as alternative for long short-term memory (LSTM) models with attention mechanisms. Appendix In this work we only show reproducible results. All models have been implemented in Python (version 3.9.9) using Tensorflow (version 2.4.1). To keep it as transparent as possible, we provide data and annotated Python code in Jupyter notebooks containing all experiments and details on models and methods [25]. References [1] Toms, B. A., Barnes, E. A., and Ebert-Uphoff, I.: Physically Interpretable Neural Networks for the Geosciences: Applications to Earth System Variability, Journal of Advances in Modeling Earth Systems, vol. 12, no. 9 (2020) [2] Coskun, N. and Yildirim, T.: The effects of training algorithms in MLP network on image classification, Proceedings of the International Joint Conference on Neural Networks, vol. 2, pp. 1223-1226 (2003), DOI: 10.1109/IJCNN.2003.1223867 [3] Shubathra, S., Kalaivaani, P., and Santhoshkumar, S.: Clothing Image Recognition Based on Multiple Features Using Deep Neural Networks, International Conference on Electronics and Sustainable Communication Systems (ICESC), pp. 166-172 (2020), DOI: 10.1109/ICESC48915.2020.9155959. [4] Krizhevsky, A., Sutskever, I., and Hinton, G. E.,: ImageNet Classification with Deep Convolutional Neural Networks, Communications of the ACM, vol. 60, issue 6, pp. 84–90 (2017), DOI: 10.1145/3065386 [5] Kadam S. S., Adamuthe A. C., and Patil, A.: CNN Model for Image Classification on MNIST and Fashion-MNIST Dataset, vol. 64, issue 2, pp. 374-384 (2020), DOI:10.37398/jsr.2020.640251 [6] Mottaghi, R., Chen, X., Liu, X., Cho, N.-G., Lee, S.-W., Fidler, S., and Yuille, A.: The role of context for object detection and semantic segmentation in the wild, In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Columbus, USA, pp. 891–898 (2014) [7] Redmon, J., Divvala, S., Girshick, R., and Farhadi, A.: You only look once: Unified, real-time object detection, In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, USA, pp. 779–788 (2016) [8] Kim, T. and King, B.: Time series prediction using deep echo state networks, Neural Computing and Applications, vol. 32 (2020) [9] Gallicchio, C., Micheli, A., and Pedrelli, L.: Deep reservoir computing: A critical experimental analysis, Neuro- computing, vol. 268, pp. 87–99 (2017) [10] Landt-Hayen, M., Kröger, P., Claus, M., and Rath, W.: Layer-wise Relevance Propagation for Echo State Networks applied to Earth System Variability, In Proceedings of the 3rd International Conference on Machine Learning Techniques (MLTEC 2022), Zurich, Switzerland, vol. 12, no. 20, pp. 115-130 (2022) [11] Shannon, L. V., Agenbag J. J., and Buys M. E. L.: Large- and mesoscale features of the Angola-Benguela front, South African Journal of Marine Science, vol. 5, no. 1, pp. 11-34 (1987), DOI: 10.2989/025776187784522261 [12] Olah, C., Schubert, L., and Mordvintsev, A.: Feature Visualization, Distill (2017), https://distill.pub/2017/feature- visualization, DOI: 10.23915/distill.00007 8 [13] Simonyan, K., Vedaldi, A., and Zisserman, A.: Deep Inside Convolutional Networks: Visualising Image Classifica- tion Models and Saliency Maps, arXiv (2013), https://arxiv.org/abs/1312.6034, DOI: 10.48550/ARXIV.1312.6034 [14] Nourani, V. and Fard, M. S.: Sensitivity analysis of the artificial neural network outputs in simulation of the evaporation process at different climatologic regimes, Advances in Engineering Software, vol. 47, pp. 127-146 (2012) [15] Bach, S., Binder, A., Montavon, G., Klauschen, F., Müller K.-R., and Samek W.: On Pixel-Wise Explanations for Non-Linear Classifier Decisions by Layer-Wise Relevance Propagation, PLoS ONE, vol. 10 (2015) [16] Montavon, G., Lapuschkin, S., Binder, A., Samek, W., and Müller, K.-R.: Explaining nonlinear classification decisions with deep Taylor decomposition, Pattern Recognition, vol. 65, pp. 211-222 (2017) [17] Krogh, A. and Hertz, J. A.: A Simple Weight Decay Can Improve Generalization, In Proceedings of the 4th International Conference on Neural Information Processing Systems (NIPS 1991), San Francisco, USA, pp. 950–957 (1991) [18] Pak, G., Park, Y.-H., Vivier, F., Kwon, Y.-O., and Chang, K.-I.: Regime-Dependent Nonstationary Relationship between the East Asian Winter Monsoon and North Pacific Oscillation, Journal of Climate, vol. 27, no. 21, pp. 8185–8204 (2014) [19] Park, Y.-H., Kim, B.-M., Pak, G., Yamamoto, M., Vivier, F., and Durand, I.: A key process of the nonstationary relationship between ENSO and the Western Pacific teleconnection pattern, Scientific Reports, vol. 8, no. 9512 (2018) [20] Zhang, W., Mei, X., Geng, X., Turner, A. G., and Jin, F.-F.: A Nonstationary ENSO–NAO Relationship Due to AMO Modulation, Journal of Climate, vol. 32, no. 1, pp. 33-43 (2019) [21] https://downloads.psl.noaa.gov/Datasets/noaa.ersst.v5/sst.mnmean.nc [22] https://climatedataguide.ucar.edu/climate-data/ [23] Morrow, R., Ward, M. L., Hogg, A. McC., and Pasquet, S.: Eddy response to Southern Ocean climate modes, Journal of Geophysical Research, vol. 115, DOI: 10.1029/2009JC005894 (2010) [24] Jaeger, H., Lukosevicius, M., Popovici, D., and Siewert, U.: Optimization and applications of echo state networks with leaky-integrator neurons, Neural Networks: The official journal of the International Neural Network Society, vol. 20, p. 335 (2007) [25] https://github.com/MarcoLandtHayen/fact-or-artifact Supplementary Material LRP for ESNs In Section 4 we give a heuristic on how to choose the leak rate α from a practical point of view. Feeding a sample with T time steps into an ESN model, the aim is to equally take all time steps' inputs into account, if possible. Here, we add a mathematical validation to support the empirical approach and explain side effects related to the choice of α. As described in Section 3, the general concept of LRP needs to be customized for ESN models. In particular, we work with leaky reservoirs. Reservoir state transition for the first time step t = 1 and subsequent time steps t = 2..T is outlined in Equations 1 and 2, respectively. The leak rate α determines the reservoir dynamics. To compute reservoir states x(t) for a given time step in the forward pass, a fraction (1 − α) of the previous reservoir states x(t − 1) is kept. The current time step's inputs u(t) are included in some activation term act[Winu(t) + bin + Wresx(t − 1) + bres]. This term is multiplied with α. The larger the leak rate, the faster the reservoir reacts to new inputs. For obtaining mean relevance maps, we unfold reservoir dynamics in time. Each time step is treated as an individual layer. We use the backward pass and start with model prediction Y as final or total relevance. A portion of the total relevance is attributed to every time step's inputs. Only the remaining relevance is then traced back through the layers or time steps. Multiplication with leak rate α in reservoir state transition leads to an exponential decay, when tracing relevance backwards. R(t) denotes residual relevance for time step t. Once we reach the initial time step t = 1, all residual relevance is attributed to the initial inputs u(t = 1). R(t) = exp(−α (T − t)) (6) Equation 6 states the the exponential decay for a given leak rate α. The left part of Figure 7 shows the result for different leak rates. We clearly see the fading memory effect that has been described in Section 4. For leak rates α = 0.1 and 0.2, only the inputs for time steps t ≥ 50 are considered. 9 Table 2: Residual relevance R(t = 1) from approximation compared to empirical residual relevance ˆR(t = 1) for first time step for ESN model trained on synthetic samples with different leak rates α. Leak rate α R(t = 1) 0.001 0.005 0.01 0.05 0.1 0.2 90.5% 60.7% 36.8% 0.7% 0.0% 0.0% ˆR(t = 1) 90.7% 63.1% 41.9% 2.9% 0.1% 0.0% Table 2 shows residual relevance R(t = 1) approximated as exponential decay according to Equation 6 for various leak rates. Here, we assume to have T = 100 time steps. In addition to that, Table 2 shows empirical residual relevance ˆR(t = 1) obtained from an ESN model trained on synthetic samples feeding samples column-wise into the model. Synthetic samples also consist of T = 100 time steps. For leak rates α = 0.001, 0.005 and 0.01, we find ˆR(t = 1) = 91%, 63% and 42% of total relevance, respectively, as residual relevance. This amount is attributed to initial inputs u(t = 1), which gives the initial inputs an unreasonable high relevance compared to all other time steps' inputs. For leak rates α = 0.05, 0.1 and 0.2, we find the remaining relevance attributed to the initial inputs to be close to zero. The exponential decay is found to be a good approximation. Using ESN models, the aim is to equally consider all time steps' inputs, since we don't know in advance, which time steps contain most relevant information. Therefore, we need to look at the rate of change for residual relevance traced backwards through all time steps. The rate of change can be approximated as first derivative R′(t) of residual relevance R(t) and is stated in Equation 7. R′(t) = ∂R ∂t = α exp(−α (T − t)) (7) The right-hand side of Figure 7 shows the resulting rate of change for different leak rates. We find the rate of change to be almost constant for small leak rates α = 0.001, 0.005 and 0.01, reflecting a similar amount of total relevance attributed to each time step's inputs u(t), as desired. This is violated for higher leak rates α = 0.05, 0.1 and 0.2, respectively. For these leak rates the ESN model puts significantly higher weights on later input steps. Taking residual relevance and rate of change into account, we need to find a compromise. We want all time steps to be about equally considered. This encourages us to choose small leak rates. However, we need to avoid an unreasonable high amount of residual relevance to be put on the initial time step's inputs u(t = 1). One possible solution is to add a dummy column of constant value one as first input time step for all input samples. Residual relevance is then absorbed by this dummy column, which doesn't affect classification in general and doesn't distort mean relevance maps, since it Figure 7: Residual relevance approximated by an exponential decay over T = 100 time steps for various leak rates α (left-hand side) and rate of change for residual relevance (right-hand side). 10 is identical for all samples of both classes. For showing the obtained mean relevance maps, the dummy column is then omitted. Data Preprocessing While the main body of this work focuses on models, methods and results, we provide details on data preprocessing in this section. Different ANN models require input samples to be customized in dimensionality and we need to deal with missing data at grid points located on land. For our MLP models, we only consider valid grid points of raw two-dimensional input samples. These grid points are then transformed into a one-dimensional vector as sketched in Figure 8. The number of input units then equals the number of valid grid points. Our CNN models require two-dimensional input samples. Missing values are replaced by zero. Input samples are then scanned by quadratic kernels. Kernel sizes and step sizes, also referred to as strides, need to be specified. Figure 9 sketches on the left-hand side an exemplary sample of dimensions 5 × 6 grid points. Here, we assume to work with Figure 8: Transformation of an exemplary two-dimensional input sample consisting of 5 rows and 6 columns into a one-dimensional vector for our MLP models. Consider only valid grid points. Invalid grid points are marked as X. 11 Figure 9: Modification of an exemplary two-dimensional input sample consisting of 5 rows and 6 columns by replacing missing values and adding an additional row of zeros for our CNN models. Invalid grid points and zeros are marked as X and O, respectively. a kernel of size 3 × 3 and step size is also chosen to be 3 in both directions, x and y. This requires adding a row of zeros to allow the sample to be completely scanned by our specified kernel and step size. The modified input sample is shown on the right-hand side of Figure 9. Adding a row of zeros doesn't affect mean relevance maps. Zero relevance is attributed to these additional grid points when we only consider positive pre-activations z+ in the propagation rule, as stated in Equation 5. For our ESN models, we need to add a dummy column of ones as first input step to absorb residual relevance in any case as described above. The way we deal with missing data varies for different techniques of feeding samples into ESN models. For feeding samples column- or row-wise, missing values are set to zero, as for our CNN models. Samples are then sliced column- or row-wise, as sketched in the upper and lower part of Figure 10, respectively. When feeding samples as equal-sized pieces, we only consider valid grid points. These grid points are then transformed into Figure 10: Preprocessing of an exemplary two-dimensional input sample for feeding samples column-wise (upper part) or row-wise (lower part) into our ESN models requires adding an additional column or row of ones, respectively, as first time step u(1) and replacing missing values by zero in any case. Invalid grid points, zeros and ones are marked as X, O and 1, respectively. 12 Figure 11: Preprocessing of an exemplary two-dimensional input sample for feeding samples as equal-sized pieces of size 5 into our ESN models. Only valid grid points are transformed into a one-dimensional vector and randomly permuted. Need to add two zeros at the trailing edge before splitting. First time step's inputs consist of ones. Invalid grid points, zeros and ones are marked as X, O and 1, respectively. a one-dimensional vector, randomly permuted and split. The size or the number of grid points per piece needs to be specified. The number of valid grid points needs to be dividable by the piece size. Therefore, we optionally add zeros on the trailing edge to allow splitting into equal-sized pieces. Again, this doesn't affect mean relevance maps, since zero relevance is attributed to these grid points. For showing resulting mean relevance maps, additional grid points are discarded. Preprocessing is demonstrated in Figure 11 for an exemplary sample consisting of 5 rows and 6 columns. Desired piece size is 5 in this example. 13
http://arxiv.org/abs/2302.12305v1
2023-02-23T20:01:46
2023-02-23T20:01:46
Coded Matrix Computations for D2D-enabled Linearized Federated Learning
Federated learning (FL) is a popular technique for training a global model on data distributed across client devices. Like other distributed training techniques, FL is susceptible to straggler (slower or failed) clients. Recent work has proposed to address this through device-to-device (D2D) offloading, which introduces privacy concerns. In this paper, we propose a novel straggler-optimal approach for coded matrix computations which can significantly reduce the communication delay and privacy issues introduced from D2D data transmissions in FL. Moreover, our proposed approach leads to a considerable improvement of the local computation speed when the generated data matrix is sparse. Numerical evaluations confirm the superiority of our proposed method over baseline approaches.
[ "Anindya Bijoy Das", "Aditya Ramamoorthy", "David J. Love", "Christopher G. Brinton" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12305v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12305v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.IT", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.IT", "cs.LG", "math.IT" ]
3 2 0 2 b e F 3 2 ] T I . s c [ 1 v 5 0 3 2 1 . 2 0 3 2 : v i X r a CODED MATRIX COMPUTATIONS FOR D2D-ENABLED LINEARIZED FEDERATED LEARNING Anindya Bijoy Das† Aditya Ramamoorthy⋆ David J. Love† Christopher G. Brinton† †School of Electrical and Computer Engineering, Purdue University, West Lafayette, IN 47907 USA ⋆Department of Electrical and Computer Engineering, Iowa State University, Ames, IA 50010 USA ABSTRACT Federated learning (FL) is a popular technique for training a global model on data distributed across client devices. Like other distributed training techniques, FL is susceptible to straggler (slower or failed) clients. Recent work has proposed to address this through device-to-device (D2D) offloading, which introduces privacy concerns. In this paper, we propose a novel straggler-optimal approach for coded matrix computa- tions which can significantly reduce the communication delay and privacy issues introduced from D2D data transmissions in FL. Moreover, our proposed approach leads to a considerable improvement of the local computation speed when the gener- ated data matrix is sparse. Numerical evaluations confirm the superiority of our proposed method over baseline approaches. Index Terms- Distributed Computing, Federated Learn- ing, Stragglers, Heterogeneous Edge Computing, Privacy. 1. INTRODUCTION Contemporary computing platforms are hard-pressed to sup- port the growing demands for AI/ML model training at the network edge. While advances in hardware serve as part of the solution, the increasing complexity of data tasks and vol- umes of data will continue impeding scalability. In this re- gard, federated learning (FL) has become a popular technique for training machine learning models in a distributed man- ner [1–3]. In FL, the edge devices carry out the local com- putations, and the server collects, aggregates and updates the global model. Recent approaches have looked at linearizing the training operations in FL [1, 4]. This is advantageous as it opens the possibility for coded matrix computing techniques that can improve operating efficiency. Specifically, in distributed set- tings like FL, the overall job execution time is often domi- nated by slower (or failed) worker nodes, which are referred to as stragglers. Recently, a number of coding theory tech- niques [5–14] have been proposed to mitigate stragglers in distributed matrix multiplications. A toy example [5] of such a technique for computing AT x across three clients is to par- tition A as A = [A0 | A1], and to assign them the job of 1 x and (A0 + A1)T x, respectively. In a computing AT linearized FL setting, A ∈ Rt×r is the data matrix and x ∈ Rt 0 x, AT is the model parameter vector. While each client has half of the total computational load, the server can recover AT x if any two clients return their results, i.e., the system is resilient to one straggler. If each of n clients computes 1/kA fraction of the whole job of computing AT x, the number of strag- glers that the system can be resilient to is upper bounded by n − kA [7]. In contemporary edge computing systems, task offloading via device-to-device (D2D) communications has also been proposed for straggler mitigation. D2D-enabled FL has re- cently been studied [2, 15, 16], but can add considerable com- munication overhead as well as compromise data privacy. In this work, we exploit matrix coding in linearized FL to mit- igate these challenges. Our straggler-optimal matrix compu- tation scheme reduces the communication delay significantly compared to the techniques in [7, 9, 12]. Moreover, unlike [7, 9, 12, 13, 17], our scheme allows a client to access a lim- ited fraction of matrix A, and provides a considerable protec- tion against information leakage. In addition, our scheme is specifically suited to sparse matrices with a significant gain in computation speed. 2. NETWORK AND LEARNING ARCHITECTURE We consider a D2D-enabled FL architecture consisting of n = kA + s clients, denoted as Wi for i = 0, 1, . . . , n − 1. The first kA of them are active clients (responsible for both data generation and local computation) and the next s < kA are passive clients (responsible for local computation only). Assume that the i-th device has local data (Di, yi), where Di and yi are the block-rows of full system dataset (D, y). Under a linear regression-based ML model, the global loss function is quadratic, i.e., f (βl) = ||Dβl − y||2, where the model parameter after iteration l is obtained through gradient methods as βl = βl−1 − μl∇βf (βl−1) and μl is the step- size. Based on the form of ∇βf (βl), the FL local model up- date at each device includes multiplying the local data matrix Di with parameter βl. For this reason, recent work has also investigated linearizing non-linear models for FL by lever- aging kernel embedding techniques [1]. Thus, our aim is to compute AT x – an arbitrary matrix operation during FL training – in a distributed fashion such that the system is re- Algorithm 1: Proposed scheme for distributed matrix-vector multiplication Input :Matrix Ai generated in active client i for i = 0, 1, . . . , kA − 1, vector x, total n clients including s < kA passive clients. 1 Set weight ωA = s + 1 ; 2 Denote client i as Wi, for i = 0, 1, . . . , n − 1; 3 for i ← 0 to kA − 1 do 4 Define Ti = {i + 1, . . . , i + ωA − 1} (mod kA); Send Aj, where j ∈ Ti, from Wj to Wi; Client Wi creates a random vector r of length kA, computes ̃Ai = Pq∈Ti rqAq and ̃AT i x; 5 6 7 end 8 for i ← 0 to s − 1 do 9 Wi creates random vector ̃r of size kA, computes ̃AkA+i = Pq∈Ti ̃rqAq and sends to WkA+i; Client WkA+i computes ̃AT kA+ix; 10 11 end Output :The server recovers AT x from the returned results by the fastest kA clients. silient to s stragglers. Our assumption is that any active client Wi generates a block-column of matrix A, denoted as Ai, i = 0, 1, . . . , kA − 1, such that A = (cid:2)A0 A1 . . . AkA−1(cid:3) . (1) In our approach, every client is responsible to compute the product of a coded submatrix (linear combinations of some block-columns of A) and the vector x. Stragglers will arise in practice from computing speed variations or failures expe- rienced by the clients at particular times [8,17,18]. Now, simi- lar to [15,16,19], we assume that there is a set of trusted neigh- bor clients for every device to transmit its data via D2D com- munications. The passive clients receive coded submatrices only from active clients. Unlike the approaches in [1, 3, 4, 20], we assume that the server cannot access to any uncoded/coded local data generated in the edge devices and is only responsi- ble for transmission of vector x and for decoding AT x once the fastest clients return the computed submatrix-vector prod- ucts. 3. HOMOGENEOUS EDGE COMPUTING Here we assume that each active client generates equal num- ber of columns of A (i.e. all Ai's have the same size in (1)) and all the clients are rated with the same computation speed. In this scenario, we propose a distributed matrix-vector mul- tiplication scheme in Alg. 1 which is resilient to any s strag- glers. The main idea is that any active client Wj generates Aj , for 0 ≤ j ≤ kA − 1 and sends it to another active client Wi, if j = i + 1, i + 2, . . . , i + ωA − 1 ( modulo kA). Here we set ωA = s + 1, thus, any data matrix Aj needs to be sent to only ωA − 1 = s other clients. Then, active client Wj computes a linear combination of Ai, Ai+1, . . . , Ai+ωA−1 (indices mod- ulo kA) where the coefficients are chosen randomly from a continuous distribution. Next, active client Wi sends another random linear combination of the same submatrices to Wi+kA (a passive client), when i = 0, 1, . . . , s − 1. Note that all n clients receive the vector x from the server. Now the job of each client is to compute the product of their respective coded submatrix and the vector x. Once the fastest kA clients finish and send their computation results to the server, it decodes AT x using the corresponding random coefficients. The fol- lowing theorem establishes the resiliency of Alg. 1 to strag- glers. Theorem 1. Assume that a system has n clients including kA active and s passive clients. If we assign the jobs according to Alg. 1, we achieve resilience to any s = n − kA stragglers. Proof. In order to recover AT x, according to (1), we need to decode all kA vector unknowns, AT kA−1x; we denote the set of these unknowns as B. Now we choose an arbitrary set of kA clients each of which corresponds to an equation in terms of ωA of those kA unknowns. Denoting the set of kA equations as C, we have |B| = |C| = kA. 1 x, . . . , AT 0 x, AT Now we consider a bipartite graph G = C ∪ B, where any vertex (equation) in C is connected to some vertices (un- knowns) in B which have participated in the corresponding equation. Thus, each vertex in C has a neighborhood of cardi- nality ωA in B. Our goal is to show that there exists a perfect matching among the vertices of C and B. We argue this ac- cording to Hall's marriage theorem [21] for which we need to show that for any ̄C ⊆ C, the cardinality of the neighbourhood of ̄C, denoted as N ( ̄C) ⊆ B, is at least as large as | ̄C|. Thus, for | ̄C| = m ≤ kA, we need to show that |N ( ̄C)| ≥ m. Case 1: First we consider the case that m ≤ 2s. We assume that m = 2p, 2p − 1 where 1 ≤ p ≤ s. Now ac- cording to Alg. 1, the participating unknowns are shifted in a cyclic manner among the equations. If we choose any δ clients out of the first kA clients (W0, W1, W2, . . . , WkA−1), according to the proof of cyclic scheme in Appendix C in [8], the minimum number of total participating unknowns is min(ωA + δ − 1, kA), where ωA = s + 1. Now according to Alg. 1, same unknowns participate in two different equations corresponding to two different clients, Wj and WkA+j, where j = 0, 1, . . . , s− 1. Thus, for any | ̄C| = m = 2p, 2p− 1 ≤ 2s, we have |N ( ̄C)| ≥ min (ωA + ⌈m/2⌉ − 1, kA) = min (ωA + p − 1, kA) = min (s + p, kA) ≥ m. Case 2: Now we consider the case where m = 2s + q, 1 ≤ q ≤ kA − 2s. We need to find the minimum number of unknowns which participate in any set of m equations. Now, the same unknowns participate in two different equations cor- responding to two different clients, Wj and WkA+j, where j = 0, 1, . . . , s − 1. Thus, the additional q equations corre- spond to at least q additional unknowns until the total number of participating unknowns is kA. Therefore, in this case W 0 A0 W 1 A1 W 2 A2 . . . . . . . . . W 8 A8 W 9 A9 assigns linear combinations of limited number of submatrices which preserve the sparsity up to certain level that leads to faster computation. (a): Data generation among the active clients. 4. HETEROGENEOUS EDGE COMPUTING W 0 W 9 W 10 W 11 . . . . . . . . . {A0, A1, A2} {A9, A0, A1} {A0, A1, A2} {A1, A2, A3} (b): Coded submatrix allocation among all the clients. Fig. 1: (a) Data generation and (b) submatrix allocation for n = 12 clients according to Alg. 1 including kA = 10 active and s = 2 pas- sive clients. Any {Aj, Ak, Al} indicates a random linear combina- tion of the corresponding submatrices. Any Wi obtains a random lin- ear combination of Ai, Ai+1 and Ai+2 (indices reduced mod 10). |N ( ̄C)| ≥ min (ωA + ⌈2s/2⌉ + q − 1, kA) = min (ωA + s + q − 1, kA) = min (2s + q, kA) ≥ m. Thus, for any m ≤ kA (where | ̄C| = m), we have shown that |N ( ̄C)| ≥ | ̄C|. So, there exists a perfect matching among the vertices of C and B according to Hall's marriage theorem. Now we consider the largest matching where vertex ci ∈ C is matched to vertex bj ∈ B, which indicates that bj partic- ipates in the equation corresponding to ci. Let us consider a kA × kA system matrix where row i corresponds to the equation associated to ci. Now we replace this row i by ej which is a unit row-vector of length kA with j-th entry being 1, and 0 otherwise. Thus we have a kA × kA matrix where each row has only one non-zero entry which is 1. Since we have a perfect matching, this kA × kA matrix has only one non-zero entry in every column. This is a permutation of the identity matrix, and thus, is full rank. Since the matrix is full rank for a choice of definite values, according to Schwartz- Zippel lemma [22], it will be full rank for random choices of non-zero entries. Thus, the server can recover all kA un- knowns from any kA clients, hence the system is resilient to (cid:4) any s = n − kA stragglers. Example 1. Consider a homogeneous system of kA = 10 ac- tive clients and s = 2 passive clients. According to Alg. 1, ωA = s+1 = 3, and client Wi (0 ≤ i ≤ 11) has a random lin- ear combination of Ai, Ai+1 and Ai+2 (indices modulo 10) as shown in Fig. 1. Thus, according to Theorem 1, this sys- tem is resilient to s = 2 stragglers. Note that our scheme requires any active client to send its local data matrix to only up to s + 1 = 3 other clients, thus involves a significantly lower communication cost in comparison to the approaches in [7, 9]. Remark 1. In comparison to [7,9,13], our proposed approach is specifically suited to sparse data matrices, i.e., most of the entries of A are zero. The approaches in [7, 9, 13] assign dense linear combinations of the submatrices which can de- stroy the inherent sparsity of A, leading to slower computa- tion speed for the clients. On the other hand, our approach In this section, we extend our approach in Alg. 1 to heteroge- nous system where the clients may have different data gen- eration capability and different computation speeds. We as- sume that we have λ different types of devices in the system, with client type j = 0, 1, . . . , λ − 1. Moreover, we assume that any active client Wi generates αi = cijα columns of data matrix A and any client Wi has a computation speed βi = cij β, where Wi is of client type j and cij ≥ 1 is an integer. Thus, a higher cij indicates a "stronger" type client Wi which can process at a cij times higher computation speed than the "weakest" type device, where α is the number of the assigned columns and β is the number of processed columns per unit time in the "weakest" type device. Note that λ = 1 and all cij = 1 lead us to the homogeneous system discussed in Sec. 3 where 0 ≤ i ≤ n − 1 and j = 0. Now, we have n = kA + s clients including kA active and s passive clients in the heterogeneous system. Aligned to the homogeneous system, we assume that the number of passive clients of any type j is less than the number of active clients of the same type. Next, without loss of generality, we sort the indices of active clients in such a way so that, cij ≥ ckj if i ≤ k, for 0 ≤ i, k ≤ kA − 1. We do the similar sorting for the passive clients too so that cij ≥ ckj if i ≤ k, for kA ≤ i, k ≤ n − 1. Now if a client Wi is of client type j, it requires the same time to process cij ≥ 1 block-columns (each consisting of α columns) of A as the "weakest" device to process cij = 1 such block-column. Moreover, if it is an active client, it also generates αi = cij α columns of data matrix A. Thus, client Wi can be thought as a collection of cij homogeneous clients of "weakest" types where each of the active "weakest" clients generates equally α columns of A and each of the "weakest" clients processes equally α columns. Theorem 2. (a) A heterogeneous system of kA active and s passive clients of different types can be considered as a homogeneous system of ̄kA = P cij active and ̄s = n−1 i=kA cij passive clients of the "weakest" type. Next (b) P if the jobs are assigned according to Alg. 1 in the modified homogeneous system of ̄n = ̄kA + ̄s "weakest" clients, the system can be resilient to ̄s such clients. kA−1 i=0 Proof. Each Ak (generated in Wk) in (1) is a block-column consisting of ckj α columns of A when client Wk is of client type j. Thus, for any k = 0, 1, . . . , kA − 1, we can parti- ̄Am+ckj −1(cid:3), where tion Ak as Ak = (cid:2) ̄Am ̄Am+1 k−1 i=0 cij and each ̄Al is a block-column consisting m = P of α columns of A, m ≤ l ≤ m + ckj − 1. Thus using . . . A ̄kA−1(cid:3), where (1), we can write A = (cid:2)A0 A1 . . . W 0 ̄A0 ̄A1 W 1 ̄A2 ̄A3 W 2 ̄A4 W 3 ̄A5 W 4 ̄A6 (a): Data generation among the active clients. W 0 W 1 W 2 W 3 { ̄A0, ̄A1, ̄A2} { ̄A2, ̄A3, ̄A4} { ̄A1, ̄A2, ̄A3} { ̄A3, ̄A4, ̄A5} { ̄A4, ̄A5, ̄A6} { ̄A5, ̄A6, ̄A0} W 4 W 5 W 6 { ̄A6, ̄A0, ̄A1} { ̄A0, ̄A1, ̄A2} { ̄A1, ̄A2, ̄A3} (b): Coded submatrix allocation among all the clients. Fig. 2: A heterogeneous system of n = 7 clients where kA = 5 and s = 2. (a) Each of W0 and W1 generates 2α columns and each of W2, W3 and W4 generates α columns of A ∈ Rt×r, where α = r/7. (b) Once the jobs are assigned, the system is resilient to stragglers. kA−1 i=0 ̄kA = P cij . Now from the matrix generation perspec- tive, kA active clients in a heterogeneous system generating ̄kA block-columns can be considered as the same as ̄kA ac- tive clients in a homogeneous system generating one block- column each. Similarly, any client Wi of type j can process cij α columns in the same time when the "weakest" type device can process α columns. Thus, from the computation speed perspective, kA active clients and s passive clients in the het- erogeneous system can be thought as ̄kA = P cij active n−1 cij passive clients, respectively, in a clients and ̄s = P i=kA homogeneous system by assigning α coded block-columns to each client. Hence, we are done with the proof of part (a). Moreover, part (b) of the proof is straight-forward from Theorem 1 when we have ̄kA active and ̄s passive clients. (cid:4) kA−1 i=0 Remark 2. The heterogeneous system is resilient to ̄s block- column processing. The number of straggler clients that the system is resilient to can vary depending on the client types. Example 2. Consider the example in Fig. 2 consisting of n = 7 clients. There are kA = 5 active clients which are responsi- ble for data matrix generation. Let us assume, W0 and W1 are of type 1 clients which generate twice as many columns of A than W2, W3 and W4 which are of type 0 clients. The jobs are assigned to all clients (including s = 2 passive clients) according to Fig. 2(b). It can be verified that this scheme is resilient to two type 0 clients or one type 1 client. 5. NUMERICAL EVALUATION In this section, we compare the performance of our proposed approach against different competing methods [7, 9, 13] in Table 1: Comparison among different approaches in terms of com- munication delay for a system with n = 20, kA = 18 and s = 2. PROP. SCH. 2.21 s POLY CODE [7] ORTHO- POLY [9] RKRP CODE [13] CONV. CODE [17] 2.56 s 14.13 s 14.02 s 2.49 s terms of different metrics for distributed matrix computations from the federated learning aspect. Note that the approaches in [1, 4] require the edge devices to transmit some coded columns of matrix A to the server which is not aligned with our assumptions. In addition, the approaches in [8] and [11] do not follow the same network learning architecture as ours. Therefore, we did not include them in our comparison. Communication Delay: We consider a homogeneous system of n = 20 clients each of which is a t2.small ma- chine in AWS (Amazon Web Services) Cluster. Here, each of kA = 18 active clients generates Ai of size 12000 × 1000, thus the size of A is 12000 × 18000. The server sends the parameter vector x of length 12000 to all 20 clients including s = 2 passive clients. Once the preprocessing and computa- tions are carried out according to Alg. 1, the server recovers AT x as soon as it receives results from the fastest kA = 18 clients, thus the system is resilient to any s = 2 stragglers. Table 1 shows the comparison of the corresponding com- munication delays (caused by data matrix transmission) among different approaches. The approaches in [7, 9] re- quire all active clients to transmit their generated submatrices to all other edge devices. Thus, they lead to much more com- munication delay than our proposed method which needs an edge device to transmit data to only up to s + 1 = 3 other devices. Note that the methods in [13, 17] involve similar amounts of communication delay as ours, however, they have other limitations in terms of privacy and computation time as discussed next. Privacy: Information leakage is introduced in FL when we consider the transmission of local data matrices to other edge devices. To protect against privacy leakage, any particu- lar client should have access to a limited portion of the whole data matrix. Consider the heterogeneous system in example 2 where the clients are honest but curious. In this scenario, the approaches in [7, 9, 13, 17] would allow clients to access the whole matrix A. In our approach, as shown in Fig. 2, clients W0 and W1 only have access to 4/7-th fraction of A and clients W2, W3 and W4 have access to 3/7-th fraction of A. This provides significant protection against privacy leak- age. Product Computation Time for Sparse Matrices: Con- sider a system with n = 30 clients where kA = 28 and s = 2. We assume that A is sparse, where each active client generates a sparse submatrix of size 40000 × 1125. We con- sider three different scenarios with three different sparsity lev- els for A where randomly chosen 95%, 98% and 99% en- tries of A are zero. Now we compare our proposed Alg. 1 Table 2: Per client product computation time where n = 30, kA = 28, s = 2 and ζ = 95%, 98% or 99% entries of A are zero. 6. REFERENCES METHODS POLY CODE [7] ORTHO-POLY [9] RKRP CODE [13] CONV. CODE [17] PROP. SCHEME PRODUCT COMP. TIME (IN MS) ζ = 99% ζ = 98% ζ = 95% 55.2 54.8 53.4 55.8 21.1 54.7 54.3 55.1 56.2 14.9 53.7 55.2 53.7 56.8 29.6 against different methods in terms of per client product com- putation time (the required time for a client to compute its assigned submatrix-vector product) in Table 2. The methods in [7, 9, 13, 17] assign linear combinations of kA = 28 sub- matrices to the clients. Hence, the inherent sparsity of A is destroyed in the encoded submatrices. On the other hand, our approach combines only s + 1 = 3 submatrices to obtain the coded submatrices. Thus, the clients require a significantly less amount of time to finish the respective tasks in compari- son to [7, 9, 13, 17]. [1] Saurav Prakash, Sagar Dhakal, Mustafa Riza Akdeniz, Yair Yona, Shilpa Talwar, Salman Avestimehr, and Nageen Himayat, "Coded computing for low-latency federated learning over wireless edge networks," IEEE Jour. on Sel. Areas in Comm., vol. 39, no. 1, pp. 233– 250, 2020. [2] Su Wang, Seyyedali Hosseinalipour, Maria Gorlatova, Christopher G Brinton, and Mung Chiang, "Uav- assisted online machine learning over multi-tiered net- works: A hierarchical nested personalized federated IEEE Trans. on Net. and Serv. learning approach," Manag., 2022. [3] Jer Shyuan Ng, Wei Yang Bryan Lim, Zehui Xiong, Xi- anbin Cao, Dusit Niyato, Cyril Leung, and Dong In Kim, "A hierarchical incentive design toward motivating par- ticipation in coded federated learning," IEEE J. Sel. Ar- eas Commun., vol. 40, no. 1, pp. 359–375, 2022. [4] Sagar Dhakal, Saurav Prakash, Yair Yona, Shilpa Tal- war, and Nageen Himayat, "Coded federated learning," in IEEE Globecom Workshop, 2019, pp. 1–6. [5] Kangwook Lee, Maximilian Lam, Ramtin Pedarsani, Dimitris Papailiopoulos, and Kannan Ramchandran, "Speeding up distributed machine learning using codes," IEEE Trans. on Info. Th., vol. 64, no. 3, pp. 1514–1529, 2018. [6] Sanghamitra Dutta, Viveck Cadambe, and Pulkit Grover, "Short-dot: Computing large linear transforms distribut- edly using coded short dot products," in Proc. of Adv. in Neur. Inf. Proc. Syst., 2016, pp. 2100–2108. [7] Qian Yu, Mohammad Maddah-Ali, and Salman Aves- timehr, "Polynomial codes: an optimal design for high- dimensional coded matrix multiplication," in Proc. of Adv. in Neur. Inf. Proc. Syst., 2017, pp. 4403–4413. [8] Anindya Bijoy Das and Aditya Ramamoorthy, "Coded sparse matrix computation schemes that leverage partial stragglers," IEEE Trans. on Info. Th., vol. 68, no. 6, pp. 4156–4181, 2022. [9] M. Fahim and V. R. Cadambe, "Numerically stable poly- nomially coded computing," IEEE Trans. on Info. Th., vol. 67, no. 5, pp. 2758–2785, 2021. [10] Rashish Tandon, Qi Lei, Alexandros G Dimakis, and Nikos Karampatziakis, "Gradient coding: Avoiding stragglers in distributed learning," in Proc. of Intl. Conf. on Mach. Learn., 2017, pp. 3368–3376. [11] Anindya Bijoy Das and Aditya Ramamoorthy, "A uni- fied treatment of partial stragglers and sparse matrices in coded matrix computation," IEEE Jour. on Sel. Area. in Info. Th., vol. 3, no. 2, pp. 241–256, 2022. [12] Sanghamitra Dutta, Mohammad Fahim, Farzin Had- dadpour, Haewon Jeong, Viveck Cadambe, and Pulkit Grover, "On the optimal recovery threshold of coded matrix multiplication," IEEE Trans. on Info. Th., vol. 66, no. 1, pp. 278–301, 2020. [13] A. M. Subramaniam, A. Heidarzadeh, and K. R. Narayanan, "Random Khatri-Rao-product codes for numerically-stable distributed matrix multiplication," in Proc. of Annual Conf. on Comm., Control, and Comput- ing (Allerton), Sep. 2019, pp. 253–259. [14] Lev Tauz and Lara Dolecek, "Variable coded batch ma- trix multiplication," IEEE Jour. on Sel. Area. in Info. Th., vol. 3, no. 2, pp. 306–320, 2022. [15] Su Wang, Mengyuan Lee, Seyyedali Hosseinalipour, Roberto Morabito, Mung Chiang, and Christopher G Brinton, "Device sampling for heterogeneous federated learning: Theory, algorithms, and implementation," in Proc. of Intl. Conf. on Comp. Comm., 2021, pp. 1–10. [16] Yuwei Tu, Yichen Ruan, Satyavrat Wagle, Christo- pher G Brinton, and Carlee Joe-Wong, "Network-aware optimization of distributed learning for fog computing," in Proc. of Intl. Conf. on Comp. Comm., 2020, pp. 2509– 2518. [17] Anindya Bijoy Das, Aditya Ramamoorthy, and Namrata Vaswani, "Efficient and robust distributed matrix com- putations via convolutional coding," IEEE Trans. on Info. Th., vol. 67, no. 9, pp. 6266–6282, 2021. [18] Seyyedali Hosseinalipour, Christopher G Brinton, Va- neet Aggarwal, Huaiyu Dai, and Mung Chiang, "From federated to fog learning: Distributed machine learning over heterogeneous wireless networks," IEEE Comm. Mag., vol. 58, no. 12, pp. 41–47, 2020. [19] Satyavrat Wagle, Seyyedali Hosseinalipour, Naji Khos- ravan, Mung Chiang, and Christopher G Brinton, "Em- bedding alignment for unsupervised federated learning via smart data exchange," in Proc. of IEEE Glob. Comm. Conf. IEEE, 2022, pp. 1–6. [20] Naoya Yoshida, Takayuki Nishio, Masahiro Morikura, Koji Yamamoto, and Ryo Yonetani, "Hybrid-fl for wire- less networks: Cooperative learning mechanism using non-iid data," in Proc. of IEEE Intl. Conf. Comm. IEEE, 2020, pp. 1–7. [21] JR Marshall. Hall, Combinatorial theory, Wiley, 1986. [22] Jacob T Schwartz, "Fast probabilistic algorithms for verification of polynomial identities," Jour. of the ACM (JACM), vol. 27, no. 4, pp. 701–717, 1980.
http://arxiv.org/abs/2302.12304v2
2023-02-27T02:49:51
2023-02-23T19:59:24
Uncertainty Injection: A Deep Learning Method for Robust Optimization
This paper proposes a paradigm of uncertainty injection for training deep learning model to solve robust optimization problems. The majority of existing studies on deep learning focus on the model learning capability, while assuming the quality and accuracy of the inputs data can be guaranteed. However, in realistic applications of deep learning for solving optimization problems, the accuracy of inputs, which are the problem parameters in this case, plays a large role. This is because, in many situations, it is often costly or sometime impossible to obtain the problem parameters accurately, and correspondingly, it is highly desirable to develop learning algorithms that can account for the uncertainties in the input and produce solutions that are robust against these uncertainties. This paper presents a novel uncertainty injection scheme for training machine learning models that are capable of implicitly accounting for the uncertainties and producing statistically robust solutions. We further identify the wireless communications as an application field where uncertainties are prevalent in problem parameters such as the channel coefficients. We show the effectiveness of the proposed training scheme in two applications: the robust power loading for multiuser multiple-input-multiple-output (MIMO) downlink transmissions; and the robust power control for device-to-device (D2D) networks.
[ "Wei Cui", "Wei Yu" ]
10.1109/TWC.2023.3249103
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1109/TWC.2023.3249103", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.12304v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12304v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.NI", "eess.SP", "stat.ML" ]
Uncertainty Injection: A Deep Learning Method for Robust Optimization Wei Cui, Graduate Student Member, IEEE, and Wei Yu, Fellow, IEEE 1 3 2 0 2 b e F 7 2 ] G L . s c [ 2 v 4 0 3 2 1 . 2 0 3 2 : v i X r a in many situations, Abstract-This paper proposes a paradigm of uncertainty injection for training deep learning model to solve robust op- timization problems. The majority of existing studies on deep learning focus on the model learning capability, while assuming the quality and accuracy of the inputs data can be guaranteed. However, in realistic applications of deep learning for solving optimization problems, the accuracy of inputs, which are the problem parameters in this case, plays a large role. This is because, it is often costly or sometime impossible to obtain the problem parameters accurately, and cor- respondingly, it is highly desirable to develop learning algorithms that can account for the uncertainties in the input and produce solutions that are robust against these uncertainties. This paper presents a novel uncertainty injection scheme for training machine learning models that are capable of implicitly accounting for the uncertainties and producing statistically robust solutions. We further identify the wireless communications as an application field where uncertainties are prevalent in problem parameters such as the channel coefficients. We show the effectiveness of the proposed training scheme in two applications: the robust power loading for multiuser multiple-input-multiple-output (MIMO) downlink transmissions; and the robust power control for device- to-device (D2D) networks. Index Terms-Robust optimization, deep learning, wire- less communications, power control, multiuser multiple-input multiple-output (MIMO), device-to-device network I. INTRODUCTION D EEP learning has achieved excellent results in a variety of different optimization tasks, such as the inference problems [2]–[4] and the generative modeling problems [5]– [7]. Although the traditional domain of deep learning has been for applications in which the optimization problems do not admit explicit mathematical models, several recent advances have also shown the promise of deep learning in solving non- convex optimization problems for which explicit mathematical formulations are available, e.g., [8]–[10]. This paper focuses on this latter class of problems in which a deep learning model is trained to take the parameters of the mathematical optimization problem as the input and to output the optimized solution of the problem. Specifically, we focus on how to train the model to achieve robustness against uncertainty in the problem parameters. While most of the deep learning literature focuses on the learning performance of the neural network on a given dataset Manuscript submitted on March 5th, 2022. The materials in this pa- per have been presented in part at the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), Barcelona, Spain, May 2020 [1]. This work was supported by Natural Sciences and Engineering Research Council (NSERC) of Canada. The authors are with The Edward S. Rogers Sr. Department of Electrical and Computer Engineering, Uni- versity of Toronto, Toronto, ON M5S 3G4, Canada (e-mails: {cuiwei2, weiyu}@ece.utoronto.ca). where the availability of high-quality input data is assumed, in many realistic applications, the uncertainties are inevitably part of the input (or the label data). When uncertainties are present, the performance of a solution under the uncertain input realizations is often of importance, and this is commonly referred to as the robustness of the solution [11], [12]. Specifically, several research directions on the robustness of deep learning have been investigated in the literature. In [13]– [16], the performances of supervised learning when trained with uncertainty in the targets are investigated. Meanwhile, the robustness of deep learning models on data distribution changes has also been explored, often referred to as distribu- tional robustness, as in [17]–[20]. In [21]–[24], the input clean- ing procedure is utilized for deep learning models given ini- tially noisy inputs. Besides the above-mentioned approaches, researchers have also explored training deep learning models with noise actively added at the inputs [25]–[29], into the neural network parameters [30], into the activation functions [31], [32], and into the gradients [33], [34]. These classes of techniques have been shown to improve the robustness of the deep learning models against small perturbations or adversarial attacks in testing inputs, and to encourage the models to produce better generalization results. Despite the large number of robust deep learning research works as mentioned above, most of them deal with problems for which explicit mathematical models do not exist, and none specifically target towards solving mathematical non- convex robust optimization problems. For example, although elaborated non-convex optimization techniques and analysis have been used for obtaining robust deep learning models in works such as [12], [27], they are not designed to obtain deep learning models specifically to take the uncertain problem parameters as the input and to produce robust solutions to a mathematical non-convex optimization problem as the output. Robust optimization has been extensively studied in the traditional mathematical programming literature. For example, in the area of wireless communication network utility maxi- mization, the optimization of network operations typically in- volves first obtaining wireless network parameters such as the channel state information (CSI), then formulating a network utility objective as a function of these network parameters, and finally optimizing the objective function assuming these fixed parameters [35]–[42]. This deterministic optimization framework may not always produce the best solution in realistic situations, because it inherently ignores the channel uncertainties, which can significantly affect the quality of the solutions. On the other hand, researchers have explored mathematical robust optimization techniques that incorporate these uncertainties. The classical approaches for dealing with wireless channel uncertainty within the optimization process either assume bounded uncertainty regions [43]–[46], or in- corporate statistical models of channel uncertainty [47]–[54]. Although fitting reality better than deterministic optimization, these robust optimization approaches rely on the mathematical models of the uncertainty in the parameters, which are often ad-hoc. Further, the parameters of these models are not easy to estimate. Finally, even if the model and its parameters are known exactly, the resulting optimization problem is often difficult to solve. We note that there has been several work on using deep learning for obtaining robust solutions to wireless communication problems [55]–[57], however these work only focus on the expectation of the achievable rates under channel uncertainty and do not fully capture the notion of robustness from statistical distribution point of view. This paper proposes a novel deep neural network training strategy for maximizing a statistical robustness measure for non-convex utility optimization problems, addressing gaps in both deep learning and wireless communication research. We advocate statistical uncertainty models rather than bounded- region uncertainty models due to the fact that realistic un- certainties are generally not guaranteed to be bounded. But instead of relying on the mathematical representations of the statistical distribution of the uncertainties, we pursue a data- driven approach to robust optimization, because it is usually much more practical to obtain samples of the uncertainty realizations rather their mathematical representations. The key innovation of this paper is that we take full advan- tage of the fact that we are solving an explicitly formulated mathematical programming problem by feeding an estimate of the problem parameters as input, then obtaining the optimized solution as the output of the neural network. In this case, the optimized solution at the output can be further evaluated under the parameter uncertainties. This allows us to propose a novel training strategy for deep learning of directly injecting the parameter uncertainty samples after the output layer of the neural network to obtain the robust objective, then optimizing the neural network weights using the gradients computed from the robust objective. Because neural networks are uni- versal and highly flexible function approximators, a neural network trained under these parameter uncertainty samples can implicitly infer the uncertainty distribution, thus producing optimized solutions that are robust against the uncertainties in the problem parameters. To illustrate the effectiveness of the proposed training scheme, we focus on two wireless network optimization prob- lems under the robust minimum-rate maximization objective: power loading for the multiuser multiple-input-multiple-output (MIMO) downlink channel, and power control for wireless device-to-device (D2D) networks. The sources of parameter uncertainties are channel estimation error and the fading in wireless channels. Under the statistical uncertainty model, similar to that of [47], [48], we adopt an outage-based notion of robustness in the optimization formulation. The minimum- rate is adopted as the objective for both problems due to its emphasis on the fairness among the transmission links. We show in this paper that uncertainty injection at the output can significantly improve the robustness of the power allocation. 2 To summarize, the main contributions of the paper are as follows: • • • • We recognize the difficulties in the state-of-the-art robust optimization studies in terms of the uncertainty modeling and algorithmic complexity. We advocate a sample-based parameter uncertainty char- acterization for greater generalization ability, higher ex- pressive power, and simplicity. We propose a novel deep learning based robust opti- mization scheme by uncertainty injection at the neural network's output layer, through which the neural network can be trained to perform robust optimization using only samples of the parameter uncertainties. We illustrate the effectiveness of the proposed approach for two important wireless communication applications: robust power loading in MIMO downlink networks, and robust power control in D2D networks. The rest of this paper is organized as follows. Sections II and III formulate the general robust optimization framework with deep learning, along with two wireless network optimization problem settings. Section IV proposes a novel sample-based uncertainty-injection training scheme for deep learning to produce statistically robust solutions. The application of the proposed method to wireless communications is described in Section V and its performance is analyzed in Section VI. Finally, conclusions are drawn in Section VII. II. ROBUST OPTIMIZATION FORMULATION We first present the general mathematical formulation of non-convex utility optimization problem, in which the notion of robustness is defined under the statistical distribution of the parameter uncertainties. A. Problem Setup Consider a general optimization problem the following components: , consisting of P • • • • True problem parameters p summarizing all the informa- tion about the environment (but not perfectly known); Measurements q about the problem parameters; Optimization variables x; Scalar utility function up(x) of the optimization problem, as computed at the optimization variables x, assuming that the problem parameters are p. Here, up(x) is as- sumed to be differentiable in x almost everywhere. The goal of robust optimization is to find an optimized x, based on q, that maximizes a robust objective of the utility function under some joint statistical distribution of the problem parameters p and the measurements q. B. Statistical Distribution of Problem Parameters In the existing robust optimization literature, there are two main parameter uncertainty models: 1) The uncertain parameters are confined within some closed sets, with ellipsoids being the most popular choice. The corresponding notion of robust objective is 3 typically the worst-case utility value over the parameters in the uncertainty sets. 2) Parameter uncertainties follow some statistical distri- bution, with well-studied distributions (e.g. exponential family) being the most popular choices due to feasi- bility of the ensuing mathematical optimization. The corresponding robust objective is typically a statistical measure of the resultant utility, e.g., the 5th-percentile outage value. less well The bounded uncertainty model is mathematically more justified in practice. Its associated tractable, but worst-case performance also tends to be over-conservative, since the worst-case scenario may occur only with very low probability. For this reason, this paper adopts the statistical model for the parameter uncertainties. The statistical uncer- tainty model lends well to data-driven approaches in which samples of the uncertain parameters can be generated and the corresponding optimization objective can be estimated empirically under these samples. We note that there are existing works in the literature such as [44], [46] that assume a bounded uncertainty model, while defining the robust objective probabilistically. These works rely on bounding the statistical quantities using often complex and mathematically involved derivations and approximations. The point of this paper is that instead of attempting to approximate these statistical quantities analytically, we use a data-driven approach to evaluate the desired robust objective empirically. Toward this end, we define the following statistical model on the problem parameter p given the measurements of the environment q as follows: D. Data-Driven Approach to Robust Optimization This paper aims to solve the the robust optimization problem (3) above based on the measurements q of the unknown prob- lem parameters p by producing an optimized variable x that maximizes the robust objective under the outage constraint. In this end, this paper proposes to utilize a deep learning approach to map the measurement of the optimization problem parameters to a robust optimized solution. The deep neural net- work is chosen for its computation capacity and representation ability. Using a neural network, the optimization algorithm can be represented as: x = FΘ(q) (4) where Θ is the collection of the neural network model pa- rameters and hyper-parameters. The optimization problem P then translates to finding a set of high-quality neural network parameters Θ. The overall optimization process is shown in Fig. 1. III. ROBUST OPTIMIZATION IN WIRELESS COMMUNICATIONS AND NETWORKING We now present two applications of the above general robust optimization framework in wireless network utility maximization: the robust power loading problem for multiuser MIMO transmissions and the robust power control problem for D2D networks. Wireless network utility optimization problems naturally fit into the robust optimization framework, since the wireless channels (i.e. the problem parameters p) are difficult to measure accurately, and the channel estimation process always produces measurement uncertainties. p q) q(p fp | | ∼ (1) A. Robust Beamforming for Minimum Rate Maximization in Multiuser MIMO Downlink We emphasize that in the proposed data-driven approach, the above uncertainty distributions need not be expressed in analytic closed form. As we shall see later, the proposed method can be applied as long as we can obtain offline samples from the above distribution. C. Robust Objective under Statistical Uncertainty Distribution Given the measurement q and the corresponding distribution of the problem parameters p q), the value of the ∼ utility function up(x) for any given x would also follow some distribution. We define the robust objective of the optimization problem by the percentile value of the resulting distribution of up(x). Specifically, define the γ-th percentile value of the utility as the largest uγ for which q(p fp | | Pr[up(x) uγ | ≤ q] γ%. ≤ can now be formulated as The robust optimization problem P maximize x uγ subject to Pr[up(x) ≤ where the probability is taken under p γ can be interpreted as an outage probability. ≤ q). The value q(p fp | | ∼ uγ q] | γ% (2) (3a) (3b) Consider a MIMO transmission scenario with one base station equipped with M antennas serving K single-antenna users. The base station serves all K users through multiuser MIMO downlink transmission in the same time-frequency K resource block. We use H = [h1, . . . , hk, . . . , hK] ∈ to denote the channel matrix, with its k-th column hk ∈ × denoting the channels from the base station antennas to the k-th user. In practical wireless communication scenarios, H is often not known perfectly. The goal is to design robust downlink beamforming vectors against the uncertainties in H. A diagram illustrating the downlink multiuser MIMO channel is shown in Fig. 2. CM × CM 1 In a dense urban environment, there are often no line-of- sight (LoS) paths from the base station to the users, and the wireless channels in the multiuser MIMO networks can be modeled as a Rayleigh fading channel [58]. To estimate the channel, pilot signals need to be used. For time-division duplex (TDD) systems, uplink pilots from the users to the base station can be used to estimate the uplink channel. Then, based on the uplink-downlink reciprocity, the downlink channel can be inferred. For frequency-division duplex (FDD) systems, downlink pilots from the base station to the users need to be used. In this case, each user estimates its own channel, then feeds back a quantized version of the channels to the 4 Fig. 1. The robust optimization problem for maximizing a γ-percentile outage utility based on a measurement of the problem parameters. can be done based on ˆH only, then rely on the subsequent power allocation to ensure robustness. This design approach can be an effective one due to that it significantly simplifies the overall design process, while still achieving competitive robust performances as shown in [52], [53]. ∈ CM More specifically, based on the estimated channels ˆH, the base station can apply any one of the well-established beam- forming techniques, such as zero-forcing (ZF) or regularized zero-forcing (RZF) [59], to design a fixed set of precoders K for downlink transmission. We use the notation B 1 B = [b1, . . . , bk, . . . , bK], with the k-th column bk ∈ with unit norm base station to transmit information to the k-th user. bk(cid:107)2 = 1 being the beamformer from the (cid:107) The robust optimization variables are now the set of power loading variables x = [0, 1] denotes the proportion of total power the base station should allocate for transmitting to the k-th user for optimizing a network-wide utility up(x). In this paper, we use the minimum rate across all the users as the utility. Note that for given x, the achievable rate for the k-th user is computed as [1...K], where xk ∈ xk}k CM { × × ∈ (cid:32) rk = w log 1 + P (cid:80) j P hH k bk| | hH k bj| =k | 2xk 2xj + σ2 (cid:33) , (6) where P denotes the total power constraint, w denotes the )H bandwidth, σ2 denotes the background noise level, and ( * denotes Hermitian transpose. For any x, the statistical channel uncertainties induce a distribution on the achievable rates of each user, and conse- quentially, a distribution on rmin, the minimum rate among all the users. We can compute the percentile value rγ min of the distribution for rmin as the maximum value for which: Pr[rmin < rγ ˆH] γ%. min| With these notations established, the multiuser MIMO ro- bust beamforming problem is now readily formulated as an in- stance of the robust optimization problem as in Section II-B, with the following correspondence: ≤ P (7) p q up(x) uγ H ˆH rmin rγ min ← ← ← ← Fig. 2. Multiuser MIMO Downlink Channel base station in order to enable the base station to design the downlink beamformers based on the estimated channels from all the users. In either case, the accuracy of the estimated channels ˆH depends on the pilot length, the background noise level, and in the FDD case is also a function of feedback rate. A common way to model the channel estimation error is to assume that for the wireless channel from the j-th base station antenna to the k-th user, the relationship between the real channel coefficient hkj and the estimated channel coefficient ˆhkj can be modeled as the following: hkj = ˆhkj + ekj, ekj ∼ CN (0, σ2 e ) j, k ∀ (5) where the estimation error ekj is independent and identically distributed (i.i.d.) across all the channels. The robust beamforming problem for the multiuser MIMO system is that of designing the beamformers at the base station, along with the power loading for each beamformer, in order to achieve a robust objective. In this paper, we treat the optimization objective of maximizing the minimum rate in order to provide fairness across all the users. Although ideally, one could conceivably design both the beamformers and the power loadings jointly to account for the channel uncertainty, such an approach would have been too challenging due to its analytic complexity. In the existing literature, only the robust optimization for the simpler objective of power minimization has been shown to be possible to solve analytically over both the beamformers and the power allocation variables [49]–[51]. In contrast, this paper adopts a different approach: we fix the beamformers and assume that the design of the beamformers ProblemParameterspp∼fp|qpfp|qMeasurementsqRobustOptimizationAlgorithmFΘ(*)OptimizedSolutionxRobustObjectiveuγup(x)fup(x)|quγBaseStationhkUEk(cid:54) 5 pilot phase of duration at least O(N 2) in order to estimate all of the N 2 channel coefficients. This is often infeasible. In this part of the paper, we explore the possibility of performing power control purely based on the geographic location information of all the transmitters and the receivers. The geographic location information already provides the pathloss component of the overall channel. The idea is to formulate a robust optimization problem, so that a reasonable minimum rate across all the users can still be achieved with high probability, even if the power control is based only on the pathloss information. Another benefit of utilizing geographic location information is that such information can also be readily used for computing the beamformers at the transmitters and the receivers based on the angles of arrival and departure of the intended signal transmission to align the beams of the transmitter and the receiver towards each other in the initial deployment phase. In the ensuing channel model, we use ˆGPL to denote the path-losses of all the channels, including the beamforming gains at both the transmitters and the receivers. In addition, we assume a log-normal shadowing component and a fast- fading component that contribute towards the uncertainties in the channel model. Specifically, we assume a log-normal distribution for the shadowing GS, and a circularly symmetric complex Gaussian distribution for the fast fading coefficients that lead to a fast fading component GF. Then, the overall channel G has its (i, j)-th component distributed as: gij = ˆgPL ij gS ijgF ij (9) with the log-normal shadowing component as gS ij = 10 gSdB ij 10 , gSdB ij ∼ N (0, σ2 S), i, j ∀ and the Rayleigh fading component as gF ij ∼ χ2(2), i, j ∀ where σS is the standard deviation of the shadowing in the dB scale, while the standard deviation of the circularly symmetric complex Gaussian distribution for the fast fading coefficients is assumed to be 1. Here, χ2(2) denotes the chi-squared distribution with 2 degrees of freedom. The robust optimization variables are the set of power control variables x = [0, 1] denotes the proportion of total pi the i-th transmitter should transmit. Given x, the achievable rate for the i-th link is computed as [1...N ], where xi ∈ xi}i { ∈ (cid:32) ri = w log 1 + (cid:80) giipixi =i gijpjxj + σ2 j (cid:33) , (10) where w is the bandwidth, pi is the power budget of link i, and σ2 is the background noise power. Under a fixed power allocation x, the statistical variations of the channel result in statistical variations in the achievable rate of each link. As a result, the minimum rate among all the links, i.e., rmin = min *** i=1, ,N ri (11) also follows a distribution induced by the channel uncertain- ties. As in Section II-B, we adopt the γ-th percentile value Fig. 3. D2D Interfering Network The robust power loading problem for maximizing the minimum-rate in a multiuser MIMO downlink, which we MIMO, is then formulated as follows: denote by P maximize x rγ min subject to Pr[rmin < rγ min| k ∀ rk, ˆH] γ% ≤ rmin ≤ K (cid:88) 1, xk ≤ k=1 and (5), (6). xk ≥ 0, k ∀ (8a) (8b) (8c) (8d) B. Robust Power Control for Minimum Rate Maximization in D2D Wireless Networks Consider a wireless ad-hoc network with N independent D2D links with full frequency reuse in a two-dimensional is to find a set region as illustrated in Fig. 3. The goal of power setting at each transmitter so as to be able to mutually accommodate the simultaneous transmissions for all links. In this application, we again use the minimum rate across all the users as the network utility function, in order to ensure fairness. This is a challenging task, because due to the aggressive frequency reuse in the shared medium, the aggregate interference from the neighboring links pose as significant impairments to each of the transmission pairs. In the setting considered in this paper, we assume that the transmitters and the receivers are equipped with mul- tiple antennas, further the links operate in the millimeter wave (mmWave) frequency and there is a dominant LoS path between each transmitter and receiver pair. Moreover, we assume that in the network deployment phase, a beam alignment procedure has taken place between each transmitter- receiver pair, so that all the direct channels can benefit from a substantial array gain. Then, an additional power optimization step across all the aggregated interference is under control for each transmission pair. Here, we focus on the power optimization step. the users is performed to ensure that To formulate and to solve a power optimization problem across N transmitting and receiving nodes using traditional mathematical programming technique, one would need to esti- mate not only all the direct channels, but also all the interfering channels between every transmitter and every receiver. In a network of N transmission pairs, one would need a dedicated Tx1Tx2Tx3Tx4Tx5Rx1Rx2Rx3Rx4Rx5(cid:54) min, as the objective value, of the minimum rate distribution, rγ i.e., rγ min is the largest value for which ˆGPL] Pr[rmin < rγ γ%. (12) ≤ min| This corresponds to the notion of outage capacity. Note that here we consider the outage in minimum rate over the entire network instead of over individual links. Instead of computing the outage rate of each link, as in the earlier work [47], [48] and the conference version of this paper [1], the percentile rate is taken after the network utility is computed. The robust optimization problem for the D2D network can now be formulated as follows. We assume that a central controller has access to only the path-loss components and the beamforming gains of all the channels, and seeks to find a set of robust power allocations that work well over different realizations of the shadowing and fast fading components. This D2D wireless network power control problem is therefore one instance of the robust optimization problem in Section II-B. We have the following correspondence: P p q up(x) uγ ← ← ← G ˆGPL rmin rγ min ← The robust power control for minimum-rate maximization D2D, problem in D2D wireless networks, which we denote by is then P maximize x rγ min subject to Pr[rmin < rγ min| i ∀ 1, rmin ≤ ri, 0 i xi ≤ ∀ ≤ and (9), (10). ˆGPL] γ% ≤ (13a) (13b) (13c) (13d) IV. UNCERTAINTY INJECTION: A DEEP LEARNING TRAINING SCHEME FOR ROBUST OPTIMIZATION This section presents a novel uncertainty injection scheme for training deep learning models for solving robust optimiza- tion problems. The goal is to train a model to produce solutions that maximize a utility subject to an outage constraint. The proposed training scheme is applicable to a wide variety of problems and different neural network architectures, requiring only the assumption that the utility can be easily evaluated under different problem parameters. A. Sample-based Uncertainty Distribution Characterization Natural phenomena often induce uncertainties that are diffi- cult to characterize accurately. Their distributions can have unbounded support, and are often not easily expressed by tractable mathematical expressions. Traditional robust opti- mization algorithms rely on building mathematical models for the distributions of the uncertainties, then performing optimization based on these models. Imposing mathemati- cal models has two major drawbacks: the models may not fully characterize the true uncertainty distributions; further the 6 subsequent optimizations are often not analytically tractable, may require extra simplifications, and may result in significant computational complexities for obtaining the final solution. In this paper, we advocate characterizing parameter un- certainties via sampling. Samples of the uncertainty can be straightforward to generate for many realistic applications. With sufficient number of samples, we can estimate the statisti- cal objective numerically, thus eliminating the need for mathe- matical models and the associated analysis. Sampling has been widely used in many machine learning algorithms, such as stochastic gradient descent [60], evolutionary algorithm [61], variational inference [5], and so on. In this paper, we use a sampling strategy to develop robust optimization algorithms that are more flexible and more computationally efficient than traditional mathematical optimization algorithms. B. Uncertainty Injection Scheme We propose an approach of training a neural network to solve the robust optimization problem . The neural network takes measurements of the problem parameters as input, i.e., q, and computes a robust solution x. The mapping from q to x can be modeled by any neural network structure. The key for our training scheme is the injection of uncertainty realizations of the problem parameters into the training process, after x is computed. P Specifically, during the training stage, after the neural network computes the solutions x based on q, we in- ject a large number of L problem parameters realizations q), at the output , sampled from fp q(p p1, p2, p3, . . . , pL} { | | layer by computing the objective values of the optimization problem for each of these samples of problem parameters, i.e., up1(x), up2(x), . . . , upL(x). From these set of objective values, we can obtain ˆuγ, an empirical estimate of uγ, by rank- ing the L objective values and take the (Lγ)-th lowest value (with linear interpolation if Lγ is not an integer). Based on the gradients derived from ˆuγ, we update the neural network weights Θ to improve the robust objective performance in an unsupervised learning fashion. The idea is that during testing, the neural network can compute x based only on q, but can nevertheless achieve statistical robustness against the unseen uncertainties in p. The overall neural network structure is shown in Fig. 4. During training, the computation flows all the way towards the end for computing ˆuγ; while during testing or for applications, the computation stops at the output layer for the optimization variables x. We emphasize that the proposed method of training with uncertainty realizations injection is fundamentally different from the idea of data augmentation, in which various trans- formations or noises are applied to the training data before feeding to the model [4], [62]. Our method is also fundamen- tally different from existing literature on noise injection for robust deep learning, in which noises are injected to the inputs [25]–[29], the neural network parameters [30], the activation functions [31], [32], and the gradients [33], [34], as already mentioned earlier. In contrast, the proposed strategy injects uncertainties after the neural network output layer, and updates 7 Fig. 4. Uncertainty injection scheme for training a neural network for robust optimization the neural network model in an unsupervised fashion, based on an objective which is a stochastic function of the input (i.e., optimizing the γ-th percentile of up(x) when the neural network input provided is q). This is a sensible strategy in the robust optimization setting because the task at hand is an explicitly formulated mathematical optimization problem, and the output of the neural network is a solution to this problem, for which we can readily evaluate its robustness under the uncertain problem parameters. The proposed strategy uses injected uncertainty realizations to compute an robust objective, then trains the neural network to maximize this objective. This training scheme allows the neural network to implicitly learn the underlying uncertainty distribution for achieving robustness in its solutions, which is impossible to do under data augmentation or existing noise injection methods in the literature. C. Gradient Computation for Back-Propagation We now elaborate on the mathematical details of the gradi- ent back-propagation under the uncertainty injection training scheme. With x computed by a usual neural network, the learned x is a differentiable function of the neural network parameters Θ. In the meanwhile, the objective function up(x) is assumed to be differentiable (almost everywhere) over x for fixed problem parameters p. Lastly, the sample-based empirical percentile value ˆuγ, even with possible linear in- terpolation between two points, is differentiable with respect to the sampled objective values up1(x), up2 (x), . . . , upL (x) } { in a local neighborhood. This is because the percentile value does not depend on most of the sampled objective values, except one or two closest to the target percentile. When L is finite, the rankings of the sampled objective values closest to the target percentile do not change in the local neighborhood, so differentiability can be ensured locally almost surely. We emphasize that the uncertainty injection scheme is not restricted to the percentile function as the notion of robustness. As long as robustness is defined by a function whose sample- based approximation is differentiable over the samples, we can train a deep learning model for this robustness objective using the uncertainty injection scheme. Taken together, we have that the empirical robust objec- tive ˆuγ is a differentiable function over the neural network model parameters Θ. Therefore, the neural network can be optimized with the stochastic gradient descent method when being trained with the uncertainty injection scheme. To compute the gradients, let pi be the uncertainty realiza- tion (among the set of L injected uncertainty samples) whose corresponding objective upi (x) is the empirical γ-th percentile value of the set of sample objectives, i.e., ˆuγ. The gradient of ˆuγ with respect to the neural network parameters Θ can be obtained by the chain-rule of differentiation1: , = = ∂x ∂Θ ∂ ˆuγ ∂Θ ∂ ˆuγ ∂upi (x) ∂upi(x) ∂x ∂upi(x) ∂x ∂x ∂Θ ∂upi (x) is 1; the term ∂upi (x) where the term2 can be com- puted3 based on the uncertainty realization pi; and lastly, the term ∂x ∂Θ depends on the number of activation layers and the values of Θ themselves in the neural network. In other words, the gradient of γ-th percentile robust objective is just the (14) ∂ ˆuγ ∂x 1If linear interpolation is needed for the empirical percentile, the expression for the gradients would involve a linear combination of two of realizations. 2Or, it is a linear combination of two constants if interpolation is needed to compute the empirical percentile. 3At points of non-differentiability, we can take a supergradient. ......................................................MeasurementsqHiddenLayerHiddenLayerOptimizationVariablesxup1(x)upL(x)RobustObjectiveˆuγInjectLUncertaintySamplesp1,...,pLtestingtraining gradient of the objective corresponding of the γ-th percentile realization pi. While the exact expressions for these gradients depend on the neural network structure and the objective function up(x), all of these differentiations are readily computed by popular deep learning frameworks such as Pytorch [63] or Tensorflow [64]. Therefore, the uncertainty injection scheme adds very little complexity to the training of deep neural networks, and no extra complexity at testing. D. Sample-Based Gradient Estimator The previous section establishes the gradient computation for optimizing the robust objective and shows that the pro- posed robust optimization process can be easily implemented in the usual deep learning computation frameworks. We now show that the sample-based gradient in (14) is an asymptoti- cally unbiased estimator of the true desired gradient. Let uγ be the true γ-th percentile of up(x) under p q(p | ∼ q), i.e., the population statistic. Let ˆuγ be the γ-th , i.e. up1(x), up2(x), . . . upL(x) } ∂Θ be the true gradient for updating the gradient fp | percentile of the samples { the sample statistic. Let ∂uγ the neural network parameters assuming that exists, (or a supergradient if the gradient does not exist). We now examine the sample-based gradient in (14) un- der the expectation. As described in Section IV-B and Sec- tion IV-C, the sample statistic ˆuγ is obtained by sorting the sample objective values then finding the index corresponding to the percentile in the samples, (i.e., with sample size being L, we find the value ranked the (Lγ)-th lowest, with linear interpolation if necessary). As shown in [65], [66], under fairly general conditions, this sample statistic is an asymptotically unbiased estimator to the true population statistic uγ. There- fore, we have: E[ˆuγ] = uγ. lim L →∞ (15) It can be seen that the expectation of the gradient (14), in the asymptotic limit of large sample size, is just ∂uγ ∂Θ : E (cid:21) (cid:20) ∂ ˆuγ ∂Θ lim L →∞ = = E[ˆuγ] ∂ limL →∞ ∂Θ ∂uγ ∂Θ (16) (17) 8 V. APPLICATIONS OF UNCERTAINTY INJECTION IN WIRELESS COMMUNICATIONS In this section, we describe the application of the uncertainty injection training scheme for solving robust optimization in wireless communication problems as described in Section III. Further, we describe the benchmarks that the proposed training method would be compared with in the numerical evaluation. A. Neural Network Architecture and Uncertainty Injection For the two applications as described in Section III-A and Section III-B, given the inputs as the estimated MIMO wireless channels or the path-loss components in a D2D wire- less network, the neural network computes robust maximum minimum-rate solutions for power loading at the base station or power control among D2D links. Robustness is achieved using the uncertainty injection train- ing scheme, in which a large set of wireless channel real- izations are sampled and injected at the output of the neural network. A set of minimum rates can then be computed, with one minimum rate for each of the channel realization. This set of rates provides an empirical distribution of the minimum rate over the uncertain channels. We then take the γ-th percentile value of this set of rates ˆrγ min as the empirical estimation for rγ min. Through computing gradient and performing gradient ascent on ˆrγ min, the neural network is trained towards the direction of improving the robust minimum rate. To explore the full potential of the training scheme with deep learning, we design the neural network based on the most general architecture: the fully connected neural networks. Following an input layer which takes channel measurement values q, we adopt fully connected hidden layers each with ReLu non-linearity activations. In the output layer that com- putes the solutions for optimization variables x, proper non- linear activations are used to account for the constraints on the variable x. During the training for each single input, we sample and inject L = 1000 uncertainty realizations. Correspondingly, at any point of training, following each neural network forward path, we compute 1000 up(x) objective values based on the x computed by the neural network. The γ-th percentile objective among these 1000 up(x) objective values is then selected for computing the gradient and performing gradient ascent on the neural network parameters Θ. where (17) follows from the linearity of both the limit and the expectation operators, and the fact that the interchange of the limit, the expectation and the derivatives is allowed under certain regularity conditions. Assuming that such regularity conditions hold for the distribution up(x), we have that in the uncertainty injection scheme, the gradients used in updating the neural network weights are asymptotically unbiased esti- mators of the true gradients, which is a desirable property for the convergence of the training of deep learning models. We note that this analysis resembles the proof that the gradient estimator of the stochastic gradient descent (SGD) algorithm [60] is unbiased. B. Robust Objective vs. Nominal Objective We show two types of objectives in the numerical simu- lations: the robust objective and the nominal objective. The robust objective is as specified by the robust optimization formulation , i.e., the γ percentile value of the objective distribution achieved by the solution x, as induced by the uncertainty distribution. P On the other hand, the nominal objective is the objective value achieved by the solution x, under the measured (or esti- mated) input values as if they are the true channel parameter values. Under our notation, the nominal objective is denoted as uq(x). We show the results for the nominal objective, because it is the objective that deterministic optimization algorithms (i.e. the non-robust optimization algorithms) would optimize, assuming that the measured or estimated problem parameters are entirely accurate. The relative performances of all the methods in terms of their nominal objective and the robust objective reveal the effectiveness of actively accounting for the channel uncertainties during optimization. C. Deep Learning without Uncertainty Injection To fully illustrate the benefits of the proposed the training scheme, we include a benchmark method where an identical neural network is trained with the same dataset and hyper- parameters, but without uncertainty injection. Specifically, we train the neural network with the same unsupervised learning procedure, except that we do not implement any uncertainty injection. Instead, during training the gradient is derived from the nominal objective uq(x), computed directly based on the measured or estimated channel parameters q. We note that to the best of the authors knowledge, there are no efficient analytic mathematical optimization methods that can account for channel uncertainties in these problem settings. VI. EXPERIMENTAL VALIDATION This section provides numerical results for the proposed uncertainty injection scheme on two wireless network appli- cations, namely, the robust power loading problem for the multiuser MIMO downlink, and the robust power control problem for D2D wireless networks. A. Multiuser MIMO Downlink Environment Consider a base station equipped with M = 4 antennas and serving K = 4 users. We assume the i.i.d. Rayleigh fading model for the MIMO channel H, with each channel entry fol- lowing a circularly symmetric complex Gaussian distribution k, j. We assume that the channel estimation hkj ∼ CN error ekj as in (5) has a variance of σ2 e = 0.075. During data transmission, we assume the total power constraint P of 1W over a bandwidth of 10MHz, and an effective background noise level of -75dBm/Hz (e.g., after accounting for pathloss and out-of-cell interference). (0, 1), ∀ Prior to the power loading optimization, based on the estimated channels ˆH using minimum mean-square estimation (MMSE) [67], we utilize the RZF beamformers, which have a better performance than the ZF beamformers. Specifically, we compute the unnormalized RZF beamformers as follows: B(cid:48) = ˆH( ˆHH ˆH + αI)− 1 (18) To choose an appropriate value for α, we make the following observation (which is verified by numerical simulations): as α approaches zero, the beamformers become more aggressive on nulling the interference, but also become more sensitive with respect to channel uncertainty. As a result, the nominal objective (as defined in Section V-B) increases while the robust objective degrades. To achieve a reasonable trade-off on the 9 regularization factor, we select the value of α that results in the highest medium rmin under the channel uncertainty distribution (assuming equal power allocation across the users for simplicity). This leads to a value of α = 0.2 in our setting. We then normalize the beamformers across each column of B(cid:48), i.e., the beamformers for each user, to unit norm, to obtain the normalized beamformers B. For the inputs to the neural network, we compute the effective channels ˆHeff based on ˆH and B as: ˆHeff = ˆHH B (19) P K) vector. and flatten the resultant matrix into a length-(K We note that this information is the measurement of the channel, i.e., playing the role of q in the robust optimization problem as in Section II-B. × i=1 xi ≤ Provided with this input, the fully-connected neural network [0, 1]K as the power loading then computes the output x ∈ solution. We use the softmax activation at the final output layer to enforce the power constraint (cid:80)K 1. Lastly, to train the neural network with uncertainty injection scheme for robust minimum-rate optimization, we randomly generate 1000 channel realizations of H according to (5) and inject them into the neural network training flow. With a specific solution x computed by the neural network, we compute then take the minimum of the K user rates achieved for each of the 1000 channel realizations. We then take the γ-th percentile of those 1000 minimum rates to obtain the empirical estimation ˆuγ. The gradient to update the neural network weights is computed based on the channel realization corresponding to ˆuγ. During training, we use a minibatch size of 1000 distinct MIMO networks, with each training epoch including 50 mini- batches. We train for a total of 500 epochs, with early stopping based on validation at the end of each epoch. We note that instead of having a fixed training set, we continuously generate new MIMO network wireless channels and their estimations, which is easy to do because of the readily available Rayleigh fading channel model. B. Multiuser MIMO Downlink Results We adopt a structure for the neural network with 4 fully- connected layers, each with 200 hidden neurons and the ReLU non-linearity, except for the output layer with the softmax non- linearity to ensure that (cid:80) xi = 1. (In the low-interference regime after RZF, the optimized x is likely to be a one that uses up all the total power, i.e., (8d) is satisfied with equality.) This same structure is also use in the deep learning without uncertainty injection benchmark as described in Section V-C. We also compare with a geometric programming bench- mark, which finds the global optimal solution for the minimum-rate maximization problem by representing the in- verse of the signal-to-inference-and-noise ratio (SINR) terms as posynomials [68]. Note that the formulation required by geometric programming cannot incorporate channel uncertain- ties, because the statistical robustness of the objective cannot be expressed by posynomials. 10 TABLE I MULTIUSER MIMO DOWNLINK 5-PERCENTILE ROBUST MINIMUM-RATE PERFORMANCE Methods Geometric Programming Deep Learning without Uncertainty Injection Deep Learning with Uncertainty Injection Uniform Power Nominal Minimum Rate 40.18Mbps Robust Minimum Rate 5.41Mbps 39.51Mbps 37.40Mbps 29.70Mbps 6.52Mbps 8.03Mbps 5.88Mbps Fig. 5. Cumulative distribution of 5th-percentile robust minimum-rates in MIMO wireless networks over 2000 test channel layouts. Fig. 6. D2D beamforming pattern at the transmitters and the receivers, and its approximation used in simulations. In the simulations, we set γ = 5, i.e., we use the robust minimum rate at the 5th-percentile across the distribution in- duced by the channel uncertainties as the robust objective. We evaluate the robust minimum rate and the nominal minimum rate performances over 2000 testing layouts. For evaluation of the robust objective, we also use 1000 randomly sampled channel realizations on each of the 2000 testing layouts to empirically estimate the 5th-percentile value of the minimum rates. The results are presented in Table I. Furthermore, the cumulative distribution function (CDF) of these robust 5th- percentile minimum-rates over all 2000 testing layouts are shown in Fig. 5. As the numerical results show, the neural network trained with the uncertainty injection scheme achieves 23% improve- ment on the robust minimum rate over the same neural network trained without uncertainty injection. This shows that the uncertainty injection scheme indeed encourages the deep learning model to learn and to produce solutions that are significantly more robust against the channel uncertainties than the state-of-the-art algorithms. Interestingly, the performance improvement over geometric programming is even larger, at 48% for the robust 5th- percentile minimum-rate. This is because the classical mathe- matical programming techniques exploit the particular channel realization to the fullest extent in order to maximize the minimum-rate objective, as shown in the nominal minimum rate result, but it does not account for robustness across the channel uncertainties at all. Even training a neural network to approximate the classical mathematical programming without uncertainty injection would already achieve some robustness, as shown in Fig. 5. Significantly better robustness is achieved with training a deep neural network with uncertainty injection. C. D2D Wireless Network Environment For the D2D wireless network, we consider a number of D2D links randomly deployed within a confined region, with the transceiver distances following uniform distributions. We impose a minimum of 5-meter distance between any trans- mitter and any receiver that do not belong to the same link. For the path-loss, we follow the short-range outdoor model ITU-1411, with 5MHz bandwidth at the carrier frequency of 25GHz (the mmWave range). Every transmitter and receiver is equipped with a linear antenna array with M = 8 antennas. We use a beamforming pattern corresponding to a uniform linear array directly aimed between the transmitter and the receiver. The beamforming gains are approximated as follows: 9dB gain for the direct links (as the transmitter and receiver pair can align with each other precisely), 6dB gain at the main lobe direction with an angle from 9dB gain at the side lobe directions. In Fig. 6, the corresponding beamforming gain pattern and its approximation are plotted for M = 8. At each transmitter, we assume a maximum transmit power of 30dBm. We also assume a background noise level of 10 to +10 degrees, and 169dBm/Hz. − − We incorporate the following channel uncertainty models − for each direct and interfering links: • • Shadowing with log-normal distribution with 8dB stan- dard deviation; Rayleigh fading with i.i.d. circularly symmetric complex Gaussian distribution with unit variance. to illustrate that Furthermore, the training process can be applied to different scenarios, we test the robust performances in three different settings with 1000 wireless networks layouts under each setting, as in Table II. For each layout, we sample 1000 channel realizations during testing to obtain an empirical 24681012Min-Rates (Mbps)0%25%50%75%100%Cumulative Distribution of Robust Min-RatesGeometric ProgrammingDeep Learning without Uncertainty InjectionDeep Learning with Uncertainty InjectionUniform Power0102030405060708090100110120130140150160170180Angle of Incidence/Arrival4030200102069Gain (dB)Max Gain: 9.031dB TABLE II D2D WIRELESS ENVIRONMENT Setting A B C Number of Links (N ) 10 10 15 Region Area (m2) 150 × 150 200 × 200 300 × 300 Direct-Link Distance Distribution 5m∼15m 20m∼30m 10m∼30m Fig. 7. Cumulative distribution of robust minimum-rates in D2D wireless networks under test setting B. approximation of the robust minimum rate across the entire network. D. D2D Wireless Networks Results We adopt a neural network structure with 5 fully-connected layers, each with 6N 2 hidden neurons and the ReLU non- linearity, except for the output layer, which produces x with N output units and has a sigmoid non-linearity (to ensure that the power control solution for the N links has a range of [0, 1]N ). This same structure is also used for the benchmark of deep learning without uncertainty injection as described in Section V-C. Because of the path-loss, the direct and the interfering links are often of different orders of magnitudes, making it difficult to obtain meaningful updates at the beginning of training. To make training effective, we adopt input normalization on the input path-loss values (for both training and testing), where each of the N 2 inputs of the path-loss values are normalized independently based on the statistics computed from the training set. For the D2D network simulations, we set γ = 10, i.e., we use the minimum rate at the 10th percentile across the distribution induced by the channel uncertainties as the robust objective. We present test results on the robust minimum-rate obtained by the neural network based only on the path-loss and the beamforming gain values as the inputs. Similar to Section VI-B, we include two benchmarks for illustrating the importance of robust optimization: deep learning without un- certainty injection, and the geometric programming (which can provide globally optimal solutions if the channel uncertainties are not considered). Results are shown in Table III. Fig. 7 presents CDF curves of the robust minimum-rates achieved by all methods over 1000 testing wireless networks, generated under test setting B in Table II. 11 As shown in these results, under various interference lev- els, link densities, and transceiver distance distributions, the neural network trained with uncertainty injection consistently produces more robust solutions. The performance gain due to the proposed uncertainty injection training is up to 9%, as compared to a deep neural network without uncertainty injection. The gain is much higher, in the range of 48-66%, when compared with the geometric programming benchmark, which is a globally optimal solution that does not account for channel uncertainty. In fact, geometric programming does not even perform as well as simply using full power in term of the robust minimum rate, although as expected it does much better in term of nominal minimum rate. VII. CONCLUSION This paper proposes a novel uncertainty injection training method for deep learning models to perform robust optimiza- tion against parameter uncertainties. We consider a robust optimization problem that aims to compute robust solutions based only on the measured or the estimated problem param- eters, while can still perform well with parameter uncertainties. Traditional robust optimization techniques addressing such problems require complicated mathematical characterizations of the parameter uncertainties, which are often difficult to analyze and may not reflect realistic environments accurately. Instead, sample-based uncertainty modeling is an attractive alternative because of its simplicity and accuracy. The proposed training scheme utilizes the capability of deep neural networks to learn from samples of uncertainties. By injecting uncertainties, an empirical estimate of the robust objective can be obtained and used for updating the neu- ral network model parameter during training. The proposed uncertainty injection scheme are applicable to a variety of robust optimization problems, while having low computational complexity. To illustrate the effectiveness of this method, we present promising numerical simulation results on two wireless communication applications. We believe that the proposed method opens up an avenue for wider application of deep learning based robust optimization under realistic scenarios, where uncertainties are ubiquitous and highly agnostic. REFERENCES [1] W. Cui, K. Shen, and W. Yu, "Deep learning for robust power control for wireless networks," in IEEE Int. Conf. Acoust. Speech Signal Process. (ICASSP), May 2020. [2] A. Krizhevsky, I. Sutskever, and G. E. Hinton, "Imagenet classification with deep convolutional neural networks," in Adv. Neural Inf. Process. Syst. (NIPS), Dec. 2012. [3] A. L. Maas, R. E. Daly, P. T. Pham, D. Huang, A. Y. Ng, and C. Potts, "Learning word vectors for sentiment analysis," in Annu. Meeting Assoc. Comput. Linguistics (ACL), Jun. 2011, pp. 142–150. [4] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in IEEE Conf Comput. Vision Pattern Recognit. (CVPR), Jun. 2016. [5] D. P. Kingma and M. Welling, "Auto-encoding variational bayes," in Int. Conf. Learn. Representations (ICLR), Apr. 2014. [6] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, "Generative adversarial nets," in Adv. Neural Inf. Process. Syst. (NIPS), Dec. 2014. [7] A. Radford, L. Metz, and S. Chintala, "Unsupervised representation learning with deep convolutional generative adversarial networks," in Int. Conf. Learn. Representations (ICLR), May 2016. 0.250.500.751.001.251.501.752.002.25Min-Rate (Mbps)0%25%50%75%100%Cumulative Distribution of Robust Min-RatesGeometric ProgrammingDeep Learning without Uncertainty InjectionDeep Learning with Uncertainty InjectionFull Power 12 TABLE III D2D WIRELESS NETWORKS ROBUST MINIMUM-RATE PERFORMANCE Methods Geometric Programming Deep Learning without Uncertainty Injection Deep Learning with Uncertainty Injection Full Power Setting A Setting B Setting C Nominal 46.84Mbps Robust 2.72Mbps Nominal 37.05Mbps Robust 0.86Mbps Nominal 40.36Mbps Robust 0.85Mbps 44.86Mbps 3.78Mbps 35.41Mbps 1.21Mbps 37.56Mbps 1.37Mbps 43.18Mbps 4.03Mbps 33.81Mbps 1.31Mbps 35.70Mbps 1.41Mbps 37.43Mbps 3.29Mbps 28.61Mbps 1.07Mbps 30.47Mbps 1.13Mbps [8] K. Gregor and Y. LeCun, "Learning fast approximations of sparse coding," in Int. Conf Mach. Learn. (ICML), Jun. 2010, pp. 399–406. [9] H. Sun, X. Chen, Q. Shi, M. Hong, X. Fu, and N. D. Sidiropoulos, "Learning to optimize: Training deep neural networks for interference management," IEEE Trans. Signal Process., vol. 66, no. 20, pp. 5438– 5453, Aug. 2018. [10] W. Cui, K. Shen, and W. Yu, "Spatial deep learning for wireless scheduling," IEEE J. Sel. Areas Commun., vol. 37, pp. 1248–1261, Jun. 2019. [11] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus, "Intriguing properties of neural networks," in Int. Conf. Learn. Representations (ICLR), Apr. 2014. [12] A. Fawzi, S. Moosavi-Dezfooli, and P. Frossard, "Robustness of clas- sifiers: from adversarial to random noise," in Adv. Neural Inf. Process. Syst. (NIPS), Dec. 2016, pp. 1632–1640. [13] N. Natarajan, I. S. Dhillon, P. Ravikumar, and A. Tewari, "Learning with noisy labels," in Adv. Neural Inf. Process. Syst. (NIPS), Dec. 2013. [14] A. Joulin, L. van der Maaten, A. Jabri, and N. Vasilache, "Learning visual features from large weakly supervised data," in Eur. Conf. Comput. Vision (ECCV), Nov. 2015. [15] A. Veit, N. Alldrin, G. Chechik, I. Krasin, A. Gupta, and S. Belongie, "Learning from noisy large-scale datasets with minimal supervision," in IEEE Conf Comput. Vision Pattern Recognit. (CVPR), Jul. 2017, pp. 839–847. [16] D. Rolnick, A. Veit, S. Belongie, and N. Shavit, "Deep learn- [Online] Available: to massive label noise," 2017, ing is robust https://arxiv.org/pdf/1705.10694.pdf. [17] A. Sinha, H. Namkoong, R. Volpi, and J. Duchi, "Certifying some training," 2017, distributional robustness with principled adversarial [Online] Available: https://arxiv.org/pdf/1710.10571.pdf. [18] G. Pleiss, M. Raghavan, F. Wu, J. Kleinberg, and K. Q. Weinberger, "On fairness and calibration," in Adv. Neural Inf. Process. Syst. (NIPS), Dec. 2017. [19] J. Duchi and H. Namkoong, "Variance-based regularization with convex objectives," J. Mach. Learn. Res. (JMLR), vol. 20, no. 1, pp. 2450–2504, Jan. 2019. [20] M. Hein, M. Andriushchenko, and J. Bitterwolf, "Why relu networks yield high-confidence predictions far away from the training data and how to mitigate the problem," in IEEE Conf. Comput. Vision Pattern Recognit. (CVPR), Jun. 2019, pp. 41–50. [21] J. Fan, Y. Shen, N. Zhou, and Y. Gao, "Harvesting large-scale weakly- tagged image databases from the web," in IEEE Conf. Comput. Vision Pattern Recognit. (CVPR), Jun. 2010. [22] V. Ordonez, G. Kulkarni, and T. Berg, "Im2text: Describing images using 1 million captioned photographs," in Adv. Neural Inf. Process. Syst. (NIPS), Dec. 2011, pp. 1143–1151. [23] Y. Xia, X. Cao, F. Wen, and J. Sun, "Well begun is half done: Generating high-quality seeds for automatic image dataset construction from web," in Eur. Conf. Comput. Vision (ECCV), Sep. 2014, pp. 387–400. [24] S. Gu and L. Rigazio, "Towards deep neural network architectures robust to adversarial examples," in Int. Conf. Learn. Representations (ICLR), May 2015. [25] C. M. Bishop, "Training with noise is equivalent to tikhonov regular- ization," Neural Comput., vol. 7, no. 1, pp. 108–116, Jan. 1995. [26] R. D. Reed and R. J. Marks, II, Neural Smithing: Supervised Learning in Feedforward Artificial Neural Networks. Bradford Books, Feb. 1999. [27] U. Shaham, Y. Yamada, and S. Negahban, "Understanding adversarial training: Increasing local stability of neural nets through robust optimiza- tion," 2015, [Online] Available: https://arxiv.org/pdf/1511.05432.pdf. [28] S. Moosavi-Dezfooli, A. Fawzi, and P. Frossard, "Deepfool: a simple and accurate method to fool deep neural networks," in IEEE Conf Comput. Vision Pattern Recognit. (CVPR), Jun. 2016. [29] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu, "Towards deep learning models resistant to adversarial attacks," in Int. Conf. Learn. Representations (ICLR), May 2018. [30] A. Graves, A. Mohamed, and G. Hinton, "Speech recognition with deep recurrent neural networks," in IEEE Int. Conf. Acoust., Speech, and Signal Process. (ICASSP), May 2013. [31] B. Poole, J. Sohl-Dickstein, and S. Ganguli, "Analyzing noise in [Online] Available: autoencoders and deep networks," Jun. 2014, https://arxiv.org/pdf/1406.1831.pdf. [32] C. Gulcehre, M. Moczulski, M. Denil, and Y. Bengio, "Noisy activation functions," in Int. Conf. Mach. Learn. (ICML), Jun. 2016. [33] A. Neelakantan, L. Vilnis, Q. V. Le, I. Sutskever, L. Kaiser, K. Kurach, and J. Martens, "Adding gradient noise improves learning for very deep networks," Nov. 2015, [Online] Available: https://arxiv.org/pdf/1511.06807.pdf. [34] M. Zhou, T. Liu, Y. Li, D. Lin, E. Zhou, and T. Zhao, "Towards understanding the importance of noise in training neural networks," in Int. Conf. Mach. Learn. (ICML), Jun. 2019. [35] X. Wu, S. Tavildar, S. Shakkottai, T. Richardson, J. Li, R. Laroia, and A. Jovicic, "FlashLinQ: A synchronous distributed scheduler for peer- to-peer ad hoc networks," IEEE/ACM Trans. Netw., vol. 21, no. 4, pp. 1215–1228, Aug. 2013. [36] K. Shen and W. Yu, "FPLinQ: A cooperative spectrum sharing strategy for device-to-device communications," in IEEE Int. Symp. Inf. Theory (ISIT), Jun. 2017, pp. 2323–2327. [37] Q. Shi, M. Razaviyayn, Z.-Q. Luo, and C. He, "An iteratively weighted MMSE approach to distributed sum-utility maximization for a MIMO interfering broadcast channel," IEEE Trans. Signal Process., vol. 59, no. 9, pp. 4331–4340, Apr. 2011. [38] N. Naderializadeh and A. S. Avestimehr, "ITLinQ: A new approach for spectrum sharing in device-to-device communication systems," IEEE J. Sel. Areas Commun., vol. 32, no. 6, pp. 1139–1151, Jun. 2014. [39] B. Zhuang, D. Guo, E. Wei, and M. L. Honig, "Scalable spectrum allocation and user association in networks with many small cells," IEEE Trans. Commun., vol. 65, no. 7, pp. 2931–2942, Jul. 2017. [40] I. Rhee, A. Warrier, J. Min, and L. Xu, "DRAN: Distributed randomized TDMA scheduling for wireless ad hoc networks," IEEE Trans. Mobile Comput., vol. 8, no. 10, pp. 1384–1396, Oct. 2009. [41] L. P. Qian and Y. J. Zhang, "S-MAPEL: Monotonic optimization for non-convex joint power control and scheduling problems," IEEE Trans. Wireless Commun., vol. 9, no. 5, pp. 1708–1719, May 2010. [42] M. Johansson and L. Xiao, "Cross-layer optimization of wireless networks using nonlinear column generation," IEEE Trans. Wireless Commun., vol. 5, no. 2, pp. 435–445, Feb. 2006. [43] M. B. Shenouda and T. N. Davidson, "Convex conic formulations of robust downlink precoder designs with quality of service constraints," IEEE J. Sel. Topics Signal Process., vol. 1, no. 4, pp. 714–724, Dec. 2007. [44] M. Hasan, E. Hossain, and D. I. Kim, "Resource allocation under channel uncertainties for relay-aided device-to-device communication underlaying LTE-A cellular networks," IEEE Trans. Wireless Commun., vol. 13, no. 4, pp. 2322–2338, Mar. 2014. [45] Y. Shen and K. S. Kwak, "Robust power control for cognitive radio networks with proportional rate fairness," ICT Express, vol. 1, pp. 22– 25, June 2015. [46] W. Wu, R. Liu, Q. Yang, and T. Q. S. Quek, "Learning-based robust resource allocation for D2D underlaying cellular network," IEEE Trans. Wireless Commun., vol. 21, no. 8, pp. 6731–6745, Aug. 2022. [47] J. Wang, J. Chen, Y. Lu, M. Gerla, and D. Cabric, "Robust power control under location and channel uncertainty in cognitive radio networks," IEEE Wireless Commun. Lett., vol. 2, no. 4, pp. 113–116, April 2015. 13 [48] E. Dall'Anese, S. Kim, G. B. Giannakis, and S. Pupolin, "Power control for cognitive radio networks under channel uncertainty," IEEE Trans. Wireless Commun. , vol. 10, no. 10, pp. 3541 – 3551, August 2011. [49] B. K. Chalise, S. Shahbazpanahi, A. Czylwik, and A. B. Gershman, "Robust downlink beamforming based on outage probability specifica- tions," IEEE Trans. Wireless Commun., vol. 6, no. 10, pp. 3498–3503, Oct. 2007. [50] M. B. Shenouda and T. N. Davidson, "Probabilistically-constrained approaches to the design of the multiple antenna downlink," in Asilomar Conf. Signals Syst. Comput., Oct. 2008. [51] K. Wang, A. M. So, T. Chang, W. Ma, and C. Chi, "Outage constrained robust transmit optimization for multiuser MISO downlinks: Tractable approximations by conic optimization," IEEE Trans. Signal Process., vol. 62, no. 21, pp. 5690–5705, Nov. 2014. [52] F. Sohrabi and T. N. Davidson, "Coordinate update algorithms for robust power loading for the MU-MISO downlink with outage constraints," IEEE Trans. Signal Process., vol. 64, no. 11, pp. 2761–2773, Jan. 2016. [53] M. Medra and T. N. Davidson, "Per-user outage-constrained power loading technique for robust MISO downlink," in Asilomar Conf. Signals Syst. Comput., Nov. 2015. [54] M. Elnourani, S. Deshmukh, B. Beferull-Lozano, and D. Romero, "Ro- bust underlay device-to-device communications on multiple channels," Feb. 2020, [Online] Available: https://arxiv.org/pdf/2002.11500.pdf. [55] P. de Kerret and D. Gesbert, "Robust decentralized joint precoding using team deep neural network," in Int. Symp. Wireless Commun. Syst. (ISWCS), Aug. 2018. [56] J. Kim, H. Lee, and S. Park, "Learning robust beamforming for MISO downlink systems," IEEE Commun. Lett., vol. 25, no. 6, pp. 1916–1920, Mar. 2021. [57] R. Dong, B. Wang, and K. Cao, "Deep learning driven 3D robust beam- forming for secure communication of UAV systems," IEEE Wireless Commun. Lett., vol. 10, no. 8, pp. 1643–1647, Aug. 2021. [58] B. Sklar, "Rayleigh fading channels in mobile digital communication systems Part I: Characterization," IEEE Commun. Mag., vol. 35, no. 7, pp. 90–100, Jul. 1997. [59] C. B. Peel, B. M. Hochwald, "A vector-perturbation technique for near-capacity multiantenna multiuser inversion and regularization," IEEE communication-part Trans. Commun., vol. 53, no. 1, pp. 195–202, Jan. 2005. and A. L. Swindlehurst, i: channel [60] J. Kiefer and J. Wolfowitz, "Stochastic estimation of the maximum of a regression function," Ann. Math. Statist., vol. 23, no. 3, pp. 462–466, Sep. 1952. [61] D. E. Goldberg and J. H. Holland, "Genetic algorithms and machine learning," Mach. Learn., vol. 3, pp. 95–99, Oct. 1988. [62] C. Lee, S. Xie, P. Gallagher, Z. Zhang, and Z. Tu, "Deeply-supervised nets," in Int. Conf. Artif. Intell. Statist. (AISTATS), May 2015. [63] A. Paszke et al., "PyTorch: An imperative style, high-performance deep learning library," in Adv. Neural Inf. Process. Syst. (NeurIPS), Dec. 2019, pp. 8024–8035. [64] M. Abadi et al., "TensorFlow: Large-scale machine learning on heterogeneous systems," 2015, software available from tensorflow.org. [Online]. Available: https://www.tensorflow.org/ [65] W. R. V. Zwet, Convex Transformations of Random Variables. Ams- terdam, Netherlands: Mathematisch Centrum, 1964, ch. 3. [66] G. Chatillon, R. Gelinas, L. Martin, and L. Laurencelle, "When is it preferable to estimate population percentiles from a set of classes rather than from the raw data?" J. Educ. Statist., vol. 12, no. 4, pp. 395–409, 1987. [67] H. V. Poor, An Introduction to Signal Detection and Estimation, 2nd ed. New York, NY, USA: Springer Science & Business Media, Feb. 1994. [68] M. Chiang, C. W. Tan, D. P. Palomar, D. O'Neill, and D. Julian, "Power control by geometric programming," IEEE Trans. Wireless Commun., vol. 6, no. 7, pp. 2640–2651, Jul. 2007.
http://arxiv.org/abs/2302.12289v1
2023-02-23T19:13:30
2023-02-23T19:13:30
Beyond Moments: Robustly Learning Affine Transformations with Asymptotically Optimal Error
We present a polynomial-time algorithm for robustly learning an unknown affine transformation of the standard hypercube from samples, an important and well-studied setting for independent component analysis (ICA). Specifically, given an $\epsilon$-corrupted sample from a distribution $D$ obtained by applying an unknown affine transformation $x \rightarrow Ax+s$ to the uniform distribution on a $d$-dimensional hypercube $[-1,1]^d$, our algorithm constructs $\hat{A}, \hat{s}$ such that the total variation distance of the distribution $\hat{D}$ from $D$ is $O(\epsilon)$ using poly$(d)$ time and samples. Total variation distance is the information-theoretically strongest possible notion of distance in our setting and our recovery guarantees in this distance are optimal up to the absolute constant factor multiplying $\epsilon$. In particular, if the columns of $A$ are normalized to be unit length, our total variation distance guarantee implies a bound on the sum of the $\ell_2$ distances between the column vectors of $A$ and $A'$, $\sum_{i =1}^d \|a_i-\hat{a}_i\|_2 = O(\epsilon)$. In contrast, the strongest known prior results only yield a $\epsilon^{O(1)}$ (relative) bound on the distance between individual $a_i$'s and their estimates and translate into an $O(d\epsilon)$ bound on the total variation distance. Our key innovation is a new approach to ICA (even to outlier-free ICA) that circumvents the difficulties in the classical method of moments and instead relies on a new geometric certificate of correctness of an affine transformation. Our algorithm is based on a new method that iteratively improves an estimate of the unknown affine transformation whenever the requirements of the certificate are not met.
[ "He Jia", "Pravesh K . Kothari", "Santosh S. Vempala" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12289v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12289v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.DS", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.DS", "cs.LG", "math.ST", "stat.ML", "stat.TH" ]
Beyond Moments: Robustly Learning Affine Transformations with Asymptotically Optimal Error ∗ He Jia [email protected] Georgia Tech † Pravesh K . Kothari [email protected] CMU ∗ Santosh S. Vempala [email protected] Georgia Tech February 27, 2023 Abstract We present a polynomial-time algorithm for robustly learning an unknown affine trans- formation of the standard hypercube from samples, an important and well-studied setting for independent component analysis (ICA). Specifically, given an ε-corrupted sample from a distribution D obtained by applying an unknown affine transformation x → Ax + s to the ˆA, ˆs such uniform distribution on a d-dimensional hypercube [−1, 1]d , our algorithm constructs ˆD from D is O(ε) using poly(d) time and that the total variation distance of the distribution samples. Total variation distance is the information-theoretically strongest possible notion of distance in our setting and our recovery guarantees in this distance are optimal up to the absolute constant factor multiplying ε. In particular, if the columns of A are normalized to be unit length, our total variation distance guarantee implies a bound on the sum of the l2 distances between the column vectors of A and A(cid:48) (cid:107)ai − ˆai (cid:107)2 = O(ε). In contrast, the strongest known prior results only yield a εO(1) (relative) bound on the distance between individual ai's and their estimates and translate into an O(dε) bound on the total variation distance. , (cid:205)d i=1 Prior algorithms for this problem rely on implementing standard approaches [7] for ICA based on the classical method of moments [12, 19] combined with robust moment estimators. We observe that an approach based on o(log d)-degree moments provably fails to obtain non-trivial total variation distance guarantees for robustly learning an affine transformation unless ε < 1/dO(1) . Our key innovation is a new approach to ICA (even to outlier-free ICA) that circumvents the difficulties in the classical method of moments and instead relies on a new geometric certificate of correctness of an affine transformation. Our algorithm is based on a new method that iteratively improves an estimate of the unknown affine transformation whenever the requirements of the certificate are not met. 3 2 0 2 b e F 3 2 ] S D . s c [ 1 v 9 8 2 2 1 . 2 0 3 2 : v i X r a ∗ Supported in part by NSF awards CCF-2007443 and CCF-2106444. †[email protected]. Supported by NSF CAREER Award #2047933, NSF #2211971, an Alfred P. Sloan Fellowship, and a Google Research Scholar Award. 1 Introduction We consider the problem of learning affine transformations from samples. Specifically, we are given i.i.d. points x ∈ Rd obtained after applying an unknown affine transformation to a uniform sample from the hypercube [−1, 1]d , i.e., x = As + a where a, A are unknown and each coordinate of s is uniformly sampled in [−1, 1]. The study of efficient algorithms for estimating the unknown affine transformation up to desired error is a major topic in signal processing [7, 9, 10], with many interesting algorithms and heuristics. It is often called standard ICA (a special case of the well-studied Independent Component Analysis) or blind deconvolution or the "cocktail party" problem. Algorithms for recovering the unknown affine transformation A are generally based on higher directional moments of the distribution. The empirical mean and covariance of the transformed samples can be used to find an affine transformation that matches the mean and second moments of the original cube. The correct rotation can be identified by first making the distrbution isotropic (zero mean, identity covariance) and then examining the fourth moment of the empirical distribution. The directions that maximize the fourth moment correspond to the facet normals of the correct rotation, see e.g., [12, 19]. The "method of moments" has been extended, using higher moments, to various generalizations of standard ICA, including more general product distributions and underdetermined ICA [13]. While the model has been quite influential and is widely studied, it is reasonable to expect that data will contain errors and will deviate, at least slightly, from the precise model. Recovering the underlying model parameters despite corruption, even arbitrary adversarial noise, is the mainstay of robust statistics, a field that has enjoyed a renaissance over the past decade (and is now called Algorithmic Robust Statistics). Beginning with the robust estimation of the mean of high- dimensional distributions [11, 17], there has been tremendous progress on a variety of well-known and central problems in statistical learning theory, including linear regression [14, 3] covariance estimation [8] and Gaussian mixture models [2]. In all these cases, nearly optimal guarantees are known, asymptotically matching statistical lower bounds for the error of the estimated parameters. Despite much progress on ICA and on robust estimation, the robust version of the problem has thus far evaded solution. The precise problem is as follows: we are given samples from an unknown affine transformation of a cube, after an ε fraction of the sample has been arbitrarily (adversarially) corrupted; estimate the affine transformation. Information-theoretically, it is possible to estimate an affine transformation so that the resulting distribution is within TV distance O(ε) of the unknown transformation. But can we find this algorithmically? Prior works [17, 16] obtained some guarantees for ICA in the presence of adversarial outliers by applying robust estimators for moments of data into the classical ICA algorithms based on ˆA the method of moments. The resulting guarantees allow recovering a linear transformation ˆA is close to the corresponding column of A up to so that (up to a permutation) each column of (1 ± εO(1)) relative error in l2 norm. However, as we discuss next, this guarantee is extremely weak and implies no upper bound on the total variation distance. Indeed a total variation guarantee requires (and our methods here will obtain!) a bound of O(ε) on the sum of the l2 errors over all columns! In particular, robust ICA algorithms from prior works yield a bound on the relevant parameter distance, namely, the total l2 error, which is off by a factor d - the underlying dimension. 1 As we next discuss, this abject failure of known methods in obtaining strong recovery guarantees for ICA is in fact an inherent issue in any algorithm that relies on the method of moments and one of our main conceptual contribution is a truly new, non-method-of-moments algorithm for learning affine transformations, even in the non-robust setting. Inadequacy of the Method of Moments: It has been shown that some of the algorithms for ICA are robust to structured noise such as Gaussian noise, i.e., instead of observing x = As + a, we see x = As + a + z where z ∼ N(0, σ2I) is Gaussian [1, 6]. However, adversarial noise breaks these classical methods, which are generally based on a constant number of moments. A natural idea is to replace moments with their robust counterparts, given that robust moment estimation is one of the successes of algorithmic robust statistics. However, as we illustrate next, these methods fall short for ICA. √ d. Then, the TV distance between the two corresponding cubes is 1 − (1 − ε√ d Consider a unit cube whose center is shifted to an unknown point μ. Now the problem simply consists of estimating μ. Robust mean estimation algorithms will solve this problem to within error O(ε), i.e., one can efficiently find ̃μ s.t. (cid:107)μ − ̃μ(cid:107)2 = O(ε) and this is the best possible bound. However, suppose the center of the cube is the origin, and the estimated center has all coordinates equal to ε/ , very far from the best possible TV distance of O(ε). On the other hand, if one could estimate the mean with O(ε) error in L1 norm, this would result in a TV distance bound of O(ε). This is simply because one can bound the TV distance as the sum over the distances along the marginals, and for each marginal it is bounded by the distance between the means. However, estimating the mean within L1 error ε is impossible in general, e.g., for a Gaussian. Indeed, almost all the recently developed methods in robust statistics naturally provide guarantees for mean estimation in l2 norm and yield no useful guarantees in our setting. )d (cid:39) 1 − e−ε √ d The robust covariance and higher-moment estimation methods of [15] can be used to robustly learn the columns of the unknown linear transformation each to within ε error in Euclidean norm (after normalizing the covariance to be the identity). However, ε error in each column means a TV distance error of up to 1 − (1 − O(ε))d , again growing with the dimension. Our Result: The main contribution of this paper is developing an algorithm for learning affine transformations that circumvents the inherent issues with the method of moments and manages to obtain, using polynomial time and samples, almost optimal recovery guarantees in total variation distance. Specifically, our main result is a polynomial-time algorithm to robustly estimate an unknown affine transformation of the hypercube to within TV distance O(ε). Theorem 1.1. Given Y = {y1, . . . , yn }, an ε-corrupted sample of points from an unknown parallelopiped H = A[−1, 1]d +a in Rd, there is a polynomial-time algorithm that outputs a parallelopiped (cid:98)H = (cid:98)A[−1, 1]d + a (cid:98) s.t. dTV ( ˆH, H) = O(ε). Our algorithm is based on a new approach to ICA, even without outliers, that does not rely on constant-order moments as in prior works. As we discuss next, a key contribution of our work is the development of a new certificate of correctness of the estimated linear transformation that does not 2 Figure 1: Shifting a cube in Euclidean norm or rotating can create very large TV distance. rely on low order moments. Our algorithm relies on an iterative update step that makes progress whenever the current guess on the unknown affine transformation fails a check in the certificate. 1.1 Approach and techniques Let us first assume the affine transformation consists of only a shift and a diagonal scaling. In this case, we start with a coarse approximation of the center and side lengths obtained by using the coordinate-wise median, and a scaling of the interval in each coordinate that contains the middle (1/2) + ε fraction of samples. We then refine this iteratively using the fact that density of the cube is uniform along each coordinate, and, crucially, that the measure of the intersection of two axis-parallel bands is bounded by the product of their individual measures. If the latter condition is violated, then the intersection has a large fraction of corrupted samples, and we simply delete all the points in the intersection and continue. A simple and important idea here is that most of the corrupted points can be partitioned among the coordinate directions. Now consider a general rotation, i.e., A is orthonormal and a = 0. This turns out to be substantially more challenging. The following bound on the TV distance serves as a starting point. Lemma 1.2. Let H = [−1, 1]d. Suppose A, (cid:98)A are d × d matrices; A is orthonormal and (cid:98)A is a matrix with unit length rows. There is an absolute constant C s.t. dTV ( (cid:98)AH, AH) ≤ C (cid:213) i ai − ai (cid:107)2. (cid:107) (cid:98) This lemma follows from Lemma 4.5, in which we prove the fraction of the volume of {x ∈ AH : ai > 1} is tightly bounded by C (cid:107) ai − ai (cid:107)2. Crucially, the RHS terms are not squared. If they were, (cid:98) (cid:98) x * 3 it would be the Frobenius norm and we can hope to robustly estimate to within low error. This norm however is not rotationally invariant, depends on the target basis (as it should!), and could be much larger. To learn a rotation, we start with a coarse approximation, where each facet normal is approxi- mated to within poly(ε) error. Then, we consider one vector at a time (keeping the others fixed) and iteratively "improve" it. Our desired objective is to maximize the number of uncorrupted sample points inside the parallelopiped defined by the current vectors. But this is hard to estimate or improve locally. Instead, we focus on minimizing the number of points outside the band | x| ≤ 1. ai − ai (cid:107)2 = δ, then the mean of points in the We do this by proving that if the current distance (cid:107) (cid:98) a(cid:62) x| ≤ 1} gives us an indication of which direction difference in this direction i.e., S = {x : (cid:98) i ai to make it closer to ai. In other words, we can improve the objective of number of points to move (cid:98) outside the band by a local update. However, the presence of outliers complicates matters, as a small number of outliers could radically alter the location of the mean outside the band. To address this challenge, we prove that estimating the mean of this subset S robustly in Euclidean norm suffices to preserve the gradient approximately! Alongside, to keep the influence of noise under control, we ensure that pairwise intersections of bands are all small. Roughly speaking, our algorithm is robust gradient descent with provable guarantees. x ≥ 1, |aT i a(cid:62) (cid:98) i We combine the above procedures by alternating between them to robustly learn arbitrary affine transformations. 2 Preliminaries 2.1 Robust Estimation Theorem 2.1 (Robust Mean Estimation for Bounded Covariance Distributions). [11] There exists a polynomial time algorithm that takes input an ε-corruption sample of a collection X of n points in Rd where the mean of X is μ and the covariance of X is Σ and outputs an estimate ̃μ satisfying (cid:107) ̃μ − μ(cid:107)2 ≤ O( √ ε)(cid:107)Σ(cid:107)1/2 2 . Theorem 2.2 (Theorem 1.4 in [16], see also [17]). There exists a polynomial time algorithm that given a corrupted sample X of n points in Rd drawn from a rotated cube AH where A ∈ Rd×d is a orthogonal matrix with rows a1, . . . , ad, outputs component estimates ˆa1, . . . , ˆad ∈ Rd with the following guarantee: the components estimates satisfy with high probability, there exists a permutation π ∈ Sd such that for any i ∈ [d], (cid:104) ˆai * aπ(i)(cid:105)2 ≥ 1 − O( ε). √ 2.2 Logconcave functions The following lemmas are either from [18] or direct consequences. Lemma 2.3. Let f measure ν. Let u, v be unit vectors in R2 with |u(cid:62)v| ≤ 1 : R2 → R+ be an isotropic two-dimensional logconcave density with associated 2 . Consider the bands Hu = {x : u(cid:62)x ≥ au } 4 and Hv = {x : v(cid:62)x ≥ av } and assume that the marginal densities along u and v, fu and fv satisfy fu(au), fv(av) ≥ 1/2. Then, for a universal constant C, ν(Hu ∩ Hv) ≤ Cν(Hu)ν(Hv) Lemma 2.4. Let f be a one-dimensional logconcave density with mean 0 and variance σ2. Let μ+ = E f (y|y ≥ 0). Then there exist universal constants c1, c2 s.t. c1σ ≤ μ+ ≤ c2σ. Lemma 2.5. For any one-dimensional logconcave density f : R → R+ with mean μ, we have Lemma 2.6. Let f be a one-dimensional logconcave density with mean μ. Then Pr(X ≥ μ) ≥ 1 e . f (μ) ≥ 1 8 max f (x). Lemma 2.7. Suppose Mn( f ) are the moments of f , i.e., ∫ ∞ Mn( f ) = t n f (t) dt. If f is logconcave, then the sequence Mn( f )/n! is logconcave. 0 2.3 Cubes The following facts about cubes will be useful. While the precise constants in the bounds are not important for our analysis, the first two facts have been a subject of inquiry in asymptotic convex geometry. Lemma 2.8. [5] Let B = [−1/2, 1/2]d be the d-dimensional cube with volume 1 and a ∈ Rd be an arbitrary unit vector. Then for all t ≤ 3/4, vol({x ∈ B : |x * a| > t 2 }) ≤ 1 − t. Lemma 2.9. [4] Let B = [−1/2, 1/2]d be the d-dimensional cube with volume 1 and a ∈ Rd be an arbitrary unit vector.. Then (d − 1)-volume of any sections of B defined by a and t is at most √ 2 voln−1({x ∈ B : x * a = t}) ≤ √ 2. The next fact follows from the above lemma and a calculation using the logconcavity of one-dimensional marginals of the hypercube. Lemma 2.10. Let x ∼ [−1, 1]d be a uniform random vector on H = [−1, 1]d and y = x * a where a is an arbitrary unit vector. Let μt = E f (y|y ≥ t). For 0 ≤ t ≤ 1/2, there exists universal constant c s.t. μt ≥ t + c. 5 3 Robustly learning a Shift and Diagonal Scaling In this section, we give an algorithm for robustly learning arbitrary shifts and diagonal scalings of the uniform distribution on the solid hypercube H = [−1, 1]d . That is, x → Ax + b when A is a diagonal matrix. Since the uniform distribution on H is symmetric around 0, we can WLOG assume that all the entries of A are non-negative. This special case is equivalent to learning affine transformations that correspond to a shift (i.e., introducing a non-zero mean) and scaling (i.e., scales each of the coordinates of the hypercube by an unknown and potentially different positive scaling factor). More precisely, we will prove: Theorem 3.1. Suppose H is an unknown axis-aligned cube in Rd, that is, H = AH0 + b = ⊗d [ui , vi] i=1 where A ∈ Rd×d is a diagonal matrix, b ∈ Rd and H0 = [−1, 1]d is the unit cube. There exists an algorithm that, for small enough constant ε > 0, takes an ε-corruption X = x(1), x(2), . . . , x(n) of size n ≥ n0 = poly(d, 1/ε) of an iid sample from the uniform distribution on H and outputs (cid:98)H = (cid:98)AH0 + (cid:98)b such that dTV (H, (cid:98)H) ≤ 4ε. Remark 3.2. While we will omit this refinement here, a more careful analysis of our algorithm produces a tighter bound of dTV (H, (cid:98)H) ≤ (2 + ε)ε. We first describe our algorithm: Algorithm 3.3. 1. Input: An ε-corruption X of an iid sample of size n chosen from ⊗d i=1 [ui , vi]. 2. Robust Range Finding: For each 1 ≤ i ≤ d, arrange the input corrupted sample in increasing order of yi. Let [li , ri] be the interval of the smallest length that includes the middle 1/2 + ε fraction of the points (notice that such an interval is uniquely defined). Set ˆui = 2li and ˆvi = 2ri. Notice that {x ∈ Rd : vi ≤ xi ≤ ui } is an axis-aligned cube that contains the true cube and all the side lengths are at most twice the true cube. 3. One-Dimensional Density Check: For all i ∈ [n], k ∈ [d], check if |S+ i,k | := |S− i,k | := (cid:26) (cid:26) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) x : x(i) ≥ (cid:18) 1 − (cid:19) kε d ˆui + x : x(i) ≤ kε d ˆui + (cid:18) 1 − kε d kε d (cid:19) ˆvi ˆvi (cid:27)(cid:12) (cid:12) (cid:12) (cid:12) (cid:27)(cid:12) (cid:12) (cid:12) (cid:12) ≥ ≥ kε 2d kε 2d n n (1) (2) 4. Update: If (1) is false for some i and k, update ˆui = ˆui − kε d ( ˆui − ˆvi) and go back to Step 3. If (2) is false for some i and k, set ˆvi = ˆvi + kε d ( ˆui − ˆvi) and iterate (go back to Step 3). 5. Two-Dimensional Density Check: For all i, j ∈ [n], k1, k2 ∈ [d], check if |S+ i,k1 ∩ S+ j,k2 |, |S+ i,k1 ∩ S− j,k2 |, |S− i,k1 ∩ S− j,k2 | ≤ 10k1k2ε2 d2 n (3) 6 6. Update: If (3) is false for some i, j and k1, k2, remove all points in the violating intersection from the sample set and go back to Step 3. 7. Return: Output the cube ⊗d i=1 [ ˆui , ˆvi]. Notice that in this case, our goal is effectively to determine the intervals [ui , vi] for each 1 ≤ i ≤ d that describe the i-th dimension of the shifted and scaled hypercube H. The key idea of the algorithm is a certificate that checks a set of efficiently verifiable conditions on the corrupted sample with the guarantee that 1) the true parameters satisfy the checks, and 2) any set of parameters that ˆH that is O(ε) different in symmetric volume difference (that satisfy the checks yield a hypercube gives us a total variation bound) from the true hypercube H. Our certificate itself is simple and natural and corresponds to checking that 1) for each of the coordinates 1 ≤ i ≤ d, the discretized density (i.e., fraction of points lying in discrete intervals of size ∼ ε/d in the purported range estimated from the corrupted sample matches the expected density of the uniform distribution on AH + b, and 2) for each pair of coordinates, the fraction of points in the intersection of intervals of length ∼ ε/d along all possible pairs of directions match the expected density. Notice that all such statistics in an uncorrupted sample match those of the population with high probability so long as the the sample is of size poly(d/ε). To analyze the above algorithm, we will prove that any set of parameters that satisfy the checks in our certificate (1),(2),(3) in Algorithm 3.3 must yield a good estimate of true parameters. Specifically, Lemma 3.5 shows that the volume of (cid:98)H that is not contained in H is small. Lemma 3.7 shows that the volume of H that is not covered by (cid:98)H is small. Together, these two lemmas imply that our estimated distribution is O(ε) close in total variation to the true hypercube. Our proof relies on an elementary combinatorial claim about set systems that we state next. We defer the proof to Section 6. Lemma 3.4. Let S1, . . . , Sd ⊆ [n] be arbitrary subsets. Let frac(S) := |S|/n be normalized size of S. Suppose that (cid:16)(cid:216) Si (cid:17) = ε frac for some ε < 1 and for all i, j, for some α > 0 s.t. αε < 1. Then, frac(Si ∩ Sj) ≤ αfrac(Si)frac(Sj), (cid:213) i∈[d] frac(Si) ≤ ε 1 − αε . (4) (5) (6) Lemma 3.5. Let X = {x(1), x(2), . . . , x(n)} be an ε-corruption of an iid sample from the uniform distribution on H = ⊗d [ ˆui , ˆvi] be any axis-aligned hypercube satisfying (1),(2),(3). Then, with probability at least 1 − 1/d over the draw of the original uncorrupted sample, [ui , vi]. Let (cid:98)H = ⊗d i=1 i=1 vol( (cid:98)H \ H) vol( (cid:98)H) ≤ 4ε. Here, vol denotes the usual Lebesgue volume of sets in Rd. 7 Proof. For only the sake of analysis, we set ˆui − ˆvi = 1. In this normalization, vol( (cid:98)H) = 1. For each i, discretize the interval [ ˆui , ˆvi] to a grid with intervals of size ε( ˆui − ˆvi)/d = ε/d. We further assume that the vertices of the unknown H are rounded to points in this grid. This assumption amounts to a change in the volume of H by at most εvol( ˆH). We will then show that the density of points in the difference (cid:98)H \ H, i.e., {x : x ∈ (cid:98)H, x ∉ H} is |{x ∈ X : x ∈ (cid:98)H \ H}| vol( (cid:98)H \ H) ≥ 1 4 n. (7) From the inequality above, it follows that vol( (cid:98)H \ H) ≤ 4 n |{x : x ∈ (cid:98)H \ H}| ≤ 4ε since |{x : x ∈ (cid:98)H \ H}| ≤ εn. So it suffices to prove (7). For all i ∈ [d], suppose ui − ˆui = ci ε/d, ˆvi − vi = c(cid:48) i ˆvi }. By (1) and (2), we have |Si | ≥ (ci + c(cid:48) i ) ε 2d n. By (3), we have for any i ≠ j, ε/d. Let Si = {x ∈ X : ˆui ≤ xi ≤ ui , vi ≤ xi ≤ |Si ∩ Sj | ≤ 10(ci + c(cid:48) i) ε2 d2 n ≤ 40|Si ||Sj |n. Then by Lemma 3.4 with α = 40, | (cid:208) Si | n − 40| (cid:208) Si | ≥ (cid:213) i∈[d] |Si | n , |{x : x ∈ (cid:98)H \ H}| n − 40|{x : x ∈ (cid:98)H \ H}| ≥ ε 2d d (cid:213) (ci + c(cid:48) i). i=1 By the upper bound on the total number |{x : x ∈ (cid:98)H \ H}| ≤ εn ≤ n/80, the denominator is at least n/2. Then |{x : x ∈ (cid:98)H \ H}| ≥ ε 4d n d (cid:213) (ci + c(cid:48) i). i=1 Thus we get (7) by vol( (cid:98)H \ H) ≤ ε d (cid:205)d i=1 (ci + c(cid:48) i ). Next we show that Step 6 removes at most εn true points in total. Lemma 3.6. With high probability, at least half of points removed in Step 6 are outliers. Proof. Suppose we remove points from an intersection S+ i,k1 | > 10k1k2ε2 d2 ∩ S+ |S+ i,k1 j,k2 ∩ S+ j,k2 , i.e., n. (cid:3) (8) If the violating intersection is outside the true cube, all the points are outliers. Otherwise, we can compute the volume by definition of S+ i,k vol(S+ i,k1 ∩ S+ j,k2 ) = k1k2ε2 d2 ( ˆui − ˆvi)( ˆuj − ˆv j) ≤ 4k1k2ε2 d2 8 where the last equality follows from ˆui − ˆvi is at most twice of the true side length. Then with high probability, the number of original uncorrupted sample in the region S+ of volume i,k1 4k1k2ε2/d2 is at most 5k1k2ε2n/d2. Thus, comparing with (8), we can see that at least half of the (cid:3) point removed by the algorithm are outliers. ∩ S+ j,k2 Lemma 3.7. Let X = {x(1), x(2), . . . , x(n)} be an ε-corruption of an iid sample from the uniform distribution on H = ⊗d [ ˆui , ˆvi] be an axis-aligned hypercube satisfying (1),(2),(3). Then, with probability at least 1 − 1/d over the draw of the original uncorrupted sample, [ui , vi]. Let (cid:98)H = ⊗d i=1 i=1 vol(H \ (cid:98)H) vol(H) ≤ 4ε. Proof. For only the sake of analysis, we set ˆui − ˆvi = 1 and vol( (cid:98)H) = 1. For i ∈ [d] s.t. ˆui < ui or vi < ˆvi, we define Si = {x : ˆui < xi ≤ ui , vi ≤ xi < ˆvi } and ci = ui − ˆui , c(cid:48) i = ˆvi − vi. Then H \ (cid:98)H = (cid:216) Si. {i: ˆui <ui , or vi < ˆvi } (ci + c(cid:48) i Since Si are removed by the algorithm, by (1) and (2), |Si | < 1 )n. Since Si is in the true 2 cube, the original uncorrupted sample in Si is at least (ci + c(cid:48) )n with high probability. So there are i at least half of the original uncorrupted sample in Si are removed by either the adversary or by the algorithm. Suppose ηi n is the number of original uncorrupted sample removed in Si. Then ). By Lemma 3.6, the total number of points deleted by the algorithm is at most εn. ηi ≥ 1 2 Hence the number of deleted points in (cid:208) Si is at most 2εn. The deletion in the intersection of Si and Sj is naturally upper bounded by the number of original uncorrupted sample. So we can apply Lemma 3.4 with α = 4 to the deletion in Si and get (ci + c(cid:48) i 2ε 1 − 8ε ≥ (cid:213) ηi. {i: ˆui <ui , or vi < ˆvi } If ε ≤ 1/16, the left hand side is at most 4ε. Thus vol(H \ (cid:98)H) = vol (cid:16)(cid:216) Si (cid:17) vol(Si) (cid:213)(ci + c(cid:48) i) ≤ (cid:213) ≤ 1 2 ≤ (cid:213) ηi ≤ 4ε. Now, with Lemmas 3.5 and 3.7, we can prove our main result of the shift and scaling case. Proof of Theorem 3.1. If the algorithm outputs a cube (cid:98)H satisfies (1),(2),(3), then by Lemma 3.5 and Lemma 3.7, dTV (H, (cid:98)H) = 1 − vol(H ∩ (cid:98)H) max{vol(H), vol( (cid:98)H)} (cid:40) = max vol(H \ (cid:98)H) vol(H) , vol( (cid:98)H \ H) vol( (cid:98)H) (cid:41) = 4ε. (cid:3) 9 Otherwise, the algorithm improves one of ˆui or ˆvi by at least ε/d. Thus, within at most O(d2/ε) iterations, the algorithm terminates. If the algorithm terminates when it deletes 2εn points, by (cid:3) Lemma 3.6, we remove all noisy points. 4 Rotation In this section, we give a robust algorithm to learn rotations of the uniform distribution of the standard hypercube. Specifically, we will show: Theorem 4.1. Suppose H = [−1, 1]d is the standard cube in Rd and A ∈ Rd×d be an unknown rotation matrix. There exists an algorithm that given an ε-corruption X = {x(1), . . . , x(n)} of size n ≥ n0 = poly(d, 1/ε) of an iid sample from the uniform distribution on AH, runs in poly(n) time and outputs (cid:98)A such that dTV (AH, (cid:98)AH) = O(ε). We first describe the algorithm: Algorithm 4.2. Input: ε-corrupted sample X = {x(1), x(2), . . . , x(n)}. Output: (cid:98)A with unit length rows ˆa(1), . . . , ˆa(d). 1. Warm Start: Run the robust moment estimation algorithm in Theorem 2.2 and get an estimate (i) = ˆa(i) for (d), so that for each i, (cid:107) ˆa(i) − a∗ ε). Initialize a0 (cid:107)2 = O( , . . . , a∗ √ (i) of A with rows a∗ (1) each i. 2. For any vector a ∈ Rd , let S(a) = {x : x * a > 1} ∪ {−x : x * a < −1}. For t = 1, 2, . . . , 212d log d, do: (a) Two-Dimensional Density Check: For all j < i, check if 1 n |S(at (i) ) ∩ S( ˆa(j))| > 2c1 n2 |S(at (i) )||S( ˆa(j))| If false, remove all points in the intersection S(at (i) ) ∩ S( ˆa(j)). (b) Robust GD: Robustly estimate the mean ̃μ by applying algorithm in Theorem 2.1 to the subset S(at (i) ). Set β = at+1 (i) = st+1 = )| , c2|S(at (i) (cid:107) ̃μ(cid:107)2n at (i) (cid:107)at (i) (cid:12) (cid:12) (cid:12) − β ̃μ − β ̃μ(cid:107) {x : |x * at+1 (i) | > 1} (cid:12) (cid:12) (cid:12) Add back points that are removed in Step (a), i.e., recover the sample set to the origin one X. 10 Let ˆa(i) = at (i) where t minimizes st . 3. Output the matrix (cid:98)A with rows ˆa(1), . . . , ˆa(d). 4.1 Outline of analysis For the purpose of analysis, we assume that the true rotation matrix is the identity matrix in the rest of Section 4. We will analyze Algorithm 4.2 by the following propositions. First we show that we can separately learn the rows of the rotation matrix. Let S(a) = {x : x * a > 1} ∪ {−x : x * a < −1}. For a set of unit vectors ˆa(1), . . . , ˆa(d) and a corrupted sample X, after we remove samples in all the intersections such that 1 n |S( ˆa(i)) ∩ S( ˆa(j))| > 2c1 n2 |S( ˆa(i))||S( ˆa(j))| as in Step 2(a) of Algorithm 4.2, we can define εi as the fraction of outliers in S( ˆa(i)) and ηi as the fraction of original uncorrupted sample in S( ˆa(i)) that are removed by the adversary or by the algorithm. That is, εi and ηi are exactly the fraction of corrupted samples when we robustly estimate ̃μ. In the following Proposition, we show that the sum of εi and ηi is small, which implies we do not increase the fraction of outliers by separately learning a(1), . . . , a(d). Proposition 4.3. Let Xi be the subset of corrupted sample X after removing samples in Step 2(a) of Algorithm 4.2 and S( ˆa(i)) = {x : x * ˆa(i) > 1, x ∈ Xi } ∪ {−x : x * ˆa(i) < −1, x ∈ Xi }. Let εi be the fraction of outliers in S( ˆa(i)), and ηi be the fraction of original uncorrupted sample in S( ˆa(i)) that are removed by the adversary or the algorithm. Suppose for all i, ˆa(i) * ei ≥ 0.99 and for all i, j, Then, 1 n |S( ˆa(i)) ∩ S( ˆa(j))| ≤ 2c1 n2 |S( ˆa(i))||S( ˆa(j))|. (cid:213) i∈[d] (εi + ηi) ≤ 2ε. The proof of Proposition 4.3 is deferred to Section 4.3. Next, we give a robust algorithm that updates a single rotation vector ˆa(i) of the cube with a small constant fraction of corruption in {x : |x * ˆa(i)| > 1}. We show that by repeatedly applying this algorithm on ˆa(i) at most O(d log d) times, we can learn the rotation vector ei with error O(εi + ηi). Proposition 4.4. Suppose H = [−1, 1]d is the true hypercube. There exists a robust algorithm that given ε-corrupted samples from H and a unit vector a0 − ei (cid:107)2 ≤ 0.1, outputs (i) such that (cid:107)a0 (i) (cid:107) ˆa(i) − ei (cid:107)2 ≤ 214(εi + ηi) after at most 212d log d iterations, where εi + ηi is the fraction of corruption in {x : x * ˆa(i) > 1}. The proof of Proposition 4.4 is deferred to Section 4.4. With the two propositions above, we complete the proof of Theorem 4.1 in Section 4.5. 11 4.2 Properties of Cubes In this section, we prove a few basic properties of uniform samples from H = [−1, 1]d , in particular, of the subset of samples {x ∈ H : x * a > 1} for a unit vector a. We will later use them in our analysis of Algorithm 4.2. The following lemma is crucial for our analysis since it connects the 2-norm error of ˆa(i) and the volume of (cid:98)AH \ AH. Hence it implies Lemma 1.2. Lemma 4.5. Let Y be a uniform sample from H of size n. Suppose a is a unit vector such that (cid:107)a − ei (cid:107) = δ. Then with high probability the number of samples in S(a) ∩ Y is δ 5 n ≤ |S(a) ∩ Y| := |{x ∈ Y : |x * a| > 1}| ≤ (1 + δ)δ 4 n. Proof. Let ̄a be the d − 1-vector that excludes i-th coordinate of a. Since (cid:107)a − ei (cid:107) = δ, we have that ai = a * ei = 1 − δ2/2 and (cid:107) ̄a(cid:107) = δ + O(δ2). Let S+(a) := {x : x * a > 1}. By symmetry of the cube, 2vol(S+(a)) = vol(S(a)). So it suffices to compute the number of original uncorrupted sample in S+(a) and double it. We can compute the volume of S+(a) by integrating the length of xi over ̄x where ̄x is the vector x without entry xi. The upper bound on ̄x is 1 and the lower bound is x * a = 1, i.e., xi = 1− ̄x* ̄a ai . So we have vol(S+(a)) = ∫ ̄x∈[−1,1]d−1 max (cid:26) 0, 1 − 1 − ̄x * ̄a ai (cid:27) d ̄x Let y = ̄x * ̄a. Suppose p(y) is the density of y. Let 1 − 1− ̄x* ̄a ai write the integral above as ≥ 0. We have y ≥ δ2/2. Thus, we can vol(S+(a)) = 2 d−1 Pr (cid:32) (cid:18) y ≥ (cid:19) (cid:18) δ2 2 1 − 1 ai (cid:19) + 1 ai ∫ y≥ δ2 2 (cid:33) y * p(y) dy . (9) Since ̄x is a uniform random variable on [−1, 1]d−1, we have y is a scaled 1d-projection of the standard (d − 1)-cube onto an arbitrary direction with zero mean and variance (cid:107) ̄a (cid:107)2/3 = δ2/3. Since y is logconcave and symmetric, we can bound the probability 1/2 − δ ≤ Pr ≤ 1/2. We define μy := E(y | y ≥ δ2/2) = ∫ y * p(y) dy as the truncated mean of y. Then y ≥ δ2 2 (cid:16) (cid:17) y≥ δ2 2 vol(S+(a)) = 2 d−1 Pr (cid:18) y ≥ (cid:19) (cid:18) δ2 2 1 − 1 ai + (cid:19) μy ai (10) By Lemma 2.4, μy is upper and lower bounded by Θ(δ). The upper bound is achieved when ̄a is in the direction of true coordinates, which is (1 + δ)δ/2. Let y+ be the truncated density of y are M0(y+) = 1, M1(y+) ≤ μy , M2(y+) = δ2/3. By Lemma 2.7, on R+ and μy into (10), we δ ≥ 2 M2 5 1 get . Then raw moments of y+ M2 2 . Then μy ≥ M1 ≥ 1√ δ. Plugging the bounds of Pr y ≥ δ2 2 ≥ M0 (cid:17) (cid:16) 6 2δ 5 − δ2 2 ≤ 1 − 1 ai + μy ai = μy − δ2/2 1 − δ2/2 ≤ δ + δ2 2 12 d−1 2 5 δn ≤ vol(S+(a)) ≤ 2 d−3(1 + δ)δn. Since the volume of the standard cube H is 2 S+(a) is at least 2 d−1δ/(5 * 2 samples in S(a) is at least δ/5 and at most (1 + δ)δ/4. d) = δ/10 and at most 2 d , the probability a uniformly random sample is in d = (1 + δ)δ/8. Thus the fraction of (cid:3) d−3(1 + δ)δ/2 Lemma 4.6. Suppose (cid:107)a − ei (cid:107) = δ. Let μ be the mean of the subset of the cube: {x ∈ [−1, 1]d Then μ * ei ≤ 1 − δ/32. : a * x > 1}. Proof. Let S+(a) = {x ∈ [−1, 1]d a fixed constant c < 1. Then by the trivial upper bound: xi ≤ 1 for any x in the cube, (cid:19) : x * a > 1} and S(cid:48) = {x ∈ [−1, 1]d μ * ei ≤ vol(S(cid:48)) + (1 − cδ)(vol(S+(a)) − vol(S(cid:48))) (cid:18) = 1 − cδ . 1 − vol(S(cid:48)) vol(S+(a)) vol(S+(a)) : x * a > 1, xi = x * ei > 1 − cδ} for We can compute the volume of S(cid:48) by integral over xi. vol(S(cid:48)) vol(H) = = ∫ 1 1−cδ ∫ 1 1−cδ 1 2 1 2 Pr(x * a > 1 | xi) dxi Pr( ̄x * ̄a ≥ 1 − xi * ai) dxi Let y = ̄x * ̄a/(cid:107) ̄a(cid:107). Since x1 and ̄x are independent, ̄x is uniformly random over the d − 1 standard cube and y is the projection of ̄x onto an arbitrary unit vector. Let t = (1 − xi)/δ and hence xi = 1 − tδ. Then dxi = −δ dt. By substitution, ∫ c ∫ c (cid:18) (cid:19) vol(S(cid:48)) vol(H) = 1 2 Pr t=0 y ≥ 1 − xi * ai (cid:107) ̄a (cid:107) δ dt ≤ 1 2 t=0 Pr(y ≥ t)δ dt By Lemma 2.8, Pr(y ≥ t) ≤ 1/2(1 − t) for any t ≤ 3/4. Take c = 1/2. Then we get vol(S(cid:48)) vol(H) ≤ 1 2 ∫ c t=0 1 2 (1 − t)δ dt = (c − c2/2)δ = 1 4 δ. 3 32 By Lemma 4.5, vol(S+(a)) vol(H) ≥ δ/10. Thus μ * ei = 1 − cδ (cid:18) 1 − vol(S(cid:48)) vol(S+(a)) (cid:19) ≤ 1 − δ/32. Lemma 4.7. Let H be the standard hypercube [−1, 1]d. Suppose (cid:107)a − ei (cid:107) = δ. Then the variance of uniform distribution on H ∩ {x : x * a > 1} in the direction ei is at most cδ2. Proof. Suppose p(xi) is the density function of xi on {x : x * a > 1} and ̄x, ̄a are vectors constructed from x, a by excluding i-th coordinate. Then p(xi) ∝ vold−1({x : x * a > 1, xi is fixed}) ∝ Pr ̄x ( ̄x * ̄a > 1 − ai xi). (cid:3) 13 Let y = ̄x * ̄a. Then y is logconcave and symmetric with mean 0 and variance δ2/3. So in the range xi ∈ [−1, 1], p(xi) is increasing. Then max p(xi) = p(1) ∝ Pr(y > δ2/2) ≥ 1 2 − δ. and p(1 − δ) ∝ Pr(y > 1 − ai(1 − δ)) ≤ Pr(y > δ) ≤ 3 − 2 4 √ 2 . If δ < 0.1, then p(1 − δ) < 1 8 max p(xi). By the monotonicity of p(xi), we have μ ≥ 1 − δ. Then by Lemma 2.4, the variance of xi on the whole subset is (cid:3) upper-bounded by the variance of one side of the mean. 8 max p(xi). By Lemma 2.6, p(μ) ≥ 1 4.3 Rotation matrix can be learned coordinate by coordinate In this section, we prove Proposition 4.3 via Lemmas 4.8 and 4.9. Recall that S( ˆa(i)) = {x : x * ˆa(i) > 1} ∪ {−x : x * ˆa(i) < −1} and εi is the fraction of outliers in S( ˆa(i)), ηi is the fraction of original uncorrupted sample in S( ˆa(i)) that are removed. Lemma 4.8. Let Xi be the subset of corrupted sample X after removing samples in Step 2(a) of Algorithm 4.2 and S( ˆa(i)) = {x : x * ˆa(i) > 1, x ∈ Xi } ∪ {−x : x * ˆa(i) < −1, x ∈ Xi }. Let εi be the fraction of outliers in S( ˆa(i)). Suppose for all i, ˆa(i) * ei ≥ 0.99 and for all i, j, 1 n |S( ˆa(i)) ∩ S( ˆa(j))| ≤ 2c1 n2 |S( ˆa(i))||S( ˆa(j))|. Then (cid:205)i∈[d] εi ≤ 2ε. Proof. Let SN ( ˆa(i)) be the set of outliers that in the halfspace {x : x * ˆa(i) > 1}. We know the fraction of all outliers is at most ε. So we have frac (cid:0)(cid:208) SN ( ˆa(i))(cid:1) ≤ ε. We may assume that εi ≥ c3frac(S( ˆa(i))). Otherwise, we can reduce frac(S( ˆa(i))) by running the update algorithm in Section 4.4 (Corollary 4.13). Then frac(SN ( ˆa(i)) ∩ SN ( ˆa(j))) ≤ frac(S( ˆa(i)) ∩ S( ˆa(j))) ≤ 2c1frac(S( ˆa(i)))frac(S( ˆa(j))) ≤ 2c1 c2 3 εi εj. Set α = 2c1 c2 3 , we get frac(SN ( ˆa(i)) ∩ SN ( ˆa(j))) ≤ αfrac(SN ( ˆa(i)))frac(SN ( ˆa(j))). Then by Lemma 3.4, (cid:205) εi = (cid:205)i∈[d] frac(SN ( ˆa(i))) ≤ ε (cid:205) εi ≤ 2ε. 1−αε . If ε ≤ c2 3 4c1 , then 1 − αε > 1/2 and hence (cid:3) Lemma 4.9. Let Xi be the subset of corrupted sample X after removing samples in Step 2(a) of Algorithm 4.2 and S( ˆa(i)) = {x : x * ˆa(i) > 1, x ∈ Xi } ∪ {−x : x * ˆa(i) < −1, x ∈ Xi }. Let ηi be the fraction of original 14 uncorrupted sample in S( ˆa(i)) that are removed by the adversary or the algorithm. Suppose for all i, ˆa(i) * ei ≥ 0.99 and for all i, j, 1 n |S( ˆa(i)) ∩ S( ˆa(j))| ≤ 2c1 n2 |S( ˆa(i))||S( ˆa(j))| then (cid:205)i∈[d] ηi ≤ 2ε. Proof. If (cid:107) ˆa(i)−ei (cid:107) = δi ≥ 8ε(cid:48) i is the fraction of original uncorrupted sample deleted by the adversary, then by Lemma 2.3, the number of original uncorrupted sample in {x : x * ˆa(i) > 1, x * ˆa(j) > 1} is at most c1δi δ j. The number of points that are deleted by the algorithm in {x : x * ˆa(i) > 1, x * ˆa(j) > 1} is at least 2c1(δi − ηi)(δ j − ηj). Then the fraction of original uncorrupted sample in the deleted points is at most i and (cid:107) ˆa(j)−ej (cid:107) = δ j ≥ 8ε(cid:48) j where ε(cid:48) c1δi δ j 2c1(δi − ε(cid:48) i )(δ j − ε(cid:48) j ) ≤ 1 2(1 − 1/8)2 ≤ 32/49. In this case, at least 17/49 of the points that are deleted by the algorithm are outliers. So the number of deleted original uncorrupted sample is at most 32 17 ε < 2ε. If (cid:107) ˆa(i) − ei (cid:107) < 8ε(cid:48) i (or (cid:107) ˆa(j) − ej (cid:107) < 8ε(cid:48) uncorrupted sample in {x : x * ˆa(i) > 1} by 8ε(cid:48) i case is at most 8 4 (cid:205)i ε(cid:48) i ≤ 2ε. j), then we can upper bound the total number of original /4. So the number of true points we deleted in this (cid:3) Combining Lemmas 4.8 and 4.9 gives the conclusion of Proposition 4.3. 4.4 Update rotation vector by the mean of outside samples As in the previous sections, we assume a is the current rotation vector and e is the true rotation vector such that (cid:107)a − e (cid:107) = δ. We first give a non-robust algorithm that improves a. Given a sample X = {x(1), . . . , x(n)} and a unit vector a, the algorithm computes μ of the subset of the sample and outputs {x : x * a > 1} ∪ {−x : x * a < −1} a(cid:48) = a − βμ (cid:107)a − βμ(cid:107) . Lemma 4.10. If the step size β ≤ 2cδ/(cid:107)μ(cid:107)2, then the non-robust algorithm outputs a unit vector a(cid:48) such that a(cid:48) * e − a * e ≥ βδ/32. Proof. By the definition of a(cid:48) , we have a(cid:48) * e = a * e − βμ * e (cid:112)(a − βμ)(a − βμ) Since (cid:107)a − e (cid:107) = δ and a, e are unit vectors, a * e = (2 − (cid:107)a − e (cid:107)2)/2 = 1 − δ2/2. By Fact 4.6, we know μ * a ≥ 1 + cδ and μ * e ≤ 1 − cδ. Plugging into the right hand side of the equation above, we get 1 − δ2/2 − β(1 − cδ) 1 − 2β(1 + cδ) + β2(cid:107)μ(cid:107)2 a(cid:48) * e ≥ (cid:112) 15 ≥ 1 − β + cβδ − δ2/2 (cid:112)1 − 2β ≥ (1 − β + βδ/32 − δ2/2)(1 + β + 3 2 ≥ 1 − δ2/2 + βδ/32 β2) where the second inequality follows from our assumption that β ≤ 2cδ/(cid:107)μ(cid:107)2. Thus a(cid:48) * e − a * e ≥ (cid:3) βδ/32. Algorithm 4.11. Input: corrupted sample x1, . . . , xn and a unit vector a such that (cid:107)a − e (cid:107) = δ. Output: a unit vector a(cid:48) Parameters: step size β > 0 1. Compute the robust mean ̃μ of the following set using the algorithm in Theorem 2.1 2. Output {x : x * a > 1} ∪ {−x : x * a < −1} a(cid:48) = a − β ̃μ (cid:107)a − β ̃μ(cid:107) Then the robust version of the algorithm is to replace the mean μ in Step 1 by the robust mean ̃μ. We will use the robust mean estimation algorithm for bounded covariance distributions in Theorem 2.1. Suppose the number of corrupted sample in the subset {x : x * a > 1} is εi n. With the similar argument as in the proof of Lemma 4.10, we can show the following result. Lemma 4.12. If εi ≤ 2 a(cid:48) such that a(cid:48) * ei − a * ei ≥ 1 128 Proof. By the definition of a(cid:48) −14δ and β ≤ βδ. , we have δ 32(cid:107) ̃μ(cid:107)2 , then the robust version of the algorithm outputs a unit vector a(cid:48) * e = a * e − β ̃μ * e (cid:112)(a − β ̃μ)(a − β ̃μ) Since (cid:107)a − e (cid:107) = δ and a, e are unit vectors, a * e = (2 − (cid:107)a − e (cid:107)2)/2 = 1 − δ2/2. a(cid:48) * ei ≥ 1 − δ2/2 − β ̃μ * e 1 − 2β ̃μ * a + β2(cid:107)μ(cid:107)2 (cid:112) ≥ (1 − δ2/2 − β ̃μ * e)(1 + β ̃μ * a − β2(cid:107) ̃μ(cid:107)2/2 + O(β2)) ≥ 1 − δ2/2 + β( ̃μ * a − ̃μ * e) − β2(cid:107) ̃μ(cid:107)2/2 − δ2 2 β ̃μ * a By Fact 4.6, we know μ * ei ≤ 1 − δ/32. Assuming that the fraction of corruption is c, we apply the algorithm in Fact 2.1 to compute the robust mean ̃μ, which gives an error guarantee that 16 √ ( ̃μ − μ) * ei ≤ O( Lemma 4.7, σ2(ei) is at most δ. Thus we have ̃μ * e ≤ 1 − (1/32 − points in {x : x * a > 1} is at least (δ/5)n. So the fraction of corruption is bounded by c)σ(ei) where σ2(ei) is the variance of {x : x * a > 1} in the direction ei. By c)δ. By Lemma 4.5, the fraction of √ c ≤ εi δ/5 ≤ 5 * 2 −14 where the last inequality follows from our assumption that εi ≤ 2 ̃μ * a > 1 and our condition (cid:107) ̃μ(cid:107)2 ≤ δ 32β , we get −14δ. By the trivial upper bound a(cid:48) * ei − a * ei ≥ β (cid:18) ( 1 32 √ − c)δ − δ 64 − (cid:19) δ2 2 ≥ 1 128 βδ. (cid:3) Corollary 4.13. By repeatedly running Algorithm 4.11 212d log d times, one of at (i) satisfies Proof. We start with (cid:107)a − ei (cid:107) = δ. Each time we run the algorithm, (cid:107)at (i) − ei (cid:107) ≤ 214εi. a(cid:48) * ei − a * ei ≥ 1 128 βδ = δ2 128 * 32(cid:107) ̃μ(cid:107)2 ≥ δ2 212d √ by Lemma 4.12 and the upper bound 211d . The optimal error we can get by repeatedly running this algorithm is 210εi from the condition of Lemma 4.12. When (cid:107)a − ei (cid:107) > 214εi, we have εi ≤ 2 as in Lemma 4.12. Suppose after t steps, the error is reduced to 214εi. Then −14δ so the algorithm will output a better a(cid:48) d on norm of the mean. Then (cid:107)a(cid:48) − e (cid:107)/(cid:107)a − e (cid:107) ≤ 1 − 1 (cid:113) (cid:33) t (cid:32)(cid:114) 1 − 1 211d δ = 214εi. √ Since δ ≤ ε and εi ≥ ε/d, we get t ≤ 212 * d * log δ 214εi ≤ 212d log d. (cid:3) 4.5 Proof of Theorem 4.1 Let εt uncorrupted sample removed from the set {x : x * at (i) i be the fraction of outliers in the set {x : x * at (i) > 1}. > 1} and ηt i be the fraction of original 17 Proof of Theorem 4.1. By Corollary 4.13, we know there exists an at ). First we show that A = (at 210(εt i (1) in TV distance. By Lemmas 4.8 and 4.9, , . . . , at + ηt i )(cid:62) (d) − ei (cid:107) ≤ is a good rotation matrix that AH is close to H (i) for all i such that (cid:107)at (i) (cid:213) (εt i + ηt i ) ≤ 4ε. Let S(a) = {x : x * a > 1} be a subset of samples after removing points in Step 2(a) of Algorithm 4.2. Then by Lemma 4.5, i (cid:213) i∈[d] |S(at (i) )| ≤ (cid:213) i∈[d] (cid:107)at (i) 1 4 − ei (cid:107)n ≤ 1 4 (cid:213) i∈[d] 210(εt i + ηt i ) ≤ 210εn. ˆA = ( ˆa(1), . . . , ˆa(d))(cid:62) Next, we prove to TV distance by showing the number of samples inside samples in ˆAH is at least is a good estimation of the true rotation matrix with respect ˆAH is at least (1 − cε)n. The number of n − (cid:213) |S( ˆa(i))| ≥ n − (cid:213) i i |S(at (i) )| ≥ (1 − 210ε)n. where the first inequality follows from |S( ˆai)| is the smallest over all t. Since each iteration is polytime and the total number of iterations is O(d2 log d), the overall complexity is polynomial in (cid:3) d. 5 General Case In this section, we give an algorithm to robustly learn an affine transformation of shift, scaling and rotation and prove our main result: Theorem 5.1. Given X = {x(1), . . . , x(n)} an ε-corrupted sample of points from an unknown cube H = {x ∈ Rd , ∀i ∈ [d]}, where n ≥ n0 = poly(d, 1/ε), there exists a polynomial-time algorithm that outputs (cid:98)H = {x ∈ Rd : ˆvi ≤ ˆa(i) * x ≤ ˆui , ∀i ∈ [d]} s.t. dTV ( (cid:98)H, H) = O(ε). * x ≤ u∗ i ≤ a∗ (i) : v∗ i Algorithm 5.2. 1. Run the robust mean and covariance estimation algorithms in Theorem 2.1 and get estimates of the mean ˆμ and covariance (cid:98)Σ of the cube with error (cid:107) ˆμ − μ∗(cid:107) ≤ C (cid:107)(cid:98)Σ − Σ∗(cid:107)2 ≤ C √ √ ε(cid:107)Σ∗(cid:107)1/2 ε(cid:107)Σ∗(cid:107)2. 2 2. Run the robust moment estimation algorithm in Theorem 2.2 and get an estimate of the rotation matrix (cid:98)A with unit rows ˆa(1), . . . , ˆa(d). 3. Repeat the following steps until the number of samples in {x : ˆvi ≤ ˆa * x ≤ ˆui , ∀i} is at least (1 − cε)n. 18 (a) Run Algorithm 3.3 with ˆa(1), . . . , ˆa(d) being the coordinates and update upper bounds and lower bounds of the cube ˆu1, . . . , ˆud, ˆv1, . . . , ˆvd (b) Run Algorithm 4.2 with upper bounds and lower bounds ˆu1, . . . , ˆud, ˆv1, . . . , ˆvd and update ˆa(1), . . . , ˆa(d). 4. Output the cube (cid:98)H = {x : ˆvi ≤ ˆa(i) * x ≤ ˆui , ∀i}. We analyze our algorithm by the following two propositions. Proposition 5.3 shows that the shift and scaling algorithm (Step 3(a)) learns the upper and lower bounds of the facets with error O(ε) + 0.7δ where δ is the error in rotation matrix. Proposition5.4 shows that the rotation algorithm (Step 3(b)) learns the rotation matrix with error O(ε) + δ where δ is the error in shift and scaling part. Proposition 5.3. Suppose (cid:107) ˆa(i) − a∗ (i) that ε. Algorithm 3.3 outputs ˆu1, . . . , ˆud, ˆv1, . . . , ˆvd such (cid:107) = δi ≤ C √ | ˆui − u∗ i u∗ i | + | ˆvi − v∗ i − v∗ i | ≤ 44εi + 0.7δi and (cid:205)i∈[d] εi ≤ 2ε. Proposition 5.4. Suppose such that where (cid:205)i∈[d] εi ≤ 2ε. | ˆui −u∗ i u∗ i |+| ˆvi −v∗ i −v∗ i | √ = δi ≤ C ε. Algorithm 4.2 outputs ˆA with unit rows ˆa(1), . . . , ˆa(d) (cid:107) ˆa(i) − a∗ (i) (cid:107) ≤ 220εi + δi We can now prove the main theorem. For the purpose of analysis, we assume that the true cube is the standard cube H = [−1, 1]d in the remaining of Section 5. √ √ ε and δr,i = (cid:107) ˆa(i) − ei (cid:107) ≤ C Proof of Theorem 5.1. Let δs,i = | ˆui −1| + | ˆvi −1| be the scaling error in coordinate i and δr,i ≤ (cid:107) ˆa(i) −ei (cid:107) be the rotation error in coordinate i. By Theorems 2.1 and 2.2, we start with δs,i = | ˆui − 1| + | ˆvi − 1| ≤ ε. By Proposition 5.3, Step 3(a) of Algorithm 5.2 improves δs,i C to δ(cid:48) ≤ 44εs,i + 0.7δr,i. With this updated δs,i, by Proposition 5.4, Step 3(b) improves δr,i to s,i ≤ 220εr,i + 44εs,i + 0.7δr,i. If δr,i ≥ 220εs,i + 5 * 220εr,i, we have δ(cid:48) ≤ cεr,i + δ(cid:48) δ(cid:48) ≤ 0.9δr,i. r,i s,i r,i Otherwise, we have (cid:213) (cid:213) 220εs,i + 5 * 220εr,i ≤ (440 + 10 * 220)ε (11) (cid:107) ˆa(i) − ei (cid:107) = δr,i ≤ (cid:213) i∈[d] i∈[d] i∈[d] where the last equality follows from the upper bounds on the sum of εs,i and εr,i in Propositions 5.3 and 5.4. Then (cid:213) i∈[d] | ˆui − 1| + | ˆvi − 1| = (cid:213) δs,i ≤ (cid:213) i∈[d] i∈[d] 44εs,i + 0.7δr,i ≤ (396 + 7 * 220)ε. (12) Thus, adding up (11) and (12), we get dTV ( (cid:98)H, H) = O(ε). Next we show that the number of iterations ε and end with δr,i ≥ ε/d. Suppose we run Step 3 for t is bounded. We start with δr,i ≤ C (cid:3) iterations. Then 0.9 ε ≤ ε/d, which implies t ≤ C log(d/ε). t C √ √ 19 5.1 Proof of Proposition 5.3 In this section, we will prove Proposition 5.3. The idea is similar with the proof of Theorem 3.1 in Section 3. But we need to deal with the error from the rotation matrix besides outliers. The following two lemmas are general versions of Lemmas 3.5 and 3.7 with rotation error. Lemma 5.5. Suppose a cube (cid:98)H = {x : ˆvi ≤ ˆa(i) * x ≤ ˆui } satisfies (1),(2),(3) in Algorithm 3.3 and δi = (cid:107) ˆa(i) − a(i)(cid:107), then with high probability, for all ˆui > 1, and for all ˆvi < −1, ˆui − 1 ≤ 0.35δ + 22εi −1 − ˆvi ≤ 0.35δ + 22εi where εi > 0 and (cid:205){i: ˆui >1 or ˆvi <−1} εi ≤ 2ε. Proof. Suppose δi = (cid:107) ˆa(i) − ei (cid:107) is the error of rotation vector in direction ei and εi is the fraction of outliers in the set {x : 1 < ˆa(i) * x ≤ ˆui } for ˆui > 1. By (1), we know that the fraction of samples in ˆH are either outliers or because of {x : 1 < ˆa(i) * x ≤ ˆui } is at least (1/2)( ˆui − 1). These points not in the rotation error. By Lemma 4.5, the fraction of original uncorrupted sample in {x : 1 < ˆa(i) * x ≤ ˆui } is at most δ/8. So we have ( ˆui − 1) ≤ δi/8 + εi. 1 2 Now we consider the case εi ≤ 0.05δi. Then we get for i s.t. ˆui > 1 and εi ≤ 0.05δi, ˆui − 1 ≤ δi/4 + 0.1δi = 0.35δi. (13) The above inequality also applies to vi by symmetry. Next if εi > 0.05δi, we have ( ˆui − 1) ≤ 22εi. Set α = 40 * 222. Then by (3), we have the fraction of the intersection of {x : 1 < ˆa(i) * x ≤ ˆui } and {x : 1 < ˆa(j) * x ≤ ˆuj } is at most αεi εj. Since the fraction of corruption is at most ε, we can apply Lemma 3.4 to outliers in {x : 1 < ˆa(i) * x ≤ ˆui } ∪ {x : ˆvi ≤ ˆa(i) * x < −1}. and get an upper bound of (cid:205) εi (cid:213) εi ≤ ε 1 − αε . {i: ˆui >1,εi ≤0.05δi } If αε ≤ 1/2, we get (cid:205){i: ˆui >1,εi ≤0.05δi } εi ≤ 2ε. Then for i s.t. ˆui > 1 and εi ≤ 0.05δi, ˆui − 1 ≤ 22εi. Add (13) and (14) gives the conclusion. Lemma 5.6. With high probability, Step 3(a) of Algorithm 5.2 outputs ˆui and ˆvi for all ˆui < 1, (14) (cid:3) and for all ˆvi > −1, 1 − ˆui ≤ 0.35δ + 22ηi ˆvi − (−1) ≤ 0.35δ + 22ηi where ηi > 0 and (cid:205){i: ˆui >1 or ˆvi <−1} ηi ≤ 2ε. 20 Proof. If ˆui < 1, by (1), the fraction of points in {x : ˆui ≤ ˆa(i) * x ≤ 1} is less than 1 (1 − ˆui). So at least 2 half of points in the region are either removed (by adversary or by the algorithm) or because of the error from the rotation vector ˆa(i). By Lemma 4.5, the fraction of error from rotation vector is at most δi/8. (1 − ˆui) ≤ δi/8 + ηi. 1 2 By Lemma 3.6, the fraction of points are removed is at most 2ε, i.e., the fraction of the union of the removed points is at most 2ε. By the same argument in the proof of Lemma 5.5, we can upper bound (cid:205) ηi by 4ε for ηi ≥ 0.05δ. (cid:3) Proof of Proposition 5.3. Lemma 5.5 proves the conclusion in the cases that ˆui > 1 or ˆvi < −1. (cid:3) Lemma 5.6 proves the conclusion in the cases that ˆui < 1 or ˆvi > −1. 5.2 Proof of Proposition 5.4 In this section, we prove Proposition 5.4. The proof follows the same idea as the proofs of the rotation case in Section 4. Lemma 5.7. Suppose (cid:107)a − ei (cid:107) = δ. Then the variance of the subset of the standard cube {x : x * a > 1 − δ/2} in the direction ei is at most cδ2 for a constant c > 0. Proof. Since the fraction of points in {x : x * a > 1 − δ/2} that satisfies xi ≥ 1 − (3δ/2) is at least 1 − cδ, by Lemma 2.5, we know that the mean of xi on the subset {x : x * a > 1 − δ/2} is at least 1 − (3δ/2). Then by Lemma 2.4, the variance of xi on the whole subset is upper-bounded by the (cid:3) variance of one side of the mean. Lemma 5.8. Suppose (cid:107)a − ei (cid:107) = δ. Then the variance of the subset of the standard cube {x : x * a > 1 − δ/2} in the direction a is at most cδ2 for a constant c > 0. Proof. Using the similar argument as in the proof of Lemma 5.7, it suffices to show that the mean of x * a on the subset {x : x * a > 1 − δ/2} is at most 1 + δ/2, which follows from Lemma 2.5 and the fact that the fraction of points in {x : x * a > 1 − δ/2} that satisfies x * a ≤ 1 + (3δ/2) is at least 1 − cδ. (cid:3) Lemma 5.9. Suppose (cid:107)a − ei (cid:107) = δ. The fraction of original uncorrupted sample of the standard cube in {x : |x * a| > 1 + δ/2} is at least δ/64 with high probability. Proof. We can compute the volume of S1 = {x ∈ [−1, 1]d of xi over ̄x where ̄x is the vector x without entry xi. : x * a > 1 + δ/2} by integrating the length vol(S1) = ∫ ̄x∈[−1,1]d−1 (cid:26) max 0, 1 − 1 + δ/2 − ̄x * ̄a ai (cid:27) d ̄x Let y = ̄x * ̄a. Suppose p(y) is the density of y. We can write the integral above as (cid:32) vol(S1) = 2 d−1 Pr (cid:18) y ≥ δ2 2 + δ/2 (cid:19) (cid:18) (cid:19) 1 − 1 + δ/2 ai + 1 ai ∫ y≥ δ2 2 +δ/2 (cid:33) y * p(y) dy . (15) 21 Since ̄x is a uniform random variable on [−1, 1]d−1, we have y is 1d projection of the standard d − 1 cube onto an arbitrary direction with zero mean and variance (cid:107) ̄a(cid:107)2/3 = δ2/3. Then we can bound δ) ≥ 1/8 − δ. By Lemma 2.10, we the probability 1/8 − δ ≤ Pr have μy := E(y | y ≥ δ2/2 + δ/2) ≥ (δ/2) + (δ2/2) + cδ. Plugging into the inequality (15), we get ≤ 1/4 and Pr(y ≥ 3 4 y ≥ δ2 2 + δ/2 (cid:16) (cid:17) vol(S1) ≥ 2 d−1 (cid:18) (cid:18) Pr y ≥ δ2 + δ/2 2 d−1(1/8 − δ)(δ/8 + O(δ2)) d−7δ. ≥ 2 = 2 (cid:19) (cid:18) 1 − 1 + δ/2 ai (cid:19)(cid:19) + μy ai d = δ/128. By symmetry Thus the probability a uniformly random sample is in S1 is at least 2 of the cube, the probability of a point that x * a < −1 − δ/2 is the same. So the fraction of samples in (cid:3) {x : |x * a| > 1 + δ/2} is at least δ/64. d−7δ/2 Lemma 5.10. Suppose (cid:107)a − ei (cid:107) = δ. Let μ be the mean of the subset of the cube {x ∈ [−1, 1]d where Δ ∈ [−δ/2, δ/2]. Then μ * a − μ * ei ≥ δ/64. : a * x > 1+Δ}, Proof. Let S1 = {x ∈ [−1, 1]d : x * a > 1 + δ/2}. By the definition, we have x * a > 1 + δ/2 and x * e ≤ 1 for all x ∈ S1. So μ(S1) * (a − e) ≥ δ/2. Then we will show that for t ∈ [−δ/2, δ/2], the mean of the section of the cube μ(1 + t) := E(x | x * a = 1 + t) in the direction ei is at most 1 + t. This is trivial for t ≥ 0. So we assume −δ/2 ≤ t < 0. μ(1 + t) * ei = E(xi | x * a = 1 + t) ∫ 1 = xi Pr( ̄x * ̄a = 1 + t − ai xi) dxi −1 where ̄x ∼ [−1, 1]d−1. Then ̄x * ̄a is symmetric at zero, that is, at xi = 1 + t + O(δ2). So the truncated | x * a = 1 + t, xi < 1 + 2t) < 1 + 2t, we mean E(xi conclude that the mean of these two parts E(xi | x * a = 1 + t) is at most 1 + t. | x * a = 1 + t, xi ≥ 1 + 2t) is 1 + t. Since E(xi By Lemma 5.9, the fraction of points in S1 = {x ∈ [−1, 1]d : x * a > 1 + δ/2} is at least δ/64. By Lemma 4.5, the fraction of {x : x * a > 1} is at most δ/8. By Lemma 2.9, the maximum of the section 2. Then the fraction of {x : 1 + t ≤ x * a ≤ 1} is upper bounded by of the cube is 2t/2. Thus √ √ μ * a − μ * e ≥ μ(S1) * (a − e) δ 32 (δ/8) − (t/ 2)) √ ≥ δ/64. (cid:3) Proof of Proposition 5.4. Suppose δi = (cid:107) ˆa(i) − ei (cid:107). In the proof of Lemma 4.12, we show that if ̃μ * ˆa(i) − ̃μ * e ≥ cδi, then Algorithm 4.11 outputs a unit vector ˆa(cid:48) * ei − ˆa(i) * ei ≥ c(cid:48)βδi. In the general algorithm, the only difference is we replace the true threshold in the direction ei by ˆui, i.e., ̃μ is the robust mean of the subset {x : ˆa(i) * x > ˆui }. Let μi be the true mean of {x : ˆa(i) * x > ˆui }. By Lemma 5.10, we have μ * ˆa(i) − μ * ei ≥ δi/64. We apply the algorithm in Theorem 2.1 to c)σ( ˆa(i)) and compute the robust mean, which give an error guarantee that ( ̃μ − μ) * ˆa(i) ≤ O( (i) such that ˆa(cid:48) √ (i) 22 √ c)σ(ei) where σ2( ˆa(i)) is the variance of {x : ˆa(i) * x > ˆui } in the direction ˆa(i) and ( ̃μ − μ) * ei ≤ O( σ2(ei) is the variance in the direction ei. By Lemmas 5.7 and 5.8, the variances are at most δ2. By Lemma 5.9, the number of true points in {x : ˆa(i) * x > ˆui } is at least (δ/64)n. Thus if the algorithm can improve ˆa(i) to ˆa(cid:48) (i) such that c ≤ εi δ/64 ≤ 214, ˆa(cid:48) (i) * ei − ˆa(i) * ei ≥ 1 256 βδi. This implies that the algorithm make progress until δ < 220εi. Then the argument in the proofs of (cid:3) Corollary 4.13 and Theorem 4.1 follows. 6 Total size of almost pairwise disjoint sets In this section, we prove Lemma 3.4. Lemma 3.4. Let S1, . . . , Sd ⊆ [n] be arbitrary subsets. Let frac(S) := |S|/n be normalized size of S. Suppose that (cid:16)(cid:216) Si (cid:17) = ε frac for some ε < 1 and for all i, j, for some α > 0 s.t. αε < 1. Then, frac(Si ∩ Sj) ≤ αfrac(Si)frac(Sj), (cid:213) i∈[d] frac(Si) ≤ ε 1 − αε . (4) (5) (6) To prove Lemma 3.4, we will use the following technical result on almost pairwise independent Bernoulli random variables. Lemma 6.1. Let X = (X1, X2, . . . , Xd) ∈ {0, 1}d be a random variable on {0, 1}d. If for any i, j ∈ [d], EXi Xj ≤ εEXiEXj where 0 ≤ ε < 1, then Proof. By Jensen's inequality, we have: EXi ≤ 1 1 − ε . d (cid:213) i=1 (cid:33)(cid:33) 2 (cid:33) 2 (cid:32) EXi = E (cid:32) d (cid:213) i=1 (cid:32) d (cid:213) i=1 Xi ≤ E (cid:33) 2 Xi (cid:32) d (cid:213) i=1 = d (cid:213) i=1 EX2 i + (cid:213) EXi Xj i,j∈[d] 23 ≤ d (cid:213) i=1 EXi + ε (cid:213) EXiEXj ≤ i,j∈[d] d (cid:213) i=1 EXi + ε (cid:33) 2 EXi (cid:32) d (cid:213) i=1 Rearranging yields that (cid:205)d i=1 EXi ≤ 1 1−ε . (cid:3) We now proceed to the proof of Lemma 3.4. Proof of Lemma 3.4. Let y be distributed uniformly on (cid:208) Si. Define a random variable X = (X1, X2, . . . , Xd) ∈ {0, 1}d as a function of y as follows: Xi = (cid:40) 0 1 if y ∉ Si if y ∈ Si Then by (4), EXi = Pr(y ∈ Si) = frac(Si ∩ Sj)/ε. By (5), we have |Si | | (cid:208) Si | = frac(Si)/ε and EXi Xj = Pr(y ∈ Si ∩ Sj) = |Si ∩Sj | | (cid:208) Si | = EXi Xj ≤ size(Si ∩ Sj) ε ≤ α ε size(Si)size(Sj) = αεEXiEXj. By Lemma 6.1, this implies (cid:205)d i=1 EXi ≤ 1 1−αε . Using that gives (cid:205)d i=1 frac(Si) ≤ ε 1−αε . (cid:213) EXi = 1 ε d (cid:213) i=1 frac(Si) (cid:3) References [1] Sanjeev Arora, Rong Ge, Ankur Moitra, and Sushant Sachdeva. Provable ICA with unknown gaussian noise, with implications for gaussian mixtures and autoencoders. In NIPS, pages 2384–2392, 2012. [2] Ainesh Bakshi, Ilias Diakonikolas, He Jia, Daniel M Kane, Pravesh K Kothari, and Santosh S Vempala. Robustly learning mixtures of k arbitrary gaussians. In Proceedings of the 54th Annual ACM SIGACT Symposium on Theory of Computing, pages 1234–1247, 2022. [3] Ainesh Bakshi and Adarsh Prasad. Robust linear regression: Optimal rates in polynomial time. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, pages 102–115, 2021. [4] Keith Ball. Cube slicing in rn. Proceedings of the American Mathematical Society, pages 465–473, 1986. 24 [5] Franck Barthe and Alexander Koldobsky. Extremal slabs in the cube and the laplace transform. Advances in Mathematics, 174(1):89–114, 2003. [6] Mikhail Belkin, Luis Rademacher, and James Voss. Blind signal separation in the presence of Gaussian noise. In Proc. of COLT, 2013. [7] J-F Cardoso. Multidimensional independent component analysis. In Acoustics, Speech and Signal Processing, 1998. Proceedings of the 1998 IEEE International Conference on, volume 4, pages 1941–1944. IEEE, 1998. [8] Y. Cheng, I. Diakonikolas, R. Ge, and D. P. Woodruff. Faster algorithms for high-dimensional robust covariance estimation. In Conference on Learning Theory, COLT 2019, pages 727–757, 2019. [9] P. Comon. Independent Component Analysis. In Proc. Int. Sig. Proc. Workshop on Higher-Order Statistics, pages 111–120, Chamrousse, France, July 10-12 1991. Keynote address. Republished in Higher-Order Statistics, J.L.Lacoume ed., Elsevier, 1992, pp 29–38. [10] Pierre Comon and Christian Jutten, editors. Handbook of Blind Source Separation. Academic Press, 2010. [11] I. Diakonikolas, G. Kamath, D. M. Kane, J. Li, A. Moitra, and A. Stewart. Robust estimators in high dimensions without the computational intractability. In Proc. 57th IEEE Symposium on Foundations of Computer Science (FOCS), pages 655–664, 2016. [12] A. Frieze, M. Jerrum, and R. Kannan. Learning linear transformations. In focs1996, pages 359–368, 1996. [13] N. Goyal, S. Vempala, and Y. Xiao. Fourier pca and robust tensor decomposition. In Proceedings of the forty-sixth annual ACM symposium on Theory of computing, pages 584–593, 2014. [14] A. Klivans, P. Kothari, and R. Meka. Efficient algorithms for outlier-robust regression. In Proc. 31st Annual Conference on Learning Theory (COLT), pages 1420–1430, 2018. [15] P. K. Kothari, J. Steinhardt, and D. Steurer. Robust moment estimation and improved clustering via sum of squares. In Proc. 50th Annual ACM Symposium on Theory of Computing (STOC), pages 1035–1046, 2018. [16] P. K. Kothari and D. Steurer. Outlier-robust moment-estimation via sum-of-squares. CoRR, abs/1711.11581, 2017. [17] K. A. Lai, A. B. Rao, and S. Vempala. Agnostic estimation of mean and covariance. In Proc. 57th IEEE Symposium on Foundations of Computer Science (FOCS), pages 665–674, 2016. [18] L. Lovász and S. Vempala. The geometry of logconcave functions and sampling algorithms. Random Structures and Algorithms, 30(3):307–358, 2007. [19] Phong Q. Nguyen and Oded Regev. Learning a parallelepiped: Cryptanalysis of GGH and NTRU signatures. J. Cryptology, 22(2):139–160, 2009. 25 Appendix Proof of Lemma 2.3. We can project the density to the span of u, v to get a center-symmetric, isotropic, two-dimensional logconcave density f : R2 → R+. Let us assume that u, v are orthogonal, the general case when they are at least at a constant angle will be similar. Consider the level set L1 of f of function value at least 1/100. We claim that it intersects the line l1 defined by uT x = 1 in a segment of length at least 1/10. Let δ = ν(Hu). Moreover, the line l2 defined by uT x = 1 + cδ does not intersect L1, else the measure in between the two lines is too large, and we know it is at most δ. Now consider L2, the level set of function value at least 1/1000. Now we claim that the intersection of l2 with L2 is of length most 1/10. Moreover, the line l3 defined by uT x = 1 + 2cδ does not intersect L2. The same bounds apply along v. To bound the measure of {x : uT x ≥ 1, vT x ≥ 1}, we divide up the region uT x ≥ 1 into strips perpendicular to u so that the measure of the bounding lines decreases by a constant factor in each strip. Each strip has length cδ We do the same for v. So the intersection of the first two strips, a square S, has measure O(δ2). Now, using the previous claims about level sets, it follows that along any line starting at the intersection of uT x = 1 and vT x = 1 and continuing in the region uT x ≥ 1, vT x ≥ 1, the value of f decreases by a constant factor every c2δ distance along the line. From this it follows that the measure of the entire regions is O(δ2). To see this we consider the polar integral of the region Hu ∩ Hv, ∫ π/2 ∫ ∞ θ=0 r=0 r f (1 + r cos θ, 1 + r sin θ) dr dθ ≤ ∫ π/2 ∫ ∞ θ=0 r=0 c1re−r/(c2δ) dr dθ = O(δ2). When u and v are at some constant angle (instead of orthogonal), then the intersection of bands induced by intervals beomes a parallelogram with area O(δ2). The rest of the argument remains (cid:3) the same. 26 Figure 2: The intersection of halfspaces has measure O(δ2). 27
http://arxiv.org/abs/2302.12252v2
2023-04-04T19:46:08
2023-02-23T18:59:56
Boosting Adversarial Transferability using Dynamic Cues
The transferability of adversarial perturbations between image models has been extensively studied. In this case, an attack is generated from a known surrogate \eg, the ImageNet trained model, and transferred to change the decision of an unknown (black-box) model trained on an image dataset. However, attacks generated from image models do not capture the dynamic nature of a moving object or a changing scene due to a lack of temporal cues within image models. This leads to reduced transferability of adversarial attacks from representation-enriched \emph{image} models such as Supervised Vision Transformers (ViTs), Self-supervised ViTs (\eg, DINO), and Vision-language models (\eg, CLIP) to black-box \emph{video} models. In this work, we induce dynamic cues within the image models without sacrificing their original performance on images. To this end, we optimize \emph{temporal prompts} through frozen image models to capture motion dynamics. Our temporal prompts are the result of a learnable transformation that allows optimizing for temporal gradients during an adversarial attack to fool the motion dynamics. Specifically, we introduce spatial (image) and temporal (video) cues within the same source model through task-specific prompts. Attacking such prompts maximizes the adversarial transferability from image-to-video and image-to-image models using the attacks designed for image models. Our attack results indicate that the attacker does not need specialized architectures, \eg, divided space-time attention, 3D convolutions, or multi-view convolution networks for different data modalities. Image models are effective surrogates to optimize an adversarial attack to fool black-box models in a changing environment over time. Code is available at https://bit.ly/3Xd9gRQ
[ "Muzammal Naseer", "Ahmad Mahmood", "Salman Khan", "Fahad Khan" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12252v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12252v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG" ]
Published as a conference paper at ICLR 2023 BOOSTING ADVERSARIAL TRANSFERABILITY USING DYNAMIC CUES Muzammal Naseer§∗ Ahmad Mahmood◦∗ §Mohamed bin Zayed University of AI, ‡Linköping University [email protected] (∗equal contribution) Salman Khan§ Fahad Shahbaz Khan§‡ ◦Lahore University of Management Sciences 3 2 0 2 r p A 4 ] V C . s c [ 2 v 2 5 2 2 1 . 2 0 3 2 : v i X r a ABSTRACT The transferability of adversarial perturbations between image models has been extensively studied. In this case, an attack is generated from a known surrogate e.g., the ImageNet trained model, and transferred to change the decision of an unknown (black-box) model trained on an image dataset. However, attacks generated from image models do not capture the dynamic nature of a moving object or a changing scene due to a lack of temporal cues within image models. This leads to reduced transferability of adversarial attacks from representation-enriched image models such as Supervised Vision Transformers (ViTs), Self-supervised ViTs (e.g., DINO), and Vision-language models (e.g., CLIP) to black-box video models. In this work, we induce dynamic cues within the image models without sacrificing their original performance on images. To this end, we optimize temporal prompts through frozen image models to capture motion dynamics. Our temporal prompts are the result of a learnable transformation that allows optimizing for temporal gradients during an adversarial attack to fool the motion dynamics. Specifically, we introduce spatial (image) and temporal (video) cues within the same source model through task- specific prompts. Attacking such prompts maximizes the adversarial transferability from image-to-video and image-to-image models using the attacks designed for image models. As an example, an iterative attack launched from image model Deit-B with temporal prompts reduces generalization (top1 % accuracy) of a video model by 35% on Kinetics-400. Our approach also improves adversarial transferability to image models by 9% on ImageNet w.r.t the current state-of-the-art approach. Our attack results indicate that the attacker does not need specialized architectures, e.g., divided space-time attention, 3D convolutions, or multi-view convolution networks for different data modalities. Image models are effective surrogates to optimize an adversarial attack to fool black-box models in a changing environment over time. Code is available at https://bit.ly/3Xd9gRQ 1 INTRODUCTION Deep learning models are vulnerable to imperceptible changes to the input images. It has been shown that for a successful attack, an attacker no longer needs to know the attacked target model to compromise its decisions (Naseer et al., 2019; 2020; Nakka & Salzmann, 2021). Adversarial perturbations suitably optimized from a known source model (a surrogate) can fool an unknown target model (Kurakin et al., 2016). These attacks are known as black-box attacks since the attacker is restricted to access the deployed model or compute its adversarial gradient information. Adversarial attacks are continuously evolving, revealing new blind spots of deep neural networks. Adversarial transferability has been extensively studied in image-domain (Akhtar & Mian, 2018; Wang & He, 2021; Naseer et al., 2022b; Malik et al., 2022). Existing works demonstrate how adversarial patterns can be generalized to models with different architectures (Zhou et al., 2018) and even different data domains (Naseer et al., 2019). However, the adversarial transferability between different architecture families designed for varying data modalities, e.g., image models to video models, has not been actively explored. Since the adversarial machine learning topic has gained maximum attention in the image-domain, it is natural to question if image models can help transfer 1 Published as a conference paper at ICLR 2023 better to video-domain models. However, the image models lack dynamic temporal cues which are essential for transfer to the video models. We are motivated by the fact that in a real-world setting, a scene is not static but mostly involves various dynamics, e.g., object motion, changing viewpoints, illumination and background changes. Therefore, exploiting dynamic cues within an adversarial attack is essential to find blind-spots of unknown target models. For this purpose, we introduce the idea of encoding disentangled temporal representations within an image-based Vision Transformer (ViT) model using dedicated temporal prompts while keeping the remaining network frozen. The temporal prompts can learn the dynamic cues which are exploited during attack for improved transferability from image-domain models. Specifically, we introduce the proposed temporal prompts to three types of image models with enriched representations acquired via supervised (ViT (Dosovitskiy et al., 2020)), self-supervised (DINO (Caron et al., 2021)) or multi-modal learning (CLIP (Radford et al., 2021)). Our approach offers the benefit that the attacks do not need to rely on specialized networks designed for videos towards better adversarial transferability. As an example, popular model designs for videos incorporate 3D convolutions, space-time attention, tube embeddings or multi-view information to be robust against the temporal changes (Bertasius et al., 2021; Arnab et al., 2021). Without access to such specific design choices, our approach demonstrates how an attacker can leverage regular image models augmented with temporal prompts to learn dynamic cues. Further, our approach can be easily extended to image datasets, where disentangled representations can be learned via tokens across a scale-space at varying image resolutions. In summary, the major contributions of this work include: • We demonstrate how temporal prompts incorporated with frozen image-based models can help model dynamic cues which can be exploited to fool deep networks designed for videos. • Our approach for dynamic cue modeling via prompts does not affect the original spatial representations learned by the image-based models during pre-training, e.g., fully-supervised, self-supervised and multi-modal models. • The proposed method significantly improves transfer to black-box image and video models. Our approach is easily extendable to 3D datasets via learning cross-view prompts; and image-only datasets via modeling the scale-space. Finally, it enables generalization from popular plain ViT models without considering video-specific specialized designs. We analyse the adversarial space of three type of image models (fully-supervised, self-supervised, and text-supervised). A pre-trained ImageNet ViT with approximately 6 million parameters exhibits 44.6 and 72.2 top-1 (%) accuracy on Kinetics-400 and ImageNet validation sets using our approach, thereby significantly improving the adversarial transferability on video-domain models. A similar trend exists with other image models. Our results indicate that the multi-modal CLIP can better adapt to video modalities than fully-supervised or self-supervised ViTs. However, CLIP adversaries are relatively less transferable as compared to fully-supervised ViT or self-supervised DINO model.As an example, a momentum based iterative attack launched from our DINO model can reduce the performance of TimesFormer (Bertasius et al., 2021) from 75.6% to 35.8% on Kinetics-400 dataset. 2 BOOSTING ADVERSARIAL TRANSFERABILITY USING DYNAMIC CUES Adversarial transferability refers to manipulating a clean sample (image, video, or 3D object rendered into multi-views) in a way that is deceiving for an unknown (black-box) model. In the absence of an adversarial perturbation, the same black-box model predicts the correct label for the given image, video, or a rendered view of a 3D object. A known surrogate model is usually used to optimize for the adversarial patterns. Instead of training the surrogate model from scratch on a given data distribution, an attacker can also adapt pre-trained image models to the new task. These image models can include supervised ImageNet models such as Deit (Touvron et al., 2020), self-supervised ImageNet models like DINO (Caron et al., 2021), and text-supervised large-scale multi-modal models e.g. CLIP (Radford et al., 2021). The adversarial attack generated from such pre-trained models with enriched representations transfer better in the black-box setting for image-to-image transfer task (Zhang et al., 2022; Naseer et al., 2022b; Aich et al., 2022). However, adversarial perturbations optimized from image models are not well suited to fool motion dynamics learned by a video model (Sec. 3). To cater for this, we introduce temporal cues to model motion dynamics within adversarial attacks through pre-trained image models. Our approach, therefore, models both spatial and temporal 2 Published as a conference paper at ICLR 2023 Figure 1: Overview of inducing dynamic cues within image models: Attackers can easily access freely available, pre-trained image models learned on large-scale image and language datasets to launch adversarial attacks. These models, however, lack temporal information. Therefore, adversarial attacks launched using image models have less success rate against a moving target such as in videos. We learn a transformation T (.) to convert a given video with t number of frames into t temporal tokens. Our transformation is based on self-attention thus it learns the motion dynamics between the video frames with global context during training. We randomly sample a single frame to represent the spatial tokens. The temporal and spatial tokens are concatenated and passed through the frozen model. The spatial tokens are ignored while the average of temporal tokens is processed through a temporal head for video recognition. The image/spatial class token learned on images (e.g., ImageNet) interacts with our temporal tokens (e.g., Kinetics) within the network through self-attention. After the training, image and video solutions are preserved within the spatial and temporal tokens and used in adversarial attacks. information during the attack (Sec. 2.1) and does not depend on specialized video networks e.g., with 3D convolutions (Tran et al., 2018), space-time divided attention (Bertasius et al., 2021) or even multi-branch models (Su et al., 2015). To this end, we first introduce temporal prompt adaptation of image models to learn dynamic cues on videos or multi-view information on rendered views of a 3D object, as explained next. 2.1 INTRODUCING DYNAMIC CUES THROUGH TEMPORAL PROMPTS Preliminaries: We consider an image model F pre-trained on the input samples x of size c × h × w, where c, h and w represent the color channels, height and width, respectively. We consider Vision Transformers (ViTs) (Dosovitskiy et al., 2020; Touvron et al., 2020) sequentially composed of n Transformer blocks comprising of multi-head self-attention (MHSA) and feed-forward layer (Dosovitskiy et al., 2020) i.e. F = (f1 ◦ f2 ◦ f3 ◦ . . . fn), where fi represents a single Transformer block. ViTs divide an input sample x into N patches also called patch tokens, Pt ∈ RN ×D, where D is the patch dimension. A class token1, Icls ∈ R1×D, is usually combined with these patch tokens within these image models (Dosovitskiy et al., 2020; Caron et al., 2021; Radford et al., 2021). We refer to these patch and class tokens collectively as 'spatial tokens' (Fig. 1). These tokens are then processed by the model F to produce an output of the same size as of input i.e. F(x) ∈ R(N +1)×D. In the case of image classification, the refined class token ( ̃Icls) is extracted from the model output and processed by MLP (gs), named spatial head (Fig. 1). It maps the refined class token from R1×D to R1×Cs, where Cs represents the number of image class categories. Motivation: The spatial class token in image models, Icls, is never optimized for temporal informa- tion. Our objective is to adapt the pre-trained and frozen image model for videos or multi-views by cls ∈ R1×D that is optimal for input samples of size t × c × h × w, training a temporal class token I t 1Hierarchical ViTs such as Swin Transformer (Liu et al., 2021c) or more simple designs without self-attention layers like MLP-Mixer (Tolstikhin et al., 2021) use average of patch tokens as the class token. 3 Proposed training for dynamic cues within image modelsImage pre-trained vision transformerMHSAFrozen modelLayer NormLayer NormFFNInput Video (x)Target Video / Image Models (Black-box)Source Image ModelRandom SamplerSpatial TokensTokenizerTransformation TMHSASpatial PoolingTokenizerLearnedTemporal Tokens (t)Perturbed Video (x′)Multi-head Self-attentionFeed-forward networkxx′TimesFormerxx′ResNet3Dxx′BiT50CrawlingJumpingCrawlingPlayingBabyWhaleAttackSpatial headTemporal head Published as a conference paper at ICLR 2023 Figure 2: Mimicking dynamic cues on static images: We optimize our proposed transformation (Fig. 1) for different spatial scales to mimic changes. This improves model generalization e.g. Deit-T performance increases from 7.7% to 45% on ImageNet val. set at 96×96. Attacking models with such prompts increases transferability. where t represents the number of temporal frames in a video or rendered views of a 3D object. We optimize the temporal token through MLP (gt), named temporal head (Fig. 1). It maps the temporal token from R1×D to R1×Ct, where Ct represents the number of video action categories. A trivial way is to concatenate all the additional frames of a video to generate t × N patch tokens which can then be combined with the temporal token before forwadpass through the image model. We can then optimize temporal class token I t cls and temporal head (gt) for video classification and incorporate the dynamic cues within a frozen image model. This approach, however, has a drawback as the computational time complexity increases significantly to O (cid:0)(t × N )2 × D(cid:1) within the self-attention layers of ViTs. Another naive way is to either apply temporal pooling to convert t × N to only N spatial tokens or approximate a video via a single frame that is ti × c × h × w, where ti corresponds to a randomly sampled frame from the input video. These approaches are however sub-optimal as we are unable to optimize for motion dynamics available from different video frames. We induce the temporal information within image models without increasing the quadratic complexity within self-attention of a Vision Transformer. We achieve this by representing a given video by a randomly sampled frame while at the same time each frame in a video is modeled via a temporal prompt of size R1×D. The temporal prompts for different frames in a video are generated through our transformation T . Therefore, we only train transformation T , temporal class token I t cls and head gt to learn motion dynamics within pre-trained and frozen image models. Our approach preserves the original image or spatial representation encoded within spatial class token Icls (Table 5). Both spatial and temporal tokens, Icls and I t cls, are then used within our attack approach (Sec. 2.2). 2.1.1 TEMPORAL PROMPTS THROUGH TRANSFORMATION As mentioned above, the transformation T processes a video with t number of temporal frames and produces only t temporal prompts (Fig. 1). A video sample, x, is divided into patch tokens such that x ∈ Rt×N ×D. The transformation T is a single self-attention block (Dosovitskiy et al., 2020) that interacts between the tokens and learns the relationship between the video frames. The transformation output is then pooled across spatial dimension N to produce t temporal tokens i.e., T (x) ∈ Rt×D. Attacking such temporal tokens allows finding adversarial patterns capable of fooling the dynamic cues learned by the unknown black-box video model. Mimicking dynamic behavior on image datasets: Image samples are static and have no temporal dimension. So we adopt a simple strategy to mimic changing behavior for such static data. We consider images at different spatial scales to obtain a scale-space (Fig. 2) and learn prompts for different spatial scales. The dynamic cues within image models not only boost transferability of the existing adversarial attacks from image-to-video models but also increase the attack success rate in the black-box image models (Sec. 3). 2.1.2 IMAGE MODELS WITH TEMPORAL AND SPATIAL PROMPTS Our approach is motivated by the shallow prompt transfer learning (Jia et al., 2022). As discussed above, we divide a given a video x into video patches such that x ∈ Rt×N ×D. These video patches are processed by our transformation to produce temporal tokens i.e. T (x) ∈ Rt×D. Further, we randomly sample a single frame xi ∼ x and divide it into patch tokens such that xi ∈ RN ×D. These single frame tokens are then concatenated with the temporal prompts generated by T (x), a temporal class token I t cls, and the image class token Icls to equip the pre-trained image representation of a model F with discriminative temporal information. F(x) = F (cid:0)(cid:2)I t cls, T (x), Icls, xi (cid:3)(cid:1) (1) After the forwardpass through the image model (Eq. 1), we extract the refined temporal class token and temporal prompts from the model's output. The average of these refined temporal class tokens, 4 Published as a conference paper at ICLR 2023 Figure 3: Visualizing the behavior of Adversarial Patterns across Time: We generate adversarial signals from our DINO model with temporal prompts using DIM attack (Xie et al., 2019). Observe the change in gradients across different frames (best viewed in zoom). We provide visual demos of adversarial patterns in Appendix K. and t temporal prompts is then projected through the temporal head gt for the new video classification task. For the sake of brevity, we will refer to the average of our refined temporal class and prompts tokens collectively as ̃I tp cls. During backpass, we only update the parameters of our transformation, temporal class token and temporal head (Fig. 1). Training: Given a pre-trained ViT, we freeze all of its existing weights and insert our learnable transformation (T ), temporal class token I t cls, and video-specific temporal head. We train for 15 epochs only using SGD optimizer with a learning rate of 0.005 which is decayed by a factor of 10 after the 11th and 14th epoch. We use batch size of 64 and train on 16 A100 GPUs for large-scale datasets such as Kinetics-400 (Kay et al., 2017) and only 2 A100 GPUs for other small datasets. We discuss the effect of our temporal prompts on temporal (video) and spatial (image) solutions in Table 5. Our method mostly retains the original image solution captured in image class token Icls while exhibiting dynamic temporal modeling. 2.2 TRANSFERABLE ATTACK USING SPATIAL AND TEMPORAL CUES Given an image model F adapted for motion dynamics via our approach (Fig. 1), our attack exploits the spatial and temporal cues to generate transferable perturbations for both image and video models. • Given a video and its corresponding label: Our attack uses the refined temporal class token cls output by the model in a supervised manner, while the spatial class token ̃Icls serves in ̃I tp an self-supervised objective. • Given an image and its corresponding label: Our attack uses the refined class tokens ̃I tp cls learned at different resolutions to mimic the dynamic behavior from images in a supervised manner, while the spatial class token ̃Icls serves in an self-supervised objective. We generate an adversarial example x(cid:48) for a video or image sample x using the following objective: find x(cid:48) such that F(x(cid:48))argmax (cid:54)= y, and (cid:107)x − x(cid:48)(cid:107)p ≤ (cid:15), (2) where y is the original label and (cid:15) represents a maximum perturbation budget within a norm distance p. We optimize Eq. 2 by maximizing the loss objective in Eq. 3 within existing adversarial attacks. maximize L = Ls − Lss, (3) where Ls is a supervised loss function. It uses the labels of a given image/video through supervised MLP head. Ls can be optimized by any of the existing supervised losses proposed in transferable attacks literature; cross-entropy (Dong et al., 2018), relativistic cross-entropy (Naseer et al., 2019), or logit loss (Zhao et al., 2021). Unless otherwise mentioned, we use cross-entropy loss to demonstrate the effectiveness of our approach. Similarly, Lss is self-supervised loss that exploits pre-trained representation within spatial class tokens. We minimize the cosine similarity between the refined class tokens of clean and adversarial samples. Specifically, we define Ls and Lss as follows: Ls = − Ct(cid:88) j=1 yjlog (cid:16) ̃I (cid:48) tp cls ◦ gt (cid:17) , Lss = (cid:62) ̃I (cid:48) ̃Icls cls cls(cid:107)(cid:107) ̃Icls(cid:107) (cid:107) ̃I (cid:48) 5 Published as a conference paper at ICLR 2023 Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014) TimesFormer ResNet3D MVCNN Models (↓) Temporal Prompts UCF 90.6 HMDB K400 75.6 59.1 SSv2 45.1 UCF 79.9 HMDB K400 60.5 45.4 SSv2 26.7 Depth 92.6 Shaded 94.8 Deit-T Deit-S Deit-B DINO CLIP Deit-T Deit-S Deit-B DINO CLIP (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) 75.1 64.5(-26.1) 21.9(-37.2) 51.6(-24.0) 19.8(-25.3) 22.3(-57.6) 8.9(-36.5) 57.8 32.9 23.5 25.7 9.8 74.7 64.0(-26.6) 20.6(-38.5) 48.5(-27.1) 19.1(-26.0) 22.6(-57.3) 8.6(-36.8) 58.2 33.5 23.0 25.4 9.7 75.5 64.7(-25.9) 20.0(-39.1) 48.6(-27.0) 19.3(-25.8) 22.7(-57.2) 8.1(-37.3) 57.5 31.7 22.6 25.0 9.2 71.0 60.7(-29.9) 18.8(-40.3) 46.7(-28.9) 19.4(-25.7) 21.9(-58.0) 8.3(-37.1) 54.2 33.7 23.8 32.0 12.4 23.3 19.4(-41.1) 13.9(-12.8) 15.2(-77.4) 77.4(-17.4) 14.7 16.0 79.0 23.9 20.6(-39.9) 13.6(-13.1) 15.9(-76.7) 78.9(-15.9) 15.9 17.2 79.8 22.4 19.5(-41.0) 13.4(-13.3) 17.1(-75.5) 80.9(-13.9) 15.5 17.3 80.6 24.3 19.6(-40.9) 13.9(-12.8) 15.0(-77.6) 70.7(-24.1) 15.2 15.2 72.7 79.8 77.5(-13.1) 29.3(-29.8) 59.5(-16.1) 25.0(-20.1) 35.6(-44.3) 11.2(-34.2) 28.8(-31.7) 16.5(-10.2) 15.6(-77.0) 81.2(-13.6) 62.3 29.9 17.3 36.6 26.4 38.5 15.0 15.8 81.4 Projected Gradient Decent (PGD) (Madry et al., 2018) 84.9 78.1(-12.5) 32.0(-27.1) 61.5(-14.1) 27.8(-17.3) 65.9(-14.0) 29.5(-15.9) 39.1(-21.4) 17.6(-9.1) 68.3 44.3 18.4 40.9 32.5 69.4 32.7 85.1 74.1(-16.5) 26.1(-33.0) 58.3(-17.3) 26.1(-19.0) 65.4(-14.5) 28.2(-17.2) 28.9(-31.6) 17.1(-9.6) 68.6 44.8 19.4 42.0 32.5 69.9 32.7 37.0 34.6(-58.0) 90.2(-4.6) 90.5 39.4 36.5(-56.1) 90.1(-4.7) 90.9 85.5 73.6(-17.0) 25.0(-34.1) 56.3(-19.3) 24.4(-20.7) 64.7(-15.2) 26.6(-18.8) 37.0(-23.5) 16.6(-10.1) 36.7(-55.9) 90.5(-4.3) 67.7 44.7 18.9 41.5 33.3 69.9 32.6 37.7 91.1 81.7 64.9(-25.7) 14.8(-44.3) 51.5(-24.1) 22.4(-22.7) 63.1(-16.8) 25.9(-19.5) 35.2(-25.3) 16.6(-10.1) 28.9(-63.5) 87.5(-7.3) 64.8 42.5 18.2 38.0 30.9 68.0 31.8 33.1 89.2 86.9 82.6(-8.0) 44.5 32.3(-26.8) 66.9(-8.7) 70.7 35.4 32.7(-12.4) 69.7(-10.2) 28.9(-16.5) 43.2(-17.3) 18.9(-7.8) 46.5 20.0 71.9 35.1 39.8 37.6(-55.0) 90.1(-4.7) 91.3 Table 1: Adversarial Transferability from image to video models: Adversarial accuracy (%) is reported at (cid:15) ≤ 16. When attack is optimized from an image model without temporal prompts ((cid:55)), then we minimize the unsupervised adversarial objective (Eq. 3) i.e., cosine similarity between the feature embedding of spatial class token of clean and adversarial frames. We use 8 frames from a given video. Attacks transferability improves by a clear margin with temporal prompts. Clean accuracy (top1 % on randomly selected validation set of 1.5k samples) is highlighted with cell color. Single step FGSM and multi-step PGD attacks perform better with our proposed temporal prompts (e.g. FGSM reduces TimesFormer generalization from 90.6% to 64.5% on UCF by exploiting dynamic cues within the DeiT-T). A similar trend exists for ResNet3D and MVCNN. In this manner, any of the existing attacks can be combined with our approach to transfer adversarial perturbations as we demonstrate in Sec. 3. 2.2.1 CHANGING SPATIAL RESOLUTION FOR REGULARIZATION An adversarial attack can easily overfit the source models meaning it can have a 100% success rate on the source model but mostly fails to fool the unknown black-box model. Different heuristics like adding momentum (Dong et al., 2018; Lin et al., 2019; Wang & He, 2021), augmentations (Naseer et al., 2021; Xie et al., 2019), ensemble of different models (Dong et al., 2018) or even self-ensemble (Naseer et al., 2022b) at a target resolution are proposed to reduce such overfitting and increase adversarial transferability. Low-resolution pre-training followed by high-resolution fine-tuning have a regularization effect on the generalization of neural networks (Touvron et al., 2022). Similarly, we observe that fine-tuning scale-space prompts at different low resolutions (e.g., 96×96) within a model pre-trained on high resolution (224×224) also has a complimentary regularization effect on the transferability of adversarial perturbations (Tables 3 and 4). Most publicly available image models are trained at a resolution of size 224×224 and their performance at low-resolution inputs is sub-optimal (Fig. 2). Learning at low-resolution with our approach (Fig. 1) also allows to mimic a changing scene over time from static datasets like ImageNet (Fig. 2). Our low-resolution scale-space prompts (Sec. 2.1) significantly improves generalization at low-resolution inputs (Fig. 2). 3 EXPERIMENTS We generate l∞ adversarial examples from the adapted image models and study their transferability to video and image models. We followed standard adversarial transferability protocol Dong et al. (2018); Naseer et al. (2022b); the attacker is unaware of the black-box video model but has access to its train data. Our temporal cues also boost cross-task adversarial transferability with no access 6 Published as a conference paper at ICLR 2023 Momentum Iterative Fast Gradient Sign Method (MIM) (Dong et al., 2018) Models (↓) Temporal Prompts TimesFormer ResNet3D MVCNN UCF 90.6 HMDB K400 59.1 75.6 SSv2 45.1 UCF 79.9 HMDB K400 45.4 60.5 SSv2 26.7 Depth Shaded 92.6 94.8 Deit-T Deit-S Deit-B DINO CLIP Deit-T Deit-S Deit-B DINO CLIP (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) 77.0 66.9(-23.7) 21.4(-37.7) 51.4(-24.2) 21.5(-23.6) 41.5(-38.4) 16.1(-29.3) 26.4(-34.1) 15.3(-11.4) 19.0(-73.6) 82.9(-11.9) 58.5 29.1 16.0 30.1 25.2 42.0 16.2 19.2 83.0 78.7 60.8(-29.8) 16.1(-43.0) 47.6(-28.0) 21.0(-24.1) 41.9(-38.0) 15.7(-29.7) 26.8(-33.7) 14.2(-12.5) 19.3(-73.3) 83.5(-11.3) 59.3 31.0 16.5 31.8 25.1 42.2 16.5 20.6 83.6 78.7 61.7(-25.9) 15.6(-43.5) 45.2(-30.4) 19.1(-26.0) 40.7(-39.2) 13.6(-31.8) 24.8(-35.7) 14.5(-12.2) 20.5(-72.1) 84.2(-10.6) 59.7 29.5 16.8 32.0 25.9 43.1 16.2 20.6 84.4 71.3 47.7(-42.9) 8.40(-50.7) 38.8(-36.8) 16.4(-28.7) 39.8(-40.1) 12.7(-32.7) 24.5(-36.0) 14.3(-12.4) 19.4(-73.2) 80.7(-14.1) 54.6 30.3 15.9 28.0 24.1 46.0 18.8 19.7 80.4 81.8 78.2(-12.4) 28.2(-30.9) 61.3(-14.3) 27.2(-17.9) 45.9(-34.0) 17.8(-27.6) 32.9(-27.6) 16.5(-10.2) 20.2(-72.4) 84.7(-10.1) 63.5 35.5 17.9 35.6 29.3 53.2 21.9 20.8 86.7 MIM with Input Diversity (DIM) (Xie et al., 2019) 75.3 62.6(-28.0) 16.9(-42.2) 48.1(-27.5) 20.5(-24.6) 37.8(-42.1) 13.4(-32.0) 24.2(-36.3) 14.3(-12.4) 19.6(-73.0) 85.0(-9.8) 59.2 29.5 16.3 28.2 24.3 41.3 16.5 20.3 84.5 76.3 54.1(-36.5) 12.3(-46.8) 42.8(-32.8) 17.7(-27.4) 36.8(-43.1) 12.7(-32.7) 22.3(-38.2) 14.6(-12.1) 21.0(-71.6) 85.7(-9.1) 57.5 29.8 16.2 29.4 24.1 39.8 17.3 21.8 85.9 75.9 55.5(-35.1) 12.6(-46.5) 40.6(-35.0) 16.8(-28.3) 37.3(-42.6) 11.4(-34.0) 21.5(-39.0) 13.3(-13.4) 20.5(-72.1) 86.3(-8.5) 57.8 30.5 15.6 28.8 24.5 41.5 16.5 22.2 85.1 64.9 45.2(-45.4) 7.30(-51.8) 35.8(-39.8) 15.8(-29.3) 32.2(-47.7) 10.6(-34.8) 18.3(-42.2) 12.0(-14.7) 18.9(-73.7) 78.6(-16.2) 51.8 27.6 13.7 23.1 22.6 43.5 16.7 19.0 80.2 78.0 73.4(-17.2) 22.7(-36.4) 56.7(-18.9) 25.1(-20.0) 46.5(-33.4) 13.6(-31.8) 31.5(-29.0) 15.7(-11.0) 20.5(-72.1) 87.4(-7.4) 61.0 32.8 16.9 29.5 26.9 50.0 19.6 20.8 87.8 Table 2: Adversarial Transferability from image to video models: Adversarial accuracy (%) is reported at (cid:15) ≤ 16. When attack is optimized from an Image model without temporal prompts ((cid:55)), then we minimize the unsupervised adversarial objective (Eq. 3), cosine similarity, between the feature embedding of spatial class token of clean and adversarial frames. We use 8 frames from a given video. Attacks transferability improves by a clear margin with temporal prompts. Clean accuracy (top1 % on randomly selected validation set of 1.5k samples) is highlighted with cell color. We observe that a small Image model (e.g. Deit-T with only 5 Million parameters) can significantly reduce the generalization of TimesFormer with the presence of our temporal prompts. The attack performance with temporal prompts increases with network capacity (e.g. Deit-T to Deit-B). to the black-box video model, its training data, or label space ( Appendix B). The maximum pixel perturbation is set to (cid:15) ≤ 16 for pixel range of [0, 255]. We use standard image attacks to optimize adversarial examples through our adapted image models and boost adversarial transferability to video models by using the following protocols: Surrogate image models: We optimize adversaries from the known surrogate models. We study three types of surrogate image models trained via supervised (Touvron et al., 2020), self-supervised (Caron et al., 2021) and text-supervised (Radford et al., 2021) models. −Supervised image models: We use Deit-T, DeiT-S, and DeiT-B with 5, 22, and 86 million parameters to video datasets. These models are pre-trained in a supervised manner on ImageNet. −Self-Supervised image model: We use Vision Transformer trained in self-supervised fashion on ImageNet using DINO training framework (Caron et al., 2021). −Text-Supervised image model: We adapt CLIP image encoder only trained on text-guided images. DeiT-B, DINO, and CLIP share the same network based on Vision Transformer. These models process images of size 3×224×224 that are divided into 196 patches with a patch size of 16. Each of these patch tokens has 768 embedding dimensions. Thus, the only difference between these models lies in their corresponding training frameworks. These models are adapted to different video datasets. Adversarial examples are then simply created using existing single and multi-step attacks (Goodfellow et al., 2014; Madry et al., 2018; Dong et al., 2018; Xie et al., 2019). Target video and image models: We transfer adversarial examples to unknown (black-box) video and image models. −Target Video Models: We consider recently proposed TimesFormer (Bertasius et al., 2021) with divided space-time attention, 3D convolutional network (Tran et al., 2018), and multi-view convolutional network (Su et al., 2015). −Target Image Models: We consider the same image models used in baseline by (Naseer et al., 2022b): BiT-ResNet50 (BiT50) (Beyer et al., 7 Published as a conference paper at ICLR 2023 MIM with Input Diversity (DIM) (Xie et al., 2019) Convolutional Transformer Models (↓) Method BiT50 Res152 WRN DN201 ViT-L T2T24 TnT T2T-7 Deit-B Deit-B DINO CLIP Naseer et al. (2022b) Ours 80.10 86.64 84.36 55.34 84.92 90.88 93.74 64.24 86.36 92.14 95.16 65.76 89.24 93.82 96.20 71.78 78.90 95.64 96.48 59.94 84.00 95.74 89.68 54.66 92.28 98.48 94.74 62.72 93.42 94.74 96.18 75.80 Table 3: Adversarial Transferability from image to image models: Fool Rate (%) on 5k ImageNet val. samples from Naseer et al. (2022b). We compare against the best results from Naseer et al. (2022b) that our baseline is a self-ensemble Deit-B with token refinement blocks. To mimic the dynamics with static images, we optimize our proposed prompts at resolutions of 56×56, 96×94, 120×120, and 224×224. Adversaries are optimized at the target resolution of 224×224. Our method performs favorably well against self-ensemble with refined tokens. Models Temporal Prompts SR TimesFormer DeiT-B (cid:55) (cid:51) (cid:51) UCF HMDB (cid:55) (cid:55) (cid:51) 75.9 55.5 53.9 28.8 12.6 11.8 Table 4: Effect of Change in Spatial Resolu- tion (SR): Incorporating change in spatial res- olution improves adversarial transferability (% accuracy, lower is better). Adversaries are cre- ated at target resolution of 224 from an ensem- ble of models adopted at 56×56, 96×96, and 224×224. 2021), ResNet152 (Res152) (He et al., 2016), Wide-ResNet-50-2 (WRN) (Zagoruyko & Komodakis, 2016), DenseNet201 (DN201) (Huang et al., 2017) and other ViT models including Token-to-Token transformer (T2T) (Yuan et al., 2021), Transformer in Transformer (TnT) (Mao et al., 2021). Adapting image models for videos using dynamic cues: We use UCF (Soomro et al., 2012), HMDB (Kuehne et al., 2011), K400 (Kay et al., 2017), and SSv2 (Goyal et al., 2017) training sets to learn temporal prompts and adapt image models to videos via our approach (Fig.1). HMDB has the smallest validation set of 1.5k samples. For evaluating robustness, we selected all validation samples in HMDB, while randomly selected 1.5k samples from UCF, K400, and SSv2 validation sets. We also use multi-view training samples rendered for 3D ModelNet40 (depth and shaded) for image models. We use validation samples of rendered multi-views for both modalities. Adapting image models to images mimicking dynamic cues: We use ImageNet training set and learn our proposed transformation and prompts at multiple spatial scales; 56×56, 96×96, 120×120, and 224×224. We optimize adversarial attacks at the target resolution of 224×224 by using the ensemble of our learned models at multiple resolutions. In this manner, our approach mimic the change over time by changing the spatial scale or resolution over time. We study our attack approach using the 5k samples from ImageNet validation set proposed by (Naseer et al., 2022b). Inference and metrics: We randomly sample 8 frames from a given video for testing. We report drop in top-1 (%) accuracy on adversarial and clean videos. We report fooling rate (%) of adversarial samples for which the predicted label is flipped w.r.t the original labels) to evaluate on image datasets. Extending image attacks to videos: We apply image attacks such as single step fast gradient sign method (FGSM) (Goodfellow et al., 2014) as well as iterative attacks with twenty iterations including PGD (Madry et al., 2018), MIM (Dong et al., 2018) and input diversity (augmentations to the inputs) (DIM) (Xie et al., 2019) attacks to adapted image models and transfer their adversarial perturbations to black-box video models. We follow the attack settings used by (Naseer et al., 2022b). Our proposed transformation (T (.)) allows to model temporal gradients during attack optimization (Fig. 3). We simply aggregates the gradients from both branches of our model to the input video frames (Fig. 1). 3.1 ADVERSARIAL TRANSFER FROM IMAGE-TO-VIDEO MODELS The generalization of image models on videos is discussed in Table 5. We observe that image solution remains preserved in ViT backbones even after training with our proposed transformation and temporal prompts. Deit models retain their top-1 (%) accuracy on ImageNet when measured through image class token, while also exhibiting decent performance on video datasets and rendered mulit-views of ModelNet40. CLIP achieves the best performance on videos. The transferability of image based attacks from our adapted image models to video and multi-view models is presented in Tables 1 and 2. Following insights emerges from our analysis: a) The attack success to video models 8 Published as a conference paper at ICLR 2023 Figure 4: Adversaries (DIM (Xie et al., 2019)) from an en- semble of image models with different networks transfer well and fool the black-box video models. First row shows trans- ferablity from an ensemble of different networks, while sec- ond row shows attack results from an ensemble of similar networks but pre-trained with different training schemes. ImageNet ImageNet and Videos ImageNet and ModelNet40 Models Deit-T Deit-S Deit-B DINO CLIP IN 72.2 79.9 81.8 NA NA IN – UCF IN – HMDB IN – K400 IN – SSv2 IN – Depth IN – Shaded 72.0 – 70.0 79.8 – 77.2 81.9 – 81.4 NA – 79.5 72.3 – 36.2 79.8 – 44.6 81.7 – 47.7 NA – 45.1 72.2 – 44.6 79.9 – 53.0 81.9 – 57.0 NA – 57.4 72.2 – 11.2 79.9 – 15.3 81.8 – 17.5 NA – 17.4 72.2 – 86.0 78.8 – 86.6 81.8 – 90.1 NA – 90.1 72.1 – 81.0 79.8 – 86.2 81.4 – 88.2 NA– 89.8 NA – 86.0 NA – 54.6 NA – 67.3 NA – 19.9 NA – 89.5 NA – 88.9 Table 5: Spatial along with Temporal Solutions within Image Models: Our approach successfully incorporates temporal information into pre-trained and frozen image models and increases their generalization (top-1 (%) at resolution 224) to high-dimensional datasets. The original image solution remains preserved in our approach. Ours Deit-B retains 81.9% top-1 accuracy on ImageNet validation set while exhibiting 81.4% on UCF. increases with size of the image models. The larger the image model (e.g. Deit-T to DeiT-B) the higher the attack success, b) The adversarial perturbations generated using self-supervised DINO transfer better than CLIP or supervised Deit-B, c) Divided space-time attention is more robust than 3D convolution, and d) MVCNN trained on shaded rendered views is more robust than depth. 3.1.1 ENSEMBLE ADVERSARIAL TRANSFER Adversarial attacks optimized from an ensemble of models (Dong et al., 2018; Xie et al., 2019) or self-ensemble (Naseer et al., 2022b) increases transferability. We study three types of image ensembles including a) Ensemble of Different Networks: We transfer attack from three image models of the Deit family (Touvron et al., 2020) including Deit-T, Deit-S and Deit-B. These models differ in architecture, b) Ensemble of Different Training Frameworks: We transfer attack from three image models including Deit-B, DINO and CLIP. These models share similar architecture but differ in their training, and c) Ensemble of Different Spatial Resolutions: We transfer attack from three image models with the same architecture (Deit-B) but prompt adapted to different spatial resolutions. Ensemble of different training frameworks performs favorably to boost attack transferability (Fig. 4). An attacker can adapt our approach at different resolutions to enhance transferability (Table 4). We provide generalization of Deit-B at varying spatial scales for video datasets in Appendix I. 3.2 ADVERSARIAL TRANSFER FROM IMAGE-TO-IMAGE MODELS Image datasets are static but we mimic the dynamic behaviour by learning our proposed transformation at different spatial scales (Fig. 2). Our approach exhibit significant gains in adversarial transferability (Table 3). Refer to appendices B-J for extensive analysis on cross-task adversarial transferability, textual bias of CLIP on adversarial transferability, visualization of attention roll-outs and latent embeddings, and effect of the number of temporal prompts on adversarial transferability. 4 CONCLUSION In this work, we study the adversarial transferability between models trained for different data modalities (e.g., images to videos). We propose a novel approach to introduce dynamic cues within pre-trained (supervised or self-supervised) image models by learning a simple transformation on videos. Our transformation enables temporal gradients from image models and boost transferability through temporal prompts. We show how our approach can be extended to multi-view information 9 Published as a conference paper at ICLR 2023 from 3D objects and varying image resolutions. Our work brings attention to the image models as universal surrogates to optimize and transfer adversarial attacks to black-box models. Reproducibility Statement: Training image models: We adapt pre-trained image models Deit, DINO and CLIP, open sourced by the corresponding authors. We freeze the weights of these models and adapt them for video datasets by introducing our modifications (transformation with temporal prompts). We incorporate the adapted models into the open sourced TimesFormer github repo https: //github.com/facebookresearch/TimeSformer and train them with default settings. Training video models: We use the TimesFormer github repo with default settings to train ResNet3D on UCF, HMDB, K-400, and SSv2. Training MVCNN: We use open source code https://github. com/jongchyisu/mvcnn_pytorch to train multi-view models on rendered views (depth, shaded) of ModelNet40. Attacks: We use adversarial attacks with default parameters as described in baseline (Naseer et al., 2022b). Datasets: We use the same 5k image samples from ImageNet validation set, open sourced by Naseer et al. (2022b), while randomly selected 1.5k samples from the validation sets of explored video datasets. Furthermore, we will release the pre-trained model publicly. Ethics Statement: Our work highlights the use of freely available pre-trained image models to generate adversarial attacks. This can be used to create attacks on real-world deep learning systems in the short run. Our work also provides insights on how such attack can emerge from different resources. Therefore, our work provides an opportunity to develop more robust models to defend against such attacks. Further, the image and video datasets used in this work also pose privacy risks which is an important topic we hope to explore in future. REFERENCES Samira Abnar and Willem Zuidema. Quantifying attention flow in transformers. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 4190–4197, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.385. URL https: //aclanthology.org/2020.acl-main.385. 17, 18 Abhishek Aich, Calvin Khang-Ta, Akash Gupta, Chengyu Song, Srikanth V. Krishnamurthy, M. Salman Asif, and Amit K. Roy-Chowdhury. Gama: Generative adversarial multi-object scene attacks, 2022. 2 Naveed Akhtar and Ajmal Mian. Threat of adversarial attacks on deep learning in computer vision: A survey. Ieee Access, 6:14410–14430, 2018. 1 Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Luˇci ́c, and Cordelia Schmid. Vivit: A video vision transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6836–6846, 2021. 2 Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for video understand- ing? In ICML, volume 2, pp. 4, 2021. 2, 3, 7, 14, 15, 19 Lucas Beyer, Xiaohua Zhai, Amélie Royer, Larisa Markeeva, Rohan Anil, and Alexander Kolesnikov. Knowledge distillation: A good teacher is patient and consistent. arXiv preprint arXiv:2106.05237, 2021. 7 Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021. 2, 3, 7, 14, 15, 16 Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6299–6308, 2017. 14, 15 Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In CVPR, 2018. 5, 6, 7, 8, 9, 14, 15 Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. 2, 3, 4 Gamaleldin F Elsayed, Ian Goodfellow, and Jascha Sohl-Dickstein. Adversarial reprogramming of neural networks. arXiv preprint arXiv:1806.11146, 2018. 14 Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2014. 6, 7, 8, 14, 15 10 Published as a conference paper at ICLR 2023 Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fruend, Peter Yianilos, Moritz Mueller-Freitag, et al. The" something something" video database for learning and evaluating visual common sense. In Proceedings of the IEEE international conference on computer vision, pp. 5842–5850, 2017. 8 Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. 8 Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4700–4708, 2017. 8 Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. arXiv preprint arXiv:2203.12119, 2022. 4, 14 Zhengbao Jiang, Frank F Xu, Jun Araki, and Graham Neubig. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423–438, 2020. 14 Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017. 5, 8 Hildegard Kuehne, Hueihan Jhuang, Estíbaliz Garrote, Tomaso Poggio, and Thomas Serre. Hmdb: a large video database for human motion recognition. In 2011 International conference on computer vision, pp. 2556–2563. IEEE, 2011. 8 Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016. 1 Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2104.08691, 2021. 14 Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190, 2021. 14 Jiadong Lin, Chuanbiao Song, Kun He, Liwei Wang, and John E Hopcroft. Nesterov accelerated gradient and scale invariance for adversarial attacks. arXiv preprint arXiv:1908.06281, 2019. 6, 14 Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021a. 14 Xiao Liu, Kaixuan Ji, Yicheng Fu, Zhengxiao Du, Zhilin Yang, and Jie Tang. P-tuning v2: Prompt tuning can be comparable to fine-tuning universally across scales and tasks. arXiv preprint arXiv:2110.07602, 2021b. 14 Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021c. 3 Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018. 6, 7, 8, 15 Hashmat Shadab Malik, Shahina Kunhimon, Muzammal Naseer, Salman Khan, and Fahad Shahbaz Khan. In 33rd British Machine Adversarial pixel restoration as a pretext task for transferable perturbations. Vision Conference 2022, BMVC 2022, London, UK, November 21-24, 2022. BMVA Press, 2022. URL https://bmvc2022.mpi-inf.mpg.de/0546.pdf. 1 Yuxin Mao, Jing Zhang, Zhexiong Wan, Yuchao Dai, Aixuan Li, Yunqiu Lv, Xinyu Tian, Deng-Ping Fan, and Nick Barnes. Transformer transforms salient object detection and camouflaged object detection. arXiv preprint arXiv:2104.10127, 2021. 8 Krishna kanth Nakka and Mathieu Salzmann. Learning transferable adversarial perturbations. In Advances in Neural Information Processing Systems, 2021. 1 Muzammal Naseer, Salman H Khan, Harris Khan, Fahad Shahbaz Khan, and Fatih Porikli. Cross-domain transferability of adversarial perturbations. Advances in Neural Information Processing Systems, 2019. 1, 5, 14 11 Published as a conference paper at ICLR 2023 Muzammal Naseer, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Fatih Porikli. A self-supervised approach for adversarial robustness. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. 1 Muzammal Naseer, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Fatih Porikli. On generating transferable targeted perturbations. arXiv preprint arXiv:2103.14641, 2021. 6, 14 Muzammal Naseer, Salman Khan, Fatih Porikli, and Fahad Shahbaz Khan. Guidance through surrogate: Toward a generic diagnostic attack. IEEE Transactions on Neural Networks and Learning Systems, 2022a. 14 Muzammal Naseer, Kanchana Ranasinghe, Salman Khan, Fahad Khan, and Fatih Porikli. On improving adversarial transferability of vision transformers. In International Conference on Learning Representations, 2022b. URL https://openreview.net/forum?id=D6nH3719vZy. 1, 2, 6, 7, 8, 9, 10, 14 F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. 20 Omid Poursaeed, Isay Katsman, Bicheng Gao, and Serge Belongie. Generative adversarial perturbations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4422–4431, 2018. 14 Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748–8763. PMLR, 2021. 2, 3, 7 Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. arXiv preprint arXiv:2010.15980, 2020. 14 Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012. 8 Hang Su, Subhransu Maji, Evangelos Kalogerakis, and Erik Learned-Miller. Multi-view convolutional neural networks for 3d shape recognition. In Proceedings of the IEEE international conference on computer vision, pp. 945–953, 2015. 3, 7 Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, et al. Mlp-mixer: An all-mlp architecture for vision. arXiv preprint arXiv:2105.01601, 2021. 3 Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020. 2, 3, 7, 9, 16, 20 Hugo Touvron, Matthieu Cord, and Hervé Jégou. Deit iii: Revenge of the vit. arXiv preprint arXiv:2204.07118, 2022. 6 Du Tran, Heng Wang, Lorenzo Torresani, Jamie Ray, Yann LeCun, and Manohar Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 6450–6459, 2018. 3, 7, 14, 15 Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. 20 Xiaosen Wang and Kun He. Enhancing the transferability of adversarial attacks through variance tuning. arXiv preprint arXiv:2103.15571, 2021. 1, 6, 14 Zhipeng Wei, Jingjing Chen, Zuxuan Wu, and Yu-Gang Jiang. Cross-modal transferable adversarial attacks from images to videos. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15064–15073, 2022. 14 Cihang Xie, Zhishuai Zhang, Yuyin Zhou, Song Bai, Jianyu Wang, Zhou Ren, and Alan L Yuille. Improving transferability of adversarial examples with input diversity. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2730–2739, 2019. 5, 6, 7, 8, 9, 14, 15, 16, 17, 21, 22, 23, 24 Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021. 8 12 Published as a conference paper at ICLR 2023 Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. 8 Qilong Zhang, Xiaodan Li, Yuefeng Chen, Jingkuan Song, Lianli Gao, Yuan He, and Hui Xue. Beyond imagenet attack: Towards crafting adversarial examples for black-box domains. arXiv preprint arXiv:2201.11528, 2022. 2 Zhengyu Zhao, Zhuoran Liu, and Martha Larson. On success and simplicity: A second look at transferable targeted attacks. Advances in Neural Information Processing Systems, 34:6115–6128, 2021. 5 Wen Zhou, Xin Hou, Yongjun Chen, Mengyun Tang, Xiangqi Huang, Xiang Gan, and Yong Yang. Transferable adversarial perturbations. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 452–467, 2018. 1, 14 13 Published as a conference paper at ICLR 2023 Appendix Our approach simply augments the existing adversarial attacks developed for image models and enhances their transferability to black-box video models using our proposed temporal cues. We study cross-task adversarial transferability ((Naseer et al., 2019)); the attacker has no access to the black-box video model, its training data, or label space in Appendix B. We compare the adversarial transferability of our best image models (DINO (Caron et al., 2021)) with temporal cues against pure video models (TimesFormer Bertasius et al. (2021), ResNet3D (Tran et al., 2018), and I3D (Carreira & Zisserman, 2017) in Appendix C. We observe that adversarial examples found within adapted CLIP models show lower transferability to image and video models (Tables 1, 2, and 3). We analyze the textual biases of CLIP vision features in Appendix D to further explain the difference between adversarial space of uni-modal and vision-language models such as CLIP. In Appendix E, we analyze the attention roll-out from our temporal prompts to signify that our prompts pay attention to temporal information across frames as compared to the original image features. We also observe the behavior of our temporal prompts across shuffled frames in Appendix F. We study the effect of increasing the number of temporal prompts during the attack in Appendix G. The effect of fully fine-tuning the image models with our proposed temporal prompts on attack transferability is presented in Appendix H. The generalization of the image model (Deit-B) at varying spatial scales on video modalities is presented in appendix I. In appendix J, we visualize the latent space of class tokens trained at a spatial resolution of 224×224 vs our adapted tokens at various spatial resolution scales. The evolution of adversarial patterns across time generated using our approach is provided in appendix K. A RELATED WORK Adversarial Attacks: Transferable adversarial attacks compromise the decision of a black-box target model. Attacker can not access weights, model outputs or gradient information of a black-box model. These attacks can broadly be categorized into iterative (Goodfellow et al., 2014; Dong et al., 2018; Lin et al., 2019; Wang & He, 2021; Xie et al., 2019; Zhou et al., 2018; Naseer et al., 2022b; Wei et al., 2022) and generative (Poursaeed et al., 2018; Naseer et al., 2019; 2021; 2022a) methods. Iterative attacks optimize adversary from a given clean sample by searching adversarial space of a white-box surrogate model iteratively. Attacker can access weights, model outputs and gradient information of a white-box surrogate model. Generative attacks on the other hand train a universal function (an auto-encoder) against the white-box model over a given data distribution. These attacks can generate adversary via single forward-pass after training. Our proposed approach can be augmented with any of these existing attacks to boost transferability from image-to-video or multi-view models. Prompt Adaptation of Image Models: Prompting refers to providing manual instructions (Liu et al., 2021a; Jiang et al., 2020; Shin et al., 2020) or fine-tuning task-specific tokens (Li & Liang, 2021; Liu et al., 2021b; Lester et al., 2021) for a desired behavior from large language models (e.g., GPT-3). Recently, prompt fine-tuning has been studied for vision models with promising results to adapt image models from one image task to another (Jia et al., 2022; Elsayed et al., 2018). We extend prompt transfer learning to adapt image models to videos and multi-view data modalities. We only train a transformation along with a prompt class token to learn dynamic cues and adapt image model to video tasks. Our approach allows transferable attacks from image-to-video or multi-view models. B DYNAMIC CUES TO BOOST CROSS-TASK TRANSFERABILITY We apply the cross-task attack using self-supervised objective (cosine similarity such as described in Eq. 3 in Sec. 2.2) to our surrogate image models with temporal cues and compare the adversarial transferability with pure video surrogate models (I3D (Carreira & Zisserman, 2017), and Timesformer (Bertasius et al., 2021)) in Table 6. The cross-task attack transferability when combined with our approach described in Section 2.2 performs favorably well against the video models. This is contributed to the fact that the attack exploits an ensemble of two different representations (image and video) when combined with our adapted image models. Therefore our approach frees the attacker from having access to a specialized video architecture trained specifically on the video to generate more transferable attacks. 14 Published as a conference paper at ICLR 2023 MIM with Input Diversity (DIM) (Xie et al., 2019) Source Domain Model (↓) Temporal Prompts K400 SSv2 TimesFormer I3D DINO (Ours) TimesFormer I3D DINO (Ours) – – (cid:51) – – (cid:51) UCF HMDB I3D TimesFormer ResNet3D I3D TimesFormer ResNet3D 35.0 – 13.2 38.2 – 18.7 – 75.6 63.2 – 78.0 62.9 42.1 47.9 41.5 40.6 45.0 42.6 21.3 – 8.4 22.6 – 10.9 – 25.1 22.9 – 29.1 21.6 21.1 19.0 15.8 21.0 18.9 16.1 Table 6: Cross-Task attack with Temporal Prompts: Adversarial attack using the self-supervised image model (Caron et al., 2021) with our dynamic cues (Section 2.2) performs favorably as compared to pure video models. Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014) Model (↓) Temporal Prompts TimesFormer ResNet3D TimesFormer ResNet3D UCF HMDB TimesFormer ResNet3D DINO (Ours) – – (cid:51) – 69.9 60.7 30.1 – 21.9 – 30.7 18.8 Projected Gradient Decent (PGD) (Madry et al., 2018) TimesFormer ResNet3D DINO (Ours) – – (cid:51) – 86.0 64.9 73.3 – 63.1 – 46.5 14.8 Momentum Iterative Fast Gradient Sign Method (MIM) (Dong et al., 2018) TimesFormer ResNet3D DINO (Ours) – – (cid:51) – 77.4 47.7 44.5 – 39.8 – 35.0 8.40 MIM with Input Diversity (DIM) (Xie et al., 2019) TimesFormer ResNet3D DINO (Ours) – – (cid:51) – 74.4 45.2 41.7 – 32.2 – 34.4 7.30 15.6 – 8.3 36.3 – 25.9 21.5 – 12.7 18.4 – 10.6 Table 7: Temporal Prompts Vs. Video Models: Adversarial attack using the self-supervised image model (Caron et al., 2021) with our dynamic cues (Section 2.2) performs favorably as compared to pure video models. Generalization of Video Models Dataset (↓) TimesFormer ResNet3D UCF HMDB K400 SSv2 90.6 59.1 75.6 45.1 79.9 45.4 60.5 26.7 I3D 79.7 43.8 73.5 48.4 Table 8: Generalization of Video Models: The top-1 (% ) accuracies on the validation datasets are reported. We provide single view inference on 8 frames to be consistent across these video models. C IMAGE VS. VIDEO SURROGATE MODELS The attack transferability of our image models with dynamic cues is compared against pure video models (TimesFormer (Bertasius et al., 2021), ResNet3D (Tran et al., 2018), and I3D (Carreira & Zisserman, 2017)) in Table 7. The generalization (top-1 % accuracies) of the video models (Table 8) is higher than our adapted image models (Table 5). This is expected as video models are specifically designed and trained from scratch on the video datasets. However, the adversarial transferability of our image models compares well against these pure video models (Table 7). Our approach enables the attacker to exploit image and video solution from the same image model while pure video models lack the image representation. D ANALYSING CLIP Vision-language models like CLIP consists of an image and a text encoder and are trained on large- scale image-text pairs to find common feature space between images and textual labels. Inherently visual features of CLIP are aliened with text. Our results indicate that adversarial perturbations 15 Published as a conference paper at ICLR 2023 Clean Adversarial Clean Adversarial Clean Adversarial Clean Adversarial Figure 5: Visualizing Textual Bias of CLIP Adversarial Space: We apply DIM attack (Xie et al., 2019) on the original CLIP model. It generates adversaries with text imprints. These perturbation successfully fools CLIP but does not transfer well on image models since the presence of textual bias is not optimal for black-box image models. We adapt the pre-trained and frozen CLIP vision encoder to videos. Therefore, it is expected that after training our temporal prompts introduced within CLIP also contain textual bias as these prompts interact with CLIP frozen features. Best Viewed in Zoom. found via the CLIP vision encoder show lower transferability as compared to similar models such as DINO (Caron et al., 2021) and Deit-B (Touvron et al., 2020). The alignment of CLIP vision features towards text results into adversaries with textual bias. We can see textual patterns emerging within adversarial perturbations (Fig. 5). These perturbations are optimal to fool CLIP but not that meaningful for vision models trained without text supervision. We quantify this as well by measuring cosine similarly between visual features of CLIP vision encoder, DINO, and Deit-B with CLIP 16 Published as a conference paper at ICLR 2023 Measuring Textual Bias Vision Encoder Text Encoder Cosine Similarity CLIP Deit-B DINO CLIP CLIP CLIP 0.31 0.005 0.002 Table 9: Textual Bias of Vision Encoders: Results are reported on 1000 randomly selected images (one per class) from ImageNet validation set. We measure the similarity between the refined class token output by vision encoders with textual features output by CLIP text encoder for text label input as "a photo of a {class name}". Inference on Shuffled Frames Model (↓) Temporal Prompts UCF HMDB k400 SSv2 Deit-B DINO CLIP (cid:51) (cid:51) (cid:51) 16.9±0.52 80.31±0.33 46.2±0.22 78.40±0.35 46.1±0.19 17.1±0.32 85.6 ± 0.23 55.0 ± 0.18 66.2 ± 0.33 19.1 ± 0.21 57.1±0.35 55.7±0.21 Table 10: Robustness to Temporal Variations: We repeat inference re- sults three times on a single view with 8 randomly sampled and shuf- fled frames. Our adapted image mod- els show higher robustness to such temporal variations. Effect of Number of Temporal Prompts on Transferability Model (↓) Temporal Prompts Deit-B DINO 8 16 32 8 16 32 TimesFormer ResNet3D UCF HMDB K400 SSv2 UCF HMDB K400 SSv2 55.5 51.4 21.5 45.2 42.9 30.2 12.6 10.6 6.5 7.3 6.0 5.7 40.6 38.7 23.1 35.8 35.3 22.6 16.8 15.3 10.4 15.8 14.5 8.3 37.3 35.2 19.6 32.2 29.7 15.3 11.4 9.9 6.0 10.6 8.8 4.9 21.5 20.6 13.9 18.3 18.1 10.0 13.3 15.5 11.2 12.0 11.5 7.3 Table 11: Effect of Number of Temporal Prompts on Adversarial Transferability: We observe non-trivial gains in adversarial transferability as we increase our temporal prompts. This indicates that the more the temporal information the better the attack transferability (DIM (Xie et al., 2019)) of our approach (lower is better). textual features produced for text labels (Table 9). These observations further explain the lower performance of the ensemble of different training frameworks ({DINO, CLIP, Deit-B}) as compared to an ensemble of different networks ({Deit-T, Deit-S, Deit-B}) (Fig. 4). E ATTENTION ROLL-OUT ACROSS TIME We compute the roll-out attention (Abnar & Zuidema, 2020) of our temporal prompts within image models and compared those against original image models (Fig. 6). We observe that our temporal prompts focuses on action across different frames for a video as compared to the spatial class token with in pre-trained image models. Fooling such models allows for finding transferable adversarial patterns. F ANALYSING DYNAMIC CUES AGAINST TEMPORAL VARIATIONS We further analyse our dynamic cues by measure robustness to temporal variations. We provide inference results on shuffled video frames in Table 10. We randomly sample a single view with 8 frames and report average and standard deviation across three runs. Our models are robust to such temporal variations. G EFFECT OF NUMBER OF TEMPORAL PROMPTS It's a common practice to increase the number of frames for better temporal modeling. In similar spirit, we also increase number of training frames and consequently the number of our temporal prompts through transformation. As expected, this strategy leads to better performance in modeling dynamic cues and attack transferability (Table 11). 17 Published as a conference paper at ICLR 2023 Attention Roll-out: Deit-B with and without our Dynamic Cues Attention Roll-out: DINO with and without our Dynamic Cues Figure 6: Visualization of Dynamic Cues through Attention role-out: We use (Abnar & Zuidema, 2020) to observe the most salient regions for the spatial and temporal class tokens. Our temporal class token pay more attention to action within a video across temporal frames. 18 DINO Deit-B Model Deit-B Deit-B DINO DINO CLIP CLIP TimesFormer Published as a conference paper at ICLR 2023 Temporal Prompting Vs. Fine-Tuning Models (↓) Temporal Prompts Fine Tuning TimesFormer UCF HMDB 56.3 45.2 59.3 55.5 13.6 7.3 12.1 12.6 Table 12: Temporal Prompts Vs. Full Fine Tuning: Our proposed temporal Prompts per- form favorably as compared to the full fine- tuning of the image model for dynamic cues. Full fine-tuning affects the pre-trained image representations which in turn lowers the con- tribution of self-supervised attack loss (Eq. 3) during the attack, reducing adversarial trans- ferability. (cid:51) (cid:51) (cid:51) (cid:51) (cid:51) (cid:55) (cid:51) (cid:55) Temporal Prompts Total Parameters (Millions) Trainable Parameters (Millions) GFLOPs (cid:55) (cid:51) (cid:55) (cid:51) (cid:55) (cid:51) – 86.0 95.0 86.0 95.0 85.6 93.6 121.7 – 7.7 – 7.7 – 7.4 121.7 140.6 34.1 140.6 34.1 139.5 34.1 196 Table 13: Our approach has significantly less computational overhead with few learnable parameters. In comparison to video models such as TimesFormer, we need to train only 7 million parameters. Note that video models like Timesformer simultaneously forward pass all sampled frames through the model layers. The image models like Deit can only process one frame at a time so these models require multiple forward pass to process a video. In contrast, our single transformation layer process a video to generate temporal prompts which are combined with a randomly selected single frame to forward pass through our image models. As result, our approach is computationally cheaper than pure video or image models while increasing the adversarial transferability. We present these results for single view with 8 frames. H PROMPT LEARNING VS. FINE TUNING We aim to use the same image backbone for different video or multi-view datasets. It has lower memory cost and computational overhead as we don't need to update all the model parameters during the backpass (Table 13). Our attack exploits pre-trained image representations (for example learned on ImageNet) along with dynamic cues (introduced via learning temporal prompts) to fool black-box video models. These adapted image models are not optimal for video learning as compared to specialized video networks such as TimesFormer (Bertasius et al., 2021). When we fully fine-tune the pre-trained image model with our design to videos, the performance of the adapted models improves, in terms of top-1 (%) accuracy, on video datasets. As a result of this fine-tuning, however, we loss the original image representations otherwise preserved in our approach. This means that the contribution of our self- supervised loss (Lss), designed to exploit image level representation, reduces and as a result it affects the transferability of adversarial attacks. Our prompt learning approach preserves the original image representations within the spatial class token which is used in our self-supervised loss to boost adversarial transferability. We lose the original image representations when doing full fine-tuning of our model on videos and as a result, transferability decreases ( Table 12 ). Interestingly this tradeoff between full fine-tuning and adversar- ial transferability is even more prominent with self-supervised DINO model as supervised fine-tuning affects the self-supervised inductive biases learned by the DINO. In conclusion, attacks from pure image representations that is without temporal prompts, or from pure video representation that is without image representation show relatively lower transferability. The combination of adversarial image and video representations compliments each other in enhancing the transferability to black-box videos and image models. Both image and video representations are well preserved in our approach with in a single image model. 19 Published as a conference paper at ICLR 2023 I IMAGE MODELS FOR VIDEOS AT VARYING SPATIAL SCALES We observe that our approach significantly improve generalization of image models on videos with low spatial resolutions (Table 14). Model UCF HMDB 224×224 96×96 56×56 224×224 96×96 56×56 DeiT-B 81.4 60.0 32.3 47.7 31.1 15.4 Table 14: Adapting image models to videos at varying spatial resolutions (SR): We showcase the generalization of DeiT-B model adopted for UCF and HMDB at multiple spatial resolutions. J VISUALIZING LATENT EMBEDDINGS We show latent space embedding of our prompts for low resolution inputs in Fig. 7. The class tokens of DeiT-S models projected from R384 to R2. The class tokens of DeiT-B models projected from R768 to R2. Figure 7: We adopted pre-trained Deit models (Touvron et al., 2020) at varying spatial resolutions using our approach; 56×56, 96×96, 120×120 (from left to right). We showcase inter-class separation and intraclass variation via t-SNE (Van der Maaten & Hinton, 2008) on 10 classes from ImageNet validation set. Our adopted image model have lower intraclass variations and better interclass separation than the original models. We used sklearn (Pedregosa et al., 2011) with perplexity set to 30 for all the experiments. (best viewed in zoom). K VISUAL DEMOS Figures 8, 9, and 10 shows adversarial pattern from our adapted image models, Deit-B, DINO, and CLIP, for different video samples. 20 Published as a conference paper at ICLR 2023 Clean video sample Adversarial patterns of DINO for a video sample. Adversarial patterns of CLIP for a video sample. Adversarial patterns of Deit-B for a video sample. Figure 8: Visualizing the behavior of Adversarial Patterns across Time: We generate adversarial signals from DINO, CLIP, and DEIT-B models with temporal prompts using DIM attack (Xie et al., 2019). Observe the change in gradients across different frames (best viewed in zoom). 21 Published as a conference paper at ICLR 2023 Clean video sample Adversarial patterns of DINO for a video sample. Adversarial patterns of CLIP for a video sample. Adversarial patterns of Deit-B for a video sample. Figure 9: Visualizing the behavior of Adversarial Patterns across Time: We generate adversarial signals from DINO, CLIP, and Deit-B models with temporal prompts using DIM attack (Xie et al., 2019). Observe the change in gradients across different frames (best viewed in zoom). 22 Published as a conference paper at ICLR 2023 Clean video sample Adversarial patterns of DINO for a video sample. Adversarial patterns of CLIP for a video sample. Adversarial patterns of Deit-B for a video sample. Figure 10: Visualizing the behavior of Adversarial Patterns across Time: We generate adversarial signals from DINO, CLIP, and Deit-B models with temporal prompts using DIM attack (Xie et al., 2019). Observe the change in gradients across different frames (best viewed in zoom). 23 Published as a conference paper at ICLR 2023 Clean video sample Adversarial patterns of DINO for a video sample. Adversarial patterns of CLIP for a video sample. Adversarial patterns of Deit-B for a video sample. Figure 11: Visualizing the behavior of Adversarial Patterns across Time: We generate adversarial signals from DINO, CLIP, and Deit-B models with temporal prompts using DIM attack (Xie et al., 2019). Observe the change in gradients across different frames (best viewed in zoom). 24
http://arxiv.org/abs/2302.12254v3
2023-08-17T16:15:28
2023-02-23T18:59:56
Change is Hard: A Closer Look at Subpopulation Shift
Machine learning models often perform poorly on subgroups that are underrepresented in the training data. Yet, little is understood on the variation in mechanisms that cause subpopulation shifts, and how algorithms generalize across such diverse shifts at scale. In this work, we provide a fine-grained analysis of subpopulation shift. We first propose a unified framework that dissects and explains common shifts in subgroups. We then establish a comprehensive benchmark of 20 state-of-the-art algorithms evaluated on 12 real-world datasets in vision, language, and healthcare domains. With results obtained from training over 10,000 models, we reveal intriguing observations for future progress in this space. First, existing algorithms only improve subgroup robustness over certain types of shifts but not others. Moreover, while current algorithms rely on group-annotated validation data for model selection, we find that a simple selection criterion based on worst-class accuracy is surprisingly effective even without any group information. Finally, unlike existing works that solely aim to improve worst-group accuracy (WGA), we demonstrate the fundamental tradeoff between WGA and other important metrics, highlighting the need to carefully choose testing metrics. Code and data are available at: https://github.com/YyzHarry/SubpopBench.
[ "Yuzhe Yang", "Haoran Zhang", "Dina Katabi", "Marzyeh Ghassemi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12254v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12254v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.CV" ]
Change is Hard: A Closer Look at Subpopulation Shift Yuzhe Yang * 1 Haoran Zhang * 1 Dina Katabi 1 Marzyeh Ghassemi 1 3 2 0 2 g u A 7 1 ] G L . s c [ 3 v 4 5 2 2 1 . 2 0 3 2 : v i X r a Abstract Machine learning models often perform poorly on subgroups that are underrepresented in the train- ing data. Yet, little is understood on the variation in mechanisms that cause subpopulation shifts, and how algorithms generalize across such di- verse shifts at scale. In this work, we provide a fine-grained analysis of subpopulation shift. We first propose a unified framework that dissects and explains common shifts in subgroups. We then establish a comprehensive benchmark of 20 state- of-the-art algorithms evaluated on 12 real-world datasets in vision, language, and healthcare do- mains. With results obtained from training over 10,000 models, we reveal intriguing observations for future progress in this space. First, existing al- gorithms only improve subgroup robustness over certain types of shifts but not others. Moreover, while current algorithms rely on group-annotated validation data for model selection, we find that a simple selection criterion based on worst-class ac- curacy is surprisingly effective even without any group information. Finally, unlike existing works that solely aim to improve worst-group accuracy (WGA), we demonstrate the fundamental trade- off between WGA and other important metrics, highlighting the need to carefully choose testing metrics. Code and data are available at: https: //github.com/YyzHarry/SubpopBench. 1. Introduction Machine learning models frequently exhibit drops in perfor- mance under the presence of distribution shifts (Quinonero- Candela et al., 2008). Constructing machine learning mod- els that are robust to these shifts is critical to the safe deploy- ment of such models in the real-world (Amodei et al., 2016). One ubiquitous type of distribution shift is subpopulation shift, which is characterized by changes in the proportion of some subpopulations between training and deployment *Equal contribution 1MIT CSAIL. Correspondence to: Yuzhe Yang <[email protected]>. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 (Koh et al., 2021). In such settings, models may have high overall performance but still perform poorly in rare sub- groups (Hashimoto et al., 2018; Zhang et al., 2020). A well-studied type of subpopulation shift occurs when data contains spurious correlations (Geirhos et al., 2020) – non- causal relationships between the input and the label which may shift in deployment (Simon, 1954). For example, image classifiers frequently make use of non-robust features such as image backgrounds (Xiao et al., 2016), textures (Geirhos et al., 2018), and erroneous markings (DeGrave et al., 2021). However, there has been little work in defining subpop- ulation shift in a holistic way, understanding when these shifts happen, and how state-of-the-art (SOTA) algorithms generalize under diverse and realistic shifts. Subpopula- tion shift can encompass a much wider array of underlying mechanisms. First, different attributes in data often exhibit skewed distributions, inevitably causing attribute imbalance (Martinez et al., 2021). Moreover, certain labels can have significantly fewer observations, where such long-tailed la- bel distribution induces severe class imbalance (Liu et al., 2019b). Finally, certain attributes may have no training data at all, which motivates the need for attribute generalization to unseen subpopulations (Santurkar et al., 2020). In this work, we systematically investigate subpopulation shift in realistic evaluation settings. We first formalize a generic framework of subpopulation shift, which decom- poses attribute and class to enable fine-grained analyses. We demonstrate that this modeling covers and explains the aforementioned common subgroup shifts, which are basic units of building more complex shifts that arise in real data. Using this framework, we can quantify the type and degree of different shift components in each given dataset. We establish a realistic and comprehensive benchmark of subpopulation shift, consisting of 20 SOTA algorithms that span different learning strategies and 12 real-world datasets in vision, language, and healthcare domains. While existing analysis on subpopulation shift either focus on a single shift type, or have limited severity, our benchmark provides a much larger set of datasets that cover different types of real- istic subgroup shifts. Our experimental framework can be easily extended to include new methods, shifts, and datasets. Our work also evaluates current methods across different settings including attribute availability in training and/or Change is Hard: A Closer Look at Subpopulation Shift validation set, model selection strategies, and a wide range of metrics for understanding subpopulation shift in-depth. With the established framework and over 10K trained mod- els, we reveal intriguing observations for future research. Concretely, we make the following contributions: • We formalize a unified framework for subpopulation shift which defines basic types of shift, explains when and why shifts happen, and quantifies their degrees. • We set up a comprehensive and realistic benchmark for systematic subpopulation shift evaluation, with 20 SOTA methods and 12 diverse datasets across various domains. • Based on over 10K trained models, we verify that current algorithms only advance subgroup robustness over certain types of shift identified by our framework, but not others. • We confirm that while successful algorithms rely on the access to group information for model selection, a simple criterion based on worst-class accuracy is surprisingly effective even without group-annotated validation data. • We establish the fundamental tradeoff between worst- group accuracy (WGA) and important metrics such as worst-case precision, highlighting the need to rethink eval- uation metrics in subpopulation shift beyond WGA. 2. Related Work Subpopulation Shift. Machine learning models frequently experience performance degradation under subpopulation shift, where the proportion of some subpopulations differ between the training and test (Cai et al., 2021; Koh et al., 2021). Depending on the definition of such subpopulations, this could lead to vastly different problem settings. Prior works largely focus on the case of shortcut learning (Geirhos et al., 2020), where subpopulations are defined as the prod- uct of attributes and labels. In such settings, models trained to minimize overall loss tend to learn spurious correlations, resulting in poor performance in the minority subpopulation (DeGrave et al., 2021; Joshi et al., 2022). There have been a large set of methods developed to address this scenario, both when the attribute is known (Gowda et al., 2021; Izmailov et al., 2022; Menon et al., 2020; Nam et al., 2022; Sagawa et al., 2019; Yao et al., 2022), and unknown (Creager et al., 2021; Han et al., 2022; Idrissi et al., 2022; Liu et al., 2021). However, subpopulations may also be defined using only the label. This setting corresponds to class-imbalanced learning, which has also been well studied with extensive proposed methods (Cao et al., 2019; Cui et al., 2019; Li et al., 2021; Yang & Xu, 2020; Yang et al., 2021; 2022). Finally, when subpopulations are defined based on a partic- ular attribute (e.g., demographic group) (Pfohl et al., 2022; Zong et al., 2022), the objective of maximizing performance for the worst-case group then becomes identical to minimax fairness (Lahoti et al., 2020; Martinez et al., 2020). In this work, we present a unified framework of subpopula- tion shift across these aforementioned scenarios. Distribution Shift Benchmarks. There have been few prior works which benchmark the performance of subpopu- lation shift methods. Koh et al. (2021) proposed the WILDS benchmark for domain generalization and subpopulation shift, though they only evaluated four methods over five datasets. Zhang et al. (2022) and Gulrajani & Lopez-Paz (2020) proposed the NICO++ and DomainBed benchmarks respectively for domain generalization, and we adapt ele- ments of their benchmark into our subpopulation shift evalu- ation. Santurkar et al. (2020) proposed the BREEDS bench- mark, which consists of multiple datasets constructed from ImageNet (Deng et al., 2009) using the WordNet hierarchy (Miller, 1995), aiming to evaluate generalization across un- seen attributes. Finally, Wiles et al. (2021) conducted a similar analysis in the general distribution shift setting on four synthetic and two real-world datasets. Our work differs from these prior works by evaluating a much larger set of algorithms that span different categories on many more real-world datasets. We further define, dissect and quantify the type and degree of shift components in each dataset, and relate it to the performance of each method. In addition, we analyze important yet overlooked factors such as model selection criteria and metrics to evaluate against, and reveal intriguing properties in subpopulation shift. 3. Unified Framework of Subpopulation Shift ∈ X and label y Problem Setup. In the general subpopulation shift setting, , the goal is to learn f : given input x ∈ Y . In addition, there exist attributes a1, ..., ai, ..., am, X → Y ai i, which may or may not be available when learning ∈ A f . Then, discrete subpopulations can be defined based on the attribute and label, by some function h : . A × Y → G Let l(y, f (x)) R be a loss function. Consider the source → distribution where (x, y) are drawn as a mixture of group- wise distributions: Psrc = (cid:80) ∆|G|. Further, consider some target distribution which is not ob- served: Ptar = (cid:80) g∈G βgPg, where β ∆|G|. The objec- tive of subpopulation shift is to find (Sagawa et al., 2020): g∈G αgPg, where α ∈ ∈ f ∗ = arg min f sup β∈∆|G| E(x,y)∼Ptar [l(y, f (x))]. This objective is equivalent to minimizing risk for the worst- case group (Sagawa et al., 2020), i.e., f ∗ = arg min f max g∈G E(x,y)∼Pg [l(y, f (x))]. 3.1. A Generic Framework for Subpopulation Shift As motivated earlier, both attribute a and label y can have specific skewed distributions, resulting in distinct types of 2 Change is Hard: A Closer Look at Subpopulation Shift Table 1. Formulation summary of basic types of subpopulation shift under our framework. Subpopulation Shift Type Attribute Bias Class Bias Impact on Classification Model Spurious Correlations (SC) Attribute Imbalance (AI) ptrain(a|y, xcore) ≫ ptrain(a|xcore) ptest(a|y, xcore) = ptest(a|xcore) ptrain(a|y, xcore) ≫ ptrain(a′|y, xcore) ptest(a|y, xcore) = ptest(a′|y, xcore) − − P(a|y,xcore) P(a|xcore) ≫ 1 ⇒ P(y|x) ↑ P(a|y,xcore) P(a|xcore) ≫ P(a′|y,xcore) P(a′|xcore) ⇒ P(y|xcore, a) ≫ P(y|xcore, a′) Class Imbalance (CI) − Attribute Generalization (AG) ptrain(a|y, xcore) = 0, ∀a ∈ A ptest(a|y, xcore) > 0, ∀a ∈ A unseen ptrain(Y = y) ≫ ptrain(Y = y′) ptest(Y = y) = ptest(Y = y′) P(y) ≫ P(y′) ⇒ P(y|x) ≫ P(y′|x) Unconstrained Generalize to A unseen subpopulation shift. To this end, we propose to decompose the effect of a and y given a multi-group dataset, and char- acterize general subpopulation shift into several basic shift components for fine-grained interpretation. Specifically, we view each input x as being fully described or generated from a set of underlying core features xcore (representing the label) and a list of attributes a (Tang et al., 2022; Wang et al., 2021). Here, xcore denotes the underly- ing invariant components that are label-specific and support robust classification, whereas attributes a may have inconsis- tent distributions and are not label-specific. Such modeling helps us disentangle the attributes and examine how they affect the classification results P(y x). Following Bayes' | theorem, we can rewrite the classification model as: that the attribute term in Eqn. (2) is only driven by biased attributes that are label-dependent. Using the formulation of "attribute-class" decomposition, we can intuitively explain when do common subpopulation shifts happen, and how they affect the classification results. 3.2. Characterizing Basic Types of Subpopulation Shift We formally define and characterize four basic types of sub- population shift using our framework: spurious correlations, attribute imbalance, class imbalance, and attribute gener- alization (see Table 1). In practice, we note that dataset often consists of multiple types of shift instead of one. The four cases constitute the basic shift units, and are important elements to explain complex subgroup shifts in real data. x) = P(y | = = P(y) y) P(x | P(x) * P(xcore, a y) | P(xcore, a) * P(xcore y) | P(xcore) (cid:123)(cid:122) PMI (cid:125) * (cid:124) P(y) y, xcore) P(a | xcore) P(a | (cid:123)(cid:122) attribute (cid:124) (cid:125) Spurious Correlations (SC). Spurious correlations happen when certain a is spuriously correlated with y in training but not in test data. Under our framework, it implies that ptrain(a xcore), which is not true of ptest. | As a result, it introduces bias to the attribute term, which induces higher prediction confidence for certain label once given its spuriously correlated attribute (details in Table 1). ptrain(a | y, xcore) ≫ (1) * , P(y) (cid:124)(cid:123)(cid:122)(cid:125) class where the first term in Eqn. (1) represents the pointwise mu- tual information (PMI) between xcore and y, the second term corresponds to the potential bias arising in the attribute distribution, and the third term explains the potential bias arising in the class (label) distribution. Given invariant xcore between training and testing distributions, we can ignore changes in first term (which is a robust indicator), and focus on how the second and third term, i.e., the attribute and class, influence the outcomes under subpopulation shift. More formally, assuming the mutual independence and con- ditional independence across different attributes ai (Wiles et al., 2021), we can further decompose the attribute term into a fine-grained version: y, xcore) P(a | xcore) ≜ P(a | (cid:89) ai∈a y, xcore) P(ai | xcore) P(ai | , (2) where each ai corresponds to an attribute. Note that for be- nign attributes that are independent of y (i.e., ai abenign), we have P(ai ∈ xcore), indicating | y, xcore) = P(ai | ⊥⊥ ai y, ∀ Attribute Imbalance (AI). Attributes often incur biased distributions in the wild. In our framework, it happens when certain attributes are sampled with a much smaller probabil- ity than others in ptrain, but not in ptest. To disentangle the effect of labels, we assume no class bias under this basic shift. As such, it again affects the attribute term in Eqn. (1) ptrain(a′ where ptrain(a y, xcore), causing lower y, xcore) | prediction confidence for underrepresented attributes. ≫ | Class Imbalance (CI). Similarly, class labels can exhibit imbalanced distributions, causing lower preference for mi- nority labels. Within our framework, CI can be explained by biasing the class term in ptrain, leading to higher prediction confidence for majority classes. Attribute Generalization (AG). Certain attributes can be totally missing in ptrain, but present in ptest, which motivates the need for attribute generalization. In our framework, this Aunseen, yet we have y, xcore) = 0, a translates to ptrain(a | ptest(a y, xcore) > 0. AG requires learning robust xcore in | order to generalize across unseen attributes, which is harder but more ubiquitous in real data (Santurkar et al., 2020). ∈ 3 Change is Hard: A Closer Look at Subpopulation Shift Table 2. Overview of the datasets for evaluating subpopulation shift. Detailed statistics and example data are provided in Appendix B. Dataset Data type # Attr. # Classes # Train set # Val. set # Test set Max group Min group Waterbirds CelebA MetaShift ImageNetBG NICO++ Living17 MultiNLI CivilComments Image Image Image Image Image Image Text Text MIMICNotes Clinical text MIMIC-CXR CheXpert Chest X-rays Chest X-rays CXRMultisite Chest X-rays 2 2 2 N/A 6 N/A 2 8 2 6 6 2 2 2 2 9 60 17 3 2 2 2 2 2 4795 162770 2276 183006 62657 39780 206175 148304 16149 303591 167093 338134 1199 19867 349 7200 8726 4420 82462 24278 3229 17859 22280 19891 SC ✓ ✓ ✓ 5794 19962 874 4050 17483 1700 3498 (73.0%) 56 (1.2%) 71629 (44.0%) 1387 (0.9%) 789 (34.7%) 196 (8.6%) N/A N/A 811 (1.3%) 0 (0.0%) N/A N/A 123712 67376 (32.7%) 1521 (0.7%) 71854 6460 35717 33419 39781 31282 (21.1%) 1003 (0.7%) 8359 (51.8%) 676 (4.2%) 68575 (22.6%) 7846 (2.6%) 51606 (30.9%) 506 (0.3%) 299089 (88.5%) 574 (0.2%) ✓ Shift type AI ✓ ✓ ✓ ✓ ✓ ✓ ✓ CI AG ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ 4. Benchmarking Subpopulation Shift Datasets. We explore subpopulation shift using 12 real- world datasets from a variety of modalities and tasks. First, for vision datasets, we use Waterbirds (Wah et al., 2011) and CelebA (Liu et al., 2015), which are commonly used in the spurious correlation literature (Liu et al., 2021). Simi- larly, we use the MetaShift cats vs. dogs dataset (Liang & Zou, 2022). We further convert the ImageNet backgrounds challenge (ImageNetBG) (Xiao et al., 2020), the NICO++ (Zhang et al., 2022) benchmark, and the Living17 dataset from the BREEDS benchmark (Santurkar et al., 2020) for subpopulation shift. Further, for language understanding datasets, we leverage CivilComments (Borkan et al., 2019) and MultiNLI (Williams et al., 2017), which are commonly used text datasets in subpopulation shift. Finally, we curate 4 datasets in the medical domain. We construct MIMIC-CXR (Johnson et al., 2019) and CheXpert (Irvin et al., 2019) to predict the presence of any pathology from a chest X-ray. We also construct MIMICNotes for mortality classification from clinical notes (Chen et al., 2019). Finally, we follow a recent work in evaluating subgroup shift and construct the CXRMultisite dataset (Puli et al., 2021). Table 2 reports the details of each dataset. We leave full information and descriptions for each of the datasets in Appendix B.1. Algorithms. We evaluate 20 algorithms that span a broad range of learning strategies and categories, and relate their performance to different shifts defined in our framework. We believe this is the first work to comprehensively evalu- ate a large set of diverse algorithms in subpopulation shift. Concretely, these algorithms cover the following areas: (1) vanilla: ERM (Vapnik, 1999), (2) subgroup robust methods: GroupDRO (Sagawa et al., 2020), CVaRDRO (Duchi & Namkoong, 2018), LfF (Nam et al., 2020), JTT (Liu et al., 2021), LISA (Yao et al., 2022), DFR (Izmailov et al., 2022), (3) data augmentation: Mixup (Zhang et al., 2018), (4) domain-invariant feature learning: IRM (Arjovsky et al., 2019), CORAL (Sun & Saenko, 2016), MMD (Li et al., 2018), (5) imbalanced learning: ReSample (Japkowicz, 2000), ReWeight (Japkowicz, 2000), Focal (Lin et al., 2017), CBLoss (Cui et al., 2019), LDAM (Cao et al., 2019), BSoftmax (Ren et al., 2020), CRT (Kang et al., 2020), ReWeightCRT (Kang et al., 2020). Our framework can be easily extended to include new algorithms. We provide detailed descriptions for each algorithm in Appendix B.2. Evaluation Metrics. Existing works on subpopulation shift mainly report worst-group accuracy (WGA) as the gold-standard. While WGA faithfully assesses worst-group performance, other important metrics (e.g., worst-case pre- cision, calibration error, etc.) are also essential especially when involving subpopulation shift. Therefore, in our bench- mark we include a variety of metrics aiming for a thorough evaluation from different aspects. In particular, besides Avg Accuracy and Worst Accuracy, we further include Avg Precision, Worst Precision, Avg F1-score, Worst F1- score, (Class-)Balanced Accuracy, Adjusted Accuracy (accuracy on a group-balanced dataset), and expected cali- bration error (ECE) (Guo et al., 2017). Detailed summaries of all metrics are in Appendix B.3. Attribute Availability. Whether attribute is known in both (1) training set and (2) validation set has long been a vital factor for almost all subgroup algorithms (Izmailov et al., 2022). Specifically, classic methods (e.g., GroupDRO) as- sume access to attributes during training to define meaning- ful groups. Recently, a number of methods (e.g., JTT, LfF, DFR) try to improve worst-group accuracy without knowing the training attributes. Nevertheless, current approaches still require access to group-annotated validation set for model selection and hyperparameter tuning (Idrissi et al., 2022). We systematically investigate this phenomenon by consider- ing three settings in our benchmark: (1) attributes are known in both training & validation, (2) attributes are unknown 4 Change is Hard: A Closer Look at Subpopulation Shift Figure 1. Worst-group improvements over ERM across different datasets when attributes are unknown in both training and validation set. SOTA algorithms only enhance subgroup robustness on certain types of shift (i.e., SC and CI). Complete results are in Appendix D.2. 5. A Fine-Grained Analysis 5.1. Quantifying Subpopulation Shift In order to quantify the degree of each shift for each dataset relative to others, we use several simple metrics. For spuri- ous correlations, we use the normalized mutual information between A and Y , where norm I(A; Y ) = 1 means that the two are perfectly correlated: norm I(A; Y ) = 2I(A;Y ) H(Y )+H(A) . For attribute and class imbalance, we use the normalized en- tropy, where norm H(Y ) = 1 indicates that the distribution is uniform (i.e., no imbalance): norm H(Y ) = H(Y ) log |supp(Y )| . For attribute generalization, we simply examine whether there exist any subpopulations in the test set which do not appear during training via an indicator function (see Fig. 2). We provide several additional metrics in Appendix D.1. We find that different datasets exhibit very different types of shift, and the degrees also greatly vary (Fig. 2). To further study how algorithms perform across various types of shift, we categorize each dataset into its most dominant shift type. 5.2. Performance across Different Types of Shift As described earlier, we run experiments for all algorithms, datasets, and attribute availability settings. We use worst- group accuracy as the model selection criterion, and provide analysis for other metrics in Appendix D.3. When attributes are unknown in the validation set, this criterion degenerates to worst-class accuracy. Interestingly, we discover that this simple method is surprisingly effective (related results in Sec. 5.4). In total, we trained over 10,000 models. We study model performance over different shifts. Specifi- cally, we report results when attributes are unknown in both training and validation. Results for other settings are in Ap- pendix D.2. We present main results in Fig. 1 and Table 3, where we make intriguing observations as follows. SOTA algorithms only improve subgroup robustness on certain types of shift, but not others. As Fig. 1 illustrates, for spurious correlations and class imbalance, existing algo- Figure 2. Quantification of the degree of different shifts over all datasets. Additional metrics are provided in Appendix D.1. in training, but known in validation, and (3) attributes are unknown in both training & validation. Note that when training attributes are unknown, methods that operate over subgroups degenerate to operate over classes. Without fur- ther specification, we report results under the third setting, which is the hardest but the most realistic one. We include full results across all settings in Appendix E. Model Selection. As mentioned earlier, model selection becomes essential when attributes are completely unknown. Significant drop (over 20%) in worst-group test accuracy has been observed if using the highest average validation accuracy as the model selection criterion without any group annotations (Idrissi et al., 2022). To this end, we provide a rigorous analysis on different model selection strategies, especially when attributes are fully unknown. Further details are provided in Appendix B.4. Implementation. For a fair evaluation, following (Gulra- jani & Lopez-Paz, 2021), for each algorithm we conduct a random search of 16 trials over a joint distribution of all hyperparameters (details are provided in Appendix C). We then use the validation set to select the best hyperparameters for each algorithm, fix them and rerun the experiments un- der three different random seeds to report the final average results with standard deviation. Such process ensures the comparison is best-versus-best, and the hyperparameters are optimized for all algorithms. 5 WaterbirdsCelebACivilCommentsMultiNLIMIMIC-CXRCXRMultisiteMIMICNotesImageNetBGLiving17NICO++°10°505101520Worst-groupImprovement(%)GroupDROJTTMixupReWeightCBLossBSoftmaxDFRCRTSpurious CorrelationsAttribute ImbalanceClass ImbalanceAttribute Generalizationmore spurious0.00.20.40.6norm.I(A;Y)NICO++Living17ImageNetBGCheXpertMIMICNotesCXRMultisiteMIMIC-CXRMultiNLICivilCommentsMetaShiftCelebAWaterbirds0.40.60.81.0norm.H(A)0.250.500.751.00norm.H(Y)0.00.51.01(Aunseen6=?)0.00.20.40.6norm.I(A;Y)NICO++Living17ImageNetBGCheXpertMIMICNotesCXRMultisiteMIMIC-CXRMultiNLICivilCommentsMetaShiftCelebAWaterbirds0.40.60.81.0norm.H(A)0.250.500.751.00norm.H(Y)0.00.51.01(Aunseen6=?)0.00.20.40.6norm.I(A;Y)NICO++Living17ImageNetBGCheXpertMIMICNotesCXRMultisiteMIMIC-CXRMultiNLICivilCommentsMetaShiftCelebAWaterbirds0.40.60.81.0norm.H(A)0.250.500.751.00norm.H(Y)0.00.51.01(Aunseen6=?)0.00.20.40.6norm.I(A;Y)NICO++Living17ImageNetBGCheXpertMIMICNotesCXRMultisiteMIMIC-CXRMultiNLICivilCommentsMetaShiftCelebAWaterbirds0.40.60.81.0norm.H(A)0.250.500.751.00norm.H(Y)0.00.51.01(Aunseen6=?)0.00.20.40.6norm.I(A;Y)NICO++Living17ImageNetBGCheXpertMIMICNotesCXRMultisiteMIMIC-CXRMultiNLICivilCommentsMetaShiftCelebAWaterbirds0.40.60.81.0norm.H(A)0.250.500.751.00norm.H(Y)0.00.51.01(Aunseen6=?)more imbalancemore imbalanceneed to generalizeSCAICIAGSpurious CorrelationsAttribute ImbalanceClass ImbalanceAttribute Generalization Change is Hard: A Closer Look at Subpopulation Shift Table 3. Results on all tested subpopulation benchmarks, when attributes are unknown in both training and validation set. Full results for each dataset and other settings are in Appendix E. Methods that re-train classifier using a two-stage strategy are marked in gray . Algorithm Waterbirds CelebA CivilComments MultiNLI MetaShift ImageNetBG NICO++ MIMIC-CXR MIMICNotes CXRMultisite CheXpert Living17 Avg ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 69.1 ±4.7 77.5 ±0.7 73.1 ±0.4 75.5 ±2.2 71.2 ±0.5 75.0 ±0.7 77.5 ±0.7 70.0 ±1.0 71.9 ±0.6 71.0 ±1.4 74.4 ±1.2 71.6 ±0.8 70.9 ±1.7 74.1 ±0.9 89.0 ±0.2 76.3 ±0.8 76.3 ±0.2 57.6 ±0.8 57.8 ±0.8 68.3 ±0.9 60.2 ±3.0 48.3 ±1.5 53.0 ±4.3 57.8 ±0.8 74.1 ±2.2 69.6 ±0.2 66.9 ±2.2 65.4 ±1.4 56.9 ±3.4 57.0 ±4.1 69.6 ±1.2 73.7 ±0.8 69.6 ±0.7 70.7 ±0.6 63.2 ±1.2 65.8 ±1.5 61.5 ±1.8 62.9 ±3.8 51.0 ±4.2 42.2 ±7.2 65.8 ±1.5 61.0 ±0.6 59.3 ±1.1 68.6 ±1.1 67.3 ±0.2 61.9 ±1.1 28.4 ±7.7 58.3 ±1.1 64.4 ±0.1 67.8 ±0.3 64.7 ±0.2 66.4 ±2.3 66.8 ±0.3 64.1 ±0.8 48.2 ±3.4 65.1 ±1.6 57.3 ±5.7 66.8 ±0.3 66.8 ±0.5 64.2 ±1.9 63.8 ±2.4 63.6 ±2.4 62.4 ±2.0 65.5 ±0.8 63.6 ±2.4 63.8 ±0.0 65.4 ±0.2 65.2 ±0.2 82.1 ±0.8 79.0 ±0.8 83.1 ±0.7 83.5 ±0.5 82.6 ±0.4 72.3 ±1.3 79.0 ±0.8 81.0 ±1.7 83.1 ±0.7 82.6 ±0.4 83.1 ±0.0 81.0 ±0.4 83.6 ±0.4 82.6 ±0.4 81.4 ±0.1 83.1 ±0.0 85.1 ±0.4 76.8 ±0.9 76.9 ±0.7 76.4 ±0.2 74.8 ±0.8 77.0 ±0.4 70.1 ±1.4 76.9 ±0.7 77.7 ±1.1 76.8 ±0.9 76.8 ±0.9 76.8 ±0.9 71.9 ±1.2 76.7 ±0.5 76.1 ±2.0 74.4 ±1.8 78.2 ±0.5 77.5 ±0.7 35.0 ±4.1 30.0 ±4.1 31.1 ±0.9 27.8 ±2.3 30.6 ±2.3 28.8 ±2.0 30.0 ±4.1 30.6 ±2.3 25.0 ±0.0 32.8 ±3.5 31.7 ±3.6 30.6 ±2.3 31.7 ±3.6 35.6 ±1.8 38.0 ±3.8 33.3 ±0.0 33.3 ±0.0 68.6 ±0.2 66.8 ±0.6 67.4 ±0.5 68.0 ±0.2 64.9 ±0.3 62.2 ±2.4 66.8 ±0.6 67.5 ±0.3 67.0 ±0.4 68.0 ±0.4 67.6 ±0.3 68.7 ±0.4 66.6 ±0.6 67.6 ±0.6 67.1 ±0.4 68.1 ±0.1 67.9 ±0.1 80.4 ±0.2 81.6 ±0.6 83.7 ±0.1 65.6 ±1.5 83.8 ±0.1 84.0 ±0.1 81.6 ±0.6 82.6 ±0.6 84.0 ±0.1 83.1 ±0.2 84.0 ±0.1 70.9 ±9.8 81.0 ±0.3 83.8 ±0.3 80.2 ±0.0 83.4 ±0.0 83.4 ±0.0 50.1 ±0.9 50.1 ±0.9 59.2 ±0.3 50.2 ±0.9 57.9 ±2.1 50.1 ±0.9 50.1 ±0.9 55.0 ±0.2 61.4 ±1.3 61.2 ±0.6 50.2 ±0.9 50.0 ±0.9 50.1 ±0.9 58.6 ±1.8 60.8 ±0.4 61.8 ±0.1 53.1 ±2.3 41.7 ±3.4 37.4 ±3.5 74.7 ±0.3 50.2 ±1.8 60.4 ±4.8 13.7 ±9.8 37.4 ±3.5 74.3 ±0.4 73.7 ±1.0 68.5 ±1.6 74.0 ±0.7 42.1 ±4.0 36.0 ±0.7 73.8 ±1.0 75.8 ±0.3 74.6 ±0.4 75.1 ±0.2 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 59.9 60.0 64.5 57.8 60.1 52.9 60.0 64.3 63.6 64.2 63.8 57.9 56.0 64.4 66.2 66.1 65.4 Figure 3. Averaged worst-group accuracy of different manners for representation learning and classifier learning under different shifts. Within each shift type, we average the results across datasets that belong to this shift to report the final accuracy. As observed, balanced classifier learning substantially improves the results for SC and CI, while balanced representation learning gives reasonable gains for AI; Yet, no stratified learning manners lead to performance gains under AG compared to vanilla ERM. Experimental details are in Sec. 5.3. Table 4. Relative improvements over ERM when using stratified balanced representation or classifier learning under different shifts. REPRESENTATION CLASSIFIER SC -0.3 +8.1 AI +1.1 +0.0 CI -0.2 +11.9 AG -0.4 -0.4 rithms can provide consistent worst-group gains over ERM even in the absence of validation attributes, indicating that progress has been made for tackling these two specific shifts. Interestingly however, when it comes to attribute imbalance, little improvement is observed across datasets. In addition, the performance becomes even worse for attribute general- ization. These findings stress that current advances are only made for specific shifts (i.e., SC and CI), while no progress has been made for the more challenging shifts such as AG. Methods that decouple representation and classifier are more effective. When further zoom into the performance across all datasets in Table 3, a set of methods that decouple the training of representation and classifier (Izmailov et al., 2022; Kang et al., 2020) achieve remarkable gains over all other algorithms (highlighted in gray). As prior works also confirmed (Izmailov et al., 2022), features learned by ERM seem to be good enough under spurious correlations. These findings inspire us to further understand the role of repre- sentation and classifier in subpopulation shift, especially their behaviors under different subgroup shifts. 5.3. The Role of Representation and Classifier We are motivated to explore the role of representation and classifier in subpopulation shift. In particular, we separate the whole network into two parts: the feature extractor and the classifier. We then employ three training strategies for representation and classifier learning, respectively: (1) uni- form, which follows the normal ERM training; (2) balanced sampling, where balanced samples are drawn from each group (class if attribute not available) during training, and (3) re-weighting, where we re-weight all the samples by the inverse of the sample size of their groups (classes). Note that classifier re-balancing resembles CRT (Kang et al., 2020) and DFR (Izmailov et al., 2022). We train models following the above settings across all datasets, and average the results over datasets according to the type of shift. Representation & classifier quality play different roles under different shifts. As Fig. 3 reveals, for SC and CI, balanced classifier learning (i.e., both re-sampling and re- weighting) can substantially improve the performance when fixing the representation, whereas different representation 6 uniformbal.samplingbal.weightClassifierLearninguniformbal.samplingbal.weightRepresentationLearning69.8077.0076.3068.3073.5077.8068.4077.1076.70SpuriousCorrelationsuniformbal.samplingbal.weightClassifierLearninguniformbal.samplingbal.weightRepresentationLearning66.4066.4066.4067.0067.0066.9067.4067.4067.60AttributeImbalanceuniformbal.samplingbal.weightClassifierLearninguniformbal.samplingbal.weightRepresentationLearning44.7053.4054.2041.6049.0054.9042.1054.5055.10ClassImbalanceuniformbal.samplingbal.weightClassifierLearninguniformbal.samplingbal.weightRepresentationLearning36.9035.7035.0035.1034.7035.1035.4035.8035.20AttributeGeneralization70727476Avg.Acc.(↑)66.466.666.867.067.267.467.6Avg.Acc.(↑)42444648505254Avg.Acc.(↑)34.7535.0035.2535.5035.7536.0036.2536.5036.75Avg.Acc.(↑) Change is Hard: A Closer Look at Subpopulation Shift Table 5. Test-set worst-group accuracy difference (%) between each selection strategy on each dataset, relative to the oracle which selects the best worst-group accuracy. Complete results across all datasets and all selection strategies are provided in Appendix D.3. Selection Strategy CelebA CheXpert CivilComments MIMIC-CXR MIMICNotes MetaShift Max Worst-Class Accuracy Max Balanced Accuracy Min Class Accuracy Diff Max Worst-Class F1 Max Overall AUROC Max Overall Accuracy -5.0 ±6.3 -4.4 ±5.4 -6.1 ±9.1 -13.4 ±10.4 -12.2 ±10.3 -18.6 ±12.0 -0.4 ±0.8 -1.3 ±2.5 -1.9 ±5.3 -5.4 ±6.7 -10.4 ±13.0 -30.9 ±24.9 -3.2 ±5.2 -3.5 ±5.8 -4.1 ±8.0 -3.2 ±3.8 -8.2 ±9.0 -13.7 ±9.5 -0.9 ±1.0 -2.9 ±4.9 -1.9 ±5.0 -2.5 ±2.2 -6.6 ±9.9 -5.1 ±6.3 -0.1 ±0.5 -2.3 ±6.2 -0.3 ±1.2 -4.4 ±8.7 -10.0 ±16.5 -19.9 ±26.0 -1.5 ±3.0 -1.7 ±3.0 -2.2 ±4.6 -1.8 ±3.3 -3.2 ±7.0 -1.9 ±3.3 Avg -1.8 -2.7 -2.7 -5.1 -8.4 -15.0 Figure 4. Averaged worst-group accuracy of various algorithms under different model selection and attribute availability settings. learning schemes do not lead to notable gains when fixing the classifier learning manner. Interestingly, for AI, balanc- ing the classifier does not lead to better performance, while balanced representation schemes can bring notable gains. ERM features are not sufficient for subpopulation shift. Unlike recent works that claim ERM features are sufficient for out-of-distribution generalization (Izmailov et al., 2022; Rosenfeld et al., 2022), our above intriguing findings sug- gest that features learned via ERM may only be good enough for certain shifts. Concretely, improving the feature extrac- tor still leads to notable gains especially for AI. The results in turn well explain the performance differences in Fig. 1, that SOTA algorithms with two-stage training do not im- prove worst-case accuracy under AI or AG. Stratified balanced learning does not outperform ERM under AG. Finally, no stratified learning manners lead to performance gains under AG. As Table 4 summarizes, both stratified representation and classifier learning manners even exhibit negative gains for datasets that require AG. This re- veals the intrinsic limitation of SOTA algorithms (Izmailov et al., 2022) against diverse types of subpopulation shift. 5.4. On Model Selection and Attribute Availability Model selection (e.g., choice of hyperparameters, training checkpoints) and attribute availability affect subpopulation shift evaluation considerably, especially given that almost all SOTA algorithms need access to a group-annotated val- idation set for model selection (Idrissi et al., 2022). We study this problem in-depth, where we follow three settings mentioned earlier (i.e., the availability of both training and validation attributes), and summarize the results in Fig. 4. The importance of training attribute availability relies on algorithm properties. As Fig. 4 verifies, when training attribute is available, it can greatly boost the performance of algorithms that need group information (e.g., GroupDRO), while it does not bring benefits for attribute-agnostic meth- ods (e.g., ERM, JTT). Validation attribute may not be necessary once you have a good selection metric. We further investigate the perfor- mance without validation attributes. It is widely known that SOTA subpopulation shift methods rely on group labels for validation. Surprisingly however, we observe a relatively small accuracy drop over all methods when using a sim- ple worst-class accuracy (degenerated from worst-group as attributes are unknown in validation) as selection metric. Specifically, comparing the last two bars across all methods in Fig. 4, the average accuracy drop is less than merely 2%. This striking finding contrasts with the literature, where large degradation (over 20%) is observed when using av- erage accuracy as the metric without validation attributes. This suggests that if carefully choosing a metric for model selection, we can achieve minimal worst-group accuracy loss even in the absence of any attribute information. Simple selection criterion using worst-class accuracy is surprisingly effective even without validation attribute. We examine different strategies for choosing when to stop during model training when no attribute annotations are available in both training and validation. We select six repre- sentative datasets and six representative selection strategies, respectively (full results across all datasets and all selection 7 ERMJTTMixupBSoftmaxDFRGroupDROReWeightCBLossCRT58606264666870AvgAcc.overAllDatasetsAttr:TrainX,ValX(selection:oracle)Attr:TrainX,ValX(selection:valworst-group)Attr:Train£,ValX(selection:valworst-group)Attr:Train£,Val£(selection:valworst-class)Training attributes agnosticTraining attributes can help Change is Hard: A Closer Look at Subpopulation Shift (a) Accuracy on the line: Adjusted accuracy is positively correlated with WGA. (b) Accuracy on the inverse line: Worst-case precision is negatively correlated with WGA. Figure 5. Fundamental tradeoff between WGA and other evaluation metrics. Complete results for all metrics are in Appendix D.4. strategies are in Appendix D.3). For each model, we utilize each stopping criterion over the validation set metrics com- puted throughout training, to determine its corresponding stopping point. We evaluate a variety of selection criteria in this way for a large variety of methods trained on each dataset. We compare each strategy with the oracle selection criteria, summarizing our results in Table 5. We observe that simply stopping when the worst-class accuracy reaches a maxima achieves the best worst-group accuracy on average. As expected, any selection criterion based on overall perfor- mance (e.g., accuracy, AUROC) performs much worse. 5.5. Metrics Beyond Worst-Group Accuracy Worst-group accuracy (WGA) has long been treated as the gold-standard for assessing the model performance in sub- population shift. Recent studies also discovered that WGA and model average performance are linearly correlated, a phenomenon called "Accuracy on the line" (Izmailov et al., 2022; Miller et al., 2021). However, WGA essentially as- sesses the worst-case (top-1) recall conditioned on attribute (Yang et al., 2022), which does not reflect other important metrics such as worst-case precision and calibration error. Whether models with high WGA will also perform bet- ter across these metrics remains unknown. Therefore, we further examine the relationship between WGA and other evaluation metrics that proposed in our benchmark. Intrinsic tradeoff: Accuracy can be on the inverse line. Interestingly, we observe that not all metrics are positively correlated with WGA. In particular, we show scatter plots of WGA vs. other metrics for representative datasets. As Fig. 5(a) confirms, adjusted accuracy is linearly correlated with WGA, which is well aligned with existing observations (Izmailov et al., 2022). Interestingly however, for worst-case precision, the positive correlation does not hold anymore; instead, we observe a strong negative linear correlation, in- dicating an intrinsic tradeoff between WGA and worst-case precision. We show in Appendix D.4 that many metrics also possess such "accuracy on the inverse line" property, further verifying the inherent tradeoff between testing metrics. Fundamental limitations of WGA as the only metric. The above observations highlight the complex relationship between WGA and other metrics: Certain metrics display high positive correlation, while many others show the oppo- site case. This finding uncovers the fundamental limitation of using only WGA to assess model performance in subpop- ulation shift: A well performed model with high WGA can however have low worst-case precision, which is alarming especially in critical applications such as medical diagnosis (e.g., CheXpert). Our observations emphasize the need for more realistic evaluation metrics in subpopulation shift. 5.6. Further Analysis Impact of model architecture (Appendix D.5). We study the effect of different model architectures on subpopulation shift across various datasets and modalities. In particular, we employ ResNets and vision transformers (ViTs) for the image modality, and five different transformer-based lan- guage models for the text modality. We observe that on text datasets, base BERT models are already competitive over other architecture variants (Table 13). Yet, the results on image datasets are mixed when comparing the worst-group performance for ResNets and ViTs (Tables 14 and 15). 8 0.820.840.860.880.900.92AdjustedAccuracy0.50.60.70.80.9WorstAccuracyCelebAρ=0.980.7550.7600.7650.7700.7750.780AdjustedAccuracy0.660.680.700.720.74MIMIC-CXRρ=0.280.720.740.760.78AdjustedAccuracy0.450.500.550.600.650.700.75CivilCommentsρ=0.820.650.700.75AdjustedAccuracy0.30.40.50.60.7CheXpertρ=0.910.600.650.700.75AdjustedAccuracy0.20.30.40.50.60.7MIMICNotesρ=0.990.50.60.70.80.9WorstPrecision0.20.40.60.81.0WorstAccuracyCelebAρ=−0.860.680.700.72WorstPrecision0.660.680.700.720.74MIMIC-CXRρ=−0.400.450.500.550.60WorstPrecision0.450.500.550.600.650.700.75CivilCommentsρ=−0.490.20.30.40.5WorstPrecision0.30.40.50.60.70.8CheXpertρ=−0.700.20.40.60.8WorstPrecision0.00.10.20.30.40.50.60.70.8MIMICNotesρ=−0.98 Change is Hard: A Closer Look at Subpopulation Shift Impact of pretraining methods (Appendix D.5). We in- vestigate how different pretraining methods affect the model performance under subpopulation shift. We consider both supervised and self-supervised pretraining using various SOTA methods. Similar to previous findings (Izmailov et al., 2022), we observe that supervised pretraining outperforms self-supervised counterparts for most of the experiments. The results may also suggest that better self-supervised schemes could be developed for tackling subgroup shifts. Impact of pretraining datasets (Appendix D.5). Finally, we investigate whether increasing the pretraining dataset size could lead to better subgroup performance. We leverage ImageNet-21K (Ridnik et al., 2021) and SWAG (Singh et al., 2022) in addition to the default ImageNet-1K. Interestingly, we find consistent and significant worst-group performance gains when going from ImageNet-1K to ImageNet-21K to SWAG, indicating that larger and more diverse pretraining datasets seem to increase worst-group performance. 6. Conclusion We systematically study the subpopulation shift problem, formalize a unified framework to define and quantify differ- ent types of subpopulation shift, and further set up a com- prehensive benchmark for realistic evaluation. Our bench- mark includes 20 SOTA methods and 12 real-world datasets across different domains. Based on over 10K trained mod- els, we reveal several intriguing properties in subpopulation shift that have implications for future research, including divergent performance on different shifts, model selection criteria, and metrics to evaluate against. We hope our bench- mark and findings will promote realistic and rigorous evalu- ations and inspire new advances in subpopulation shift. Acknowledgements This work was supported in part by the MIT-IBM Watson AI Lab, and a grant from Quanta Computing. References Amodei, D., Olah, C., Steinhardt, J., Christiano, P., Schul- man, J., and Man ́e, D. Concrete problems in ai safety. arXiv preprint arXiv:1606.06565, 2016. Anthony, L. F. W., Kanding, B., and Selvan, R. Car- bontracker: Tracking and predicting the carbon foot- print of training deep learning models. arXiv preprint arXiv:2007.03051, 2020. Arjovsky, M., Bottou, L., Gulrajani, I., and Lopez- Invariant risk minimization. arXiv preprint Paz, D. arXiv:1907.02893, 2019. Beltagy, I., Lo, K., and Cohan, A. Scibert: A pre- 9 trained language model for scientific text. arXiv preprint arXiv:1903.10676, 2019. Borkan, D., Dixon, L., Sorensen, J., Thain, N., and Vasser- man, L. Nuanced metrics for measuring unintended bias with real data for text classification. In Companion pro- ceedings of the 2019 world wide web conference, pp. 491–500, 2019. Cai, T., Gao, R., Lee, J., and Lei, Q. A theory of label propagation for subpopulation shift. In International Con- ference on Machine Learning, pp. 1170–1182. PMLR, 2021. Cao, K., Wei, C., Gaidon, A., Arechiga, N., and Ma, T. Learning imbalanced datasets with label-distribution- aware margin loss. In NeurIPS, 2019. Caron, M., Touvron, H., Misra, I., J ́egou, H., Mairal, J., Bojanowski, P., and Joulin, A. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9650–9660, 2021. Chen, I. Y., Szolovits, P., and Ghassemi, M. Can ai help reduce disparities in general medical and mental health care? AMA journal of ethics, 21(2):167–179, 2019. Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A simple framework for contrastive learning of visual rep- In International conference on machine resentations. learning, pp. 1597–1607. PMLR, 2020. Creager, E., Jacobsen, J.-H., and Zemel, R. Environment inference for invariant learning. In International Con- ference on Machine Learning, pp. 2189–2200. PMLR, 2021. Cui, Y., Jia, M., Lin, T.-Y., Song, Y., and Belongie, S. Class- balanced loss based on effective number of samples. In CVPR, 2019. DeGrave, A. J., Janizek, J. D., and Lee, S.-I. Ai for radio- graphic covid-19 detection selects shortcuts over signal. Nature Machine Intelligence, 3(7):610–619, 2021. Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009. Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. Bert: Pre-training of deep bidirectional transformers for lan- guage understanding. arXiv preprint arXiv:1810.04805, 2018. Duchi, J. and Namkoong, H. Learning models with uni- form performance via distributionally robust optimization. arXiv preprint arXiv:1810.08750, 2018. Change is Hard: A Closer Look at Subpopulation Shift Geirhos, R., Rubisch, P., Michaelis, C., Bethge, M., Wich- mann, F. A., and Brendel, W. Imagenet-trained cnns are biased towards texture; increasing shape bias improves ac- curacy and robustness. arXiv preprint arXiv:1811.12231, 2018. Geirhos, R., Jacobsen, J.-H., Michaelis, C., Zemel, R., Bren- del, W., Bethge, M., and Wichmann, F. A. Shortcut learn- ing in deep neural networks. Nature Machine Intelligence, 2(11):665–673, 2020. Gowda, S., Joshi, S., Zhang, H., and Ghassemi, M. Pulling up by the causal bootstraps: Causal data augmentation for pre-training debiasing. arXiv preprint arXiv:2108.12510, 2021. Gretton, A., Borgwardt, K. M., Rasch, M. J., Sch ̈olkopf, B., and Smola, A. A kernel two-sample test. The Journal of Machine Learning Research, 13(1):723–773, 2012. Gulrajani, I. and Lopez-Paz, D. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020. Gulrajani, I. and Lopez-Paz, D. In search of lost domain generalization. In ICLR, 2021. Guo, C., Pleiss, G., Sun, Y., and Weinberger, K. Q. On cali- bration of modern neural networks. In International Con- ference on Machine Learning, pp. 1321–1330. PMLR, 2017. Han, Z., Liang, Z., Yang, F., Liu, L., Li, L., Bian, Y., Zhao, P., Wu, B., Zhang, C., and Yao, J. Umix: Improving importance weighting for subpopulation arXiv preprint shift via uncertainty-aware mixup. arXiv:2209.08928, 2022. Hashimoto, T., Srivastava, M., Namkoong, H., and Liang, P. Fairness without demographics in repeated loss minimiza- tion. In International Conference on Machine Learning, pp. 1929–1938. PMLR, 2018. He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In CVPR, 2016. Hinton, G., Vinyals, O., and Dean, J. the knowledge in a neural network. arXiv:1503.02531, 2015. Distilling arXiv preprint Idrissi, B. Y., Arjovsky, M., Pezeshki, M., and Lopez-Paz, D. Simple data balancing achieves competitive worst- group-accuracy. In Conference on Causal Learning and Reasoning, pp. 336–351. PMLR, 2022. Irvin, J., Rajpurkar, P., Ko, M., Yu, Y., Ciurea-Ilcus, S., Chute, C., Marklund, H., Haghgoo, B., Ball, R., Shpan- skaya, K., et al. Chexpert: A large chest radiograph dataset with uncertainty labels and expert comparison. In Proceedings of the AAAI conference on artificial intelli- gence, volume 33, pp. 590–597, 2019. Izmailov, P., Kirichenko, P., Gruver, N., and Wilson, A. G. On feature learning in the presence of spurious correla- tions. arXiv preprint arXiv:2210.11369, 2022. Japkowicz, N. The class imbalance problem: Significance and strategies. In Proc. of the Int'l Conf. on Artificial Intelligence, volume 56, pp. 111–117. Citeseer, 2000. Johnson, A. E., Pollard, T. J., Shen, L., Lehman, L.-w. H., Feng, M., Ghassemi, M., Moody, B., Szolovits, P., An- thony Celi, L., and Mark, R. G. Mimic-iii, a freely ac- cessible critical care database. Scientific data, 3(1):1–9, 2016. Johnson, A. E., Pollard, T. J., Greenbaum, N. R., Lun- gren, M. P., Deng, C.-y., Peng, Y., Lu, Z., Mark, R. G., Berkowitz, S. J., and Horng, S. Mimic-cxr-jpg, a large publicly available database of labeled chest radiographs. arXiv preprint arXiv:1901.07042, 2019. Joshi, N., Pan, X., and He, H. Are all spurious features in natural language alike? an analysis through a causal lens. arXiv preprint arXiv:2210.14011, 2022. Kang, B., Xie, S., Rohrbach, M., Yan, Z., Gordo, A., Feng, J., and Kalantidis, Y. Decoupling representation and classifier for long-tailed recognition. ICLR, 2020. Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In ICLR, 2015. Koh, P. W., Sagawa, S., Marklund, H., Xie, S. M., Zhang, M., Balsubramani, A., Hu, W., Yasunaga, M., Phillips, R. L., Gao, I., et al. Wilds: A benchmark of in-the- wild distribution shifts. In International Conference on Machine Learning, pp. 5637–5664. PMLR, 2021. Kornblith, S., Shlens, J., and Le, Q. V. Do better imagenet models transfer better? In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2661–2671, 2019. Krishna, R., Zhu, Y., Groth, O., Johnson, J., Hata, K., Kravitz, J., Chen, S., Kalantidis, Y., Li, L.-J., Shamma, D. A., et al. Connecting language and vision using crowd- sourced dense image annotations. Visual genome, 2016. Lahoti, P., Beutel, A., Chen, J., Lee, K., Prost, F., Thain, N., Wang, X., and Chi, E. Fairness without demograph- ics through adversarially reweighted learning. Advances in neural information processing systems, 33:728–740, 2020. Li, H., Pan, S. J., Wang, S., and Kot, A. C. Domain gen- eralization with adversarial feature learning. In CVPR, 2018. 10 Change is Hard: A Closer Look at Subpopulation Shift Li, T., Cao, P., Yuan, Y., Fan, L., Yang, Y., Feris, R., In- dyk, P., and Katabi, D. Targeted supervised contrastive arXiv preprint learning for long-tailed recognition. arXiv:2111.13998, 2021. Menon, A. K., Rawat, A. S., and Kumar, S. Overparameter- isation and worst-case generalisation: friend or foe? In International Conference on Learning Representations, 2020. Li, Z., Evtimov, I., Gordo, A., Hazirbas, C., Hassner, T., Ferrer, C. C., Xu, C., and Ibrahim, M. A whac-a-mole dilemma: Shortcuts come in multiples where mitigating one amplifies others. arXiv preprint arXiv:2212.04825, 2022. Liang, W. and Zou, J. Metashift: A dataset of datasets for evaluating contextual distribution shifts and training conflicts. arXiv preprint arXiv:2202.06523, 2022. Lin, T.-Y., Goyal, P., Girshick, R., He, K., and Doll ́ar, P. Focal loss for dense object detection. In ICCV, pp. 2980– 2988, 2017. Liu, E. Z., Haghgoo, B., Chen, A. S., Raghunathan, A., Koh, P. W., Sagawa, S., Liang, P., and Finn, C. Just train twice: Improving group robustness without training group information. In International Conference on Machine Learning, pp. 6781–6792. PMLR, 2021. Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019a. Liu, Z., Luo, P., Wang, X., and Tang, X. Deep learning face attributes in the wild. In Proceedings of the IEEE international conference on computer vision, pp. 3730– 3738, 2015. Liu, Z., Miao, Z., Zhan, X., Wang, J., Gong, B., and Yu, S. X. Large-scale long-tailed recognition in an open world. In CVPR, 2019b. Maleki, F., Muthukrishnan, N., Ovens, K., Reinhold, C., and Forghani, R. Machine learning algorithm validation: from essentials to advanced applications and implications for regulatory certification and deployment. Neuroimaging Clinics, 30(4):433–445, 2020. Martinez, N., Bertran, M., and Sapiro, G. Minimax pareto In Interna- fairness: A multi objective perspective. tional Conference on Machine Learning, pp. 6755–6764. PMLR, 2020. Martinez, N. L., Bertran, M. A., Papadaki, A., Rodrigues, M., and Sapiro, G. Blind pareto fairness and subgroup ro- bustness. In International Conference on Machine Learn- ing, pp. 7492–7501. PMLR, 2021. Mehta, R., Albiero, V., Chen, L., Evtimov, I., Glaser, T., Li, Z., and Hassner, T. You only need a good embed- dings extractor to fix spurious correlations. arXiv preprint arXiv:2212.06254, 2022. Miller, G. A. Wordnet: a lexical database for english. Com- munications of the ACM, 38(11):39–41, 1995. Miller, J. P., Taori, R., Raghunathan, A., Sagawa, S., Koh, P. W., Shankar, V., Liang, P., Carmon, Y., and Schmidt, L. Accuracy on the line: on the strong correlation between out-of-distribution and in-distribution generalization. In International Conference on Machine Learning, pp. 7721– 7735. PMLR, 2021. Nam, J., Cha, H., Ahn, S., Lee, J., and Shin, J. Learning from failure: De-biasing classifier from biased classifier. Advances in Neural Information Processing Systems, 33: 20673–20684, 2020. Nam, J., Kim, J., Lee, J., and Shin, J. Spread spurious attribute: Improving worst-group accuracy with spurious attribute estimation. arXiv preprint arXiv:2204.02070, 2022. Paul, S. and Chen, P.-Y. Vision transformers are robust In Proceedings of the AAAI Conference on learners. Artificial Intelligence, volume 36, pp. 2071–2081, 2022. Pfohl, S. R., Zhang, H., Xu, Y., Foryciarz, A., Ghassemi, M., and Shah, N. H. A comparison of approaches to improve worst-case predictive model performance over patient subpopulations. Scientific reports, 12(1):1–13, 2022. Puli, A. M., Zhang, L. H., Oermann, E. K., and Ranganath, R. Out-of-distribution generalization in the presence of nuisance-induced spurious correlations. In International Conference on Learning Representations, 2021. Quinonero-Candela, J., Sugiyama, M., Schwaighofer, A., and Lawrence, N. D. Dataset shift in machine learning. Mit Press, 2008. Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al. Learning transferable visual models from natural In International conference on language supervision. machine learning, pp. 8748–8763. PMLR, 2021. Ren, J., Yu, C., Ma, X., Zhao, H., Yi, S., et al. Bal- anced meta-softmax for long-tailed visual recognition. In NeurIPS, 2020. 11 Change is Hard: A Closer Look at Subpopulation Shift Ridnik, T., Ben-Baruch, E., Noy, A., and Zelnik-Manor, L. Imagenet-21k pretraining for the masses. arXiv preprint arXiv:2104.10972, 2021. Rosenfeld, E., Ravikumar, P., and Risteski, A. Domain- adjusted regression or: Erm may already learn features sufficient for out-of-distribution generalization. arXiv preprint arXiv:2202.06856, 2022. Russakovsky, O., Deng, J., Su, H., Krause, J., Satheesh, S., Ma, S., Huang, Z., Karpathy, A., Khosla, A., Bern- stein, M., et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115: 211–252, 2015. Sagawa, S., Koh, P. W., Hashimoto, T. B., and Liang, P. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case gener- alization. arXiv preprint arXiv:1911.08731, 2019. Sagawa, S., Koh, P. W., Hashimoto, T. B., and Liang, P. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case gener- alization. In ICLR, 2020. Sanh, V., Debut, L., Chaumond, J., and Wolf, T. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019. Santurkar, S., Tsipras, D., and Madry, A. Breeds: Benchmarks for subpopulation shift. arXiv preprint arXiv:2008.04859, 2020. Schuhmann, C., Beaumont, R., Vencu, R., Gordon, C., Wightman, R., Cherti, M., Coombes, T., Katta, A., Mullis, C., Wortsman, M., et al. Laion-5b: An open large-scale dataset for training next generation image-text models. arXiv preprint arXiv:2210.08402, 2022. Seyyed-Kalantari, L., Zhang, H., McDermott, M. B., Chen, I. Y., and Ghassemi, M. Underdiagnosis bias of artificial intelligence algorithms applied to chest radiographs in under-served patient populations. Nature medicine, 27 (12):2176–2182, 2021. Simon, H. A. Spurious correlation: A causal interpretation. Journal of the American statistical Association, 49(267): 467–479, 1954. Singh, M., Gustafson, L., Adcock, A., de Freitas Reis, V., Gedik, B., Kosaraju, R. P., Mahajan, D., Girshick, R., Doll ́ar, P., and Van Der Maaten, L. Revisiting weakly supervised pre-training of visual perception models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 804–814, 2022. Steiner, A., Kolesnikov, A., Zhai, X., Wightman, R., Uszkor- eit, J., and Beyer, L. How to train your vit? data, augmen- tation, and regularization in vision transformers. arXiv preprint arXiv:2106.10270, 2021. Sun, B. and Saenko, K. Deep coral: Correlation alignment for deep domain adaptation. In ECCV, 2016. Tang, K., Tao, M., Qi, J., Liu, Z., and Zhang, H. Invariant feature learning for generalized long-tailed classification. In ECCV, pp. 709–726. Springer, 2022. Vapnik, V. N. An overview of statistical learning theory. IEEE transactions on neural networks, 10(5):988–999, 1999. Wah, C., Branson, S., Welinder, P., Perona, P., and Belongie, S. The caltech-ucsd birds-200-2011 dataset. 2011. Wang, T., Yue, Z., Huang, J., Sun, Q., and Zhang, H. Self- supervised learning disentangled group representation as feature. Advances in Neural Information Processing Systems, 34:18225–18240, 2021. Wiens, J., Saria, S., Sendak, M., Ghassemi, M., Liu, V. X., Doshi-Velez, F., Jung, K., Heller, K., Kale, D., Saeed, M., et al. Do no harm: a roadmap for responsible machine learning for health care. Nature medicine, 25(9):1337– 1340, 2019. Wiles, O., Gowal, S., Stimberg, F., Alvise-Rebuffi, S., Ktena, I., Dvijotham, K., and Cemgil, T. A fine-grained analysis on distribution shift. arXiv preprint arXiv:2110.11328, 2021. Williams, A., Nangia, N., and Bowman, S. R. A broad- coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426, 2017. Xiao, K., Engstrom, L., Ilyas, A., and Madry, A. Noise or signal: The role of image backgrounds in object recogni- tion. arXiv preprint arXiv:2006.09994, 2020. Xiao, T., Li, H., Ouyang, W., and Wang, X. Learning deep feature representations with domain guided dropout for person re-identification. In CVPR, 2016. Yang, Y. and Xu, Z. Rethinking the value of labels for improving class-imbalanced learning. In NeurIPS, 2020. Yang, Y., Zha, K., Chen, Y.-C., Wang, H., and Katabi, D. Delving into deep imbalanced regression. In ICML, 2021. Yang, Y., Wang, H., and Katabi, D. On multi-domain long- tailed recognition, imbalanced domain generalization and beyond. In European Conference on Computer Vision (ECCV), 2022. 12 Change is Hard: A Closer Look at Subpopulation Shift Yang, Y., Liu, X., Wu, J., Borac, S., Katabi, D., Poh, M.- Z., and McDuff, D. Simper: Simple self-supervised learning of periodic targets. In International Conference on Learning Representations, 2023. Yao, H., Wang, Y., Li, S., Zhang, L., Liang, W., Zou, J., and Finn, C. Improving out-of-distribution robustness via selective augmentation. arXiv preprint arXiv:2201.00299, 2022. Zbontar, J., Jing, L., Misra, I., LeCun, Y., and Deny, S. Bar- low twins: Self-supervised learning via redundancy reduc- tion. In International Conference on Machine Learning, pp. 12310–12320. PMLR, 2021. Zhang, H., Cisse, M., Dauphin, Y. N., and Lopez-Paz, D. mixup: Beyond empirical risk minimization. In ICLR, 2018. Zhang, H., Lu, A. X., Abdalla, M., McDermott, M., and Ghassemi, M. Hurtful words: quantifying biases in clini- cal contextual word embeddings. In proceedings of the ACM Conference on Health, Inference, and Learning, pp. 110–120, 2020. Zhang, X., Zhou, L., Xu, R., Cui, P., Shen, Z., and Liu, H. Nico++: Towards better benchmarking for domain generalization. arXiv preprint arXiv:2204.08040, 2022. Zhou, B., Lapedriza, A., Khosla, A., Oliva, A., and Tor- ralba, A. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6):1452–1464, 2017. Zong, Y., Yang, Y., and Hospedales, T. Medfair: Bench- marking fairness for medical imaging. arXiv preprint arXiv:2210.01725, 2022. 13 A. Limitations and Broader Impacts Change is Hard: A Closer Look at Subpopulation Shift Limitations. We acknowledge several limitations of our benchmark and analyses. First, we have used 12 real-world predictive datasets in our benchmark. However, real-world data can have many complexities including potential mislabelling in both attributes and labels. We do not consider this effect, though it would be interesting to examine it in a synthetic setting. Moreover, prior work has shown that in the case of multiple spurious attributes, reducing reliance on one can increase reliance on another (Li et al., 2022). We only consider a single attribute in this benchmark, though an evaluation of this effect in the context of model selection criteria would be an interesting direction of future research. Potential Negative Impacts. There are several potential negative social impacts of our work. First, we assume throughout the work that we would like to have models that are robust to subpopulation shift. However, in practice, this comes at the cost of overall accuracy on the training distribution. There may be cases where the practitioner would like to maximize overall accuracy regardless of spurious correlations, and thus subpopulation shift methods would worsen overall performance and potentially cause excess harm. Next, we recognize that the large grid of deep models trained for our evaluations likely resulted in a significant carbon footprint (Anthony et al., 2020). However, we hope that the insights provided in this paper will reduce the number of models and training steps (and therefore carbon emissions) required by future practitioners. Finally, we have constructed several models in this paper that utilize clinical data for clinical predictive tasks. We do not advocate for blind deployment of these models in any way, as there are many issues that need to be verified and resolved before their deployment, such as real-world clinical testing, privacy, fairness, interpretability, and regulatory requirements (Maleki et al., 2020; Wiens et al., 2019). B. Details of the Subpopulation Shift Benchmark B.1. Dataset Details We explore subpopulation shift using 12 real-world datasets from a variety of domains including computer vision, natural language processing, and healthcare applications. We provide example inputs for each dataset in Table 6 and Table 7. Note that we omit showing examples for MIMIC-CXR, MIMICNotes, and CXRMultisite to comply with the PhysioNet Credentialed Health Data Use Agreement. Below, we provide detailed descriptions for each dataset in our benchmark. Waterbirds (Wah et al., 2011). Waterbirds is a commonly used binary classification image dataset in the spurious correlations setting, constructed by placing images from the Caltech-UCSD Birds-200-2011 (CUB) dataset (Wah et al., 2011) over backgrounds from the Places dataset (Zhou et al., 2017). The task is to classify whether a bird is a landbird or a waterbird, where the spurious attribute is the background (water or land). We use standard train/val/test splits given by prior work (Idrissi et al., 2022). CelebA (Liu et al., 2015). CelebA is a binary classification image dataset consisting of over 200,000 celebrity face images. The task, which is also used widely in the spurious correlations literature, is to predict the hair color of the person (blond vs. non-blond), where the spurious correlation is the gender. We also use standard dataset splits from prior work (Idrissi et al., 2022). The dataset is licensed under the Creative Commons Attribution 4.0 International license. MetaShift (Liang & Zou, 2022). MetaShift is a general method of creating image datasets from the Visual Genome project (Krishna et al., 2016). Here, we make use of the pre-processed Cat vs. Dog dataset, where the goal is to distinguish between the two animals. The spurious attribute is the image background, where cats and more likely to be indoors, and dogs are more likely to be outdoors. We use the "unmixed" version generated from the authors' codebase. CivilComments (Borkan et al., 2019). CivilComments is a binary classification text dataset, where the goal is to predict whether a internet comment contains toxic language. The spurious attribute is whether the text contains reference to eight demographic identities (male, female, LGBTQ, Christian, Muslim, other religions, Black, and White). We use the standard splits provided by the WILDS benchmark (Koh et al., 2021). MultiNLI (Williams et al., 2017). MultiNLI is a text classification dataset with 3 classes, where the target is the natural language inference relationship between the premise and the hypothesis (neutral, contradiction, or entailment). The spurious attribute is whether negation appears in the text, as negation is highly correlated with the contradiction label. We use standard train/val/test splits given by prior work (Idrissi et al., 2022). 14 Change is Hard: A Closer Look at Subpopulation Shift Table 6. Example inputs for image datasets in our benchmark. We omit showing samples for MIMIC-CXR and CXRMultisite to comply with the PhysioNet Credentialed Health Data Use Agreement. Dataset Examples Waterbirds CelebA MetaShift CheXpert NICO++ ImageNetBG Living17 Table 7. Example inputs for text datasets in our benchmark. We omit showing samples for MIMICNotes to comply with the PhysioNet Credentialed Health Data Use Agreement. Dataset Examples CivilComments "Munchins looks like a munchins. The man who dont want to show his taxes, will tell you everything..." "The democratic party removed the filibuster to steamroll its agenda. Suck it up boys and girls." "so you dont use oil? no gasoline? no plastic? man you ignorant losers are pathetic." MultiNLI "The analysis proves that there is no link between PM and bronchitis." "Postal Service were to reduce delivery frequency." "The famous tenements (or lands) began to be built." MIMIC-CXR (Johnson et al., 2019). MIMIC-CXR is a chest X-ray dataset originating from the Beth Israel Deaconess Medical Center from Boston, Massachusetts containing over 300,000 images. We use "No Finding" as the label, where a positive label means that the patient has no illness. Inspired by prior work (Seyyed-Kalantari et al., 2021), we use the intersection of race (White, Black, Other) and gender as attributes. We randomly split the dataset into 85% train, 5% validation, and 10% test splits. CheXpert (Irvin et al., 2019). CheXpert is a chest X-ray dataset originating from the Stanford University Medical center containing over 200,000 images. We use the same data processing setup as MIMIC-CXR. CXRMultisite (Puli et al., 2021). CXRMultisite is a dataset proposed by Puli et al. (2021) which combines MIMIC- CXR (Johnson et al., 2019) and CheXpert (Irvin et al., 2019) to create a semi-synthetic spurious correlation. The task is to predict pneumonia, and the dataset is constructed such that 90% of the patients with pnuemonia are from MIMIC-CXR, and 90% of the healthy patients are from CheXpert. Thus, the site where the image was taken is the spurious correlation. We 15 Change is Hard: A Closer Look at Subpopulation Shift (a) Spurious correlations. (b) Attribute imbalance. (c) Class imbalance. (d) Attribute generalization. Figure 6. Typical label distributions for different types of subpopulation shift. create this correlation by subsampling. We randomly split the dataset into 85% train, 5% validation, and 10% test splits. MIMICNotes (Johnson et al., 2016). MIMICNotes is a dataset used in a prior work (Chen et al., 2019) showing differences in error rate between demographic groups in predicting mortality from clinical notes in MIMIC-III (Johnson et al., 2016). Following their work, we reproduce their dataset which consists of featurizing the first 48 hours of clinical text from a patient's hospital stay using the top 5,000 TF-IDF features. We use gender as the attribute. NICO++ (Zhang et al., 2022). NICO++ is a large-scale benchmark for domain generalization. Here, we use data from Track 1 (the common context generalization) of their challenge. We only use their training dataset, which consists of 60 classes and 6 common attributes (autumn, dim, grass, outdoor, rock, water). To transform this dataset into the attribute generalization setting, we select all (attribute, label) pairs with less than 75 samples, and remove them from our training split, so they are only used for validation and testing. For each (attribute, label) pair, we use 25 samples for validation and 50 samples for testing, and use the remaining data as training samples. ImageNetBG (Xiao et al., 2020). ImageNetBG is a benchmark created with the goal of evaluating the reliance of ImageNet classifiers on the background. The authors first created a subset of ImageNet with 9 classes (ImageNet-9), and annotated bounding boxes so that backgrounds can be removed. In our setup, we train models on the original IN-9L (with backgrounds), and evaluate our model on MIXED-RAND. Note that attribute (i.e., the label of the background) is not available for this dataset. This can be thought of as an attribute generalization setting, as we do not observe test backgrounds during training. Living17 (Santurkar et al., 2020). Living17 is a dataset created as part of the BREEDS benchmark for subpopulation shift. Their setup is slightly different from a traditional subpopulation shift setting, where subpopulations are defined using a WordNet hierarchy, and the goal is to generalize to unseen subclasses in the same hierarchy level. As such, it is difficult to define the notion of an "attribute" in this setting. In particular, the Living17 dataset consists of images of living objects across 17 classes. We train our models on the source subclasses and evaluate them on the target subclasses. Label distribution for different types of subpopulation shift. Finally, we provide typical label distributions for different subpopulation shift types in Fig. 6. As highlighted, different shifts exhibit distinct types of label distributions, resulting in different properties in learning. For NICO++ (Fig. 6(d)), certain attributes have no training samples in certain classes. B.2. Algorithm Details Our benchmark contains a large number of algorithms that span different learning strategies. We group them according to their categories, and provide detailed descriptions for each algorithm below. 16 0.00.51.01.52.02.53.03.5#ofsamples×103Attribute0:Land01classindex0.00.51.01.52.02.53.03.5#ofsamples×103Attribute1:WaterWaterbirds01234567#ofsamples×104Attribute0:Nonegation012classindex01234567#ofsamples×104Attribute1:NegationMultiNLI012345678#ofsamples×103Attribute0:Female01classindex012345678#ofsamples×103Attribute1:MaleMIMICNotes05#ofsamples×102Attribute0:Autumn05#ofsamples×102Attribute1:Dim05#ofsamples×102Attribute2:Grass05#ofsamples×102Attribute3:Outdoor05#ofsamples×102Attribute4:Rock0510152025303540455055classindex05#ofsamples×102Attribute5:WaterNICO++ Change is Hard: A Closer Look at Subpopulation Shift • Vanilla: The empirical risk minimization (ERM) (Vapnik, 1999) minimizes the sum of errors across all samples. • Subgroup robust methods: Group distributionally robust optimization (GroupDRO) (Sagawa et al., 2020) performs ERM while increasing the importance of groups with larger errors. CVaRDRO (Duchi & Namkoong, 2018) proposes a variant of GroupDRO that dynamically weights data samples that have the highest losses. LfF (Nam et al., 2020) trains two models simultaneously, where the first model is biased and the second one is debiased by re-weighting the gradient of the loss. Just train twice (JTT) (Liu et al., 2021) first trains an ERM model to identify minority groups in the training set and then trains a second ERM model with the identified samples being re-weighted. LISA (Yao et al., 2022) learns invariant predictors through data interpolation within and across attributes. Deep feature re-weighting (DFR) (Izmailov et al., 2022) first trains an ERM model, then retrains the last layer of the model using a balanced validation set with group annotations. • Data augmentation: Mixup (Zhang et al., 2018) performs ERM on linear interpolations of randomly sampled training examples and their labels. • Domain-invariant representation learning: Invariant risk minimization (IRM) (Arjovsky et al., 2019) learns a feature representation such that the optimal linear classifier on top of that representation matches across domains. Deep correlation alignment (CORAL) (Sun & Saenko, 2016) matches the mean and covariance of feature distributions. Maximum mean discrepancy (MMD) (Li et al., 2018) matches the MMD (Gretton et al., 2012) of feature distributions. Note that all methods in this category require group annotations during training. • Imbalanced learning: ReSample (Japkowicz, 2000) and ReWeight (Japkowicz, 2000) simply re-sample or re-weight the inputs according to the number of samples per class. Focal loss (Focal) (Lin et al., 2017) reduces the relative loss for well-classified samples and focuses on difficult samples. Class-balanced loss (CBLoss) (Cui et al., 2019) proposes re-weighting by the inverse effective number of samples. The LDAM loss (LDAM) (Cao et al., 2019) employs a modified marginal loss that favors minority samples more. Balanced-Softmax (BSoftmax) (Ren et al., 2020) extends Softmax to an unbiased estimation that considers the number of samples in each class. Classifier re-training (CRT) (Kang et al., 2020) decomposes the representation and classifier learning into two stages, where it fine-tunes the classifier using class-balanced sampling with representation fixed in the second stage. ReWeightCRT (Kang et al., 2020) is a re-weighting variant of CRT. B.3. Evaluation Metrics We describe in detail all the evaluation metrics we used in our experiments. Average & Worst Accuracy. The average accuracy is defined as the accuracy over all samples. For worst-group accuracy (WGA), we compute the accuracy over all subgroups in the test set and report the worst one. When viewing each class as a subgroup, WGA degenerates to the worst-class accuracy. Average & Worst Precision. Precision is defined as TP/(TP + FP), where TP is the number of true positives and FP the number of false positives. Average precision simply takes the average precision score over all classes, whereas the worst precision reports the lowest precision value across classes. Average & Worst F1-score. The F1-score is defined as the harmonic mean of precision and recall. Average F1-score simply takes the average F1-score over all classes, whereas the worst F1-score reports the lowest value across all classes. Adjusted Accuracy. Adjusted accuracy is defined as the average accuracy on a group-balanced dataset, which accounts for the data imbalance over subgroups. Balanced Accuracy. Balanced accuracy is defined as the average of recall obtained on each class, taking the imbalance over classes into account. AUROC. Following the common evaluation practice for the medical datasets used in our benchmark (Irvin et al., 2019; Johnson et al., 2019), we also include the area under the receiver operating characteristic curve (AUROC) for evaluation. ECE (Guo et al., 2017). The expected calibration error (ECE) is defined as the difference in expected accuracy and expected confidence, which measures how close the output pseudo-probabilities match with the actual probabilities of a correct prediction (lower the better). 17 Change is Hard: A Closer Look at Subpopulation Shift B.4. Model Selection Protocol There has been an increasing interest in model selection within the literature on out-of-distribution generalization (Gulrajani & Lopez-Paz, 2021). In subpopulation shift, model selection becomes essential especially when attributes are completely unknown in both training and validation set. Significant drop (over 20%) in worst-group test accuracy has been reported if using the highest average validation accuracy as the model selection criterion without any group annotations (Izmailov et al., 2022). Our benchmark provides different model selection strategies based on various evaluation metrics as described in Appendix B.3. Throughout the paper, we mainly use worst-group accuracy as the metric for model selection (which degenerates to worst-class accuracy when attributes are unknown in the validation set). Nevertheless, one can specify any aforementioned metric during model selection stage for experimenting with different selection strategies. C. Experimental Settings C.1. Implementation Details Following (Gulrajani & Lopez-Paz, 2021; Izmailov et al., 2022), we use pretrained ResNet-50 model (He et al., 2016) as the backbone network for image datasets (except for Living17, which we train from scratch), and use pretrained BERT model (Idrissi et al., 2022) for all text datasets. We employ a three-layer MLP for MIMICNotes dataset given its simplicity. For all image datasets, we follow standard pre-processing steps (Idrissi et al., 2022): resize and center crop the image to 224 pixels, and perform normalization using the ImageNet channel statistics. Following the literature (Idrissi et al., 224 2022; Izmailov et al., 2022), we use the AdamW optimizer (Kingma & Ba, 2015) for all text datasets, and use SGD with momentum for all image datasets. We train all models for 5,000 steps on Waterbirds and MetaShift, 10,000 steps on MIMICNotes and ImageNetBG, 20,000 steps on CheXpert and CXRMultisite, and 30,000 steps on all other datasets to ensure convergence. × C.2. Hyperparameters Search Protocol For a fair evaluation across different algorithms, following the training protocol in (Gulrajani & Lopez-Paz, 2021), for each algorithm we conduct a random search of 16 trials over a joint distribution of its all hyperparameters. We then use the validation set to select the best hyperparameters for each algorithm, fix them and rerun the experiments under 3 different random seeds to report the final average results (and standard deviation). Such process ensures the comparison is best-versus-best, and the hyperparameters are optimized for all algorithms. We detail the hyperparameter choices for each algorithm in Table 8. D. Additional Analysis and Studies D.1. Quantifying the Degree of Different Shifts In order to quantify the degree of each shift for each dataset relative to others, we use several simple metrics (see Table 9, Table 10, and Table 11). For spurious correlations, we use: • The Mutual Information (MI) between A and Y , I(A; Y ). • The Normalized Mutual Information (NMI) between A and Y , where norm I(A; Y ) = 1 indicates that the two are perfectly correlated: norm I(A; Y ) = 2I(A; Y ) H(Y ) + H(A) . • Cramer's V, which is an association measure based on the Chi-squared test statistic. It has a range of [0, 1], where 1 indicates perfect correlation. • Tschuprow's T, which is closely related to Cramer's V. It also has a range of [0, 1]. Note that we only examine the correlation between A and Y , but not the degree of effectiveness to which A can be inferred from X. This is an important component, as the model can not take advantage of the spurious correlation if it could not 18 Change is Hard: A Closer Look at Subpopulation Shift Table 8. Hyperparameters search space for all experiments. Condition Parameter Default value Random distribution General: ResNet BERT MLP Algorithm-specific: learning rate batch size learning rate batch size dropout learning rate batch size IRM GroupDRO Mixup CVaRDRO JTT LISA LfF DFR lambda iterations of penalty annealing eta alpha alpha first stage step fraction lambda alpha p select q regularization CORAL, MMD gamma Focal CBLoss LDAM gamma beta max m scale 0.001 108 0.00001 32 0.5 0.001 256 100 500 0.01 0.2 0.1 0.5 10 2 0.5 0.7 0.1 1 1 0.9999 0.5 30 10Uniform(−4,−2) 2Uniform(6,7) 10Uniform(−5.5,−4) 2Uniform(3,5.5) RandomChoice([0, 0.1, 0.5]) 10Uniform(−4,−2) 2Uniform(7,10) 10Uniform(−1,5) 10Uniform(0,4) 10Uniform(−3,−1) 10Uniform(0,4) 10Uniform(−2,0) Uniform(0.2, 0.8) 10Uniform(0,2.5) 10Uniform(−1,1) Uniform(0, 1) Uniform(0.05, 0.95) 10Uniform(−2,0.5) 10Uniform(−1,1) 0.5 ∗ 10Uniform(0,1) 1 − 10Uniform(−5,−2) 10Uniform(−1,−0.1) RandomChoice([10, 30]) be learnt easily. However, we would expect that most attributes (e.g., words in text, image backgrounds) should be easily inferred from the inputs for the datasets we examine. For attribute and class imbalance, we use the following metrics (shown for the class imbalance case): • Entropy: H(Y ). • Normalized Entropy, where norm H(Y ) = 1 means that the distribution is uniform (i.e., no imbalance): norm H(Y ) = H(Y ) supp(Y ) | | . log • Difference between the probability of the most frequent class and the probability of the least frequent class (pmax pmin). − For attribute generalization, we simply examine whether there exist any subpopulations in the test set which do not appear during training. 19 Change is Hard: A Closer Look at Subpopulation Shift Table 9. Metrics for quantifying the degree of spurious correlations. Dataset Waterbirds CelebA MetaShift CivilComments MultiNLI MIMIC-CXR MIMICNotes CXRMultisite CheXpert NICO++ ImageNetBG Living17 MI↑ 0.37 0.06 0.09 0.02 0.03 0.01 < 1e−4 0.03 < 1e−3 0.11 − − NMI↑ 0.67 0.11 0.13 0.02 0.04 0.01 < 1e−4 0.13 < 1e−3 0.04 − − Cramer↑ Tschuprow↑ 0.87 0.31 0.41 0.19 0.25 0.15 0.01 0.32 0.03 0.20 − − 0.87 0.31 0.41 0.11 0.21 0.10 0.01 0.32 0.02 0.11 − − Table 10. Metrics for quantifying the degree of attribute imbalance. Dataset Entropy↓ N. Entropy↓ pmax − pmin ↑ Waterbirds CelebA MetaShift CivilComments MultiNLI MIMIC-CXR MIMICNotes CXRMultisite CheXpert NICO++ ImageNetBG Living17 0.82 0.98 0.99 2.78 0.37 2.33 0.99 0.51 2.20 2.47 − − 0.82 0.98 0.99 0.93 0.37 0.90 0.99 0.51 0.85 0.96 − − 0.48 0.16 0.14 0.20 0.86 0.27 0.14 0.77 0.32 0.17 − − Table 11. Metrics for quantifying the degree of class imbalance. Dataset Entropy↓ N. Entropy↓ pmax − pmin ↑ Waterbirds CelebA MetaShift CivilComments MultiNLI MIMIC-CXR MIMICNotes CXRMultisite CheXpert NICO++ ImageNetBG Living17 0.78 0.61 0.99 0.67 1.58 0.97 0.45 0.12 0.47 5.81 3.17 4.09 0.78 0.61 0.99 0.67 0.99 0.97 0.45 0.12 0.47 0.98 1 1 0.54 0.70 0.13 0.65 0.001 0.20 0.81 0.97 0.80 0.03 0 0 D.2. Improvements across Different Shifts & Settings We show in Fig. 7 the complete results on worst-group performance improvements over ERM under different settings. As can be observed from all figures, algorithmic advances have been made for spurious correlations and class imbalance, where consistent improvements can be obtained across different training & validation settings. Yet, small overall improvements are observed for attribute imbalance, while almost no performance gains can be obtained for attribute generalization, indicating the limitation of SOTA algorithms on tackling these types of subpopulation shift. 20 Change is Hard: A Closer Look at Subpopulation Shift (a) Train & validation attributes both known (oracle selection). (b) Train attributes unknown, but validation attributes known (worst-group accuracy selection). (c) Train & validation attributes both unknown (worst-class accuracy selection). Figure 7. Complete results on worst-group performance improvements over ERM under different settings. Table 12. Test-set worst-group accuracy difference (%) between each selection strategy on each dataset, relative to the oracle which selects the best test-set worst-group accuracy. Note that we have only defined AUPRC and Brier score for the binary classification case. Selection Strategy CXRMultisite CelebA CheXpert CivilComments ImageNetBG Living17 MIMIC-CXR MIMICNotes MetaShift MultiNLI NICO++ Waterbirds Avg Max Worst-Class Accuracy Max Balanced Accuracy Min Class Accuracy Diff Max Worst-Class F1 Max Macro Avg F1 Min Per-Class Recall Stdev. Max Weighted Avg Precision Max Overall AUROC Max Overall AUPRC Min Overall BCE Max Per-class Precision Max Overall Accuracy Min Overall Brier Score Min Overall ECE -6.9 ±10.7 -6.9 ±10.7 -6.2 ±10.3 -7.7 ±11.3 -8.2 ±11.6 -6.2 ±10.3 -8.3 ±11.5 -10.0 ±12.5 -10.0 ±12.5 -8.2 ±11.5 -8.2 ±11.7 -8.2 ±11.4 -8.2 ±11.5 -8.2 ±11.5 -5.0 ±6.3 -4.4 ±5.4 -6.1 ±9.1 -13.4 ±10.4 -14.3 ±10.6 -6.1 ±9.1 -13.5 ±10.1 -12.2 ±10.3 -13.0 ±10.3 -18.1 ±13.2 -3.0 ±8.9 -18.6 ±12.0 -18.8 ±13.1 -20.5 ±15.7 -0.4 ±0.8 -1.3 ±2.5 -1.9 ±5.3 -5.4 ±6.7 -7.7 ±9.8 -1.9 ±5.3 -6.3 ±11.1 -10.4 ±13.0 -11.6 ±11.9 -18.7 ±16.4 -6.8 ±12.5 -30.9 ±24.9 -19.6 ±16.6 -20.3 ±17.4 -3.2 ±5.2 -3.5 ±5.8 -4.1 ±8.0 -3.2 ±3.8 -5.1 ±4.7 -4.1 ±8.0 -5.7 ±8.6 -8.2 ±9.0 -8.1 ±8.9 -13.1 ±12.3 -14.8 ±24.3 -13.7 ±9.5 -13.5 ±12.3 -14.4 ±13.5 -0.7 ±1.3 -0.9 ±1.6 -2.8 ±13.0 -0.8 ±1.2 -0.9 ±1.5 -2.3 ±11.5 -0.8 ±1.3 -1.1 ±2.1 - -0.9 ±1.6 -7.6 ±18.4 -0.9 ±1.6 - -16.9 ±33.6 -1.6 ±2.3 -4.5 ±5.4 -5.1 ±10.0 -3.5 ±4.4 -4.4 ±5.3 -5.5 ±9.1 -7.5 ±7.8 -5.5 ±6.7 - -7.2 ±7.3 -19.3 ±15.9 -4.5 ±5.4 - -28.8 ±19.6 -0.9 ±1.0 -2.9 ±4.9 -1.9 ±5.0 -2.5 ±2.2 -2.8 ±4.5 -1.9 ±5.0 -4.3 ±6.4 -6.6 ±9.9 -7.3 ±10.2 -7.2 ±12.0 -9.4 ±12.7 -5.1 ±6.3 -7.1 ±12.0 -12.3 ±18.2 -0.1 ±0.5 -2.3 ±6.2 -0.3 ±1.2 -4.4 ±8.7 -8.2 ±13.2 -0.3 ±1.2 -12.6 ±21.5 -10.0 ±16.5 -9.6 ±16.3 -14.3 ±20.7 -12.6 ±22.4 -19.9 ±26.0 -15.1 ±21.6 -16.2 ±22.7 -1.5 ±3.0 -1.7 ±3.0 -2.2 ±4.6 -1.8 ±3.3 -1.8 ±2.9 -2.2 ±4.6 -3.3 ±8.0 -3.2 ±7.0 -2.7 ±6.2 -3.7 ±7.7 -9.9 ±17.4 -1.9 ±3.3 -2.7 ±5.3 -20.9 ±28.8 -1.9 ±2.9 -3.7 ±3.9 -5.7 ±8.6 -2.3 ±3.0 -3.3 ±3.4 -5.6 ±8.7 -3.4 ±4.7 -4.4 ±5.8 - -6.2 ±7.8 -6.6 ±10.1 -3.7 ±3.9 - -24.6 ±19.0 -5.3 ±5.6 -7.0 ±5.8 -27.2 ±15.4 -6.7 ±6.3 -7.0 ±5.8 -29.7 ±14.3 -6.8 ±5.5 -6.9 ±6.3 - -7.6 ±6.1 -14.8 ±11.8 -7.1 ±5.8 - -20.0 ±14.3 -0.8 ±1.4 -1.3 ±1.9 -2.4 ±4.8 -2.6 ±3.5 -3.1 ±4.0 -2.4 ±4.8 -4.9 ±10.1 -2.6 ±6.1 -4.0 ±9.5 -12.5 ±18.4 -5.3 ±12.4 -7.2 ±11.7 -6.9 ±11.0 -11.0 ±17.9 -2.4 -3.4 -5.5 -4.5 -5.6 -5.7 -6.5 -6.7 -8.3 -9.8 -9.8 -10.2 -11.5 -17.9 D.3. Model Selection without Validation Attributes In the main paper, we examine the feasibility of different metrics for model selection without group-annotated validation data. We further confirm this in Table 12 by showing the results for more selection strategies with all metrics across all 21 MetaShiftWaterbirdsCelebACivilCommentsMultiNLIMIMIC-CXRCXRMultisiteMIMICNotesCheXpertImageNetBGLiving17NICO++°100102030Worst-groupImprovement(%)GroupDROJTTMixupReWeightCBLossBSoftmaxDFRCRTSpurious CorrelationsAttribute ImbalanceClass ImbalanceAttribute GeneralizationMetaShiftWaterbirdsCelebACivilCommentsMultiNLIMIMIC-CXRCXRMultisiteMIMICNotesCheXpertImageNetBGLiving17NICO++°100102030Worst-groupImprovement(%)GroupDROJTTMixupReWeightCBLossBSoftmaxDFRCRTSpurious CorrelationsAttribute ImbalanceClass ImbalanceAttribute GeneralizationMetaShiftWaterbirdsCelebACivilCommentsMultiNLIMIMIC-CXRCXRMultisiteMIMICNotesCheXpertImageNetBGLiving17NICO++°100102030Worst-groupImprovement(%)GroupDROJTTMixupReWeightCBLossBSoftmaxDFRCRTSpurious CorrelationsAttribute ImbalanceClass ImbalanceAttribute Generalization Change is Hard: A Closer Look at Subpopulation Shift (a) Adjusted accuracy. Figure 8. Accuracy on the line. We show metrics that are positively correlated with worst-group accuracy. (b) Balanced accuracy. (a) Worst precision. Figure 9. Accuracy on the inverse line. We show metrics that are negatively correlated with worst-group accuracy. (b) ECE. datasets in our benchmark. Specifically, when using worst-class accuracy as the model selection criterion, on average we achieve only 2.4% degrade of worst-group accuracy compared to oracle selection method. The selection criterion also performs the best over all other selection metrics on 10 out of 12 datasets, indicating its effectiveness for reliable model selection without any attribute information. D.4. Rethinking Evaluation Metrics in Subpopulation Shift We provide complete results on the correlation between worst-group accuracy (WGA) and other metrics we consider in our benchmark. Accuracy on the line. In the main paper we show that certain metrics exhibit high linear correlation with WGA. We further show in Fig. 8 with a full list of metrics that exhibit consistent positive correlation across diverse datasets. Specifically, both adjusted accuracy and balanced accuracy display the "accuracy on the line" property, which has also been confirmed in prior work (Izmailov et al., 2022). 22 0.820.840.860.880.900.92AdjustedAccuracy0.50.60.70.80.9WorstAccuracyCelebAρ=0.980.7550.7600.7650.7700.7750.780AdjustedAccuracy0.660.680.700.720.74MIMIC-CXRρ=0.280.720.740.760.78AdjustedAccuracy0.450.500.550.600.650.700.75CivilCommentsρ=0.820.650.700.75AdjustedAccuracy0.30.40.50.60.7CheXpertρ=0.910.600.650.700.75AdjustedAccuracy0.20.30.40.50.60.7MIMICNotesρ=0.990.860.880.900.920.94BalancedAccuracy0.40.50.60.70.80.9WorstAccuracyCelebAρ=0.290.750.760.770.78BalancedAccuracy0.660.680.700.720.74MIMIC-CXRρ=0.150.740.760.780.80BalancedAccuracy0.20.30.40.50.60.7CivilCommentsρ=0.770.700.750.80BalancedAccuracy0.30.40.50.60.7CheXpertρ=0.930.600.650.700.75BalancedAccuracy0.20.30.40.50.60.7MIMICNotesρ=0.980.50.60.70.80.9WorstPrecision0.20.40.60.81.0WorstAccuracyCelebAρ=−0.860.680.700.72WorstPrecision0.660.680.700.720.74MIMIC-CXRρ=−0.400.450.500.550.60WorstPrecision0.450.500.550.600.650.700.75CivilCommentsρ=−0.490.20.30.40.5WorstPrecision0.30.40.50.60.70.8CheXpertρ=−0.700.20.40.60.8WorstPrecision0.00.10.20.30.40.50.60.70.8MIMICNotesρ=−0.980.050.100.15ECE0.20.40.60.81.0WorstAccuracyCelebAρ=−0.670.000.050.100.150.20ECE0.660.680.700.720.74MIMIC-CXRρ=−0.020.10.20.3ECE0.450.500.550.600.650.700.75CivilCommentsρ=−0.190.10.20.30.4ECE0.30.40.50.60.70.80.91.0CheXpertρ=−0.780.00.10.20.30.4ECE0.20.40.60.8MIMICNotesρ=−0.81 Change is Hard: A Closer Look at Subpopulation Shift (a) Worst F1-score. (b) Average accuracy. (c) Average precision. Figure 10. Accuracy not on the line. We show metrics that do not demonstrate consistent correlations across datasets with worst-group accuracy. (d) Average F1-score. Accuracy on the inverse line. More interestingly, we further establish the intrinsic tradeoff between WGA and certain metrics. Fig. 9 shows that both worst-case precision and ECE exhibit clear negative correlation with WGA, demonstrating the fundamental tradeoff between WGA and several important metrics in subpopulation shift. These intriguing observations highlight the need for considering more realistic evaluation metrics in subpopulation shift beyond just using WGA. Accuracy not on the line. Finally, we display also other metrics that do not show either positive or negative correlation with WGA (Fig. 10). As observed, the correlation between these metrics and WGA shows inconsistent behavior across datasets. Interestingly, this phenomenon also indicates the potential bad performance on these metrics when merely optimizing for better WGA. We leave the exploration of other metrics and the rationale behind these behaviors for future work. D.5. Impact of Architecture, Pretraining Method, and Pretraining Dataset In this section, we examine the impact of model architecture and the source of the initial model weights on the worst group accuracy. Similar to the experiments above, we consider the following settings: 23 0.650.700.750.800.85WorstF1-score0.50.60.70.80.91.01.1WorstAccuracyCelebAρ=−0.770.710.720.730.74WorstF1-score0.660.680.700.720.74MIMIC-CXRρ=0.200.560.580.600.620.64WorstF1-score0.500.550.600.650.700.75CivilCommentsρ=0.140.300.350.400.45WorstF1-score0.30.40.50.60.7CheXpertρ=0.020.300.350.400.45WorstF1-score0.20.30.40.50.60.7MIMICNotesρ=0.390.880.900.920.940.96AvgAccuracy0.20.40.60.81.0WorstAccuracyCelebAρ=−0.490.760.770.780.79AvgAccuracy0.660.680.700.720.74MIMIC-CXRρ=−0.040.760.780.800.820.840.86AvgAccuracy0.20.30.40.50.60.7CivilCommentsρ=0.230.70.80.9AvgAccuracy0.30.40.50.60.70.80.9CheXpertρ=−0.520.70.80.9AvgAccuracy0.00.20.40.60.81.01.2MIMICNotesρ=−0.830.750.800.850.90AvgPrecision0.20.40.60.81.0WorstAccuracyCelebAρ=−0.820.750.760.770.78AvgPrecision0.660.680.700.720.74MIMIC-CXRρ=−0.130.700.720.740.76AvgPrecision0.450.500.550.600.650.700.75CivilCommentsρ=−0.230.550.600.650.70AvgPrecision0.30.40.50.60.70.80.9CheXpertρ=−0.590.600.650.700.750.800.85AvgPrecision0.00.10.20.30.40.50.60.70.8MIMICNotesρ=−0.980.8000.8250.8500.8750.900AvgF1-score0.20.40.60.81.0WorstAccuracyCelebAρ=−0.630.750.760.770.78AvgF1-score0.660.680.700.720.74MIMIC-CXRρ=−0.090.720.740.76AvgF1-score0.450.500.550.600.650.700.75CivilCommentsρ=0.200.500.550.600.650.70AvgF1-score0.30.40.50.60.70.8CheXpertρ=−0.300.550.600.650.70AvgF1-score0.10.20.30.40.50.60.7MIMICNotesρ=−0.01 Change is Hard: A Closer Look at Subpopulation Shift • Known Attributes. Attributes are known in both training and validation, and validation set worst-group accuracy is used as the model selection criteria. • Unknown Attributes. Attributes are unknown during training and validation. Following our findings in Sec. 5.4, we use worst-class accuracy as the model selection criteria. We experiment with ERM, JTT, and DFR as representative methods; CivilComments as the representative text dataset, and Waterbirds, CheXpert, and NICO++ as representative image datasets. For the text modality, we consider the following architectures and initial weights: • BERTBASE (Devlin et al., 2018): A contextual language model based on the transformer architecture pretrained on BookCorpus and English Wikipedia data using the masked language model and next sentence prediction tasks. • SciBERT (Beltagy et al., 2019): Same architecture as BERTBASE, but pretrained on scientific papers from Semantic Scholar, and has higher reported performance on scientific NLP tasks. • DistilBERT (Sanh et al., 2019): A knowledge distilled (Hinton et al., 2015) version of BERTBASE with 40% fewer parameters, pretrained using the same datasets as BERTBASE. • GPT-2 (Radford et al., 2019): An autoregressive language model based on the transformer decoder, pretrained using text from webpages upvoted on Reddit. • RoBERTaBASE (Liu et al., 2019a): Same architecture as BERTBASE, but pretrained with a more efficient procedure and using a collection of corpora much larger than BERTBASE. For the image modality, we consider ResNet-50 (He et al., 2016) and vision transformers (ViT-B) (Steiner et al., 2021). We consider model weights initialized with the following pretraining methods that span supervised and self-supervised manners: • Supervised pretraining (Kornblith et al., 2019). • SimCLR (Chen et al., 2020): Self-supervised contrastive pretraining using image augmentations. • Barlow Twins (Zbontar et al., 2021): Self-supervised pretraining via redundancy reduction. • DINO (Caron et al., 2021): Self-distillation with no labels. • CLIP (Radford et al., 2021): Using associated text as supervision. We select only the vision encoder. We consider model weights initialized using the above pretraining methods on the following pretraining datasets: • ImageNet-1K (Deng et al., 2009): 1.2 million images belonging to 1,000 classes, introduced as part of the ILSVRC2012 visual recognition challenge (Russakovsky et al., 2015). • ImageNet-21K (Ridnik et al., 2021): A superset of ImageNet-1K, consisting of 14 million images belonging to 21,841 classes. • SWAG (Singh et al., 2022): 3.6 billion images collected from public Instagram posts, weakly supervised using their associated hashtags. • LAION-2B (Schuhmann et al., 2022): 2.32 billion English image-text pairs constructed from Common Crawl. • OpenAI-CLIP (Radford et al., 2021): 400 million image-text pairs collected by OpenAI in training their CLIP model. As model weights for many combinations of the above architectures, pretraining methods, and pretraining datasets are not available, we only experiment with the subset of combinations of weights that exist in public repositories. Based on our experimental results on CivilComments (Table 13), we find that BERTBASE is competitive in performance, even outperforming its successor RoBERTaBASE on many tasks. In addition, DistilBERT and GPT-2 exhibits much worse performance especially on ERM models. Based on our experimental results on image datasets (Tables 14 and 15), we find the following: 24 Change is Hard: A Closer Look at Subpopulation Shift • Optimal architecture is dataset dependent. Contrary to prior work (Paul & Chen, 2022), we find mixed results when comparing the worst-group performance for ResNet and ViT-B. Specifically, ResNets seem to work better on CheXpert and Waterbirds, while vision transformers work better on NICO++. • Supervised pretraining outperforms others. Similar to prior work (Izmailov et al., 2022), we find that supervised pretraining outperforms self-supervised learning for the most part, though some self-supervised pretraining methods are still competitive. The results also warrant better self-supervised schemes for subgroup shifts (Yang et al., 2023). • Larger pretraining datasets yield better results. The biggest impact on worst-group accuracy by far appears to be the dataset on which the initial model weights are derived. This is especially true for NICO++ and Waterbirds, where going from ImageNet-1K to ImageNet-21K to SWAG almost always leads to a significant increase in worst-group accuracy, indicating that larger and more diverse pretraining datasets seem to increase performance. The effectiveness of SWAG-pretrained ViTs on Waterbirds has also been discussed in prior work (Mehta et al., 2022). Table 13. Test-set worst-group accuracy on CivilComments for different text architectures and pretraining methods. Arch BERT SciBERT DistilBERT GPT-2 RoBERTa Unknown Attributes Known Attributes ERM 65.6 61.1 51.8 14.7 61.0 JTT 69.6 58.3 55.1 49.0 58.0 DFR ERM 62.4 62.5 61.8 51.7 61.6 66.2 61.1 59.6 14.7 63.1 JTT 65.0 58.3 66.2 49.0 66.7 DFR 69.7 68.0 67.6 51.9 68.2 Table 14. Test-set worst-group accuracy for three image datasets with known attributes, varying the model architecture and source of model initial weights. Best results of each column are in bold and the second best are underlined. Arch Pretrain Method Pretrain Dataset ResNet ViT-B Barlow DINO SimCLR Supervised Supervised CLIP CLIP DINO Supervised Supervised Supervised ImageNet-1K ImageNet-1K ImageNet-1K ImageNet-1K ImageNet-21K Laion-2B OpenAI-CLIP ImageNet-1K ImageNet-1K ImageNet-21K SWAG CheXpert NICO++ Waterbirds ERM 46.2 43.0 47.9 59.2 51.4 49.2 42.2 43.4 40.4 47.5 48.7 JTT 66.0 71.5 72.3 61.7 68.0 58.5 55.8 71.8 64.5 69.1 67.3 DFR ERM 74.7 72.8 74.8 72.2 70.0 69.1 68.8 72.4 70.1 69.1 72.5 40.0 39.5 30.0 25.0 40.0 33.3 33.3 30.0 20.0 48.0 50.0 JTT 40.0 40.0 30.0 30.0 46.0 40.0 40.0 40.0 33.3 50.0 50.0 DFR ERM 20.0 4.0 16.0 20.0 40.0 33.3 30.0 32.0 0.0 18.0 34.0 67.3 72.9 70.1 76.5 74.5 39.6 40.4 63.9 51.2 69.9 82.7 JTT 72.4 72.5 68.1 74.3 75.9 46.9 40.4 64.6 52.6 73.8 81.2 DFR 88.3 89.1 81.2 90.2 90.2 75.5 78.2 90.2 80.4 87.2 87.5 Avg 57.2 56.1 54.5 56.6 61.8 49.5 47.7 56.5 45.8 59.2 63.8 Table 15. Test-set worst-group accuracy for three image datasets with unknown attributes, varying the model architecture and source of model initial weights. Best results of each column are in bold and the second best are underlined. Arch Pretrain Method Pretrain Dataset ResNet ViT-B Barlow DINO SimCLR Supervised Supervised CLIP CLIP DINO Supervised Supervised Supervised ImageNet-1K ImageNet-1K ImageNet-1K ImageNet-1K ImageNet-21K Laion-2B OpenAI-CLIP ImageNet-1K ImageNet-1K ImageNet-21K SWAG CheXpert NICO++ Waterbirds ERM 46.2 43.0 47.9 59.2 45.3 49.2 42.2 43.4 40.4 47.5 52.5 JTT 66.0 71.5 72.3 61.7 69.3 58.5 57.4 69.4 69.5 69.7 63.8 DFR ERM 73.7 73.3 74.6 75.4 69.9 69.7 70.4 72.3 71.5 71.3 71.3 33.3 39.5 30.0 40.0 40.0 30.0 33.3 40.0 33.3 50.0 50.0 JTT 40.0 40.0 30.0 30.0 40.0 30.0 40.0 41.2 33.3 50.0 50.0 DFR ERM 40.0 12.0 26.0 33.3 40.0 40.0 40.0 37.5 16.7 38.0 50.0 67.3 72.9 70.1 67.0 74.5 45.2 26.5 63.9 49.4 69.9 82.7 JTT 72.4 72.5 69.0 74.3 75.9 46.9 44.4 64.6 52.6 73.8 81.2 DFR 89.8 87.9 79.2 89.6 88.3 78.4 77.4 90.0 81.2 88.9 88.6 Avg 58.7 57.0 55.5 58.9 60.4 49.8 48.0 58.0 49.8 62.1 65.6 25 E. Complete Results Change is Hard: A Closer Look at Subpopulation Shift We provide complete evaluation results in this section. As confirmed earlier, model selection and attribute availability play critical roles in subpopulation shift evaluation. To provide a thorough analysis, we investigate the following three settings: • Attributes are known in both training & validation (Appendix E.1). When attributes are known in both training and validation set, which corresponds to the most ideal scenario, we use "test set worst-group accuracy" as an oracle selection method to identify the best possible performance for each algorithm. • Attributes are unknown in training, but known in validation (Appendix E.2). When attributes are still known in validation, we use "validation set worst-group accuracy" to select models. We ignore algorithms that require attribute information in the training set (i.e., IRM, MMD, CORAL) when reporting results under this setting. • Attributes are unknown in both training & validation (Appendix E.3). When attributes are completely unknown, we still use "validation set worst-group accuracy" for model selection, which however degenerates to "worst-class accuracy". We again ignore algorithms that require attribute information in the training set. E.1. Attributes Known in Both Training & Validation E.1.1. WATERBIRDS Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 84.1 ±1.7 89.5 ±0.4 88.8 ±1.8 88.4 ±0.1 89.8 ±0.4 88.8 ±0.6 87.0 ±0.3 92.8 ±0.2 93.0 ±0.1 89.4 ±0.9 91.8 ±0.2 88.7 ±0.3 91.3 ±0.7 89.3 ±0.2 87.3 ±0.5 88.4 ±1.3 92.3 ±0.2 90.5 ±0.0 91.2 ±0.1 E.1.2. CELEBA 69.1 ±4.7 78.2 ±0.4 78.6 ±1.0 74.5 ±1.5 75.5 ±2.2 72.0 ±0.3 75.2 ±0.7 88.7 ±0.6 83.9 ±1.4 77.7 ±1.2 86.9 ±0.7 78.6 ±0.1 86.2 ±0.3 71.6 ±0.8 71.0 ±1.8 74.1 ±0.9 91.0 ±0.3 79.7 ±0.3 78.4 ±0.1 77.4 ±2.0 83.9 ±0.6 83.6 ±2.4 82.5 ±0.2 84.5 ±0.7 83.1 ±0.8 80.7 ±0.3 88.4 ±0.4 89.5 ±0.4 84.0 ±1.4 87.1 ±0.3 82.8 ±0.4 86.5 ±1.1 83.7 ±0.3 81.2 ±0.6 82.7 ±1.6 87.5 ±0.3 85.3 ±0.0 86.4 ±0.2 60.7 ±3.2 71.6 ±1.3 70.9 ±5.0 69.5 ±0.6 73.2 ±1.7 71.2 ±1.5 66.2 ±0.5 79.5 ±0.8 83.1 ±1.1 72.1 ±3.1 77.5 ±0.8 69.6 ±1.1 76.4 ±2.3 72.4 ±0.5 67.7 ±1.5 70.1 ±3.0 77.5 ±0.6 74.5 ±0.0 76.8 ±0.3 79.4 ±2.1 85.9 ±0.4 85.3 ±2.0 84.3 ±0.1 86.1 ±0.3 84.7 ±0.6 82.8 ±0.3 90.0 ±0.3 90.0 ±0.1 85.7 ±1.0 88.7 ±0.2 84.9 ±0.3 88.2 ±0.7 85.2 ±0.3 83.0 ±0.5 84.4 ±1.5 89.5 ±0.2 87.0 ±0.1 87.7 ±0.1 69.5 ±2.9 78.8 ±0.6 78.1 ±2.6 76.4 ±0.1 79.0 ±0.4 76.9 ±0.8 74.3 ±0.5 84.8 ±0.4 84.5 ±0.1 78.4 ±1.4 82.7 ±0.3 77.3 ±0.4 82.0 ±1.0 77.5 ±0.4 74.4 ±0.6 76.5 ±2.1 84.1 ±0.3 80.3 ±0.1 81.2 ±0.2 83.1 ±2.0 88.9 ±0.3 88.5 ±0.8 87.1 ±0.3 88.5 ±0.3 86.9 ±0.3 86.2 ±0.3 92.0 ±0.1 90.5 ±0.2 88.3 ±0.4 90.7 ±0.1 88.1 ±0.2 90.4 ±0.1 87.1 ±0.3 85.7 ±0.2 87.0 ±1.0 92.1 ±0.1 89.3 ±0.1 89.4 ±0.1 83.1 ±2.0 88.9 ±0.3 88.5 ±0.8 87.1 ±0.3 88.5 ±0.3 86.9 ±0.3 86.2 ±0.3 92.0 ±0.1 90.5 ±0.2 88.3 ±0.4 90.7 ±0.1 88.1 ±0.2 90.4 ±0.1 87.1 ±0.3 85.7 ±0.2 87.0 ±1.0 92.1 ±0.1 89.3 ±0.1 89.4 ±0.1 91.0 ±1.4 94.7 ±0.2 95.5 ±0.5 94.0 ±0.3 95.4 ±0.2 94.1 ±0.1 93.3 ±0.3 97.0 ±0.1 96.2 ±0.1 95.2 ±0.3 95.8 ±0.1 94.5 ±0.1 95.7 ±0.0 94.2 ±0.2 93.3 ±0.2 94.1 ±1.0 97.4 ±0.1 95.7 ±0.0 95.8 ±0.1 12.9 ±1.7 7.0 ±0.6 9.1 ±2.2 9.5 ±0.2 8.2 ±0.2 9.0 ±0.4 9.4 ±0.5 5.4 ±0.3 6.4 ±0.5 8.0 ±1.1 7.0 ±0.6 8.2 ±0.7 8.2 ±1.4 6.9 ±0.1 13.7 ±2.2 9.8 ±1.2 7.1 ±0.6 7.9 ±0.1 6.3 ±0.2 Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 95.1 ±0.2 95.4 ±0.1 91.4 ±0.6 94.7 ±0.8 95.2 ±0.1 90.4 ±2.3 81.1 ±5.6 92.6 ±0.1 92.5 ±0.7 92.0 ±0.8 91.9 ±0.5 93.6 ±0.1 91.2 ±0.7 94.9 ±0.3 94.5 ±0.2 91.9 ±0.1 91.9 ±0.1 92.7 ±0.1 92.5 ±0.2 62.6 ±1.5 57.8 ±0.8 89.0 ±0.7 63.0 ±2.5 64.1 ±2.8 70.0 ±10.2 53.0 ±4.3 86.5 ±1.2 24.4 ±2.0 87.4 ±0.8 89.7 ±0.2 82.4 ±0.5 89.4 ±0.7 59.1 ±2.0 59.6 ±2.4 83.3 ±0.5 90.4 ±0.1 87.2 ±0.3 87.2 ±0.3 87.5 ±0.5 88.4 ±0.3 80.4 ±0.8 87.0 ±1.9 88.4 ±0.6 80.5 ±4.2 71.8 ±4.1 82.2 ±0.2 91.4 ±1.4 81.4 ±1.2 81.2 ±0.8 84.0 ±0.2 80.2 ±1.1 87.5 ±0.8 86.5 ±0.8 81.1 ±0.2 81.2 ±0.2 82.4 ±0.1 82.1 ±0.3 76.4 ±1.2 78.5 ±0.7 61.5 ±1.7 75.3 ±3.9 78.6 ±1.4 62.5 ±8.7 45.2 ±8.3 65.1 ±0.4 90.1 ±2.2 63.6 ±2.6 63.2 ±1.8 69.0 ±0.3 61.0 ±2.3 76.7 ±1.7 74.7 ±1.9 62.9 ±0.4 63.2 ±0.3 65.7 ±0.2 65.1 ±0.6 83.1 ±0.5 83.8 ±0.3 74.9 ±1.2 82.2 ±1.8 83.0 ±0.2 72.6 ±5.1 59.0 ±7.3 77.6 ±0.3 63.7 ±3.9 76.0 ±1.5 75.7 ±1.0 79.6 ±0.3 74.5 ±1.6 82.4 ±0.6 81.3 ±0.3 76.1 ±0.3 75.8 ±0.2 77.4 ±0.1 77.1 ±0.3 90.1 ±0.3 90.6 ±0.2 84.9 ±0.8 89.6 ±1.1 90.1 ±0.1 83.4 ±3.3 73.2 ±5.6 86.6 ±0.2 79.8 ±2.1 85.6 ±1.0 85.4 ±0.7 87.9 ±0.2 84.6 ±1.0 89.7 ±0.4 89.0 ±0.2 85.6 ±0.2 85.5 ±0.1 86.5 ±0.1 86.3 ±0.2 26 86.9 ±0.2 85.8 ±0.2 92.6 ±0.1 86.9 ±0.5 86.7 ±0.9 86.4 ±1.6 78.3 ±3.0 92.0 ±0.3 68.5 ±0.7 92.0 ±0.2 92.6 ±0.2 91.2 ±0.1 92.6 ±0.2 85.6 ±0.5 85.6 ±0.8 91.1 ±0.2 92.3 ±0.0 91.8 ±0.1 91.8 ±0.0 93.4 ±0.2 93.1 ±0.1 93.3 ±0.2 93.3 ±0.3 92.2 ±0.7 90.3 ±1.1 85.3 ±2.9 94.0 ±0.1 74.3 ±2.1 93.1 ±0.1 93.0 ±0.2 93.8 ±0.1 93.2 ±0.3 92.5 ±0.4 92.3 ±0.7 93.9 ±0.1 93.1 ±0.1 93.4 ±0.0 93.4 ±0.0 98.4 ±0.1 98.4 ±0.1 98.1 ±0.0 98.5 ±0.0 98.2 ±0.1 93.2 ±2.2 94.1 ±1.2 98.5 ±0.0 96.0 ±0.9 98.1 ±0.0 98.0 ±0.1 98.4 ±0.1 98.0 ±0.1 98.2 ±0.1 98.0 ±0.1 98.6 ±0.0 97.9 ±0.0 98.2 ±0.0 98.2 ±0.0 3.3 ±0.5 2.5 ±0.2 8.0 ±0.9 3.4 ±1.3 2.6 ±0.3 4.1 ±1.4 27.9 ±5.5 7.7 ±0.3 3.6 ±0.2 7.4 ±1.1 7.9 ±0.9 5.8 ±0.2 8.4 ±1.0 3.2 ±0.4 28.3 ±2.7 8.4 ±0.2 8.9 ±0.1 6.6 ±0.1 7.1 ±0.3 E.1.3. CIVILCOMMENTS Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 85.4 ±0.2 84.9 ±0.3 81.8 ±0.6 85.5 ±0.0 83.5 ±0.3 83.3 ±0.1 65.5 ±5.6 82.7 ±0.1 84.6 ±0.2 82.2 ±0.0 82.5 ±0.0 83.3 ±0.5 82.9 ±0.1 85.5 ±0.2 81.9 ±2.2 83.8 ±0.0 83.3 ±0.0 83.8 ±0.0 83.8 ±0.1 E.1.4. MULTINLI 63.7 ±1.1 66.1 ±1.3 70.6 ±1.2 63.2 ±0.8 68.7 ±1.3 64.3 ±1.5 51.0 ±6.1 73.7 ±0.3 54.5 ±1.4 73.3 ±0.5 72.5 ±0.0 71.7 ±0.4 73.3 ±0.2 62.0 ±1.0 37.4 ±8.1 71.2 ±0.4 69.6 ±0.2 71.1 ±0.1 71.0 ±0.1 75.4 ±0.2 74.8 ±0.4 72.0 ±0.5 75.5 ±0.1 73.5 ±0.3 72.8 ±0.1 60.4 ±3.5 72.6 ±0.1 73.9 ±0.4 72.4 ±0.0 72.6 ±0.1 73.3 ±0.4 72.9 ±0.1 75.5 ±0.4 69.6 ±3.5 73.8 ±0.0 73.2 ±0.0 73.8 ±0.0 73.8 ±0.1 57.8 ±0.6 56.4 ±0.9 49.6 ±1.1 57.8 ±0.2 52.8 ±0.6 52.4 ±0.3 31.2 ±5.6 51.1 ±0.2 56.7 ±0.7 50.2 ±0.1 50.8 ±0.1 52.5 ±1.0 51.5 ±0.2 58.5 ±0.8 49.9 ±5.9 53.5 ±0.0 52.3 ±0.1 53.5 ±0.0 53.5 ±0.2 77.0 ±0.0 76.6 ±0.2 74.2 ±0.5 77.1 ±0.0 75.9 ±0.2 74.8 ±0.1 58.5 ±5.0 75.0 ±0.1 74.4 ±0.4 74.8 ±0.0 75.0 ±0.1 75.7 ±0.4 75.4 ±0.1 76.8 ±0.3 69.7 ±3.4 76.1 ±0.0 75.6 ±0.0 76.1 ±0.0 76.1 ±0.0 63.1 ±0.1 62.7 ±0.2 60.3 ±0.6 63.3 ±0.1 62.4 ±0.2 60.3 ±0.2 41.9 ±5.6 61.1 ±0.1 58.2 ±0.7 61.1 ±0.0 61.4 ±0.1 62.0 ±0.4 61.7 ±0.1 62.5 ±0.4 50.6 ±5.5 62.5 ±0.0 61.8 ±0.0 62.5 ±0.0 62.4 ±0.0 77.7 ±0.2 77.9 ±0.3 78.5 ±0.2 77.8 ±0.1 78.6 ±0.2 76.8 ±0.2 64.8 ±4.2 78.7 ±0.2 73.6 ±0.6 79.2 ±0.0 79.1 ±0.1 78.9 ±0.1 79.2 ±0.1 76.9 ±0.4 67.5 ±4.0 78.7 ±0.1 78.1 ±0.0 78.6 ±0.0 78.5 ±0.0 79.2 ±0.3 79.3 ±0.3 79.9 ±0.2 79.4 ±0.1 80.7 ±0.1 78.4 ±0.2 65.6 ±4.5 80.1 ±0.1 74.9 ±0.5 80.6 ±0.0 80.6 ±0.1 80.4 ±0.1 80.6 ±0.1 78.4 ±0.4 70.0 ±3.3 80.4 ±0.0 80.2 ±0.0 80.4 ±0.0 80.4 ±0.1 90.0 ±0.0 89.7 ±0.0 88.8 ±0.2 89.9 ±0.1 89.8 ±0.1 88.2 ±0.1 69.2 ±6.5 89.1 ±0.1 86.1 ±0.7 89.3 ±0.1 89.5 ±0.0 89.7 ±0.0 89.6 ±0.1 89.1 ±0.3 79.7 ±4.2 89.8 ±0.0 89.5 ±0.0 89.4 ±0.0 89.6 ±0.0 8.1 ±0.2 8.4 ±1.0 12.2 ±0.9 7.4 ±0.6 32.9 ±0.4 10.2 ±0.3 26.4 ±2.4 11.7 ±0.3 5.0 ±1.5 12.2 ±0.2 12.0 ±0.2 10.3 ±0.8 11.1 ±0.3 6.7 ±0.4 21.1 ±0.3 10.3 ±0.1 16.6 ±0.3 11.2 ±0.3 10.7 ±0.1 Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 80.9 ±0.1 81.4 ±0.3 81.1 ±0.3 77.8 ±0.6 75.1 ±0.1 80.9 ±0.5 71.7 ±1.1 80.3 ±0.4 78.8 ±0.1 77.2 ±0.2 81.0 ±0.2 80.7 ±0.3 80.6 ±0.1 80.7 ±0.2 80.7 ±0.3 80.9 ±0.1 81.7 ±0.0 81.9 ±0.0 81.3 ±0.0 E.1.5. METASHIFT 66.8 ±0.5 68.5 ±0.6 76.0 ±0.7 63.6 ±1.3 63.0 ±1.5 69.1 ±0.1 63.6 ±2.9 73.3 ±1.0 69.1 ±1.5 72.3 ±0.8 68.8 ±0.4 69.5 ±0.7 72.2 ±0.3 69.4 ±0.7 69.6 ±1.6 66.9 ±0.4 68.5 ±0.2 70.7 ±0.1 69.0 ±0.2 81.1 ±0.1 81.6 ±0.3 81.4 ±0.3 78.3 ±0.5 76.2 ±0.2 81.3 ±0.4 71.8 ±1.1 80.4 ±0.4 79.3 ±0.2 77.6 ±0.0 81.1 ±0.2 81.0 ±0.3 80.8 ±0.1 81.2 ±0.2 81.1 ±0.1 81.1 ±0.1 82.1 ±0.0 82.2 ±0.0 81.4 ±0.0 76.0 ±0.2 76.0 ±0.5 74.7 ±0.5 71.0 ±1.1 65.6 ±0.2 74.3 ±1.1 68.7 ±0.7 75.9 ±0.3 71.7 ±0.7 70.7 ±1.0 76.0 ±0.7 74.6 ±0.5 74.9 ±0.3 73.7 ±0.6 73.9 ±0.9 75.9 ±0.3 75.6 ±0.2 75.9 ±0.1 77.0 ±0.1 80.9 ±0.1 81.4 ±0.3 81.1 ±0.3 77.9 ±0.6 75.2 ±0.1 81.0 ±0.5 71.7 ±1.1 80.3 ±0.4 78.9 ±0.1 77.3 ±0.1 81.0 ±0.2 80.8 ±0.3 80.6 ±0.1 80.8 ±0.2 80.8 ±0.2 80.9 ±0.1 81.7 ±0.0 82.0 ±0.0 81.3 ±0.0 77.8 ±0.1 78.0 ±0.2 77.8 ±0.1 74.8 ±0.4 72.1 ±0.2 77.6 ±0.5 68.5 ±1.8 76.7 ±0.4 75.5 ±0.1 73.8 ±0.1 77.4 ±0.1 77.5 ±0.3 77.5 ±0.1 77.3 ±0.1 77.4 ±0.2 77.7 ±0.1 77.9 ±0.0 78.3 ±0.0 77.6 ±0.0 79.7 ±0.0 80.1 ±0.3 80.8 ±0.3 76.6 ±0.5 74.2 ±0.4 80.0 ±0.4 70.8 ±1.4 79.8 ±0.5 78.0 ±0.4 77.6 ±0.3 79.6 ±0.1 79.9 ±0.4 80.1 ±0.1 79.6 ±0.2 79.7 ±0.3 79.7 ±0.0 81.2 ±0.0 81.1 ±0.0 80.5 ±0.0 80.9 ±0.1 81.4 ±0.3 81.1 ±0.3 77.8 ±0.6 75.1 ±0.1 80.9 ±0.5 71.7 ±1.1 80.3 ±0.4 78.8 ±0.1 77.2 ±0.2 81.0 ±0.2 80.7 ±0.3 80.6 ±0.1 80.7 ±0.2 80.7 ±0.3 80.9 ±0.1 81.7 ±0.0 81.9 ±0.0 81.3 ±0.0 93.6 ±0.1 93.6 ±0.1 93.7 ±0.1 91.5 ±0.3 86.3 ±0.2 93.7 ±0.2 87.0 ±0.8 92.7 ±0.2 91.7 ±0.1 90.9 ±0.0 93.5 ±0.1 93.4 ±0.2 93.4 ±0.1 93.6 ±0.1 93.5 ±0.1 93.6 ±0.1 93.2 ±0.0 93.9 ±0.0 93.7 ±0.0 8.1 ±0.3 9.4 ±0.9 9.8 ±1.0 11.2 ±1.8 41.4 ±0.1 7.0 ±1.5 4.4 ±0.6 4.3 ±0.4 11.6 ±0.3 10.8 ±0.2 8.1 ±0.1 9.2 ±1.0 7.5 ±0.5 4.4 ±1.0 33.4 ±0.3 8.1 ±0.2 8.8 ±0.3 11.5 ±0.0 6.9 ±0.1 27 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 91.3 ±0.3 91.6 ±0.3 91.0 ±0.1 91.8 ±0.4 92.1 ±0.2 91.2 ±0.5 80.2 ±0.3 89.5 ±0.4 89.4 ±0.1 91.2 ±0.1 91.7 ±0.4 91.5 ±0.2 91.7 ±0.4 91.7 ±0.2 91.5 ±0.1 91.6 ±0.2 88.4 ±0.3 91.3 ±0.2 91.2 ±0.1 82.6 ±0.4 81.0 ±0.8 85.6 ±0.4 83.0 ±0.1 84.6 ±0.0 83.6 ±0.4 73.1 ±1.6 84.1 ±0.4 85.9 ±0.7 85.6 ±0.4 85.6 ±0.4 84.6 ±0.7 85.5 ±0.4 81.5 ±0.0 83.6 ±0.4 83.1 ±0.7 85.4 ±0.4 84.1 ±0.4 85.6 ±0.4 91.2 ±0.3 91.7 ±0.3 90.9 ±0.1 91.8 ±0.4 92.1 ±0.2 91.3 ±0.6 80.5 ±0.3 89.6 ±0.4 89.5 ±0.2 91.1 ±0.1 91.8 ±0.4 91.5 ±0.2 91.8 ±0.4 91.7 ±0.2 91.5 ±0.1 91.6 ±0.2 88.4 ±0.3 91.3 ±0.2 91.1 ±0.1 90.6 ±0.4 90.6 ±0.2 90.0 ±0.6 90.5 ±1.0 90.8 ±0.6 89.3 ±1.1 77.2 ±1.3 88.4 ±0.3 88.3 ±0.2 90.8 ±0.1 90.2 ±0.6 89.7 ±0.2 90.2 ±0.7 91.1 ±0.6 90.7 ±0.3 89.8 ±0.3 86.8 ±0.3 90.2 ±0.2 90.1 ±0.1 91.2 ±0.3 91.6 ±0.3 90.9 ±0.1 91.7 ±0.4 92.1 ±0.2 91.1 ±0.5 80.1 ±0.3 89.5 ±0.5 89.3 ±0.1 91.1 ±0.1 91.7 ±0.3 91.5 ±0.2 91.6 ±0.3 91.7 ±0.2 91.5 ±0.1 91.6 ±0.2 88.4 ±0.3 91.3 ±0.2 91.2 ±0.1 90.7 ±0.3 91.0 ±0.3 90.4 ±0.0 91.3 ±0.4 91.6 ±0.2 90.6 ±0.4 78.8 ±0.3 88.8 ±0.6 88.4 ±0.1 90.5 ±0.1 91.1 ±0.3 91.1 ±0.2 91.1 ±0.3 91.2 ±0.2 90.9 ±0.1 91.2 ±0.2 87.8 ±0.4 90.8 ±0.2 90.7 ±0.0 89.3 ±0.3 89.4 ±0.3 89.8 ±0.1 89.7 ±0.5 90.4 ±0.2 89.6 ±0.8 80.3 ±0.6 88.5 ±0.3 89.4 ±0.0 90.0 ±0.2 90.6 ±0.5 89.7 ±0.3 90.6 ±0.4 89.5 ±0.2 89.8 ±0.1 89.4 ±0.3 87.7 ±0.3 89.6 ±0.2 89.8 ±0.1 91.2 ±0.3 91.6 ±0.3 91.0 ±0.1 91.7 ±0.4 92.1 ±0.2 91.1 ±0.5 80.1 ±0.1 89.5 ±0.5 89.2 ±0.1 91.1 ±0.1 91.6 ±0.3 91.6 ±0.2 91.6 ±0.3 91.7 ±0.2 91.5 ±0.1 91.7 ±0.1 88.5 ±0.3 91.3 ±0.2 91.2 ±0.0 97.3 ±0.2 97.3 ±0.1 97.5 ±0.0 97.6 ±0.2 97.7 ±0.0 97.4 ±0.0 90.6 ±0.6 96.0 ±0.1 95.4 ±0.3 97.4 ±0.1 97.5 ±0.1 97.7 ±0.0 97.5 ±0.1 97.7 ±0.0 97.5 ±0.1 97.7 ±0.0 95.6 ±0.1 97.3 ±0.0 96.8 ±0.1 6.3 ±0.9 2.3 ±0.1 3.2 ±0.5 5.3 ±0.2 4.9 ±0.3 5.9 ±0.7 8.3 ±1.5 25.4 ±0.2 3.2 ±0.3 5.2 ±0.2 4.2 ±0.2 3.6 ±0.6 4.1 ±0.2 5.2 ±1.6 10.8 ±0.6 4.0 ±0.6 5.7 ±0.2 7.4 ±0.1 7.8 ±0.1 E.1.6. IMAGENETBG Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 88.4 ±0.1 88.5 ±0.3 87.3 ±0.2 88.7 ±0.1 88.2 ±0.1 87.2 ±0.1 85.3 ±0.3 86.2 ±0.3 88.2 ±0.2 88.5 ±0.2 88.4 ±0.1 88.3 ±0.1 88.4 ±0.1 87.2 ±0.1 88.0 ±0.1 88.3 ±0.1 87.2 ±0.2 88.4 ±0.1 88.6 ±0.0 E.1.7. NICO++ 81.0 ±0.9 82.4 ±0.3 78.2 ±0.3 81.3 ±0.3 80.7 ±1.1 80.5 ±0.3 76.7 ±0.5 76.1 ±0.8 80.8 ±0.5 81.0 ±0.4 81.0 ±0.9 80.1 ±0.2 81.0 ±0.9 78.4 ±0.1 80.1 ±0.3 80.7 ±0.7 78.5 ±0.6 80.2 ±0.3 79.4 ±0.2 88.5 ±0.1 88.7 ±0.2 87.5 ±0.2 88.8 ±0.1 88.4 ±0.1 87.5 ±0.2 85.6 ±0.3 86.3 ±0.3 88.4 ±0.2 88.7 ±0.2 88.5 ±0.1 88.4 ±0.1 88.5 ±0.1 87.3 ±0.2 88.3 ±0.0 88.4 ±0.1 87.2 ±0.3 88.4 ±0.1 88.7 ±0.0 80.4 ±0.1 80.4 ±1.3 77.9 ±1.1 81.6 ±0.2 78.6 ±1.9 78.0 ±0.7 74.0 ±2.2 75.5 ±1.0 80.0 ±1.1 79.9 ±1.0 80.4 ±0.1 80.5 ±0.5 80.4 ±0.1 78.7 ±0.7 80.1 ±0.6 79.4 ±0.9 78.2 ±1.2 80.4 ±0.8 81.6 ±0.7 88.4 ±0.1 88.5 ±0.3 87.3 ±0.2 88.7 ±0.1 88.3 ±0.1 87.2 ±0.1 85.3 ±0.3 86.2 ±0.3 88.2 ±0.2 88.5 ±0.2 88.4 ±0.1 88.3 ±0.1 88.4 ±0.1 87.2 ±0.1 88.1 ±0.1 88.3 ±0.1 87.2 ±0.2 88.3 ±0.1 88.6 ±0.0 81.3 ±0.1 81.9 ±0.8 80.0 ±0.9 81.7 ±0.1 80.7 ±0.5 80.2 ±0.6 75.8 ±1.3 77.1 ±0.5 80.7 ±0.3 81.5 ±0.4 81.3 ±0.1 80.9 ±0.4 81.3 ±0.1 78.9 ±0.5 81.4 ±0.3 80.8 ±0.4 78.8 ±0.9 80.7 ±0.3 81.5 ±0.2 88.4 ±0.1 88.5 ±0.3 87.3 ±0.2 88.7 ±0.1 88.2 ±0.1 87.2 ±0.1 85.3 ±0.3 86.2 ±0.3 88.2 ±0.2 88.5 ±0.2 88.4 ±0.1 88.3 ±0.1 88.4 ±0.1 87.2 ±0.1 88.0 ±0.1 88.3 ±0.1 87.2 ±0.2 88.4 ±0.1 88.6 ±0.0 88.4 ±0.1 88.5 ±0.3 87.3 ±0.2 88.7 ±0.1 88.2 ±0.1 87.2 ±0.1 85.3 ±0.3 86.2 ±0.3 88.2 ±0.2 88.5 ±0.2 88.4 ±0.1 88.3 ±0.1 88.4 ±0.1 87.2 ±0.1 88.0 ±0.1 88.3 ±0.1 87.2 ±0.2 88.4 ±0.1 88.6 ±0.0 99.0 ±0.0 98.8 ±0.1 98.9 ±0.0 99.1 ±0.0 99.0 ±0.0 98.9 ±0.0 98.5 ±0.0 98.3 ±0.1 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 98.8 ±0.0 98.7 ±0.1 99.0 ±0.0 98.8 ±0.0 99.0 ±0.0 99.1 ±0.0 5.8 ±0.2 3.3 ±1.0 4.3 ±0.5 5.2 ±0.1 4.9 ±0.4 2.4 ±0.5 2.6 ±0.4 4.2 ±0.2 5.8 ±0.2 6.0 ±0.2 5.8 ±0.2 5.3 ±0.3 5.8 ±0.2 4.4 ±1.1 48.3 ±1.9 6.0 ±0.2 9.9 ±1.3 4.5 ±0.5 4.5 ±0.8 Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 84.5 ±0.5 84.0 ±0.6 83.2 ±0.4 84.4 ±0.7 83.6 ±0.6 85.1 ±0.3 78.3 ±0.4 84.7 ±0.3 84.9 ±0.1 84.8 ±0.3 85.7 ±0.2 84.7 ±0.7 84.5 ±0.4 83.8 ±1.4 82.8 ±0.4 84.0 ±0.5 75.6 ±0.5 85.2 ±0.3 85.0 ±0.1 37.6 ±2.0 42.7 ±1.4 37.8 ±1.8 40.0 ±0.0 36.7 ±2.7 40.0 ±0.0 30.4 ±1.3 42.7 ±2.2 40.7 ±0.5 40.0 ±0.0 41.9 ±1.6 40.0 ±0.0 37.8 ±1.8 36.7 ±2.7 42.0 ±0.9 40.4 ±0.3 23.7 ±0.7 43.3 ±2.7 23.3 ±1.4 85.5 ±0.3 85.2 ±0.5 84.5 ±0.4 85.1 ±0.5 85.0 ±0.4 86.0 ±0.3 80.7 ±0.2 85.7 ±0.2 85.8 ±0.1 85.8 ±0.3 86.6 ±0.1 85.7 ±0.4 85.2 ±0.5 85.0 ±1.1 84.4 ±0.3 84.8 ±0.3 77.4 ±0.4 85.7 ±0.2 85.5 ±0.1 54.5 ±2.8 53.0 ±1.6 55.5 ±1.0 63.0 ±2.0 55.7 ±2.3 54.8 ±2.7 45.6 ±1.3 54.7 ±1.4 57.0 ±1.2 58.6 ±2.6 57.3 ±3.8 57.5 ±1.3 61.1 ±0.8 54.2 ±3.7 51.1 ±2.7 61.4 ±1.1 37.7 ±3.2 64.6 ±0.6 61.6 ±0.3 65.8 ±1.1 63.4 ±1.1 63.6 ±0.6 65.9 ±1.2 64.3 ±1.5 65.4 ±1.8 52.5 ±0.6 65.4 ±1.2 66.3 ±0.7 65.4 ±1.7 65.0 ±1.7 65.7 ±1.5 66.1 ±1.4 63.8 ±3.0 62.0 ±1.6 65.2 ±1.1 46.0 ±2.6 69.2 ±0.3 67.0 ±0.1 84.0 ±0.5 83.7 ±0.6 82.7 ±0.4 83.9 ±0.7 83.2 ±0.6 84.7 ±0.3 78.0 ±0.3 84.2 ±0.3 84.5 ±0.1 84.4 ±0.4 85.3 ±0.2 84.2 ±0.6 84.0 ±0.4 83.3 ±1.4 82.4 ±0.4 83.7 ±0.5 75.3 ±0.5 84.7 ±0.3 84.3 ±0.1 84.3 ±0.5 83.9 ±0.6 83.0 ±0.4 84.3 ±0.7 83.5 ±0.6 85.0 ±0.3 78.3 ±0.4 84.6 ±0.3 84.8 ±0.1 84.7 ±0.4 85.6 ±0.2 84.6 ±0.7 84.3 ±0.4 83.6 ±1.4 82.7 ±0.4 84.0 ±0.5 75.5 ±0.5 85.0 ±0.3 84.8 ±0.1 99.3 ±0.0 99.3 ±0.0 99.3 ±0.0 99.4 ±0.0 99.4 ±0.0 99.4 ±0.0 99.2 ±0.0 99.2 ±0.0 99.4 ±0.0 99.4 ±0.0 99.4 ±0.0 99.4 ±0.0 99.4 ±0.0 99.4 ±0.1 98.7 ±0.1 99.4 ±0.0 98.6 ±0.0 99.4 ±0.0 99.3 ±0.0 10.4 ±0.1 2.5 ±1.0 8.7 ±0.6 7.0 ±1.4 7.9 ±1.1 10.2 ±0.2 1.4 ±0.3 11.9 ±1.6 9.2 ±0.4 8.8 ±0.2 9.8 ±0.3 8.1 ±1.1 8.3 ±1.2 4.8 ±0.7 68.7 ±2.2 7.0 ±1.2 19.4 ±0.5 7.9 ±0.6 3.6 ±0.3 84.6 ±0.4 84.2 ±0.6 83.3 ±0.4 84.4 ±0.6 83.8 ±0.6 85.2 ±0.3 78.6 ±0.4 84.8 ±0.3 85.0 ±0.1 84.9 ±0.4 85.8 ±0.1 84.8 ±0.6 84.5 ±0.5 83.9 ±1.4 83.0 ±0.4 84.1 ±0.4 75.8 ±0.4 85.2 ±0.3 85.0 ±0.1 28 E.1.8. MIMIC-CXR Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 78.2 ±0.1 78.3 ±0.0 76.9 ±0.3 78.2 ±0.0 78.3 ±0.1 78.1 ±0.0 73.3 ±0.9 77.9 ±0.1 76.8 ±0.2 78.1 ±0.1 78.2 ±0.1 78.2 ±0.2 78.4 ±0.1 78.3 ±0.1 77.7 ±0.6 77.8 ±0.2 78.0 ±0.0 78.5 ±0.0 78.5 ±0.0 68.9 ±0.3 68.1 ±0.9 74.4 ±0.2 67.7 ±0.2 68.6 ±0.4 67.3 ±0.7 62.6 ±2.6 70.4 ±0.2 68.0 ±0.6 71.9 ±0.2 71.6 ±0.3 70.3 ±0.2 70.7 ±0.1 68.7 ±0.4 68.6 ±1.1 68.4 ±0.2 68.9 ±0.0 71.0 ±0.0 70.8 ±0.0 77.3 ±0.1 77.4 ±0.0 76.1 ±0.2 77.3 ±0.0 77.4 ±0.1 77.1 ±0.0 72.3 ±1.0 77.0 ±0.1 75.9 ±0.2 77.3 ±0.1 77.4 ±0.1 77.3 ±0.2 77.5 ±0.1 77.4 ±0.1 76.8 ±0.6 76.9 ±0.2 77.1 ±0.0 77.6 ±0.0 77.6 ±0.0 71.1 ±0.1 71.6 ±0.2 68.7 ±0.5 71.4 ±0.1 71.1 ±0.3 71.4 ±0.2 65.2 ±1.0 70.6 ±0.3 70.2 ±0.4 70.7 ±0.3 70.9 ±0.3 71.0 ±0.3 71.6 ±0.2 70.8 ±0.2 70.4 ±0.9 70.2 ±0.3 70.9 ±0.0 71.5 ±0.1 71.5 ±0.1 77.5 ±0.1 77.5 ±0.0 76.3 ±0.2 77.5 ±0.0 77.7 ±0.1 77.3 ±0.0 72.4 ±1.0 77.2 ±0.1 76.0 ±0.2 77.5 ±0.1 77.6 ±0.1 77.5 ±0.2 77.7 ±0.1 77.6 ±0.1 77.0 ±0.6 77.1 ±0.2 77.3 ±0.0 77.9 ±0.0 77.8 ±0.0 73.6 ±0.1 73.4 ±0.1 72.7 ±0.1 73.5 ±0.1 73.9 ±0.0 73.2 ±0.1 67.7 ±1.4 73.3 ±0.1 71.5 ±0.3 73.8 ±0.2 73.8 ±0.1 73.6 ±0.2 73.8 ±0.1 73.9 ±0.0 73.1 ±0.7 73.3 ±0.2 73.3 ±0.0 74.0 ±0.0 73.9 ±0.0 77.2 ±0.0 77.2 ±0.1 76.7 ±0.1 77.2 ±0.1 77.4 ±0.0 77.0 ±0.0 72.4 ±1.1 77.2 ±0.1 76.0 ±0.3 77.6 ±0.1 77.6 ±0.1 77.3 ±0.3 77.6 ±0.1 77.4 ±0.1 76.9 ±0.6 77.0 ±0.2 77.0 ±0.0 77.7 ±0.0 77.7 ±0.0 77.8 ±0.1 77.8 ±0.1 76.9 ±0.2 77.8 ±0.1 78.1 ±0.0 77.5 ±0.1 72.8 ±1.1 77.6 ±0.1 76.2 ±0.2 78.0 ±0.1 78.0 ±0.1 77.9 ±0.2 78.0 ±0.1 78.1 ±0.0 77.4 ±0.6 77.6 ±0.2 77.6 ±0.0 78.2 ±0.0 78.2 ±0.0 85.2 ±0.1 85.1 ±0.1 83.7 ±0.1 85.2 ±0.1 85.1 ±0.0 84.9 ±0.0 79.3 ±1.3 84.9 ±0.1 83.4 ±0.2 85.0 ±0.1 85.1 ±0.1 85.2 ±0.2 85.2 ±0.0 85.4 ±0.0 84.6 ±0.6 84.9 ±0.2 84.9 ±0.0 85.4 ±0.0 85.4 ±0.0 3.4 ±0.2 3.6 ±0.2 4.7 ±0.1 3.4 ±0.2 7.8 ±0.3 3.4 ±0.1 12.3 ±0.7 4.0 ±0.6 8.8 ±2.0 5.5 ±0.8 4.2 ±0.2 4.1 ±0.2 4.1 ±0.4 10.1 ±0.6 22.0 ±0.2 5.0 ±0.2 7.0 ±0.1 4.1 ±0.1 4.3 ±0.0 E.1.9. MIMICNOTES Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 91.1 ±0.1 91.1 ±0.0 76.1 ±0.7 91.0 ±0.0 90.9 ±0.1 71.3 ±3.7 84.0 ±1.2 85.2 ±1.4 91.2 ±0.1 80.4 ±1.8 84.8 ±0.8 90.1 ±0.3 83.2 ±1.2 91.0 ±0.0 90.6 ±0.1 76.9 ±0.9 43.1 ±19.8 82.1 ±3.5 83.5 ±2.6 18.7 ±2.7 22.7 ±3.2 72.6 ±0.5 22.5 ±2.5 23.0 ±4.6 65.9 ±2.8 62.7 ±2.1 58.0 ±3.1 23.0 ±0.5 68.0 ±3.0 60.5 ±2.5 37.2 ±4.5 63.3 ±2.2 19.1 ±2.3 5.3 ±2.4 73.1 ±1.0 6.7 ±5.5 56.2 ±13.8 58.7 ±6.8 77.6 ±0.9 76.8 ±0.7 61.3 ±0.1 76.3 ±0.5 76.5 ±1.2 60.3 ±0.7 64.6 ±0.7 65.5 ±0.9 76.8 ±0.3 63.0 ±0.8 65.2 ±0.6 71.8 ±1.1 64.1 ±0.6 77.1 ±0.6 84.4 ±0.8 61.7 ±0.2 51.9 ±2.8 65.9 ±3.5 64.6 ±1.5 63.1 ±2.0 61.2 ±1.6 25.7 ±0.4 60.1 ±1.2 60.6 ±2.9 23.4 ±1.9 33.6 ±1.6 35.7 ±2.1 61.0 ±0.5 29.7 ±1.8 34.8 ±1.3 49.9 ±2.5 32.5 ±1.5 62.1 ±1.4 78.1 ±1.7 26.5 ±0.6 7.3 ±3.0 36.8 ±8.2 33.9 ±3.5 63.2 ±1.6 65.1 ±1.6 61.8 ±0.4 65.2 ±1.2 64.6 ±2.4 58.6 ±2.3 67.1 ±0.8 68.0 ±0.9 65.9 ±0.5 64.9 ±1.2 67.8 ±0.5 69.1 ±0.9 66.6 ±0.8 63.6 ±1.3 52.5 ±2.1 62.5 ±0.5 28.3 ±9.1 63.4 ±0.5 66.1 ±1.5 31.2 ±3.1 35.0 ±3.2 38.6 ±0.3 35.3 ±2.4 34.0 ±4.8 36.0 ±1.8 43.6 ±0.8 44.5 ±0.9 36.5 ±0.9 41.6 ±1.2 44.4 ±0.5 43.7 ±1.9 43.0 ±0.8 31.9 ±2.6 10.0 ±4.1 39.3 ±0.4 7.2 ±5.8 37.5 ±1.4 42.0 ±1.2 59.7 ±1.3 61.5 ±1.6 76.2 ±0.3 61.5 ±1.2 61.4 ±2.3 75.5 ±0.4 74.7 ±0.4 74.0 ±0.6 61.9 ±0.4 75.8 ±0.4 74.5 ±0.5 67.6 ±1.7 74.8 ±0.4 59.9 ±1.1 52.7 ±1.2 76.6 ±0.2 53.4 ±2.8 70.9 ±4.0 72.9 ±1.5 59.9 ±1.3 61.7 ±1.7 76.5 ±0.2 61.7 ±1.2 61.6 ±2.4 75.6 ±0.4 74.7 ±0.5 74.2 ±0.7 62.1 ±0.4 76.1 ±0.4 74.7 ±0.5 67.8 ±1.7 74.9 ±0.5 60.2 ±1.1 52.7 ±1.2 76.7 ±0.2 53.4 ±2.8 71.0 ±4.0 73.0 ±1.5 85.3 ±0.1 85.4 ±0.0 85.0 ±0.1 85.3 ±0.0 85.1 ±0.1 84.9 ±0.1 85.1 ±0.0 85.3 ±0.0 85.3 ±0.0 85.3 ±0.0 85.2 ±0.0 85.2 ±0.1 85.2 ±0.1 85.3 ±0.1 84.9 ±0.1 85.4 ±0.0 84.5 ±0.0 84.3 ±0.0 84.3 ±0.0 2.1 ±0.8 2.0 ±0.8 22.2 ±0.6 1.9 ±0.2 4.2 ±1.6 27.5 ±3.9 12.5 ±1.2 15.5 ±1.5 1.4 ±0.1 18.8 ±2.2 14.1 ±0.9 4.2 ±1.0 14.7 ±1.3 8.1 ±0.7 28.9 ±1.0 23.5 ±1.1 40.1 ±0.3 28.3 ±4.3 28.9 ±2.2 E.1.10. CXRMULTISITE 29 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 98.3 ±0.0 98.3 ±0.0 84.0 ±10.9 77.5 ±17.0 98.3 ±0.0 94.1 ±0.9 9.9 ±6.7 98.3 ±0.0 87.4 ±8.9 96.4 ±0.3 88.0 ±5.3 98.0 ±0.1 98.0 ±0.0 98.3 ±0.0 98.3 ±0.0 89.1 ±0.2 79.3 ±8.8 87.0 ±2.7 82.5 ±6.3 0.0 ±0.0 0.0 ±0.0 19.3 ±13.7 8.8 ±7.2 0.0 ±0.0 0.0 ±0.0 5.4 ±4.4 0.0 ±0.0 12.8 ±10.4 1.1 ±0.5 19.4 ±7.9 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.5 ±0.1 22.2 ±9.9 17.2 ±6.5 27.8 ±11.4 49.2 ±0.0 49.2 ±0.0 55.7 ±2.0 49.6 ±0.3 61.2 ±4.9 59.0 ±0.7 17.4 ±13.5 49.2 ±0.0 49.6 ±0.4 57.9 ±0.3 52.9 ±0.7 65.5 ±0.3 64.7 ±0.3 55.4 ±5.1 49.2 ±0.0 56.2 ±0.1 54.9 ±2.7 54.2 ±1.4 56.0 ±3.5 0.0 ±0.0 0.0 ±0.0 12.7 ±4.1 0.7 ±0.5 24.0 ±9.8 18.5 ±1.4 0.6 ±0.5 0.0 ±0.0 0.8 ±0.6 17.1 ±0.5 6.9 ±1.4 32.4 ±0.6 30.9 ±0.6 12.5 ±10.2 0.0 ±0.0 12.5 ±0.2 10.9 ±5.6 9.1 ±2.8 13.0 ±7.1 49.6 ±0.0 49.6 ±0.0 51.2 ±5.0 42.4 ±5.9 50.7 ±0.7 62.9 ±0.8 8.5 ±5.6 49.6 ±0.0 47.0 ±2.1 59.8 ±0.1 52.0 ±2.2 60.7 ±1.8 59.2 ±1.0 49.7 ±0.1 49.6 ±0.0 58.1 ±0.2 48.2 ±3.5 54.2 ±2.9 51.8 ±4.1 0.0 ±0.0 0.0 ±0.0 12.4 ±2.9 1.3 ±1.0 2.2 ±1.5 28.9 ±1.2 1.2 ±1.0 0.0 ±0.0 1.4 ±1.2 21.4 ±0.3 10.8 ±2.1 22.5 ±3.7 19.4 ±1.9 0.3 ±0.2 0.0 ±0.0 22.0 ±0.3 9.0 ±1.4 15.5 ±4.2 13.6 ±4.5 50.0 ±0.0 50.0 ±0.0 55.9 ±2.5 51.1 ±0.9 50.2 ±0.2 55.2 ±0.9 50.5 ±0.4 50.0 ±0.0 50.6 ±0.5 54.0 ±0.1 56.7 ±1.7 53.4 ±0.7 52.5 ±0.3 50.0 ±0.0 50.0 ±0.0 50.4 ±0.0 55.5 ±1.8 58.2 ±1.5 58.7 ±2.1 50.0 ±0.0 50.0 ±0.0 59.7 ±2.5 51.8 ±1.5 50.6 ±0.4 82.2 ±2.4 51.7 ±1.4 50.0 ±0.0 52.0 ±1.7 63.4 ±1.2 64.1 ±4.4 58.9 ±2.1 56.9 ±1.0 50.1 ±0.1 50.0 ±0.0 90.0 ±0.1 63.9 ±4.7 73.4 ±3.0 66.8 ±2.8 93.1 ±0.1 92.9 ±0.1 79.4 ±2.9 64.2 ±7.3 93.0 ±0.0 93.2 ±0.1 60.6 ±1.6 90.3 ±0.0 56.5 ±1.9 89.7 ±0.1 75.7 ±2.4 92.9 ±0.1 92.5 ±0.0 93.2 ±0.0 92.9 ±0.0 92.9 ±0.1 78.9 ±5.3 81.5 ±4.1 81.1 ±4.8 0.3 ±0.1 0.3 ±0.0 29.3 ±6.3 47.3 ±1.1 0.9 ±0.3 6.4 ±0.5 82.6 ±12.8 8.9 ±1.6 15.4 ±12.5 4.1 ±0.2 37.2 ±4.1 4.1 ±0.9 6.0 ±0.8 11.5 ±0.6 33.3 ±0.0 19.9 ±1.3 41.5 ±1.9 35.1 ±3.4 29.9 ±8.6 E.1.11. CHEXPERT Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 86.9 ±0.5 81.9 ±6.2 78.9 ±0.3 89.8 ±0.3 66.2 ±2.7 73.0 ±1.9 22.3 ±10.2 79.2 ±0.8 86.9 ±0.5 79.0 ±0.8 78.7 ±0.4 82.1 ±1.5 79.1 ±0.1 89.3 ±0.3 90.1 ±0.0 79.1 ±0.4 78.2 ±0.4 79.1 ±0.2 80.4 ±0.0 E.1.12. LIVING17 50.2 ±3.8 37.4 ±3.5 74.5 ±0.2 34.4 ±1.7 57.9 ±0.4 61.3 ±4.9 13.7 ±9.8 75.6 ±0.6 50.2 ±3.8 75.3 ±0.5 75.7 ±0.1 70.0 ±2.3 74.7 ±0.3 42.1 ±4.0 36.4 ±0.3 75.4 ±0.5 71.7 ±0.2 74.6 ±0.3 76.0 ±0.1 66.3 ±0.3 63.5 ±5.0 62.8 ±0.1 70.1 ±0.7 56.4 ±0.5 58.6 ±1.1 37.3 ±5.8 63.1 ±0.4 66.3 ±0.3 62.8 ±0.3 62.7 ±0.1 64.3 ±0.7 62.7 ±0.0 69.6 ±0.4 70.6 ±0.1 63.0 ±0.2 62.4 ±0.2 62.8 ±0.1 63.5 ±0.0 37.6 ±0.8 33.9 ±9.3 28.3 ±0.3 46.5 ±1.6 17.7 ±1.0 21.6 ±1.7 9.0 ±0.7 28.8 ±0.8 37.6 ±0.8 28.4 ±0.7 28.2 ±0.3 31.8 ±1.7 28.3 ±0.1 44.7 ±1.1 47.5 ±0.1 28.6 ±0.4 27.6 ±0.4 28.4 ±0.2 29.8 ±0.1 68.6 ±0.2 62.5 ±5.9 64.4 ±0.2 68.6 ±0.1 52.9 ±1.6 57.9 ±1.7 19.5 ±8.3 64.8 ±0.6 68.6 ±0.2 64.5 ±0.6 64.3 ±0.3 66.7 ±1.1 64.3 ±0.1 69.8 ±0.4 68.9 ±0.2 64.7 ±0.3 63.8 ±0.3 64.4 ±0.2 65.6 ±0.1 44.6 ±0.5 35.7 ±7.6 41.7 ±0.3 42.7 ±0.3 27.9 ±1.1 32.8 ±2.4 8.8 ±3.9 42.3 ±0.7 44.6 ±0.5 41.7 ±0.7 41.6 ±0.3 44.1 ±1.2 41.4 ±0.1 45.5 ±1.0 43.3 ±0.3 42.1 ±0.4 40.9 ±0.3 41.6 ±0.3 43.0 ±0.1 72.5 ±1.1 63.8 ±4.7 78.4 ±0.1 67.5 ±0.6 66.1 ±0.6 69.8 ±2.6 46.2 ±2.9 78.8 ±0.3 72.5 ±1.1 78.4 ±0.0 78.5 ±0.1 77.7 ±0.5 77.9 ±0.0 70.4 ±1.1 67.3 ±0.3 78.4 ±0.2 77.5 ±0.1 78.0 ±0.2 78.8 ±0.1 72.8 ±1.1 64.1 ±4.6 79.0 ±0.1 67.5 ±0.6 67.0 ±0.6 71.0 ±2.5 46.2 ±3.1 79.4 ±0.1 72.8 ±1.1 78.7 ±0.1 78.9 ±0.0 78.3 ±0.5 78.4 ±0.1 70.4 ±1.3 67.6 ±0.2 79.2 ±0.1 78.6 ±0.0 78.6 ±0.2 79.1 ±0.1 84.8 ±0.3 76.1 ±8.5 86.0 ±0.1 85.8 ±0.3 73.0 ±0.6 77.6 ±2.3 30.5 ±10.1 86.5 ±0.1 84.8 ±0.3 85.7 ±0.2 86.3 ±0.0 86.5 ±0.1 85.7 ±0.1 86.5 ±0.1 86.0 ±0.1 86.4 ±0.1 85.5 ±0.0 85.8 ±0.2 86.3 ±0.0 8.6 ±0.4 16.1 ±9.0 21.1 ±1.0 4.4 ±1.2 40.4 ±0.0 26.3 ±2.0 65.7 ±10.2 21.5 ±1.2 8.6 ±0.4 20.1 ±1.4 20.9 ±0.5 18.8 ±2.2 22.1 ±0.5 16.1 ±1.7 32.3 ±0.3 23.9 ±0.2 39.5 ±0.1 21.2 ±0.3 20.2 ±0.1 Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 28.2 ±1.5 29.8 ±1.8 27.2 ±1.5 28.2 ±1.5 28.3 ±0.7 28.8 ±1.1 26.2 ±1.1 29.8 ±0.9 26.6 ±1.8 30.7 ±2.1 28.2 ±1.5 28.2 ±1.5 28.2 ±1.5 28.0 ±1.2 24.7 ±0.8 27.5 ±0.8 29.0 ±0.2 33.9 ±0.1 33.7 ±0.1 8.7 ±1.0 9.3 ±1.4 9.7 ±0.7 8.7 ±1.0 8.3 ±0.7 8.7 ±1.0 8.7 ±0.3 11.3 ±0.3 8.3 ±0.3 10.3 ±2.3 8.7 ±1.0 8.7 ±1.0 8.7 ±1.0 8.0 ±0.5 7.0 ±0.5 8.7 ±0.7 10.0 ±0.0 10.7 ±0.3 7.7 ±0.3 29.5 ±1.1 32.5 ±2.3 29.8 ±0.7 29.5 ±1.1 30.0 ±0.7 29.8 ±1.8 28.3 ±0.9 32.0 ±0.4 28.9 ±1.1 33.1 ±1.2 29.5 ±1.1 29.5 ±1.1 29.5 ±1.1 28.8 ±1.3 28.3 ±0.6 28.6 ±1.0 31.6 ±0.3 34.5 ±0.2 33.9 ±0.1 9.0 ±1.2 9.5 ±1.3 7.8 ±0.9 9.0 ±1.2 7.9 ±0.2 8.3 ±1.5 8.8 ±1.1 9.4 ±0.4 9.5 ±1.1 10.5 ±1.3 9.0 ±1.2 9.0 ±1.2 9.0 ±1.2 7.8 ±1.1 6.0 ±0.4 8.5 ±0.7 10.8 ±0.5 10.0 ±0.2 15.3 ±0.6 10.0 ±1.5 10.1 ±1.5 9.1 ±0.8 10.0 ±1.5 8.0 ±0.2 9.1 ±1.6 9.3 ±0.6 10.4 ±0.3 9.5 ±0.9 11.2 ±1.4 10.0 ±1.5 10.0 ±1.5 10.0 ±1.5 8.3 ±1.0 6.7 ±0.3 9.4 ±1.0 11.6 ±0.5 10.3 ±0.2 11.5 ±0.4 28.2 ±1.5 29.8 ±1.8 27.2 ±1.5 28.2 ±1.5 28.3 ±0.7 28.8 ±1.1 26.2 ±1.1 29.8 ±0.9 26.6 ±1.8 30.7 ±2.1 28.2 ±1.5 28.2 ±1.5 28.2 ±1.5 28.0 ±1.2 24.7 ±0.8 27.5 ±0.8 29.0 ±0.2 33.9 ±0.1 33.7 ±0.1 28.2 ±1.5 29.8 ±1.8 27.2 ±1.5 28.2 ±1.5 28.3 ±0.7 28.8 ±1.1 26.2 ±1.1 29.8 ±0.9 26.6 ±1.8 30.7 ±2.1 28.2 ±1.5 28.2 ±1.5 28.2 ±1.5 28.0 ±1.2 24.7 ±0.8 27.5 ±0.8 29.0 ±0.2 33.9 ±0.1 33.7 ±0.1 77.9 ±1.2 78.3 ±1.2 77.8 ±0.6 77.9 ±1.2 81.0 ±0.1 80.2 ±1.1 76.6 ±0.7 78.2 ±0.6 78.5 ±1.0 80.9 ±0.4 77.9 ±1.2 77.9 ±1.2 77.9 ±1.2 79.5 ±1.1 78.1 ±1.2 78.1 ±1.0 82.8 ±0.0 83.2 ±0.1 82.5 ±0.0 53.5 ±2.5 34.6 ±1.7 55.8 ±0.5 53.5 ±2.5 33.2 ±4.1 38.0 ±5.8 56.4 ±3.3 30.3 ±0.6 48.4 ±6.7 47.5 ±3.1 53.5 ±2.5 53.5 ±2.5 53.5 ±2.5 48.6 ±1.0 9.7 ±2.7 54.7 ±3.1 3.4 ±0.4 32.8 ±1.4 41.4 ±0.2 27.8 ±1.3 29.8 ±1.8 27.3 ±1.1 27.8 ±1.3 27.9 ±0.8 28.3 ±1.4 26.0 ±1.1 29.9 ±0.7 26.5 ±1.5 30.7 ±2.0 27.8 ±1.3 27.8 ±1.3 27.8 ±1.3 27.1 ±1.0 24.5 ±0.6 27.0 ±0.8 28.8 ±0.2 33.3 ±0.1 33.1 ±0.1 30 E.1.13. OVERALL Change is Hard: A Closer Look at Subpopulation Shift Algorithm Waterbirds CelebA CivilComments MultiNLI MetaShift ImageNetBG NICO++ MIMIC-CXR MIMICNotes CXRMultisite CheXpert Living17 Avg ERM Mixup GroupDRO IRM CVaRDRO JTT LfF LISA MMD ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 69.1 ±4.7 78.2 ±0.4 78.6 ±1.0 74.5 ±1.5 75.5 ±2.2 72.0 ±0.3 75.2 ±0.7 88.7 ±0.6 83.9 ±1.4 77.7 ±1.2 86.9 ±0.7 78.6 ±0.1 86.2 ±0.3 71.6 ±0.8 71.0 ±1.8 74.1 ±0.9 91.0 ±0.3 79.7 ±0.3 78.4 ±0.1 62.6 ±1.5 57.8 ±0.8 89.0 ±0.7 63.0 ±2.5 64.1 ±2.8 70.0 ±10.2 53.0 ±4.3 86.5 ±1.2 24.4 ±2.0 87.4 ±0.8 89.7 ±0.2 82.4 ±0.5 89.4 ±0.7 59.1 ±2.0 59.6 ±2.4 83.3 ±0.5 90.4 ±0.1 87.2 ±0.3 87.2 ±0.3 63.7 ±1.1 66.1 ±1.3 70.6 ±1.2 63.2 ±0.8 68.7 ±1.3 64.3 ±1.5 51.0 ±6.1 73.7 ±0.3 54.5 ±1.4 73.3 ±0.5 72.5 ±0.0 71.7 ±0.4 73.3 ±0.2 62.0 ±1.0 37.4 ±8.1 71.2 ±0.4 69.6 ±0.2 71.1 ±0.1 71.0 ±0.1 66.8 ±0.5 68.5 ±0.6 76.0 ±0.7 63.6 ±1.3 63.0 ±1.5 69.1 ±0.1 63.6 ±2.9 73.3 ±1.0 69.1 ±1.5 72.3 ±0.8 68.8 ±0.4 69.5 ±0.7 72.2 ±0.3 69.4 ±0.7 69.6 ±1.6 66.9 ±0.4 68.5 ±0.2 70.7 ±0.1 69.0 ±0.2 82.6 ±0.4 81.0 ±0.8 85.6 ±0.4 83.0 ±0.1 84.6 ±0.0 83.6 ±0.4 73.1 ±1.6 84.1 ±0.4 85.9 ±0.7 85.6 ±0.4 85.6 ±0.4 84.6 ±0.7 85.5 ±0.4 81.5 ±0.0 83.6 ±0.4 83.1 ±0.7 85.4 ±0.4 84.1 ±0.4 85.6 ±0.4 81.0 ±0.9 82.4 ±0.3 78.2 ±0.3 81.3 ±0.3 80.7 ±1.1 80.5 ±0.3 76.7 ±0.5 76.1 ±0.8 80.8 ±0.5 81.0 ±0.4 81.0 ±0.9 80.1 ±0.2 81.0 ±0.9 78.4 ±0.1 80.1 ±0.3 80.7 ±0.7 78.5 ±0.6 80.2 ±0.3 79.4 ±0.2 37.6 ±2.0 42.7 ±1.4 37.8 ±1.8 40.0 ±0.0 36.7 ±2.7 40.0 ±0.0 30.4 ±1.3 42.7 ±2.2 40.7 ±0.5 40.0 ±0.0 41.9 ±1.6 40.0 ±0.0 37.8 ±1.8 36.7 ±2.7 42.0 ±0.9 40.4 ±0.3 23.7 ±0.7 43.3 ±2.7 23.3 ±1.4 68.9 ±0.3 68.1 ±0.9 74.4 ±0.2 67.7 ±0.2 68.6 ±0.4 67.3 ±0.7 62.6 ±2.6 70.4 ±0.2 68.0 ±0.6 71.9 ±0.2 71.6 ±0.3 70.3 ±0.2 70.7 ±0.1 68.7 ±0.4 68.6 ±1.1 68.4 ±0.2 68.9 ±0.0 71.0 ±0.0 70.8 ±0.0 83.1 ±0.1 82.0 ±0.4 83.7 ±0.1 83.2 ±0.2 81.9 ±0.1 83.8 ±0.1 84.0 ±0.1 83.6 ±0.2 82.0 ±0.5 83.9 ±0.1 83.6 ±0.3 83.1 ±0.1 83.2 ±0.1 71.1 ±9.9 81.0 ±0.3 83.4 ±0.3 83.6 ±0.0 83.4 ±0.0 83.4 ±0.0 50.1 ±0.9 50.1 ±0.9 59.6 ±1.0 47.9 ±1.1 50.2 ±0.9 50.1 ±0.9 50.1 ±0.9 48.9 ±1.3 50.1 ±0.9 59.0 ±1.1 64.2 ±0.7 50.0 ±1.0 50.1 ±0.9 50.0 ±0.9 50.0 ±0.0 50.1 ±1.1 53.5 ±0.2 65.2 ±0.1 60.9 ±0.8 50.2 ±3.8 37.4 ±3.5 74.5 ±0.2 34.4 ±1.7 57.9 ±0.4 61.3 ±4.9 13.7 ±9.8 75.6 ±0.6 50.2 ±3.8 75.3 ±0.5 75.7 ±0.1 70.0 ±2.3 74.7 ±0.3 42.1 ±4.0 36.4 ±0.3 75.4 ±0.5 71.7 ±0.2 74.6 ±0.3 76.0 ±0.1 28.2 ±1.5 29.8 ±1.8 27.2 ±1.5 28.2 ±1.5 28.3 ±0.7 28.8 ±1.1 26.2 ±1.1 29.8 ±0.9 26.6 ±1.8 30.7 ±2.1 28.2 ±1.5 28.2 ±1.5 28.2 ±1.5 28.0 ±1.2 24.7 ±0.8 27.5 ±0.8 29.0 ±0.2 33.9 ±0.1 33.7 ±0.1 62.0 62.0 69.6 60.8 63.3 64.2 55.0 69.5 59.7 69.8 70.8 67.4 69.4 59.9 58.7 67.0 67.8 70.4 68.2 E.2. Attributes Unknown in Training, but Known in Validation E.2.1. WATERBIRDS Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 84.1 ±1.7 89.5 ±0.4 86.9 ±0.9 89.9 ±0.4 88.9 ±0.6 86.5 ±0.6 89.5 ±0.4 86.2 ±0.5 86.9 ±0.5 89.7 ±0.4 86.8 ±0.6 89.3 ±0.2 87.3 ±0.5 88.4 ±1.2 92.2 ±0.2 89.2 ±0.1 89.4 ±0.3 69.1 ±4.7 78.2 ±0.4 73.1 ±0.4 75.5 ±2.2 71.0 ±0.5 74.7 ±1.0 78.2 ±0.4 70.0 ±1.0 72.5 ±0.3 71.3 ±1.4 74.4 ±1.2 71.6 ±0.8 71.0 ±1.8 74.1 ±0.9 89.0 ±0.2 76.3 ±0.8 76.3 ±0.2 77.4 ±2.0 83.9 ±0.6 80.7 ±1.1 84.5 ±0.7 83.2 ±0.8 80.1 ±0.7 83.9 ±0.6 79.8 ±0.6 80.7 ±0.6 84.3 ±0.6 80.4 ±0.7 83.7 ±0.3 81.2 ±0.6 82.6 ±1.6 87.7 ±0.3 83.5 ±0.1 83.8 ±0.3 60.7 ±3.2 71.6 ±1.3 66.1 ±2.2 73.2 ±1.7 71.5 ±1.7 64.7 ±1.4 71.6 ±1.3 64.9 ±1.4 66.1 ±1.3 73.6 ±0.9 65.5 ±1.3 72.4 ±0.5 67.7 ±1.5 69.9 ±2.9 78.4 ±0.5 71.3 ±0.4 71.9 ±0.7 79.4 ±2.1 85.9 ±0.4 82.8 ±0.9 86.2 ±0.3 84.7 ±0.6 82.3 ±0.6 85.9 ±0.4 81.7 ±0.5 82.7 ±0.5 85.7 ±0.6 82.6 ±0.7 85.2 ±0.3 83.0 ±0.5 84.4 ±1.5 89.2 ±0.2 85.3 ±0.1 85.6 ±0.3 69.5 ±2.9 78.8 ±0.6 74.4 ±1.2 79.0 ±0.4 76.8 ±0.8 73.8 ±0.8 78.8 ±0.6 72.7 ±0.7 74.2 ±0.6 78.2 ±0.8 74.0 ±1.0 77.5 ±0.4 74.4 ±0.6 76.4 ±2.0 83.6 ±0.3 77.8 ±0.1 78.1 ±0.4 83.1 ±2.0 88.9 ±0.3 86.3 ±0.5 88.5 ±0.3 86.8 ±0.2 86.2 ±0.3 88.9 ±0.3 85.0 ±0.2 86.1 ±0.1 87.4 ±0.5 86.2 ±0.6 87.1 ±0.3 85.7 ±0.2 87.0 ±1.0 91.2 ±0.1 87.9 ±0.1 88.0 ±0.2 83.1 ±2.0 88.9 ±0.3 86.3 ±0.5 88.5 ±0.3 86.8 ±0.2 86.2 ±0.3 88.9 ±0.3 85.0 ±0.2 86.1 ±0.1 87.4 ±0.5 86.2 ±0.6 87.1 ±0.3 85.7 ±0.2 87.0 ±1.0 91.2 ±0.1 87.9 ±0.1 88.0 ±0.2 91.0 ±1.4 94.7 ±0.2 94.0 ±0.3 95.4 ±0.2 94.2 ±0.1 93.5 ±0.2 94.7 ±0.2 92.8 ±0.1 93.9 ±0.1 94.5 ±0.4 93.5 ±0.4 94.2 ±0.2 93.3 ±0.2 94.0 ±0.9 96.8 ±0.1 94.8 ±0.0 94.9 ±0.1 12.9 ±1.7 7.0 ±0.6 10.5 ±0.8 8.3 ±0.2 9.1 ±0.3 9.9 ±0.8 7.0 ±0.6 11.3 ±0.3 10.6 ±0.3 8.8 ±0.4 11.3 ±0.4 6.9 ±0.1 13.7 ±2.2 9.9 ±1.2 6.8 ±0.4 9.2 ±0.2 8.8 ±0.2 E.2.2. CELEBA Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 95.0 ±0.1 95.4 ±0.1 92.4 ±0.2 95.1 ±0.1 88.1 ±0.5 81.1 ±5.6 95.4 ±0.1 92.2 ±0.4 92.0 ±0.4 93.7 ±0.2 93.8 ±0.3 94.9 ±0.3 94.5 ±0.2 91.9 ±0.1 91.2 ±0.1 94.1 ±0.1 94.2 ±0.1 57.6 ±0.8 57.8 ±0.8 78.5 ±1.1 62.2 ±3.1 66.0 ±11.9 53.0 ±4.3 57.8 ±0.8 82.2 ±1.2 81.5 ±0.9 72.0 ±2.2 75.0 ±2.4 59.1 ±2.0 59.3 ±2.3 83.3 ±0.5 86.3 ±0.3 70.4 ±0.4 71.1 ±0.5 87.4 ±0.2 88.4 ±0.3 81.9 ±0.3 87.8 ±0.2 75.2 ±1.1 71.8 ±4.1 88.4 ±0.3 81.5 ±0.6 81.3 ±0.6 84.3 ±0.5 84.5 ±0.7 87.5 ±0.8 86.5 ±0.8 81.1 ±0.2 80.0 ±0.1 85.1 ±0.2 85.3 ±0.1 76.3 ±0.3 78.5 ±0.7 64.5 ±0.5 77.1 ±0.5 54.1 ±1.0 45.2 ±8.3 78.5 ±0.7 63.7 ±1.3 63.2 ±1.4 69.4 ±1.1 69.9 ±1.6 76.7 ±1.7 74.7 ±1.9 62.9 ±0.4 61.0 ±0.2 71.3 ±0.5 71.8 ±0.3 E.2.3. CIVILCOMMENTS 89.9 ±0.1 90.6 ±0.2 86.3 ±0.2 90.2 ±0.1 76.7 ±3.3 73.2 ±5.6 90.6 ±0.2 85.9 ±0.5 85.7 ±0.6 88.1 ±0.4 88.3 ±0.5 89.7 ±0.4 89.1 ±0.2 85.6 ±0.2 84.4 ±0.1 88.6 ±0.1 88.7 ±0.1 31 82.7 ±0.2 83.8 ±0.3 77.1 ±0.4 83.2 ±0.1 60.5 ±6.6 59.0 ±7.3 83.8 ±0.3 76.6 ±0.8 76.3 ±0.8 80.0 ±0.6 80.3 ±0.8 82.4 ±0.6 81.4 ±0.3 76.1 ±0.3 74.1 ±0.1 80.6 ±0.2 80.9 ±0.1 85.6 ±0.2 85.8 ±0.2 90.1 ±0.3 86.8 ±0.7 81.7 ±5.5 78.3 ±3.0 85.8 ±0.2 90.8 ±0.1 90.7 ±0.2 89.0 ±0.5 89.8 ±0.5 85.6 ±0.5 85.6 ±0.8 91.1 ±0.2 90.8 ±0.0 88.5 ±0.1 88.7 ±0.1 93.0 ±0.0 93.1 ±0.1 93.9 ±0.1 93.2 ±0.2 82.7 ±6.7 85.3 ±2.9 93.1 ±0.1 93.8 ±0.1 93.8 ±0.1 94.0 ±0.0 94.0 ±0.1 92.5 ±0.4 92.5 ±0.7 93.9 ±0.1 92.6 ±0.0 93.5 ±0.1 93.6 ±0.1 98.4 ±0.0 98.4 ±0.1 98.5 ±0.0 98.4 ±0.1 91.3 ±0.2 94.1 ±1.2 98.4 ±0.1 98.5 ±0.0 98.4 ±0.1 98.4 ±0.0 98.5 ±0.0 98.2 ±0.1 98.2 ±0.1 98.6 ±0.0 97.9 ±0.0 98.4 ±0.0 98.4 ±0.0 2.9 ±0.1 2.5 ±0.2 7.4 ±0.5 3.0 ±0.2 5.0 ±1.0 27.9 ±5.5 2.5 ±0.2 7.4 ±0.8 7.8 ±0.8 5.3 ±0.4 5.1 ±0.6 3.2 ±0.4 28.0 ±2.6 8.4 ±0.2 14.1 ±0.0 4.5 ±0.2 4.6 ±0.2 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 85.4 ±0.2 84.9 ±0.3 83.1 ±0.3 83.5 ±0.3 83.3 ±0.1 68.2 ±5.0 84.9 ±0.3 82.5 ±0.6 83.1 ±0.1 83.6 ±0.1 84.1 ±0.7 85.6 ±0.3 81.8 ±2.2 83.0 ±0.4 81.3 ±0.0 83.0 ±0.0 83.4 ±0.0 63.2 ±1.2 66.1 ±1.3 69.5 ±0.7 68.7 ±1.3 64.3 ±1.5 50.3 ±5.9 66.1 ±1.3 68.2 ±0.7 69.9 ±0.6 70.1 ±0.3 67.0 ±0.1 61.9 ±1.1 37.0 ±7.9 69.4 ±1.2 66.5 ±0.2 68.5 ±0.0 68.2 ±0.4 75.4 ±0.3 74.8 ±0.3 73.2 ±0.2 73.5 ±0.3 72.8 ±0.1 62.9 ±3.5 74.8 ±0.3 72.7 ±0.5 73.2 ±0.1 73.6 ±0.1 74.1 ±0.7 75.6 ±0.4 69.4 ±3.4 73.1 ±0.3 71.2 ±0.0 73.0 ±0.0 73.3 ±0.0 57.6 ±0.7 56.2 ±0.8 52.0 ±0.6 52.8 ±0.6 52.4 ±0.3 34.1 ±5.4 56.2 ±0.8 51.0 ±1.3 52.0 ±0.1 52.9 ±0.2 54.3 ±1.6 58.5 ±0.9 49.7 ±5.8 51.8 ±0.7 48.6 ±0.0 51.7 ±0.1 52.5 ±0.1 77.0 ±0.1 76.7 ±0.2 75.7 ±0.2 75.9 ±0.2 74.8 ±0.1 61.5 ±4.7 76.7 ±0.2 75.0 ±0.5 75.6 ±0.1 76.0 ±0.1 76.2 ±0.5 77.0 ±0.3 69.4 ±3.3 75.5 ±0.3 73.4 ±0.0 75.4 ±0.0 75.7 ±0.0 63.2 ±0.1 62.8 ±0.3 62.2 ±0.2 62.4 ±0.2 60.3 ±0.2 45.8 ±5.5 62.8 ±0.3 61.2 ±0.5 62.1 ±0.1 62.4 ±0.2 62.6 ±0.5 62.9 ±0.5 49.9 ±5.2 61.9 ±0.3 59.0 ±0.0 61.8 ±0.0 62.0 ±0.0 77.7 ±0.1 78.0 ±0.1 79.1 ±0.1 78.6 ±0.2 76.8 ±0.2 68.5 ±4.4 78.0 ±0.1 78.4 ±0.1 78.8 ±0.1 78.7 ±0.2 78.4 ±0.1 77.3 ±0.3 67.1 ±3.9 78.7 ±0.3 76.8 ±0.0 78.6 ±0.0 78.3 ±0.0 79.4 ±0.2 79.6 ±0.1 80.9 ±0.1 80.7 ±0.1 78.4 ±0.2 69.8 ±4.8 79.6 ±0.1 80.3 ±0.1 80.7 ±0.1 80.7 ±0.2 80.2 ±0.2 78.7 ±0.3 69.5 ±3.2 80.6 ±0.3 78.8 ±0.0 80.6 ±0.0 80.4 ±0.0 89.8 ±0.1 89.8 ±0.1 89.9 ±0.1 89.8 ±0.1 88.2 ±0.1 75.0 ±6.5 89.8 ±0.1 89.3 ±0.1 89.8 ±0.0 89.9 ±0.1 90.0 ±0.0 89.4 ±0.4 79.0 ±3.8 89.7 ±0.2 86.7 ±0.1 89.4 ±0.1 89.4 ±0.0 7.8 ±0.4 9.0 ±0.6 12.3 ±0.5 32.9 ±0.4 10.2 ±0.3 30.8 ±2.7 9.0 ±0.6 13.8 ±1.0 11.0 ±0.2 10.1 ±0.1 9.1 ±1.0 7.7 ±0.4 21.0 ±0.2 12.1 ±0.9 19.6 ±0.1 12.5 ±0.1 11.5 ±0.2 E.2.4. MULTINLI Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 80.9 ±0.3 81.4 ±0.3 81.0 ±0.0 75.1 ±0.1 81.4 ±0.1 71.7 ±1.1 81.4 ±0.3 81.4 ±0.3 79.2 ±0.4 80.9 ±0.1 81.1 ±0.2 80.7 ±0.2 80.7 ±0.3 80.9 ±0.1 80.2 ±0.0 80.2 ±0.0 80.2 ±0.0 E.2.5. METASHIFT 69.5 ±0.3 68.5 ±0.6 69.3 ±1.5 63.0 ±1.5 68.4 ±0.6 63.6 ±2.9 68.5 ±0.6 67.5 ±0.4 67.8 ±1.2 66.6 ±0.4 66.2 ±0.7 69.3 ±0.8 69.6 ±1.6 66.9 ±0.4 63.8 ±0.0 65.4 ±0.1 65.3 ±0.1 81.3 ±0.3 81.6 ±0.3 81.3 ±0.1 76.2 ±0.2 81.6 ±0.1 71.8 ±1.1 81.6 ±0.3 81.7 ±0.3 79.5 ±0.3 81.1 ±0.1 81.2 ±0.2 81.2 ±0.2 81.1 ±0.1 81.1 ±0.1 80.3 ±0.0 80.3 ±0.0 80.3 ±0.0 73.7 ±0.4 76.0 ±0.5 74.9 ±0.6 65.6 ±0.2 75.7 ±0.3 68.7 ±0.7 76.0 ±0.5 74.7 ±0.6 73.0 ±0.5 76.0 ±0.3 76.6 ±0.3 73.5 ±0.5 73.9 ±0.9 75.9 ±0.3 75.2 ±0.0 74.4 ±0.1 74.4 ±0.0 81.0 ±0.3 81.4 ±0.3 81.1 ±0.1 75.2 ±0.1 81.5 ±0.1 71.7 ±1.1 81.4 ±0.3 81.4 ±0.3 79.3 ±0.4 80.9 ±0.1 81.1 ±0.2 80.8 ±0.2 80.8 ±0.2 80.9 ±0.1 80.3 ±0.0 80.2 ±0.0 80.2 ±0.0 77.6 ±0.3 78.0 ±0.2 77.7 ±0.1 72.1 ±0.2 78.1 ±0.1 68.5 ±1.8 78.0 ±0.2 77.8 ±0.3 75.7 ±0.3 77.7 ±0.1 77.8 ±0.1 77.4 ±0.2 77.4 ±0.2 77.7 ±0.1 76.2 ±0.0 76.4 ±0.0 76.4 ±0.0 79.7 ±0.3 80.1 ±0.3 79.5 ±0.3 74.2 ±0.4 80.2 ±0.2 70.8 ±1.4 80.1 ±0.3 79.9 ±0.2 78.4 ±0.2 79.6 ±0.0 79.7 ±0.0 79.5 ±0.1 79.7 ±0.3 79.7 ±0.0 78.5 ±0.0 78.6 ±0.0 78.6 ±0.0 80.9 ±0.3 81.4 ±0.3 81.0 ±0.0 75.1 ±0.1 81.4 ±0.1 71.7 ±1.1 81.4 ±0.3 81.4 ±0.3 79.2 ±0.4 80.9 ±0.1 81.1 ±0.2 80.7 ±0.2 80.7 ±0.3 80.9 ±0.1 80.2 ±0.0 80.2 ±0.0 80.2 ±0.0 93.6 ±0.1 93.6 ±0.1 93.8 ±0.0 86.3 ±0.2 93.9 ±0.0 87.0 ±0.8 93.6 ±0.1 93.8 ±0.1 92.5 ±0.1 93.6 ±0.1 93.7 ±0.1 93.6 ±0.1 93.5 ±0.1 93.6 ±0.1 92.9 ±0.0 92.9 ±0.0 92.9 ±0.0 10.7 ±0.5 9.4 ±0.9 8.7 ±0.4 41.4 ±0.1 9.4 ±0.5 4.4 ±0.6 9.4 ±0.9 11.3 ±1.3 13.1 ±1.5 8.1 ±0.2 8.9 ±0.4 4.5 ±1.1 33.4 ±0.3 8.1 ±0.2 5.7 ±0.0 14.9 ±0.1 15.0 ±0.2 Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 91.5 ±0.2 91.4 ±0.2 91.5 ±0.3 91.5 ±0.2 91.5 ±0.2 80.3 ±0.4 91.4 ±0.2 92.1 ±0.3 91.2 ±0.5 91.1 ±0.2 91.2 ±0.1 91.6 ±0.2 91.7 ±0.0 91.2 ±0.3 90.5 ±0.4 91.5 ±0.0 91.3 ±0.1 82.1 ±0.8 79.0 ±0.8 82.6 ±1.1 82.6 ±1.1 82.6 ±0.4 72.6 ±1.2 79.0 ±0.8 80.5 ±1.5 83.1 ±0.7 82.1 ±0.8 82.6 ±0.4 81.0 ±0.4 83.6 ±0.4 82.6 ±0.4 81.5 ±0.0 83.1 ±0.0 85.1 ±0.4 91.5 ±0.1 91.4 ±0.2 91.5 ±0.3 91.5 ±0.2 91.5 ±0.2 80.6 ±0.3 91.4 ±0.2 92.1 ±0.3 91.1 ±0.5 91.1 ±0.2 91.2 ±0.1 91.6 ±0.3 91.7 ±0.0 91.1 ±0.3 90.5 ±0.4 91.4 ±0.0 91.2 ±0.1 90.7 ±0.3 90.9 ±0.2 90.8 ±0.3 90.7 ±0.5 91.0 ±0.1 77.5 ±1.4 90.9 ±0.2 91.4 ±0.4 90.2 ±0.4 90.5 ±0.2 90.7 ±0.2 91.2 ±0.4 90.9 ±0.3 90.2 ±0.2 89.2 ±0.3 90.6 ±0.1 90.1 ±0.3 91.4 ±0.2 91.3 ±0.2 91.5 ±0.3 91.5 ±0.2 91.5 ±0.2 80.2 ±0.3 91.3 ±0.2 92.1 ±0.3 91.1 ±0.5 91.1 ±0.2 91.2 ±0.1 91.6 ±0.2 91.7 ±0.0 91.2 ±0.3 90.5 ±0.4 91.4 ±0.0 91.2 ±0.1 90.9 ±0.2 90.8 ±0.2 91.0 ±0.3 91.0 ±0.2 90.9 ±0.3 78.9 ±0.4 90.8 ±0.2 91.6 ±0.3 90.6 ±0.6 90.5 ±0.2 90.6 ±0.1 91.0 ±0.2 91.2 ±0.0 90.7 ±0.3 90.0 ±0.4 90.9 ±0.0 90.8 ±0.1 89.4 ±0.3 88.7 ±0.1 89.5 ±0.4 89.5 ±0.4 89.6 ±0.1 80.4 ±0.6 88.7 ±0.1 89.5 ±0.1 89.3 ±0.5 89.1 ±0.3 89.3 ±0.2 89.5 ±0.2 90.0 ±0.1 89.2 ±0.3 88.2 ±0.3 89.5 ±0.0 89.7 ±0.2 91.4 ±0.2 91.3 ±0.2 91.5 ±0.3 91.5 ±0.2 91.4 ±0.3 80.2 ±0.2 91.3 ±0.2 92.1 ±0.3 91.1 ±0.5 91.1 ±0.2 91.1 ±0.1 91.5 ±0.2 91.7 ±0.0 91.2 ±0.3 90.6 ±0.4 91.4 ±0.0 91.3 ±0.1 97.5 ±0.1 97.2 ±0.0 97.5 ±0.1 97.5 ±0.1 97.6 ±0.1 90.7 ±0.6 97.2 ±0.0 97.5 ±0.1 97.4 ±0.2 97.4 ±0.1 97.4 ±0.0 97.6 ±0.0 97.5 ±0.1 97.4 ±0.1 96.7 ±0.0 97.3 ±0.0 96.8 ±0.1 5.7 ±0.4 1.7 ±0.2 5.9 ±0.5 7.8 ±2.1 6.5 ±0.1 8.0 ±1.3 1.7 ±0.2 6.7 ±0.4 6.6 ±0.8 6.7 ±0.3 6.7 ±0.1 3.3 ±0.4 9.9 ±0.7 6.8 ±0.3 3.2 ±0.2 6.8 ±0.0 8.1 ±0.1 E.2.6. IMAGENETBG 32 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 87.7 ±0.1 87.9 ±0.2 87.7 ±0.1 87.8 ±0.2 87.6 ±0.4 84.7 ±0.5 87.9 ±0.2 88.2 ±0.4 87.7 ±0.1 87.7 ±0.1 87.7 ±0.1 86.7 ±0.2 88.2 ±0.1 87.7 ±0.1 86.8 ±0.5 88.3 ±0.1 88.4 ±0.1 76.8 ±0.9 76.9 ±0.7 76.4 ±0.2 74.8 ±0.8 77.0 ±0.4 70.1 ±1.4 76.9 ±0.7 77.7 ±1.1 76.8 ±0.9 76.8 ±0.9 76.8 ±0.9 71.9 ±1.2 76.7 ±0.5 76.1 ±2.0 74.4 ±1.8 78.2 ±0.5 77.5 ±0.7 87.9 ±0.1 88.4 ±0.1 87.9 ±0.1 88.0 ±0.1 87.8 ±0.3 85.4 ±0.3 88.4 ±0.1 88.4 ±0.4 87.9 ±0.1 87.9 ±0.1 87.9 ±0.1 87.1 ±0.2 88.5 ±0.1 88.0 ±0.1 86.9 ±0.5 88.3 ±0.1 88.5 ±0.1 78.3 ±1.3 76.6 ±2.6 76.2 ±0.5 79.9 ±0.9 78.3 ±3.0 72.1 ±3.1 76.6 ±2.6 79.7 ±1.0 78.3 ±1.3 78.3 ±1.3 78.3 ±1.3 74.2 ±1.3 77.6 ±1.1 77.7 ±1.3 78.9 ±1.6 82.7 ±0.4 82.1 ±0.4 87.7 ±0.1 88.0 ±0.2 87.6 ±0.1 87.8 ±0.2 87.5 ±0.3 84.7 ±0.5 88.0 ±0.2 88.2 ±0.4 87.7 ±0.1 87.7 ±0.1 87.7 ±0.1 86.6 ±0.2 88.1 ±0.1 87.7 ±0.1 86.7 ±0.5 88.3 ±0.1 88.4 ±0.1 80.7 ±0.4 80.5 ±1.0 81.1 ±0.3 79.5 ±0.3 80.4 ±0.6 76.2 ±0.6 80.5 ±1.0 80.6 ±1.0 80.7 ±0.4 80.7 ±0.4 80.7 ±0.4 77.6 ±0.7 81.3 ±0.4 80.4 ±0.8 78.1 ±1.3 80.9 ±0.2 81.2 ±0.3 87.7 ±0.1 87.9 ±0.2 87.7 ±0.1 87.8 ±0.2 87.6 ±0.4 84.7 ±0.5 87.9 ±0.2 88.2 ±0.4 87.7 ±0.1 87.7 ±0.1 87.7 ±0.1 86.7 ±0.2 88.2 ±0.1 87.7 ±0.1 86.8 ±0.5 88.3 ±0.1 88.4 ±0.1 87.7 ±0.1 87.9 ±0.2 87.7 ±0.1 87.8 ±0.2 87.6 ±0.4 84.7 ±0.5 87.9 ±0.2 88.2 ±0.4 87.7 ±0.1 87.7 ±0.1 87.7 ±0.1 86.7 ±0.2 88.2 ±0.1 87.7 ±0.1 86.8 ±0.5 88.3 ±0.1 88.4 ±0.1 99.0 ±0.0 98.7 ±0.0 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 98.6 ±0.0 98.7 ±0.0 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 98.9 ±0.0 98.8 ±0.0 99.0 ±0.0 98.8 ±0.1 99.1 ±0.0 99.1 ±0.0 5.1 ±0.1 4.7 ±1.6 5.1 ±0.1 5.6 ±0.2 3.7 ±0.2 1.8 ±0.4 4.7 ±1.6 5.4 ±0.5 5.1 ±0.1 5.1 ±0.1 5.1 ±0.1 2.8 ±0.6 45.9 ±0.7 5.6 ±0.5 8.9 ±1.4 5.6 ±0.2 5.4 ±0.2 E.2.7. NICO++ Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 85.3 ±0.3 85.5 ±0.2 83.0 ±0.3 84.4 ±0.6 85.4 ±0.2 78.5 ±0.6 85.5 ±0.2 84.8 ±0.4 85.8 ±0.1 85.4 ±0.2 85.1 ±0.4 85.1 ±0.5 84.7 ±0.4 85.2 ±0.3 82.5 ±0.0 85.7 ±0.0 85.8 ±0.1 40.0 ±0.0 30.0 ±4.1 31.1 ±0.9 31.7 ±3.6 32.2 ±0.9 28.3 ±1.7 30.0 ±4.1 23.3 ±1.4 25.0 ±0.0 35.6 ±1.8 34.4 ±2.4 29.4 ±2.0 26.7 ±1.4 29.4 ±2.0 39.3 ±2.4 33.3 ±0.0 33.3 ±0.0 86.2 ±0.2 86.5 ±0.1 84.5 ±0.2 85.5 ±0.5 86.2 ±0.2 80.9 ±0.3 86.5 ±0.1 85.7 ±0.3 86.6 ±0.1 86.4 ±0.1 85.9 ±0.3 86.0 ±0.3 85.6 ±0.3 85.9 ±0.2 83.3 ±0.0 86.1 ±0.0 86.1 ±0.1 59.2 ±1.1 55.7 ±2.5 54.4 ±3.9 57.1 ±1.6 57.8 ±4.6 44.3 ±0.8 55.7 ±2.5 58.9 ±2.7 59.8 ±1.1 57.5 ±1.4 56.9 ±1.1 58.1 ±2.2 60.4 ±1.4 57.6 ±2.1 55.3 ±1.3 64.4 ±0.2 66.1 ±0.5 85.4 ±0.3 85.7 ±0.2 83.2 ±0.3 84.6 ±0.6 85.5 ±0.2 78.8 ±0.6 85.7 ±0.2 84.9 ±0.4 85.9 ±0.1 85.6 ±0.1 85.2 ±0.4 85.3 ±0.4 84.8 ±0.4 85.3 ±0.3 82.6 ±0.0 85.7 ±0.0 85.8 ±0.1 66.0 ±0.6 66.5 ±1.6 64.9 ±0.9 66.6 ±1.5 65.1 ±2.8 54.4 ±1.3 66.5 ±1.6 65.5 ±1.1 69.1 ±0.5 66.7 ±1.2 64.9 ±0.1 65.0 ±0.8 65.3 ±0.7 66.9 ±0.7 63.7 ±0.9 69.1 ±0.1 69.9 ±0.2 84.8 ±0.3 85.0 ±0.2 82.6 ±0.3 84.0 ±0.6 84.9 ±0.2 78.1 ±0.6 85.0 ±0.2 84.2 ±0.4 85.3 ±0.1 84.9 ±0.2 84.7 ±0.4 84.6 ±0.5 84.2 ±0.4 84.8 ±0.3 82.1 ±0.0 85.2 ±0.0 85.4 ±0.1 85.2 ±0.3 85.4 ±0.2 82.9 ±0.3 84.3 ±0.6 85.3 ±0.2 78.4 ±0.6 85.4 ±0.2 84.7 ±0.4 85.7 ±0.1 85.3 ±0.2 85.1 ±0.4 85.0 ±0.5 84.6 ±0.4 85.1 ±0.3 82.4 ±0.0 85.6 ±0.0 85.7 ±0.1 99.4 ±0.0 99.1 ±0.0 99.3 ±0.0 99.4 ±0.0 99.4 ±0.0 99.2 ±0.0 99.1 ±0.0 99.3 ±0.0 99.4 ±0.0 99.4 ±0.0 99.4 ±0.0 99.4 ±0.0 98.9 ±0.1 99.4 ±0.0 99.2 ±0.0 99.4 ±0.0 99.4 ±0.0 9.6 ±0.2 2.0 ±0.3 7.4 ±0.5 7.8 ±1.3 10.2 ±0.2 1.8 ±0.2 2.0 ±0.3 10.1 ±0.0 9.4 ±0.2 9.3 ±0.0 9.1 ±0.7 4.6 ±1.1 62.6 ±2.0 8.4 ±0.9 11.7 ±0.1 4.7 ±0.0 6.2 ±0.2 E.2.8. MIMIC-CXR Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 78.6 ±0.2 78.5 ±0.1 78.3 ±0.1 78.4 ±0.3 78.2 ±0.1 73.9 ±1.1 78.5 ±0.1 78.7 ±0.1 78.0 ±0.1 78.5 ±0.2 78.6 ±0.1 78.3 ±0.1 78.5 ±0.1 78.2 ±0.2 78.3 ±0.0 78.3 ±0.0 77.9 ±0.0 68.5 ±0.4 67.2 ±1.1 67.4 ±0.9 67.5 ±0.1 66.6 ±0.8 62.1 ±2.4 67.2 ±1.1 68.9 ±0.3 67.4 ±0.3 68.9 ±0.5 67.8 ±0.6 67.3 ±1.2 68.2 ±1.4 67.2 ±0.2 67.1 ±0.4 69.1 ±0.2 68.9 ±0.0 77.7 ±0.2 77.5 ±0.1 77.4 ±0.1 77.4 ±0.3 77.3 ±0.1 72.9 ±1.1 77.5 ±0.1 77.8 ±0.1 77.1 ±0.0 77.6 ±0.2 77.6 ±0.1 77.4 ±0.1 77.6 ±0.1 77.3 ±0.2 77.3 ±0.0 77.4 ±0.0 77.0 ±0.0 72.2 ±0.5 72.3 ±0.5 71.9 ±0.2 72.1 ±0.6 71.9 ±0.3 66.5 ±1.1 72.3 ±0.5 72.2 ±0.1 70.9 ±0.2 71.6 ±0.3 72.3 ±0.4 71.6 ±0.1 72.0 ±0.4 71.9 ±0.5 72.0 ±0.2 71.1 ±0.1 70.5 ±0.0 77.8 ±0.2 77.6 ±0.0 77.6 ±0.1 77.6 ±0.3 77.4 ±0.1 73.0 ±1.2 77.6 ±0.0 78.0 ±0.1 77.3 ±0.0 77.7 ±0.2 77.8 ±0.1 77.5 ±0.1 77.7 ±0.1 77.4 ±0.2 77.5 ±0.0 77.6 ±0.0 77.3 ±0.0 73.7 ±0.2 73.4 ±0.1 73.4 ±0.1 73.4 ±0.2 73.2 ±0.1 68.0 ±1.6 73.4 ±0.1 74.0 ±0.1 73.3 ±0.0 73.8 ±0.2 73.6 ±0.2 73.5 ±0.2 73.6 ±0.3 73.2 ±0.1 73.2 ±0.1 73.7 ±0.0 73.4 ±0.0 77.5 ±0.2 77.2 ±0.1 77.2 ±0.1 77.2 ±0.2 77.0 ±0.1 72.9 ±1.2 77.2 ±0.1 77.7 ±0.1 77.0 ±0.0 77.4 ±0.2 77.4 ±0.1 77.2 ±0.2 77.5 ±0.2 77.1 ±0.1 77.1 ±0.0 77.4 ±0.0 77.0 ±0.0 78.1 ±0.2 77.8 ±0.1 77.8 ±0.1 77.7 ±0.2 77.6 ±0.1 73.2 ±1.2 77.8 ±0.1 78.2 ±0.1 77.6 ±0.0 78.1 ±0.2 78.0 ±0.1 77.8 ±0.1 78.0 ±0.2 77.6 ±0.1 77.6 ±0.1 78.0 ±0.0 77.7 ±0.0 85.5 ±0.2 85.3 ±0.1 85.1 ±0.0 84.9 ±0.2 85.0 ±0.1 79.9 ±1.5 85.3 ±0.1 85.4 ±0.1 84.9 ±0.0 85.4 ±0.1 85.4 ±0.1 85.3 ±0.1 85.3 ±0.1 85.1 ±0.1 85.0 ±0.0 85.3 ±0.0 85.0 ±0.0 2.6 ±0.2 2.4 ±0.7 3.7 ±0.4 5.7 ±0.3 3.3 ±0.1 11.3 ±0.3 2.4 ±0.7 3.6 ±0.1 4.1 ±0.6 3.6 ±0.4 3.2 ±0.3 10.0 ±0.6 22.2 ±0.1 3.6 ±0.5 20.0 ±0.1 4.7 ±0.1 4.9 ±0.3 E.2.9. MIMICNOTES 33 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 91.1 ±0.1 91.1 ±0.0 83.2 ±2.4 90.2 ±0.0 71.3 ±3.7 84.0 ±1.2 91.1 ±0.0 81.4 ±1.5 82.7 ±0.7 90.3 ±0.2 78.2 ±1.0 91.0 ±0.0 90.6 ±0.1 76.9 ±0.9 69.2 ±1.3 77.8 ±0.0 81.2 ±2.8 24.2 ±2.8 22.7 ±3.2 62.6 ±6.3 0.0 ±0.0 65.9 ±2.8 62.7 ±2.1 22.7 ±3.2 67.1 ±2.6 65.5 ±1.3 35.7 ±4.0 72.3 ±1.3 19.1 ±2.3 5.3 ±2.4 73.1 ±1.0 67.3 ±1.7 73.1 ±0.0 63.9 ±7.6 76.4 ±0.9 76.8 ±0.7 64.7 ±1.4 45.1 ±0.0 60.3 ±0.7 64.6 ±0.7 76.8 ±0.7 63.3 ±0.6 63.8 ±0.4 72.4 ±0.9 61.9 ±0.3 77.1 ±0.6 84.4 ±0.8 61.7 ±0.2 58.8 ±0.2 61.6 ±0.0 63.6 ±1.6 60.3 ±2.1 61.2 ±1.6 33.7 ±3.4 0.0 ±0.0 23.4 ±1.9 33.6 ±1.6 61.2 ±1.6 30.5 ±1.5 31.7 ±0.9 51.3 ±2.1 27.3 ±0.8 62.1 ±1.4 78.1 ±1.7 26.5 ±0.6 21.0 ±0.5 26.7 ±0.0 31.4 ±3.9 65.8 ±1.2 65.1 ±1.6 66.4 ±1.3 47.4 ±0.0 58.6 ±2.3 67.1 ±0.8 65.1 ±1.6 65.4 ±1.0 66.3 ±0.5 68.7 ±0.9 63.2 ±0.7 63.6 ±1.3 52.5 ±2.1 62.5 ±0.5 56.5 ±0.8 62.8 ±0.0 64.7 ±1.6 36.5 ±2.5 35.0 ±3.2 42.8 ±1.1 0.0 ±0.0 36.0 ±1.8 43.6 ±0.8 35.0 ±3.2 42.0 ±1.0 42.8 ±0.5 42.8 ±2.1 39.8 ±0.6 31.9 ±2.6 10.0 ±4.1 39.3 ±0.4 33.1 ±0.5 39.2 ±0.0 40.7 ±1.3 62.2 ±1.3 61.5 ±1.6 74.3 ±1.5 50.0 ±0.0 75.5 ±0.4 74.7 ±0.4 61.5 ±1.6 75.4 ±0.3 75.3 ±0.2 66.7 ±1.6 76.1 ±0.2 59.9 ±1.1 52.7 ±1.2 76.6 ±0.2 73.1 ±0.0 75.9 ±0.0 73.8 ±1.6 62.4 ±1.4 61.7 ±1.7 74.4 ±1.5 50.0 ±0.0 75.6 ±0.4 74.7 ±0.5 61.7 ±1.7 75.6 ±0.4 75.4 ±0.3 66.8 ±1.6 76.2 ±0.2 60.2 ±1.1 52.7 ±1.2 76.7 ±0.2 73.1 ±0.0 75.9 ±0.0 73.9 ±1.6 85.2 ±0.1 85.4 ±0.0 85.1 ±0.1 71.6 ±0.4 84.9 ±0.1 85.1 ±0.0 85.4 ±0.0 85.1 ±0.0 85.2 ±0.1 85.2 ±0.1 85.0 ±0.0 85.3 ±0.1 84.9 ±0.1 85.4 ±0.0 81.0 ±0.0 84.3 ±0.0 84.3 ±0.0 2.2 ±0.1 2.0 ±0.8 13.8 ±3.2 40.2 ±0.0 27.5 ±3.9 12.5 ±1.2 2.0 ±0.8 17.4 ±1.9 15.9 ±0.7 3.7 ±0.7 20.6 ±1.3 8.1 ±0.7 28.9 ±1.0 23.5 ±1.1 38.4 ±0.1 23.0 ±0.1 26.5 ±2.4 E.2.10. CXRMULTISITE Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 98.3 ±0.0 98.3 ±0.0 90.2 ±0.1 98.3 ±0.0 94.1 ±0.9 9.9 ±6.7 98.3 ±0.0 88.3 ±1.6 89.5 ±0.0 94.5 ±0.4 1.7 ±0.0 98.3 ±0.0 98.3 ±0.0 89.1 ±0.2 89.7 ±0.1 90.4 ±0.1 89.9 ±0.1 E.2.11. CHEXPERT 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 5.4 ±4.4 0.0 ±0.0 0.1 ±0.1 0.3 ±0.1 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.5 ±0.1 0.6 ±0.1 1.1 ±0.5 1.4 ±0.6 49.2 ±0.0 49.2 ±0.0 56.7 ±0.1 61.2 ±4.9 59.0 ±0.7 17.4 ±13.5 49.2 ±0.0 55.9 ±0.6 56.4 ±0.0 59.4 ±0.2 0.8 ±0.0 55.4 ±5.1 49.2 ±0.0 56.2 ±0.1 56.5 ±0.0 56.9 ±0.0 56.6 ±0.0 0.0 ±0.0 0.0 ±0.0 13.6 ±0.1 24.0 ±9.8 18.5 ±1.4 0.6 ±0.5 0.0 ±0.0 12.0 ±1.2 13.0 ±0.0 19.3 ±0.6 0.0 ±0.0 12.5 ±10.2 0.0 ±0.0 12.5 ±0.2 13.2 ±0.1 13.9 ±0.1 13.4 ±0.1 49.6 ±0.0 49.6 ±0.0 59.2 ±0.1 50.7 ±0.7 62.9 ±0.8 8.5 ±5.6 49.6 ±0.0 57.3 ±1.4 58.5 ±0.0 63.7 ±0.3 1.7 ±0.0 49.7 ±0.1 49.6 ±0.0 58.1 ±0.2 58.7 ±0.1 59.5 ±0.1 59.0 ±0.1 0.0 ±0.0 0.0 ±0.0 23.7 ±0.2 2.2 ±1.5 28.9 ±1.2 1.2 ±1.0 0.0 ±0.0 20.9 ±1.8 22.7 ±0.0 30.2 ±0.4 0.0 ±0.0 0.3 ±0.2 0.0 ±0.0 22.0 ±0.3 23.0 ±0.1 24.2 ±0.1 23.3 ±0.1 50.0 ±0.0 50.0 ±0.0 50.2 ±0.1 50.2 ±0.2 55.2 ±0.9 50.5 ±0.4 50.0 ±0.0 50.3 ±0.5 50.5 ±0.2 56.3 ±0.1 50.0 ±0.0 50.0 ±0.0 50.0 ±0.0 50.4 ±0.0 50.4 ±0.0 51.2 ±0.1 51.1 ±0.3 50.0 ±0.0 50.0 ±0.0 90.4 ±0.0 50.6 ±0.4 82.2 ±2.4 51.7 ±1.4 50.0 ±0.0 88.1 ±0.7 90.3 ±0.0 82.3 ±1.6 50.0 ±0.0 50.1 ±0.1 50.0 ±0.0 90.0 ±0.1 90.4 ±0.0 90.2 ±0.1 90.4 ±0.0 93.1 ±0.1 92.9 ±0.1 92.8 ±0.2 93.0 ±0.0 93.2 ±0.1 60.6 ±1.6 92.9 ±0.1 92.3 ±0.1 93.2 ±0.1 93.3 ±0.0 62.7 ±1.5 93.2 ±0.0 93.1 ±0.1 92.9 ±0.1 92.8 ±0.1 93.3 ±0.0 93.1 ±0.1 0.3 ±0.1 0.3 ±0.0 13.5 ±0.7 0.9 ±0.3 6.4 ±0.5 82.6 ±12.8 0.3 ±0.0 13.0 ±2.8 17.7 ±1.7 6.0 ±0.2 98.3 ±0.0 11.5 ±0.6 0.3 ±0.1 19.9 ±1.3 47.3 ±0.1 15.7 ±0.9 15.5 ±0.7 Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 88.6 ±0.7 81.9 ±6.2 79.0 ±0.3 73.7 ±1.0 75.2 ±0.8 22.3 ±10.2 81.9 ±6.2 77.6 ±0.4 79.2 ±0.5 83.5 ±0.3 80.0 ±0.5 89.3 ±0.3 90.1 ±0.0 79.5 ±0.2 78.9 ±0.2 79.1 ±0.1 79.0 ±0.0 41.7 ±3.4 37.4 ±3.5 75.1 ±0.6 50.2 ±1.8 60.4 ±4.8 13.7 ±9.8 37.4 ±3.5 73.0 ±0.6 73.8 ±1.0 68.5 ±1.6 74.0 ±0.7 42.1 ±4.0 34.5 ±1.5 74.2 ±1.1 75.4 ±0.6 74.0 ±0.2 73.9 ±0.2 68.3 ±1.1 63.5 ±5.0 62.9 ±0.1 57.3 ±0.1 59.4 ±1.1 37.3 ±5.8 63.5 ±5.0 62.3 ±0.1 62.9 ±0.3 65.0 ±0.2 63.3 ±0.2 69.6 ±0.4 70.6 ±0.1 63.2 ±0.1 62.9 ±0.1 62.9 ±0.0 62.9 ±0.0 42.3 ±2.4 33.9 ±9.3 28.5 ±0.3 20.1 ±0.3 23.0 ±1.5 9.0 ±0.7 33.9 ±9.3 27.2 ±0.3 28.6 ±0.5 33.3 ±0.4 29.4 ±0.5 44.7 ±1.1 47.6 ±0.1 29.0 ±0.2 28.5 ±0.1 28.6 ±0.1 28.5 ±0.0 68.7 ±0.2 62.5 ±5.9 64.6 ±0.2 56.8 ±0.4 59.6 ±1.4 19.5 ±8.3 62.5 ±5.9 63.4 ±0.3 64.6 ±0.4 67.9 ±0.2 65.2 ±0.4 69.8 ±0.4 68.6 ±0.3 65.0 ±0.2 64.5 ±0.1 64.6 ±0.1 64.5 ±0.0 43.8 ±0.7 35.7 ±7.6 42.0 ±0.3 29.9 ±0.2 34.4 ±2.3 8.8 ±3.9 35.7 ±7.6 40.6 ±0.3 42.0 ±0.5 45.5 ±0.3 42.6 ±0.5 45.5 ±1.0 42.5 ±0.7 42.5 ±0.2 42.0 ±0.1 42.0 ±0.1 41.9 ±0.0 69.5 ±1.3 63.8 ±4.7 78.6 ±0.0 65.7 ±0.6 70.7 ±2.6 46.2 ±2.9 63.8 ±4.7 78.0 ±0.3 78.5 ±0.3 77.8 ±0.4 78.6 ±0.2 70.4 ±1.1 66.8 ±0.5 78.7 ±0.2 78.9 ±0.1 78.7 ±0.1 78.8 ±0.1 70.0 ±1.5 64.1 ±4.6 79.3 ±0.1 67.0 ±0.4 72.0 ±2.5 46.2 ±3.1 64.1 ±4.6 78.7 ±0.3 79.0 ±0.2 78.5 ±0.3 79.0 ±0.2 70.4 ±1.3 67.0 ±0.5 79.6 ±0.1 79.3 ±0.0 79.1 ±0.1 79.2 ±0.1 85.4 ±0.4 76.1 ±8.5 86.3 ±0.1 72.9 ±0.4 79.0 ±2.5 30.5 ±10.1 76.1 ±8.5 85.9 ±0.4 86.2 ±0.1 86.3 ±0.3 86.1 ±0.3 86.5 ±0.1 85.5 ±0.3 86.6 ±0.1 86.0 ±0.1 86.2 ±0.0 86.3 ±0.1 5.0 ±1.1 16.1 ±9.0 22.0 ±0.4 40.4 ±0.0 24.4 ±0.5 65.7 ±10.2 16.1 ±9.0 19.1 ±1.0 20.6 ±0.4 15.6 ±1.1 19.6 ±0.6 16.1 ±1.7 31.7 ±0.4 21.9 ±0.2 26.2 ±0.5 21.9 ±0.1 22.3 ±0.1 E.2.12. LIVING17 34 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 E.2.13. OVERALL 5.7 ±1.5 8.7 ±1.4 6.0 ±1.4 4.0 ±0.5 5.7 ±2.2 7.0 ±1.2 8.7 ±1.4 6.7 ±1.5 5.7 ±1.5 5.7 ±1.5 5.7 ±1.5 5.3 ±0.3 4.0 ±0.8 6.7 ±0.7 6.0 ±0.9 6.3 ±0.3 9.3 ±0.3 28.2 ±1.0 30.9 ±2.2 32.1 ±0.9 29.2 ±1.7 31.1 ±0.9 28.3 ±0.8 30.9 ±2.2 33.0 ±0.6 28.2 ±1.0 28.2 ±1.0 28.2 ±1.0 28.8 ±1.0 28.0 ±1.2 30.7 ±1.0 27.4 ±0.3 31.8 ±0.0 33.4 ±0.1 8.2 ±1.6 9.5 ±1.3 9.6 ±0.2 5.1 ±0.8 8.0 ±1.7 9.6 ±1.8 9.5 ±1.3 11.0 ±0.6 8.2 ±1.6 8.2 ±1.6 8.2 ±1.6 7.1 ±1.0 6.6 ±1.4 8.2 ±0.8 8.6 ±0.8 7.5 ±0.3 11.3 ±0.3 27.1 ±1.1 29.3 ±1.9 30.8 ±0.7 26.5 ±1.5 28.3 ±1.3 26.1 ±1.2 29.3 ±1.9 31.0 ±0.6 27.1 ±1.1 27.1 ±1.1 27.1 ±1.1 27.0 ±0.7 24.0 ±0.8 28.3 ±1.3 25.7 ±0.2 30.5 ±0.1 32.6 ±0.0 6.9 ±1.7 9.7 ±1.5 7.6 ±0.8 4.8 ±0.6 7.2 ±2.3 8.7 ±1.7 9.7 ±1.5 8.3 ±1.2 6.9 ±1.7 6.9 ±1.7 6.9 ±1.7 6.3 ±0.5 5.1 ±0.3 7.3 ±0.5 7.5 ±1.1 6.8 ±0.3 10.8 ±0.2 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 77.3 ±1.3 78.2 ±1.2 80.1 ±0.8 81.0 ±0.2 81.0 ±0.8 76.6 ±0.6 78.2 ±1.2 81.0 ±0.7 77.3 ±1.3 77.3 ±1.3 77.3 ±1.3 78.7 ±0.5 79.1 ±1.0 78.0 ±1.0 79.4 ±0.1 80.3 ±0.1 82.0 ±0.0 59.6 ±0.5 34.1 ±1.9 53.5 ±0.8 28.8 ±6.8 36.9 ±3.2 61.0 ±0.7 34.1 ±1.9 46.6 ±3.1 59.6 ±0.5 59.6 ±0.5 59.6 ±0.5 49.9 ±1.9 12.4 ±0.5 56.5 ±1.7 13.8 ±0.4 49.6 ±1.7 40.0 ±0.4 Algorithm Waterbirds CelebA CivilComments MultiNLI MetaShift ImageNetBG NICO++ MIMIC-CXR MIMICNotes CXRMultisite CheXpert Living17 Avg ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 69.1 ±4.7 78.2 ±0.4 73.1 ±0.4 75.5 ±2.2 71.0 ±0.5 74.7 ±1.0 78.2 ±0.4 70.0 ±1.0 72.5 ±0.3 71.3 ±1.4 74.4 ±1.2 71.6 ±0.8 71.0 ±1.8 74.1 ±0.9 89.0 ±0.2 76.3 ±0.8 76.3 ±0.2 57.6 ±0.8 57.8 ±0.8 78.5 ±1.1 62.2 ±3.1 66.0 ±11.9 53.0 ±4.3 57.8 ±0.8 82.2 ±1.2 81.5 ±0.9 72.0 ±2.2 75.0 ±2.4 59.1 ±2.0 59.3 ±2.3 83.3 ±0.5 86.3 ±0.3 70.4 ±0.4 71.1 ±0.5 63.2 ±1.2 66.1 ±1.3 69.5 ±0.7 68.7 ±1.3 64.3 ±1.5 50.3 ±5.9 66.1 ±1.3 68.2 ±0.7 69.9 ±0.6 70.1 ±0.3 67.0 ±0.1 61.9 ±1.1 37.0 ±7.9 69.4 ±1.2 66.5 ±0.2 68.5 ±0.0 68.2 ±0.4 69.5 ±0.3 68.5 ±0.6 69.3 ±1.5 63.0 ±1.5 68.4 ±0.6 63.6 ±2.9 68.5 ±0.6 67.5 ±0.4 67.8 ±1.2 66.6 ±0.4 66.2 ±0.7 69.3 ±0.8 69.6 ±1.6 66.9 ±0.4 63.8 ±0.0 65.4 ±0.1 65.3 ±0.1 82.1 ±0.8 79.0 ±0.8 82.6 ±1.1 82.6 ±1.1 82.6 ±0.4 72.6 ±1.2 79.0 ±0.8 80.5 ±1.5 83.1 ±0.7 82.1 ±0.8 82.6 ±0.4 81.0 ±0.4 83.6 ±0.4 82.6 ±0.4 81.5 ±0.0 83.1 ±0.0 85.1 ±0.4 76.8 ±0.9 76.9 ±0.7 76.4 ±0.2 74.8 ±0.8 77.0 ±0.4 70.1 ±1.4 76.9 ±0.7 77.7 ±1.1 76.8 ±0.9 76.8 ±0.9 76.8 ±0.9 71.9 ±1.2 76.7 ±0.5 76.1 ±2.0 74.4 ±1.8 78.2 ±0.5 77.5 ±0.7 40.0 ±0.0 30.0 ±4.1 31.1 ±0.9 31.7 ±3.6 32.2 ±0.9 28.3 ±1.7 30.0 ±4.1 23.3 ±1.4 25.0 ±0.0 35.6 ±1.8 34.4 ±2.4 29.4 ±2.0 26.7 ±1.4 29.4 ±2.0 39.3 ±2.4 33.3 ±0.0 33.3 ±0.0 68.5 ±0.4 67.2 ±1.1 67.4 ±0.9 67.5 ±0.1 66.6 ±0.8 62.1 ±2.4 67.2 ±1.1 68.9 ±0.3 67.4 ±0.3 68.9 ±0.5 67.8 ±0.6 67.3 ±1.2 68.2 ±1.4 67.2 ±0.2 67.1 ±0.4 69.1 ±0.2 68.9 ±0.0 80.4 ±0.2 81.6 ±0.6 83.7 ±0.0 65.6 ±1.5 83.8 ±0.1 84.1 ±0.0 81.6 ±0.6 82.4 ±0.5 84.0 ±0.1 83.1 ±0.2 83.9 ±0.1 70.3 ±9.6 81.0 ±0.3 83.7 ±0.3 80.2 ±0.0 83.4 ±0.0 83.4 ±0.0 50.1 ±0.9 50.1 ±0.9 49.2 ±0.5 50.2 ±0.9 50.1 ±0.9 50.1 ±0.9 50.1 ±0.9 47.8 ±2.5 51.9 ±2.3 50.2 ±0.9 50.2 ±0.9 50.0 ±0.9 50.1 ±0.9 50.1 ±1.1 56.1 ±3.5 56.5 ±3.5 55.4 ±4.9 41.7 ±3.4 37.4 ±3.5 75.1 ±0.6 50.2 ±1.8 60.4 ±4.8 13.7 ±9.8 37.4 ±3.5 73.0 ±0.6 73.8 ±1.0 68.5 ±1.6 74.0 ±0.7 42.1 ±4.0 34.5 ±1.5 74.2 ±1.1 75.4 ±0.6 74.0 ±0.2 73.9 ±0.2 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 60.5 60.2 65.6 59.9 62.6 54.1 60.2 64.4 65.1 64.4 65.0 58.4 56.8 65.5 67.2 65.8 66.0 E.3. Attributes Unknown in Both Training & Validation E.3.1. WATERBIRDS Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 84.1 ±1.7 89.2 ±0.6 86.9 ±0.9 89.9 ±0.4 88.9 ±0.6 86.6 ±0.5 89.2 ±0.6 86.2 ±0.5 86.2 ±0.6 89.4 ±0.4 86.8 ±0.6 89.3 ±0.2 87.9 ±0.2 88.4 ±1.2 92.2 ±0.2 89.2 ±0.1 89.4 ±0.3 69.1 ±4.7 77.5 ±0.7 73.1 ±0.4 75.5 ±2.2 71.2 ±0.5 75.0 ±0.7 77.5 ±0.7 70.0 ±1.0 71.9 ±0.6 71.0 ±1.4 74.4 ±1.2 71.6 ±0.8 70.9 ±1.7 74.1 ±0.9 89.0 ±0.2 76.3 ±0.8 76.3 ±0.2 77.4 ±2.0 83.5 ±0.8 80.7 ±1.1 84.5 ±0.7 83.2 ±0.8 80.3 ±0.6 83.5 ±0.8 79.8 ±0.6 79.9 ±0.7 83.9 ±0.6 80.4 ±0.7 83.7 ±0.3 81.9 ±0.3 82.6 ±1.6 87.6 ±0.3 83.5 ±0.1 83.8 ±0.3 60.7 ±3.2 70.6 ±1.9 66.1 ±2.2 73.2 ±1.7 71.4 ±1.6 65.1 ±1.1 70.6 ±1.9 64.9 ±1.4 64.3 ±1.6 72.8 ±0.9 65.5 ±1.3 72.4 ±0.5 69.1 ±0.8 69.9 ±2.9 78.3 ±0.6 71.3 ±0.4 71.9 ±0.7 E.3.2. CELEBA 79.4 ±2.1 85.6 ±0.7 82.8 ±0.9 86.2 ±0.3 84.7 ±0.6 82.5 ±0.5 85.6 ±0.7 81.7 ±0.5 82.1 ±0.6 85.3 ±0.6 82.6 ±0.7 85.2 ±0.3 83.6 ±0.1 84.4 ±1.5 89.2 ±0.2 85.3 ±0.1 85.6 ±0.3 35 69.5 ±2.9 78.4 ±0.9 74.4 ±1.2 79.0 ±0.4 76.8 ±0.8 74.0 ±0.7 78.4 ±0.9 72.7 ±0.7 73.5 ±0.7 77.7 ±0.9 74.0 ±1.0 77.5 ±0.4 75.2 ±0.1 76.4 ±2.0 83.5 ±0.4 77.8 ±0.1 78.1 ±0.4 83.1 ±2.0 88.9 ±0.2 86.3 ±0.5 88.5 ±0.3 86.8 ±0.2 86.3 ±0.3 88.9 ±0.2 85.0 ±0.2 86.2 ±0.1 87.2 ±0.6 86.2 ±0.6 87.1 ±0.3 86.0 ±0.2 87.0 ±1.0 91.2 ±0.1 87.9 ±0.1 88.0 ±0.2 83.1 ±2.0 88.9 ±0.2 86.3 ±0.5 88.5 ±0.3 86.8 ±0.2 86.3 ±0.3 88.9 ±0.2 85.0 ±0.2 86.2 ±0.1 87.2 ±0.6 86.2 ±0.6 87.1 ±0.3 86.0 ±0.2 87.0 ±1.0 91.2 ±0.1 87.9 ±0.1 88.0 ±0.2 91.0 ±1.4 94.9 ±0.1 94.0 ±0.3 95.4 ±0.2 94.2 ±0.1 93.4 ±0.2 94.9 ±0.1 92.8 ±0.1 94.0 ±0.1 94.4 ±0.5 93.5 ±0.4 94.2 ±0.2 93.5 ±0.1 94.0 ±0.9 96.8 ±0.0 94.8 ±0.0 94.9 ±0.1 12.9 ±1.7 8.0 ±1.1 10.5 ±0.8 8.3 ±0.2 9.2 ±0.3 10.0 ±0.8 8.0 ±1.1 11.3 ±0.3 10.8 ±0.4 9.0 ±0.5 11.3 ±0.4 6.9 ±0.1 11.8 ±1.7 9.9 ±1.2 6.9 ±0.4 9.2 ±0.2 8.8 ±0.2 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 95.0 ±0.1 95.4 ±0.1 94.4 ±0.0 95.1 ±0.1 95.9 ±0.0 81.1 ±5.6 95.4 ±0.1 94.1 ±0.1 94.1 ±0.1 94.0 ±0.2 94.4 ±0.0 94.9 ±0.3 94.7 ±0.3 94.5 ±0.1 93.6 ±0.0 94.1 ±0.1 94.2 ±0.1 57.6 ±0.8 57.8 ±0.8 68.3 ±0.9 60.2 ±3.0 48.3 ±1.5 53.0 ±4.3 57.8 ±0.8 74.1 ±2.2 69.6 ±0.2 66.9 ±2.2 65.4 ±1.4 56.9 ±3.4 57.0 ±4.1 69.6 ±1.2 73.7 ±0.8 69.6 ±0.7 70.7 ±0.6 87.4 ±0.2 88.4 ±0.3 85.8 ±0.1 87.7 ±0.3 90.5 ±0.1 71.8 ±4.1 88.4 ±0.3 85.0 ±0.1 85.1 ±0.1 85.0 ±0.4 85.9 ±0.1 87.4 ±0.7 86.7 ±0.9 85.9 ±0.2 84.1 ±0.1 85.1 ±0.3 85.4 ±0.1 76.3 ±0.3 78.5 ±0.7 72.7 ±0.1 76.9 ±0.6 82.9 ±0.3 45.2 ±8.3 78.5 ±0.7 71.1 ±0.2 71.2 ±0.2 71.0 ±0.9 72.9 ±0.2 76.4 ±1.5 74.8 ±2.0 72.9 ±0.4 69.4 ±0.2 71.4 ±0.5 71.9 ±0.3 89.9 ±0.1 90.6 ±0.2 89.2 ±0.1 90.1 ±0.1 91.4 ±0.1 73.2 ±5.6 90.6 ±0.2 88.6 ±0.1 88.7 ±0.1 88.6 ±0.3 89.2 ±0.1 89.7 ±0.4 89.5 ±0.5 89.4 ±0.2 87.8 ±0.1 88.6 ±0.2 88.8 ±0.1 82.7 ±0.2 83.8 ±0.3 81.7 ±0.1 83.1 ±0.2 85.2 ±0.1 59.0 ±7.3 83.8 ±0.3 80.7 ±0.2 81.0 ±0.2 80.7 ±0.4 81.7 ±0.1 82.4 ±0.7 82.1 ±0.8 82.0 ±0.3 79.4 ±0.1 80.7 ±0.3 81.1 ±0.2 85.6 ±0.2 85.8 ±0.2 88.4 ±0.2 86.3 ±0.7 83.4 ±0.4 78.3 ±3.0 85.8 ±0.2 89.5 ±0.5 88.6 ±0.0 87.9 ±0.5 87.6 ±0.3 85.2 ±0.8 85.5 ±0.9 88.8 ±0.3 89.0 ±0.2 88.4 ±0.1 88.7 ±0.1 93.0 ±0.0 93.1 ±0.1 93.9 ±0.1 93.1 ±0.1 92.4 ±0.2 85.3 ±2.9 93.1 ±0.1 93.8 ±0.1 94.0 ±0.1 93.9 ±0.1 93.8 ±0.1 92.6 ±0.3 93.2 ±0.2 94.2 ±0.1 93.2 ±0.0 93.6 ±0.0 93.6 ±0.0 98.4 ±0.0 98.4 ±0.1 98.6 ±0.0 98.4 ±0.0 98.6 ±0.0 94.1 ±1.2 98.4 ±0.1 98.4 ±0.0 98.5 ±0.0 98.4 ±0.0 98.5 ±0.0 98.3 ±0.1 98.4 ±0.0 98.6 ±0.0 98.2 ±0.0 98.4 ±0.0 98.4 ±0.0 2.9 ±0.1 2.5 ±0.2 4.1 ±0.0 3.1 ±0.1 1.3 ±0.1 27.9 ±5.5 2.5 ±0.2 4.8 ±0.1 4.6 ±0.0 4.8 ±0.2 4.4 ±0.1 3.1 ±0.4 30.7 ±0.5 4.6 ±0.0 14.8 ±0.5 4.6 ±0.2 4.7 ±0.1 E.3.3. CIVILCOMMENTS Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 85.4 ±0.2 84.6 ±0.1 81.2 ±0.3 81.6 ±0.7 79.0 ±1.8 69.1 ±4.3 84.6 ±0.1 80.4 ±0.2 80.6 ±0.3 82.9 ±0.5 84.0 ±0.8 85.6 ±0.3 80.2 ±2.1 80.3 ±0.2 80.7 ±0.0 82.7 ±0.1 82.4 ±0.0 63.2 ±1.2 65.8 ±1.5 61.5 ±1.8 62.9 ±3.8 51.0 ±4.2 42.2 ±7.2 65.8 ±1.5 61.0 ±0.6 59.3 ±1.1 68.6 ±1.1 67.3 ±0.2 61.9 ±1.1 28.4 ±7.7 58.3 ±1.1 64.4 ±0.1 67.8 ±0.3 64.7 ±0.2 75.4 ±0.3 74.4 ±0.2 71.9 ±0.2 72.1 ±0.5 69.7 ±1.3 62.6 ±3.2 74.4 ±0.2 71.2 ±0.1 71.5 ±0.2 73.0 ±0.4 74.0 ±0.7 75.6 ±0.4 67.8 ±3.3 71.3 ±0.1 70.9 ±0.0 72.8 ±0.1 72.6 ±0.0 57.6 ±0.7 55.3 ±0.3 48.6 ±0.5 49.3 ±1.2 45.5 ±2.8 33.9 ±4.5 55.3 ±0.3 47.2 ±0.2 47.6 ±0.5 51.7 ±0.9 54.1 ±1.8 58.5 ±0.9 46.2 ±5.6 47.2 ±0.3 47.6 ±0.1 51.1 ±0.2 50.5 ±0.1 77.0 ±0.1 76.4 ±0.1 74.2 ±0.3 74.4 ±0.6 71.4 ±1.6 62.0 ±4.3 76.4 ±0.1 73.4 ±0.1 73.7 ±0.2 75.4 ±0.4 76.2 ±0.6 77.0 ±0.3 68.3 ±3.1 73.5 ±0.2 73.1 ±0.0 75.2 ±0.1 75.0 ±0.0 63.2 ±0.1 62.6 ±0.2 60.9 ±0.3 60.9 ±0.6 56.6 ±1.8 45.7 ±5.2 62.6 ±0.2 59.8 ±0.2 60.3 ±0.2 61.8 ±0.4 62.5 ±0.5 62.9 ±0.5 48.9 ±5.0 60.0 ±0.1 58.7 ±0.0 61.6 ±0.1 61.4 ±0.0 77.7 ±0.1 78.0 ±0.2 78.9 ±0.1 78.4 ±0.4 75.0 ±0.8 67.2 ±4.0 78.0 ±0.2 78.3 ±0.1 78.7 ±0.1 78.6 ±0.2 78.5 ±0.2 77.3 ±0.3 66.1 ±3.6 78.4 ±0.1 76.8 ±0.0 78.7 ±0.0 78.4 ±0.0 79.4 ±0.2 79.7 ±0.0 81.3 ±0.1 80.8 ±0.1 77.7 ±0.8 69.7 ±4.7 79.7 ±0.0 80.7 ±0.1 81.3 ±0.0 80.6 ±0.2 80.3 ±0.3 78.7 ±0.3 69.5 ±3.2 81.1 ±0.1 79.0 ±0.0 80.7 ±0.0 80.7 ±0.0 89.8 ±0.1 89.7 ±0.1 89.8 ±0.1 89.6 ±0.1 86.5 ±1.0 75.0 ±6.6 89.7 ±0.1 89.3 ±0.1 89.9 ±0.1 89.8 ±0.1 90.0 ±0.0 89.4 ±0.4 77.4 ±4.0 89.8 ±0.1 86.9 ±0.0 89.5 ±0.1 89.5 ±0.0 7.8 ±0.4 9.3 ±0.4 15.7 ±0.6 31.9 ±0.1 14.0 ±1.6 27.9 ±1.6 9.3 ±0.4 17.0 ±0.6 14.9 ±0.5 10.9 ±0.7 9.5 ±1.4 7.7 ±0.4 20.7 ±0.5 16.5 ±0.8 20.4 ±0.1 13.0 ±0.1 12.6 ±0.1 E.3.4. MULTINLI Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 81.0 ±0.3 81.7 ±0.1 81.1 ±0.2 75.4 ±0.2 81.4 ±0.0 71.4 ±1.6 81.7 ±0.1 81.5 ±0.0 79.4 ±0.2 80.6 ±0.2 80.6 ±0.3 80.9 ±0.2 80.9 ±0.1 80.6 ±0.2 80.2 ±0.0 80.2 ±0.0 80.2 ±0.0 E.3.5. METASHIFT 66.4 ±2.3 66.8 ±0.3 64.1 ±0.8 48.2 ±3.4 65.1 ±1.6 57.3 ±5.7 66.8 ±0.3 66.8 ±0.5 64.2 ±1.9 63.8 ±2.4 63.6 ±2.4 62.4 ±2.0 65.5 ±0.8 63.6 ±2.4 63.8 ±0.0 65.4 ±0.2 65.2 ±0.2 81.3 ±0.3 81.9 ±0.1 81.3 ±0.2 75.8 ±0.3 81.7 ±0.0 71.5 ±1.7 81.9 ±0.1 81.9 ±0.1 79.6 ±0.2 80.8 ±0.2 80.8 ±0.2 81.2 ±0.2 81.1 ±0.1 80.8 ±0.2 80.3 ±0.0 80.3 ±0.0 80.3 ±0.0 74.2 ±0.4 75.8 ±0.1 74.8 ±0.1 68.9 ±0.1 75.0 ±0.1 67.1 ±2.0 75.8 ±0.1 74.2 ±0.2 72.9 ±0.3 75.1 ±0.2 75.1 ±0.3 74.3 ±0.1 74.6 ±0.3 75.1 ±0.2 75.2 ±0.0 74.3 ±0.0 74.4 ±0.0 81.1 ±0.3 81.8 ±0.1 81.1 ±0.2 75.5 ±0.3 81.5 ±0.0 71.4 ±1.7 81.8 ±0.1 81.6 ±0.0 79.4 ±0.2 80.6 ±0.2 80.6 ±0.3 81.0 ±0.2 80.9 ±0.1 80.7 ±0.2 80.3 ±0.0 80.2 ±0.0 80.2 ±0.0 77.6 ±0.2 78.3 ±0.1 77.9 ±0.1 72.0 ±0.1 77.8 ±0.1 68.4 ±2.7 78.3 ±0.1 78.0 ±0.1 75.8 ±0.1 77.5 ±0.2 77.5 ±0.2 77.4 ±0.2 77.4 ±0.0 77.6 ±0.2 76.2 ±0.0 76.4 ±0.0 76.4 ±0.0 79.4 ±0.8 80.1 ±0.2 79.4 ±0.2 72.3 ±0.8 79.8 ±0.3 69.3 ±2.9 80.1 ±0.2 79.9 ±0.1 78.0 ±0.2 78.8 ±0.5 78.7 ±0.5 78.7 ±0.3 79.2 ±0.2 78.7 ±0.5 78.5 ±0.0 78.6 ±0.0 78.6 ±0.0 81.0 ±0.3 81.7 ±0.1 81.1 ±0.2 75.4 ±0.2 81.4 ±0.0 71.4 ±1.6 81.7 ±0.1 81.5 ±0.0 79.4 ±0.2 80.6 ±0.2 80.6 ±0.3 80.9 ±0.2 80.9 ±0.1 80.6 ±0.2 80.2 ±0.0 80.2 ±0.0 80.2 ±0.0 93.6 ±0.1 93.7 ±0.0 93.7 ±0.1 87.3 ±0.2 93.9 ±0.0 86.6 ±1.4 93.7 ±0.0 93.9 ±0.0 92.6 ±0.1 93.5 ±0.1 93.5 ±0.1 93.7 ±0.1 93.5 ±0.0 93.5 ±0.1 92.9 ±0.0 92.8 ±0.0 92.9 ±0.0 11.1 ±0.6 10.9 ±0.2 9.1 ±0.9 41.8 ±0.2 9.4 ±0.4 6.2 ±0.5 10.9 ±0.2 12.2 ±0.6 14.2 ±0.6 7.8 ±0.2 7.8 ±0.2 5.3 ±0.8 33.2 ±0.4 7.8 ±0.2 5.8 ±0.0 14.9 ±0.1 14.7 ±0.1 36 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 91.2 ±0.4 91.4 ±0.1 91.5 ±0.3 91.2 ±1.0 91.2 ±0.1 80.4 ±0.4 91.4 ±0.1 92.2 ±0.3 91.5 ±0.4 91.3 ±0.1 91.4 ±0.1 91.6 ±0.2 91.6 ±0.1 91.3 ±0.3 90.2 ±0.2 91.5 ±0.0 91.3 ±0.1 82.1 ±0.8 79.0 ±0.8 83.1 ±0.7 83.5 ±0.5 82.6 ±0.4 72.3 ±1.3 79.0 ±0.8 81.0 ±1.7 83.1 ±0.7 82.6 ±0.4 83.1 ±0.0 81.0 ±0.4 83.6 ±0.4 82.6 ±0.4 81.4 ±0.1 83.1 ±0.0 85.1 ±0.4 91.1 ±0.4 91.4 ±0.1 91.4 ±0.3 91.2 ±1.0 91.1 ±0.1 80.7 ±0.3 91.4 ±0.1 92.1 ±0.3 91.5 ±0.4 91.2 ±0.1 91.3 ±0.1 91.7 ±0.2 91.6 ±0.0 91.3 ±0.3 90.2 ±0.2 91.4 ±0.0 91.2 ±0.1 90.4 ±0.5 90.6 ±0.4 90.1 ±0.6 89.4 ±1.8 90.6 ±0.2 76.9 ±1.7 90.6 ±0.4 91.4 ±0.4 90.6 ±0.3 90.3 ±0.2 90.4 ±0.4 90.9 ±0.6 90.9 ±0.3 89.9 ±0.3 88.1 ±0.5 90.6 ±0.1 90.1 ±0.3 91.1 ±0.4 91.4 ±0.1 91.4 ±0.3 91.1 ±1.0 91.1 ±0.1 80.4 ±0.4 91.4 ±0.1 92.2 ±0.3 91.5 ±0.4 91.2 ±0.1 91.4 ±0.1 91.6 ±0.2 91.6 ±0.1 91.3 ±0.3 90.2 ±0.2 91.4 ±0.0 91.2 ±0.1 90.6 ±0.4 90.9 ±0.1 91.0 ±0.3 90.7 ±0.9 90.6 ±0.1 79.7 ±0.4 90.9 ±0.1 91.7 ±0.3 91.0 ±0.4 90.7 ±0.2 90.9 ±0.2 91.1 ±0.2 91.1 ±0.1 90.9 ±0.3 89.8 ±0.2 90.9 ±0.0 90.8 ±0.1 89.1 ±0.5 88.5 ±0.2 89.4 ±0.5 89.2 ±1.0 89.2 ±0.1 80.5 ±0.6 88.5 ±0.2 89.6 ±0.1 89.5 ±0.4 89.2 ±0.2 89.4 ±0.1 89.4 ±0.2 89.9 ±0.1 89.2 ±0.3 88.0 ±0.2 89.5 ±0.0 89.7 ±0.2 91.1 ±0.4 91.4 ±0.1 91.5 ±0.3 91.2 ±0.9 91.1 ±0.1 80.6 ±0.3 91.4 ±0.1 92.2 ±0.2 91.5 ±0.4 91.3 ±0.1 91.4 ±0.2 91.6 ±0.2 91.6 ±0.1 91.4 ±0.3 90.3 ±0.2 91.4 ±0.0 91.3 ±0.1 97.4 ±0.1 97.3 ±0.0 97.6 ±0.1 97.5 ±0.2 97.6 ±0.0 91.5 ±0.1 97.3 ±0.0 97.5 ±0.1 97.5 ±0.1 97.5 ±0.1 97.4 ±0.1 97.6 ±0.0 97.5 ±0.1 97.5 ±0.1 96.7 ±0.0 97.3 ±0.0 96.8 ±0.1 6.1 ±0.7 1.9 ±0.4 5.5 ±1.0 13.0 ±5.9 7.2 ±0.2 8.5 ±1.1 1.9 ±0.4 6.8 ±0.4 5.8 ±0.6 5.6 ±1.0 6.3 ±0.4 4.9 ±1.2 9.5 ±1.0 5.7 ±0.8 3.2 ±0.2 6.8 ±0.0 8.1 ±0.1 E.3.6. IMAGENETBG Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 87.7 ±0.1 87.9 ±0.2 87.7 ±0.1 87.8 ±0.2 87.6 ±0.4 84.7 ±0.5 87.9 ±0.2 88.2 ±0.4 87.7 ±0.1 87.7 ±0.1 87.7 ±0.1 86.7 ±0.2 88.2 ±0.1 87.7 ±0.1 86.8 ±0.5 88.3 ±0.1 88.4 ±0.1 76.8 ±0.9 76.9 ±0.7 76.4 ±0.2 74.8 ±0.8 77.0 ±0.4 70.1 ±1.4 76.9 ±0.7 77.7 ±1.1 76.8 ±0.9 76.8 ±0.9 76.8 ±0.9 71.9 ±1.2 76.7 ±0.5 76.1 ±2.0 74.4 ±1.8 78.2 ±0.5 77.5 ±0.7 87.9 ±0.1 88.4 ±0.1 87.9 ±0.1 88.0 ±0.1 87.8 ±0.3 85.4 ±0.3 88.4 ±0.1 88.4 ±0.4 87.9 ±0.1 87.9 ±0.1 87.9 ±0.1 87.1 ±0.2 88.5 ±0.1 88.0 ±0.1 86.9 ±0.5 88.3 ±0.1 88.5 ±0.1 78.3 ±1.3 76.6 ±2.6 76.2 ±0.5 79.9 ±0.9 78.3 ±3.0 72.1 ±3.1 76.6 ±2.6 79.7 ±1.0 78.3 ±1.3 78.3 ±1.3 78.3 ±1.3 74.2 ±1.3 77.6 ±1.1 77.7 ±1.3 78.9 ±1.6 82.7 ±0.4 82.1 ±0.4 87.7 ±0.1 88.0 ±0.2 87.6 ±0.1 87.8 ±0.2 87.5 ±0.3 84.7 ±0.5 88.0 ±0.2 88.2 ±0.4 87.7 ±0.1 87.7 ±0.1 87.7 ±0.1 86.6 ±0.2 88.1 ±0.1 87.7 ±0.1 86.7 ±0.5 88.3 ±0.1 88.4 ±0.1 80.7 ±0.4 80.5 ±1.0 81.1 ±0.3 79.5 ±0.3 80.4 ±0.6 76.2 ±0.6 80.5 ±1.0 80.6 ±1.0 80.7 ±0.4 80.7 ±0.4 80.7 ±0.4 77.6 ±0.7 81.3 ±0.4 80.4 ±0.8 78.1 ±1.3 80.9 ±0.2 81.2 ±0.3 87.7 ±0.1 87.9 ±0.2 87.7 ±0.1 87.8 ±0.2 87.6 ±0.4 84.7 ±0.5 87.9 ±0.2 88.2 ±0.4 87.7 ±0.1 87.7 ±0.1 87.7 ±0.1 86.7 ±0.2 88.2 ±0.1 87.7 ±0.1 86.8 ±0.5 88.3 ±0.1 88.4 ±0.1 87.7 ±0.1 87.9 ±0.2 87.7 ±0.1 87.8 ±0.2 87.6 ±0.4 84.7 ±0.5 87.9 ±0.2 88.2 ±0.4 87.7 ±0.1 87.7 ±0.1 87.7 ±0.1 86.7 ±0.2 88.2 ±0.1 87.7 ±0.1 86.8 ±0.5 88.3 ±0.1 88.4 ±0.1 99.0 ±0.0 98.7 ±0.0 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 98.6 ±0.0 98.7 ±0.0 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 99.0 ±0.0 98.9 ±0.0 98.8 ±0.0 99.0 ±0.0 98.8 ±0.1 99.1 ±0.0 99.1 ±0.0 5.1 ±0.1 4.7 ±1.6 5.1 ±0.1 5.6 ±0.2 3.7 ±0.2 1.8 ±0.4 4.7 ±1.6 5.4 ±0.5 5.1 ±0.1 5.1 ±0.1 5.1 ±0.1 2.8 ±0.6 45.9 ±0.7 5.6 ±0.5 8.9 ±1.4 5.6 ±0.2 5.4 ±0.2 E.3.7. NICO++ Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 85.3 ±0.3 85.4 ±0.1 83.7 ±0.5 85.8 ±0.1 85.7 ±0.1 78.7 ±0.6 85.4 ±0.1 84.9 ±0.2 85.5 ±0.2 85.5 ±0.1 85.9 ±0.1 85.7 ±0.1 85.4 ±0.4 85.8 ±0.0 82.7 ±0.1 85.8 ±0.1 85.8 ±0.1 35.0 ±4.1 30.0 ±4.1 31.1 ±0.9 27.8 ±2.3 30.6 ±2.3 28.8 ±2.0 30.0 ±4.1 30.6 ±2.3 25.0 ±0.0 32.8 ±3.5 31.7 ±3.6 30.6 ±2.3 31.7 ±3.6 35.6 ±1.8 38.0 ±3.8 33.3 ±0.0 33.3 ±0.0 86.3 ±0.2 86.2 ±0.1 84.6 ±0.4 86.5 ±0.1 86.4 ±0.1 81.0 ±0.3 86.2 ±0.1 85.6 ±0.1 86.4 ±0.1 86.5 ±0.1 86.6 ±0.1 86.5 ±0.1 86.1 ±0.3 86.4 ±0.1 83.2 ±0.1 86.1 ±0.0 86.1 ±0.1 56.3 ±4.9 62.2 ±0.5 58.2 ±1.5 61.5 ±0.7 60.9 ±1.2 45.1 ±1.2 62.2 ±0.5 62.9 ±1.6 59.0 ±1.3 55.9 ±2.1 59.3 ±3.0 58.5 ±0.6 62.4 ±1.0 60.7 ±1.4 58.5 ±1.6 65.3 ±0.6 64.3 ±0.7 85.4 ±0.3 85.5 ±0.1 83.8 ±0.5 85.8 ±0.1 85.8 ±0.1 79.0 ±0.6 85.5 ±0.1 84.9 ±0.2 85.6 ±0.2 85.6 ±0.1 86.0 ±0.1 85.8 ±0.1 85.5 ±0.4 85.8 ±0.0 82.7 ±0.1 85.8 ±0.1 85.8 ±0.1 64.9 ±2.3 69.4 ±0.4 66.7 ±0.9 67.3 ±0.5 66.7 ±0.4 54.2 ±1.4 69.4 ±0.4 67.1 ±0.3 67.6 ±0.4 66.4 ±1.3 67.2 ±0.7 66.7 ±0.8 68.1 ±1.3 69.2 ±0.6 65.1 ±0.2 69.9 ±0.4 69.7 ±0.4 84.9 ±0.3 85.0 ±0.1 83.3 ±0.4 85.2 ±0.1 85.2 ±0.1 78.4 ±0.5 85.0 ±0.1 84.3 ±0.2 84.9 ±0.2 85.0 ±0.1 85.4 ±0.1 85.2 ±0.1 84.9 ±0.5 85.3 ±0.0 82.4 ±0.1 85.3 ±0.1 85.4 ±0.1 85.2 ±0.3 85.3 ±0.1 83.6 ±0.5 85.7 ±0.1 85.6 ±0.1 78.6 ±0.6 85.3 ±0.1 84.8 ±0.2 85.4 ±0.2 85.4 ±0.1 85.8 ±0.0 85.6 ±0.1 85.3 ±0.4 85.7 ±0.0 82.6 ±0.1 85.6 ±0.1 85.7 ±0.1 99.4 ±0.0 99.2 ±0.0 99.3 ±0.0 99.4 ±0.0 99.4 ±0.0 99.2 ±0.0 99.2 ±0.0 99.3 ±0.0 99.4 ±0.0 99.4 ±0.0 99.4 ±0.0 99.5 ±0.0 99.1 ±0.0 99.4 ±0.0 99.2 ±0.0 99.4 ±0.0 99.4 ±0.0 9.4 ±0.1 2.3 ±0.5 7.0 ±0.2 9.9 ±0.0 9.5 ±0.2 1.5 ±0.3 2.3 ±0.5 10.2 ±0.4 9.7 ±0.0 9.4 ±0.1 10.1 ±0.1 6.3 ±0.3 56.9 ±1.4 9.4 ±0.1 11.7 ±0.2 6.0 ±0.6 6.1 ±0.8 E.3.8. MIMIC-CXR 37 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 78.3 ±0.1 77.9 ±0.3 77.9 ±0.0 78.2 ±0.1 77.4 ±0.3 73.2 ±0.9 77.9 ±0.3 78.4 ±0.1 77.6 ±0.0 78.3 ±0.0 78.3 ±0.2 78.3 ±0.1 78.0 ±0.1 78.0 ±0.1 78.3 ±0.0 78.0 ±0.0 77.8 ±0.0 68.6 ±0.2 66.8 ±0.6 67.4 ±0.5 68.0 ±0.2 64.9 ±0.3 62.2 ±2.4 66.8 ±0.6 67.5 ±0.3 67.0 ±0.4 68.0 ±0.4 67.6 ±0.3 68.7 ±0.4 66.6 ±0.6 67.6 ±0.6 67.1 ±0.4 68.1 ±0.1 67.9 ±0.1 77.4 ±0.1 77.0 ±0.3 77.1 ±0.0 77.3 ±0.1 76.5 ±0.3 72.3 ±1.0 77.0 ±0.3 77.6 ±0.1 76.8 ±0.0 77.5 ±0.0 77.4 ±0.2 77.4 ±0.1 77.2 ±0.2 77.1 ±0.1 77.4 ±0.0 77.2 ±0.0 77.0 ±0.0 71.2 ±0.1 70.7 ±0.6 70.2 ±0.1 70.7 ±0.2 70.1 ±0.7 65.1 ±0.9 70.7 ±0.6 70.8 ±0.1 69.7 ±0.0 70.6 ±0.0 70.8 ±0.2 70.8 ±0.2 70.4 ±0.2 70.4 ±0.1 72.1 ±0.2 70.1 ±0.0 70.0 ±0.0 77.6 ±0.1 77.2 ±0.3 77.4 ±0.0 77.6 ±0.1 76.7 ±0.2 72.5 ±1.0 77.2 ±0.3 77.8 ±0.1 77.1 ±0.0 77.8 ±0.0 77.7 ±0.2 77.6 ±0.1 77.4 ±0.2 77.3 ±0.1 77.5 ±0.0 77.4 ±0.0 77.2 ±0.0 73.7 ±0.1 73.2 ±0.3 73.7 ±0.0 73.8 ±0.1 72.8 ±0.2 67.8 ±1.5 73.2 ±0.3 74.2 ±0.1 73.4 ±0.0 74.2 ±0.0 74.0 ±0.2 73.9 ±0.0 73.7 ±0.2 73.6 ±0.1 73.2 ±0.1 73.9 ±0.0 73.6 ±0.0 77.3 ±0.1 76.9 ±0.3 77.3 ±0.0 77.3 ±0.1 76.4 ±0.2 72.4 ±1.1 76.9 ±0.3 77.6 ±0.1 76.9 ±0.1 77.6 ±0.0 77.5 ±0.1 77.4 ±0.1 77.2 ±0.2 77.2 ±0.1 77.1 ±0.0 77.3 ±0.0 77.0 ±0.0 78.0 ±0.1 77.5 ±0.3 77.9 ±0.0 78.0 ±0.1 77.1 ±0.2 72.9 ±1.1 77.5 ±0.3 78.3 ±0.1 77.6 ±0.0 78.3 ±0.0 78.2 ±0.2 78.1 ±0.0 77.9 ±0.2 77.8 ±0.1 77.6 ±0.1 78.0 ±0.0 77.8 ±0.0 85.4 ±0.1 84.9 ±0.3 85.2 ±0.1 85.1 ±0.0 84.5 ±0.2 79.3 ±1.3 84.9 ±0.3 85.4 ±0.1 84.9 ±0.0 85.6 ±0.0 85.5 ±0.1 85.4 ±0.0 85.2 ±0.1 85.1 ±0.1 85.1 ±0.0 85.3 ±0.0 85.0 ±0.0 3.8 ±0.2 3.6 ±0.5 5.5 ±0.3 6.8 ±0.7 4.2 ±0.4 11.3 ±0.8 3.6 ±0.5 5.3 ±0.0 5.2 ±0.4 5.2 ±0.3 4.7 ±0.3 10.1 ±0.6 22.5 ±0.2 5.2 ±0.4 20.0 ±0.1 6.2 ±0.0 5.4 ±0.0 E.3.9. MIMICNOTES Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 91.1 ±0.1 91.1 ±0.0 83.2 ±2.4 90.2 ±0.0 71.3 ±3.7 84.0 ±1.2 91.1 ±0.0 81.4 ±1.5 82.7 ±0.7 90.3 ±0.2 78.2 ±1.0 91.0 ±0.0 90.6 ±0.1 76.9 ±0.9 69.2 ±1.3 77.8 ±0.0 81.2 ±2.8 24.2 ±2.8 22.7 ±3.2 62.6 ±6.3 0.0 ±0.0 65.9 ±2.8 62.7 ±2.1 22.7 ±3.2 67.1 ±2.6 65.5 ±1.3 35.7 ±4.0 72.3 ±1.3 19.1 ±2.3 5.3 ±2.4 73.1 ±1.0 67.3 ±1.7 73.1 ±0.0 63.9 ±7.6 76.4 ±0.9 76.8 ±0.7 64.7 ±1.4 45.1 ±0.0 60.3 ±0.7 64.6 ±0.7 76.8 ±0.7 63.3 ±0.6 63.8 ±0.4 72.4 ±0.9 61.9 ±0.3 77.1 ±0.6 84.4 ±0.8 61.7 ±0.2 58.8 ±0.2 61.6 ±0.0 63.6 ±1.6 60.3 ±2.1 61.2 ±1.6 33.7 ±3.4 0.0 ±0.0 23.4 ±1.9 33.6 ±1.6 61.2 ±1.6 30.5 ±1.5 31.7 ±0.9 51.3 ±2.1 27.3 ±0.8 62.1 ±1.4 78.1 ±1.7 26.5 ±0.6 21.0 ±0.5 26.7 ±0.0 31.4 ±3.9 65.8 ±1.2 65.1 ±1.6 66.4 ±1.3 47.4 ±0.0 58.6 ±2.3 67.1 ±0.8 65.1 ±1.6 65.4 ±1.0 66.3 ±0.5 68.7 ±0.9 63.2 ±0.7 63.6 ±1.3 52.5 ±2.1 62.5 ±0.5 56.5 ±0.8 62.8 ±0.0 64.7 ±1.6 36.5 ±2.5 35.0 ±3.2 42.8 ±1.1 0.0 ±0.0 36.0 ±1.8 43.6 ±0.8 35.0 ±3.2 42.0 ±1.0 42.8 ±0.5 42.8 ±2.1 39.8 ±0.6 31.9 ±2.6 10.0 ±4.1 39.3 ±0.4 33.1 ±0.5 39.2 ±0.0 40.7 ±1.3 62.2 ±1.3 61.5 ±1.6 74.3 ±1.5 50.0 ±0.0 75.5 ±0.4 74.7 ±0.4 61.5 ±1.6 75.4 ±0.3 75.3 ±0.2 66.7 ±1.6 76.1 ±0.2 59.9 ±1.1 52.7 ±1.2 76.6 ±0.2 73.1 ±0.0 75.9 ±0.0 73.8 ±1.6 62.4 ±1.4 61.7 ±1.7 74.4 ±1.5 50.0 ±0.0 75.6 ±0.4 74.7 ±0.5 61.7 ±1.7 75.6 ±0.4 75.4 ±0.3 66.8 ±1.6 76.2 ±0.2 60.2 ±1.1 52.7 ±1.2 76.7 ±0.2 73.1 ±0.0 75.9 ±0.0 73.9 ±1.6 85.2 ±0.1 85.4 ±0.0 85.1 ±0.1 71.6 ±0.4 84.9 ±0.1 85.1 ±0.0 85.4 ±0.0 85.1 ±0.0 85.2 ±0.1 85.2 ±0.1 85.0 ±0.0 85.3 ±0.1 84.9 ±0.1 85.4 ±0.0 81.0 ±0.0 84.3 ±0.0 84.3 ±0.0 2.2 ±0.1 2.0 ±0.8 13.8 ±3.2 40.2 ±0.0 27.5 ±3.9 12.5 ±1.2 2.0 ±0.8 17.4 ±1.9 15.9 ±0.7 3.7 ±0.7 20.6 ±1.3 8.1 ±0.7 28.9 ±1.0 23.5 ±1.1 38.4 ±0.1 23.0 ±0.1 26.5 ±2.4 E.3.10. CXRMULTISITE Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 98.3 ±0.0 98.3 ±0.0 90.2 ±0.1 98.3 ±0.0 94.1 ±0.9 9.9 ±6.7 98.3 ±0.0 88.3 ±1.6 89.5 ±0.0 94.5 ±0.4 1.7 ±0.0 98.3 ±0.0 98.3 ±0.0 89.1 ±0.2 89.7 ±0.1 90.4 ±0.1 89.9 ±0.1 E.3.11. CHEXPERT 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 5.4 ±4.4 0.0 ±0.0 0.1 ±0.1 0.3 ±0.1 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.0 ±0.0 0.5 ±0.1 0.6 ±0.1 1.1 ±0.5 1.4 ±0.6 49.2 ±0.0 49.2 ±0.0 56.7 ±0.1 61.2 ±4.9 59.0 ±0.7 17.4 ±13.5 49.2 ±0.0 55.9 ±0.6 56.4 ±0.0 59.4 ±0.2 0.8 ±0.0 55.4 ±5.1 49.2 ±0.0 56.2 ±0.1 56.5 ±0.0 56.9 ±0.0 56.6 ±0.0 0.0 ±0.0 0.0 ±0.0 13.6 ±0.1 24.0 ±9.8 18.5 ±1.4 0.6 ±0.5 0.0 ±0.0 12.0 ±1.2 13.0 ±0.0 19.3 ±0.6 0.0 ±0.0 12.5 ±10.2 0.0 ±0.0 12.5 ±0.2 13.2 ±0.1 13.9 ±0.1 13.4 ±0.1 49.6 ±0.0 49.6 ±0.0 59.2 ±0.1 50.7 ±0.7 62.9 ±0.8 8.5 ±5.6 49.6 ±0.0 57.3 ±1.4 58.5 ±0.0 63.7 ±0.3 1.7 ±0.0 49.7 ±0.1 49.6 ±0.0 58.1 ±0.2 58.7 ±0.1 59.5 ±0.1 59.0 ±0.1 0.0 ±0.0 0.0 ±0.0 23.7 ±0.2 2.2 ±1.5 28.9 ±1.2 1.2 ±1.0 0.0 ±0.0 20.9 ±1.8 22.7 ±0.0 30.2 ±0.4 0.0 ±0.0 0.3 ±0.2 0.0 ±0.0 22.0 ±0.3 23.0 ±0.1 24.2 ±0.1 23.3 ±0.1 50.0 ±0.0 50.0 ±0.0 50.2 ±0.1 50.2 ±0.2 55.2 ±0.9 50.5 ±0.4 50.0 ±0.0 50.3 ±0.5 50.5 ±0.2 56.3 ±0.1 50.0 ±0.0 50.0 ±0.0 50.0 ±0.0 50.4 ±0.0 50.4 ±0.0 51.2 ±0.1 51.1 ±0.3 50.0 ±0.0 50.0 ±0.0 90.4 ±0.0 50.6 ±0.4 82.2 ±2.4 51.7 ±1.4 50.0 ±0.0 88.1 ±0.7 90.3 ±0.0 82.3 ±1.6 50.0 ±0.0 50.1 ±0.1 50.0 ±0.0 90.0 ±0.1 90.4 ±0.0 90.2 ±0.1 90.4 ±0.0 93.1 ±0.1 92.9 ±0.1 92.8 ±0.2 93.0 ±0.0 93.2 ±0.1 60.6 ±1.6 92.9 ±0.1 92.3 ±0.1 93.2 ±0.1 93.3 ±0.0 62.7 ±1.5 93.2 ±0.0 93.1 ±0.1 92.9 ±0.1 92.8 ±0.1 93.3 ±0.0 93.1 ±0.1 0.3 ±0.1 0.3 ±0.0 13.5 ±0.7 0.9 ±0.3 6.4 ±0.5 82.6 ±12.8 0.3 ±0.0 13.0 ±2.8 17.7 ±1.7 6.0 ±0.2 98.3 ±0.0 11.5 ±0.6 0.3 ±0.1 19.9 ±1.3 47.3 ±0.1 15.7 ±0.9 15.5 ±0.7 38 Change is Hard: A Closer Look at Subpopulation Shift Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 88.6 ±0.7 81.9 ±6.2 79.2 ±0.2 73.7 ±1.0 75.2 ±0.8 22.3 ±10.2 81.9 ±6.2 79.6 ±0.6 79.6 ±0.5 83.5 ±0.3 80.0 ±0.5 89.3 ±0.3 90.0 ±0.0 79.9 ±0.2 79.1 ±0.0 79.3 ±0.1 79.3 ±0.1 41.7 ±3.4 37.4 ±3.5 74.7 ±0.3 50.2 ±1.8 60.4 ±4.8 13.7 ±9.8 37.4 ±3.5 74.3 ±0.4 73.7 ±1.0 68.5 ±1.6 74.0 ±0.7 42.1 ±4.0 36.0 ±0.7 73.8 ±1.0 75.8 ±0.3 74.6 ±0.4 75.1 ±0.2 68.3 ±1.1 63.5 ±5.0 62.9 ±0.1 57.3 ±0.1 59.4 ±1.1 37.3 ±5.8 63.5 ±5.0 63.1 ±0.3 63.1 ±0.2 65.0 ±0.2 63.3 ±0.2 69.6 ±0.4 70.6 ±0.1 63.3 ±0.0 63.0 ±0.0 62.9 ±0.1 63.0 ±0.0 42.3 ±2.4 33.9 ±9.3 28.6 ±0.2 20.1 ±0.3 23.0 ±1.5 9.0 ±0.7 33.9 ±9.3 29.0 ±0.6 29.0 ±0.5 33.3 ±0.4 29.4 ±0.5 44.7 ±1.1 47.3 ±0.2 29.4 ±0.1 28.6 ±0.0 28.7 ±0.1 28.7 ±0.0 68.7 ±0.2 62.5 ±5.9 64.7 ±0.2 56.8 ±0.4 59.6 ±1.4 19.5 ±8.3 62.5 ±5.9 65.0 ±0.5 65.0 ±0.4 67.9 ±0.2 65.2 ±0.4 69.8 ±0.4 69.1 ±0.1 65.3 ±0.1 64.7 ±0.0 64.7 ±0.1 64.7 ±0.0 43.8 ±0.7 35.7 ±7.6 42.0 ±0.2 29.9 ±0.2 34.4 ±2.3 8.8 ±3.9 35.7 ±7.6 42.3 ±0.6 42.4 ±0.5 45.5 ±0.3 42.6 ±0.5 45.5 ±1.0 43.6 ±0.1 42.8 ±0.0 42.1 ±0.0 42.0 ±0.1 42.0 ±0.0 69.5 ±1.3 63.8 ±4.7 78.4 ±0.2 65.7 ±0.6 70.7 ±2.6 46.2 ±2.9 63.8 ±4.7 78.3 ±0.3 78.4 ±0.3 77.8 ±0.4 78.6 ±0.2 70.4 ±1.1 67.8 ±0.2 78.6 ±0.2 78.8 ±0.0 78.5 ±0.1 78.6 ±0.1 70.0 ±1.5 64.1 ±4.6 79.1 ±0.1 67.0 ±0.4 72.0 ±2.5 46.2 ±3.1 64.1 ±4.6 79.0 ±0.2 79.1 ±0.2 78.5 ±0.3 79.0 ±0.2 70.4 ±1.3 67.9 ±0.1 79.5 ±0.1 79.3 ±0.0 79.0 ±0.1 79.0 ±0.1 85.4 ±0.4 76.1 ±8.5 86.2 ±0.0 72.9 ±0.4 79.0 ±2.5 30.5 ±10.1 76.1 ±8.5 86.3 ±0.2 86.2 ±0.1 86.3 ±0.3 86.1 ±0.3 86.5 ±0.1 86.1 ±0.1 86.6 ±0.1 86.0 ±0.0 86.1 ±0.1 86.2 ±0.0 5.0 ±1.1 16.1 ±9.0 21.3 ±0.8 40.4 ±0.0 24.4 ±0.5 65.7 ±10.2 16.1 ±9.0 20.1 ±1.4 21.0 ±0.7 15.6 ±1.1 19.6 ±0.6 16.1 ±1.7 32.3 ±0.2 21.3 ±0.4 25.6 ±0.1 21.7 ±0.1 21.7 ±0.1 E.3.12. LIVING17 Algorithm Avg Acc. Worst Acc. Avg Prec. Worst Prec. Avg F1 Worst F1 Adjusted Acc. Balanced Acc. AUROC ECE ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 E.3.13. OVERALL 5.7 ±1.5 8.7 ±1.4 6.0 ±1.4 4.0 ±0.5 5.7 ±2.2 7.0 ±1.2 8.7 ±1.4 6.7 ±1.5 5.7 ±1.5 5.7 ±1.5 5.7 ±1.5 5.3 ±0.3 4.0 ±0.8 6.7 ±0.7 6.0 ±0.9 6.3 ±0.3 9.3 ±0.3 28.2 ±1.0 30.9 ±2.2 32.1 ±0.9 29.2 ±1.7 31.1 ±0.9 28.3 ±0.8 30.9 ±2.2 33.0 ±0.6 28.2 ±1.0 28.2 ±1.0 28.2 ±1.0 28.8 ±1.0 28.0 ±1.2 30.7 ±1.0 27.4 ±0.3 31.8 ±0.0 33.4 ±0.1 8.2 ±1.6 9.5 ±1.3 9.6 ±0.2 5.1 ±0.8 8.0 ±1.7 9.6 ±1.8 9.5 ±1.3 11.0 ±0.6 8.2 ±1.6 8.2 ±1.6 8.2 ±1.6 7.1 ±1.0 6.6 ±1.4 8.2 ±0.8 8.6 ±0.8 7.5 ±0.3 11.3 ±0.3 27.1 ±1.1 29.3 ±1.9 30.8 ±0.7 26.5 ±1.5 28.3 ±1.3 26.1 ±1.2 29.3 ±1.9 31.0 ±0.6 27.1 ±1.1 27.1 ±1.1 27.1 ±1.1 27.0 ±0.7 24.0 ±0.8 28.3 ±1.3 25.7 ±0.2 30.5 ±0.1 32.6 ±0.0 6.9 ±1.7 9.7 ±1.5 7.6 ±0.8 4.8 ±0.6 7.2 ±2.3 8.7 ±1.7 9.7 ±1.5 8.3 ±1.2 6.9 ±1.7 6.9 ±1.7 6.9 ±1.7 6.3 ±0.5 5.1 ±0.3 7.3 ±0.5 7.5 ±1.1 6.8 ±0.3 10.8 ±0.2 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 77.3 ±1.3 78.2 ±1.2 80.1 ±0.8 81.0 ±0.2 81.0 ±0.8 76.6 ±0.6 78.2 ±1.2 81.0 ±0.7 77.3 ±1.3 77.3 ±1.3 77.3 ±1.3 78.7 ±0.5 79.1 ±1.0 78.0 ±1.0 79.4 ±0.1 80.3 ±0.1 82.0 ±0.0 59.6 ±0.5 34.1 ±1.9 53.5 ±0.8 28.8 ±6.8 36.9 ±3.2 61.0 ±0.7 34.1 ±1.9 46.6 ±3.1 59.6 ±0.5 59.6 ±0.5 59.6 ±0.5 49.9 ±1.9 12.4 ±0.5 56.5 ±1.7 13.8 ±0.4 49.6 ±1.7 40.0 ±0.4 Algorithm Waterbirds CelebA CivilComments MultiNLI MetaShift ImageNetBG NICO++ MIMIC-CXR MIMICNotes CXRMultisite CheXpert Living17 Avg ERM Mixup GroupDRO CVaRDRO JTT LfF LISA ReSample ReWeight SqrtReWeight CBLoss Focal LDAM BSoftmax DFR CRT ReWeightCRT 69.1 ±4.7 77.5 ±0.7 73.1 ±0.4 75.5 ±2.2 71.2 ±0.5 75.0 ±0.7 77.5 ±0.7 70.0 ±1.0 71.9 ±0.6 71.0 ±1.4 74.4 ±1.2 71.6 ±0.8 70.9 ±1.7 74.1 ±0.9 89.0 ±0.2 76.3 ±0.8 76.3 ±0.2 57.6 ±0.8 57.8 ±0.8 68.3 ±0.9 60.2 ±3.0 48.3 ±1.5 53.0 ±4.3 57.8 ±0.8 74.1 ±2.2 69.6 ±0.2 66.9 ±2.2 65.4 ±1.4 56.9 ±3.4 57.0 ±4.1 69.6 ±1.2 73.7 ±0.8 69.6 ±0.7 70.7 ±0.6 63.2 ±1.2 65.8 ±1.5 61.5 ±1.8 62.9 ±3.8 51.0 ±4.2 42.2 ±7.2 65.8 ±1.5 61.0 ±0.6 59.3 ±1.1 68.6 ±1.1 67.3 ±0.2 61.9 ±1.1 28.4 ±7.7 58.3 ±1.1 64.4 ±0.1 67.8 ±0.3 64.7 ±0.2 66.4 ±2.3 66.8 ±0.3 64.1 ±0.8 48.2 ±3.4 65.1 ±1.6 57.3 ±5.7 66.8 ±0.3 66.8 ±0.5 64.2 ±1.9 63.8 ±2.4 63.6 ±2.4 62.4 ±2.0 65.5 ±0.8 63.6 ±2.4 63.8 ±0.0 65.4 ±0.2 65.2 ±0.2 82.1 ±0.8 79.0 ±0.8 83.1 ±0.7 83.5 ±0.5 82.6 ±0.4 72.3 ±1.3 79.0 ±0.8 81.0 ±1.7 83.1 ±0.7 82.6 ±0.4 83.1 ±0.0 81.0 ±0.4 83.6 ±0.4 82.6 ±0.4 81.4 ±0.1 83.1 ±0.0 85.1 ±0.4 76.8 ±0.9 76.9 ±0.7 76.4 ±0.2 74.8 ±0.8 77.0 ±0.4 70.1 ±1.4 76.9 ±0.7 77.7 ±1.1 76.8 ±0.9 76.8 ±0.9 76.8 ±0.9 71.9 ±1.2 76.7 ±0.5 76.1 ±2.0 74.4 ±1.8 78.2 ±0.5 77.5 ±0.7 35.0 ±4.1 30.0 ±4.1 31.1 ±0.9 27.8 ±2.3 30.6 ±2.3 28.8 ±2.0 30.0 ±4.1 30.6 ±2.3 25.0 ±0.0 32.8 ±3.5 31.7 ±3.6 30.6 ±2.3 31.7 ±3.6 35.6 ±1.8 38.0 ±3.8 33.3 ±0.0 33.3 ±0.0 68.6 ±0.2 66.8 ±0.6 67.4 ±0.5 68.0 ±0.2 64.9 ±0.3 62.2 ±2.4 66.8 ±0.6 67.5 ±0.3 67.0 ±0.4 68.0 ±0.4 67.6 ±0.3 68.7 ±0.4 66.6 ±0.6 67.6 ±0.6 67.1 ±0.4 68.1 ±0.1 67.9 ±0.1 80.4 ±0.2 81.6 ±0.6 83.7 ±0.1 65.6 ±1.5 83.8 ±0.1 84.0 ±0.1 81.6 ±0.6 82.6 ±0.6 84.0 ±0.1 83.1 ±0.2 84.0 ±0.1 70.9 ±9.8 81.0 ±0.3 83.8 ±0.3 80.2 ±0.0 83.4 ±0.0 83.4 ±0.0 50.1 ±0.9 50.1 ±0.9 59.2 ±0.3 50.2 ±0.9 57.9 ±2.1 50.1 ±0.9 50.1 ±0.9 55.0 ±0.2 61.4 ±1.3 61.2 ±0.6 50.2 ±0.9 50.0 ±0.9 50.1 ±0.9 58.6 ±1.8 60.8 ±0.4 61.8 ±0.1 53.1 ±2.3 41.7 ±3.4 37.4 ±3.5 74.7 ±0.3 50.2 ±1.8 60.4 ±4.8 13.7 ±9.8 37.4 ±3.5 74.3 ±0.4 73.7 ±1.0 68.5 ±1.6 74.0 ±0.7 42.1 ±4.0 36.0 ±0.7 73.8 ±1.0 75.8 ±0.3 74.6 ±0.4 75.1 ±0.2 27.7 ±1.1 29.8 ±1.8 31.1 ±1.0 27.3 ±1.6 28.3 ±1.1 26.4 ±1.3 29.8 ±1.8 31.4 ±0.6 27.7 ±1.1 27.7 ±1.1 27.7 ±1.1 26.9 ±0.6 24.3 ±0.8 28.6 ±1.4 26.3 ±0.4 31.1 ±0.1 33.1 ±0.1 59.9 60.0 64.5 57.8 60.1 52.9 60.0 64.3 63.6 64.2 63.8 57.9 56.0 64.4 66.2 66.1 65.4 39
http://arxiv.org/abs/2302.12251v2
2023-03-25T07:48:55
2023-02-23T18:59:36
VoxFormer: Sparse Voxel Transformer for Camera-based 3D Semantic Scene Completion
Humans can easily imagine the complete 3D geometry of occluded objects and scenes. This appealing ability is vital for recognition and understanding. To enable such capability in AI systems, we propose VoxFormer, a Transformer-based semantic scene completion framework that can output complete 3D volumetric semantics from only 2D images. Our framework adopts a two-stage design where we start from a sparse set of visible and occupied voxel queries from depth estimation, followed by a densification stage that generates dense 3D voxels from the sparse ones. A key idea of this design is that the visual features on 2D images correspond only to the visible scene structures rather than the occluded or empty spaces. Therefore, starting with the featurization and prediction of the visible structures is more reliable. Once we obtain the set of sparse queries, we apply a masked autoencoder design to propagate the information to all the voxels by self-attention. Experiments on SemanticKITTI show that VoxFormer outperforms the state of the art with a relative improvement of 20.0% in geometry and 18.1% in semantics and reduces GPU memory during training to less than 16GB. Our code is available on https://github.com/NVlabs/VoxFormer.
[ "Yiming Li", "Zhiding Yu", "Christopher Choy", "Chaowei Xiao", "Jose M. Alvarez", "Sanja Fidler", "Chen Feng", "Anima Anandkumar" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12251v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12251v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.AI", "cs.LG", "cs.RO" ]
VoxFormer: Sparse Voxel Transformer for Camera-based 3D Semantic Scene Completion Yiming Li1 Jose M. Alvarez2 Zhiding Yu2∗ Christopher Choy2 Chaowei Xiao2,3 Sanja Fidler2,4,5 Chen Feng1 Anima Anandkumar2,6 1NYU 2NVIDIA 3ASU 4University of Toronto 5Vector Institute 6Caltech 3 2 0 2 r a M 5 2 ] V C . s c [ 2 v 1 5 2 2 1 . 2 0 3 2 : v i X r a Abstract Humans can easily imagine the complete 3D geometry of occluded objects and scenes. This appealing ability is vital for recognition and understanding. To enable such capa- bility in AI systems, we propose VoxFormer, a Transformer- based semantic scene completion framework that can out- put complete 3D volumetric semantics from only 2D images. Our framework adopts a two-stage design where we start from a sparse set of visible and occupied voxel queries from depth estimation, followed by a densification stage that gen- erates dense 3D voxels from the sparse ones. A key idea of this design is that the visual features on 2D images corre- spond only to the visible scene structures rather than the occluded or empty spaces. Therefore, starting with the fea- turization and prediction of the visible structures is more reliable. Once we obtain the set of sparse queries, we ap- ply a masked autoencoder design to propagate the infor- mation to all the voxels by self-attention. Experiments on SemanticKITTI show that VoxFormer outperforms the state of the art with a relative improvement of 20.0% in geome- try and 18.1% in semantics and reduces GPU memory dur- ing training to less than 16GB. Our code is available on https://github.com/NVlabs/VoxFormer. 1. Introduction Holistic 3D scene understanding is an important problem in autonomous vehicle (AV) perception. It directly affects downstream tasks such as planning and map construction. However, obtaining accurate and complete 3D information of the real world is difficult, since the task is challenged by the lack of sensing resolution and the incomplete observa- tion due to the limited field of view and occlusions. To tackle the challenges, semantic scene completion (SSC) [1] was proposed to jointly infer the complete scene geometry and semantics from limited observations. An SSC solution has to simultaneously address two subtasks: scene reconstruction for visible areas and scene hallucination for * Corresponding author: Zhiding Yu ([email protected]) (a) A diagram of VoxFormer for camera-based se- Figure 1. mantic scene completion that predicts complete 3D geometry and semantics given only 2D images. After obtaining voxel query proposals based on depth, VoxFormer generates semantic voxels (b) A comparison against via an MAE-like architecture [3]. the state-of-the-art MonoScene [4] in different ranges on Se- manticKITTI [5]. VoxFormer performs much better in safety- critical short-range areas, while MonoScene performs indiffer- ently at three distances. The relative gains are marked by red. occluded regions. This task is further backed by the fact that humans can naturally reason about scene geometry and semantics from partial observations. However, there is still a significant performance gap between state-of-the-art SSC methods [2] and human perception in driving scenes. Most existing SSC solutions consider LiDAR a pri- mary modality to enable accurate 3D geometric measure- ment [6–9]. However, LiDAR sensors are expensive and less portable, while cameras are cheaper and provide richer visual cues of the driving scenes. This motivated the study of camera-based SSC solutions, as first proposed in the pio- neering work of MonoScene [4]. MonoScene lifts 2D image inputs to 3D using dense feature projection. However, such a projection inevitably assigns 2D features of visible regions to the empty or occluded voxels. For example, an empty voxel occluded by a car will still get the car's visual feature. As a result, the generated 3D features contain many ambi- Query ProposalsInput: 2D Images3D SemanticVoxels(b) A comparison with the state of the art(a) A high-level architecture diagram of VoxFormer75.9%50.7%18.1%70.2%49.6%20.0%Cross-AttentionSelf-AttentionMask TokenOutput guities for subsequent geometric completion and semantic segmentation, resulting in unsatisfactory performance. Our contributions. Unlike MonoScene, VoxFormer considers 3D-to-2D cross-attention to represent the sparse queries. The proposed design is motivated by two insights: (1) reconstruction-before-hallucination: the non-visible re- gion's 3D information can be better completed using the re- constructed visible areas as starting points; and (2) sparsity- in-3D-space: since a large volume of the 3D space is usu- ally unoccupied, using a sparse representation instead of a dense one is certainly more efficient and scalable. Our con- tributions in this work can be summarized as follows: • A novel two-stage framework that lifts images into a complete 3D voxelized semantic scene. • A novel query proposal network based on 2D convolu- tions that generates reliable queries from image depth. • A novel Transformer similar to masked autoencoder (MAE) [3] that yields complete 3D scene representation. • VoxFormer sets a new state-of-the-art in camera-based SSC on SemanticKITTI [5], as shown in Fig. 1 (b). VoxFormer consists of class-agnostic query proposal (stage-1) and class-specific semantic segmentation (stage- 2), where stage-1 proposes a sparse set of occupied vox- els, and stage-2 completes the scene representations starting from the proposals given by stage-1. Specifically, stage-1 has a lightweight 2D CNN-based query proposal network using the image depth to reconstruct the scene geometry. It then proposes a sparse set of voxels from predefined learn- able voxel queries over the entire field of view. Stage-2 is based on a novel sparse-to-dense MAE-like architecture as shown in Fig. 1 (a). It first strengthens the featurization of the proposed voxels by allowing them to attend to the im- age observations. Next, the non-proposed voxels will be associated with a learnable mask token, and the full set of voxels will be processed by self-attention to complete the scene representations for per-voxel semantic segmentation. Extensive tests on the large-scale SemanticKITTI [5] show that VoxFormer achieves state-of-the-art performance in geometric completion and semantic segmentation. More the improvements are significant in safety- importantly, critical short-range areas, as shown in Fig. 1 (b). 2. Related Works 3D reconstruction and completion. 3D reconstruction aims to infer the 3D geometry of objects or scenes from single or multiple 2D images. This challenging problem re- ceives extensive attention in the traditional computer vision era [10] and the recent deep learning era [11]. 3D recon- struction can be divided into (1) single-view reconstruction by learning shape priors from massive data [12–15], and (2) multi-view reconstruction by leveraging different view- points [16, 17]. Both explicit [12, 14] and implicit represen- tations [18–22] are investigated for the object/scene. Unlike 3D reconstruction, 3D completion requires the model to hal- lucinate the unseen structure related to single-view 3D re- construction, yet the input is in 3D except for 2D. 3D object shape completion is an active research topic that estimates the complete geometry from a partial shape in the format of point [23–25], voxels [26–28], and distance fields [29], etc. In addition to object-level completion, scene-level 3D com- pletion has also been investigated in both indoor [30] and outdoor scenes [31]: [30] proposes a sparse generative net- work to convert a partial RGB-D scan into a high-resolution 3D reconstruction with missing geometry. [31] learns a neu- ral network to convert each scan to a dense volume of trun- cated signed distance fields (TSDF). Semantic segmentation. Human-level scene under- standing for intelligent agents is typically advanced by se- mantic segmentation on images [32] or point clouds [33]. Researchers have significantly promoted image segmenta- tion performance with a variety of deep learning techniques, such as convolutional neural network [34, 35], vision trans- formers [36, 37], prototype learning [38, 39], etc. To have intelligent agents interact with the 3D environment, think- ing in 3D is essential because the physical world is not 2D but rather 3D. Thus various 3D point cloud segmentation methods have been developed to address 3D semantic un- derstanding [40–42]. However, real-world sensing in 3D is inherently sparse and incomplete. For holistic semantic un- derstanding, it is insufficient to solely parse the sparse mea- surements while ignoring the unobserved scene structures. 3D semantic scene completion. Holistic 3D scene un- derstanding is challenged by limited sensing range, and re- searchers have proposed multi-agent collaborative percep- tion to introduce more observations of the 3D scene [43– 49]. Another line of research is 3D semantic scene comple- tion, unifying scene completion and semantic segmentation which are investigated separately at the early stage [50, 51]. SSCNet [1] first defines the semantic scene completion task where geometry and semantics are jointly inferred given an incomplete visual observation. In recent years, SSC in the indoor scenes with a relatively small scale has been in- tensively studied [52–59]. Meanwhile, SSC in the large- scale outdoor scenes have also started to receive attention after the release of SemanticKITTI dataset [5]. Semantic scene completion with a sparse observation is a highly de- sirable capability for autonomous vehicles since it can gen- erate a dense 3D voxelized semantic representation of the scene. Such representation can aid 3D semantic map con- struction of the static environment and help perceive dy- namic objects. Unfortunately, SSC for large-scale driving scenes is only at the preliminary development and explo- ration stages. Existing works commonly depend on 3D input such as LiDAR point clouds [6–9, 60]. In contrast, the recent MonoScene [4] has studied semantic scene com- pletion from a monocular image. It proposes 2D-3D fea- ture projections and uses successive 2D and 3D UNets to achieve camera-only 3D semantic scene completion. How- ever, 2D-to-3D feature projection is prone to introduce false features for unoccupied 3D positions, and the heavy 3D convolution will lower the system's efficiency. Camera-based 3D perception. Camera-based systems have received extensive attention in the autonomous driving community because the camera is low-cost, easy to deploy, and widely available. In addition, the camera can provide rich visual attributes of the scene to help vehicles achieve holistic scene understanding. Several works have recently been proposed for 3D object detection or map segmentation from RGB images. Inspired by DETR [62] in 2D detec- tion, DETR3D [63] links learnable 3D object queries with 2D images by camera projection matrices and enables end- to-end 3D bounding box prediction without non-maximum suppression (NMS). M2BEV [64] also investigates the vi- ability of simultaneously running multi-tasks perception based on BEV features. BEVFormer [65] proposes a spa- tiotemporal transformer that aggregates BEV features from current and previous features via deformable attention [66]. Compared to object detection, semantic scene completion can provide occupancy for each small cell instead of assign- ing a fixed-size bounding box to an object. This could help identify an irregularly-shaped object with an overhanging obstacle. Compared to 2D BEV representation, 3D vox- elized scene representation has more information, which is particularly helpful when vehicles are driving over bumpy roads. Hence, dense volumetric semantics can provide a more comprehensive 3D scene representation, while how to create it with only cameras receives scarce attention. 3. Methodology 3.1. Preliminary Problem setup. We aim to predict a dense seman- tic scene within a certain volume in front of the vehi- cle, given only RGB images. More specifically, we use as input current and previous images denoted by It = {It, It−1, ...}, and use as output a voxel grid Yt ∈ {c0, c1, ..., cM }H×W ×Z defined in the coordinate of ego- vehicle at timestamp t, where each voxel is either empty (denoted by c0) or occupied by a certain semantic class in {c1, cm, ..., cM }. Here M denotes the total number of in- terested classes, and H, W , Z denote the length, width, and height of the voxel grid, respectively. In summary, the over- all objective is to learn a neural network Θ to generate a semantic voxel Yt = Θ(It) as close to the ground truth ˆYt as possible. Note that previous SSC works commonly consider 3D input [2]. The most related work to us [4] con- siders a single image as input which is our special case. Design rationale. Motivated by reconstruction-before- hallucination and sparsity-in-3D-space, we build a two- stage framework: stage-1 based on CNN proposes a sparse set of voxel queries from image depth to attend to images since the image features correspond to visible and occu- pied voxels instead of non-visible and empty ones; stage- 2 based on Transformer uses an MAE-like architecture to first strengthen the featurization of the proposed voxels by voxel-to-image cross-attention, and then process the full set of voxels with self-attention to enable the voxel interactions. 3.2. Overall Architecture We learn 3D voxel features from 2D images for SSC based on Transformer, as illustrated in Fig. 2: our archi- tecture extracts 2D features from RGB images and then uses a sparse set of 3D voxel queries to index into these 2D features, linking 3D positions to an image stream using camera projection matrices. Specifically, voxel queries are 3D-grid-shaped learnable parameters designed to query fea- tures inside the 3D volume from images via attention mech- anisms [67]. Our framework is a two-stage cascade com- posed of class-agnostic proposals and class-specific seg- mentation similar to [68]: stage-1 generates class-agnostic query proposals, and stage-2 uses an MAE-like architecture to propagate information to all voxels. Ultimately, the voxel features will be up-sampled for semantic segmentation. A more specific procedure is as follows: • Extract 2D features F2D t ∈ Rb×c×d from RGB image It using ResNet-50 backbone [61], where b × c is spatial resolution, and d is feature dimension. • Generate class-agnostic query proposals Qp ∈ RNp×d which is a subset of the predefined voxel queries Q ∈ RNq×d, where Np and Nq are the numbers of query pro- posals and the total number of voxel queries respectively. • Refine voxel features F3D t ∈ RNq×d with two steps: (1) update the subset of voxels corresponding to query pro- posals by using Qp to attend to image features F2D via cross-attention and (2) update all voxels by letting them attend to each other via self-attention. t • Output dense semantic map Yt ∈ RH×W ×Z×(M +1) by up-sampling and linear projection of F3D . t We will detail the voxel queries in Sec. 3.3, stage-1 in Sec. 3.4, stage-2 in Sec. 3.5, and training loss in Sec. 3.6. 3.3. Predefined Parameters Voxel queries. We pre-define a total of Nq voxel queries as a cluster of 3D-grid-shaped learnable parameters Q ∈ Rh×w×z×d (Nq = h × w × z) as shown in the bottom left corner of Fig. 2, with h × w × z its spatial resolution which is lower than output resolution H × W × Z to save Figure 2. Overall framework of VoxFormer. Given RGB images, 2D features are extracted by ResNet50 [61] and the depth is estimated by an off-the-shelf depth predictor. The estimated depth after correction enables the class-agnostic query proposal stage: the query located at an occupied position will be selected to carry out deformable cross-attention with image features. Afterwards, mask tokens will be added for completing voxel features by deformable self-attention. The refined voxel features will be upsampled and projected to the output space for per-voxel semantic segmentation. Note that our framework supports the input of single or multiple images. computations. Note that d denotes the feature dimension, which is equal to that of image features. More specifically, a single voxel query q ∈ Rd located at (i, j, k) position of Q is responsible for the corresponding 3D voxel inside the volume. Each voxel corresponds to a real-world size of a meters. Meanwhile, the voxel queries are defined in the ego vehicle's coordinate, and learnable positional embeddings will be added to voxel queries for attention stages, following existing works for 2D BEV feature learning [65]. Mask token. While some voxel queries are selected to attend to images; the remaining voxels will be associated with another learnable parameter to complete 3D voxel fea- tures. We name such learnable parameter as mask token [3] for conciseness since unselected from Q is analogous to masked from Q. Specifically, each mask token m ∈ Rd is a learnable vector that indicates the presence of a missing voxel to be predicted. The positional embeddings are also added to help mask tokens be aware of their 3D locations. 3.4. Stage-1: Class-Agnostic Query Proposal Our stage-1 determines which voxels to be queried based the occupied voxels deserve careful attention, on depth: while the empty ones can be detached from the group. Given a 2D RGB observation, we first obtain a 2.5D rep- resentation of the scene based on depth estimation. After- wards, we acquire 3D query positions by occupancy predic- tion that help correct the inaccurate image depth. Depth estimation. We leverage off-the-shelf depth es- timation models such as monocular depth [69] or stereo depth [70] to directly predict the depth Z(u, v) of each im- age pixel (u, v). Afterwards, the depth map Z will be back- projected into a 3D point cloud: a pixel (u, v) will be trans- formed to (x, y, z) in 3D by: x = (u − cu) × z fu , y = (v − cv) × z fv , z = Z(u, v), (1) where (cu, cv) is the camera center and fu and fv are the horizontal and vertical focal length. However, the resulting 3D point cloud has low quality, especially in the long-range area, because the depth at the horizon is extremely inconsis- tent; only a few pixels determine the depth of a large area. Depth correction. To obtain satisfactory query propos- als, we employ a model Θocc to predict an occupancy map at a lower spatial resolution to help correct the image depth. Specifically, the synthetic point cloud is firstly converted into a binary voxel grid map Min, where each voxel is marked as 1 if occupied by at least one point. Then we can predict the occupancy by Mout = Θocc(Min), where Mout ∈ {0, 1}h×w×z has a lower resolution than the in- put Min ∈ {0, 1}H×W ×Z since a lower resolution is more robust to depth errors and compatible with the resolution of voxel queries. Θocc is a lightweight UNet-like model adapted from [6], mainly using 2D convolutions for binary classification of each voxel. Query proposal. Following depth correction, we can select voxel queries from Q based on the binary Mout: Qp = Reshape(Q[Mout]), (2) where Qp ∈ RNp×d is the query proposals to attend to images later on. Our depth-based query proposal can: (1) save computations and memories by removing many empty spaces and (2) ease attention learning by reducing ambigu- ities caused by erroneous 2D-to-3D correspondences. Depth-based Query ProposalFeature ExtractorDepth PredictionVoxel QueriesQwhzVoxel Features Ft3D...Query Proposals QpImage I%,I%&',...Image Features Ft2D............Deformable Cross-AttentionDeformable Self-AttentionQKVKVQOutput UP & FCMask TokenUpdated QueriesQpStage-1Stage-2m 3.5. Stage-2: Class-Specific Segmentation 3.6. Training Loss Following stage-1, we then attend to image features with query proposals Qp to learn rich visual features of the 3D scene. For efficiency, we utilize deformable attention [66], which interacts with local regions of interest, and only sam- ple Ns points around the reference point to compute the attention results. Mathematically, each query q will be up- dated by the following general equation: DA(q, p, F) = Ns(cid:88) s=1 AsWsF(p + δps), (3) where p denotes the reference point, F represents input fea- tures, and s indexes the sampled point from a total of Ns points. Ws ∈ Rd×d denotes learnable weights for the value generation, As ∈ [0, 1] is the learnable attention weight. δps ∈ R2 is the predicted offset to the reference point p, and F(p + δps) is the feature at location p + δps extracted by bilinear interpolation. Note that we only show the for- mulation of single-head attention for conciseness. Deformable cross-attention. For each proposed query qp, we obtain its corresponding real-world location based on the voxel resolution h × w × z and the real size of the in- terested 3D volume. Afterwards, we project the 3D point to 2D image features F2D = {F2D t−1, ...} based on pro- jection matrics. However, the projected 2D point can only fall on some images due to the limited field of view. Here, we term the hit image as Vt. After that, we regard these 2D points as the reference points of the query qp and sam- ple the features from the hit views around these reference points. Finally, we perform a weighted sum of the sampled features as the output of deformable cross-attention (DCA): , F2D t DCA(qp, F2D) = 1 |Vt| (cid:88) t∈Vt DA(qp, P(p, t), F2D t ), (4) where t indexes the images, and for each query proposal qp located at p = (x, y, z), we use camera projection function P(p, t) to obtain the reference point on image t. Deformable self-attention. After several layers of de- formable cross-attention, the query proposals will be up- dated to ˆQp. To get the complete voxel features, we com- bine the updated query proposals ˆQp and the mask tokens m to get the initial voxel features F3D ∈ R×h×w×z×d. Then we use deformable self-attention to get the refined voxel features ˆF3D ∈ R×h×w×z×d: DSA(F3D, F3D) = DA(f , p, F3D), (5) where f could be either a mask token or an updated query proposal located at p = (x, y, z). Output Stage. After obtaining refined voxel features ˆF3D, it will be upsampled and projected to the output space to get the final output Yt ∈ RH×W ×Z×(M +1), where M +1 denotes M semantic classes and one empty class. We train stage-2 with a weighted cross-entropy loss. The ground truth ˆYt ∈ {c0, c1, ..., cM }H×W ×Z defined at time t represents a multi-class semantic voxel grid. Therefore, the loss can be computed by: L = − K (cid:88) cM(cid:88) k=1 c=c0 wc ˆyk,clog( eyk,c c eyk,c (cid:80) ), (6) where k is the voxel index, K is the total number of the voxel (K = H × W × C), c indexes class, yk,c is the pre- dicted logits for the k-th voxel belonging to class c, ˆyk,c is the k-th element of ˆYt and is a one-hot vector (yi,k,c = 1 if voxel k belongs to class c). wc is a weight for each class according to the inverse of the class frequency as in [6]. We also use scene-class affinity loss proposed in [4]. For stage-1, we employ a binary cross-entropy loss for occu- pancy prediction at a lower spatial resolution. 4. Experiments 4.1. Experimental Setup Dataset. We verify VoxFormer on SemanticKITTI [5], which provides dense semantic annotations for each LiDAR sweep from the KITTI Odometry Benchmark [71] com- posed of 22 outdoor driving scenarios. SemanticKITTI SSC benchmark is interested in a volume of 51.2m ahead of the car, 25.6m to left and right side, and 6.4m in height. The voxelization of this volume leads to a group of 3D voxel grids with a dimension of 256 × 256 × 32 since each voxel has a size of 0.2m × 0.2m × 0.2m. The voxel grids are labelled with 20 classes (19 semantics and 1 free). Regard- ing the target output, SemanticKITTI provides the ground- truth semantic voxel grids by voxelization of the aggregated consecutive registered semantic point cloud. Regarding the sparse input to an SSC model, it can be either a single vox- elized LiDAR sweep or an RGB image. In this work, we investigate image-based SSC similar to [4], yet our input could be multiple images including temporal information. Implementation details. Regarding stage-1, we employ the MobileStereoNet [70] for direct depth estimation. Such depth can help generate a pseudo-LiDAR point cloud at a much lower cost based solely on stereo images. The occu- pancy prediction network for depth correction is adapted from LMSCNet [6] which is on top of lightweight 2D CNNs. We directly utilize the depth predictor in [70], and we train an occupancy predictor from scratch, using as input a voxelized pseudo point cloud with a size of 256 × 256 × 32 and as output an occupancy map with a size of 128 × 128 × 16. Regarding stage-2, we crop RGB im- ages of cam2 to size 1220 × 370 and employ ResNet50 [61] to extract image features, then the features in the 3rd stage will be taken by FPN [72] to produce a feature map whose Methods Range IoU (%) Precision (%) Recall (%) mIoU car (3.92%) bicycle (0.03%) motorcycle (0.03%) truck (0.16%) other-veh. (0.20%) person (0.07%) bicyclist (0.07%) motorcyclist (0.05%) road (15.30%) parking (1.12%) sidewalk (11.13%) other-grnd(0.56%) building (14.10%) fence (3.90%) vegetation (39.3%) trunk (0.51%) terrain (9.17%) pole (0.29%) traf.-sign (0.08%) VoxFormer-T (Ours) VoxFormer-S (Ours) MonoScene [4] LMSCNet∗ [6] SSCNet∗ [1] 12.8m 25.6m 51.2m 12.8m 25.6m 51.2m 12.8m 25.6m 51.2m 12.8m 25.6m 51.2m 12.8m 25.6m 51.2m 65.38 76.54 81.77 21.55 44.90 5.22 2.98 9.80 17.21 4.44 2.65 0.00 75.45 21.01 45.39 0.00 25.13 16.17 43.55 21.39 42.82 20.66 10.63 57.69 69.95 76.70 18.42 37.46 2.87 1.24 10.38 10.61 3.50 3.92 0.00 66.15 23.96 34.53 0.76 29.45 11.15 38.07 12.75 39.61 15.56 8.09 44.15 62.06 60.47 13.35 26.54 1.28 0.56 7.26 7.81 1.93 1.97 0.00 53.57 19.69 26.52 0.42 19.54 7.31 26.10 6.10 33.06 9.15 4.94 65.35 77.65 80.49 17.66 39.78 3.04 2.84 7.50 8.71 4.10 6.82 0.00 72.40 10.79 39.35 0.00 17.91 12.98 40.50 15.81 32.25 14.47 6.19 57.54 70.85 75.39 16.48 35.24 1.48 1.10 7.47 4.98 3.31 7.14 0.00 65.74 18.49 33.20 1.54 24.09 10.63 34.68 10.64 35.08 11.95 6.29 44.02 62.32 59.99 12.35 25.79 0.59 0.51 5.63 3.77 1.78 3.32 0.00 54.76 15.50 26.35 0.70 17.65 7.64 24.39 5.08 29.96 7.11 4.18 38.42 51.22 60.60 12.25 24.34 0.07 0.05 15.44 1.18 0.90 0.54 0.00 57.37 20.04 27.81 1.73 16.67 7.57 19.52 2.02 31.72 3.10 3.69 38.55 51.96 59.91 12.22 24.64 0.23 0.20 13.84 2.13 1.37 1.00 0.00 57.11 18.60 27.58 2.00 15.97 7.37 19.68 2.57 31.59 3.79 2.54 36.80 52.19 55.50 11.30 23.29 0.28 0.59 9.29 2.63 2.00 1.07 0.00 55.89 14.75 26.50 1.63 13.55 6.60 17.98 2.44 29.84 3.91 2.43 65.52 86.51 72.98 15.69 42.99 0.00 0.00 0.76 0.00 0.00 0.00 0.00 73.85 15.63 42.29 0.00 22.46 5.84 39.04 6.32 41.59 7.28 0.00 54.89 82.21 62.29 14.13 35.41 0.00 0.00 3.49 0.00 0.00 0.00 0.00 67.56 13.22 34.20 0.00 27.83 4.42 33.32 3.01 41.51 4.43 0.00 38.36 77.60 43.13 9.94 23.62 0.00 0.00 1.69 0.00 0.00 0.00 0.00 54.90 9.89 25.43 0.00 14.55 3.27 20.19 1.06 32.30 2.04 0.00 59.51 65.38 86.89 16.32 37.48 0.00 0.00 10.23 7.60 0.00 0.00 0.00 72.27 15.55 40.88 0.00 18.19 5.31 36.34 13.35 37.61 11.36 3.86 53.20 59.13 84.15 14.55 31.09 0.00 0.00 8.49 4.55 0.00 0.02 0.00 65.78 13.35 32.84 0.01 24.59 4.53 33.17 8.53 38.46 8.33 2.65 40.93 48.77 71.80 10.27 22.32 0.00 0.00 4.69 2.43 0.00 0.01 0.00 51.28 9.07 22.38 0.02 15.20 3.57 22.24 4.33 31.21 4.83 1.49 Table 1. Quantitative comparison against the state-of-the-art camera-based SSC methods. We report the performances inside three volumes, i.e., 12.8×12.8×6.4m3, 25.6×25.6×6.4m3, and 51.2×51.2×6.4m3. The first two volumes are introduced for assessing the SSC performance in safety-critical nearby locations. The top three performances are marked by red, green, and blue respectively. size is 1/16 of the input image size. The feature dimension is set as d = 128. The numbers of deformable attention layers for cross-attention and self-attention are 3 and 2 re- spectively. We use 8 sampling points around each reference point for the cross-/self-attention head. There is also a lin- ear layer that projects feature dimension 128 to the number of classes 20. We train stage-1 and stage-2 separately with 24 epochs, a learning rate of 2×10−4. Note that we provide two versions of VoxFormer, one takes only the current im- age as input (VoxFormer-S), and the other takes the current and the previous 4 images as input (VoxFormer-T). Evaluation metrics. We employ intersection over union (IoU) to evaluate the scene completion quality, regardless of the allocated semantic labels. Such a group of geometry- only voxel grids is actually a binary occupancy map which is crucial for obstacle avoidance in self-driving. We use the mean IoU (mIoU) of 19 semantic classes to assess the performance of semantic segmentation. Note that there is a strong interaction between IoU and mIoU, e.g., a high mIoU can be achieved by naively decreasing the IoU. There- fore, the desired model should achieve excellent perfor- mance in both geometric completion and semantic segmen- tation. Meanwhile, we further propose to assess different ranges ahead of the car for a thorough evaluation: we in- dividually report the IoU and mIoU inside the volume of 12.8m × 12.8m × 6.4m, 25.6m × 25.6m × 6.4m, and 51.2m × 51.2m × 6.4m. Note that the understanding of a short-range area is more crucial since it leaves less time for autonomous vehicles to improve. Differently, the under- standing of a provisional long-range area could be enhanced as SDVs get closer to it to collect more observations. We re- port the results within different ranges on the validation set, and the results within the full range on the hidden test set are in the supplementary. Baseline methods. We compare VoxFormer against the state-of-the-art SSC methods with public resources: (1) a camera-based SSC method MonoScene [4] based on 2D-to-3D feature projection, (2) LiDAR-based SSC methods including JS3CNet [8], LMSCNet [6], and SSC- Net [1], and (3) RGB-inferred baselines LMSCNet∗ [6] and SSCNet∗ [1] which take as input a pseudo LiDAR point cloud generated by the stereo depth [70]. 4.2. Performance 4.2.1 Comparison against camera-based methods 3D-to-2D query outperforms 2D-to-3D projection. VoxFormer-S outperforms MonoScene by a large margin in terms of geometric completion (36.80 → 44.02, 19.62%); see Table 1. Such a large improvement stems from stage- 1 with explicit depth estimation and correction, reducing a lot of empty spaces during the query process. In contrast, MonoScene based on 2D-to-3D projection will associate a lot of empty voxels with false features, e.g., if a free voxel is occluded by a car, it will be assigned the car's features when reprojected to the image, causing ambiguities during training. Meanwhile, the semantic score is also improved by 9.29% without sacrificing IoU. Temporal information boost the semantic under- standing. Despite the negligible difference in IoU, VoxFormer-T further improves the SSC performance over Figure 3. Qualitative results of our method and others. VoxFormer better captures the scene layout in large-scale self-driving scenarios. Meanwhile, VoxFormer shows satisfactory performances in completing small objects such as trunks and poles. Methods Modality IoU (%) mIoU (%) 12.8m 25.6m 51.2m 12.8m 25.6m 51.2m Methods Depth IoU (%) mIoU (%) 12.8m 25.6m 51.2m 12.8m 25.6m 51.2m MonoScene [4] Camera VoxFormer-T (Ours) Camera 38.42 38.55 36.80 12.25 12.22 11.30 65.38 57.69 44.15 21.55 18.42 13.35 SSCNet [1] LMSCNet [6] JS3CNet [8] LiDAR 64.37 61.02 50.22 20.02 19.68 16.35 LiDAR 74.88 69.45 55.22 22.37 21.50 17.19 LiDAR 63.47 63.40 53.09 30.55 28.12 22.67 MonoScene [4] - 38.42 38.55 36.80 12.25 12.22 11.30 VoxFormer-T (Ours) Stereo [70] 65.38 57.69 44.15 21.55 18.42 13.35 Mono [69] 59.03 50.47 38.08 18.67 15.42 11.27 VoxFormer-S (Ours) Stereo [70] 65.35 57.54 44.02 17.66 16.48 12.35 Mono [69] 57.41 50.61 38.68 14.62 14.01 10.67 Table 2. Quantitative comparison against the state-of-the-art LiDAR-based SSC methods. VoxFormer even performs on par with some LiDAR-based methods at close range. Table 3. Ablation study for image depth. With monocular depth, VoxFormer-S performs better than MonoScene in geome- try (12.8m, 25.6m, and 51.2m) and semantics (12.8m and 25.6m). VoxFormer-S with temporal information: the mIoU is im- proved by 8.10%, 11.77%, and 22.03% inside three vol- umes (51.2m, 25.6m, and 12.8m) respectively as shown in Table 1. For example, the IoU scores of building, park- ing, and terrain categories are respectively improved by 10.71%, 27.03%, and 10.35% inside the full volume be- cause VoxFormer-S is restricted by the individual viewpoint while involving more viewpoints can mitigate this issue. Our superiority over others in short-range areas. Our method shows a significant improvement over other camera-based methods in safety-critical short-range ar- eas, as shown in Table 1. VoxFormer-T can achieve mIoU scores of 21.55 and 18.42 within 12.8 meters and 25.6 meters, which outperforms the state-of-the-art MonoScene by 75.92% and 50.74% respectively. Com- pared to MonoScene with comparable performances at dif- ferent distances (11.30 ∼ 12.25), VoxFormer with much better short-range performances is more desirable in self- driving. The reason is that the insufficient understanding of a provisional long-range area could be gradually advanced as SDVs move forward to collect more close observations. Our superiority over others for small objects. Vox- Former shows a large advancement in completing small ob- jects compared to the main baseline MonoScene such as the bicycle (0.07 → 5.22), motorcycle (0.05 → 2.98), bicyclist (0.54 → 6.82), trunk (2.02 → 21.39), pole (3.10 → 20.66), and traffic sign (3.69 → 10.63), as shown in Table 1. The gap is even larger compared to LMSCNet∗ and SSCNet∗ directly consuming the pseudo point cloud, e.g., bicycle (0.00 → 5.22), motorcycle (0.00 → 2.98), and person (0.00 → 4.44). Such major improvements come from the full exploitation of visual attributes of the 3D scene. Our superiority in size and memory. VoxFormer has a total of ∼60M parameters, which is more lightweight than MonoScene with ∼150M parameters. Besides, VoxFormer needs less than 16GB GPU memory during training. 4.2.2 Comparison against LiDAR-based methods As shown in Table 2, as the distance gets closer to the ego- vehicle, the performance gap between our method and the state-of-the-art LiDAR-based methods becomes smaller, roadcartrucktrunkbicycleterrain.sidewalkpersonparkingbicyclistother-grndmotorcyclistbuildingbicyclistvegetationfenceother-veh.polemotorcycletraf.-signGround TruthVoxFormer-TLMSCNet*SSCNet*Camera ViewMonoScene Query Dense Random Occupancy Spatial resolution Ratio (%) 100 90 80 70 60 50 40 30 20 10 10∼20 Memory (G) 18.5 18.2 17.6 17.3 16.8 16.3 15.8 15.3 14.9 14.4 34.6 34.5 34.1 34.0 34.2 33.9 24.5 34.0 33.5 24.6 9.9 9.9 9.8 9.6 9.5 3.8 9.3 8.9 3.8 10.1 IoU (%) mIoU (%) 14.6 44.0 12.4 Table 4. Ablation study for query proposal. Our depth-based query proposal performs best. t -10 0 +10 +20 +30 +40 +50 +60 IoU (%) mIoU (%) Memory (G) Online (cid:88) (cid:88) 44.31 Offline (cid:88) (cid:88) (cid:88) 44.48 (cid:88) (cid:88) (cid:88) (cid:88) 44.24 (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) 44.83 (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) 44.58 (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) 44.53 (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) 45.05 13.24 14.02 14.53 15.42 15.88 16.09 16.20 15.21 15.74 16.25 16.81 17.43 18.03 19.37 Table 5. Ablation study for temporal input. +N means using the future frame t + N . Memory denotes training memory. e.g., compared to LMSCNet, the mIoU pair is 13.35 ↔ 17.19 if considering the area of 51.2 × 51.2m2 ahead of the ego-vehicle, while the mIoU pair will be 21.55 ↔ 22.37 if only considering the area of 12.8 × 12.8m2. This observa- tion is promising and inspiring to the self-driving commu- nity since VoxFormer only needs cheap cameras during in- ference. More interestingly, our mIoU within 12.8×12.8m2 is even better than LiDAR-based SSCNet with a relative gain of 7.63%, and our IoU within 12.8 × 12.8m2 is bet- ter than LiDAR-based JS3CNet with an improvement of 3.00%. In contrast, there is always a large gap between MonoScene and LiDAR-based methods at different ranges. 4.2.3 Ablation studies Depth estimation. We compare the performances between VoxFormers using monocular [69] and stereo depth [70], as shown in Table 3. In general, stereo depth is more accu- rate than monocular depth since the former exploits epipolar geometry, but the latter relies on pattern recognition [73]. Hence, VoxFormer with stereo depth performs best. Note that our framework can be integrated with any state-of-the- art depth models, so using a stronger existing depth predic- tor [74–76] could enhance our SSC performance. Mean- while, VoxFormer can be further promoted along with the advancement of depth estimation. Query mechanism. The ablation study for the query mechanism is reported in Table 4. We find that: (1) dense query (use all voxel queries in stage-2) is ineffi- cient in memory consumption and performs worse than our occupancy-based query in both geometry and semantics; (2) the performance of random query (randomly proposing a subset from all 128 × 128 × 16 voxel queries based on a specific ratio) is not stable, and there is a large gap between the random and occupancy-based query in both geometry and semantics; (3) our method achieves an excellent trade- off between the memory consumption and the performance. 1 4 (cid:88) 1 8 (cid:88) 1 16 (cid:88) (cid:88) (cid:88) (cid:88) 1 32 (cid:88) (cid:88) IoU (%) mIoU (%) Params (M) 44.26 44.38 44.02 44.19 44.01 10.24 11.33 12.35 12.29 12.22 57.81 57.84 57.90 58.04 58.93 Table 6. Ablation study for 2D image feature layers. Spatial resolution is relative to the input image size. Methods IoU (%) mIoU (%) Ours Ours w/o depth estimation Ours w/o depth correction Ours w/o cross-attention Ours w/o self-attention 44.02 34.64 36.95 32.74 43.73 12.35 10.14 11.36 9.94 10.70 Table 7. Ablation study for architecture. Temporal input. The ablation study for temporal infor- mation is shown in Table 5. The offline setting with more future observations can largely boost semantic segmenta- tion. Compared to the online setting with only previous and current images, the mIoU can be improved from 13.24 to 16.20 (22.36%). Note that involving more temporal input can lead to more memory consumption. Image features. The ablation study for 2D feature layers is shown in Table 6. We see that using different layers has comparable IoU but different mIoU. Using the layer whose size is 1/16 of the input image size achieves an excellent balance between the performance and the model size. Architecture. We conduct architecture ablation as shown in Table 7. For stage-1, depth estimation and correc- tion are both important since a group of reasonable voxel queries can set a good basis for complete scene representa- tion learning. For stage-2, self-attention and cross-attention can help improve the performance by enabling voxel-to- voxel and voxel-to-image interactions. 4.2.4 Limitation and future work Our performance at long range still needs to be improved, because the depth is very unreliable at the corresponding locations. Decoupling the long-range and short-range SSC is a potential solution to enhance the SSC far away from the ego vehicle. We leave this as our future work. 5. Conclusion In this paper, we present VoxFormer, a strong camera- based 3D semantic scene completion (SSC) framework composed of (1) class-agnostic query proposal based on depth estimation and (2) class-specific segmentation with a sparse-to-dense MAE-like design. VoxFormer outperforms the state-of-the-art camera-based method and even performs on par with LiDAR-based methods at close range. We hope VoxFormer can motivate further research in camera-based SSC and its applications in AV perception. Appendix In the appendix, we mainly provide quantitative and qualitative results of our method and the state-of-the-art camera-based SSC method MonoScene [4] on the hidden test set of SemanticKITTI [5]. Since we do not have access to the ground truth of the test set, we can only report the performances within the full range (51.2×51.2×6.4m3). A. Quantitative Comparison Scene completion. As shown in Table I, VoxFormer out- performs MonoScene with a large gap in terms of geometric completion. VoxFormer-S without using historical observa- tions improves MonoScene on IoU with a relative gain of 25.73%. Note that in autonomous driving, geometry occu- pancy is critical for obstacle avoidance since a false negative could result in severe accidents. Therefore, our method is more desirable than MonoScene in safety-critical camera- based autonomous driving applications. Semantic scene completion. As shown in Table I, Vox- Former also demonstrates a better semantic scene under- standing. VoxFormer-S and VoxFormer-T both demonstrate better mIoU than MonoScene. VoxFormer-T / VoxFormer- S have a relative improvement of 21.03% / 10.11% com- pared with the cutting-edged MonoScene. Note that the values of IoU and mIoU are intertwined, and some meth- ods can naively increase the value of mIoU by sacrificing IoU. In contrast, our method shows superior performance in terms of both geometry and semantics. Short-range performances. Although short-range eval- uations are not available on the hidden test set, we expect to see a similar trend (we perform much better in safety- critical short-range areas than MonoScene). The reason is that the scores of mIoU and IoU on the test set are compara- ble to that on the validation set inside the 51.2×51.2×6.4m3 volume. For example, VoxFormer-S achieves an mIoU of 12.35 on the validation set and 12.20 on the test set. B. Qualitative Comparison More visualizations are shown in Fig. I. We can see that our method performs much better than MonoScene in the short-range areas. There are some missing objects for MonoScene at close range, as shown in the first and last row of Fig. I. Meanwhile, the long-range performance of our method can be further improved, e.g., the trunks in the long- range areas are not completed in the fourth row of Fig. I. References [1] Shuran Song, Fisher Yu, Andy Zeng, Angel X Chang, Mano- lis Savva, and Thomas Funkhouser. Semantic scene com- In Proceedings of the pletion from a single depth image. IEEE conference on computer vision and pattern recogni- tion, pages 1746–1754, 2017. 1, 2, 6, 7 [2] Luis Roldao, Raoul De Charette, and Anne Verroust- Inter- Blondet. 3d semantic scene completion: a survey. national Journal of Computer Vision, pages 1–28, 2022. 1, 3 [3] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Doll ́ar, and Ross Girshick. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 16000– 16009, 2022. 1, 2, 4 [4] Anh-Quan Cao and Raoul de Charette. Monoscene: Monoc- In Proceedings of ular 3d semantic scene completion. the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3991–4001, 2022. 1, 3, 5, 6, 7, 9 [5] Jens Behley, Martin Garbade, Andres Milioto, Jan Quen- zel, Sven Behnke, Cyrill Stachniss, and Jurgen Gall. Se- mantickitti: A dataset for semantic scene understanding of lidar sequences. In Proceedings of the IEEE/CVF Interna- tional Conference on Computer Vision, pages 9297–9307, 2019. 1, 2, 5, 9 [6] Luis Roldao, Raoul de Charette, and Anne Verroust-Blondet. Lmscnet: Lightweight multiscale 3d semantic completion. In 2020 International Conference on 3D Vision (3DV), pages 111–119. IEEE, 2020. 1, 3, 4, 5, 6, 7 [7] Ran Cheng, Christopher Agia, Yuan Ren, Xinhai Li, and Liu Bingbing. S3cnet: A sparse semantic scene completion net- work for lidar point clouds. In Conference on Robot Learn- ing, pages 2148–2161. PMLR, 2021. 1, 3 [8] Xu Yan, Jiantao Gao, Jie Li, Ruimao Zhang, Zhen Li, Rui Huang, and Shuguang Cui. Sparse single sweep lidar point cloud segmentation via learning contextual shape priors from scene completion. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 3101–3109, 2021. 1, 3, 6, 7 [9] Pengfei Li, Yongliang Shi, Tianyu Liu, Hao Zhao, Guyue Zhou, and Ya-Qin Zhang. Semi-supervised implicit scene completion from sparse lidar, 2021. 1, 3 [10] Richard Hartley and Andrew Zisserman. Multiple view ge- ometry in computer vision. Cambridge university press, 2003. 2 [11] Xian-Feng Han, Hamid Laga, and Mohammed Bennamoun. Image-based 3d object reconstruction: State-of-the-art and trends in the deep learning era. IEEE transactions on pattern analysis and machine intelligence, 43(5):1578–1604, 2019. 2 [12] Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3d-r2n2: A unified approach for single and multi-view 3d object reconstruction. In European conference on computer vision, pages 628–644. Springer, 2016. 2 [13] Shubham Tulsiani, Tinghui Zhou, Alexei A Efros, and Ji- tendra Malik. Multi-view supervision for single-view re- construction via differentiable ray consistency. In Proceed- ings of the IEEE conference on computer vision and pattern recognition, pages 2626–2634, 2017. 2 ) % 2 9 . 3 ( r a U c o I d o h t e M ) % 3 0 . 0 ( e l c y c r o t o m ) % 3 0 . 0 ( e l c y c i b ) % 0 2 . 0 ( . h e v - r e h t o ) % 6 1 . 0 ( k c u r t ) % 7 0 . 0 ( n o s r e p ) % 7 0 . 0 ( t s i l c y c i b ) % 5 0 . 0 ( t s i l c y c r o t o m ) % 0 3 . 5 1 ( d a o r ) % 2 1 . 1 ( g n i k r a p ) % 3 1 . 1 1 ( k l a w e d i s ) % 6 5 . 0 ( d n r g - r e h t o ) % 0 1 . 4 1 ( g n i d l i u b ) % 3 . 9 3 ( n o i t a t e g e v ) % 0 9 . 3 ( e c n e f ) % 1 5 . 0 ( k n u r t ) % 7 1 . 9 ( n i a r r e t ) % 9 2 . 0 ( e l o p ) % 8 0 . 0 ( n g i s - . f a r t U o I m MonoScene 34.16 18.80 0.50 0.70 3.30 4.40 1.00 1.40 0.40 54.70 24.80 27.10 5.70 14.40 11.10 14.90 2.40 19.50 3.30 2.10 11.08 VoxFormer-S (Ours) 42.95 20.80 1.00 0.70 3.50 3.70 1.40 2.60 0.20 53.90 21.10 25.30 5.60 19.80 11.10 22.40 7.50 21.30 5.10 4.90 12.20 VoxFormer-T (Ours) 43.21 21.70 1.90 1.60 3.60 4.10 1.60 1.10 0.00 54.10 25.10 26.90 7.30 23.50 13.10 24.40 8.10 24.20 6.60 5.70 13.41 Table I. Quantitative results of VoxFormer and the state-of-the-art MonoScene on the hidden test set of SemanticKITTI. Figure I. Qualitative results of our method and others on the hidden test set. VoxFormer better captures the scene layout in large-scale self-driving scenarios. Meanwhile, VoxFormer shows satisfactory performances in completing small objects such as trunks and poles. roadcartrucktrunkbicycleterrain.sidewalkpersonparkingbicyclistother-grndmotorcyclistbuildingbicyclistvegetationfenceother-veh.polemotorcycletraf.-signVoxFormer-TLMSCNet*SSCNet*Camera ViewMonoScene [14] Haoqiang Fan, Hao Su, and Leonidas J Guibas. A point set generation network for 3d object reconstruction from a single image. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 605–613, 2017. 2 [15] Xinchen Yan, Jimei Yang, Ersin Yumer, Yijie Guo, and Honglak Lee. Perspective transformer nets: Learning single- view 3d object reconstruction without 3d supervision. In Ad- vances in neural information processing systems, volume 29, 2016. 2 [16] Richard A Newcombe, Shahram Izadi, Otmar Hilliges, David Molyneaux, David Kim, Andrew J Davison, Pushmeet Kohi, Jamie Shotton, Steve Hodges, and Andrew Fitzgibbon. Kinectfusion: Real-time dense surface mapping and track- ing. In 2011 10th IEEE international symposium on mixed and augmented reality, pages 127–136. Ieee, 2011. 2 [17] Benjamin Ummenhofer, Huizhong Zhou, Jonas Uhrig, Niko- laus Mayer, Eddy Ilg, Alexey Dosovitskiy, and Thomas Brox. Demon: Depth and motion network for learning monocular stereo. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5038–5047, 2017. 2 [18] Lars Mescheder, Michael Oechsle, Michael Niemeyer, Se- bastian Nowozin, and Andreas Geiger. Occupancy networks: Learning 3d reconstruction in function space. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 4460–4470, 2019. 2 [19] Songyou Peng, Michael Niemeyer, Lars Mescheder, Marc Pollefeys, and Andreas Geiger. Convolutional occupancy In European Conference on Computer Vision, networks. pages 523–540. Springer, 2020. 2 [20] Qiangeng Xu, Weiyue Wang, Duygu Ceylan, Radomir Mech, and Ulrich Neumann. Disn: Deep implicit surface network for high-quality single-view 3d reconstruction. Ad- vances in Neural Information Processing Systems, 32, 2019. 2 [21] Stefan Popov, Pablo Bauszat, and Vittorio Ferrari. Corenet: Coherent 3d scene reconstruction from a single rgb image. In European Conference on Computer Vision, pages 366–383. Springer, 2020. 2 [22] Zihan Zhu, Songyou Peng, Viktor Larsson, Weiwei Xu, Hu- jun Bao, Zhaopeng Cui, Martin R Oswald, and Marc Polle- feys. Nice-slam: Neural implicit scalable encoding for slam. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12786–12796, 2022. 2 [23] Wentao Yuan, Tejas Khot, David Held, Christoph Mertz, and In 2018 Martial Hebert. Pcn: Point completion network. International Conference on 3D Vision (3DV), pages 728– 737. IEEE, 2018. 2 [24] Jiayuan Gu, Wei-Chiu Ma, Sivabalan Manivasagam, Wenyuan Zeng, Zihao Wang, Yuwen Xiong, Hao Su, and Raquel Urtasun. Weakly-supervised 3d shape completion in the wild. In European Conference on Computer Vision, pages 283–299. Springer, 2020. 2 [25] Xingguang Yan, Liqiang Lin, Niloy J Mitra, Dani Lischin- Shapeformer: ski, Daniel Cohen-Or, and Hui Huang. Transformer-based shape completion via sparse representa- tion. In Proceedings of the IEEE/CVF Conference on Com- puter Vision and Pattern Recognition, pages 6239–6249, 2022. 2 [26] Julian Chibane, Thiemo Alldieck, and Gerard Pons-Moll. Implicit functions in feature space for 3d shape reconstruc- tion and completion. In Proceedings of the IEEE/CVF Con- ference on Computer Vision and Pattern Recognition, pages 6970–6981, 2020. 2 [27] Xiaogang Wang, Marcelo H Ang, and Gim Hee Lee. Voxel- based network for shape completion by leveraging edge gen- eration. In Proceedings of the IEEE/CVF international con- ference on computer vision, pages 13189–13198, 2021. 2 [28] Linqi Zhou, Yilun Du, and Jiajun Wu. 3d shape generation and completion through point-voxel diffusion. In Proceed- ings of the IEEE/CVF International Conference on Com- puter Vision, pages 5826–5835, 2021. 2 [29] Angela Dai, Charles Ruizhongtai Qi, and Matthias Niessner. Shape completion using 3d-encoder-predictor cnns and shape synthesis. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5868–5877, 2017. 2 [30] Angela Dai, Christian Diller, and Matthias Niessner. Sg-nn: Sparse generative neural networks for self-supervised scene completion of rgb-d scans. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 849–858, 2020. 2 [31] Ignacio Vizzo, Benedikt Mersch, Rodrigo Marcuzzi, Louis Wiesmann, Jens Behley, and Cyrill Stachniss. Make it dense: Self-supervised geometric scan completion of sparse 3d lidar scans in large outdoor environments. IEEE Robotics and Au- tomation Letters, 7(3):8534–8541, 2022. 2 [32] Shervin Minaee, Yuri Boykov, Fatih Porikli, Antonio Plaza, Nasser Kehtarnavaz, and Demetri Terzopoulos. Image seg- mentation using deep learning: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(7):3523– 3542, 2022. 2 [33] Yulan Guo, Hanyun Wang, Qingyong Hu, Hao Liu, Li Liu, and Mohammed Bennamoun. Deep learning for 3d point clouds: A survey. IEEE transactions on pattern analysis and machine intelligence, 43(12):4338–4364, 2020. 2 [34] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Pro- ceedings of the IEEE conference on computer vision and pat- tern recognition, pages 3431–3440, 2015. 2 [35] Hyeonwoo Noh, Seunghoon Hong, and Bohyung Han. Learning deconvolution network for semantic segmentation. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), December 2015. 2 [36] Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo. Segformer: Simple and ef- ficient design for semantic segmentation with transformers. In Advances in Neural Information Processing Systems, vol- ume 34, pages 12077–12090, 2021. 2 [37] Bowen Cheng, Alex Schwing, and Alexander Kirillov. Per- pixel classification is not all you need for semantic segmenta- tion. In Advances in Neural Information Processing Systems, volume 34, pages 17864–17875, 2021. 2 [38] Kaixin Wang, Jun Hao Liew, Yingtian Zou, Daquan Zhou, Panet: Few-shot image semantic seg- and Jiashi Feng. mentation with prototype alignment. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9197–9206, 2019. 2 [39] Tianfei Zhou, Wenguan Wang, Ender Konukoglu, and Luc Van Gool. Rethinking semantic segmentation: A proto- In Proceedings of the IEEE/CVF Conference type view. on Computer Vision and Pattern Recognition, pages 2582– 2593, 2022. 2 [40] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification In Proceedings of the IEEE conference and segmentation. on computer vision and pattern recognition, pages 652–660, 2017. 2 [41] Xun Xu and Gim Hee Lee. Weakly supervised semantic point cloud segmentation: Towards 10x fewer labels. In Pro- ceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 13706–13715, 2020. 2 [42] Qingyong Hu, Bo Yang, Linhai Xie, Stefano Rosa, Yulan Guo, Zhihua Wang, Niki Trigoni, and Andrew Markham. Randla-net: Efficient semantic segmentation of large-scale point clouds. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11108– 11117, 2020. 2 [43] Tsun-Hsuan Wang, Sivabalan Manivasagam, Ming Liang, Bin Yang, Wenyuan Zeng, and Raquel Urtasun. V2vnet: Vehicle-to-vehicle communication for joint perception and In European conference on computer vision, prediction. pages 605–621. Springer, 2020. 2 [44] Yiming Li, Dekun Ma, Ziyan An, Zixun Wang, Yiqi Zhong, Siheng Chen, and Chen Feng. V2x-sim: Multi-agent col- laborative perception dataset and benchmark for autonomous driving. IEEE Robotics and Automation Letters, 7(4):10914– 10921, 2022. 2 [45] Runsheng Xu, Hao Xiang, Zhengzhong Tu, Xin Xia, Ming- Hsuan Yang, and Jiaqi Ma. V2x-vit: Vehicle-to-everything cooperative perception with vision transformer. In European conference on computer vision, pages 107–124. Springer, 2022. 2 [46] Yiming Li, Shunli Ren, Pengxiang Wu, Siheng Chen, Chen Feng, and Wenjun Zhang. Learning distilled collaboration In Advances in Neural graph for multi-agent perception. Information Processing Systems, volume 34, pages 29541– 29552, 2021. 2 [47] Runsheng Xu, Zhengzhong Tu, Hao Xiang, Wei Shao, Bolei Zhou, and Jiaqi Ma. Cobevt: Cooperative bird's eye view se- mantic segmentation with sparse transformers. In 6th Annual Conference on Robot Learning, 2022. 2 [48] Yiming Li, Juexiao Zhang, Dekun Ma, Yue Wang, and Chen Feng. Multi-robot scene completion: Towards task-agnostic collaborative perception. In 6th Annual Conference on Robot Learning, 2022. 2 [49] Sanbao Su, Yiming Li, Sihong He, Songyang Han, Chen Feng, Caiwen Ding, and Fei Miao. Uncertainty quantifica- tion of collaborative detection for self-driving. In IEEE In- ternational Conference on Robotics and Automation, 2023. 2 [50] Saurabh Gupta, Pablo Arbelaez, and Jitendra Malik. Percep- tual organization and recognition of indoor scenes from rgb- d images. In Proceedings of the IEEE conference on com- puter vision and pattern recognition, pages 564–571, 2013. 2 [51] S. Thrun and B. Wegbreit. In Tenth IEEE International Conference on Computer Vision (ICCV'05) Volume 1, volume 2, pages 1824–1831 Vol. 2, 2005. 2 Shape from symmetry. [52] Jiahui Zhang, Hao Zhao, Anbang Yao, Yurong Chen, Li Zhang, and Hongen Liao. Efficient semantic scene com- In Pro- pletion network with spatial group convolution. ceedings of the European Conference on Computer Vision (ECCV), pages 733–749, 2018. 2 [53] Shice Liu, Yu Hu, Yiming Zeng, Qiankun Tang, Beibei Jin, Yinhe Han, and Xiaowei Li. See and think: Disentangling semantic scene completion. In Advances in Neural Informa- tion Processing Systems, volume 31, 2018. 2 [54] Jie Li, Yu Liu, Xia Yuan, Chunxia Zhao, Roland Sieg- wart, Ian Reid, and Cesar Cadena. Depth based semantic scene completion with position importance aware loss. IEEE Robotics and Automation Letters, 5(1):219–226, 2019. 2 [55] Jie Li, Yu Liu, Dong Gong, Qinfeng Shi, Xia Yuan, Chunxia Zhao, and Ian Reid. Rgbd based dimensional decomposition residual network for 3d semantic scene completion. In Pro- ceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7693–7702, 2019. 2 [56] Pingping Zhang, Wei Liu, Yinjie Lei, Huchuan Lu, and Xi- aoyun Yang. Cascaded context pyramid for full-resolution 3d semantic scene completion. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7801– 7810, 2019. 2 [57] Jie Li, Kai Han, Peng Wang, Yu Liu, and Xia Yuan. Anisotropic convolutional networks for 3d semantic scene In Proceedings of the IEEE/CVF Conference completion. on Computer Vision and Pattern Recognition, pages 3351– 3359, 2020. 2 [58] Xiaokang Chen, Kwan-Yee Lin, Chen Qian, Gang Zeng, and Hongsheng Li. 3d sketch-aware semantic scene comple- tion via semi-supervised structure prior. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4193–4202, 2020. 2 [59] Yingjie Cai, Xuesong Chen, Chao Zhang, Kwan-Yee Lin, Xiaogang Wang, and Hongsheng Li. Semantic scene com- In pletion via integrating instances and scene in-the-loop. Proceedings of the IEEE/CVF Conference on Computer Vi- sion and Pattern Recognition, pages 324–333, 2021. 2 [60] Christoph B Rist, David Emmerichs, Markus Enzweiler, and Dariu M Gavrila. Semantic scene completion using local IEEE transactions deep implicit functions on lidar data. on pattern analysis and machine intelligence, 44(10):7205– 7218, 2021. 3 [61] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceed- ings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. 3, 4, 5 [62] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to- end object detection with transformers. In European confer- ence on computer vision, pages 213–229. Springer, 2020. 3 [63] Yue Wang, Vitor Campagnolo Guizilini, Tianyuan Zhang, Yilun Wang, Hang Zhao, and Justin Solomon. Detr3d: 3d object detection from multi-view images via 3d-to-2d queries. In Conference on Robot Learning, pages 180–191. PMLR, 2022. 3 [64] Enze Xie, Zhiding Yu, Daquan Zhou, Jonah Philion, Anima Anandkumar, Sanja Fidler, Ping Luo, and Jose M Alvarez. Mˆ 2bev: Multi-camera joint 3d detection and segmentation with unified birds-eye view representation. arXiv preprint arXiv:2204.05088, 2022. 3 [65] Zhiqi Li, Wenhai Wang, Hongyang Li, Enze Xie, Chong- hao Sima, Tong Lu, Qiao Yu, and Jifeng Dai. Bevformer: Learning bird's-eye-view representation from multi-camera images via spatiotemporal transformers. In European con- ference on computer vision, 2022. 3, 4 [66] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In International Conference on Learning Representations, 2020. 3, 5 [67] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszko- reit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, volume 30, 2017. 3 [68] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information pro- cessing systems, volume 28, 2015. 3 [69] Shariq Farooq Bhat, Ibraheem Alhashim, and Peter Wonka. Adabins: Depth estimation using adaptive bins. In Proceed- ings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4009–4018, 2021. 4, 7, 8 [70] Faranak Shamsafar, Samuel Woerz, Rafia Rahim, and An- dreas Zell. Mobilestereonet: Towards lightweight deep net- works for stereo matching. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2417–2426, 2022. 4, 5, 6, 7, 8 [71] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In 2012 IEEE conference on computer vision and pat- tern recognition, pages 3354–3361. IEEE, 2012. 5 [72] Tsung-Yi Lin, Piotr Doll ́ar, Ross Girshick, Kaiming He, Feature pyra- Bharath Hariharan, and Serge Belongie. In Proceedings of the mid networks for object detection. IEEE conference on computer vision and pattern recogni- tion, pages 2117–2125, 2017. 5 [73] Hamid Laga, Laurent Valentin Jospin, Farid Boussaid, and Mohammed Bennamoun. A survey on deep learning tech- niques for stereo-based depth estimation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. 8 [74] Zhenda Xie, Zigang Geng, Jingcheng Hu, Zheng Zhang, Han Hu, and Yue Cao. Revealing the dark secrets of masked im- age modeling. arXiv preprint arXiv:2205.13543, 2022. 8 [75] Vladimir Tankovich, Christian Hane, Yinda Zhang, Adarsh Kowdle, Sean Fanello, and Sofien Bouaziz. Hitnet: Hierar- chical iterative tile refinement network for real-time stereo matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 14362– 14372, 2021. 8 [76] Weihao Yuan, Xiaodong Gu, Zuozhuo Dai, Siyu Zhu, and Ping Tan. Newcrfs: Neural window fully-connected crfs for In Proceedings of the IEEE monocular depth estimation. Conference on Computer Vision and Pattern Recognition, 2022. 8
http://arxiv.org/abs/2302.12250v2
2023-10-24T17:59:46
2023-02-23T18:59:30
Phase diagram of early training dynamics in deep neural networks: effect of the learning rate, depth, and width
We systematically analyze optimization dynamics in deep neural networks (DNNs) trained with stochastic gradient descent (SGD) and study the effect of learning rate $\eta$, depth $d$, and width $w$ of the neural network. By analyzing the maximum eigenvalue $\lambda^H_t$ of the Hessian of the loss, which is a measure of sharpness of the loss landscape, we find that the dynamics can show four distinct regimes: (i) an early time transient regime, (ii) an intermediate saturation regime, (iii) a progressive sharpening regime, and (iv) a late time ``edge of stability" regime. The early and intermediate regimes (i) and (ii) exhibit a rich phase diagram depending on $\eta \equiv c / \lambda_0^H $, $d$, and $w$. We identify several critical values of $c$, which separate qualitatively distinct phenomena in the early time dynamics of training loss and sharpness. Notably, we discover the opening up of a ``sharpness reduction" phase, where sharpness decreases at early times, as $d$ and $1/w$ are increased.
[ "Dayal Singh Kalra", "Maissam Barkeshli" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12250v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12250v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cond-mat.dis-nn" ]
3 2 0 2 t c O 4 2 ] G L . s c [ 2 v 0 5 2 2 1 . 2 0 3 2 : v i X r a Phase diagram of early training dynamics in deep networks: effect of the learning rate, depth, and width Dayal Singh Kalra ∗† [email protected] Maissam Barkeshli ∗‡§ [email protected] Abstract We systematically analyze optimization dynamics in deep neural networks (DNNs) trained with stochastic gradient descent (SGD) and study the effect of learning rate η, depth d, and width w of the neural network. By analyzing the maximum eigenvalue λH t of the Hessian of the loss, which is a measure of sharpness of the loss landscape, we find that the dynamics can show four distinct regimes: (i) an early time transient regime, (ii) an intermediate saturation regime, (iii) a progressive sharpening regime, and (iv) a late time "edge of stability" regime. The early and intermediate regimes (i) and (ii) exhibit a rich phase diagram depending on η 0 , d, and w. We identify several critical values of c, which separate qualitatively distinct phenomena in the early time dynamics of training loss and sharpness. Notably, we discover the opening up of a "sharpness reduction" phase, where sharpness decreases at early times, as d and 1/w are increased. c/λH ≡ 1 Introduction The optimization dynamics of deep neural networks (DNNs) is a rich problem that is of great interest. Basic questions about how to choose learning rates and their effect on generalization error and training speed remain intensely studied research problems. Classical intuition from convex optimization has lead to the often made suggestion that in stochastic gradient descent (SGD), the learning rate η should satisfy η < 2/λH, where λH is the maximum eigenvalue of the Hessian H of the loss, in order to ensure that the network reaches a minimum. However several recent studies have suggested that it is both possible and potentially preferable to have the learning rate early in training reach η > 2/λH [66, 49, 72]. The idea is that such a choice will induce a temporary training instability, causing the network to 'catapult' out of a local basin into a flatter one with lower λH where training stabilizes. Indeed, during the early training phase, the local curvature of the loss landscape changes rapidly [42, 1, 37, 15], and the learning rate plays a crucial role in determining the convergence basin [37]. Flatter basins are believed to be preferable because they potentially lead to lower generalization error [31, 32, 42, 12, 39, 14] and allow larger learning rates leading to potentially faster training. From a different perspective, the major theme of deep learning is that it is beneficial to increase the model size as much as possible. This has come into sharp focus with the discovery of scaling laws that show power law improvement in generalization error with model and dataset size [40]. This raises the fundamental question of how one can scale DNNs to arbitrarily large sizes while maintaining the ability to learn; in particular, how should initialization and optimization hyperparameters be chosen to maintain a similar quality of learning as the model size is taken to infinity [34, 47, 48, 11, 69, 58, 70, 68]? ∗Condensed Matter Theory Center, University of Maryland, College Park †Institute for Physical Science and Technology, University of Maryland, College Park ‡Department of Physics, University of Maryland, College Park §Joint Quantum Institute, University of Maryland, College Park 37th Conference on Neural Information Processing Systems (NeurIPS 2023). Figure 1: Training trajectories of the (a) training loss, (b) sharpness, and (c) training accuracy of CNNs (d = 5 and w = 512) trained on CIFAR-10 with MSE loss using vanilla SGD with learning rates η = c/λH 0 and batch size B = 512. Vertical dashed lines approximately separate the different training regimes. Horizontal dashed lines in (b) denote the 2/η threshold for each learning rate. Motivated by these ideas, we perform a systematic analysis of the training dynamics of SGD for DNNs as learning rate, depth, and width are tuned, across a variety of architectures and datasets. We monitor both the loss and sharpness (λH ) trajectories during early training, observing a number of qualitatively distinct phenomena summarized below. 1.1 Our contributions We study SGD on fully connected networks (FCNs) with the same number of hidden units (width) in each layer, convolutional neural networks (CNNs), and ResNet architectures of varying width w and depth d with ReLU activation. For CNNs, the width corresponds to the number of channels. We focus on networks parameterized in Neural Tangent Parameterization (NTP) [34], and Standard Parameterization (SP) [62] initialized at criticality [55, 58], while other parameterizations and initializations may show different behavior. Further experimental details are provided in Appendix A. We study both mean-squared error (MSE) and cross-entropy loss functions and the datasets CIFAR- 10, MNIST, Fashion-MNIST. Our findings apply to networks with d/w ≲ C, where C depends on 1/16) and loss function, but is independent of d, w, and η. architecture class (e.g. for FCNs, C Above this ratio, the dynamics becomes noise-dominated, and separating the underlying deterministic dynamics from random fluctuations becomes challenging, as shown in Appendix E. We use sharpness to refer to λH t . t , the maximum eigenvalue of H at time-step t, and flatness refers to 1/λH By monitoring the sharpness, we find four clearly separated, qualitatively distinct regimes throughout the training trajectory. Fig. 1 shows an example from a CNN architecture. The four observed regimes are: (i) an early time transient regime where loss and sharpness may drastically change and eventually settle down, (ii) an intermediate saturation regime where the sharpness has lowered and remains relatively constant, (iii) a progressive sharpening regime where sharpness steadily rises, and finally, (iv) a late time regime where the sharpness saturates around 2/η for MSE loss; whereas for cross- entropy loss, sharpness drops after reaching this maximum value while remaining less than 2/η [8]. Note the log scale in Figure 1 highlights the early regimes (i) and (ii); in absolute terms these are much shorter in time than regimes (iii) and (iv). ≈ In this work, we focus on the early transient and intermediate saturation regimes. As learning rate, d and w are tuned, a clear picture emerges, leading to a rich phase diagram, as demonstrated in Section 2. Given the learning rate scaled as η = c/λH 0 , we characterize four distinct behaviors in the training dynamics in the early transient regime (i): Sharpness reduction phase (c < closs) : Both the loss and the sharpness monotonically decrease during early training. There is a particularly significant drop in sharpness in the regime ccrit < c < closs, which motivates us to refer to learning rates lower than ccrit as sub-critical and larger than ccrit as super-critical. We discuss ccrit in detail below. The regime ccrit < c < closs opens up significantly with increasing d and 1/w, which is a new result of this work. Loss catapult phase (closs < c < csharp) : The first few gradient steps take training to a flatter region but with a higher loss. Training eventually settles down in the flatter region as the loss starts to decrease again. The sharpness monotonically decreases from initialization in this early time transient regime. 2 100101102103104105t(step)10−1100Trainingloss(a)(i)(ii)(iii)(iv)100101102103104105t(step)0123λHt/λH0(b)(i)(ii)(iii)(iv)100101102103104105t(step)0.20.40.60.8Trainingaccuracy(c)(i)(ii)(iii)(iv)c1.01.42.02.84.05.78.011.316.022.6 Loss and sharpness catapult phase (csharp < c < cmax): In this regime both the loss and sharpness initially start to increase, effectively catapulting to a different point where loss and sharpness can start to decrease again. Training eventually exhibits a significant reduction in sharpness by the end of the early training. The report of a loss and sharpness catapult is also new to this work. Divergent phase (c > cmax): The learning rate is too large for training and the loss diverges. The critical values closs, csharp, cmax are random variables that depend on random initialization, SGD batch selection, and architecture. The averages of closs, csharp, cmax shown in the phase diagrams show strong systematic dependence on depth and width. In order to better understand the cause of the sharpness reduction during early training we study the effect of network output at initialization by (1) centering the network, (2) setting last layer weights to zero, or (3) tuning the overall scale of the output layer. We also analyze the linear connectivity of the loss landscape in the early transient regime and show that for a range of learning rates closs < c < cbarrier, no barriers exist from the initial state to the final point of the initial transient phase, even though training passes through regions with higher loss than initialization. Next, we provide a quantitative analysis of the intermediate saturation regime. We find that sharpness during this time typically displays 3 distinct regimes as the learning rate is tuned, depicted in Fig. 5. By identifying an appropriate order parameter, we can extract a sharp peak corresponding to ccrit. 2, whereas for crossentropy loss, 4 ≳ ccrit ≳ 2. For c ccrit, the network is For MSE loss ccrit effectively in a lazy training regime, with increasing fluctuations as d and/or 1/w are increased. ≪ ≈ Finally, we show that a single hidden layer linear network – the uv model – displays the same phenomena discussed above and we analyze the phase diagram in this minimal model. 1.2 Related works A significant amount of research has identified various training regimes using diverse criteria, e.g., [13, 1, 16, 37, 17, 45, 35, 8, 33]. Here we focus on studies that characterize training regimes with sharpness and learning rates. Several studies have analyzed sharpness at different training times [37, 15, 35, 8, 33]. Ref. [8] studied sharpness at late training times and showed how large-batch gradient descent shows progressive sharpening followed by the edge of stability, which has motivated various theoretical studies [9, 2, 3]. Ref. [37] studied the entire training trajectory of sharpness in models trained with SGD and cross-entropy loss and found that sharpness increases during the early stages of training, reaches a peak, and then decreases. In contrast, we find a sharpness-reduction phase, c < closs which becomes more prominent with increasing d and 1/w, where sharpness only decreases during early training; this also occurs in the catapult phase closs < c < csharp, during which the loss initially increases before decreasing. This discrepancy is likely due to different initialization and learning rate scaling in their work [33]. Ref. [35] examined the effect of hyperparameters on sharpness at late training times. Ref. [20] studied the optimization dynamics of SGD with momentum using sharpness. Ref. [45] classify training into 2 different regimes using training loss, providing a significantly coarser description of training dynamics than provided here. Ref. [33] studied the scaling of the maximum learning rate with d and w during early training in FCNs and its relationship with sharpness at initialization. Refs. [52, 71] present phase diagrams of shallow ReLU networks at infinite width under gradient flow. is the maximum learning rate for convergence Previous studies such as [41, 69] show that 2/λN T K . This limit results in the kernel regime as training time is restricted to O(1) in the as w limit of infinite width, resulting in a lazy training regime for learning rates less than 2/λN T K and divergent training for larger learning rates. In contrast, we analyze optimization dynamics at training timescales t⋆ that grow with width w. Specifically, the end of the early time transient period occurs at t⋆ log(w). → ∞ 0 0 Ref. [49] analyzed the training dynamics at large widths and training times, using the top eigenvalue of the neural tangent kernel (NTK) as a proxy for sharpness. They demonstrated the existence of a new early training phase, which they dubbed the "catapult" phase, 2/λN T K < η < ηmax, in wide networks trained with MSE loss using SGD, in which training converges after an initial increase in training loss. The existence of this new training regime was further extended to quadratic models with large widths by [72, 53]. Our work extends the above analysis by studying the combined effect of learning rate, depth, and width for both MSE and cross-entropy loss, demonstrating the opening 0 ∼ 3 Figure 2: Early training dynamics of (a, b, c) a shallow (d = 5, w = 512) and (d, e, f) a deep CNN (d = 10, w = 128) trained on CIFAR-10 with MSE loss for t = 10 steps using SGD for various learning rates η = c/λH 0 and batch size B = 512. (a, d) training loss, (b, e) sharpness, and (c, f) interpolated loss between the initial and final parameters after 10 steps for the respective models. For the shallow CNN, closs = 2.82, csharp = 5.65, cmax = 17.14 and for the deep CNN, closs = 36.75, csharp = 39.39, cmax = 48.50. of a sharpness-reduction phase, the refinement of the catapult phase into two phases depending on whether the sharpness also catapults, analyzing the phase boundaries as d and 1/w is increased, analyzing linear mode connectivity in the catapult phase, examining different qualitative behaviors in the intermediate saturation regime (ii) mentioned above. 2 Phase diagram of early transient regime For wide enough networks trained with MSE loss using SGD, training converges into a flatter region after an initial increase in the training loss for learning rates c > 2 [49]. Fig. 2(a, b) shows the first 10 steps of the loss and sharpness trajectories of a shallow (d = 5 and w = 512) CNN trained on 2.82, the loss catapults the CIFAR-10 dataset with MSE loss using SGD. For learning rates, c and training eventually converges into a flatter region, as measured by sharpness. Additionally, we observe that sharpness may also spike initially, similar to the training loss (see Fig. 2 (b)). However, 5.65), which we will this initial spike in sharpness occurs at relatively higher learning rates (c examine along with the loss catapult. We refer to this spike in sharpness as 'sharpness catapult.' ≥ ≥ An important consideration is the degree to which this phenomenon changes with network depth and width. Interestingly, we found that the training loss in deep networks on average catapults at much larger learning rates than c = 2. Fig. 2(d, e) shows that for a deep (d = 10, w = 128) CNN, the loss and sharpness may catapult only near the maximum trainable learning rate. In this section, we characterize the properties of the early training dynamics of models with MSE loss. In Appendix F, we show that a similar picture emerges for cross-entropy loss, despite the dynamics being noisier. 2.1 Loss and sharpness catapult during early training In this subsection, we characterize the effect of finite depth and width on the onset of the loss and sharpness catapult and training divergence. We begin by defining critical constants that correspond to the above phenomena. Definition 1. (closs, csharp, cmax) For learning rate η = c/λH step t be denoted by 0 , let the training loss and sharpness at t (c). We define closs(csharp) as minimum learning rates constants t(c) and λH L 4 0246810t(step)0.00.51.01.52.0Trainingloss(a)0246810t(step)0.20.40.60.81.01.2λHt/λH0(b)0.00.20.40.60.81.0s0.050.100.150.200.250.30Lint(s,c)(c)c2.03.04.05.78.00246810t(step)0.00.20.40.60.81.0Trainingloss(d)0246810t(step)0.00.51.01.52.0λHt/λH0(e)0.00.20.40.60.81.0s0.10.20.3Lint(s,c)(f)c2.05.711.322.645.3 (a) d = 8 (b) d = 7 (c) d = 18 (d) w = 512 (e) w = 1024 (f) w = 2048 Figure 3: Phase diagrams of early training of neural networks trained with MSE loss using SGD. Panels (a-c) show phase diagrams with width: (a) FCNs (d = 8) trained on the MNIST dataset, (b) CNNs (d = 7) trained on the Fashion-MNIST dataset, (c) ResNet (d = 18) trained on the CIFAR-10 (without batch normalization). Panels (d-f) show phase diagrams with depth: FCNs trained on the Fashion-MNIST dataset for different widths. Each data point in the figure represents an average of ten distinct initializations, and the solid lines represent a smooth curve fitted to the raw data points. The vertical dotted line shows c = 2 for comparison, and various colors are filled in between the various curves for better visualization. For experimental details and additional results, see Appendices A and C, respectively. The phase diagram of early training of FCNs with depth for three different widths trained on Fashion-MNIST with MSE loss using SGD. such that the loss (sharpness) increases during the initial transient period: closs = min c c { | max t∈[1,T1] L t(c) > 0(c) } , L csharp = min c { c | max t∈[1,T1] t (c) > λH λH 0 (c) , } and cmax as the maximum learning rate constant such that the loss does not diverge during the initial , where K is a fixed large constant.5. transient period: cmax = maxc t } ∀ Note that the definition of cmax allows for more flexibility than previous studies [33] in order to investigate a wider range of phenomena occurring near the maximum learning rate. Here, closs, csharp, and cmax are random variables that depend on the random initialization and the SGD batch sequence, and we denote the average over this randomness using t(c) < K, [1, T1] c { | L ∈ ⟩ ⟨ , ⟩ csharp , and ⟩ cmax ⟨ Fig. 3(a-c) illustrates the phase diagram of early training for three different architectures trained on various datasets with MSE loss using SGD. These phase diagrams show how the averaged values are affected by width. The results show that the averaged values of all closs ⟨ the critical constants increase significantly with 1/w (note the log scale). At large widths, the loss starts to catapult at c at cmax ⟨ ⟩ large 1/w. By comparison, sharpness starts to catapult at relatively large learning rates at small 1/w, with . Similar ⟩ results are observed for different depths as demonstrated in Appendix C. Phase diagrams obtained by varying d are qualitatively similar to those obtained by varying 1/w, as shown in Figure 3(d-f). may increase or decrease with 1/w in different settings while Comparatively, we observe that ⟨ consistently increasing with d, as shown in Appendices F and H. continuing to increase with 1/w while remaining between increases and eventually converges to 2. As 1/w increases, csharp ⟨ cmax cmax closs closs and ≈ ⟨ ⟩ ⟨ ⟩ ⟩ ⟨ ⟩ . ⟨*⟩ 5We use K = 105 to estimate cmax In all our experiments, L0 = O(1) (see Appendix A), which justifies the use of a fixed value. 5 2−12021222324c2−112−102−92−81/whclossihcsharpihcmaxihcbarrieri2−120212223242526c2−82−72−62−51/whclossihcsharpihcmaxihcbarrieri2−1202122232425c2−72−62−51/whclossihcsharpihcmaxihcbarrieri2−1202122232425c222324dhclossihcsharpihcmaxihcbarrieri2−12021222324c222324dhclossihcsharpihcmaxihcbarrieri2−12021222324c222324dhclossihcsharpihcmaxihcbarrieri (a) FCNs on MNIST (b) CNNs on Fashion-MNIST (c) ResNets on CIFAR-10 Figure 4: The relationship between critical constants for (a) FCNs, (b) CNNs, and (c) ResNets. Each data point corresponds to a run with varying depth, width, and initialization. The dashed line represents the y = x line. While we plotted the averaged quantities , we have observed that their , ⟩ ⟩ variance also increases significantly with d and 1/w; in Appendix C we show standard deviations about the averages for different random initializations. Nevertheless, we have found that the inequality cmax typically holds, for any given initialization and batch sequences, except for closs some outliers due to high fluctuations when the averaged critical curves start merging at large d and 1/w. Fig. 4 shows evidence of this claim. The setup is the same as in Fig. 3. Appendix D presents extensive additional results across various architectures and datasets. cmax ⟨ closs ⟨ csharp csharp , ⟩ ≤ ≤ ⟨ In Appendix F, we show that cross-entropy loss shows similar results with some notable differences. The loss catapults at a relatively higher value consistently decreases with 1/w, cmax. while still satisfying closs ≳ 4 and csharp cmax closs ⟨ ⟩ ⟨ ⟩ ≤ ≤ 2.2 Loss connectivity in the early transient period In the previous subsection, we observed that training loss and sharpness might quickly increase before decreasing ("catapult") during early training for a range of depths and widths. A logical next step is to analyze the region in the loss landscape that the training reaches after the catapult. Several works have analyzed loss connectivity along the training trajectory [21, 51, 64]. Ref. [51] report that training traverses a barrier at large learning rates, aligning with the naive intuition of a barrier between the initial and final points of the loss catapult, as the loss increases during early training. In this section, we will test the credibility of this intuition in real-world models. Specifically, we linearly interpolate the loss between the initial and final point after the catapult and examine the effect of the learning rate, depth, and width. The linearly interpolated loss and barrier are defined as follows. int(s, c), U (c)) Let θ0 represent the initial set of parameters, and let θT1 represent Definition 2. ( the set of parameters at the end of the initial transient period, trained using a learning rate constant c. Then, we define the linearly interpolated loss as [0, 1] is the interpolation parameter. The interpolated loss barrier is defined as the maximum value of the interpolated loss over the range of s: U (c) = maxs∈[0,1] L Here we subtracted the loss's initial value such that a positive value indicates a barrier to the final point from initialization. Using the interpolated loss barrier, we define cbarrier as follows. Definition 3. (cbarrier) Given the initial (θ0) and final parameters (θT1), we define cbarrier as the minimum learning rate constant such that there exists a barrier from θ0 to θT1: cbarrier = minc s) θ0 + s θT1 ], where s L int(s) int(s, c) = (θ0). − L [(1 − L L ∈ c { | U (c) > 0 . } Here, cbarrier is also a random variable that depends on the initialization and SGD batch sequence. We denote the average over this randomness using as before. Fig. 2(c, f) shows the interpolated loss of CNNs trained on the CIFAR-10 dataset for t = 10 steps. The experimental setup is the same as in Section 2. For the network with larger width, we observe a barrier emerging at cbarrier = 5.65, while the loss starts to catapult at closs = 2.83. In comparison, we do not observe any barrier from initialization to the final point at large d and 1/w. Fig. 3 shows the relationship between and 1/w for various models and datasets. We consistently observe that csharp cbarrier, suggesting that training traverses a barrier only when sharpness starts to catapult during early training. Similar results cbarrier ⟨ . ⟨ ≤ ⟩ ⟩ 6 2122232425csharp2122232425closscmax2122232425csharp2122232425closscmax2122232425csharp2122232425closscmax (a) (b) (c) Figure 5: (a) Normalized sharpness measured at cτ = 200 against the learning rate constant for 7- layer CNNs trained on the CIFAR-10 dataset, with varying widths. Each data point is an average over 5 initializations, where the shaded region depicts the standard deviation around the mean trend. (b, c) Smooth estimations of the first two derivatives, χτ and χ′ τ , of the averaged normalized sharpness wrt the learning rate constant. The vertical lines denote ccrit estimated using the maximum of χ′ τ . For smoothening details, see Appendix I.2. were observed on increasing d instead of 1/w as shown in Appendix C. We chose not to characterize the phase diagram of early training using cbarrier as we did for other critical c's, as it is somewhat different in character than the other critical constants, which depend only on the sharpness and loss trajectories. These observations call into question the intuition of catapulting out of a basin for a range of learning rates in between closs < c < cbarrier. These results show that for these learning rates, the final point after the catapult already lies in the same basin as initialization, and even connected through a linear path, revealing an inductive bias of the training process towards regions of higher loss during the early time transient regime. 3 Intermediate saturation regime In the intermediate saturation regime, sharpness does not change appreciably and reflects the cumula- tive change that occurred during the initial transient period. This section analyzes sharpness in the in- termediate saturation regime by studying how it changes with the learning rate, depth, and width of the model. Here, we show results for MSE loss, whereas cross-entropy results are shown in Appendix F. We measure the sharpness λH τ at a time τ in the middle of the intermediate saturation regime. We 200.6 For further details on sharpness measurement, see Appendix I.1. Fig. choose τ so that cτ ≈ 5(a) illustrates the relationship between λH τ and the learning rate for 7-layer deep CNNs trained on the CIFAR-10 dataset with varying widths. The results indicate that the dependence of λH τ on learning rate can be grouped into three distinct stages. (1) At small learning rates, λH τ remains relatively constant, with fluctuations increasing as d and 1/w increase (c < 2 in Fig. 5(a)). (2) A crossover regime where λH τ is dropping significantly (2 < c < 23 in Fig. 5(a)). (3) A saturation stage where λH τ stays small and constant with learning rate (c > 23) in Fig. 5(a)). In Appendix I, we show that these results are consistent across architectures and datasets for varying values of d and w. Additionally, the results reveal that in stage (1), where c < 2 is sub-critical, λH τ decreases with increasing d and 1/w. In other words, for small c and in the intermediate saturation regime, the loss is locally flatter as d and 1/w increase. We can precisely extract a critical value of c that separates stages (1) and (2), which corresponds to the onset of an abrupt reduction of sharpness λH τ . To do this, we consider the averaged normalized . The first two derivatives of the averaged sharpness over initializations and denote it by ∂ λH normalized sharpness, χτ = , characterize the change in τ /λH ∂c ⟨ 0 ⟩ sharpness with learning rate. The extrema of χ′ τ quantitatively define the boundaries between the three stages described above. In particular, using the maximum of χ′ , which marks τ , we define ⟩ the beginning of the sharp decrease in λH λH τ /λH 0 ⟩ ⟨ and χ′ τ = τ with the learning rate. λH τ /λH 0 ⟩ ccrit ⟨ ∂2 ∂c2 ⟨ − − 6time-step τ = 200/c is in the middle of regime (ii) for the models studied. Normalizing by c allows proper comparison for different learning rates. 7 2−12021222324c0.00.20.40.60.8λHτ/λH0width1282565122−12021222324c0.00.10.20.30.4χτwidth1282565122−12021222324c−0.3−0.2−0.10.00.10.20.3χ0τwidth128256512 (a) vanilla (b) centered (c) last layer zero at init Figure 6: Phase diagrams of d = 8 layer FCNs trained on the CIFAR-10 dataset using MSE, demonstrating the effect of output scale at initialization: (a) vanilla network, (b) centered network, and (c) network initialized with the last layer set to zero. λH Definition 4. ( τ /λH 0 ⟩ ⟨ ccrit to be the learning rate constant that minimizes its second derivative: ) Given the averaged normalized sharpness ⟩ ccrit ⟨ measured at τ , we define ccrit ⟨ = arg maxc χ′ τ . ⟩ ⟨ . ⟩ to denote that the critical constant is obtained from the averaged normalized Here, we use sharpness. Fig. 5(b, c) show χτ and χ′ τ obtained from the results in Fig. 5(a). We observe similar results across various architectures and datasets, as shown in Appendix I. Our results show that has slight fluctuations as d and 1/w are changed but generally stay in the vicinity of c = 2. ccrit ⟨ ⟩ The peak in χ′ τ becomes wider as d and 1/w increase, indicating that the transition between stages (1) and (2) becomes smoother, presumably due to larger fluctuations in the properties of the Hessian H increase with d and 1/w, implying the opening of the at initialization. In contrast to sharpness reduction phase as d and 1/w increase. In Appendix F, we show that ⟩ cross-entropy loss shows qualitatively similar results, but with 2 ≲ , closs ⟨ ⟩ < c < ⟨ ccrit ⟨ ⟩ closs ≲ 4. ccrit ⟨ ⟩ ccrit ⟨ ⟩ 4 Effect of network output at initialization on early training Here we discuss the effect of network output f (x; θt) at initialization on the early training dynamics. x is the input and θt denotes the set of parameters at time t. We consider setting the network output to zero at initialization, f (x; θ0) = 0, by either (1) considering the "centered" network: fc(x; θ) = f (x; θ) f (x; θ0), or (2) setting the last layer weights to zero at initialization (for details, see Appendix G). Remarkably, both (1) and (2) remove the opening up of the sharpness reduction phase with 1/w as shown in Figure 6. The average onset of the loss catapult, diagnosed by , ⟩ becomes independent of 1/w and d. closs − ⟨ We also empirically study the impact of the output scale [19, 5, 4] on early training dynamics. Given a network function f (x; θ), we define the scaled network as fs(x; θ) = αf (x; θ), where α is a scalar, f (x; θ0) fixed throughout training. In Appendix H, we show that a large (resp. small) value of ∥ ∥ relative to the one-hot encodings of the labels causes the sharpness to decrease (resp. increase) during early training. Interestingly, we still observe an increase in with d and 1/w, unlike the case of initializing network output to zero, highlighting the unique impact of output scale on the dynamics. closs ⟨ ⟩ 5 Insights from a simple model Here we analyze a two-layer linear network [57, 60, 49], the uv model, which shows much of the Rw are the phenomena presented above. Define f (x) = 1√ w vT ux, with x, f (x) 1, . . . , w trainable parameters, initialized using the normal distribution, ui, vi . } The model is trained with MSE loss on a single training example (x, y) = (1, 0), which simplifies (u, v) = f 2/2, and which was also considered in Ref. [49]. Our choice of y = 0 is the loss to motivated by the results of Sec. 4, which suggest that the empirical results of Sec. 2 are intimately relative to the output labels. We related to the model having a large initial output scale minimize the loss using gradient descent (GD) with learning rate η. The early time phase diagram also shows similar features to those described in preceding sections (compare Fig. 7(a) and Fig. 3). Below we develop an understanding of this early time phase diagram in the uv model. R. Here, u, v (0, 1) for i f (x; θ0) ∥ ∈ ∼ N ∈ ∈ { L ∥ 8 2−12123c2−112−102−92−81/whclossihcsharpihcmaxi2−12021222324c2−112−102−92−81/whclossihcsharpihcmaxi2−12021222324c2−112−102−92−81/whclossihcsharpihcmaxi (a) (b) (c) Figure 7: The phase diagram of the uv model trained with MSE loss using gradient descent with (a) the top eigenvalue of Hessian λH t , (b) the trace of Hessian tr(Ht) and (c) the square of the Frobenius norm tr(H T t Ht) used as a measure of sharpness. In (a), the learning rate is scaled as η = c/λH 0 , while in (b) and (c), the learning rate is scaled as η = k/tr(H0). The vertical dashed line shows c = 2 (k = 2) for reference. Each data point is an average over 500 random initializations. The update equations of the uv model in function space can be written in terms of the trace of the Hessian tr(H) ft+1 = ft 1 (cid:18) η tr(Ht) + − η2f 2 t w , tr(Ht+1) = tr(Ht) + ηf 2 t w (η tr(Ht) − 4) . (1) (cid:19) 0 = kλH From the above equations, it is natural to scale the learning rate as η = k/tr(H0). Note that c = ηλH 0 /tr(H0). Also, we denote the critical constants in this scaling as kloss, ktrace, kmax and kcrit, where the definitions follow from Definitions 1 and 4 on replacing sharpness with trace to denote an average over initialization. Figure 7(b) shows the phase diagram of early and use training, with tr(Ht) replaced with λH t as the measure of sharpness and with the learning rate scaled as η = k/tr(H0). Similar to Figure 7(a), we observe a new phase opening up kcrit at small width. However, we do not observe the loss-sharpness catapult phase as tr(H) does not increase during training (see Equation 1). We also observe ⟨ = 4, independent of width. < k < kloss . ⟩ ⟨ ⟩ ⟨ ⟩ kmax ⟩ In Appendix B.3, we show that the critical value of k for which which explains why ⟩ up of the sharpness reduction phase as w is decreased. increases with 1/w. Combined with kloss ⟨ ⟨ L1/L0 ⟨ kcrit ⟨ ⟩ ≈ > 1 increases with 1/w, ⟩ 2, this implies the opening is difficult to analyze, we consider the Frobenius norm To understand the loss-sharpness catapult phase, we require some other measure as tr(H) does not increase for 0 < k < 4. As λH F = t ∥ tr(H T H) as a proxy for sharpness. We define kf rob as the minimum learning rate such that 2 F increases during early training. Figure 7(c) shows the phase diagram of the uv model, with Ht (cid:112) || || 2 F as the measure of sharpness, while the learning rate is scaled as η = k/tr(H0). We observe Ht || || the loss-sharpness catapult phase at small widths. In Appendix B.4, we show that the critical value as 1/w increases. This explains the of k for which H0 opening up of the loss catapult phase at small w in Fig. 7 (c). > 0 increases from 2 F − || || 2 F || kloss H1 H || ∥ ⟨ ⟩ (cid:10) (cid:11) Fig. 8 shows the training trajectories of the uv model with large (w = 512) and small (w = 2) widths in a two-dimensional slice of parameters defined by tr(H) and weight correlation ⟨v,u⟩/||u||||v||. The above figure reveals that the first few training steps of the small-width network take the system in a flatter direction (as measured by tr(H)) as compared to the wider network. This means that the small-width network needs a relatively larger learning rate to get to a point of increased loss (loss catapult). We thus have the opening up of a new regime , in which the loss and ⟩ ⟨ sharpness monotonically decrease during early training. kloss ⟨ < k < kcrit ⟩ The loss landscape of the uv model shown in Fig. 8 reveals interesting insights into the loss landscape connectivity results in Section 2.2 and the presence of cbarrier. Fig. 8 shows how even when there is a loss catapult, as long as the learning rate is not too large, the final point after the catapult can be reached from initialization by a linear path without increasing the loss and passing through a barrier. However if the learning rate becomes large enough, then the final point after the catapult may correspond to a region of large weight correlation, and there will be a barrier in the loss upon linear interpolation. The uv model trained on an example (x, y) with y = 0 provides insights into the effect of network output at initialization observed in Section 4. In Appendix G, we show that setting f0 = 0 and 9 1234c2−62−52−42−32−22−11/whclossihcsharpihcmaxi1234k2−62−52−42−32−22−11/whklossihktraceihkmaxi1234k2−62−52−42−32−22−11/whklossihkfrobihkmaxi̸ Figure 8: Training trajectories of the uv model trained on (x, y) = (1, 0), with (a, b) large and (c, d) small width, in a two-dimensional slice of the parameters defined by the trace of Hessian tr(H) and weight correlation, trained with (a, c) small (c = 0.5) and (b, d) large (c = 2.5) learning rates. The colors correspond to the training loss , with darker colors representing a smaller loss. L = 0 in the dynamical equations results in loss catapult at k = 2, implying y irrespective of w. kloss ⟨ ⟩ ≈ ⟨ kcrit ⟩ ≈ 2, 6 Discussion We have studied the effect of learning rate, depth, and width on the early training dynamics in DNNs trained using SGD with learning rate scaled as η = c/λH 0 . We analyzed the early transient and intermediate saturation regimes and presented a rich phase diagram of early training with learning rate, depth, and width. We report two new phases, sharpness reduction and loss-sharpness catapult, which have not been reported previously. Furthermore, we empirically investigated the underlying cause of sharpness reduction during early training. Our findings show that setting the network output to zero at initialization effectively leads to the vanishing of sharpness reduction phase at supercritical learning rates. We further studied loss connectivity in the early transient regime and demonstrated the , in which the final point after the catapult lies in the existence of a regime ⟩ same basin as initialization, connected through a linear path. Finally, we study these phenomena in a 2-layer linear network (uv model), gaining insights into the opening of the sharpness reduction phase. closs ⟨ cbarrier < c < ⟩ ⟨ We performed a preliminary analysis on the effect of batch size on the presented results in Appendix J. The sharpness trajectories of models trained with a smaller batch size (B = 32 vs. B = 512) show similar early training dynamics. In the early transient regime, we observe a qualitatively similar phase diagram. In the intermediate saturation regime, the effect of reducing the batch size is to broaden the transition around ccrit. 4 at large In Section 2, we noted that for cross-entropy loss, the loss starts to catapult around c widths, as compared to closs = 2 for MSE loss. Previous work, such as [50], analyzed the catapult dynamics for the uv model with logistic loss and demonstrated that the loss catapult occurs above ηloss = 4/λN T K . We summarize the main intuition about their analysis in Appendix B.9. However, a complete understanding of the catapult phenomenon in the context of cross-entropy loss requires a more detailed examination. ≈ 0 The early training dynamics is sensitive to the initialization scheme and optimization algorithm used, and we leave it to future work to explore this dependence and its implications. In this work, we focused on models initialized at criticality [55] as it allows for proper gradient flow through ReLU networks at initialization [23, 58], and studied vanilla SGD for simplicity. However, other initializations [46], parameterizations [69, 70], and optimization procedures [22] may show dissimilarities with the reported phase diagram of early training. 10 −1.0−0.50.00.51.0weightcorrelation012Tr(H)(a)−1.0−0.50.00.51.0weightcorrelation(b)−1.0−0.50.00.51.0weightcorrelation(c)−1.0−0.50.00.51.0weightcorrelation(d)10−210−1100101102103̸ Acknowledgments We thank Andrey Gromov, Tianyu He, and Shubham Jain for discussions, and Paolo Glorioso, Sho Yaida, Daniel Roberts, and Darshil Doshi for detailed comments on the manuscript. We also express our gratitude to anonymous reviewers for their valuable feedback for improving the manuscript. This work is supported by an NSF CAREER grant (DMR1753240) and the Laboratory for Physical Sciences through the Condensed Matter Theory Center. References [1] Alessandro Achille, Matteo Rovere, and Stefano Soatto. Critical learning periods in deep In International Conference on Learning Representations, 2019. URL https: networks. //openreview.net/forum?id=BkeStsCcKQ. [2] Atish Agarwala, Fabian Pedregosa, and Jeffrey Pennington. Second-order regression models exhibit progressive sharpening to the edge of stability. ArXiv, abs/2210.04860, 2022. [3] Sanjeev Arora, Zhiyuan Li, and Abhishek Panigrahi. Understanding gradient descent on edge of stability in deep learning. In International Conference on Machine Learning, 2022. [4] Alexander Atanasov, Blake Bordelon, Sabarish Sainathan, and Cengiz Pehlevan. The onset In The Eleventh of variance-limited behavior for networks in the lazy and rich regimes. International Conference on Learning Representations, 2023. URL https://openreview. net/forum?id=JLINxPOVTh7. [5] Blake Bordelon and Cengiz Pehlevan. Self-consistent dynamical field theory of kernel evolution in wide neural networks. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022. URL https:// openreview.net/forum?id=sipwrPCrIS. [6] Blake Bordelon and Cengiz Pehlevan. Dynamics of finite width kernel and prediction fluctua- tions in mean field neural networks. ArXiv, abs/2304.03408, 2023. [7] James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax. [8] Jeremy Cohen, Simran Kaur, Yuanzhi Li, J Zico Kolter, and Ameet Talwalkar. Gradient descent on neural networks typically occurs at the edge of stability. In International Conference on Learn- ing Representations, 2021. URL https://openreview.net/forum?id=jh-rTtvkGeM. [9] Alex Damian, Eshaan Nichani, and Jason D. Lee. Self-stabilization: The implicit bias of gradient descent at the edge of stability. In OPT 2022: Optimization for Machine Learning (NeurIPS 2022 Workshop), 2022. URL https://openreview.net/forum?id=enoU_Kp7Dz. [10] Li Deng. The mnist database of handwritten digit images for machine learning research. IEEE Signal Processing Magazine, 29(6):141–142, 2012. [11] Ethan Dyer and Guy Gur-Ari. Asymptotics of wide networks from feynman diagrams. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id=S1gFvANKDS. [12] Gintare Karolina Dziugaite and Daniel M. Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. In Gal Elidan, Kristian Kersting, and Alexander Ihler, editors, Proceedings of the Thirty-Third Conference on Uncertainty in Artificial Intelligence, UAI 2017, Sydney, Australia, August 11-15, 2017. AUAI Press, 2017. URL http://auai.org/uai2017/proceedings/papers/173. pdf. [13] Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, Journal of and Samy Bengio. Why does unsupervised pre-training help deep learning? Machine Learning Research, 11(19):625–660, 2010. URL http://jmlr.org/papers/v11/ erhan10a.html. 11 [14] Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware min- imization for efficiently improving generalization. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=6Tm1mposlrM. [15] Stanislav Fort and Surya Ganguli. Emergent properties of the local geometry of neural loss landscapes. ArXiv, abs/1910.05929, 2019. [16] Stanislav Fort, Gintare Karolina Dziugaite, Mansheej Paul, Sepideh Kharaghani, Daniel M. an empirical tangent ker- In NeurIPS, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/ Roy, and Surya Ganguli. study of loss landscape geometry and the time evolution of the neural nel. 405075699f065e43581f27d67bb68478-Abstract.html. Deep learning versus kernel learning: [17] Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M. Roy, and Michael Carbin. Linear mode connectivity and the lottery ticket hypothesis. In Proceedings of the 37th International Conference on Machine Learning, ICML'20. JMLR.org, 2020. [18] Mario Geiger, Leonardo Petrini, and Matthieu Wyart. Perspective: A phase diagram for deep learning unifying jamming, feature learning and lazy training, 2020. [19] Mario Geiger, Stefano Spigler, Arthur Jacot, and Matthieu Wyart. Disentangling feature and lazy training in deep neural networks. Journal of Statistical Mechanics: Theory and Experiment, 2020(11):113301, nov 2020. doi: 10.1088/1742-5468/abc4de. URL https://dx.doi.org/ 10.1088/1742-5468/abc4de. [20] Justin Gilmer, Behrooz Ghorbani, Ankush Garg, Sneha Kudugunta, Behnam Neyshabur, David Cardoze, George Edward Dahl, Zachary Nado, and Orhan Firat. A loss curvature perspective on training instabilities of deep learning models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=OcKMT-36vUs. [21] Ian J. Goodfellow and Oriol Vinyals. Qualitatively characterizing neural network optimization In Yoshua Bengio and Yann LeCun, editors, 3rd International Conference on problems. Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6544. [22] Priya Goyal, Piotr Dollár, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. ArXiv, abs/1706.02677, 2017. [23] Boris Hanin. Which neural net architectures give rise to exploding and vanishing gradients? In Neural Information Processing Systems, 2018. [24] Boris Hanin and Mihai Nica. Finite depth and width corrections to the neural tangent kernel. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id=SJgndT4KwB. [25] Boris Hanin and David Rolnick. How to start training: The effect of initialization and architec- ture. In Neural Information Processing Systems, 2018. [26] Soufiane Hayou, A. Doucet, and Judith Rousseau. On the selection of initialization and activation function for deep neural networks. ArXiv, abs/1805.08266, 2018. [27] Soufiane Hayou, A. Doucet, and Judith Rousseau. Exact convergence rates of the neural tangent kernel in the large depth limit. 2019. [28] Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. 2015 IEEE International Conference on Computer Vision (ICCV), pages 1026–1034, 2015. [29] Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016. 12 [30] Jonathan Heek, Anselm Levskaya, Avital Oliver, Marvin Ritter, Bertrand Rondepierre, Andreas Steiner, and Marc van Zee. Flax: A neural network library and ecosystem for JAX, 2020. URL http://github.com/google/flax. [31] Sepp Hochreiter and Jürgen Schmidhuber. Simplifying neural nets by discovering flat minima. Advances in neural information processing systems, 7, 1994. [32] Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural computation, 9(1):1–42, 1997. [33] Gaurav Iyer, Boris Hanin, and David Rolnick. Maximal initial learning rates in deep relu networks. ArXiv, abs/2212.07295, 2022. [34] Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: convergence and generalization in neural networks (invited paper). Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing, 2018. [35] Stanislaw Jastrzebski, Maciej Szymczak, Stanislav Fort, Devansh Arpit, Jacek Tabor, Kyunghyun Cho*, and Krzysztof Geras*. The break-even point on optimization trajectories of deep neural networks. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=r1g87C4KwB. [36] Stanisław Jastrz ̨ebski, Zac Kenton, Devansh Arpit, Nicolas Ballas, Asja Fischer, Amos Storkey, and Yoshua Bengio. Three factors influencing minima in SGD, 2018. URL https:// openreview.net/forum?id=rJma2bZCW. [37] Stanisław Jastrz ̨ebski, Zachary Kenton, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amost Storkey. On the relation between the sharpest directions of DNN loss and the SGD step length. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id=SkgEaj05t7. [38] Stanisław Jastrz ̨ebski, Zachary Kenton, Nicolas Ballas, Asja Fischer, Yoshua Bengio, and Amost Storkey. On the relation between the sharpest directions of DNN loss and the SGD step length. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id=SkgEaj05t7. [39] Yiding Jiang*, Behnam Neyshabur*, Hossein Mobahi, Dilip Krishnan, and Samy Bengio. Fantastic generalization measures and where to find them. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=SJgIPJBFvH. [40] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. [41] Ryo Karakida, Shotaro Akaho, and Shun ichi Amari. Universal statistics of fisher information in deep neural networks: Mean field approach, 2019. [42] Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. In International Conference on Learning Representations, 2017. URL https://openreview. net/forum?id=H1oyRlYgg. [43] Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. In NIPS, pages 972–981, 2017. URL http://papers.nips.cc/paper/ 6698-self-normalizing-neural-networks. [44] Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009. [45] Guillaume Leclerc and Aleksander Madry. The two regimes of deep network training. ArXiv, abs/2002.10376, 2020. [46] Yann LeCun, Léon Bottou, Genevieve B. Orr, and Klaus-Robert Müller. Efficient backprop. In Neural Networks, 2012. 13 [47] Jaehoon Lee, Jascha Sohl-dickstein, Jeffrey Pennington, Roman Novak, Sam Schoenholz, and Yasaman Bahri. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=B1EA-M-0Z. [48] Jaehoon Lee, Lechao Xiao, Samuel S. Schoenholz, Yasaman Bahri, Roman Novak, Jascha Narain Sohl-Dickstein, and Jeffrey S. Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. Journal of Statistical Mechanics: Theory and Experiment, 2020, 2019. [49] Aitor Lewkowycz, Yasaman Bahri, Ethan Dyer, Jascha Sohl-Dickstein, and Guy Gur-Ari. The large learning rate phase of deep learning: the catapult mechanism. ArXiv, abs/2003.02218, 2020. [50] Chunrui Liu, Wei Huang, and Richard Yi Da Xu. Implicit bias of deep learning in the large learning rate phase: A data separability perspective. Applied Sciences, 13(6), 2023. ISSN 2076- 3417. doi: 10.3390/app13063961. URL https://www.mdpi.com/2076-3417/13/6/3961. [51] James Lucas, Juhan Bae, Michael R Zhang, Stanislav Fort, Richard Zemel, and Roger Grosse. Analyzing monotonic linear interpolation in neural network loss landscapes. arXiv preprint arXiv:2104.11044, 2021. [52] Tao Luo, Zhi-Qin John Xu, Zheng Ma, and Yaoyu Zhang. Phase diagram for two-layer relu neural networks at infinite-width limit, 2020. [53] David Meltzer and Junyu Liu. Catapult dynamics and phase transitions in quadratic nets. ArXiv, abs/2301.07737, 2023. [54] Roman Novak, Lechao Xiao, Jiri Hron, Jaehoon Lee, Alexander A. Alemi, Jascha Sohl- Dickstein, and Samuel S. Schoenholz. Neural tangents: Fast and easy infinite neural networks in python. In International Conference on Learning Representations, 2020. URL https: //openreview.net/forum?id=SklD9yrFPS. [55] Ben Poole, Subhaneil Lahiri, Maithra Raghu, Jascha Sohl-Dickstein, and Surya Ganguli. Exponential expressivity in deep neural networks through transient chaos. In NIPS, 2016. [56] Jasson D. M. Rennie and Nathan Srebro. Fast maximum margin matrix factorization for collaborative prediction. In Proceedings of the 22nd International Conference on Machine Learning, ICML '05, page 713–719, New York, NY, USA, 2005. Association for Computing Machinery. ISBN 1595931805. doi: 10.1145/1102351.1102441. URL https://doi.org/10. 1145/1102351.1102441. [57] Jasson D. M. Rennie and Nathan Srebro. Fast maximum margin matrix factorization for collaborative prediction. In Proceedings of the 22nd International Conference on Machine Learning, ICML '05, page 713–719, New York, NY, USA, 2005. Association for Computing Machinery. ISBN 1595931805. doi: 10.1145/1102351.1102441. URL https://doi.org/10. 1145/1102351.1102441. [58] Daniel A. Roberts, Sho Yaida, and Boris Hanin. The Principles of Deep Learning Theory. Cambridge University Press, 2022. https://deeplearningtheory.com. [59] Abraham. Savitzky and M. J. E. Golay. Smoothing and differentiation of data by simplified least squares procedures. Analytical Chemistry, 36(8):1627–1639, 1964. doi: 10.1021/ac60214a047. URL https://doi.org/10.1021/ac60214a047. [60] Andrew M. Saxe, James L. McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. CoRR, abs/1312.6120, 2014. [61] Vaishaal Shankar, Alexander W. Fang, Wenshuo Guo, Sara Fridovich-Keil, Ludwig Schmidt, Jonathan Ragan-Kelley, and Benjamin Recht. Neural kernels without tangents. In ICML, 2020. [62] Jascha Narain Sohl-Dickstein, Roman Novak, Samuel S. Schoenholz, and Jaehoon Lee. On the infinite width limit of neural networks with a standard parameterization. ArXiv, abs/2001.07301, 2020. 14 [63] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson, C J Carey, ̇Ilhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman, Ian Henriksen, E. A. Quintero, Charles R. Harris, Anne M. Archibald, Antônio H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17:261–272, 2020. doi: 10.1038/s41592-019-0686-2. [64] Tiffany J. Vlaar and Jonathan Frankle. What can linear interpolation of neural network loss landscapes tell us? In International Conference on Machine Learning, 2021. [65] Zixuan Wang, Zhouzi Li, and Jian Li. Analyzing sharpness along GD trajectory: Progressive sharpening and edge of stability. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=thgItcQrJ4y. [66] Lei Wu, Chao Ma, and Weinan E. How sgd selects the global minima in over-parameterized learning: A dynamical stability perspective. In S. Bengio, H. Wallach, H. Larochelle, K. Grau- man, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips. cc/paper/2018/file/6651526b6fb8f29a00507de6a49ce30f-Paper.pdf. [67] Han Xiao, Kashif Rasul, and Roland Vollgraf. image dataset for benchmarking machine learning algorithms, 2017. URL http://arxiv. org/abs/1708.07747. cite arxiv:1708.07747Comment: Dataset is freely available at https://github.com/zalandoresearch/fashion-mnist Benchmark is available at http://fashion- mnist.s3-website.eu-central-1.amazonaws.com/. Fashion-mnist: a novel [68] Sho Yaida. Meta-principled family of hyperparameter scaling strategies. ArXiv, abs/2210.04909, 2022. [69] Greg Yang and Edward J. Hu. Tensor programs iv: Feature learning in infinite-width neural networks. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 11727–11737. PMLR, 18–24 Jul 2021. URL https://proceedings.mlr.press/ v139/yang21c.html. [70] Greg Yang, Edward J. Hu, Igor Babuschkin, Szymon Sidor, Xiaodong Liu, David Farhi, Nick Ryder, Jakub W. Pachocki, Weizhu Chen, and Jianfeng Gao. Tensor programs v: Tuning large neural networks via zero-shot hyperparameter transfer. In Neural Information Processing Systems, 2022. [71] Hanxu Zhou, Qixu Zhou, Zhenyuan Jin, Tao Luo, Yaoyu Zhang, and Zhi-Qin John Xu. Empirical phase diagram for three-layer neural networks with infinite width. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=ZgWT_u19Ue5. [72] Libin Zhu, Chaoyue Liu, Adityanarayanan Radhakrishnan, and Mikhail Belkin. Quadratic models for understanding neural network dynamics. ArXiv, abs/2205.11787, 2022. 15 A Experimental details Datasets: We considered the MNIST [10], Fashion-MNIST [67], and CIFAR-10 [44] datasets. We standardized the images and used one-hot encoding for the labels. Models: We considered fully connected networks (FCNs), Myrtle family CNNs [61] and ResNets (version 1) [29] trained using the JAX [7], and Flax libraries [30]. We use d and w to denote the depth and width of the network. Below, we provide additional details of the models and clarify what width corresponds to for CNNs and ResNets. 1. FCNs: We considered ReLU FCNs with constant width w in Neural Tangent Parameteriza- tion (NTP) / Standard Parameterization (SP), initialized at criticality [55]. The models do not include bias or normalization. The forward pass of the pre-activations from layer l to l + 1 is given by w hl+1 i = γl W l ijφ(hl j), (2) j (cid:88) where φ(.) is the ReLU activation and γl is a constant. For NTP, γl = 2/√ W l are initialized using normal distribution, i.e., W l weights W l are initialized as W l NTP and W L (0, 1/w) for SP. For d/w ≳ 1/16, the dynamics is noisier, and it becomes challenging to separate the underly- ing deterministic dynamics from random fluctuations (see Appendix E). w and the weights (0, 1). For SP, γl = 1 and the w for (0, 2/w). For the last layer, we have γL = 1/√ ij ∼ N ij ∼ N ij ∼ N 2. CNNs: We considered Myrtle family ReLU CNNs [61] without any bias or normalization in Standard Parameterization (SP), initialized using He initialization [29]. The above model uses a fixed number of channels in each layer, which we refer to as the width of the network. In this case, the forward pass equations for the pre-activations from layer l to layer l + 1 are given by w hl+1 i (α) = W l+1 ij (β)φ(hl i(α + β)), (3) j (cid:88) where α, β label the spacial location. The weights are initialized as W l where k is the filter size. β∈ker (cid:88) ij(β) (0, 2/k2w), ∼ N 3. ResNets: We considered version 1 ResNet [29] implementations from Flax examples without Batch Norm or regularization. For ResNets, width corresponds to the number of channels in the first block. For example, the standard ResNet-18 has four blocks with widths [w, 2w, 4w, 8w], with w = 64. We refer to w as the width or the widening factor. We considered ResNet-18 and ResNet-34. All the models are trained with the average loss over the batch L(x, yDB ) = 1/B initialization, ensures that the loss is (cid:80) B μ=1, i.e., B μ=1 l(xμ, yμ), where l(.) is the loss function. This normalization, along with (1) at initialization. (xμ, yμ) } { Bias: Throughout this work, we have primarily focused on models without any bias for simplicity. In Appendix K, we demonstrate that bias does not have an appreciable impact on the results. B = O D Batch size: We use a batch size of 512 and scale the learning rate as η = c/λH unless specified. Appendix J shows results for a smaller batch size B = 32. Learning rate: We scale the learning rate constant as c = 2x, with x 0.1. Here, xmax is related to the maximum learning rate constant as cmax = 2xmax. Sharpness measurement: We measure sharpness using the power iteration method with 20 iterations. We found that 20 iterations suffice both for MSE and cross-entropy loss. For MSE loss, we use m = 2048 randomly selected training examples for evaluating sharpness at each step. In comparison, we found that cross-entropy requires a large number of training examples to obtain a good approximation 0 in all our experiments, 1.0, . . . xmax in steps of ∈ {− } 16 of sharpness. Given the computational constraints, we use 4096 training examples to approximate sharpness for cross-entropy loss. Averages over initialization and SGD runs: All the critical constants depend on both the random initializations and the SGD runs. In our experiments, we found that the fluctuations from initial- ization at large d/w outweigh the randomness coming from different SGD runs. Thus, we focus on initialization averages in all our experiments. A.1 Compute usage We utilized different computational resources depending on the task complexity. For less demanding tasks, we performed computation for a total of 2800 hours, utilizing a seventh of an NVIDIA A100 GPU. For more computationally intensive tasks, we utilized a full NVIDIA A100 GPU for a total 300 hours. A.2 Reproducibility The main results of this paper can be reproduced using the associated GitHub reposi- tory:https://github.com/dayal-kalra/early-training. A.3 Details of Figures in the main text: Figure 1: A shallow CNN (d = 5, w = 128) in SP trained on the CIFAR-10 dataset with MSE 0 and batch size B = 512. We measure loss for 1000 epochs using SGD with learning rates η = c/λH sharpness at every step for the first epoch, every epoch between 10 and 100 epochs, and every 10 epochs beyond 100. Figure 2: (top panel) A wide (d = 5, w = 512) and (bottom panel) a deep CNN (d = 10, w = 128) in SP trained on the CIFAR-10 dataset with MSE loss for t = 10 steps using vanilla SGD with learning rates η = c/λH 0 and batch size B = 512. Figure 3: Phase diagrams of early training of neural networks trained with MSE loss using SGD. Panels (a-c) show phase diagrams with width: (a) FCNs (d = 8) trained on the MNIST dataset, (b) CNNs (d = 7) trained on the Fashion-MNIST dataset, (c) ResNet (d = 18) trained on the CIFAR-10 (without batch normalization). Panels (d-f) show phase diagrams with depth: FCNs trained on the Fashion-MNIST dataset for different widths. Each data point in the figure represents an average of ten distinct initializations, and the solid lines represent a two-degree polynomial y = a + bx + cx2 fitted to the raw data points. Here, where x = 1/w, and y can take on one of three values: closs, csharp and cmax. Figure 4: (a) FCNs in SP with d dataset, (b) CNNs in SP with d MNIST dataset, (c) ResNet in SP with d dataset (without batch normalization). ∈ { ∈ { and w and w 4, 8, 16 } 5, 7, 10 } 18, 34 } ∈ { ∈ { ∈ { and w 256, 512, 1024, 2048 trained on the MNIST } 64, 128, 256, 512 trained on the Fashion- } 32, 64, 128 trained on the CIFAR-10 } ∈ { Figure 6: Phase diagrams of d = 8 layer FCNs trained on the CIFAR-10 dataset using MSE, demonstrating the effect of output scale at initialization: (a) vanilla network, (b) centered network, and (c) network initialized with the last layer set to zero. The values of widths are the same as in Figure fig. 3. Figure 5: Normalized sharpness measured at cτ = 200 against the learning rate constant for 7-layer CNNs in SP trained on the CIFAR-10 dataset, with w . Each data point is an } average over five random initialization. Smoothening details are provided in Appendix I.2. 128, 256, 512 ∈ { Figure 7: The phase diagram of the uv model trained with MSE loss using gradient descent with (a) the top eigenvalue of Hessian λH t , (b) the trace of Hessian tr(Ht) and (c) the square of the Frobenius norm tr(H T t Ht) used as a measure of sharpness. In (a), the learning rate is scaled as η = c/λH 0 , while in (b) and (c), the learning rate is scaled as η = k/tr(H0). The vertical dashed line shows c = 2 (k = 2) for reference. Each data point is an average over 500 random initializations. Figure 8: Training trajectories of the uv model with (a, b) large (w = 512) and (c, d) small (w = 2) width, trained for t = 10 training steps on a single example (x, y) = (1, 0) with MSE loss using vanilla gradient descent with learning rates (a, c) c = 0.5 and (b, d) c = 2.50. 17 (a) (b) Figure 9: Training trajectories of the uv model with (a) large (w = 512) and (v) a small (w = 2) widths trained for t = 10 training steps on a single example (x, y) = (1, 0). For the wide network, closs = 2.1, csharp = 2.6, cmax = 4.0, and for the narrow network, closs = 3.74, csharp = 4.63, cmax = 4.93. B Additional results for the uv model B.1 Details of the model Consider a two-layer linear network in (NTP) with unit input-output dimensions f (x) = 1 √w vT ux, (4) R. Here, u, v where x, f (x) ∈ the normal distribution, ui, vi on a single training example (x, y) = (1, 0), which simplifies the loss to Rw are trainable parameters, with each element initialized using . The model is trained using MSE loss } (0, 1) for i ∈ ∼ N 1, . . . , w ∈ { The trace of the Hessian tr(H) has a simple expression in terms of the norms of the weight vectors (u, v) = L 1 2 f 2. (5) tr(H) = x2 w u ∥ 2 + ∥ v ∥ 2 ∥ , (cid:0) (cid:1) which is equivalent to the NTK for this model. The Frobenius norm of the Hessian written in terms of the loss and tr(H) L (6) F can be H ∥ ∥ H ∥ F = tr(H)2 + 2f 2 2 ∥ 1 + (cid:18) 2 w (cid:19) = tr(H)2 + 4 L 1 + (cid:18) 2 w (cid:19) (7) The gradient descent updates of the model trained using MSE loss on a single training example (x, y) = (1, 0) are given by 18 0246810t(step)020406080Trainingloss0246810t(step)0.20.40.60.81.0λHt/λH00246810t(step)0.20.40.60.81.0TrHt/TrH0c1.01.52.02.53.00246810t(step)0.00.20.40.60.8Trainingloss0246810t(step)0.00.20.40.60.81.0λHt/λH00246810t(step)0.00.20.40.60.81.0TrHt/TrH0c1.52.23.03.74.5 (a) (b) (c) Figure 10: (a) Normalized sharpness measured at τ = 100 steps against the learning rate constant for the uv model trained on (x, y) = (1, 0), with varying widths. Each data point is an average of over 500 initializations, where the shaded region depicts the standard deviation around the mean trend. (b, c) Smooth estimations of the first two derivatives, χτ and χ′ τ , of the, averaged normalized sharpness wrt the learning rate constant. The vertical dashed lines denote ccrit estimated for each width, using the maximum of χ′ τ . Here, we have removed the points beyond c = 3.5 for the calculation of derivatives to avoid large fluctuations near the divergent phase. Smoothening details are described in Appendix I.2. vt+1 = vt ut+1 = ut ηft ηft − − 1 √w 1 √w utx vtx (8) (9) The update equations in function space can be written in terms of the trace of the Hessian tr(H). ft+1 = ft 1 η tr(Ht) + − (cid:18) tr(Ht+1) = tr(Ht) + ηf 2 t w η2f 2 t w (cid:19) (η tr(Ht) 4) . − (10) Figure 9 shows the training trajectories of the uv model trained on (x, y) = (1, 0) using MSE loss for 10 training steps. The model shows similar dynamics to those presented in Section 2. It is worth mentioning that the above equations have been analyzed in [49] at large width. In the following subsections, we extend their analysis by incorporating the higher-order terms to analyze the effect of finite width. B.2 The intermediate saturation regime The uv model trained on (x, y) = (1, 0) does not show the progressive sharpening and late-time regimes (iii) and (iv) described in Section 1. Hence, we can measure sharpness at the end of training to analyze how it is reduced upon increasing the learning rate and to compare it with the intermediate saturation regime results in Section 3. Figure 10(a) shows the normalized sharpness measured at τ = 100 steps for various widths. This behavior reproduces the results observed in the intermediate saturation regime in Section 3. In particular, we can see stages (1) and (2), where λH 0 starts off fairly independent of learning rate constant c, and then dramatically reduces when c > 2; stage (3), where λH 0 plateaus at a small τ /λH value as a function of c is too close to the divergent phase in this model to be clearly observed. The corresponding derivatives of the averaged normalized sharpness, χτ , and χ′ τ , are shown in Figure 10(b, c). The vertical dashed lines denote ccrit estimated for each width, using the maximum of χ′ τ . We observe that ccrit = 2 for all widths. τ /λH 19 01234c0.00.20.40.60.81.0λHτ/λH0width2.08.032.0512.001234c−0.20.00.20.40.60.81.0χτwidth283251201234c−3−2−1012χ0τwidth2832512 (a) (b) (c) Figure 11: (a, b) The averaged loss at the first step against the learning rate constant k for L1/L0 ⟨ varying widths obtained from (a) inequality 16 and (b) numerical experiments. The intersection of with the horizontal line y = 1 depicts kloss. The two vertical lines k = 2 and k = 4 mark the L1/L0 ⟨ endpoints of kloss at small and large widths. The shaded region in (b) shows the standard deviation around the mean trend. (c) The scaling of λH 0 and tr(H0) with width. ⟩ ⟩ B.3 Opening of the sharpness reduction phase in the uv model (1/w) terms in Equation (10) effectively lead to the opening of the sharpness This section shows that reduction phase with 1/w in the uv model. In Appendix B.2, we demonstrated that for the uv model, ccrit = 2 for all values of widths. Hence, it suffices to show that closs increases from the value 2 as 1/w increases. We do so by finding the smallest k such that the averaged loss over initializations increases during early training. O It follows from Equation 10 that the averaged loss increases in the first training step if the following holds = 1 L L 0 (cid:29) (cid:28) 1 − (cid:42)(cid:18) η tr(H0) + η2f 2 0 w 2 (cid:43) (cid:19) > 1, (11) where . ⟩ ⟨ k/tr(H0), we have denotes the average over initializations. On scaling the learning rate with trace as η = 1 L L L L 0 (cid:29) 1 0 (cid:29) (cid:28) (cid:28) = = 1 (cid:28)(cid:18) (1 − (cid:18) k + − k2 w k)2 + 2(1 f 2 0 tr(H0)2 k2 w k) − > 1 f 2 0 tr(H0)2 + k4 w2 (cid:29) (cid:28) f 4 0 tr(H0)4 (cid:29)(cid:19) > 1. (cid:19)(cid:29) (cid:28) The required two averages have the following expressions as shown in Appendix B.8. f 2 0 T r(H0)2 f 4 0 T r(H0)4 (cid:28) (cid:28) (cid:29) (cid:29) = = w 4(w + 1) 3(w + 2)w3 16 Γ(w) Γ(w + 4) . (12) (13) (14) (15) Inserting the above expressions in Equation 13, on average the loss increases in the very first step if the following inequality holds 1 L L 0 (cid:29) (cid:28) = (1 (cid:18) k)2 + − k2(1 k) − 2(w + 1) + 3k4 16(w + 3)(w + 1) > 1 (cid:19) (16) 20 01234k02468DL1L0Ew24816326401234k02468DL1L0Ew2481632644.24.44.64.84λH0/Tr(H0)2−52−42−32−22−120d/w The graphical representation of the above inequality shown in Figure 11(a) is in excellent agreement with the experimental results presented in Figure 11(b). Let us denote k′ loss as the minimum learning rate constant such that the average loss increases in the first step. Similarly, let kloss denote the learning rate constant if the loss increases in the first 10 steps. Then, k′ loss increases from the value 2 as 1/w increases as shown in Figure 11(a). By comparison, the trace reduces at any step if η tr(Ht) < 4. At initialization, this condition becomes k < 4. Hence, for k < k′ loss, both the loss and trace monotonically decrease in the first training step. These arguments can be extended to later training steps, revealing that the loss and trace will continue to decrease for k < k′ Next, let ηloss denote the learning rate corresponding to closs. Then, we have ηloss = closs λH 0 implying = kloss tr(H0) , loss. closs = kloss λH 0 tr(H0) . (17) Figure 11(c) shows that λH tr(H0) for all widths, implying closs kloss. Hence, closs increases with 1/w as observed in Figure 7(a). In Appendix B.2, we demonstrated that for the uv model, ccrit = 2 for all values of widths. Incorporating this with closs increases with 1/w, we have sharpness reduction phase opening up as 1/w increases. 0 ≥ ≥ B.4 Opening of the loss catapult phase at finite width In this section, we use the Frobenius norm of the Hessian F as a proxy for the sharpness and demonstrate the emergence of the loss-sharpness catapult phase at finite width. In particular, We after the first training step near k = kloss and show that analyze the expectation value t and kloss ≤ tr(Ht) tr(H T H) ⟩ kf rob, with the difference increasing with 1/w. First, we write tr(H T t Ht) in terms of H ∥ L ∥ ⟨ tr(H T t Ht) = tr(Ht)2 + 4 1 + (cid:18) 2 w t. L (cid:19) (18) Next, using Equations 1, we write down the change in tr(H T of tr(H0) and 0 L t Ht) after the first training step in terms ∆ tr(H T 1 H1) = tr(H T 1 H T 1 ) tr(H T 0 H0) = tr(H1)2 − − tr(H0)2 + 4 1 + ∆ tr(H T 1 H1) = ηf 2 0 w (η tr(H0) ηf 2 0 w 4) − (cid:20) (η tr(H0) − (cid:18) 4) + 2 tr(H0) 2 w ( (cid:19) 1 + 1 L 2 w 0) − L ( L 1 − L 0) (19) (cid:19) + 4 (cid:21) (cid:18) Next, we substitute η = k/ tr(H0) to obtain the above equation as a function of k ∆ tr(H T 1 H1) = 4) k(k − w 4) k(k − w (cid:20) f 4 0 tr(H0)2 + 2f 2 0 + 4 1 + (cid:21) (cid:18) 2 w (cid:19) ( L 1 − L 0) Finally, we calculate the expectation value of ∆ tr(H T ⟨ 1 H1) ⟩ ∆ tr(H T 1 H1) = (cid:10) (cid:11) 4) k(k − w 4) k(k − w (cid:20) (cid:28) f 4 0 tr(H0)2 (cid:29) + 2 f 2 0 ⟩ ⟨ + 4 1 + (cid:21) (cid:18) 2 w (cid:19) 1 ⟨L − L 0 , ⟩ 21 (20) (21) Figure 12: The relationship between the critical constants for the uv model trained on a single training examples (x, y) = (1, 0) with MSE loss using gradient descent. Each data point corresponds to a random initialization by estimating f 4 0 tr(H0)2 (cid:68) (cid:69) using the approach demonstrated in the previous section f 4 0 tr(H0)2 (cid:28) Inserting f 4 0 tr(H0)2 (cid:68) (cid:69) in Equation 21 along with 3w 4(w + 3) . = 1, we have = (cid:29) f 2 0 ⟩ ⟨ ∆ tr(H T 1 H1) = (cid:10) (cid:11) 4) k(k − w 3k(k 4) 4(w + 3) − (cid:20) I(k,w) + 2 +4 1 + (cid:21) (cid:18) 2 w (cid:19) 1 − L 0 ⟩ ⟨L (22) (23) (cid:124) − L 1 L < 0. In order for the sharpness to catapult, we require (cid:125) (cid:123)(cid:122) 1 H1) At infinite width, the above equation reduces to kloss. For any finite width, I(k, w) < 0 for 0 < k < 4. At k ∆ tr(H T therefore kf rob > kloss. As 1/w increases (cid:10) 0 is required to reach a point where 1 L 1/w. , and hence, kf rob = ⟩ 0, and therefore 0 − L ∆ tr(H T > 0 and 1 H1) I(k, w) also increases, which means a higher value of (cid:11) | | ∆ tr(H T 1 H1) kloss increases with (cid:10) 0. Thus kf rob = 4 1 ⟨L kloss, ∆ tr(H T 1 H1) − L (cid:11) ≤ ≤ ≥ − (cid:10) (cid:11) 0 (cid:10) (cid:11) B.5 The early training trajectories Figure 9 shows the early training trajectories of the uv model with large (w = 512) and small (w = 2) widths. The dynamics depicted show several similarities with early training dynamics of real-world models shown in Figure 2. At small widths, the loss catapults at relatively higher learning rates (specifically, at closs = 3.74, which is significantly higher than the critical value of ccrit = 2). B.6 Relationship between critical constants Figure 12 shows the relationship between various critical constants for the uv model. The data show that the inequality closs cmax holds for every random initialization of the uv model. csharp ≤ ≤ B.7 Phase diagrams with error bars This section shows the variation in the phase diagram boundaries of the uv model shown in Figure 7(a, b). Figure 13 shows these phase diagrams. Each data point is an average of over 500 initializations. The horizontal bars around each data point indicate the region between 25% and 75% quantile. B.8 Derivation of the expectation values Here, we provide the detailed derivation of the averages finding the average f 2 0 T r(H0)2 (cid:68) (cid:69) 22 f 2 0 T r(H0)2 and f 4 0 T r(H0)4 . We begin by (cid:68) (cid:69) (cid:68) (cid:69) 23456csharp23456closscmax (a) (b) (c) (b) trace of Hessian trH Figure 13: The phase diagram of the uv model trained with MSE loss using gradient descent with (a) sharpness λH t Ht) used as a t measure of sharpness. In (a), the learning rate is scaled as η = c/λH 0 , while in (b) and (c), the learning rate is scaled as η = k/tr(H0). Each data point denotes an average of over 500 initialization, and the smooth curve represents a 2-degree polynomial fitted to the raw data. The horizontal bars around the average data point indicate the region between 25% and 75% quantile. 0 and (c) the square of the Frobenius norm tr(H T f 2 0 T r(H0)2 (cid:28) = w (cid:29) ∞ w −∞ (cid:90) i=1 (cid:18) (cid:89) dvidui 2π exp (cid:19) − (cid:18) u ∥ 2 + ∥ 2 v ∥ 2 ∥ w j,k=1 ujvjukvk 2)2 , ( u (cid:19) (cid:80) ∥ ∥ 2 + ∥ ∥ v (24) where denotes the norm of the vectors. . ∥ ∥ The above integral is non-zero only if j = k. Hence, it is a sum of w identical integrals. Without any loss of generality, we solve this integral for j = 1 and multiply by w to obtain the final result, i.e., f 2 0 T r(H0)2 (cid:28) (cid:29) = w2 ∞ w −∞ (cid:90) i=1 (cid:18) (cid:89) dvidui 2π exp (cid:19) − (cid:18) 2 + u ∥ 2 ∥ v ∥ 2 ∥ 1v2 u2 1 2 + v ∥ ∥ 2)2 ∥ (cid:19) ( u ∥ (25) Consider a transformation of u, v ∈ Rw into w dimensional spherical coordinates such that u1 = ru cos φu1 , v1 = rv cos φv1, (26) which yields, f 2 0 T r(H0)2 f 2 0 T r(H0)2 f 2 0 T r(H0)2 (cid:28) (cid:28) (cid:28) (cid:29) (cid:29) (cid:29) = w2 (2π)w = w2 (2π)w = w2 (2π)w (cid:90) (cid:90) (cid:90) (cid:124) drudrvdΩu,wdΩv,wrw−1 u rw−1 v exp u + r2 r2 v 2 (cid:19) − (cid:18) u cos2 φu1r2 r2 u + r2 (r2 v cos2 φu1 v)2 drudrv exp u + r2 r2 v 2 − (cid:18) drudrv exp u + r2 r2 v 2 − (cid:18) Ir (cid:123)(cid:122) (cid:19) (cid:19) (cid:0) (cid:0) ur2 r2 v u + rw+1 rw+1 v 2 (cid:90) (cid:1) (27) dΩu,wdΩv,w cos2 φu1 cos2 φv1 (28) 2 r2 ur2 v u + rw+1 rw+1 v  2 (cid:90)     (cid:124) (cid:1) (cid:125) dΩw cos2 φ1  , Iφ (cid:123)(cid:122)     (cid:125) (29) where dΩ denotes the w dimensional solid angle element. Here, we denote the radial and angular integrals by Ir and Iφ respectively. The radial integral Ir is 23 1234c2−62−52−42−32−22−11/whclossihcsharpihcmaxi1234k2−62−52−42−32−22−11/whklossihktraceihkmaxi1234k2−62−52−42−32−22−11/whklossihkfrobihkmaxi ∞ Ir = drudrv 0 (cid:90) rw+1 rw+1 u v v)2 exp u + r2 (r2 u + r2 r2 v 2 . (cid:19) − (cid:18) Let ru = R cos θ and rv = R sin θ with R [0, ∈ ∞ ) and θ [ − ∈ π 2 , π 2 ], then we have Ir = Ir = ∞ 0 (cid:90) √π 23 dR R2w−1e−R2/2 w+2 2 Γ(w) Γ Γ w+3 (cid:0) 2 , (cid:1) π/2 0 (cid:90) dθ cosw+1 θ sinw+1 θ where Γ(.) denotes the Gamma function. The angular integral Iφ is (cid:0) (cid:1) Iφ = dφ1dφ2 . . . dφw−1 sinw−2 φ1 cos2 φ1 sinw−3 φ2 . . . sin φw−2 (cid:90) Iφ = dφ1dφ2 . . . dφw−1 sinw−2 φ1 sinw−3 φ2 . . . sin φw−2 Iφ = (cid:90) πw/2 Γ( w+2 2 ) . (cid:82) π 0 dφ1 sinw−2 φ1 cos2 φ1 0 dφ1 sinw−2 φ1 π (cid:82) Plugging in Equations 32 and 35 into Equation 29, we obtain a very simple expression f 2 0 T r(H0)2 (cid:28) (cid:29) = w2 2w+3 √πΓ(w) 2 )Γ( w+3 2 ) Γ( w+2 = w 4(w + 1) . (30) (31) (32) (33) (34) (35) (36) The other integral can be obtained by generalizing the above approach as described below f 4 0 T r(H0)4 (cid:28) (cid:29) = w2 −∞ (cid:90) i=1 (cid:18) (cid:89) dvidui 2π exp (cid:19) − (cid:18) u ∥ ∥ 2 + 2 v ∥ 2 ∥ w j,k,l,m=1 ujvjukvkulvlumvm (cid:19) (cid:80) ( ∥ 2 + u ∥ v ∥ 2)4 ∥ . (37) The integral is zero if either j = k and l = m or j = k = l = m, which we consider separately. Without loss of generality, we find the following integrals f 4 0 T r(H0)4 (cid:28) (cid:29)22 f 4 0 T r(H0)4 ∞ w −∞ (cid:90) ∞ i=1 (cid:18) (cid:89) w = w2 = w2 (cid:28) i=1 (cid:18) (cid:89) which have the following expressions (cid:90) (cid:29)4 −∞ dvidui 2π dvidui 2π exp exp (cid:19) (cid:19) − (cid:18) − (cid:18) 2 + u ∥ 2 ∥ v ∥ 2 ∥ 2 + u ∥ 2 ∥ v ∥ 2 ∥ (cid:19) 1u2 u2 2 + ( u ∥ ∥ 1v2 2v2 2 v ∥ 1v4 u4 1 2 + v ∥ ∥ 2)4 ∥ 2)4 , ∥ (cid:19) ( u ∥ f 4 0 T r(H0)4 f 4 0 T r(H0)4 (cid:28) (cid:28) (cid:29)22 (cid:29)4 = = w2 16 9w2 16 Γ(w) Γ(w + 4) Γ(w) Γ(w + 4) , 24 (38) (39) (40) (41) f 4 0 T r(H0)4 (cid:68) (cid:69) w ∞ (a) d = 4 (b) d = 8 (c) d = 16 Figure 14: Phase diagrams of FCNs in NTP with varying depths trained on the MNIST dataset using MSE loss. where Γ(.) denotes the gamma function. On combining the expressions with their multiplicities, we obtain the final result f 4 0 T r(H0)4 f 4 0 T r(H0)4 (cid:28) (cid:28) = 3w(w 1) − (cid:28) 3(w + 2)w3 16 (cid:29) (cid:29) = f 4 0 T r(H0)4 Γ(w) Γ(w + 4) + w (cid:29)22 (cid:28) f 4 0 T r(H0)4 (cid:29)4 (42) (43) B.9 Insights into the catapult effect in crossentropy loss using uv model In this section, we summarize the main intuition behind the discrepancy in the values of closs for cross-entropy loss at large widths. We consider the uv model trained on a classification task using logistic loss, as presented in [50]. Consider the uv model trained on a binary classification task using the logistic loss on two training examples (x1, y1) = (1, 1) and (x2, y2) = (1, 2 log(2 + 2 cosh(f )). Hence, the loss grows monotonically as the output function increases. The update equation of the function is given by: 1). Then, the total loss is (f ) = 1 − L f | | ft+1 = ft 1 η tr(Ht) ft − ′(f ) η2 L + L ′(ft)2 n , (44) where η is the learning rate and 1 ≤ | | 1/2 in the above case, this decrease persists for η tr(H) < 4. This result provides some intuition behind the discrepancy. < 1 holds, then output function continues to decrease. Given that (cid:18) ′(.) is the derivative of the loss. At large width, if the condition η tr(H) ′(f )/f ′(f )/f − (cid:19) L L L C Phase diagrams of early training This section describes experimental details and shows additional phase diagrams of early training. The results include (1) FCNs in NTP trained on MNIST, Fashion-MNIST, and CIFAR-10 datasets, (2) CNNs in SP trained on Fashion-MNIST and CIFAR-10, and (3) ResNets in SP trained on CIFAR- 10 datasets using MSE loss. Figures 14 to 19 show these results. The depths and widths are the same as specified in Appendix A. Each data point is an average over 10 initializations. The horizontal bars around the average data point indicate the region between 25% and 75% quantile. Phase diagrams for cross-entropy results are shown in Appendix F. : We train each model for t = 10 steps using SGD with learning Additional experimental details rates η = c/λH in steps of 0.1. Here, xmax is relatd to the maximum trainable learning rate constant as cmax = 2xmax . We have considered 10 random initializations for each model. As mentioned in Appendix A, we do not 0 and batch size of 512, where c = 2x with x 0.0, . . . xmax ∈ { } 25 2−120212223c2−112−102−92−81/whclossihcsharpihcmaxi2−12123c2−112−102−92−81/whclossihcsharpihcmaxi2−1212325c2−112−102−92−81/whclossihcsharpihcmaxi (a) d = 4 (b) d = 8 (c) d = 16 Figure 15: Phase diagrams of FCNs in NTP with varying depths trained on the Fashion-MNIST dataset. (a) d = 4 (b) d = 8 (c) d = 16 Figure 16: Phase diagrams of FCNs in NTP with varying depths trained on the CIFAR-10 dataset. (a) d = 5 (b) d = 7 (c) d = 10 Figure 17: Phase diagrams of Convolutional Neural Networks (CNNs) in SP with varying depths trained on the Fashion-MNIST dataset. (a) d = 5 (b) d = 7 (c) d = 10 Figure 18: Phase diagrams of Convolutional Neural Networks (CNNs) in SP with varying depths trained on the CIFAR-10 dataset. 26 2−12123c2−112−102−92−81/whclossihcsharpihcmaxi2−12123c2−112−102−92−81/whclossihcsharpihcmaxi2−1212325c2−112−102−92−81/whclossihcsharpihcmaxi2−120212223c2−112−102−92−81/whclossihcsharpihcmaxi2−12123c2−112−102−92−81/whclossihcsharpihcmaxi2−1212325c2−112−102−92−81/whclossihcsharpihcmaxi2−12123c2−92−82−72−61/whclossihcsharpihcmaxi2−1212325c2−92−82−72−61/whclossihcsharpihcmaxi2−1212325c2−92−82−72−61/whclossihcsharpihcmaxi2−12123c2−92−82−72−61/whclossihcsharpihcmaxi2−1212325c2−92−82−72−61/whclossihcsharpihcmaxi2−1212325c2−92−82−72−61/whclossihcsharpihcmaxi (a) d = 18 (b) d = 34 Figure 19: Phase diagrams of Resnets in SP with different depths trained on the CIFAR-10 dataset. (a) w = 512 (b) w = 1024 (c) w = 2048 Figure 20: Phase diagrams of FCNs in NTP with varying widths trained on the CIFAR-10 dataset. consider averages over SGD runs as the randomness from initialization outweighs it. Hence, we obtain 10 values for each of the critical values in the following results. For each initialization, we compute the critical constants using Definitions 1 and 3. To avoid a random increase in loss and sharpness due to fluctuations, we round off the values of λH 0 and Lt/L0 to their second decimal places before comparing with 1. We denote the average values using data points and variation using horizontal bars around the average data points, which indicate the region between 25% and 75% quantile. The smooth curves are obtained by fitting a two-degree polynomial y = a + bx + cx2 with x = 1/w and y can take on one of three values: closs, csharp and cmax. t /λH Phase diagrams with depth Figure 20: shows the phase diagrams with depth for FCNs in NTP trained on the CIFAR-10 dataset. The phase diagrams look qualitatively similar compared to the 1/w phase diagrams. D Relationship between various critical constants Figure 21 illustrates the relationship between the early training critical constants for models and datasets. The experimental setup is the same as in Appendix C. Typically, we find that closs ≤ csharp holds true. However, there are some exceptions, which are observed at high values csharp of d/w (see 21 (d, e)), where the trends of the critical constants converge, and large fluctuations can cause deviations from the inequality. ≤ E The effect of d/w on the noise in dynamics In this section, we demonstrate that for FCNs with d/w ≳ 1/16, the dynamics becomes noise- dominated. This aspect makes it challenging to distringuish the underlying deterministic dynamics from random fluctuations. To demonstrate this, we consider FCNs trained on CIFAR-10 using MSE and cross-entropy loss and use 4096 training examples for estimating sharpness. 27 2−1212325c2−72−62−51/whclossihcsharpihcmaxi2−1212325c2−72−62−51/whclossihcsharpihcmaxi2−1212325c222324depthhclossihcsharpihcmaxi2−12123c222324depthhclossihcsharpihcmaxi2−12123c222324depthhclossihcsharpihcmaxi (a) FCNs on MNIST (b) FCNs on Fashion-MNIST (c) FCNs on CIFAR-10 (d) CNNs on Fashion-MNIST (e) CNNs on CIFAR-10 (f) ResNets on CIFAR-10 Figure 21: The relationship between various critical constants for various models and datasets. Each data point corresponds to a model with random initialization. The dashed line denotes the values where x = y. Figure 22: Training loss trajectories of ReLU FCNs with d = 16 trained on the CIFAR-10 dataset with MSE loss using SGD with learning rate η = c/λH 0 and batch size B = 512. Figures 22 and 23 show the training loss and sharpness of FCNs with d = 16 and varying widths, trained on CIFAR-10 using MSE loss. We observe that the sharpness dynamics becomes noisier for w ≲ 64. Figures 24 and 25 shows the training dynamics with loss switched to cross-entropy, while keeping the initialization and SGD batch sequence the same as in the MSE loss case. In comparison to MSE 28 2122232425csharp2122232425closscmax2122232425csharp2122232425closscmax2122232425csharp2122232425closscmax2122232425csharp2122232425closscmax222426csharp212223242526closscmax2122232425csharp2122232425closscmax05101520step0246810Traininglossloss:mse,width:1024,depth:16c369121505101520step0.10.20.30.40.5Traininglossloss:mse,width:512,depth:16c1234505101520step0.10.20.30.40.50.6Traininglossloss:mse,width:256,depth:16c24681005101520step0.10.20.30.4Traininglossloss:mse,width:128,depth:16c24681005101520step0.050.100.150.200.25Traininglossloss:mse,width:64,depth:16c24681005101520step0.060.080.100.120.140.160.18Traininglossloss:mse,width:32,depth:16c12345 Figure 23: Sharpness trajectories of ReLU FCNs with d = 16 trained on the CIFAR-10 dataset with MSE loss using SGD with learning rate η = c/λH 0 and batch size B = 512. Figure 24: Training loss trajectories of ReLU FCNs with d = 16 trained on the CIFAR-10 dataset with cross-entropy loss using SGD with learning rate η = c/λH 0 and batch size B = 512. loss, the training loss and sharpness dynamics show a higher level of noise, especially for w ≲ 256. As a result, it becomes difficult to characterize the training dynamics for d/w ≳ 1/16. F Crossentropy In this section, we provide additional results for models trained with cross-entropy (xent) loss and compare them with MSE results. Broadly speaking, models trained with cross-entropy loss show similar characterstics to those trained with MSE loss, such as, (i) sharpness reduction during early training, (ii) an increase in critical constants closs, csharp with d and 1/w, (iii) closs cmax. However, the dynamics of models trained with cross-entropy loss is noisier compared to MSE as shown in the previous section, and characterizing these dynamics can be more complex. In the csharp ≤ ≤ 29 05101520step0.00.51.01.52.02.53.0λHt/λH0loss:mse,width:1024,depth:16c369121505101520step0.20.40.60.81.0λHt/λH0loss:mse,width:512,depth:16c1234505101520step0.20.40.60.81.0λHt/λH0loss:mse,width:256,depth:16c24681005101520step0.00.20.40.60.81.0λHt/λH0loss:mse,width:128,depth:16c24681005101520step0.00.20.40.60.81.0λHt/λH0loss:mse,width:64,depth:16c24681005101520step0.20.40.60.81.0λHt/λH0loss:mse,width:32,depth:16c1234505101520step2468101214Traininglossloss:xent,width:1024,depth:16c1530456005101520step2345678Traininglossloss:xent,width:512,depth:16c81624324005101520step23456Traininglossloss:xent,width:256,depth:16c1530456005101520step2.002.252.502.753.003.253.503.75Traininglossloss:xent,width:128,depth:16c1530456005101520step2.12.22.32.42.52.62.7Traininglossloss:xent,width:64,depth:16c4812162005101520step2.152.202.252.302.352.40Traininglossloss:xent,width:32,depth:16c48121620 Figure 25: Sharpness trajectories of ReLU FCNs with d = 16 trained on the CIFAR-10 dataset with cross-entropy loss using SGD with learning rate η = c/λH 0 and batch size B = 512. (a) MSE, d = 4 (b) MSE, d = 8 (c) MSE, d = 16 (d) xent, d = 4 (e) xent, d = 8 (f) xent, d = 16 Figure 26: The phase diagrams of early training of FCNs trained on the CIFAR-10 dataset using (a, b, c) MSE and (d, e, f) cross-entropy loss. Each data point is an average over 10 initializations, and solid lines represent a smooth curve fitted to raw data points. The horizontal bars around the averaged data point indicates the region between 25% and 75% quantile. For cross-entropy phase diagrams, the c = 2 line is shown for reference only and does not relate to ccrit. following experiments, we consider models trained on the CIFAR-10 dataset and used 4096 training examples to estimate sharpness. F.1 Phase diagrams Figure 26 compares the phase diagrams of FCNs in SP trained on the CIFAR-10 dataset, using both MSE and cross-entropy loss. The estimated critical constants for cross-entropy loss are generally 30 05101520step0.00.20.40.60.81.01.21.41.6λHt/λH0loss:xent,width:1024,depth:16c1530456005101520step0.00.20.40.60.81.01.21.41.6λHt/λH0loss:xent,width:512,depth:16c81624324005101520step0.00.51.01.52.02.5λHt/λH0loss:xent,width:256,depth:16c1530456005101520step0.00.20.40.60.81.0λHt/λH0loss:xent,width:128,depth:16c1530456005101520step0.00.20.40.60.81.01.2λHt/λH0loss:xent,width:64,depth:16c4812162005101520step0.000.250.500.751.001.251.501.75λHt/λH0loss:xent,width:32,depth:16c481216202−120212223c2−112−102−92−81/whclossihcsharpihcmaxi2−12123c2−112−102−92−81/whclossihcsharpihcmaxi2−1212325c2−112−102−92−81/whclossihcsharpihcmaxi2−121232527c2−112−102−92−81/whclossihcsharpihcmaxi2−121232527c2−112−102−92−81/whclossihcsharpihcmaxi2−121232527c2−112−102−92−81/whclossihcsharpihcmaxi (a) (b) Figure 27: Comparison of the relationship between critical constants for FCNs in SP trained on CIFAR-10 using MSE and cross-entropy loss. Each data point corresponds to a randomly initialized model with depths and widths mentioned in Appendix A. more noisy, as quantified by the confidence intervals. In comparison to phase diagrams of models trained with MSE loss, we observe a few notable differences. First, the loss starts to catapult at a value appreciably larger than c = 2 at large widths. Primarly, 4 ≲ closs ≲ 8. Additionally, cmax generally decreases with 1/w. This decreasing trend becomes less sharp at large depths. Despite these differences, the phase diagrams for both loss functions share various similarities. First, we observe sharpness reduces during early training for c < csharp (see the first row of Figure 25). Next, we observe that the inequality closs cmax generally holds for both loss functions ≤ as demonstrated in Figure 27, barring some exceptions. csharp ≤ Figure 28 shows the phase diagrams for CNNs and ResNets trained on the CIFAR-10 dataset using cross-entropy loss. The observed critical constants are much noisier as quantified by the confidence intervals. Nevertheless, the phase diagram shows similar trends as mentioned above. For large 1/w models, we found that progressive sharpening begins after 5 10 training steps. For these cases, we only use the first 5 steps to measure sharpness to avoid progressive sharpening. For CNNs, we observed that the dynamics becomes difficult to characterize for w ≲ 32 and d ≳ 10, due to large fluctuations. Consequently, we've opted not to include these particular results. − (a) CNN, d = 5 (b) CNN, d = 7 (c) ResNet, d = 18 Figure 28: Phase diagrams of (a, b) CNNs and (c) ResNets trained on the CIFAR-10 dataset with cross-entropy loss using SGD with η = c/λH 0 and B = 512. F.2 Intemediate saturation regime Figure 29 shows the normalized sharpness measured at cτ = 100 for FCNs trained on CIFAR-10 using cross-entropy loss. 7 Similar to MSE loss, we observe an abrupt drop in sharpness at large learning rates. However, this abrupt drop occurs at 2 ≲ ccrit ≲ 4. The estimated sharpness is noisier (compare with Figure 38), which hinders a reliable estimation of ccrit. We speculate that we require a 7The time step τ = 100/c is in the middle of the intermediate saturation regime for most of the models. For further details on estimating sharpness, see Appendix I.1. 31 2122232425csharp2122232425loss:mseclosscmax222426csharp222426loss:xentclosscmax2−1212325c2−82−72−61/whclossihcsharpihcmaxi2−1212325c2−82−72−61/whclossihcsharpihcmaxi2−1212325c2−72−62−51/whclossihcsharpihcmaxi (a) d = 4 (b) d = 8 (c) d = 16 Figure 29: Sharpness measured at cτ = 100 against the learning rate constant for FCNs trained on the CIFAR-10 dataset using cross-entropy loss, with varying depths and widths. Each curve is an average over ten initializations, where the shaded region depicts the standard deviation around the mean trend. The vertical dashed line shows c = 2 for reference. large number of averages for a reliable estimation of ccrit for cross-entropy loss. We leave the precise characterization of ccrit for cross-entropy loss for future work. G The effect of setting model output to zero at initialization In this section, we demonstrate the effect of network output f (x; θt) at initialization on the early training dynamics. In particular, we set the network output to zero at initialization, f (x; θ0) = 0, by (1) 'centering' the network by its initial value fc(x; θt) = f (x; θ) f (x; θ0) or (2) setting the last layer weights to zero at initialization. We show that both (1) and (2) remove the opening of the 2, sharpness reduction phase with 1/w. Resultantly, the average onset of loss catapult occurs at closs independent of depth and width. − ≈ Throughout this section, we use 'vanilla' networks to refer to networks initialized in the standard way. For simplicity, we train FCNs using full batch gradient descent with MSE loss using a subset consisting of 4096 examples of the CIFAR-10 dataset. G.1 The effect of centering networks Given a network function f (x; θt), we define the centered network fc(x; θt) as fc(x; θt) = f (x; θt) f (x; θ0), − (45) where f (x; θ0) is the network output at intialization. By construction, the network output is zero at initialization. It is noteworthy that centering a network is an unusual way of training deep networks as it doubles the cost of training because of two forward passes. Figure 30 compares the training loss and sharpness dynamics of vanilla networks and centered networks. Unlike vanilla networks, we do not observe a decrease in sharpness for c < closs during early training. Rather, we observe a slight increase in sharpness. To distinguish this slight increase from sharpness catapult, we introduce a threshold ε, comparing normalized sharpness λH 0 with 1 + ε, to define a sharpness catapult.8 As demonstrated in Appendix G.3, the uv model trained on a single training example (x, y) with y = 0 sheds lights on this initial increase in sharpness. t /λH 2, as Interestingly, irrespective of depth and width, we observe that loss catapults at closs demonstrated in the phase diagrams in Figure 31(a, b, c). These findings suggest a strong correlation and the opening of the sharpness reduction between a large network output at initialization phase discussed in Section 2. f (x; θ0) ∥ ∥ ≈ G.2 The effect of setting the last layer to zero An alternative way to train networks with f (x; θ0) = 0 is by setting the last layer to zero at initialization. The principle of criticality at initialization [55, 58, 68] does not put any constraints on 8In experiments, we set ε = 0.05. We use the same threshold for zero-init networks. 32 2−12021222324c0.20.40.60.81.0λHτ/λH0width256512102420482−12021222324c0.20.40.60.8λHτ/λH0width256512102420482−12021222324c0.250.500.751.001.251.501.75λHτ/λH0width25651210242048̸ (a) (b) (c) (d) (e) (f) Figure 30: Comparison of the early training dynamics of (a, b) vanilla, (c, d) centered, and (e, f) zero- initialized FCNs (with depth = 8 and width = 512), trained on the CIFAR-10 dataset with MSE loss using gradient descent for 20 steps. the last layer weights. Hence, setting the last layer to zero does not affect signal/gradient propagation at initialization. Yet, setting the last layer to zero results in initialization in a flat curvature region at initialization, resulting in access to larger learning rates. We refer to these networks as 'zero-init' networks. Figure 30 compares the training dynamics of zero-init networks with vanilla and centered networks. We observe that the dynamics is quite similar to the centered networks: (i) sharpness does not reduce 2, irrespective of depth and width. Figure 31(d, for small learning rates and (ii) loss catapults closs e, f) show the phase diagrams of networks with zero-initialized networks. Like centered networks, the critical constants do not scale with depth and width. Again, suggesting that a large network output f (x; θ0) at initialization is related to the opening of the sharpness reduction phase in the early ∥ training results shown in Section 2. ≈ ∥ 33 05101520step01234Traininglossvanillanetsloss:mse,width:512,depth:8c1.53.04.56.07.505101520step0.00.51.01.5λHt/λH0vanillanetsloss:mse,width:512,depth:8c1.53.04.56.07.505101520step0.00.51.01.52.02.5Traininglosscenterednetsloss:mse,width:512,depth:8c1.53.04.56.07.505101520step0.00.51.01.5λHt/λH0centerednetsloss:mse,width:512,depth:8c1.53.04.56.07.505101520step0.00.51.01.5Traininglosszero-initnetsloss:mse,width:512,depth:8c1.53.04.56.07.505101520step0.00.51.01.5λHt/λH0zero-initnetsloss:mse,width:512,depth:8c1.53.04.56.07.5 (a) centered, d = 4 (b) centered, d = 8 (c) centered, d = 16 (d) zero-init, d = 4 (e) zero-init, d = 8 (f) zero-init, d = 16 Figure 31: The phase diagrams of early training dynamics of (a, b, c) centered and (d, e, f) zero-init networks trained on CIFAR-10 using MSE using gradient descent. Each data point is an average over 10 initializations. The horizontal bars around the average data point indicate the region between 25% and 75% quantile. G.3 Insights from uv model trained on (x, y) In this section, we gain insights into the effect of setting network output to zero at initialization using uv model trained on an example (x, y). In particular, we show that loss catapults at kloss = 2 and sharpness increases during early training. Consider the uv model trained on a single training example (x, y) with y = 0 9 This simplifies the loss function to f (x) = 1 √w w i (cid:88) uivi x. 1 2 = L (f (x) − y)2 = 1 2 ∆f 2, where ∆f is the residual. The trace of the Hessian tr(H) is tr(H) = x2 w v ∥ 2 + ∥ u ∥ 2 ∥ . The Frobeinus norm can be written in terms of the trace and the network output (cid:0) (cid:1) H ∥ F = λ2 + 2x2∆f 2 2 ∥ 1 + (cid:18) 2f w∆f . (cid:19) The function and residual updates are given by 9Note that for y = 0, the network is already at a minimum for f0 = 0. 34 (46) (47) (48) 2−120212223c2−112−102−92−81/whclossihcsharpihcmaxi2−12123c2−112−102−92−81/whclossihcsharpihcmaxi2−1212325c2−112−102−92−81/whclossihcsharpihcmaxi2−120212223c2−112−102−92−81/whclossihcsharpihcmaxi2−120212223c2−112−102−92−81/whclossihcsharpihcmaxi2−12123c2−112−102−92−81/whclossihcsharpihcmaxi̸ (a) (b) (c) (d) (e) (f) Figure 32: The early training dynamics of FCNs with a fixed output scale trained on the CIFAR-10 dataset with MSE loss using gradient descent. ft+1 = ft − η tr(Ht) + η2x2 w ft∆f 2 t ∆ft+1 = ∆ft η tr(Ht) + 1 (cid:18) − η2x2 w ft∆ft . (cid:19) Similarly, we can obtain the trace update equations tr(Ht+1) = tr(Ht) + η∆f 2 t x2 w (cid:18) η tr(Ht) 4 ft ∆ft (cid:19) . − (49) (50) (51) Let us analyze them for the networks with zero output at initialization. The loss at the first step increases if 35 05101520step0.0400.0420.0440.0460.0480.050Traininglosss=0.1loss:mse,width:512,depth:8c0.81.62.43.24.005101520step123λHt/λH0s=0.1loss:mse,width:512,depth:8c0.81.62.43.24.005101520step0.10.20.30.40.50.6Traininglosss=1.0loss:mse,width:512,depth:8c1.53.04.56.07.505101520step0.00.51.01.5λHt/λH0s=1.0loss:mse,width:512,depth:8c1.53.04.56.07.505101520step01020304050Traininglosss=10.0loss:mse,width:512,depth:8c1.53.04.56.07.505101520step0.00.51.01.5λHt/λH0s=10.0loss:mse,width:512,depth:8c1.53.04.56.07.5 L1 L0 (cid:29) (cid:28) = 1 − (cid:42)(cid:18) η tr(H0) + η2x2 n f0∆f0 2 (cid:43) (cid:19) > 1 (52) (53) Setting f0 = 0 and scaling the learning rate as η = k/ tr(H0), we see that the loss increases at the first step if k > 2. L1 L0 (cid:29) (cid:28) (cid:10) (cid:11) = (1 − k)2 > 1 (54) Next, we analyze the change in trace during the first training step. Setting f0 = 0, we observe that the trace increases for all learning rates tr(H1) = tr(H0) + η2x2 w ∆f 2 0 tr(H0), (55) modulated by the learning rate and width. Finally, we analyze the change in Frobenius norm in the first training step at k = kloss, which implies ∆f 2 1 = ∆f 2 0 , H1 ∆ ∥ 2 ∥ = tr(H1)2 − (cid:10) As tr(H) increases in the first training step, (cid:10) (cid:11) H ∥ tr(H0)2 + 2x2 ∆f 2 1 − F also increases in the first training step. ∥ (cid:1)(cid:11) (cid:0) ∆f 2 0 . (56) H The effect of output scale on the training dynamics Given a neural network function f (x) with depth d and width w, we define the scaled network as fs(x) = αf (x), where α is referred to as the output scale. In this section, we empirically study the impact of the output scale on the early training dynamics. In particular, we show that a large (resp. relative to the one-hot encodings of the labels causes the sharpness to small) value of decrease (resp. increase) during early training. Interestingly, we still observe an increase in closs ⟩ ⟨ with d and 1/w, unlike the case of initializing network output to zero, highlighting the unique impact of output scale on the dynamics. For simplicity, we train FCNs using gradient descent with MSE loss using a subset consisting of 4096 examples of the CIFAR-10 dataset, as in the previous section. f (x; θ0) ∥ ∥ H.1 The effect of fixed output scale at initialization In this section, we study the training dynamics of models trained with a fixed output scale at initialization. Given a network output function f (θ), we define the 'scaled network' as fs(θ) = sf (θ) f (θ0) ∥ ∥ , (57) where s is a scalar, fixed throughout training. By construction, the network output norm f (θ0) equals s. For standard initialization, s = ∥ ∥ Figure 32 shows the training dynamics of FCNs for three different values of the output scale s. The training dynamics of networks with s = 1.0 and s = 10.0 share qualitative similarities. In contrast, networks initialized with a smaller output scale (s = 0.1) exhibit distinctly different dynamics. In particular, we observe that for large output scales (s ≳ 0.5) sharpness decreases during early training, while sharpness increases for small output scales 10. Furthermore, the training dynamics tends to (√k), where k are the number of classes. fs(θ0) O = ∥ ∥ 10We empirically observed that sharpness reduces for output scales as small as s ∼ 0.5, which is relatively small compared to √ k. 36 (a) (b) (c) (d) (e) (f) Figure 33: The phase diagrams of early training dynamics for ReLU FCNs with fixed output scale trained on a subset of the CIFAR-10 dataset using MSE loss using gradient descent. Each data point is an average over 10 initializations. The horizontal bars around the average data point indicate the region between 25% and 75% quantile. be noisier at small output scales, making it difficult to characterize catapult dynamics amidst these fluctuations. In summary, the training dynamics of networks with small output scale deviate from the training dynamics discussed in the main text, particularly as the sharpness quickly increases during early training. Figure 33 shows the trends of various critical constants with width for FCNs for three different values of s. Similar to vanilla networks, we observe that closs increases with d and 1/w. In comparison, sharpness decreases (increases) for large (small) values of s. These experiments suggest that the output scale primarly influences the increase/decrease in sharpness during early training and does not affect the scaling of closs with depth and width. Note that we do not generate phase diagrams for these experiments as the training dynamics of networks with small output scales at initialization deviate from the training dynamics disucssed in the main text. H.2 Scaling the output scale with width In this section, we study the training dynamics of models with an output scale scaled with width as α = w−σ, which is commonly used in the literature [19, 6, 4]. We consider three distinct σ 0.5 represents the lazy regime, σ = 0.5 corresponds to feature values learning (rich) regime and σ = 0.0 correponds to standard (vanilla) initialization. , where σ = } 0.5, 0.0, 0.5 {− − Figure 34 shows the training loss and sharpness trajectories of FCNs trained on for different σ values. We observe that the training trajectories in the lazy regime look identical to standard initialization. In comparison, the training trajectories in the feature learning regime is distinctly different. We observe that in the standard and lazy regimes, sharpness decreases during early training, whereas sharpness tends to increase in the feature learning regime and eventually oscillates around the edge of stability regime. Moreover, we observe that sharpness can catapult before the training loss in the feature learning regime (compare catapult peaks in 34(e, f)). These results are in parallel to the fixed output scale networks studied in the pervious section. 37 2−12123c2−112−102−92−81/ws=0.1loss:mse,depth:4hclossihcsharpihcmaxi2−12123c2−112−102−92−81/ws=1.0loss:mse,depth:4hclossihcsharpihcmaxi2−12123c2−112−102−92−81/ws=10.0loss:mse,depth:4hclossihcsharpihcmaxi2−12123c2−112−102−92−81/ws=0.1loss:mse,depth:8hclossihcsharpihcmaxi2−12123c2−112−102−92−81/ws=1.0loss:mse,depth:8hclossihcsharpihcmaxi2−12123c2−112−102−92−81/ws=10.0loss:mse,depth:8hclossihcsharpihcmaxi (a) (b) (c) (d) (e) (f) Figure 34: The early training dynamics of FCNs with output scale α = w−σ trained on the CIFAR- 10 dataset with MSE loss using gradient descent. Figure 35 summarizes the early training dynamics of FCNs with different σ values. We observe similar results as in the previous section. The output scale affects the initial increase/decrease of sharpness but does not affect the scaling trend of closs with depth and width. Moreover, we observe a systematic pattern of cmax scaling with width. In the lazy regime, we observe that cmax increases with 1/w, while cmax decreases with 1/w in the feature learning regime. I Sharpness curves in the intermediate saturation regime This section shows additional results for Section 3 for MSE loss. Cross-entropy results are shown in Appendix F. Figures 36 to 40 show the normalized sharpness curves for different depths and widths. I.1 Estimating the sharpness This paragraph describes the procedure for measuring the sharpness to study the effect of the learning rate, depth, and width in the intermediate saturation regime. We measure the sharpness λH τ at a time 200, for learning τ in the middle of the intermediate saturation regime. We choose τ so that cτ rates c = 2x, where x 1.0, 4.0] in steps of 0.1. The value 200 is chosen such that τ is in the middle of the intermediate saturation regime. Next, we measure sharpness over a range of steps [ − ≈ ∈ 38 05101520step0500100015002000Traininglossσ:-0.5loss:mse,width:512,depth:4c1234505101520step0.000.250.500.751.001.251.50λHt/λH0σ:-0.5loss:mse,width:512,depth:4c1234505101520step01234Traininglossσ:0.0loss:mse,width:512,depth:4c1234505101520step0.000.250.500.751.001.251.50λHt/λH0σ:0.0loss:mse,width:512,depth:4c1234505101520step0.0400.0450.050Traininglossσ:0.5loss:mse,width:512,depth:4c0.51.01.52.02.505101520step0.51.01.52.02.5λHt/λH0σ:0.5loss:mse,width:512,depth:4c0.51.01.52.02.5 (a) (b) (c) (d) (e) (f) Figure 35: The phase diagrams of early training dynamics for ReLU FCNs with varying depths and output scale. [τ t initializations and obtain the average sharpness. − ∈ 5, τ + 5] and average over t to reduce fluctuations. We repeat this process for various (a) d = 4 (b) d = 8 (c) d = 16 Figure 36: Sharpness measured at cτ = 200 against the learning rate constant for FCNs trained on the MNIST dataset, with varying depths and widths. Each curve is an average over ten initializations, where the shaded region depicts the standard deviation around the mean trend. The vertical lines denote ccrit estimated using the maximum of χ′ τ . I.2 Estimating the critical constant ccrit This subsection explains how to estimate ccrit from sharpness measured at time τ . First, we normalize the sharpness with its initial value, and then average over random initializations. Next, we estimate the critical point ccrit using the second derivative of the order parameter curve. Even if the obtained averaged normalized sharpness curve is somewhat smooth, the second derivative may become extremely noisy as minor fluctuations amplify on taking derivatives. This can cause difficulties in obtaining ccrit. We resolve this issue by estimating the smooth derivatives of the averaged order parameter with the Savitzky–Golay filter [59] using its scipy implementation [63]. The estimated ccrit is shown by vertical lines in the sharpness curves in Figures 36 to 40. 39 2−12123c2−112−102−92−81/wσ:-0.5loss:mse,depth:4hclossihcsharpihcmaxi2−12123c2−112−102−92−81/wσ:0.0loss:mse,depth:4hclossihcsharpihcmaxi2−22−1202122c2−112−102−92−81/wσ:0.5loss:mse,depth:4hclossihcsharpihcmaxi2−12123c2−112−102−92−81/wσ:-0.5loss:mse,depth:8hclossihcsharpihcmaxi2−12123c2−112−102−92−81/wσ:0.0loss:mse,depth:8hclossihcsharpihcmaxi2−12123c2−112−102−92−81/wσ:0.5loss:mse,depth:8hclossihcsharpihcmaxi2−12021222324c0.00.20.40.60.8λHτ/λH0width256512102420482−12021222324c0.00.20.40.6λHτ/λH0width256512102420482−12021222324c0.00.20.40.6λHτ/λH0width25651210242048 (a) d = 4 (b) d = 8 (c) d = 16 Figure 37: Sharpness measured at cτ = 200 against the learning rate constant for FCNs trained on the Fashion-MNIST dataset, with varying depths and widths. Each curve is an average over ten initializations, where the shaded region depicts the standard deviation around the mean trend. The vertical lines denote ccrit estimated using the maximum of χ′ τ . (a) d = 4 (b) d = 8 (c) d = 16 Figure 38: Sharpness measured at cτ = 200 against the learning rate constant for FCNs trained on the CIFAR-10 dataset, with varying depths and widths. Each curve is an average over ten initializations, where the shaded region depicts the standard deviation around the mean trend. The vertical lines denote ccrit estimated using the maximum of χ′ τ . (a) d = 5 (b) d = 7 (c) d = 10 Figure 39: Sharpness measured at cτ = 200 against the learning rate constant for Myrtle-CNNs trained on the CIFAR-10 dataset, with varying depths and widths. Each curve is an average of over ten initializations, where the shaded region depicts the standard deviation around the mean trend. The vertical lines denote ccrit estimated using the maximum of χ′ τ . J The effect of batch size on the reported results J.1 The early transient regime Figure 41 shows the phase diagrams of early training dynamics of FCNs with d = 4 trained on the CIFAR-10 dataset using two different batch sizes. The phase diagram obtained is consistent with the findings presented in Section 2, except for one key difference. Specifically, we observe that when d/w is small and small batch sizes are used for training, sharpness may increase from initialization 40 2−12021222324c0.00.20.40.60.8λHτ/λH0width256512102420482−12021222324c0.00.20.40.6λHτ/λH0width256512102420482−12021222324c0.00.20.40.6λHτ/λH0width256512102420482−12021222324c0.00.20.40.60.8λHτ/λH0width256512102420482−12021222324c0.00.20.40.6λHτ/λH0width256512102420482−12021222324c0.00.10.20.30.40.50.6λHτ/λH0width256512102420482−12021222324c0.00.20.40.60.8λHτ/λH0width1282565122−12021222324c0.00.20.40.60.8λHτ/λH0width1282565122−12021222324c0.00.20.40.60.8λHτ/λH0width128256512 (a) d = 18 (b) d = 34 (c) d = 50 Figure 40: Sharpness measured at cτ = 200 against the learning rate constant for ResNets trained on the CIFAR-10 dataset, with varying depths and widths. Each curve is an average of over ten initializations, where the shaded region depicts the standard deviation around the mean trend. The vertical lines denote ccrit estimated using the maximum of χ′ τ . at relatively smaller values of c. This is reflected in Fig. 41 by moving to the left as B is reduced from 512 to 128. However, this initial increase in sharpness is small compared to the sharpness catapult observed at larger batch sizes. We found that this increase at small batch sizes is due to fluctuations in gradient estimation that can cause sharpness to increase above its initial value by chance. csharp ⟩ ⟨ (a) B = 128 (b) B = 512 Figure 41: The phase diagram of early training for FCNs with d = 4 trained on the CIFAR-10 dataset with MSE loss using SGD with different batch sizes. J.2 The intermediate saturation regime (a) (b) (c) Figure 42: (a) Normalized sharpness measured at cτ = 200 against the learning rate constant for FCNs with d = 4 trained on the CIFAR-10 dataset, with varying widths. Each data point is an average over 10 initializations, where the shaded region depicts the standard deviation around the mean trend. (b, c) Smooth estimations of the first two derivatives, χτ and χ′ τ , of the averaged normalized sharpness wrt the learning rate constant. Figure 42 shows the normalized sharpness, measured at cτ = 200, and its derivatives for various widths and batch sizes. The results are consistent with those in Section 3, with a lowering in the peak 41 2−12021222324c0.00.20.40.6λHτ/λH0width32641282−12021222324c0.00.20.40.6λHτ/λH0width32641282−12021222324c0.00.20.40.60.8λHτ/λH0width32641282−12123c2−92−82−72−6d/whclossihcsharpihcmaxihcbarrieri2−12123c2−92−82−72−6d/whclossihcsharpihcmaxihcbarrieri2−12021222324c0.00.20.40.60.8λHτ/λH0width25651210242048B321285122−12021222324c0.00.20.40.6χτwidth25651210242048|S|32.0128.0512.02−12021222324c−0.50.00.51.0χ0τwidth25651210242048B32.0128.0512.0 heights of the derivatives χ and χ′ at small batch sizes. The lowering of the peak heights means the full width at half maximum increases, which implies a broadening of the transition around ccrit at smaller batch sizes. K The effect of bias on the reported results In this section, we show that FCNs with bias show similar results as presented in the main text. We considered FCNs in SP initialized with He initialization [29]. Figure 43 shows the phase diagrams of early training for FCNs with bias trained on the CIFAR-10 dataset. We observe a similar phase diagram compared to the no-bias case (compare with Figure 26). (a) d = 4 (b) d = 8 Figure 43: The phase diagram of early training for FCNs with bias trained on the CIFAR-10 dataset with MSE loss using SGD with different depths. 42 2−12123c2−92−82−72−6d/whclossihcsharpihcmaxi2−1212325c2−82−72−62−5d/whclossihcsharpihcmaxi
http://arxiv.org/abs/2302.12247v4
2023-10-30T05:32:38
2023-02-23T18:59:05
Quantifying & Modeling Multimodal Interactions: An Information Decomposition Framework
The recent explosion of interest in multimodal applications has resulted in a wide selection of datasets and methods for representing and integrating information from different modalities. Despite these empirical advances, there remain fundamental research questions: How can we quantify the interactions that are necessary to solve a multimodal task? Subsequently, what are the most suitable multimodal models to capture these interactions? To answer these questions, we propose an information-theoretic approach to quantify the degree of redundancy, uniqueness, and synergy relating input modalities with an output task. We term these three measures as the PID statistics of a multimodal distribution (or PID for short), and introduce two new estimators for these PID statistics that scale to high-dimensional distributions. To validate PID estimation, we conduct extensive experiments on both synthetic datasets where the PID is known and on large-scale multimodal benchmarks where PID estimations are compared with human annotations. Finally, we demonstrate their usefulness in (1) quantifying interactions within multimodal datasets, (2) quantifying interactions captured by multimodal models, (3) principled approaches for model selection, and (4) three real-world case studies engaging with domain experts in pathology, mood prediction, and robotic perception where our framework helps to recommend strong multimodal models for each application.
[ "Paul Pu Liang", "Yun Cheng", "Xiang Fan", "Chun Kai Ling", "Suzanne Nie", "Richard Chen", "Zihao Deng", "Nicholas Allen", "Randy Auerbach", "Faisal Mahmood", "Ruslan Salakhutdinov", "Louis-Philippe Morency" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12247v4", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12247v4", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.CL", "cs.CV", "cs.IT", "math.IT" ]
3 2 0 2 t c O 0 3 ] G L . s c [ 4 v 7 4 2 2 1 . 2 0 3 2 : v i X r a Quantifying & Modeling Multimodal Interactions: An Information Decomposition Framework Paul Pu Liang1, Yun Cheng1,2, Xiang Fan1,3, Chun Kai Ling1,8, Suzanne Nie1, Richard J. Chen4,5, Zihao Deng6, Nicholas Allen7, Randy Auerbach8, Faisal Mahmood4,5, Ruslan Salakhutdinov1, Louis-Philippe Morency1 1CMU, 2Princeton University, 3UW, 4Harvard Medical School, 5Brigham and Women's Hospital, 6University of Pennsylvania, 7University of Oregon, 8Columbia University [email protected], [email protected] Abstract The recent explosion of interest in multimodal applications has resulted in a wide selection of datasets and methods for representing and integrating information from different modalities. Despite these empirical advances, there remain fundamental research questions: How can we quantify the interactions that are necessary to solve a multimodal task? Subsequently, what are the most suitable multimodal models to capture these interactions? To answer these questions, we propose an information-theoretic approach to quantify the degree of redundancy, uniqueness, and synergy relating input modalities with an output task. We term these three measures as the PID statistics of a multimodal distribution (or PID for short), and introduce two new estimators for these PID statistics that scale to high-dimensional distributions. To validate PID estimation, we conduct extensive experiments on both synthetic datasets where the PID is known and on large-scale multimodal benchmarks where PID estimations are compared with human annotations. Finally, we demonstrate their usefulness in (1) quantifying interactions within multimodal datasets, (2) quantifying interactions captured by multimodal models, (3) principled approaches for model selection, and (4) three real-world case studies engaging with domain experts in pathology, mood prediction, and robotic perception where our framework helps to recommend strong multimodal models for each application. Introduction 1 A core challenge in machine learning lies in capturing the interactions between multiple input modalities. Learning different types of multimodal interactions is often quoted as motivation for many successful multimodal modeling paradigms, such as contrastive learning to capture redun- dancy [54, 82], modality-specific representations to retain unique information [100], as well as tensors and multiplicative interactions to learn higher-order interactions [52, 58, 115]. However, several fundamental research questions remain: How can we quantify the interactions that are necessary to solve a multimodal task? Subsequently, what are the most suitable multimodal models to capture these interactions? This paper aims to formalize these questions by proposing an approach to quantify the nature (i.e., which type) and degree (i.e., the amount) of modality interactions, a fundamental principle underpinning our understanding of multimodal datasets and models [62]. By bringing together two previously disjoint research fields of Partial Information Decomposition (PID) in information theory [13, 41, 108] and multimodal machine learning [9, 62], we provide precise definitions categorizing interactions into redundancy, uniqueness, and synergy. Redundancy quantifies information shared between modalities, uniqueness quantifies the information present in only one of the modalities, and synergy quantifies the emergence of new information not previously present in either modality. A key aspect of these four measures is that they not only quantify interactions between modalities, but also how they relate to a downstream task. Figure 1 shows a depiction of these four measures, which we refer to as PID statistics. Leveraging insights from 37th Conference on Neural Information Processing Systems (NeurIPS 2023). neural representation learning, we propose two new estimators for PID statistics that can scale to high-dimensional multimodal datasets and models. The first estimator is exact, based on convex optimization, and is able to scale to features with discrete support, while the second estimator is an approximation based on sampling, which enables us to handle features with large discrete or even continuous supports. We validate our estimation of PID in 2 ways: (1) on synthetic datasets where PID statistics are known due to exact computation and from the nature of data generation, and (2) on real-world data where PID is compared with human annotation. Finally, we demonstrate that these estimated PID statistics can help in multimodal applications involving: 1. Dataset quantification: We apply PID to quantify large-scale multimodal datasets, showing that these estimates match common intuition for interpretable modalities (e.g., language, vision, and audio) and yield new insights in other domains (e.g, healthcare, HCI, and robotics). 2. Model quantification: Across a suite of models, we apply PID to interpret model predictions and find consistent patterns of interactions that different models capture. 3. Model selection: Given our findings from dataset and model quantification, a new research question naturally arises: given a new multimodal task, can we quantify its PID values to infer (a priori) what type of models are most suitable? Our experiments show success in model selection for both existing benchmarks and completely new case studies engaging with domain experts in computational pathology, mood prediction, and robotics to select the best multimodal model. Finally, we make public a suite of trained models across 10 model families and 30 datasets to acceler- ate future analysis of multimodal interactions at https://github.com/pliang279/PID. 2 Background and Related Work Let Xi and Y be sample spaces for features and labels. Define ∆ to be the set of joint distributions over (X1, X2, Y). We are concerned with features X1, X2 (with support Xi) and labels Y (with support Y) drawn from some distribution p ∈ ∆. We denote the probability mass (or density) function by p(x1, x2, y), where omitted parameters imply marginalization. Key to our work is defining estimators that given p or samples {(x1, x2, y) : X1 × X2 × Y} thereof (i.e., dataset or model predictions), returns estimates for the amount of redundant, unique, and synergistic interactions. 2.1 Partial Information Decomposition Information theory formalizes the amount of information that one variable provides about another [86]. However, its extension to 3 vari- ables is an open question [34, 70, 93, 106]. In particular, the natural three-way mutual information I(X1; X2; Y ) = I(X1; X2) − I(X1; X2|Y ) [70, 93] can be both positive and negative, which makes it difficult to inter- pret. In response, Partial information decom- position (PID) [108] generalizes information theory to multiple variables by decomposing Ip(X1, X2; Y ), the total information 2 vari- ables X1, X2 provide about a task Y into 4 quantities (see Figure 1): redundancy R between X1 and X2, uniqueness U1 in X1 and U2 in X2, and synergy S that only emerges when both X1 and X2 are present. We adopt the PID definition proposed by Bertschinger et al. [13]: Figure 1: PID decomposes I(X1, X2; Y ) into redun- dancy R between X1 and X2, uniqueness U1 in X1 and U2 in X2, and synergy S in both X1 and X2. Iq(X1; X2; Y ), R = max q∈∆p U1 = min q∈∆p Iq(X1; Y |X2), U2 = min q∈∆p Iq(X1, X2; Y ), S = Ip(X1, X2; Y ) − min q∈∆p Iq(X2; Y |X1), (1) (2) (3) where ∆p = {q ∈ ∆ : q(xi, y) = p(xi, y) ∀y ∈ Y, xi ∈ Xi, i ∈ [2]} and the notation Ip(*) and Iq(*) disambiguates mutual information under p and q respectively. The key lies in optimizing q ∈ ∆p to satisfy the marginals q(xi, y) = p(xi, y), but relaxing the coupling between x1 and x2: q(x1, x2) need not be equal to p(x1, x2). The intuition behind this is that one should be able to infer redundancy and uniqueness given only access to p(x1, y) and p(x2, y), and therefore they should only depend on q ∈ ∆p. Synergy is the only term that should depend on the coupling p(x1, x2), and this is reflected 2 Classical Information TheoryPartial Information Decomposition in (3) depending on the full p distribution. This definition enjoys several useful properties in line with intuition, as we will see in comparison with related frameworks for interactions below [13]. 2.2 Related Frameworks for Feature Interactions Information-theoretic definitions: Perhaps the first measure of redundancy in machine learning is co-training [14, 8, 23], where 2 variables are redundant if they are conditionally independent given the task: I(X1; X2|Y ) = 0. As a result, redundancy can be measured by I(X1; X2; Y ). The same definition of redundancy is used in multi-view learning [98, 94, 89] which further define I(X1; Y |X2) and I(X2; Y |X1) as unique information in X1, X2. However, I(X1; X2; Y ) can be both positive and negative [51]. PID resolves this by separating R and S such that R − S = I(X1; X2; Y ), identifying that prior measures confound redundancy and synergy. This crucially provides an explanation for the distinction between mediation, where one feature conveys the information already in another (i.e., R > S), versus moderation, where one feature affects the relationship of other features (i.e., S > R) [10, 36]. Furthermore, if I(X1; X2; Y ) = 0 then existing frameworks are unable to distinguish between positive R and S canceling each other out. Statistical measures: Other approaches have studied interaction measures via statistical measures, such as redundancy via distance between prediction logits using either feature [69], statistical distribution tests on input features [114, 7], or via human annotations [85]. However, it is unclear how to extend these definitions to uniqueness and synergy while remaining on the same standardized scale like PID provides. Also of interest are notions of redundant and synergistic interactions in human and animal communication [78, 79, 30, 85], which we aim to formalize. Model-based methods: Prior research has formalized definitions of non-additive interactions [32] to quantify their presence [88, 101, 102, 46] in trained models, or used Shapley values on trained features to measure interactions [49]. Parallel research has also focused on qualitative visualizations of real- world multimodal datasets and models, such as DIME [68], M2Lens [105], and MultiViz [61]. 3 Scalable Estimators for PID PID as a framework for multimodality: Our core insight is that PID provides a formal framework to understand both the nature and degree of interactions involved when two features X1 and X2 are used for task Y . The nature of interactions is afforded by a precise decomposition into redundant, unique, and synergistic interactions, and the degree of interactions is afforded by a standardized unit of measure (bits). However, computing PID is a considerable challenge, since it involves optimization over ∆p and estimating information-theoretic measures. Up to now, analytic approximations of these quantities were only possible for discrete and small support [13, 41, 109] or continuous but low-dimensional variables [76, 81, 110]. Leveraging ideas in representation learning, Sections 3.1 and 3.2 are our first technical contributions enabling scalable estimation of PID for high-dimensional distributions. The first, CVX, is exact, based on convex optimization, and is able to scale to problems where |Xi| and |Y| are around 100. The second, BATCH, is an approximation based on sampling, which enables us to handle large or even continuous supports for Xi and Y . Applying these estimators in Section 4, we show that PID provides a path towards understanding the nature of interactions in datasets and those learned by different models, and principled approaches for model selection. 3.1 CVX: Dataset-level Optimization Our first estimator, CVX, directly compute PID from its definitions using convex programming. Crucially, Bertschinger et al. [13] show that the solution to the max-entropy optimization problem: q∗ = arg maxq∈∆p Hq(Y |X1, X2) equivalently solves (1)-(3). When Xi and Y are small and discrete, we can represent all valid distributions q(x1, x2, y) as a set of tensors Q of shape |X1| × |X2| × |Y| with each entry representing Q[i, j, k] = p(X1 = i, X2 = j, Y = k). The problem then boils down to optimizing over valid tensors Q ∈ ∆p that match the marginals p(xi, y). Given a tensor Q representing q, our objective is the concave function Hq(Y |X1, X2). While Bertschinger et al. [13] report that direct optimization is numerically difficult as routines such as Mathematica's FINDMINIMUM do not exploit convexity, we overcome this by rewriting conditional entropy as a KL-divergence [38], Hq(Y |X1, X2) = log |Y| − KL(q|| ̃q), where ̃q is an auxiliary product density of q(x1, x2) * 1 |Y| enforced using linear constraints: ̃q(x1, x2, y) = q(x1, x2)/|Y|. Finally, optimizing over Q ∈ ∆p that match the marginals can also be enforced through linear constraints: the 3D-tensor Q summed over the second dimension gives q(x1, y) and summed over 3 Figure 2: We propose BATCH, a scalable estimator for PID over high-dimensional continuous distributions. BATCH parameterizes ̃q using a matrix A learned by neural networks such that mutual information objectives over ̃q can be optimized via gradient-based approaches over minibatches. Marginal constraints ̃q ∈ ∆p are enforced through a variant of the Sinkhorn-Knopp algorithm on A. the first dimension gives q(x2, y), yielding the final optimization problem: arg max Q, ̃Q KL(Q|| ̃Q), s.t. ̃Q(x1, x2, y) = Q(x1, x2)/|Y|, Q = p(x1, y), (cid:88) x2 (cid:88) x1 Q = p(x2, y), Q ≥ 0, (cid:88) Q = 1. x1,x2,y (4) (5) The KL-divergence objective is recognized as convex, allowing the use of conic solvers such as SCS [75], ECOS [27], and MOSEK [6]. Plugging q∗ into (1)-(3) yields the desired PID. Pre-processing via feature binning: In practice, X1 and X2 often take continuous rather than discrete values. We work around this by histogramming each Xi, thereby estimating the continuous joint density by discrete distributions with finite support. We provide more details in Appendix B.1. 3.2 BATCH: Batch-level Amortization We now present BATCH, our next estimator that is suitable for large datasets where Xi is high- dimensional and continuous (|Y| remains finite). To estimate PID given a sampled dataset D = {(x(j) 2 , y(j))} of size n, we propose an end-to-end model parameterizing marginal-matching joint distributions in ∆p and a training objective whose solution returns approximate PID values. 1 , x(j) Simplified algorithm sketch: Our goal, loosely speaking, is to optimize ̃q ∈ ∆p for objective (1) through an approximation using neural networks instead of exact optimization. We show an overview in Figure 2. To explain our approach, we first describe (1) how we parameterize ̃q using neural networks such that it can be learned via gradient-based approaches, (2) how we ensure the marginal constraints ̃q ∈ ∆p through a variant of the Sinkhorn-Knopp algorithm, and finally (3) how to scale this up over small subsampled batches from large multimodal datasets. Parameterization using neural networks: The space of joint distributions ∆ is often too large to explicitly specify. To tackle this, we implicitly parameterize each distribution ̃q ∈ ∆ using a neural network fφ that takes in batches of modalities X1 ∈ (cid:101)X n 2 and the label Y ∈ Y n before returning a matrix A ∈ Rn×n×|Y| representing an (unnormalized) joint distribution ̃q, i.e., we want A[i][j][y] = ̃q(X1[i], X2[j], y) for each y ∈ Y. In practice, fφ is implemented via a pair of encoders fφ(1) and fφ(2) that learn modality representations, before an outer product to learn joint relationships Ay = exp(fφ(1)(X1, y)fφ(2)(X2, y)⊤) for each y, yielding the desired n × n × |Y| joint distribution. As a result, optimizing over ̃q can be performed via optimizing over parameters φ. 1 , X2 ∈ (cid:101)X n Respecting the marginal constraints: How do we make sure the ̃q's learned by the network satisfies the marginal constraints (i.e., ̃q ∈ ∆p)? We use an unrolled version of Sinkhorn's algorithm [24] which projects A onto ∆p by iteratively normalizing A's rows and columns to sum to 1 and rescaling to satisfy the marginals p(xi, y). However, p(xi, y) is not easy to estimate for high-dimensional continuous xi's. In response, we first expand p(xi, y) into p(y|xi) and p(xi) using Bayes' rule. Since A was constructed by samples xi from the dataset, the rows and columns of A are already distributed according to p(x1) and p(x2) respectively. This means that it suffices to approximate p(y|xi) with unimodal classifiers ˆp(y|xi) parameterized by neural networks and trained separately, before using Sinkhorn's algorithm to normalize each row to ˆp(y|x1) and each column to ˆp(y|x2). Objective: We choose the objective Iq(X1; X2; Y ), which equivalently solves the optimization problems in the other PID terms [13]. Given matrix A representing ̃q(x1, x2, y), the objective can be computed in closed form through appropriate summation across dimensions in A to obtain ̃q(xi), ̃q(x1, x2), ̃q(xi|y), and ̃q(x1, x2|y) and plugging into I ̃q(X1; X2; Y ) = I ̃q(X1; X2)−I ̃q(X1; X2|Y ). We maximize I ̃q(X1; X2; Y ) by updating parameters φ via gradient-based methods. Overall, each 4 SensorsVideoSinkhorn's algorithmUnnormalizedjoint distributionTraining objectivePID values Figure 3: Left to right: (a) Contour plots of the GMM's density for ||μ||2 = 2.0. Red line denotes the optimal linear classifier. (b) PID (Cartesian) computed for varying ∠μ with respect to the x axis. (c) PID (Polar) for varying ∠μ, with U1 and U2 corresponding to unique information from (r, θ). Plots (d)-(f) are similar to (a)-(c), but repeated for ||μ||2 = 1.0. Legend: ✖(R), q(U1), s(U2), u(S), ✚(Sum). Observe how PID changes with the change of variable from Cartesian (b and e) to Polar (c and f), as well as how a change in ||μ||2 can lead to a disproportionate change across PID (b vs e). gradient step involves computing ̃q = SINKHORN ˆp(A), and updating φ to maximize (1) under ̃q. Since Sinkhorn's algorithm is differentiable, gradients can be backpropagated end-to-end. Approximation with small subsampled batches: Finally, to scale this up to large multimodal datasets where the full ̃q may be too large to store, we approximate ̃q with small subsampled batches: for each gradient iteration t, the network fφ now takes in a batch of m ≪ n datapoints sampled from D and returns A ∈ Rm×m×|Y| for the subsampled points. We perform Sinkhorn's algorithm on A and a gradient step on φ as above, as if Dt was the full dataset (i.e., mini-batch gradient descent). While it is challenging to obtain full-batch gradients since computing the full A is intractable, we found our approach to work in practice for large m. Our approach can also be informally viewed as performing amortized optimization [3] by using φ to implicitly share information about the full batch using subsampled batches. Upon convergence of φ, we extract PID by plugging ̃q into (1)-(3). Implementation details such as the network architecture of f , approximation of objective (1) via sampling from ̃q, and estimation of I ̃q({X1, X2}; Y ) from learned ̃q are in Appendix B.3. 4 Evaluation and Applications of PID in Multimodal Learning We design experiments to (1) understand PID on synthetic data, (2) quantify real-world multimodal benchmarks, (3) understand the interactions captured by multimodal models, (4) perform model selection across different model families, and (5) applications on novel real-world tasks. 4.1 Validating PID Estimates on Synthetic Data Our first goal is to evaluate the accuracy of our proposed estimators with respect to the ground truth (if it can be computed) or human judgment (for cases where the ground truth cannot be readily obtained). We start with a suite of datasets spanning both synthetic and real-world distributions. OR XOR AND 0 0.5 0.31 0 0 0.5 0.31 0 0 0.5 0.31 0 Table 1: Results on estimating PID on synthetic bitwise datasets. Both our estimators exactly recover the correct PID values as reported in Bertschinger et al. [13]. Task R U1 U2 S R U1 U2 S R U1 U2 S PID 0 1 Exact 0.31 0 CVX 0.31 0 0 1 0 1 BATCH 0.31 0 Synthetic bitwise features: We sam- ple from a binary bitwise distribution: x1, x2 ∼ {0, 1}, y = x1 ∧ x2, y = x1 ∨ x2, y = x1 ⊕ x2,. Each bitwise operator's PID can be solved exactly when the xi's and labels are discrete and low-dimensional [13]. Compared to the ground truth in Bertschinger et al. [13], both our estimators exactly recover the correct PID values (Table 1). Gaussian Mixture Models (GMM): Consider a GMM, where X1, X2 ∈ R and the label Y ∈ {−1, +1}, comprising two equally weighted standard multivariate Gaussians centered at ±μ, where μ ∈ R2, i.e., Y ∼ Bernoulli(1/2), (X1, X2)|Y = y ∼ N (y * μ, I). PID was estimated by sampling 1e6 points, histogramming them into 50 bins spanning [−5, +5] to give p, and then applying the CVX estimator. We term this PID-Cartesian. We also compute PID-Polar, which are PID computed using polar coordinates, (r, θ). We use a variant where the angle θ is given by the arctangent with principal values [0, π] and the length r ∈ R could be negative. θ specifies a line (through the origin), and r tells us where along the line the datapoint lies on. Results: We consider ||μ||2 ∈ {1.0, 2.0}, where for each ||μ||2, we vary the angle ∠μ that μ makes with the horizontal axis. Our computed PID is presented in Figure 3. Overall, we find that the PID matches what we expect from intuition. For Cartesian, unique information dominates when 0 0.5 0 0 0 0.5 0 0 0 0.5 0 0 5 505(a)50501(b)0.02.55.07.51e101(c)0.02.55.07.51e1505(d)50501(e)0.02.55.07.51e101(f)0.02.55.07.51e1 Table 2: Estimating PID on synthetic generative model datasets. Both CVX and BATCH measures agree with each other on relative values and are consistent with ground truth interactions. y = f (z∗ 1 , z∗ R U1 U2 DU2 R U1 U2 S R U1 U2 S R U1 U2 S R U1 U2 2 , z∗ c ) S DU1 DR DS S 0 0.05 0 0.16 0 0.05 0 0 0.17 0.05 0.07 0 0.01 0.14 0.04 0.01 0 0.07 0 0 0.30 0 0.11 0.02 0.02 0.15 0.06 0.01 0.01 0.06 0 0.27 0 0 0.54 0 0 0.30 0 0 0.56 0 0 0.56 0.13 0 0 0 0 0 Task PID CVX 0.16 0 BATCH 0.29 0.02 0.02 0 0 0.58 0 Truth 0 y = f (z1, z∗ 2 , z∗ c ) Task R U1 U2 S PID CVX 0.04 0.06 0 0.07 0.07 0 BATCH 0.04 0.09 0 0.06 0.11 0.02 0.02 0.10 0.11 0.02 0.02 0.05 0.07 0 0.06 0 0.19 0 0.06 0 0.34 0 0.17 0 Truth 0 0.12 0.1 0 0.01 0.07 0.03 0 0.04 0.05 0.1 0 0.04 0.05 y = f (z∗ 2 , zc) S R U1 U2 S y = f (z1, z2, z∗ c ) S R U1 U2 y = f (z∗ 1 , z∗ R U1 U2 0 0.25 0 0.25 0.18 0 0 0.22 0.21 0 0.21 0 y = f (z∗ R U1 U2 0 0.36 0.22 0 2 , zc) S 2 , z∗ c ) the angle goes to 0 or π/2 - if centroids share a coordinate, then observing that coordinate yields no information about y. Conversely, synergy and redundancy peak at π/4. Interestingly, synergy seems to be independent of ||μ||2. For Polar, redundancy is 0. Furthermore, θ contains no unique information, since θ shows nothing about y unless we know r (in particular, its sign). When the angle goes to π/2, almost all information is unique in r. The distinctions between Cartesian and Polar highlight how different representations of data can exhibit wildly different PID values, even if total information is the same. More thorough results and visualizations of q∗ are in Appendix C.2. Synthetic generative model: We begin with a set of latent vectors z1, z2, zc ∼ N (0d, Σ2 d), d = 50 representing information unique to X1, X2 and common to both respectively. [z1, zc] is transformed into high-dimensional x1 using a fixed transformation T1 and likewise [z2, zc] to x2 via T2. The label y is generated as a function of (1) only zc, in which case we expect complete redundancy, (2) only z1 or z2 which represents complete uniqueness, (3) a combination of z1 and z2 representing complete synergy, or (4) arbitrary ratios of each of the above with z∗ i representing half of the dimensions from zi and therefore half of each interaction. In total, Table 2 shows the 10 synthetic datasets we generated: 4 specialized datasets DI , I ∈ {R, U1, U2, S} where y only depends on one interaction, and 6 mixed datasets with varying interaction ratios. We also report the ground-truth interactions as defined by the label-generating process and the total capturable information using the bound in Feder and Merhav [29], which relates the accuracy of the best model on these datasets with the mutual information between the inputs to the label. Since the test accuracies for Table 2 datasets range from 67-75%, this corresponds to total MI of 0.42 − 0.59 bits. Results: From Table 2, both CVX and BATCH agree in relative PID values, correctly assigning the predominant interaction type and interactions with minimal presence consistent with the ground-truth based on data generation. For example, DR has the highest R value, and when the ratio of z1 increases, U1 increases from 0.01 on y = f (z∗ 1 , z∗ c ). We also note some interesting observations due to the random noise in label generation, such as the non-zero synergy measure of datasets such as DR, DU1, DU2 whose labels do not depend on synergy. 4.2 Quantifying Real-world Multimodal Benchmarks We now apply these estimators to quantify the interactions in real-world multimodal datasets. c ) to 0.06 on y = f (z1, z∗ 2 , z∗ 2 , z∗ Real-world multimodal data setup: We use a large collection of real-world datasets in Multi- Bench [60] which test multimodal fusion of different input signals (including images, video, audio, text, time-series, sets, and tables) for different tasks (predicting humor, sentiment, emotions, mortality rate, ICD-9 codes, image-captions, human activities, digits, and design interfaces). We also include experiments on question-answering (Visual Question Answering 2.0 [5, 39] and CLEVR [53]) which test grounding of language into the visual domain. For the 4 datasets (top row of Table 3) involving images and text where modality features are available and readily clustered, we apply the CVX estimator on top of discrete clusters. For the remaining 4 datasets (bottom row of Table 3) with video, audio, and medical time-series modalities, clustering is not easy, so we use the end-to-end BATCH estimator (see Appendix C.4 for full dataset and estimator details). Human judgment of interactions: Real-world multimodal datasets do not have reference PID values, and exact PID computation is impossible due to continuous data. We therefore use human judgment as a reference. We design a new annotation scheme where we show both modalities and the label and ask each annotator to annotate the degree of redundancy, uniqueness, and synergy on a scale of 0-5, alongside their confidence in their answers on a scale of 0-5. We show a sample 6 Table 3: Estimating PID on real-world MultiBench [60] datasets. Many of the estimated interactions align well with human judgement as well as unimodal performance. AV-MNIST U2 U1 Task PID CVX Human 0.57 0.61 R S 0.10 0.97 0.03 0.08 0.73 0.38 0.53 0.34 0.79 0.87 0 4.92 0.55 0.48 0 5.16 0 6.19 - 0 6.58 S S S 0 0 0 0 0 0 - - - ENRICO R U1 U2 VQA 2.0 R U1 U2 CLEVR R U1 U2 MOSEI U2 U1 Task PID BATCH 0.26 0.49 0.03 0.04 0.03 0.04 0.01 0.08 0.14 0.01 0.01 0.30 0.05 0.17 0 0.01 Human 0.32 0.20 0.15 0.15 0.04 0.05 0.03 0.04 0.13 0.17 0.04 0.16 MIMIC R U1 U2 S UR-FUNNY MUSTARD R U1 R U1 U2 U2 R S S S - - - - user interface and annotation procedures in Appendix C.5. We give 50 datapoints from each dataset (except MIMIC and ENRICO which require specialized knowledge) to 3 annotators each. Results on multimodal fusion: From Table 3, we find that different datasets do require different interactions. Some interesting observations: (1) all pairs of modalities on MUSTARD sarcasm detection show high synergy values, which aligns with intuition since sarcasm is often due to a contradiction between what is expressed in language and speech, (2) uniqueness values are strongly correlated with unimodal performance (e.g., modality 1 in AV-MNIST and MIMIC), (3) datasets with high synergy do indeed benefit from interaction modeling as also seen in prior work (e.g., MUSTARD, UR-FUNNY) [17, 43], and (4) conversely datasets with low synergy are those where unimodal performance is relatively strong (e.g., MIMIC) [60]. Results on QA: We observe very high synergy values as shown in Table 3 consistent with prior work studying how these datasets were balanced (e.g., VQA 2.0 having different images for the same question such that the answer can only be obtained through synergy) [39] and that models trained on these datasets require non-additive interactions [46]. CLEVR has a higher proportion of synergy than VQA 2.0 (83% versus 75%): indeed, CLEVR is a more balanced dataset where the answer strictly depends on both the question and image with a lower likelihood of unimodal biases. Comparisons with human judgment: For human judgment, we cannot ask humans to give a score in bits, so it is on a completely different scale (0-5 scale). To put them on the same scale, we normalize the human ratings such that the sum of human interactions is equal to the sum of PID estimates. The resulting comparisons are in Table 3, and we find that the human-annotated interactions overall align with estimated PID: the highest values are the same for 4 datasets: both explain highest synergy on VQA and CLEVR, image (U1) being the dominant modality in AV-MNIST, and language (U1) being the dominant modality in MOSEI. Overall, the Krippendorff's alpha for inter-annotator agreement is high (0.72 for R, 0.68 for U1, 0.70 for U2, 0.72 for S) and the average confidence scores are also high (4.36/5 for R, 4.35/5 for U1, 4.27/5 for U2, 4.46/5 for S), indicating that the human-annotated results are reliable. For the remaining two datasets (UR-FUNNY and MUSTARD), estimated PID matches the second-highest human-annotated interaction. We believe this is because there is some annotator subjectivity in interpreting whether sentiment, humor, and sarcasm are present in language only (U1) or when contextualizing both language and video (S), resulting in cases of low annotator agreement in U1 and S: −0.14, −0.03 for UR-FUNNY and −0.08, −0.04 for MUSTARD. Comparisons with other interaction measures: Our framework allows for easy generalization to other interaction definitions: we also implemented 3 information theoretic measures I-min [108], WMS [19], and CI [74]. These results are in Table 10 in the Appendix, where we explain the limitations of these methods as compared to PID, such as over- and under-estimation, and potential negative estimation [41]. These are critical problems with the application of information theory for shared I(X1; X2; Y ) and unique information I(X1; Y |X2), I(X2; Y |X1) often quoted in the co-training [8, 14] and multi-view learning [89, 94, 98] literature. We also tried 3 non-info theory measures: Shapley values [67], Integrated gradients (IG) [91], and CCA [4], which are based on quantifying interactions captured by a multimodal model. Our work is fundamentally different in that interactions are properties of data before training any models (see Appendix C.6). 4.3 Quantifying Multimodal Model Predictions We now shift our focus to quantifying multimodal models. Do different multimodal models learn different interactions? A better understanding of the types of interactions that our current models struggle to capture can provide new insights into improving these models. 7 Table 4: Average interactions (R/U/S) learned by models alongside their average performance on interaction-specialized datasets (DR/DU /DS). Synergy is the hardest to capture and redundancy is relatively easier to capture by existing models. EF ADDITIVE AGREE ALIGN ELEM TENSOR MI MULT LOWER REC AVERAGE Model 0.55 R 0.35 Acc(DR) 0.71 0.75 0.52 U 0.29 0.73 Acc(DU ) 0.66 0.33 S 0.13 Acc(DS) 0.56 0.74 0.47 0.53 0.41 ± 0.11 0.74 0.75 0.73 ± 0.02 0.55 0.55 0.37 ± 0.14 0.73 0.73 0.68 ± 0.06 0.31 0.32 0.21 ± 0.10 0.73 0.74 0.68 ± 0.06 0.20 0.40 0.67 0.73 0.18 0.45 0.66 0.72 0.12 0.29 0.65 0.72 0.44 0.73 0.19 0.60 0.08 0.63 0.48 0.74 0.31 0.55 0.09 0.66 0.47 0.74 0.44 0.73 0.29 0.72 0.27 0.70 0.20 0.66 0.14 0.66 Setup: For each dataset, we train a suite of models on the train set Dtrain and apply it to the validation set Dval, yielding a predicted dataset Dpred = {(x1, x2, ˆy) ∈ Dval}. Running PID on Dpred summarizes the interactions that the model captures. We categorize and implement a comprehensive suite of models (spanning representation fusion at different feature levels, types of interaction inductive biases, and training objectives) that have been previously motivated to capture redundant, unique, and synergistic interactions (see Appendix C.7 for full model descriptions). Results: We show results in Table 4 and highlight the following observations: General observations: We first observe that model PID values are consistently higher than dataset PID. The sum of model PID is also a good indicator of test performance, which agrees with their formal definition since their sum is equal to I({X1, X2}; Y ), the total task-relevant information. On redundancy: Several methods succeed in capturing redundancy, with an overall average of R = 0.41 ± 0.11 and accuracy of 73.0 ± 2.0% on redundancy-specialized datasets. Additive, agreement, and alignment-based methods are particularly strong, and we do expect them to capture redundant shared information [26, 82]. Methods based on tensor fusion (synergy-based), including lower-order interactions, and adding reconstruction objectives (unique-based) also capture redundancy. On uniqueness: Uniqueness is harder to capture than redun- dancy, with an average of U = 0.37 ± 0.14. Redundancy-based methods like additive and agreement do poorly on unique- ness, while those designed for uniqueness (lower-order inter- actions [115] and modality reconstruction objectives [100]) do well, with on average U = 0.55 and 73.0% accuracy on uniqueness datasets. On synergy: Synergy is the hardest to capture, with an av- erage score of only S = 0.21 ± 0.10. Some of the strong methods are tensor fusion [33], tensors with lower-order inter- actions [115], modality reconstruction [100], and multimodal transformer [112], which achieve around S = 0.30, acc = 73.0%. Additive, agreement, and element-wise interactions do not seem to capture synergy well. On robustness: Finally, we also show connections between PID and model performance in the presence of missing modalities. We find high correlation (ρ = 0.8) between the performance drop when Xi is missing and the model's Ui value. Inspecting Figure 4, we find that the implication only holds in one direc- tion: high Ui coincides with large performance drops (in red), but low Ui can also lead to performance drops (in green). The latter can be further explained by the presence of large S values: when Xi is missing, synergy can no longer be learned which affects performance. For the subset of points when Ui ≤ 0.05, the correlation between S and performance drop is ρ = 0.73 (in contrast, the correlation for R is ρ = 0.01). Figure 4: We find high correlation (ρ = 0.8) between the performance drop when Xi is missing and the model's Ui value: high Ui coin- cides with large performance drops (red), but low Ui can also lead to performance drops. The latter can be further explained by large S so Xi is necessary (green). 4.4 PID Agreement and Model Selection Now that we have quantified datasets and models individually, the natural next question unifies both: what does the agreement between dataset and model PID measures tell us about model performance? We hypothesize that models able to capture the interactions necessary in a given dataset should also 8 Table 5: Model selection results on unseen synthetic and real-world datasets. Given a new dataset D, finding the closest synthetic dataset D′ with similar PID values and recommending the best models on D′ consistently achieves 95% − 100% of the best-performing model on D. Dataset % Performance 5 Synthetic Datasets MIMIC ENRICO UR-FUNNY MOSEI MUSTARD MAPS 100% 99.35% 95.15% 99.78% 100% 98.58% 99.91% achieve high performance. Given estimated interactions on dataset D and model f (D) trained on D, we define the agreement for each interaction I ∈ {R, U1, U2, S} as: αI (f, D) = ˆIDIf (D), ˆID = ID I ′∈{R,U1,U2,S} I ′ D , (cid:80) (6) I αI (f, D). which summarizes the quantity of an interaction captured by a model (If (D)) weighted by its normal- ized importance in the dataset ( ˆID). The total agreement sums over α(f, D) = (cid:80) Results: Our key finding is that PID agreement scores α(f, D) correlate (ρ = 0.81) with model accuracy across all 10 syn- thetic datasets as illustrated in Figure 5. This shows that PID agreement can be a useful proxy for model performance. For the specialized datasets, we find that the correlation between αI and DI is 0.96 for R, 0.86 for U , and 0.91 for S, and neg- atively correlated with other specialized datasets. For mixed datasets with roughly equal ratios of each interaction, the mea- sures that correlate most with performance are αR (ρ = 0.82) and αS (ρ = 0.89); datasets with relatively higher redundancy see ρ = 0.89 for αR; those with higher uniqueness have αU1 and αU2 correlate ρ = 0.92 and ρ = 0.85; those with higher synergy increases the correlation of αS to ρ = 0.97. Using these observations, our final experiment is model selec- tion: can we choose the most appropriate model to tackle the interactions required for a dataset? Figure 5: PID agreement α(f, D) between datasets and models strongly correlate with model accuracy (ρ = 0.81). Setup: Given a new dataset D, we first compute its difference in normalized PID values with respect to D′ among our suite of 10 synthetic datasets, s(D, D′) = (cid:80) I∈{R,U1,U2,S} | ˆID − ˆID′|, to rank the dataset D∗ with the most similar interactions, and return the top-3 performing models on D∗. In other words, we select models that best capture interactions that are of similar nature and degree as those in D. We emphasize that even though we restrict dataset and model search to synthetic datasets, we evaluate model selection on real-world datasets and find that it generalizes to the real world. Results: We test our selected models on 5 new synthetic datasets with different PID ratios and 6 real-world datasets, summarizing results in Table 5. We find that the top 3 chosen models achieve 95% − 100% of the best-performing model accuracy, and > 98.5% for all datasets except 95.2% on MUSTARD. For example, UR-FUNNY and MUSTARD have the highest synergy (S = 0.13, S = 0.3) and indeed transformers and higher-order interactions are helpful (MULT: 65%, MI: 61%, TENSOR: 60%). ENRICO has the highest R = 0.73 and U2 = 0.53, and methods for redundant and unique interactions perform best (LOWER: 52%, ALIGN: 52%, AGREE: 51%). MIMIC has the highest U1 = 0.17, and unimodal models are mostly sufficient [60]. 4.5 Real-world Applications Finally, we apply PID to 3 real-world case studies: pathology, mental health, and robotic perception (see full details and results in Appendix C.9-C.11). Case Study 1: Computational pathology. Cancer prognostication is a challenging task in anatomic pathology that requires integration of whole-slide imaging (WSI) and molecular features for patient stratification [21, 63, 71]. We use The Cancer Genome Atlas (TCGA), a large public data consortium of paired WSI, molecular, and survival information [107, 96], including modalities: (1) pre-extracted histology image features from diagnostic WSIs and (2) bulk gene mutation status, copy number variation, and RNA-Seq abundance values. We evaluate on two cancer datasets in TCGA, lower-grade glioma (LGG [73], n = 479) and pancreatic adenocarcinoma (PAAD [83], n = 209). 9 Results: In TCGA-LGG, most PID measures were near-zero except U2 = 0.06 for genomic features, which indicates that genomics is the only modality containing task-relevant information. This conclusion corroborates with the high performance of unimodal-genomic and multimodal models in Chen et al. [22], while unimodal-pathology performance was low. In TCGA-PAAD, the uniqueness in pathology and genomic features was less than synergy (U1 = 0.06, and U2 = 0.08 and S = 0.15), which also match the improvement of using multimodal models that capture synergy. Case Study 2: Mental health. Suicide is the second leading cause of death among adolescents [18]. Intensive monitoring of behaviors via adolescents' frequent use of smartphones may shed new light on the early risk of suicidal ideations [37, 72], since smartphones provide rich behavioral markers [59]. We used a dataset, MAPS, of mobile behaviors from high-risk consenting adolescent populations (approved by IRB). Passive sensing data is collected from each participant's smartphone across 6 months. The modalities include (1) text entered by the user represented as a bag of top 1000 words, (2) keystrokes that record the exact timing and duration of each typed character, and (3) mobile applications used per day as a bag of 137 apps. Every morning, users self-report their daily mood, which we discretized into −1, 0, +1. In total, MAPS has 844 samples from 17 participants. Results: We first experiment with MAPST,K using text and keystroke features. PID measures show that MAPST,K has high synergy (0.40), some redundancy (0.12), and low uniqueness (0.04). We found the purely synergistic dataset DS has the most similar interactions and the suggested models LOWER, REC, and TENSOR that work best on DS were indeed the top 3 best-performing models on MAPST,K, indicating that model selection is effective. Model selection also retrieves the best-performing model on MAPST,A using text and app usage features. Case Study 3: Robotic Perception. MuJoCo PUSH [57] is a contact-rich planar pushing task in MuJoCo [95], where a 7-DoF Panda Franka robot is pushing a circular puck with its end-effector in simulation. The dataset consists of 1000 trajectories with 250 steps sampled at 10Hertz. The multimodal inputs are gray-scaled images from an RGB camera, force and binary contact information from a force/torque sensor, and the 3D position of the robot end-effector. We estimate the 2D position of the unknown object on a table surface while the robot intermittently interacts with it. Results: We find that BATCH predicts U1 = 1.79 as the highest PID value, which aligns with our ob- servation that image is the best unimodal predictor. Comparing both estimators, CVX underestimates U1 and R since the high-dimensional time-series modality cannot be easily described by clusters without losing information. In addition, both estimators predict a low U2 value but attribute high R, implying that a multimodal model with higher-order interactions would not be much better than unimodal models. Indeed, we observe no difference in performance between these two. 5 Conclusion Our work aims to quantify the nature and degree of feature interactions by proposing scalable estimators for redundancy, uniqueness, and synergy suitable for high-dimensional heterogeneous datasets. Through comprehensive experiments and real-world applications, we demonstrate the utility of our proposed framework in dataset quantification, model quantification, and model selection. We are aware of some potential limitations: 1. These estimators only approximate real interactions due to cluster preprocessing or unimodal models, which naturally introduce optimization and generalization errors. We expect progress in density estimators, generative models, and unimodal classifiers to address these problems. 2. It is harder to quantify interactions for certain datasets, such as ENRICO which displays all interactions which makes it difficult to distinguish between R and S or U and S. 3. Finally, there exist challenges in quantifying interactions since the data generation process is never known for real-world datasets, so we have to resort to human judgment, other automatic measures, and downstream tasks such as estimating model performance and model selection. Future work can leverage PID for targeted dataset creation, representation learning optimized for PID values, and applications of information theory to higher-dimensional data. More broadly, there are several exciting directions in investigating more applications of multivariate information theory in modeling feature interactions, predicting multimodal performance, and other tasks involving feature interactions such as privacy-preserving and fair representation learning from high-dimensional data [28, 42]. Being able to provide guarantees for fairness and privacy-preserving learning can be particularly impactful. 10 Acknowledgements This material is based upon work partially supported by Meta, National Science Foundation awards 1722822 and 1750439, and National Institutes of Health awards R01MH125740, R01MH132225, R01MH096951 and R21MH130767. PPL is supported in part by a Siebel Scholarship and a Waibel Presidential Fellowship. RS is supported in part by ONR grant N000142312368 and DARPA FA87502321015. One of the aims of this project is to understand the comfort zone of people for better privacy and integrity. Any opinions, findings, conclusions, or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the sponsors, and no official endorsement should be inferred. Finally, we would also like to acknowledge feedback from the anonymous reviewers who significantly improved the paper and NVIDIA's GPU support. References [1] Akshay Agrawal, Robin Verschueren, Steven Diamond, and Stephen Boyd. A rewriting system for convex optimization problems. Journal of Control and Decision, 5(1):42–60, 2018. [2] Paul D Allison. Testing for interaction in multiple regression. American journal of sociology, 1977. [3] Brandon Amos. Tutorial on amortized optimization for learning to optimize over continuous domains. arXiv preprint arXiv:2202.00665, 2022. [4] Galen Andrew, Raman Arora, Jeff Bilmes, and Karen Livescu. Deep canonical correlation analysis. In International conference on machine learning, pages 1247–1255. PMLR, 2013. [5] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In Proceedings of the IEEE international conference on computer vision, pages 2425–2433, 2015. [6] MOSEK ApS. MOSEK Optimizer API for Python 10.0.34, 2022. [7] Benjamin Auffarth, Maite L ́opez, and Jes ́us Cerquides. Comparison of redundancy and relevance measures for feature selection in tissue classification of ct images. In Industrial conference on data mining, pages 248–262. Springer, 2010. [8] Maria-Florina Balcan, Avrim Blum, and Ke Yang. Co-training and expansion: Towards bridging theory and practice. Advances in neural information processing systems, 17, 2004. [9] Tadas Baltruˇsaitis, Chaitanya Ahuja, and Louis-Philippe Morency. Multimodal machine learning: A survey and taxonomy. IEEE transactions on pattern analysis and machine intelligence, 2018. [10] Reuben M Baron and David A Kenny. The moderator–mediator variable distinction in social psycho- logical research: Conceptual, strategic, and statistical considerations. Journal of personality and social psychology, 51(6):1173, 1986. [11] Jan Beirlant, Edward J Dudewicz, L ́aszl ́o Gy ̈orfi, Edward C Van der Meulen, et al. Nonparametric entropy estimation: An overview. International Journal of Mathematical and Statistical Sciences, 1997. [12] Anthony J Bell. The co-information lattice. In Proceedings of the fifth international workshop on independent component analysis and blind signal separation: ICA, volume 2003, 2003. [13] Nils Bertschinger, Johannes Rauh, Eckehard Olbrich, J ̈urgen Jost, and Nihat Ay. Quantifying unique information. Entropy, 16(4):2161–2183, 2014. [14] Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In Proceedings of the eleventh annual conference on Computational learning theory, pages 92–100, 1998. [15] Cameron W Brennan, Roel GW Verhaak, Aaron McKenna, Benito Campos, Houtan Noushmehr, Sofie R Salama, Siyuan Zheng, Debyani Chakravarty, J Zachary Sanborn, Samuel H Berman, et al. The somatic genomic landscape of glioblastoma. cell, 155(2):462–477, 2013. [16] Nancy Ann Oberheim Bush, Susan M Chang, and Mitchel S Berger. Current and future strategies for treatment of glioma. Neurosurgical review, 40(1):1–14, 2017. [17] Santiago Castro, Devamanyu Hazarika, Ver ́onica P ́erez-Rosas, Roger Zimmermann, Rada Mihalcea, and Soujanya Poria. Towards multimodal sarcasm detection (an obviously perfect paper). In ACL, 2019. [18] CDC. CDC WONDER: Underlying cause of death, 1999–2019. 2020. 11 [19] Gal Chechik, Amir Globerson, M Anderson, E Young, Israel Nelken, and Naftali Tishby. Group redun- dancy measures reveal redundancy reduction in the auditory pathway. Advances in neural information processing systems, 14, 2001. [20] Richard J Chen, Ming Y Lu, Jingwen Wang, Drew FK Williamson, Scott J Rodig, Neal I Lindeman, and Faisal Mahmood. Pathomic fusion: an integrated framework for fusing histopathology and genomic features for cancer diagnosis and prognosis. IEEE Transactions on Medical Imaging, 2020. [21] Richard J Chen, Ming Y Lu, Wei-Hung Weng, Tiffany Y Chen, Drew FK Williamson, Trevor Manz, Maha Shady, and Faisal Mahmood. Multimodal co-attention transformer for survival prediction in gigapixel whole slide images. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4015–4025, 2021. [22] Richard J Chen, Ming Y Lu, Drew FK Williamson, Tiffany Y Chen, Jana Lipkova, Zahra Noor, Muham- mad Shaban, Maha Shady, Mane Williams, Bumjin Joo, et al. Pan-cancer integrative histology-genomic analysis via multimodal deep learning. Cancer Cell, 40(8):865–878, 2022. [23] C Mario Christoudias, Raquel Urtasun, and Trevor Darrell. Multi-view learning in the presence of view disagreement. In Proceedings of the Twenty-Fourth Conference on Uncertainty in Artificial Intelligence, pages 88–96, 2008. [24] Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26, 2013. [25] Steven Diamond and Stephen Boyd. CVXPY: A Python-embedded modeling language for convex optimization. Journal of Machine Learning Research, 17(83):1–5, 2016. [26] Daisy Yi Ding, Shuangning Li, Balasubramanian Narasimhan, and Robert Tibshirani. Cooperative learning for multiview analysis. Proceedings of the National Academy of Sciences, 2022. [27] Alexander Domahidi, Eric Chu, and Stephen Boyd. Ecos: An socp solver for embedded systems. In 2013 European Control Conference (ECC), pages 3071–3076. IEEE, 2013. [28] Sanghamitra Dutta, Praveen Venkatesh, Piotr Mardziel, Anupam Datta, and Pulkit Grover. An information- theoretic quantification of discrimination with exempt features. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 3825–3833, 2020. [29] Meir Feder and Neri Merhav. Relations between entropy and error probability. IEEE Transactions on Information theory, 40(1):259–266, 1994. [30] Ross Flom and Lorraine E Bahrick. The development of infant discrimination of affect in multimodal and unimodal stimulation: The role of intersensory redundancy. Developmental psychology, 43(1):238, 2007. [31] Joseph C Franklin, Jessica D Ribeiro, Kathryn R Fox, Kate H Bentley, Evan M Kleiman, Xieyining Huang, Katherine M Musacchio, Adam C Jaroszewski, Bernard P Chang, and Matthew K Nock. Risk factors for suicidal thoughts and behaviors: a meta-analysis of 50 years of research. Psychological bulletin, 2017. [32] Jerome H Friedman and Bogdan E Popescu. Predictive learning via rule ensembles. The annals of applied statistics, 2(3):916–954, 2008. [33] Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. In Conference on Empirical Methods in Natural Language Processing, pages 457–468. ACL, 2016. [34] Wendell R Garner. Uncertainty and structure as psychological concepts. 1962. [35] Timothy J Gawne and Barry J Richmond. How independent are the messages carried by adjacent inferior temporal cortical neurons? Journal of Neuroscience, 13(7):2758–2771, 1993. [36] AmirEmad Ghassami and Negar Kiyavash. Interaction information for causal inference: The case of directed triangle. In IEEE International Symposium on Information Theory (ISIT), 2017. [37] Catherine R Glenn and Matthew K Nock. Improving the short-term prediction of suicidal behavior. American journal of preventive medicine, 2014. [38] Amir Globerson and Tommi Jaakkola. Approximate inference using conditional entropy decompositions. In Artificial Intelligence and Statistics, pages 131–138. PMLR, 2007. 12 [39] Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the v in vqa matter: Elevating the role of image understanding in visual question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6904–6913, 2017. [40] Michael Grant, Stephen Boyd, and Yinyu Ye. Disciplined convex programming. In Global optimization, pages 155–210. Springer, 2006. [41] Virgil Griffith and Christof Koch. Quantifying synergistic mutual information. In Guided self-organization: inception, pages 159–190. Springer, 2014. [42] Faisal Hamman and Sanghamitra Dutta. Demystifying local and global fairness trade-offs in federated learning using information theory. In Federated Learning and Analytics in Practice: Algorithms, Systems, Applications, and Opportunities, 2023. [43] Md Kamrul Hasan, Wasifur Rahman, AmirAli Bagher Zadeh, Jianyuan Zhong, Md Iftekhar Tanveer, Louis-Philippe Morency, and Mohammed Ehsan Hoque. Ur-funny: A multimodal language dataset for understanding humor. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2046–2056, 2019. [44] Trevor Hastie and Robert Tibshirani. Generalized additive models: some applications. Journal of the American Statistical Association, 82(398):371–386, 1987. [45] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. [46] Jack Hessel and Lillian Lee. Does my multimodal model learn cross-modal interactions? it's harder to tell than you might think! In EMNLP, 2020. [47] Ming Hou, Jiajia Tang, Jianhai Zhang, Wanzeng Kong, and Qibin Zhao. Deep multimodal multilinear fusion with high-order polynomial pooling. Advances in Neural Information Processing Systems, 32: 12136–12145, 2019. [48] Maximilian Ilse, Jakub Tomczak, and Max Welling. Attention-based deep multiple instance learning. In International conference on machine learning, pages 2127–2136. PMLR, 2018. [49] Jan Ittner, Lukasz Bolikowski, Konstantin Hemker, and Ricardo Kennedy. Feature synergy, redun- dancy, and independence in global model explanations using shap vector decomposition. arXiv preprint arXiv:2107.12436, 2021. [50] James Jaccard and Robert Turrisi. Interaction effects in multiple regression. Number 72. sage, 2003. [51] Aleks Jakulin and Ivan Bratko. Quantifying and visualizing attribute interactions: An approach based on entropy. 2003. [52] Siddhant M. Jayakumar, Wojciech M. Czarnecki, Jacob Menick, Jonathan Schwarz, Jack Rae, Simon Osindero, Yee Whye Teh, Tim Harley, and Razvan Pascanu. Multiplicative interactions and where to find them. In International Conference on Learning Representations, 2020. [53] Justin Johnson, Bharath Hariharan, Laurens Van Der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2901–2910, 2017. [54] Wonjae Kim, Bokyung Son, and Ildoo Kim. Vilt: Vision-and-language transformer without convolution or region supervision. In International Conference on Machine Learning, pages 5583–5594. PMLR, 2021. [55] G ̈unter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter. Self-normalizing neural networks. Advances in neural information processing systems, 30, 2017. [56] Matthew Michael Large, Daniel Thomas Chung, Michael Davidson, Mark Weiser, and Christopher James Ryan. In-patient suicide: selection of people at risk, failure of protection and the possibility of causation. BJPsych Open, 3(3):102–105, 2017. [57] Michelle A Lee, Brent Yi, Roberto Mart ́ın-Mart ́ın, Silvio Savarese, and Jeannette Bohg. Multimodal sensor fusion with differentiable filters. IROS, 2020. [58] Paul Pu Liang, Zhun Liu, Yao-Hung Hubert Tsai, Qibin Zhao, Ruslan Salakhutdinov, and Louis-Philippe Morency. Learning representations from imperfect time series data via tensor rank regularization. In ACL, 2019. 13 [59] Paul Pu Liang, Terrance Liu, Anna Cai, Michal Muszynski, Ryo Ishii, Nick Allen, Randy Auerbach, David Brent, Ruslan Salakhutdinov, and Louis-Philippe Morency. Learning language and multimodal privacy-preserving markers of mood from mobile data. In ACL, 2021. [60] Paul Pu Liang, Yiwei Lyu, Xiang Fan, Zetian Wu, Yun Cheng, Jason Wu, Leslie Yufan Chen, Peter Wu, Michelle A Lee, Yuke Zhu, et al. Multibench: Multiscale benchmarks for multimodal representation learning. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1), 2021. [61] Paul Pu Liang, Yiwei Lyu, Gunjan Chhablani, Nihal Jain, Zihao Deng, Xingbo Wang, Louis-Philippe Morency, and Ruslan Salakhutdinov. Multiviz: An analysis benchmark for visualizing and understanding multimodal models. arXiv preprint arXiv:2207.00056, 2022. [62] Paul Pu Liang, Amir Zadeh, and Louis-Philippe Morency. Foundations and recent trends in multimodal machine learning: Principles, challenges, and open questions. arXiv preprint arXiv:2209.03430, 2022. [63] Jana Lipkova, Richard J Chen, Bowen Chen, Ming Y Lu, Matteo Barbieri, Daniel Shao, Anurag J Vaidya, Chengkuan Chen, Luoting Zhuang, Drew FK Williamson, et al. Artificial intelligence for multimodal data integration in oncology. Cancer Cell, 40(10):1095–1110, 2022. [64] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach, 2019. [65] Zhun Liu, Ying Shen, Varun Bharadhwaj Lakshminarasimhan, Paul Pu Liang, AmirAli Bagher Zadeh, and Louis-Philippe Morency. Efficient low-rank multimodal fusion with modality-specific factors. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2247–2256, 2018. [66] David N Louis, Arie Perry, Guido Reifenberger, Andreas Von Deimling, Dominique Figarella-Branger, Webster K Cavenee, Hiroko Ohgaki, Otmar D Wiestler, Paul Kleihues, and David W Ellison. The 2016 world health organization classification of tumors of the central nervous system: a summary. Acta neuropathologica, 131(6):803–820, 2016. [67] Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. Advances in neural information processing systems, 30, 2017. [68] Yiwei Lyu, Paul Pu Liang, Zihao Deng, Ruslan Salakhutdinov, and Louis-Philippe Morency. Dime: Fine-grained interpretations of multimodal models via disentangled local explanations. AIES, 2022. [69] Alessio Mazzetto, Dylan Sam, Andrew Park, Eli Upfal, and Stephen Bach. Semi-supervised aggregation In Proceedings of The 24th of dependent weak supervision sources with performance guarantees. International Conference on Artificial Intelligence and Statistics, 2021. [70] William McGill. Multivariate information transmission. Transactions of the IRE Professional Group on Information Theory, 4(4):93–111, 1954. [71] Pooya Mobadersany, Safoora Yousefi, Mohamed Amgad, David A Gutman, Jill S Barnholtz-Sloan, Jos ́e E Vel ́azquez Vega, Daniel J Brat, and Lee AD Cooper. Predicting cancer outcomes from histology and genomics using convolutional networks. Proceedings of the National Academy of Sciences, 2018. [72] Inbal Nahum-Shani, Shawna N Smith, Bonnie J Spring, Linda M Collins, Katie Witkiewitz, Ambuj Tewari, and Susan A Murphy. Just-in-time adaptive interventions (jitais) in mobile health: key components and design principles for ongoing health behavior support. Annals of Behavioral Medicine, 2018. [73] Cancer Genome Atlas Research Network. Comprehensive, integrative genomic analysis of diffuse lower-grade gliomas. New England Journal of Medicine, 372(26):2481–2498, 2015. [74] Sheila Nirenberg, Steve M Carcieri, Adam L Jacobs, and Peter E Latham. Retinal ganglion cells act largely as independent encoders. Nature, 411(6838):698–701, 2001. [75] Brendan O'Donoghue, Eric Chu, Neal Parikh, and Stephen Boyd. Conic optimization via operator splitting and homogeneous self-dual embedding. Journal of Optimization Theory and Applications, 2016. [76] Ari Pakman, Amin Nejatbakhsh, Dar Gilboa, Abdullah Makkeh, Luca Mazzucato, Michael Wibral, and Elad Schneidman. Estimating the unique information of continuous variables. Advances in Neural Information Processing Systems, 34:20295–20307, 2021. [77] Liam Paninski. Estimation of entropy and mutual information. Neural computation, 2003. 14 [78] Sarah Partan and Peter Marler. Communication goes multimodal. Science, 283(5406):1272–1273, 1999. [79] Sarah R Partan and Peter Marler. Issues in the classification of multimodal communication signals. The American Naturalist, 166(2):231–245, 2005. [80] Fernando P ́erez-Cruz. Kullback-leibler divergence estimation of continuous distributions. In 2008 IEEE international symposium on information theory, pages 1666–1670. IEEE, 2008. [81] Alexandra M Proca, Fernando E Rosas, Andrea I Luppi, Daniel Bor, Matthew Crosby, and Pedro AM Mediano. Synergistic information supports modality integration and flexible learning in neural networks solving multiple tasks. arXiv preprint arXiv:2210.02996, 2022. [82] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748–8763. PMLR, 2021. [83] Benjamin J Raphael, Ralph H Hruban, Andrew J Aguirre, Richard A Moffitt, Jen Jen Yeh, Chip Stewart, Integrated genomic A Gordon Robertson, Andrew D Cherniack, Manaswi Gupta, Gad Getz, et al. characterization of pancreatic ductal adenocarcinoma. Cancer cell, 32(2):185–203, 2017. [84] John A Rice. Mathematical statistics and data analysis. Cengage Learning, 2006. [85] Natalie Ruiz, Ronnie Taib, and Fang Chen. Examining the redundancy of multimodal input. In Proceed- ings of the 18th Australia conference on Computer-Human Interaction: Design: Activities, Artefacts and Environments, pages 389–392, 2006. [86] Claude Elwood Shannon. A mathematical theory of communication. The Bell system technical journal, 27(3):379–423, 1948. [87] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition, 2014. URL https://arxiv.org/abs/1409.1556. [88] Daria Sorokina, Rich Caruana, Mirek Riedewald, and Daniel Fink. Detecting statistical interactions with additive groves of trees. In Proceedings of the 25th international conference on Machine learning, 2008. [89] Karthik Sridharan and Sham M Kakade. An information theoretic framework for multi-view learning. In Conference on Learning Theory, 2008. [90] Milan Studen`y and Jirina Vejnarov ́a. The multiinformation function as a tool for measuring stochastic dependence. In Learning in graphical models, pages 261–297. Springer, 1998. [91] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In Interna- tional conference on machine learning, pages 3319–3328. PMLR, 2017. [92] Masahiro Suzuki, Kotaro Nakayama, and Yutaka Matsuo. Joint multimodal learning with deep generative models. arXiv preprint arXiv:1611.01891, 2016. [93] Han Te Sun. Multiple mutual informations and multiple interactions in frequency data. Inf. Control, 46: 26–45, 1980. [94] Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning? Advances in Neural Information Processing Systems, 2020. [95] Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems. IEEE, 2012. [96] Katarzyna Tomczak, Patrycja Czerwi ́nska, and Maciej Wiznerowicz. The cancer genome atlas (tcga): an immeasurable source of knowledge. Contemporary Oncology/Wsp ́ołczesna Onkologia, 2015. [97] Giulio Tononi, Olaf Sporns, and Gerald M Edelman. A measure for brain complexity: relating functional segregation and integration in the nervous system. Proceedings of the National Academy of Sciences, 91 (11):5033–5037, 1994. [98] Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive learning, multi-view redundancy, and linear models. In Algorithmic Learning Theory, pages 1179–1206. PMLR, 2021. [99] Yao-Hung Hubert Tsai, Shaojie Bai, Paul Pu Liang, J Zico Kolter, Louis-Philippe Morency, and Ruslan Salakhutdinov. Multimodal transformer for unaligned multimodal language sequences. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6558–6569, 2019. 15 [100] Yao-Hung Hubert Tsai, Paul Pu Liang, Amir Zadeh, Louis-Philippe Morency, and Ruslan Salakhutdinov. Learning factorized multimodal representations. In International Conference on Learning Representations, 2019. [101] Michael Tsang, Dehua Cheng, and Yan Liu. Detecting statistical interactions from neural network weights. In International Conference on Learning Representations, 2018. [102] Michael Tsang, Dehua Cheng, Hanpeng Liu, Xue Feng, Eric Zhou, and Yan Liu. Feature interaction interpretability: A case for explaining ad-recommendation systems via neural interaction detection. In International Conference on Learning Representations, 2019. [103] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017. [104] Qing Wang, Sanjeev R Kulkarni, and Sergio Verd ́u. A nearest-neighbor approach to estimating divergence between continuous random vectors. In 2006 IEEE International Symposium on Information Theory, pages 242–246. IEEE, 2006. [105] Xingbo Wang, Jianben He, Zhihua Jin, Muqiao Yang, Yong Wang, and Huamin Qu. M2lens: Visualizing and explaining multimodal models for sentiment analysis. IEEE Transactions on Visualization and Computer Graphics, 28(1):802–812, 2021. [106] Satosi Watanabe. Information theoretical analysis of multivariate correlation. IBM Journal of research and development, 4(1):66–82, 1960. [107] John N Weinstein, Eric A Collisson, Gordon B Mills, Kenna R Shaw, Brad A Ozenberger, Kyle Ellrott, Ilya Shmulevich, Chris Sander, and Joshua M Stuart. The cancer genome atlas pan-cancer analysis project. Nature genetics, 45(10):1113–1120, 2013. [108] Paul L Williams and Randall D Beer. Nonnegative decomposition of multivariate information. arXiv preprint arXiv:1004.2515, 2010. [109] Patricia Wollstadt, Joseph Lizier, Raul Vicente, Conor Finn, Mario Martinez-Zarzuela, Pedro Mediano, Leonardo Novelli, and Michael Wibral. Idtxl: The information dynamics toolkit xl: a python package for the efficient analysis of multivariate information dynamics in networks. Journal of Open Source Software, 4(34):1081, 2019. [110] Patricia Wollstadt, Sebastian Schmitt, and Michael Wibral. A rigorous information-theoretic definition of redundancy and relevancy in feature selection based on (partial) information decomposition. arXiv preprint arXiv:2105.04187, 2021. [111] Mike Wu and Noah Goodman. Multimodal generative models for scalable weakly-supervised learning. Advances in Neural Information Processing Systems, 31, 2018. [112] Peng Xu, Xiatian Zhu, and David A Clifton. Multimodal learning with transformers: A survey. arXiv preprint arXiv:2206.06488, 2022. [113] Shaowei Yao and Xiaojun Wan. Multimodal transformer for multimodal machine translation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Online, July 2020. Association for Computational Linguistics. [114] Lei Yu and Huan Liu. Efficient feature selection via analysis of relevance and redundancy. The Journal of Machine Learning Research, 5:1205–1224, 2004. [115] Amir Zadeh, Minghai Chen, Soujanya Poria, Erik Cambria, and Louis-Philippe Morency. Tensor fusion network for multimodal sentiment analysis. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1103–1114, 2017. [116] AmirAli Bagher Zadeh, Paul Pu Liang, Soujanya Poria, Erik Cambria, and Louis-Philippe Morency. Multimodal language analysis in the wild: Cmu-mosei dataset and interpretable dynamic fusion graph. In ACL, 2018. 16 Figure 6: The PID framework formalizes the nature of feature interactions for a task. Through our proposed scalable estimators for redundancy, uniqueness, and synergy, we demonstrate their useful- ness towards quantifying multimodal datasets and multimodal model predictions, which together yield principles for model selection. Appendix A Partial Information Decomposition Information theory formalizes the amount of information that a single variable (X) provides about another (Y ), and is quantified by Shannon's mutual information [86] I(X; Y ) which measures the amount of uncertainty reduced from H(Y ) to H(Y |X) when given X as input. However, the direct extension of information theory to 3 or more variables, such as through total correlation [106, 34, 90, 97] or interaction information [70, 93, 12, 35], both have significant shortcomings. In particular, the three-way mutual information I(X1; X2; Y ) can be both negative and positive, leading to considerable difficulty in its interpretation by theoreticians and practitioners. Partial information decomposition (PID) [108] was proposed as a method to generalize information theory to multiple variables, by positing a decomposition of the total information 2 variables provide about a task I(X1, X2; Y ) into 4 quantities: redundancy R between X1 and X2, unique information U1 in X1 and U2 in X2, and synergy S that should together satisfy the following consistency equations: R + U1 = I(X1; Y ), R + U2 = I(X2; Y ) U1 + S = I(X1; Y |X2), U2 + S = I(X2; Y |X1) R − S = I(X1; X2; Y ) (7) (8) (9) (10) (11) A definition of R was first proposed by Williams and Beer [108] and was subsequently improved by Bertschinger et al. [13], Griffith and Koch [41] giving: R = max q∈∆p U1 = min q∈∆p U2 = min q∈∆p Iq(X1; X2; Y ) Iq(X1; Y |X2) Iq(X2; Y |X1) S = Ip(X1, X2; Y ) − min q∈∆p Iq(X1, X2; Y ) (12) (13) (14) (15) where ∆p = {q ∈ ∆ : q(xi, y) = p(xi, y) ∀y, xi, i ∈ {1, 2}} and ∆ is the set of all joint distributions over X1, X2, Y . We call this the set of marginal-matching distributions. The core intuition of these definitions and how they enable PID lies in optimization over ∆p instead of simply estimating information-theoretic measures for the observed distribution p. Specifically, synergy S is the difference between total multimodal information in p and total multimodal information in q∗ ∈ ∆p, the non-synergistic distribution (see Figure 7 for an illustration). While there have been other definitions of PID that also satisfy the consistency equations, Bertschinger et al. [13] showed that their proposed measure satisfies several desirable properties. Optimizing over ∆p can be seen as going beyond purely observed data and discovering latent redundancy, uniqueness, and synergy via representation learning. According to Bertschinger et al. [13], it suffices to solve for q using the following max-entropy optimization problem, the same q equivalently solves any of the remaining problems defined for 17 Unique 1Unique 2RedundancySynergy1. Dataset quantification:2. Model quantification:3. Model selection: Figure 7: We illustrate the set of marginal-matching distributions q ∈ ∆p, and an intuition behind the definition of synergy S as the difference between total multimodal information in p and total multimodal information in q∗ ∈ ∆p, the non-synergistic distribution. redundancy, uniqueness, and synergy. q∗ = arg max q∈∆p q∗ = arg max q∈∆p q∗ = arg min q∈∆p q∗ = arg min q∈∆p q∗ = arg min q∈∆p Hq(Y |X1, X2) Iq(X1; X2; Y ) Iq({X1, X2}; Y ) Iq(X1; Y |X2) Iq(X2; Y |X1) (max-entropy) (redundancy) (synergy) (unique in X1) (unique in X2) (16) (17) (18) (19) (20) B Scalable PID Estimators This section provides algorithmic and implementation details on the estimation of PID values for high-dimensional continuous datasets. B.1 Estimator 1: CVX for Discrete Representations Our first proposed estimator, CVX, is exact, based on convex optimization, and is able to scale to problems where |Xi| and |Y| are around 100. We show a high-level diagram of CVX in Figure 8 and provide several implementation details here: Implementation Details: We implemented (5) using CVXPY [25, 1]. The transformation from the max-entropy objective (16) to (5) ensures adherence to disciplined convex programs [40], thus allowing CVXPY to recognize it as a convex program. All 3 conic solvers, ECOS [27], SCS [75], and MOSEK [6] were used, with ECOS and SCS being default solvers packaged with CVXPY. Our experience is that MOSEK is the fastest and most stable solver, working out of the box without any tuning. However, it comes with the downside of being commercial. For smaller problems, ECOS and SCS work just fine. Potential Numerical Issues: Most conic solvers will suffer from numerical instability when dealing with ill-conditioned problems, typically resulting from coefficients that are too large or small. It is fairly common, especially in the GMM experiment that a single bin contains just one sample. Since P is estimated from an empirical frequency matrix, it will contain probabilities of the order 1/num-samples. When the number of samples is too large (e.g., ≥ 1e8), this frequency is too small and causes all 3 solvers to crash. Approximating Continuous Representation using Histogramming: The number and width of bins can affect quality of PID estimation [77]. For example, it is known that with a fixed number of samples, making the width of bins arbitrarily small will cause KL estimates to diverge. It is known that the number of bins should grow sub-linearly with the number of samples. Rice [84] suggest setting the number of bins to be the cubed-root of the number of samples. In our synthetic experiments, we sampled at least 1e6 samples and used no more than 100 bins. Note that increasing the number of samples ad infinitum is not an option due to potential numerical issues described above. 18 Figure 8: Overview of CVX estimator. Appropriate histogramming of each Xi or clustering in preprocessed feature space is first performed to constrain |Xi|. By rewriting the entropy objective as a KL divergence (with auxiliary variables) which is recognized as convex, this allows us to use conic solvers such as SCS [75], ECOS [27], and MOSEK [6] in CVXPY to solve for q∗ and obtain PID values. B.2 Alternate Methods for Working with Continuous X1, X2: Another method for discretization is based on nearest neighbors [80, 11, 104], which has the ad- vantage of performing density estimation as an intermediate step, but is ill-suited for our purposes of approximating q∗. Pakman et al. [76] attempt to optimize q∗ directly in the space of continuous distribution by approximating an optimal copula, which canonically captures dependencies between X1, X2 in q. However, this is nontrivial due to the space of possible joint distributions, and the authors restrict themselves to Gaussian copulas. B.3 Estimator 2: BATCH for Continuous Representations Our next estimator, BATCH, is suitable for large datasets where the support of X1 and X2 are high-dimensional continuous vectors and not enumerable. Instead, we propose an end-to-end model parameterizing the joint distribution and a training objective whose solution allows us to obtain PID. Here |Xi| = |Y| = ∞. However, we wish to estimate the PID values given a sampled dataset D = {(x(j) 2 , y(j))} of size n. 1 , x(j) In this appendix section, we provide full details deriving our BATCH estimator, see Figure 9 for a high- level overview. We first rewrite the optimization objective in (18) before defining neural estimators to approximate high-dimensional variables that we cannot compute exactly, before optimizing the (18) using learned models and obtaining the PID values. Objective function: First, we observe that the optimization objective in (18) can be written as: q∗ = arg min q∈∆p Iq({X1, X2}; Y ) = arg min q∈∆p E x1,x2,y∼q = arg min q∈∆p E x1,x2,y∼q = arg min q∈∆p E x1,x2,y∼q (cid:20) log (cid:20) log (cid:20) log (cid:21) q(x1, x2, y) q(x1, x2)q(y) (cid:21) q(x1, x2|y) q(x1, x2) q(x2|x1, y)q(x1|y) q(x2|x1)q(x1) (cid:21) = arg min q∈∆p E x1,y∼q(x1,y) x2∼q(x2|x1,y) (cid:34) log q(x2|x1, y)q(x1|y) y′∈Y q(x2|x1, y′)q(y′|x1)q(x1) (cid:80) (cid:35) (21) (22) (23) (24) (25) Our goal is to approximate the optimal ̃q that satisfies this problem. Note that by the marginal constraints, q(x1, y) = p(x1, y) and q(y′|x1) = p(y′|x1). The former can be obtained by sampling from the dataset and the latter is an unimodal model independent of q. 19 TextImageConvex programming with linear constraintsCVXPY 1 , X2 ∈ (cid:101)X m Figure 9: Overview of BATCH estimator: We define an end-to-end model that takes in batches 2 , Y ∈ Y m and learns a matrix A ∈ Rm×m×|Y| to represent of features X1 ∈ (cid:101)X m the unnormalized joint distribution ̃q. Following ideas in multimodal alignment [99] and attention methods [103] that learn approximate distributions over input data, we parameterize A by computing the outer-product similarity matrix over learned features. To ensure that ̃q ∈ ∆p, we use an unrolled version of Sinkhorn's algorithm [24] which projects A onto ∆p by iteratively normalizing all rows and columns to sum to 1 and rescaling to satisfy the marginals ˆp. We plug in the learned ̃q into our objective in (25) and update trainable neural network parameters φ using projected gradient descent. Upon convergence, we extract PID by approximating I ̃q({X1, X2}; Y ) by sampling and plugging into (1)-(3). This use of a mini-batch of size m can be seen as an approximation of full-batch gradient descent over the entire dataset of size n ≫ m. While it is challenging to obtain an unbiased estimator of the full-batch gradient since computing the full A is intractable, we found our approach to work in practice for large m. Our approach can also be informally viewed as performing amortized optimization [3] by using φ to implicitly share information about the full batch using subsampled batches. 1 , X2 ∈ (cid:101)X m Neural architecture: To scale to continuous or unseen xi's, we define a function approximator that takes in x1, x2 and y and outputs an unnormalized joint density ̃q(x1, x2, y). Given batches 2 , Y ∈ Y m, we define learnable encoders fφ(1) and fφ(2) that output a X1 ∈ (cid:101)X m matrix A ∈ Rm×m×|Y| to represent the unnormalized joint distribution ̃q, i.e., we want A[i][j][y] = ̃q(X1[i], X2[j], y). Following ideas in multimodal alignment [99] and attention methods [103] in deep learning that learn approximate distributions over input data, we also parameterize our neural architecture by computing the outer-product similarity matrix over learned features: A = exp (cid:0)fφ(1)(X1, y)fφ(2)(X2, y)⊤(cid:1) (26) Constraining A using Sinkhorn's algorithm: To ensure that the learned A is a valid pdf and respects the marginal constraints ̃q(xi, y) = p(xi, y), we use the Sinkhorn-Knopp algorithm [24], which projects A into the space of non-negative square matrices that are row and column-normalized to satisfy the desired marginals p(x1, y) and p(x2, y). Sinkhorn's algorithm enables us to perform this projection by iteratively normalizing all rows and columns of A to sum to 1 and rescaling the rows and columns to satisfy the marginals. Since p(xi, y) is not easy to estimate for continuous xi, we compute the marginals using Bayes' rule by expanding it as p(xi)p(y|xi). Note that by sampling xi from the dataset, the rows and columns of A are already distributed as p(xi). The only remaining term needed is p(y|xi), for which we use unimodal models ˆp(y|xi) trained before running the estimator and subsequently frozen. Finally, Sinkhorn's algorithm is performed by normalizing each row to ˆp(y|x1) and normalizing each column to ˆp(y|x2). Optimization of the objective: We obtain the value of ̃q(x2|x1, y) by marginalizing from the above distribution ̃q(x1, x2|y). Given matrix A representing ̃q(x1, x2, y), the remaining terms can all be computed in closed form through appropriate summation across dimensions in A to obtain ̃q(xi), 20 SensorsVideoSinkhorn's algorithmUnnormalized joint distributionTraining objectivePID values ̃q(x1, x2), ̃q(xi|y), and ̃q(x1, x2|y). We now have all the terms for the objective in (25). We optimize the objective via gradient descent. Our final algorithm for training BATCH is outlined in Algorithm 1. Extracting PID values from the learned ̃q: To extract the PID values from a learned distribution of ̃q, we first expand the definition of mutual information under p and ̃q, and calculate the PID values from their definitions in (1)-(3): (cid:33)(cid:35) (27) (28) (29) (30) (31) (32) (33) Ip(Y ; Xi) = E xi,y∼p (cid:20) log Ip(Y ; X1, X2) = E x1,x2,y∼p (cid:19)(cid:21) (cid:18) ˆp(y|xi) ˆp(y) (cid:18) ˆp(y|x1, x2) ˆp(y) log (cid:20) (cid:19)(cid:21) I ̃q(Y ; X1, X2) = E x1,x2,y∼ ̃q log (cid:34) (cid:32) ̃q(x2|x1, y)ˆp(y|x1) ˆp(y) (cid:80) y′ ̃q(x2|x1, y′)ˆp(y′|x1) R = I ̃q(Y ; X1, X2) U1 = I ̃q(Y ; X1, X2) − Ip(Y ; X2) U2 = I ̃q(Y ; X1, X2) − Ip(Y ; X1) S = Ip(Y ; X1, X2) − I ̃q(Y ; X1, X2) Algorithm 1 BATCH algorithm. Require: Multimodal dataset X1 ∈ (cid:101)X n 1 , X2 ∈ (cid:101)X n 2 , Y ∈ Y n. Initialize feed-forward networks fφ(1), fφ(2). while not converged do for sampled batch X1 ∈ (cid:101)X m 1 , X2 ∈ (cid:101)X m 2 , Y ∈ Y m do h1[:, y] ← fφ(1)(x1, y), h2[:, y] ← fφ(2)(x2, y) A[:, :, y] ← exp(h1[:, y]h2[:, y]⊤) ̃p(y|xi) ← unimodal predictions. A ← SINKHORN ˆp(A) Marginalize and sample (x1, x2, y) from A. Calculate the loss from (25) using (x1, x2, y). Perform a gradient step on the loss. end for end while return network weights in f1,j, f2,j for j ∈ [C] Important assumptions and caveats: As a note, the above formulation assumes the existence of unimodal models ˆp(y|xi). We train these models independently and freeze them when training the above estimator. After obtaining ̃q, we extract the PID values. To do so, we need an additional multimodal model to estimate ˆp(y|x1, x2) due to (28). Because part of our goal is multimodal model selection, we must assume that the existing multimodal model might not be expressive enough and could underestimate (28). However, this value is only subsequently used to calculate S, leading to a possibly underestimated S, but leaving all other PID values unaffected by the choice of the multimodal model. In practice, the possibility of S being larger than estimated should be considered, and more complex models should be investigated until S stops increasing. Empirically, we have observed that measured value of S by BATCH is generally larger than that measured by CVX; the underestimation is not as large as in the case of clustering in CVX. In additional to the above, we note that the learned joined distribution ̃q(x1, x2, y) is limited by the expressivity of the neural network and similarity matrix method used in our model. Empirically, the PID values are not sensitive to hyperparameters, as long as the network is trained to convergence. Finally, our approximation using batch sampling limits the possible joined distributions to alignments within a batch, which we alleviates by using large batch size (256 in our experiments). Implementation Details: We separately train the unimodal and multimodal models from the dataset using the best model from Liang et al. [60] and freeze them when running Algorithm 1. For the 21 Figure 10: Results for PID decomposition under Cartesian coordinates. Within each plot: PID 2 |i ∈ {0, . . . , 40}}. ✖, q, s, u, ✚ represent the R, U1, U2, values for GMMs for ∠μ in { i S and their sum respectively. (r, θ) corresspond to the unique information (U1, U2) respectively. Across columns: As ||μ||2 varies from {0.1, 0.5, 1.0, 1.5, 2.0}. Top-Bottom: Soft and Hard labels respectively. Note the scale of the y-axis for Soft. The overall trend for each PID component as ∠μ varies is similar across ||μ||2. However, the relative contribution of Synergy and Redundancy changes significantly as ||μ||2 varies, particularly for Hard. 40 * π neural network in Algorithm 1, we use a 3-layer feedforward neural network with a hidden dimension of 32. We train the network for 10 epochs using the Adam optimizer with a batch size of 256 and learning rate of 0.001. To summarize, we propose 2 scalable estimators for PID, each with their approximations for the parameterization of q and procedure for the estimation of PID. 1. Parameterizing q explicitly via a joint probability matrix over ∆p, and optimizing convex objective (5) with linear constraints. This can only be used for finite X1, X2, Y , or after preprocessing by histogramming continuous domains. 2. Parameterizing q via neural networks and optimize their parameters φ by repeatedly subsampling from data; for each subsample, we perform one step of projected gradient descent (using Sinkhorn's method) as if this subsample was the full dataset. C Experiments C.1 Synthetic Bitwise Features We show results on estimating PID values for OR, AND, and XOR interactions between X1 and X2 in Table 1 and find that both our estimators exactly recover the ground truth results in Bertschinger et al. [13]. C.2 Gaussian Mixture Models (GMM) Extended Results: For each of Cartesian and Polar we consider two cases, Soft-labels, when we observe Y , and Hard-labels, where we use ˆY predicted by the optimal linear classifier ˆy = sign (⟨(x1, x2), μ⟩). We hope this will provide additional intuition to the bitwise modality experiments. This results are given in Figures 10, 11. Most of the trends are aligned with what we would expect from Redundancy, Uniqueness, and Synergy. We list the most interesting observations here. • In all cases, total information (sum of PID values) is independent of ∠μ. This is a natural consequence of rotational symmetry. It is also higher for higher ||μ||2, e.g., 2.0, reflecting the fact that X1, X2 contain less information about labels when their centroids are close. Lastly, observe, that when ||μ||2 increases, the total information approaches log(2), which is all the label information. This perfectly aligned with our intuition: if the cluster centroids are far away, then knowing a datapoint's cartesian coordinates will let us predict its label accurately (which is one bit of information). • For Cartesian, unique information dominates when angle goes to 0 or π/2. This is sensible, if centroids share a coordinate, then observing that coordinate yields no information about y. Conversely, synergy and redundancy peak at π/4. 22 0.00.51.01.502461e3RSU1U2Sum0.00.51.01.50.00.51.01e1RSU1U2Sum0.00.51.01.501231e1RSU1U2Sum0.00.51.01.50241e1RSU1U2Sum0.00.51.01.502461e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum Figure 11: Results for PID decomposition under Polar coordinates where θ ∈ [0, π] and r ∈ R, i.e., angle is restricted to the first two quadrants but distance could be negative. Within each plot: 2 |i ∈ {0, . . . , 40}}. ✖, q, s, u, ✚ represent the R, U1, PID values for GMMs for ∠μ in { i U2, S and their sum respectively. Across columns: As ||μ||2 varies from {0.1, 0.5, 1.0, 1.5, 2.0}. Top-Bottom: Soft and Hard labels respectively. Note the scale of the y-axis for Soft. The overall trend for each PID component as ∠μ varies is similar across ||μ||2, except for when ||μ||2 is small in Soft. However, the relative contribution of Synergy and Redundancy changes significantly as ||μ||2 varies, particularly for Hard. 40 * π Figure 12: Results for PID decomposition under Polar coordinates, using the normal parameterization where θ ∈ [−π, π] and r ≥ 0. Within each plot: PID values for GMMs for ∠μ in { i 2 |i ∈ {0, . . . , 40}}. ✖, q, s, u, ✚ represent the R, U1, U2, S and their sum respectively. (r, θ) corresspond to the unique information (U1, U2) respectively. Across columns: As ||μ||2 varies from {0.1, 0.5, 1.0, 1.5, 2.0}. Top-Bottom: Soft and Hard labels respectively. Note the scale of the y-axis for Soft. Observe that PID values are independent of ∠μ, with unique information from θ dominating. 40 * π • Redundancy dominates Synergy as ||μ||2 increases. Interestingly, synergy seems to be independent of ||μ||2 (one has to account for the scale in the vertical axis to recognize this). • Hard contains 0.65 ≈ log(2) nats of total information, since Y |X1, X2 is deterministic. The deficit of 0.04 nats is due to discretization near the decision boundary, and is expected to vanish if we increase the number of bins (though this ought to be accompanied by an increase in samples used to approximate PID). • However, for Soft, total information is nearly 0 for small ||μ||2 (and approaches log(2) when large). When the two cluster centroids are close, it is difficult to glean any information about the (soft) label, while we can predict y accurately from both x1, x2 when centroids are far apart. • For Polar, redundancy is 0. Furthermore, θ contains no unique information, since θ shows nothing about y unless we know r (in particular, its sign). When angle goes to π/2, almost all information is unique in r. Lastly, we also experimented on the more common definition of polar coordinates, with θ ∈ [−π, π] and r ≥ 0 (that is, angle is allowed to be negative but lengths have to be nonnegative). The results are in Figure 12. As one may expect, there is nothing exciting going on for both Softand Hard. For Hard, the optimal classifier is precisely expressed in terms of θ only, so all the information belongs to U2, i.e., θ. For Soft, the same trend remains: virtually all information is in U2, i.e., θ, with the trend becoming even sharper as ||μ||2 increases. Intuitively, when the 2 centroids are extremely far 23 0.00.51.01.502461e3RSU1U2Sum0.00.51.01.50.00.51.01e1RSU1U2Sum0.00.51.01.501231e1RSU1U2Sum0.00.51.01.50241e1RSU1U2Sum0.00.51.01.502461e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.502461e3RSU1U2Sum0.00.51.01.50.00.51.01e1RSU1U2Sum0.00.51.01.501231e1RSU1U2Sum0.00.51.01.50241e1RSU1U2Sum0.00.51.01.502461e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum0.00.51.01.50.02.55.07.51e1RSU1U2Sum apart, then the optimal linear classifier is extremely accurate; which may be expressed by θ alone without any knowledge of r. Conversely, when the centroids are close, r can provide some synergy with θ-the larger r is, the more "confident" we are in predictions based on θ. Visualization of q∗: The following plots of q∗ are provided to provide some intuition behind the objectives in (16). We focus on Cartesian for ease of visualization. For each ||μ||2 ∈ {0.5, 1.0, 2.0}, we vary the angle ∠μ and sample 1e7 labelled datapoints. We then compare q∗ (for both Soft and Hard) with the empirical distribution p. To compute PID, we use 50 bins evenly spaced between [−5, 5] for both dimensions. The results for varying ||μ||2 are shown in Figures 13-15. When ∠μ is 0, there are few differences, barring a slightly "blockier" feel for q∗ over p. However, as ∠μ increases, q∗ gets skewed rather than rotated, becoming "thinner" in the process. The limiting case is when ∠μ2 = π/4, i.e., 45 degrees. Here, the objective diverges to infinity, with what appears to be a solution with nonnegative entries only along the diagonal-this observation appears to hold even as we increase the number of bins. We hypothesize that in the truly continuous case (recall we are performing discretization for this set of experiments), the optimum is a degenerate "one dimensional" GMM with mass located only at q(x, x). Figure 13: Densities for GMMs where ||μ||2 = 2.0. Top to Bottom: Densities for p, q∗ (Soft), and q∗ (Hard). Left to right, ∠μ in { i 8 * π 4 |i ∈ {0, . . . , 8}} Figure 14: Densities for GMMs where ||μ||2 = 1.0. Top to Bottom: Densities for p, q∗ (Soft), and q∗ (Hard). Left to right, ∠μ in { i 8 * π 4 |i ∈ {0, . . . , 8}} C.3 Synthetic Generative Model Our third setting simulates a data generation process where there exists a set of latent concepts that either redundantly, uniquely, or synergistically determine the label. Setup: We begin with a fixed set of latent variables z1, z2, zc ∈ R50 from N (0, σ2) with σ = 0.5 representing latent concepts for modality 1, modality 2, and common information respectively. The concatenated variables [z1, zc] are transformed into high-dimensional x1 ∈ R100 data space using a fixed transformation matrix T1 ∈ R50×100 and likewise [z2, zc] to x2 via T2. The label y is generated 24 505505505505505505505505505505505505505505505505505505505505505505505505 Figure 15: Densities for GMMs where ||μ||2 = 0.5. Top to Bottom: Densities for p, q∗ (Soft), and q∗ (Hard). Left to right, ∠μ in { i 8 * π 4 |i ∈ {0, . . . , 8}} as a transformation function of (1) only zc, in which case we expect redundancy in x1 and x2 with respect to y, (2) only z1 or z2 which represents uniqueness in x1 or x2 respectively, (3) the concatenated [z1, z2] representing synergy, or (4) arbitrary ratios of each of the above. We also introduce nonlinearity and random noises to increase data complexity. In formal notation, (cid:20) y = sigmoid (cid:18) (cid:80)n i=0 f (z)i n (cid:19) (cid:21) ≥ 0.5 where f is a fixed nonlinear transformation with dropout (p = 0.1) and z can be z1, z2, zc or any combination according to the cases described above. These datasets are designed to test a combination of feature learning with predefined interactions between the modalities and the label. We generated 10 synthetic datasets as shown in Table 2. The first four are specialized datasets denoted as Dm, m ∈ {R, U1, U2, S} for which the label y only depends on redundancy, uniqueness, or synergy features respectively. The rest are mixed datasets with y generated from z1, z2, zc of i ∈ R50 to denote a randomly sub-sampled feature from zi. For varying dimensions. We use z∗ example, to generate the label of one data point (x(j) 2 , zc), 2 )(j), zc] following the we sub-sampled (z∗ process above. 2 ) in the mixed dataset y = (z∗ 1 )(j), (z∗ 2 )(j) from z1, z2 and generate y from [(z∗ 1 )(j), (z∗ 1 , x(j) 1 , z∗ To report the ground-truth interactions for these datasets, we first train multimodal models and obtain an estimate of test performance on them. We then convert Pacc, the test accuracy of the best model on these datasets into the mutual information between the inputs to the label using the bound in Feder and Merhav [29]: I(X1, X2; Y ) ≤ log Pacc + H(Y ) (34) Since the test accuracies for Table 2 datasets range from 67-75%, this corresponds to a total MI of 0.42 − 0.59 bits (i.e., from log2 0.67 + 1 to log2 0.75 + 1). The information in each interaction is then computed by dividing this total mutual information by the interactions involved in the data generation process: if the total MI is 0.6 bits and the label depends on half from the common information between modalities and half from the unique information in x1, then the ground truth R = 0.3 and U1 = 0.3. Results: In the main paper, we note the agreement between CVX and BATCH and their consis- tency with the dataset (Table 2). In addition, we note that the sum of PID values (which sum to Ip(Y ; X1, X2)) is generally larger in BATCH than in CVX, which accounts for the information loss during CVX's clustering. Moreover, in the last two cases (y = f (z∗ 2 , zc)), CVX predicts non-zero amount of S despite the dataset being synergy-free by construction. Because the total mutual information is small, the spurious synergy becomes a large portion of the total PID values. This potentially demonstrates that when the total mutual information is small, spurious information gain could have a large impact on the results. c ) and y = f (z∗ 2 , z∗ C.4 Quantifying Multimodal Datasets Setup: We use a large collection of real-world datasets in MultiBench [60] which test multimodal fusion of different input signals and requires representation learning of complex real-world interactions 25 505505505505505505505505505505505505 Table 6: Full results on estimating PID on real-world MultiBench [60] datasets. Many of the estimated interactions align well with dataset construction (e.g., MUSTARD for sarcasm) and unimodal performance (e.g., MIMIC and AV-MNIST). On QA [5] datasets, synergy is consistently the highest. AV-MNIST Task Measure R U1 U2 CVX S 0.10 0.97 0.03 0.08 0.73 0.38 0.53 0.34 0.79 0.87 0 4.92 0.55 0.48 0 5.16 S VQA 2.0 R U1 U2 S CLEVR R U1 U2 S ENRICO R U1 U2 MIMIC Task Measure R U1 U2 S BATCH 0.05 0.17 0 0.01 0.02 0 0.08 0.07 0.06 0 0.04 0.11 0.02 0.04 0 0.06 UR-FUNNY A,T S R U1 U2 UR-FUNNY V,A R U1 U2 S UR-FUNNY V,T S R U1 U2 MOSEI A,T Task Measure R U1 U2 R U1 U2 S R U1 U2 S BATCH 0.22 0.04 0.09 0.13 0.30 0.70 0 0 0.26 0.74 0 0 MOSEI V,A MOSEI V,T S Task Measure R U1 U2 BATCH 0.14 0.01 0.01 0.37 0.14 0.02 0.01 0.34 0.14 0.01 0.01 0.20 MUSTARD A,T S MUSTARD V,A S MUSTARD V,T S R U1 U2 R U1 U2 for different tasks. MultiBench spans 10 diverse modalities (images, video, audio, text, time-series, various robotics sensors, sets, and tables), 15 prediction tasks (humor, sentiment, emotions, mortality rate, ICD-9 codes, image-captions, human activities, digits, robot pose, object pose, robot contact, and design interfaces), and 5 research areas (affective computing, healthcare, multimedia, robotics, and HCI). These datasets are designed to test a combination of feature learning and arbitrary complex interactions between the modalities and the label in the real world. We also include experiments on question-answering (Visual Question Answering [5, 39] and CLEVR [53]) which test grounding of language into the visual domain. Details of applying CVX: For quantifying multimodal datasets with CVX, we first apply PCA to reduce the high dimension of multimodal data. For each of the train, validation, and test split, we then use unsupervised clustering to generate 20 clusters. We obtain a clustered version of the original dataset D = {(x1, x2, y)} as Dcluster = {(c1, c2, y)} where ci ∈ {1, . . . , 20} is the ID of the cluster that xi belongs to. For datasets with 3 modalities we estimate PID separately for each of the 3 modality pairs. Details of applying BATCH: For quantifying multimodal datasets with BATCH, we first use pretrained encoders to obtain the image and text features, and then train 2 unimodal and 1 multimodal classifiers on those features to predict the original answer. The final PID values are computed using the encoded features and the 3 classifiers. In our experiments we used the pretrained image and text encoders from the CLIP-VIT-B/32 [82] model, and the unimodal and multimodal classifiers are 2-layer MLPs. Results on multimodal fusion: We show full results on quantifying datasets in Table 6. For multimodal fusion, we find that different datasets do require different interactions. Among interesting observations are that (1) all pairs of modalities on sarcasm detection shows high synergy values, which aligns with intuition on sarcasm in human communication, (2) uniqueness values are strongly correlated with unimodal performance (e.g., AV-MNIST and MIMIC first modality), (3) datasets with high synergy benefit from interaction modeling (e.g., sarcasm), and (4) conversely datasets with low synergy are also those where modeling in higher-order interactions do not help (e.g., MIMIC). To test grounding of language into the visual domain, we also run experiments on the VQA v2.0 [5, 39] dataset, which contains 443757 training and 214354 validation data with real-life images, and the CLEVR [53] dataset, which contains 699960 training and 149991 validation data with rendered images and generated questions. The test spilt for both datasets are not used because the labels are not publicly available. Note that for both validation datasets, we first filter out all data instances where the label is neither "yes" nor "no". On the remaining data, we use the outputs from the last feature layer of a VGG19 [87] model as image embeddings and use RoBERTa [64] to obtain the text embeddings for questions, and then apply K-means clustering to both embeddings to obtain a clustered version 26 Table 7: Estimating PID on QA [5] datasets with both CVX and BATCH estimators. Synergy is consistently the highest and both estimators return PID values that are consistent relative to each other. Task VQA 2.0 Measure R U1 U2 0 CVX BATCH Human S 0.79 0.87 5.16 0.10 0.14 0.09 0.16 0.01 0.01 0.01 0.03 5.00 0.23 CLEVR R U1 U2 0 4.92 0.55 0.48 4.80 S 0 0 0 0 0 Figure 16: We show a sample user interface for annotating information decomposition into redun- dancy, uniqueness, and synergy, which we give to 3 annotators each to obtain agreeing and reliable judgments of each interaction for real-world multimodal datasets. of the original dataset D = {(x1, x2, y)} as Dcluster = {(c1, c2, y)}, where ci ∈ {1, . . . , 20} are the cluster IDs. We then calculate the PID values on the clustered dataset Dcluster. Results on QA: As a whole, we observe consistently high synergy values on QA datasets as shown in Table 6. This is consistent with prior work studying how these datasets were balanced (e.g., VQA 2.0 having different images for the same question such that both yes/no answers are observed in the dataset so that the answer can only be obtained through synergy) [39] and models trained on these datasets [46]. Comparing CVX and BATCH: We carefully compare CVX and BATCH on the 2 question answering datasets VQA and CLEVR, showing these results in Table 7. We choose these two datasets since their input modalities are images and text, which make them suitable for both clustering of representations extracted from pre-trained before input into CVX, and end-to-end encoding and PID estimation with BATCH. We also include human judgment of PID on these 2 datasets for comparison. From Table 7, we find that all three measures agree on the largest interaction, as well as the relative order of interaction values. We find that the absolute values of each interaction can be quite different due to the unavoidable information loss of both input modalities to the label during clustering in CVX or representation learning in BATCH. Hence, we emphasize that these estimated interactions are most useful through relative comparison to judge which interaction is most dominant in a particular dataset. C.5 Comparisons with Human Judgment To quantify information decomposition for real-world tasks, we investigate whether human judgment can be used as a reliable estimator. We propose a new annotation scheme where we show both modalities and the label and ask each annotator to annotate the degree of redundancy, uniqueness, and synergy on a scale of 0-5 using the following definitions inspired by the formal definitions in information decomposition: 1. R: The extent to which using the modalities individually and together gives the same predictions on the task, 2. U1: The extent to which x1 enables you to make a prediction about the task that you would not if using x2, 3. U2: The extent to which x2 enables you to make a prediction about the task that you would not if using x1, 4. S: The extent to which only both modalities enable you to make a prediction about the task that you would not otherwise make using either modality individually, alongside their confidence in their answers on a scale of 0-5. We show a sample user interface for the annotations in Figure 16. 27 Instruction:Look at the data and provide your rating for the following questions on a scale of 0 (none at all) - 5 (large extent)and score your confidence in your answer from a scale of 0 (no confidence) - 5 (high confidence): 1. The extent to which both modalities enable you to make the same predictions about the task.2. The extent to which modality 1 enables you to make a prediction about the task that you would not if using modality 2.3. The extent to which modality 2 enables you to make a prediction about the task that you would not if using modality 1.4. The extent to which both modalities enable you to make a prediction about the task that you would not otherwise make using either modality individually.IDModality 1Modality 21 Rating1 Confidence2 Rating2 Confidence3 Rating3 Confidence4 Rating4 Confidencemosei1videoThe devil deceives false Christians into thinking they are already safe and secure and on their way to heaven.mosei2videoCurrently, over four-hundered thousand Americans with disabilities are being paid less than the minimum wage, some of them mere pennies per hour.mosei3videoSo once again, we call on the regime to cease these absolutely senseless attacks, which are, of course, violations of the cessation of hostilities.mosei4videohey hey hey Sherri Brown here with a super sweet and awesome promotion for anybody looking to take their business to the next level.mosei5videoI am absolutely optimistic, I think that there is no other way to be.mosei6videoIn 2008, there were very serious tribal warfare in Kenya following a disputed election.mosei7videoThey're not going to give this thing any floor time at all because they know that Donald Trump is not going to divest from his corporationsmosei8videoAnd you saw some of the leading brands out there like McDonalds, like General Mills and Coca Cola, who are doing such a great job of tapping into those insights and bringing them to life in their advertising.mosei9videoKnow who's in it and follow the B2B CFO\u00ae golden rule; Let the Finders find, Minders mind, and Grinders grind.mosei10videoYou have been invited to a special event that includes an invitation, so let's take a look at how should we respond to it.vqa1imageHow many pictures are there?vqa2imageWhat color is the woman's shirt on the left?vqa3imageIs this a hospital?vqa4imageWhat is the green fruit called?vqa5imageWhat are these animals?vqa6imageIs the door closed?vqa7imageWhere do these animals live?vqa8imageWhat game are they playing?vqa9imageIs it an overcast day?vqa10imageWhat 2 colors are the flowers?clevr1image"The other small shiny thing that is the same shape as the tiny yellow shiny object is what color?"clevr2image"How many large things are either cyan metallic cylinders or yellow blocks?"clevr3image"There is a yellow thing to the right of the rubber thing on the left side of the gray rubber cylinder; what is its material?"clevr4image"Are there any large matte blocks of the same color as the large metal ball?"clevr5image"What number of cylinders are gray objects or tiny brown matte objects?"clevr6image"Are there any large blue metallic things that have the same shape as the small brown matte object?" Table 8: Collection of datasets used for our study of multimodal fusion interactions covering diverse modalities, tasks, and research areas in multimedia and affective computing. Modalities Size Datasets 690 MUSTARD [17] {text, video, audio} 16, 514 UR-FUNNY [43] {text, video, audio} 22, 777 {text, video, audio} MOSEI [116] {image, question} 853, 554 CLEVR [53] {image, question} 1, 100, 000 VQA 2.0 [39] Prediction task sarcasm humor Research Area Affective Computing Affective Computing sentiment, emotions Affective Computing QA QA Multimedia Multimedia Table 9: Annotator agreement and average confidence scores of human annotations of PID values for real-world multimodal datasets. Task Agreement Measure R U1 U2 Human Confidence R U1 U2 S S 0.72 0.68 0.70 0.72 4.36 4.35 4.27 4.46 Based on direct communication with our institution's IRB office, this line of user-study research is aligned with similar annotation studies at our institution that are exempt from IRB. The information obtained during our study is recorded in such a manner that the identity of the human subjects cannot readily be ascertained, directly or through identifiers linked to the subjects. We do not collect any identifiable information from annotators. Participation in all annotations was fully voluntary and we obtained consent from all participants prior to annotations. Participants were not the authors nor in the same research groups as the authors. They all hold or are working towards a graduate degree in a STEM field and have knowledge of machine learning. None of the participants knew about this project before their session and each participant only interacted with the setting they were involved in. We sample 10 datapoints with class balance from each of the 5 datasets in Table 8 and give them to 3 annotators. All the data were manually selected and do not contain offensive content. We clarified all the confusion that the annotators may have about the instructions and the definitions above at the beginning of the annotation process. We summarize the results and key findings: 1. General observations on interactions, agreement, and confidence: The annotated in- teractions align with prior intuitions on these multimodal datasets and do indeed explain the interactions between modalities. For example, VQA and CLEVR are annotated with significantly high synergy, and language is annotated as the dominant modality in sentiment, humor, and sarcasm (high U1 values). Overall, Table 9 shows that the Krippendorff's alpha for inter-annotator agreement in human annotations of the interactions is quite high and the average confidence scores are also quite high. This indicates that the human-annotated results are reliable. 2. Annotator subjectivity in interpreting presence vs absence of an attribute and con- textualizing both language and video: We observe that there is some confusion between uniqueness in the language modality and synergy in the video datasets, resulting in cases of low agreement in annotating U1 and S: −0.09, −0.07 for MOSEI, −0.14, −0.03 for UR-FUNNY and −0.08, −0.04 for MUSTARD respectively. We believe this is due to annotator subjectivity in interpreting whether sentiment, humor, and sarcasm are present only in the language modality (U1) or present when contextualizing both language and video (S). We further investigated the agreement and confidence in the presence or absence of an attribute (e.g., humor or sarcasm). We examined videos that show and do not show an attribute separately and indeed found in general, humans reached higher agreement on annotating attribute-present videos. The agreement of annotating S is 0.13 when the attribute is present, compared to −0.10 when absent. C.6 Comparisons with Other Interaction Measures It is worth noting that other valid information-theoretic definitions of multimodal interactions also exist, but are known to suffer from issues regarding over- and under-estimation, and may even be negative [41]; these are critical problems with the application of information theory for shared 28 Table 10: Estimating PID on synthetic generative model datasets. Ground truth total information is computed based on an upper bound from the best multimodal test accuracy. Both CVX and BATCH measures agree with each other on relative values and are consistent with ground truth interactions. We also implement 3 other definitions: I-min can sometimes overestimate synergy and uniqueness; WMS is actually synergy minus redundancy, so can be negative and when R & S are of equal magnitude WMS cancels out to be 0; CI can also be negative and sometimes incorrectly concludes highest uniqueness for S-only data. R S 0 R-only data U1 0.08 0.20 Task PID I-MIN 0.17 WMS 0.34 −0.09 −0.10 0.17 CI 0.05 0.16 CVX 0 BATCH 0.29 0.02 0 0.58 Truth 0 0.02 0 0 0 0 U1-only data U2-only data U2 0.07 0.20 −0.11 0 0.25 0.02 0.05 0 0.03 0.27 0.05 R U1 U2 0 0 0.23 S R U1 U2 0.06 0 S 0 0.25 0.08 0.07 0.03 0.04 0.17 0.14 0.15 0.07 0.06 0 0.01 0.25 0.07 −0.02 0.13 0.14 0.08 0.05 0 0.01 0.14 0.11 0.02 0.02 0.15 0 0.56 0 0.17 0.05 0.07 0 0.30 0 0.54 0 0 0 0 0 0 0 0 0 0 0 0.23 0 0.16 0 0.30 0 0.56 0 0 0 0 S-only data U1 U2 R S I(X1; X2; Y ) and unique information I(X1; Y |X2), I(X2; Y |X1) often quoted in the co-training [14, 8] and multi-view learning [98, 94, 89] literature. We additionally compare PID with other previously used measures for feature interactions on the synthetic generative model datasets. Both CVX and BATCH measures agree with each other on relative values and are consistent with ground truth interactions. We also implement 3 other definitions: I-min can sometimes overestimate synergy and uniqueness; WMS is actually synergy minus redundancy, so can be negative and when R & S are of equal magnitude WMS cancels out to be 0; CI can also be negative and sometimes incorrectly concludes highest uniqueness for S-only data. These results are in Table 10. We also tried 3 non-info theory measures: Shapley values, Integrated gradients (IG), and CCA, which are based on quantifying interactions captured by a multimodal model. Our work is fundamentally different in that interactions are properties of data before training any models. C.7 Quantifying Model Predictions Setup: For each dataset, we first train a suite of models on the train set Dtrain and apply it to the validation set Dval, yielding a predicted dataset Dpred = {(x1, x2, ˆy) ∈ Dval}. Running PID on Dpred summarizes the interactions that the model captures. We categorize and implement a comprehensive suite of models (spanning representation fusion at different feature levels, types of interaction inductive biases, and training objectives) that have been previously motivated in the literature to capture certain types of interactions [62]. In the following, we use xi to denote data or extracted features from unimodal models where appropriate. We include all implementation details and hyperparameters in Table 11, 12, 13, 14, 15. General: We first implement the most general model, which we call early fusion: 1. EF: Concatenating data at the earliest input level, essentially treating it as a single modality, and defining a suitable prediction model y = f ([x1, x2]) [62]. Redundancy: Fusion at the decision level (i.e., late fusion) is often motivated to capture redundancy between unimodal predictors. 1. ADDITIVE: Suitable unimodal models are first applied to each modality before aggregating the outputs using an additive average: y = 1/2(f1(x1) + f2(x2)) [44]. 2. AGREE: Prediction agreement (+λ(f1(x1) − f2(x2))2 [26]) can be added for redundancy. 3. ALIGN: Feature alignment (+λsim(x1, x2) like contrastive learning [82]) can also be added for redundancy. Synergy: Exemplified by methods such as bilinear pooling [33] and tensor fusion [115], researchers have long sought to learn higher-order interactions across modalities to capture synergistic interactions. We implement the following models: 1. ELEM: For static interactions (i.e., without trainable interaction parameters), we implement element-wise interactions: y = f (x1 ⊙ x2) [2, 50]. 2. TENSOR: We also implement outer-product interactions (i.e., higher-order tensors) y = f (cid:0)x1x⊤ 2 (cid:1) [33, 115, 47, 58, 65]. 29 3. MI: Dynamic interactions with learnable weights include multiplicative interactions W: y = f (x1Wx2) [52]. 4. MULT: Another example of dynamic interactions with learnable weights is Crossmodal 2 )x1) [103, self-attention typically used in multimodal Transformers: y = f (softmax(x1x⊤ 99, 113]. Unique: There have been relatively fewer methods that explicitly aim to capture uniqueness, since label information is often assumed to be shared across modalities (i.e., redundancy) [98, 94], two that we implement are: 1. LOWER: Some approaches explicitly include lower-order terms in higher-order interactions to capture unique information [65, 115]. 2. REC: Finally, several methods include reconstruction objectives to encourage maxi- mization of unique information (i.e., adding an objective Lrec = ∥g1(zmm) − x1∥2 + ∥g2(zmm) − x2∥2 where g1, g2 are auxiliary decoders mapping zmm to each raw input modality [92, 100, 111]. Results: We show the full results on estimating PID for all models trained on all datasets in Table 18. To better understand the models' ability in capturing each type of interaction, we present a concise overview of the full results in Table 4, focusing on the PID values of each type of interaction I for each model on I-specialized dataset DI . We also compute the distribution of IDI over all models. We highlight the following observations: General observations: We first observe that model PID measures are consistently higher than dataset measures. The sum of model measures is also a good indicator of test performance, which agrees with their formal definition since their sum is equal to I({X1, X2}; Y ), the total explained mutual information between multimodal data and Y . On redundancy: Overall, several methods succeed in capturing redundancy, with an overall average of 0.41 ± 0.11 and accuracy of 73.0 ± 2.0% on redundancy-specialized datasets. Additive, agreement, and alignment-based methods are particularly strong, but other methods based on tensor fusion (synergy-based), including lower-order interactions, and adding reconstruction objectives (unique- based) also capture redundancy well. On uniqueness: Uniqueness is harder to capture than redundancy, with an average of 0.37 ± 0.14. Certain methods like additive and agreement do poorly on uniqueness, while those designed for uniqueness (lower-order interactions and reconstruction objectives) do well, with U = 0.55 and 73.0% accuracy on uniqueness datasets. On synergy: On average, synergy is the hardest to capture, with an average score of only 0.21 ± 0.10. The best-performing methods are tensor fusion S = 0.33, acc = 74.0% and multimodal transformer S = 0.29, acc = 73.0%. Additive, agreement, and element-wise interactions do not seem to capture synergy well. On robustness: Finally, we also show empirical connections between estimated PID values with model performance in the presence of noisy or missing modalities. Specifically, with the original performance Acc on perfect bimodal data, we define the performance drop when Xi is missing as Acc−i = Acc − Acci where Acci is the unimodal performance when Xi is missing. We find high correlation (ρ = 0.8) between Acc−i and the model's Ui value. Inspecting the graph closely in Figure 5, we find that the correlation is not perfect because the implication only holds in one direction: high Ui coincides with large performance drops, but low Ui can also lead to performance drops. We find that the latter can be further explained by the presence of large S values: when Xi is missing, these interactions can no longer be discovered by the model which decreases robustness. For the subset of points when Ui ≤ 0.05, the correlation between S and performance drop is ρ = 0.73 while the correlation between R and performance drop is only ρ = 0.01. 30 Table 11: Table of hyperparameters for prediction on synthetic data. Component Encoder Decoder Model Identity Linear Linear Fusion Concat ElemMultWithLinear MI-Matrix [52] LRTF [65] MULT [99] Identity Classification head 2-Layer MLP EF & ADDITIVE & ELEM & TENSOR MI & MULT & LOWER AGREE & ALIGN Training REC [100] Parameter / Input size Hidden dim Input dim Hidden dim / Output dim Output dim rank Embed dim Num heads / Hidden size Activation Dropout Loss Batch size Num epochs Optimizer/Learning rate Loss Batch size Num epochs Optimizer/Learning rate Cross Entropy Weight Agree/Align Weight Loss Batch size Num epochs Optimizer Learning rate Recon Loss Modality Weight Cross Entropy Weight Intermediate Modules Value / [200, 200] 512 [200, 200] 512 / 512 512 32 512 8 / 512 LeakyReLU(0.2) 0.1 Cross Entropy 128 100 Adam/0.0001 Cross Entropy + Agree/Align Weight 128 200 Adam/0.0001 2.0 1.0 Cross Entropy + Reconstruction (MSE) 128 100 Adam 0.0001 [1, 1] 2.0 MLP [512, 256, 256] MLP [512, 256, 256] 31 Table 12: Table of hyperparameters for prediction on affective computing datasets. Component Encoder Decoder Model Identity GRU GRU Fusion Concat ElemMultWithLinear MI-Matrix [52] Tensor Fusion [115] MULT [99] Identity Classification head 2-Layer MLP EF & ADDITIVE & ELEM & TENSOR MI & MULT & LOWER Training AGREE & ALIGN REC [100] Parameter / Input size Hidden dim Input size Hidden dim / Output dim Output dim Embed dim Num heads / Hidden size Activation Dropout Loss Batch size Num epochs Optimizer/Learning rate Loss Batch size Num epochs Optimizer/Learning rate Agree/Align Weight Loss Batch size Num epochs Optimizer Learning rate Recon Loss Modality Weight Intermediate Modules Value / [5, 20, 35, 74, 300, 704] [32, 64, 128, 512, 1024] [5, 20, 35, 74, 300, 704] [32, 64, 128, 512, 1024] / [400, 512] 512 40 8 / 512 LeakyReLU(0.2) 0.1 L1 Loss 32 40 Adam/0.0001 L1 Loss + Agree/Align Weight 32 30 Adam/0.0001 0.1 L1 Loss + Reconstruction (MSE) 128 50 Adam 0.001 [1, 1] MLP [600, 300, 300] MLP [600, 300, 300] Table 13: Table of hyperparameters for prediction on ENRICO dataset in the HCI domain. Model Unimodal MI-Matrix [52] MI LRTF [65] Training Parameter Hidden dim Hidden dim Input dims Hidden dim Input dims Hidden dim Input dims Rank Loss Batch size Activation Dropout Optimizer Learning Rate Num epochs Value 16 32 16, 16 32 16, 16 32 16, 16 20 Class-weighted Cross Entropy 32 ReLU 0.2 Adam 10−5 30 32 Table 14: Table of hyperparameters for prediction on MIMIC dataset in the healthcare domain. Component Model Static Encoder 2-layer MLP Static Decoder 2-layer MLP Time Series Encoder GRU Time Series Decoder GRU Classification Head 2-Layer MLP Fusion LRTF [65] MI-Matrix [52] TENSOR, MI Parameter Hidden sizes Activation Layer sizes Activation Hidden dim Hidden dim Hidden size Activation Output dim Ranks output dim Loss Batch size Num epochs Optimizer Learning rate Loss REC [100] Training Batch size Num epochs Optimizer Learning Rate Recon Loss Modality Weights Cross Entropy Weight Intermediate Modules Value [10, 10] LeakyReLU(0.2) [200, 40, 5] LeakyReLU(0.2) 30 30 40 LeakyReLU(0.2) 100 40 100 Cross Entropy 40 20 RMSprop 0.001 Cross Entropy + Reconstruction(MSE) 40 30 Adam 0.001 [1, 1] 2.0 MLPs [200, 100, 100], [200, 100, 100], [400, 100, 100] 33 Table 15: Table of hyperparameters for prediction on MAPS. Component Encoder Decoder Model Identity Linear Linear Fusion Concat ElemMultWithLinear MI-Matrix [52] LRTF [65] MULT [99] Identity Classification head 2-Layer MLP EF & ADDITIVE & ELEM & TENSOR MI & MULT & LOWER AGREE & ALIGN Training REC [100] Parameter / Input size Hidden dim Input dim Hidden dim / Output dim Output dim rank Embed dim Num heads / Hidden size Activation Dropout Loss Batch size Num epochs Optimizer/Learning rate Loss Batch size Num epochs Optimizer/Learning rate Cross Entropy Weight Agree/Align Weight Loss Batch size Num epochs Optimizer Learning rate Recon Loss Modality Weight Cross Entropy Weight Intermediate Modules Value / [1000, 18, 137] 512 [1000, 18, 137] 512 / 512 512 32 512 8 / 512 LeakyReLU(0.2) 0.1 Cross Entropy 128 100 Adam/0.0001 Cross Entropy + Agree/Align Weight 128 200 Adam/0.0001 2.0 1.0 Cross Entropy + Reconstruction (MSE) 128 100 Adam 0.0001 [1, 1] 2.0 MLP [512, 256, 256] MLP [512, 256, 256] Table 16: Table of hyperparameters for prediction on Push dataset. Component Pos Encoder Sensors Encoder Model Linear Linear Image Encoder CNN Control Encoder Linear Fusion Unimodal LSTM Late Fusion LSTM Classification Head Linear Training Parameter Hidden sizes Hidden sizes Filter sizes Num filters Filter strides Filter padding Hidden sizes Hidden size Num layers Hidden size Num layers Hidden size Loss Batch size Num epochs Activation Optimizer Learning rate Value [64, 64, 64 (residual)] [64, 64, 64 (residual)] [5, 3, 3, 3, 3] [32, 32, 32, 16, 8] 1 [2, 1, 1, 1, 1] [64, 64, 64 (residual)] 512 2 256 1 64 Mean Squared Error 32 20 ReLU Adam 10−5 34 Table 17: Table of hyperparameters for prediction on AV-MNIST dataset. Component Model Image Encoder LeNet-3 Image Decoder DeLeNet-3 Audio Encoder LeNet-5 Audio Decoder DeLeNet-5 Classification Head 2-Layer MLP Training Unimodal, LF Parameter Filter Sizes Num Filters Filter Strides / Filter Paddings Max Pooling Filter Sizes Num Filters Filter Strides / Filter Paddings Filter Sizes Num Filters Filter Strides / Filter Paddings Max Pooling Filter Sizes Num Filters Filter Strides / Filter Paddings Hidden size Activation Loss Batch size Num epochs Optimizer/Learning rate/weight decay Value [5, 3, 3, 3] [6, 12, 24, 48] [1, 1, 1, 1] /[2, 1, 1, 1] [2, 2, 2, 2] [4, 4, 4, 8] [24, 12, 6, 3] [2, 2, 2, 4]/[1, 1, 1, 1] [5, 3, 3, 3, 3, 3] [6, 12, 24, 48, 96, 192] [1, 1, 1, 1, 1, 1]/[2, 1, 1, 1, 1, 1] [2, 2, 2, 2, 2, 2] [4, 4, 4, 4, 4, 8] [96, 48, 24, 12, 6, 3] [2, 2, 2, 2, 2, 4]/[1, 1, 1, 1, 1, 1] 100 LeakyReLU(0.2) Cross Entropy 40 25 SGD/0.05/0.0001 35 Table 18: Results on estimating PID on model families trained on synthetic datasets with controlled interactions. 0.41 0 0 0.01 0.15 0.02 Category Model Measure (zc) (z1) (z2) (z1, z2) 2 , z∗ (z∗ 1 , z∗ c ) 0.22 (z1, z∗ 2 , z∗ c ) 0.16 0.15 (z1, z2, z∗ c ) 0.16 0.05 (z∗ 1 , z∗ 2 , zc) 0.25 0.03 2 , z∗ (z∗ c ) 0.19 (z∗ 0.26 2 , zc) 0 0 0 GENERAL EF R U1 U2 0.47 0.01 0.01 0.04 0.74 0.35 0.2 0.04 0.73 0.02 0.14 S Acc R U1 U2 0 0 0 ADDITIVE REDUNDANCY AGREE 0 S Acc R U1 U2 0.43 0.06 0.72 0.01 0.2 0.13 0.56 0.14 0.08 0.64 0.21 0 0.18 0.06 0.6 0.06 0.23 0.11 0.52 0.02 S Acc 0.04 0.71 0.48 0.01 0.01 0.06 0.74 0.04 0.38 0.03 0.61 0.02 0.15 0.48 0.04 0.72 0.26 0.09 0.66 0.11 0.15 0.58 0.08 0.08 0.53 0.33 0.06 0.62 0.09 0.67 0.24 0.04 0.64 0.1 0.16 0.61 0.07 0.18 0.61 0.13 0.18 0.08 0.71 0.1 0.08 0.67 0.44 0.04 0 0 0 0 0 0 0 0 0 0 0 0 0.47 0.04 0.72 0.05 0.29 0.72 0.15 0.07 0.15 0.64 0.31 0.16 0.15 0.71 0.06 0.25 0.74 0.09 0.14 0.66 0.39 0.11 0 0 0 0 0 0.12 0.06 0.65 0.15 0.12 0.05 0.7 0.27 0 0 S Acc R U1 U2 REDUNDANCY ALIGN Category Model R U1 U2 Measure 0 0.44 0.02 (zc) 0.03 0 (z1) 0.05 (z2) 0.02 (z1, z2) 2 , z∗ (z∗ 1 , z∗ c ) 0.33 0.06 (z1, z∗ 2 , z∗ c ) 0.21 (z1, z2, z∗ c ) 0.14 1 , z∗ (z∗ 2 , zc) 0.23 2 , z∗ (z∗ c ) (z∗ 2 , zc) 0 0 0 0.18 0.1 0 0.16 0 0 0 0 0 0 0.2 0 0.05 0.73 0.27 0.05 0.48 0.39 0.1 0.71 0.01 0.38 0.08 0.63 0.07 0.02 0.15 0.66 0.05 0.05 0.14 0.66 0.04 0.05 0.26 0.04 0.64 0.08 0.02 0.09 0.08 0.64 0.1 0.17 0.6 0.04 0 0.2 0.06 0.69 0.15 0 0 0 0 SYNERGY ELEM TENSOR 0 0 0.56 0 0.14 0.66 0.15 0.03 S Acc R U1 U2 0 0.05 0.66 0.2 0.05 0.66 0.01 0 S Acc 0.01 0.07 0.7 0.47 0.01 0.01 0.04 0.74 0.02 0.74 0.54 0.02 0.73 0.31 0.73 0.01 0.07 0.56 0.2 0.01 0.01 0.21 0.65 0.13 0.71 0.27 0.72 0.01 0.06 0.6 0.27 0.05 0.02 0.15 0.68 0.01 0.06 0.56 0.03 0.05 0.57 0.05 0.03 0.05 0.65 0.03 0.06 0.65 0.14 0.08 0.61 0.09 0.24 0.12 0.66 0.17 0.06 0 0 0 0 0 0 0 0 MULT SYNERGY S Acc R U1 U2 0 0 0.01 0.05 0.67 0.4 0.02 0.48 0 MI R U1 U2 0.2 0 0.01 0.13 0.01 0.05 0.04 Category Model Measure (zc) (z1) (z2) (z1, z2) 2 , z∗ (z∗ 1 , z∗ (z1, z∗ 2 , z∗ 0 (z1, z2, z∗ 0 1 , z∗ (z∗ 2 , zc) 0.12 0.01 0.01 0.06 0.62 0.33 2 , z∗ (z∗ c ) 0.01 0.06 0.54 0.13 (z∗ 2 , zc) 0.01 0.06 0.64 0.36 0.12 0.65 0.16 0.05 c ) 0.07 0.01 0.01 0.08 0.55 0.21 0.11 0.06 0.58 0.1 0.29 c ) 0.02 0.01 0.08 0.62 0.18 0.02 c ) 0.04 0.01 0.05 0.66 0.23 0.05 0.66 0.02 S Acc 0.06 0.73 0.02 0.73 0.42 0.06 0.71 0.29 0.72 0.2 0.66 0.11 0.7 0.3 0.72 0.03 0.14 0.68 0.39 0.04 0.67 0.18 0.04 0.72 0.02 0.13 0 0 0 0 0 0 0 0 0 0 0 0 0 LOWER UNIQUE REC S Acc R U1 U2 R U1 U2 0 0.53 0.56 0 0.01 0 0.15 0.03 Category Model Measure (zc) (z1) (z2) (z1, z2) 2 , z∗ (z∗ 1 , z∗ (z1, z∗ 2 , z∗ 0 (z1, z2, z∗ 0 1 , z∗ (z∗ 2 , zc) 0.31 0.01 0.01 0.16 0.68 0.32 2 , z∗ (z∗ 0.29 0.04 0.64 0.19 c ) (z∗ 0.13 0.04 0.7 0.42 2 , zc) S Acc 0.01 0.03 0.75 0.55 0.02 0.01 0.02 0.75 0.03 0.74 0.55 0.02 0.73 0.34 0.74 0.26 0.66 0.16 0.71 0.31 0.72 0.06 0.21 0.68 0.36 0.04 0.66 0.15 0.03 0.72 0.32 0.74 0.14 0.06 c ) 0.21 0.01 0.01 0.2 0.65 0.19 0.03 c ) 0.09 0.27 0.13 0.71 0.08 0.29 0.27 0.73 0.21 0.05 c ) 0.16 0.06 0.02 0.74 0.54 0.02 0.72 0.01 0.53 0 0.13 0.31 0 0 0 0 0 0 0 0 0 0 0 0 36 Table 19: Results on estimating PID on model families trained on real-world multimodal datasets. GENERAL EF R U1 U2 0 REDUNDANCY ADDITIVE AGREE Category Model Measure UR-FUNNY A,T 0.02 UR-FUNNY V,T 0.05 0.01 UR-FUNNY V,A 0.01 0.27 MOSEI A,T MOSEI V,T MOSEI V,A MUSTARD A,T MUSTARD V,T MUSTARD V,A MIMIC ENRICO 0 0 0 0 0 0 0.02 0.15 0.60 0.02 0.02 0.06 0.59 0.02 0.17 0.60 0.02 0.04 S Acc R U1 U2 S Acc R U1 U2 0.17 0.62 0.11 0.08 0.19 0.59 0.03 S Acc 0.02 0.05 0.59 0.24 0.59 0.02 0.15 0.53 0.79 0.15 0.19 0.02 0.13 0.80 0.14 0.11 0.05 0.06 0.80 0.80 0.63 0.11 1.21 0.24 0.61 0.01 0.63 0.59 0.62 0.05 0.31 0.68 0.07 0.27 0.67 0.16 0.58 0 0.01 0.27 0.92 0 0.71 0.34 0.44 0.38 0.50 0.69 0.28 0.39 0.35 0.30 0.40 0.30 0.52 0.75 0.51 0.03 0.04 0.42 0.17 0.57 0.14 0.57 0.25 0.12 0.91 0.01 0.27 0.16 0.27 0.03 0 0.01 0 0 0 0.06 0 0 0 0 0.80 0.1 0.84 0.12 0.65 0.10 1.46 0.15 0.61 0.33 0.10 0.92 0.01 0.27 0.04 0.33 0.70 0.18 0.07 0.33 0.69 0.19 0.02 0.15 0.56 0.02 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ELEM SYNERGY S Acc R U1 U2 S Acc R U1 U2 REDUNDANCY ALIGN R U1 U2 0 0 Category Model S Acc Measure 0.02 0.05 0.62 0.02 0.06 0.58 0.01 UR-FUNNY A,T 0.02 0.14 0.62 UR-FUNNY V,T 0.02 0.02 0.15 0.60 0.02 0.01 0.15 0.60 UR-FUNNY V,A 0.12 0.05 0.01 0.19 0.53 0.03 0.13 0.80 0 0.12 0.26 0.14 0.16 0.65 0.09 1.07 MOSEI A,T 0.81 0 0.09 0.65 0.25 0.92 0.21 0.61 MOSEI V,T 0 0.65 1.15 0.79 0.40 0.14 1.21 MOSEI V,A 0.06 0.29 0.70 0.17 0.01 0.11 0.23 0.60 0.20 0.13 0.25 0.59 0.20 MUSTARD A,T 0.08 0.29 0.70 0.18 0.01 0.04 0.32 0.64 0.18 0.01 0.02 0.34 0.59 0.16 MUSTARD V,T 0.18 0.60 0 0.27 0.12 MUSTARD V,A 0.01 0.28 0.01 0.91 0 MIMIC 0.37 0.34 0.57 0.76 0.52 0.3 0.43 0.29 0.73 0.44 0.38 0.48 0.32 0.69 0.50 ENRICO 0.14 0.62 0.36 0.07 0.91 0.04 0.24 0.15 0.81 0.12 1.23 0.65 0.12 1.07 0.16 0.55 0.33 0.05 0.28 0.01 0.91 0.16 0.61 0.03 0.01 0.16 0.59 0.02 0.15 0.80 0.18 0.17 0.06 0.03 0.05 0.64 0.01 TENSOR 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNIQUE LOWER SYNERGY MI R U1 U2 0 Category Model Measure UR-FUNNY A,T 0.01 UR-FUNNY V,T 0.04 0.02 UR-FUNNY V,A 0.02 0.23 MOSEI A,T MOSEI V,T MOSEI V,A MUSTARD A,T MUSTARD V,T MUSTARD V,A MIMIC ENRICO S Acc R U1 U2 S Acc 0.01 0.14 0.60 0.03 0.04 0.62 0.02 0.01 0.15 0.62 0.14 0.64 0.04 0.19 0.58 0.15 0.61 0.02 0.15 0.54 0.79 0.13 0.05 0.01 0.19 0.81 0.20 0.92 0.08 0.80 0.80 0.17 1.14 0 0.11 0.98 0.13 0.65 0.12 1.0 0.65 1.54 0.64 0 0.05 0.26 0.59 0.18 0.08 0.29 0.63 0.21 0 0.06 0.28 0.58 0.20 0.01 0.03 0.25 0.63 0.17 0.24 0.59 0.28 0.04 0.02 0.18 0.56 0.24 0.08 0.02 0.26 0.01 0.91 0.01 0.92 0.01 0.28 0.28 0.41 0.34 0.48 0.38 0.52 0.29 0.69 0.52 0.56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 Figure 17: Model selection pipeline: (1) quantifying the interactions in different datasets, (2) quantifying interactions captured by different model families, then (3) selecting the closest model for a given new dataset yields models of > 96% performance as compared to exhaustively trying all models. C.8 Multimodal Model Selection Setup: We show that our findings on quantifying multimodal datasets and model predictions are generalizable, and that the PID estimations are informative for model selection on new datasets without training all models from scratch. We simulate the model selection process on 5 new synthetic datasets and 6 real-world multimodal datasets. Given a new dataset D, we compute their PID values ID and normalize it to obtain ˆID: ˆID = ID I ′∈{R,U1,U2,S} I ′ D . (cid:80) (35) We select the most similar dataset D∗ from our base datasets (the 10 synthetic datasets presented in Table 2) that has the smallest difference measure s(D, D′) = (cid:88) | ˆID − ˆID′| I∈{R,U1,U2,S} (36) which adds up the absolute difference between normalized PID values on D and D′. The model selection pipeline is illustrated in Figure 17. We hypothesize that the top-3 best-performing models on D∗ should also achieve decent performance on D due to their similar distribution of interactions. We verify the quality of the model selection by computing a percentage of the performance of the selected model f with respect to the performance of the actual best-performing model f ∗ on D, i.e. % Performance(f, f,∗ ) = Acc(f )/Acc(f ∗). Results: We summarize our evaluation of the model selection in Table 5, and find that the top 3 chosen models all achieve 95% − 100% of the best-performing model accuracy, and above 98.5% for all datasets except MUSTARD. For example, UR-FUNNY and MUSTARD have the highest synergy (S = 0.13, S = 0.3) and indeed transformers and higher-order interactions are helpful (MULT: 0.65%, MI: 0.61%, TENSOR: 0.6%). ENRICO has the highest R = 0.73 and U2 = 0.53, and indeed methods for redundant and unique interactions perform best (LOWER: 0.52%, ALIGN: 0.52%, AGREE: 0.51%). MIMIC has the highest U1 = 0.17, and indeed unimodal models are mostly sufficient [60]. We hypothesize that model selection is more difficult on MUSTARD since it has the highest synergy ratio, and it is still an open question regarding how to capture synergistic multimodal interactions. Therefore, PID values provide a strong signal for multimodal model selection. C.9 Real-world Case Study 1: Computational Pathology Setup: The current standard of care for cancer prognosis in anatomic pathology is the integration of both diagnostic histological information (via whole-slide imaging (WSI)) as well as molecular information for patient stratifcation and therapeutic decision-making [63]. For cancer types such as diffuse gliomas, the combination of histological subtypes (astrocytoma, oligodendroglioma) and molecular markers (IDH1 mutation, 1p19q codeletion) determines whether patients should be administered tumor resection, radiation therapy, adjuvant chemotherapy, or combination therapies [66, 16, 20]. Recent applications of multimodal learning in pathology have found that though fusion confers benefit for a majority of cancer types, unimodal models can be as competitive in patient stratification performance, which suggest potential clinical application of prognosticating using only a single modality for certain cancers [22]. 38 Table 20: Results on estimating PID across the TCGA-GBMLGG and TCGA-PAAD datasets. U1, U2 correspond to pathology and genomics respectively. Dataset Measure R 0 CVX TCGA-LGG U1 0.02 U2 0.06 S 0.02 R 0 TCGA-PAAD U1 0.06 U2 0.08 S 0.15 Using The Cancer Genome Atlas (TCGA), PID was used to quantify pathology image-omic inter- actions in downstream prognostication tasks for two cancer datasets: lower-grade glioma (TCGA- LGG [15] (n = 479) and pancreatic adenocarcinoma (TCGA-PAAD [83], (n = 209). As mentioned in the main text, the modalities include: (1) a sequence of pre-extracted histology image features from diagnostic WSIs (N × 1024, where N is the number of non-overlapping 256 × 256 patches at 20× magnification and 1024 is the extracted feature dimension of a pretrained vision encoder), and (2) feature vector (1 × D) of D bulk gene mutation status, copy number variation, and RNA-Seq abundance values. The label space is overall survival time converted to 4 discrete bins. Following the study design of [22], we trained an Attention-Based Multiple Instance Learning (ABMIL) model and a Self-Normalizing Network (SNN) for the pathology and genomic modalities using a log likelihood loss for survival analysis respectively [48, 55]. For ABMIL, a truncated ResNet-50 encoder pretrained on ImageNet was used for patch feature extraction of WSIs [45]. Unimodal features were extracted before the classification layer, with K-means clustering (k = 3) for each modality used to obtain (x1, x2, y) pairs where x1 is pathology, x2 is genomics and y is the discrete bins, which can then be used in CVX to compute PID measures. Results: We assess these PID measures (Table 20) in the context of current scientific understanding of pathology and genomic interactions in cancer prognostication in the literature. Specifically, we compare against the findings [22], which previously investigated unimodal and multimodal survival models in TCGA and observed that risk predictions were primarily driven by genomics across most cancer types (such as TCGA-LGG), with exceptions in a few cancer types such as TCGA- PAAD. In the evaluation of TCGA-LGG and TCGA-PAAD in [22], concordance Index performance of unimodal-pathology, unimodal-genomic, and multimodal survival models were (0.668, 0.792, 0.808) and (0.580, 0.593, 0.653) respectively. In [22], one of the original hypotheses for the lack of multimodal improvement for some cancer types was due to high mutual information between both modalities. In our results, we observe the opposite effect in which there is little mutual information between both modalities. This observation coupled with the low and high synergy values in TCGA- LGG (S = 0.02) and TCGA-PAAD (S = 0.15) suggest that only TCGA-PAAD would benefit from multimodal integration, which was empirically found with both the c-Index improvement and statistical significant patient stratification results in TCGA-PAAD evaluation. The uniqueness values of both tasks also corroborate the high amount of task-specific information in genomics with high c-Index performance, and vice versa with pathology. Overall, we demonstrate we can use PID measures to refine biomedical insights into understanding when multimodal integration confers benefit. C.10 Real-world Case Study 2: Mood Prediction from Mobile Data Setup: Suicide is the second leading cause of death among adolescents [18]. Despite these alarming statistics, there is little consensus concerning imminent risk for suicide [31, 56]. Intensive monitoring of behaviors via adolescents' frequent use of smartphones may shed new light on the early risk of suicidal thoughts and ideations [37, 72]. Smartphones provide a valuable and natural data source with rich behavioral markers spanning online communication, keystroke patterns, and application usage [59]. Learning these markers requires large datasets with diversity in participants, variety in features, and accuracy in annotations. As a step towards this goal, we partnered with several hospitals (approved by NIH IRB for central institution and secondary sites) to collect a dataset of mobile behaviors from high-risk adolescent populations with consent from participating groups. This data monitors adolescents spanning (a) recent suicide attempters (past 6 months) with current suicidal ideation, (b) suicide ideators with no past suicide attempts, and (c) psychiatric controls with no history of suicide ideation or attempts. Passive sensing data is collected from each participant's smartphone across a duration of 6 months. The modalities include (1) text entered by the user represented as a bag of top 1000 words that contains the daily number of occurrences of each word, (2) keystroke features that record the exact timing and duration that each character was typed on a mobile keyboard 39 Table 21: Results on estimating PID on the MAPS dataset with pairs of modalities text + apps (MAPST,A) and text + keystrokes (MAPST,K). MAPST,A U2 U1 0.09 0 MAPST,K U2 U1 0.04 0 Dataset Measure CVX S 0.26 S 0.40 R 0.09 R 0.12 Table 22: Results on estimating PID on model families trained on the MAPS dataset. Category Model S Acc R U1 U2 Measure MAPST,A 0.61 0.01 0.08 0.02 0.42 0.43 0 0.26 MAPST,K 0.16 0.29 S Acc 0.40 0 0.08 0.51 0.09 0 0.18 0.21 0.47 0.20 0 0.24 0.17 0.42 GENERAL EF R U1 U2 S Acc R U1 U2 0.39 0.45 0 0.24 0 REDUNDANCY ADDITIVE AGREE 0 REDUNDANCY ALIGN Category Model S Acc Measure MAPST,A 0.69 0 0.11 0.03 0.39 0.42 0.04 0.05 0.13 0.41 0.42 0.10 0.03 0.11 0.45 0.32 0.57 MAPST,K 0.41 0.01 0.28 0.34 0.33 0.17 0.37 0.02 0.41 0.27 0.24 0.15 S Acc R U1 U2 S Acc R U1 U2 R U1 U2 SYNERGY TENSOR ELEM 0 Category Model S Acc R U1 U2 S Acc Measure MAPST,A 0.28 0.12 0.01 0.21 0.47 0.40 0.09 0 0.03 0.48 MAPST,K 0.25 0.24 0.02 0.40 0.36 0.10 0.27 0 0.19 0.50 MI R U1 U2 SYNERGY MULT Category Model S Acc Measure MAPST,A 0.53 0.04 0.04 0.09 0.41 0.28 0.06 0.07 0.10 0.56 0.18 0.52 MAPST,K 0.12 0.24 REC S Acc R U1 U2 0.22 0.51 0.23 0.17 R U1 U2 UNIQUE LOWER 0 0 (including alphanumeric characters, special characters, spaces, backspace, enter, and autocorrect), and (3) mobile applications used per day, creating a bag of 137 apps for each day that are used by at least 10% of the participants. Every day at 8am, users are asked to respond to the following question - "In general, how have you been feeling over the last day?" - with an integer score between 0 and 100, where 0 means very negative and 100 means very positive. To construct our prediction task, we discretized these scores into the following three bins: negative (0 − 33), neutral (34 − 66), and positive (67 − 100), which follow a class distribution of 12.43%, 43.63%, and 43.94% respectively. For our 3-way classification task, participants with fewer than 50 daily self-reports were removed since these participants do not provide enough data to train an effective model. In total, our dataset consists of 1641 samples, consisting of data coming from 17 unique participants. Results: The results are shown in Table 21, 22. We observe that both MAPST,A (text + apps) and MAPST,K (text + keystrokes) have the highest synergy (S = 0.26, S = 0.4 respectively) and some redundancy (R = 0.09, R = 0.12) and uniqueness in the second modality (U2 = 0.09, U2 = 0.04). We find indeed the best-performing models are REC (acc = 0.56%) and MULT (acc = 0.48%) for MAPST,A, and TENSOR (acc = 0.57%) and REC (acc = 0.52%) for MAPST,K, which are designed to capture synergy and uniqueness interactions. Our model selection also successfully chooses REC for MAPST,A and TENSOR for MAPST,K with a high agreement of α = 0.66 and α = 0.74 (98.3% and 99.85% of the highest agreement respectively). This result further corroborates the utility and generalizability of our PID estimations and model selection. 40 Table 23: Results on estimating PID on robotic perception task. Task Measure CVX BATCH PUSH I,C U2 U1 0.06 0.03 0.03 1.79 R 0.24 0.75 S 0.04 0.08 C.11 Real-world Case Study 3: Robotic Perception Setup: MuJoCo PUSH [57] is a contact-rich planar pushing task in the MuJoCo simulation framework, in which a 7-DoF Panda Franka robot is pushing a circular puck with its end-effector in simulation. We estimate the 2D position of the unknown object on a table surface, while the robot intermittently interacts with the object. The final dataset consists of 1000 trajectories with 250 steps at 10Hertz, of a simulated Franka Panda robot arm pushing a circular puck in MuJoCo [95]. The pushing actions are generated by a heuristic controller that tries to move the end-effector to the center of the object. The multimodal inputs are gray-scaled images (1 × 32 × 32) from an RGB camera, forces (and binary contact information) from a force/torque sensor, and the 3D position of the robot end-effector. The task is to predict the 2-D planar object pose. We use CNN feature extractors and LSTM as a sequence model for both unimodal and multimodal models. We use hyperparameters from Table 16. Because both CVX and BATCH assumes discrete classes of labels, we discretize all continuous labels into 10 bins of equal data points from the training set, and use the same bin cutoffs at test time. The task is to predict the correct bin that contains the original label, and we use cross entropy loss as our loss function. Results: The results are shown in Table 23. As can be seen from the table, BATCH predicts U1 as the highest PID value (U1 = 1.79), which aligns with the fact that image is the best unimodal predictor for this dataset [60]. Comparing both estimators, CVX underestimates U1 and R since CVX clusters the data before processing, and the high-dimensional time-series modalities cannot be easily described by clusters without losing information. In addition, both BATCH and CVX predict a low U2 value but attributes some mutual information to R (redundancy), implying that a multimodal model with both modalities would not be much better compared to an unimodal model on modality 1, since the multimodal model would mostly get redundant information from modality 2. In our experiments, we observe no difference in performance between the multimodal model and the unimodal model with modality 1. D Summary of Takeaway Messages and Future Work From these results, we emphasize the main take-away messages and motivate several directions for future work: 1. Dataset quantification: PID provides reliable indicators for the nature and quantity of interactions present in both synthetic and real-world multimodal datasets, which provides a useful tool summarizing these datasets. In our opinion, creators of new datasets focused on modeling interactions between multiple features or modalities should report estimated PID values on new datasets alongside justification on whether these values are to be expected based on how the features were selected. 2. Model quantification: PID also provides reasonable indicators for the interactions captured by trained models, but naturally there is more noise due to different model parameter counts, training trajectories, and non-convex optimization artifacts that despite our best efforts remain impossible to exactly control. Despite these details, we still find several consistent patterns in the types of interactions different models capture. We suggest that researchers developing new multimodal models explicitly state the assumptions on the underlying multimodal distribution their models require and the interactions their models are designed to capture, before testing exhaustively on datasets predominantly of those interactions. 3. Model selection: Our experiments on model selection for real-world datasets and applica- tions demonstrate potential utility in a rough 'user-guide' for practitioners aiming to tackle real-world multimodal datasets. Given a new dataset, estimate its PID values. If there is high U1 and U2, just using unimodal models in the corresponding modality may be sufficient. 41 Otherwise, if there is high R, methods like agreement, alignment, ensemble, or co-training should be tried. If there is high S, it is worth spending the time on multimodal methods that model more complex interactions based on tensors, multiplicative interactions, and self-attention. We believe that the intersection of PID and machine learning opens the door to several exciting directions of future work: 1. Pointwise interaction measures: A natural extension is to design pointwise measures: how much does a single datapoint contribute to redundancy, uniqueness, or synergy in the context of an entire distribution? Pointwise measures could help for more fine-grained dataset and model quantification, including error analysis of incorrect predictions or active learning of difficult examples. 2. Representation learning for desired interactions: Can we design new model architectures or training objectives that better capture certain interactions? Current well-performing models like Transformers already include some notion of multiplicative interactions, so it does seem that, heuristically, synergy between input features is playing a role in their success. Designing models that better capture synergy, as quantified by our PID estimators, could be a path towards learning better representations. 3. Principled approaches to fairness and invariance: Currently, PID is designed to measure the information that 2 variables contribute towards a task Y , but conversely it can also be used to remove information that one variable can have about Y , in the context of another variable. These could provide formal learning objectives for fairness, privacy, and other feature invariance tasks. E Limitations and Broader Impact E.1 Limitations of our Estimators While our estimators appear to perform well in practice, each suffers from distinct limitations. For CVX, it is rarely able to scale up to domains with more than several thousand classes. Furthermore, if |Xi| is large-which is frequently the case in real-world applications, then empirical frequencies will often be near 0, causing much instability in conic solvers (see Appendix B.1 for a more detailed description). BATCH sidesteps many of the issues with CVX by applying batch gradient descent. However, it may suffer from approximation error depending on whether the network can sufficiently cover the space of joint distributions (i.e., representation capacity), alongside bias resulting from mini-batch gradient descent (as compared to full-batch gradient descent) when approximating ̃q using bootstrapped samples. Lastly, it may suffer from the usual problems with neural estimators, such as local minima, poor or unstable convergence (in both learning ̃q and ˆp). Therefore, while BATCH scales to high- dimensional continuous distributions, it comes with the challenges involving training and tuning neural networks. E.2 Broader Impact Multimodal data and models are ubiquitous in a range of real-world applications. Our proposed framework based on PID is our attempt to systematically quantify the plethora of datasets and models currently in use. While these contributions will accelerate research towards multimodal datasets and models as well as their real-world deployment, we believe that special care must be taken in the following regard to ensure that these models are safely deployed: Care in interpreting PID values: Just like with any approximate estimator, the returned PID values are only an approximation to the actual interactions and care should be taken to not overfit to these values. Other appropriate forms of dataset visualization and quantification should still be conducted to obtain holistic understanding of multimodal datasets. Privacy, security, and biases: There may be privacy risks associated with making predictions from multimodal data if the datasets include recorded videos of humans or health indicators. In our experiments with real-world data where people are involved (i.e., healthcare and affective computing), the creators of these datasets have taken the appropriate steps to only access public data which participants/content creators have consented for released to the public. We also acknowledge the risk 42 of exposure bias due to imbalanced datasets that may cause biases towards certain genders, races, and demographic groups. Therefore, care should be taken in understanding the social risks of each multimodal dataset in parallel to understanding its interactions via PID. Time & space complexity: Modern multimodal datasets and models, especially those pretrained on internet-scale data, may cause broader impacts resulting from the cost of hardware, electricity, and computation, as well as environmental impacts resulting from the carbon footprint required to fuel modern hardware. Future work should carefully investigate the role of size on the interactions learned by models through estimated PID values. Our preliminary experiments showed that smaller models could still capture high degrees of each interaction, which may pave away towards designing new inductive biases that enable interaction modeling while using fewer parameters. Overall, PID offers opportunities to study the potential social and environmental issues in multimodal datasets by obtaining a deeper understanding of the underlying feature interactions, providing a path towards interpretable and lightweight models. We plan to continue expanding our understanding of PID via deeper engagement with domain experts and how they use this framework in their work. Our released datasets, models, and code will also present a step towards scalable quantification of feature interactions for future work. 43
http://arxiv.org/abs/2302.12245v2
2023-03-02T13:36:28
2023-02-23T18:58:57
Set Features for Fine-grained Anomaly Detection
Fine-grained anomaly detection has recently been dominated by segmentation based approaches. These approaches first classify each element of the sample (e.g., image patch) as normal or anomalous and then classify the entire sample as anomalous if it contains anomalous elements. However, such approaches do not extend to scenarios where the anomalies are expressed by an unusual combination of normal elements. In this paper, we overcome this limitation by proposing set features that model each sample by the distribution its elements. We compute the anomaly score of each sample using a simple density estimation method. Our simple-to-implement approach outperforms the state-of-the-art in image-level logical anomaly detection (+3.4%) and sequence-level time-series anomaly detection (+2.4%).
[ "Niv Cohen", "Issar Tzachor", "Yedid Hoshen" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12245v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12245v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG" ]
3 2 0 2 r a M 2 ] V C . s c [ 2 v 5 4 2 2 1 . 2 0 3 2 : v i X r a Set Features for Fine-grained Anomaly Detection Niv Cohen Issar Tzachor School of Computer Science and Engineering The Hebrew University of Jerusalem, Israel [email protected] Yedid Hoshen Abstract Fine-grained anomaly detection has recently been dominated by segmentation- based approaches. These approaches first classify each element of the sample (e.g., image patch) as normal or anomalous and then classify the entire sample as anomalous if it contains anomalous elements. However, such approaches do not extend to scenarios where the anomalies are expressed by an unusual combination of normal elements. In this paper, we overcome this limitation by proposing set features that model each sample by the distribution of its elements. We compute the anomaly score of each sample using a simple density estimation method. Our simple-to-implement approach1 outperforms the state-of-the-art in image- level logical anomaly detection (+3.4%) and sequence-level time series anomaly detection (+2.4%). 1 Introduction Anomaly detection aims to automatically identify samples that exhibit unexpected behavior. In fine-grained anomaly detection, such as detecting faults in industrial images or irregularities in time series, anomalies are quite subtle. For example, let us consider an image of a bag containing screws, nuts and washers (Fig.1). There are two ways in which a sample can be anomalous: (i) one or more of the elements in the sample are anomalous. E.g., a broken screw. (ii) the elements are normal but appear in an anomalous combination. E.g., one of the washers might be replaced with a nut. In recent years, remarkable progress was made in detecting samples featuring anomalous elements. The usual procedure is: First, we perform anomaly segmentation by detecting which (if any) of the elements of the sample are anomalous. This can be performed by a variety of methods, in particular, using density estimation methods Cohen & Hoshen (2020); Defard et al. (2021); Roth et al. (2022). Given an anomaly segmentation map, we compute the sample-wise anomaly score as the number of anomalous elements, or the abnormality level of the most anomalous element. If the anomaly score exceeds a threshold, the entire sample is denoted as an anomaly. We denote this paradigm: detection-by-segmentation. Here, we tackle the more challenging case of detecting anomalies consisting of an unusual combina- tion of normal elements. For example, consider the case where normal images contain two washers and two nuts but anomalous images may contain one washer and three nuts. As each of the elements (nuts or screws) occur in natural images, simple detection-by-segmentation will not work. Instead, a more holistic understanding of the image is required. While simple global representations, e.g., taking the average of the representations of all elements, might work in some cases, the result is typically too coarse to detect fine-grained anomalies. We propose to detect anomalies consisting of unusual combinations of normal elements using set representations. The key assumption behind our method is that the distribution of elements in a sample is more correlated with it being anomalous than the ordering of the elements. Each sample 1The code is available on github under: https://github.com/NivC/SINBAD. . is therefore modeled as an orderless set of elements. The elements are represented using feature embedding, e.g., a deep representation extracted by a pre-trained neural network or handcrafted features. To describe this set of features we count the percentage of elements falling in different histograms bins. We compute a histogram for each dimension of the feature space. The bins from all the histograms are concatenated together, forming our set representation. Finally, we score anomalies using density estimation on this set representation. Our method, SINBAD (Set INspection Based Aomalies Detection) is evaluated on two diverse tasks. The first task is image-level logical anomaly detection on the MVTec-LOCO datasets. Our method outperforms more complex state-of-the-art methods, while not requiring any training. We also evaluate our method on series-level time series anomaly detection. Our approach outperforms all current methods while not using augmentation or training. We make the following contribution: • Identifying set representation as key for detecting anomalies consisting entirely of normal elements. • An effective approach for measuring the distance between samples treated as sets of their local elements. • State-of-the-art results for sample-wise logical anomaly detection (MVTec-LOCO) and time series datasets. 2 Previous work Image Anomaly Detection. The field of anomaly detection has been researched for several decades. A comprehensive review can be found in Ruff et al. (2021). Early approaches (Glodek et al. (2013); Latecki et al. (2007); Eskin et al. (2002)) used handcrafted representations and aimed at detecting images with different coarse-grained objects (e.g., cats vs. dogs). Deep learning has provided a significant improvement on such benchmarks Larsson et al. (2016); Ruff et al. (2018); Golan & El-Yaniv (2018); Hendrycks et al. (2019); Ruff et al. (2019); Perera & Patel (2019); Salehi et al. (2021); Tack et al. (2020). As density estimation methods utilizing pre-trained deep representation have made significant steps towards the supervised performance on such benchmarks Deecke et al. (2021); Cohen & Avidan (2022); Reiss et al. (2021); Reiss & Hoshen (2021); Reiss et al. (2022), much research is now directed at other challenges Reiss et al. (2022). Such challenges include detecting anomalous image parts which are small and fine-grained Cohen & Hoshen (2020); Li et al. (2021); Defard et al. (2021); Roth et al. (2022); Horwitz & Hoshen (2022). The recent progress in anomaly detection and segmentation methods for this setting has been enabled by the introduction of appropriate datasets Bergmann et al. (2019, 2021); Carrera et al. (2016); Jezek et al. (2021). The dominant paradigm in state-of-the-art methods Roth et al. (2022) is to detect fine-grained anomalous images by first segmenting highly anomalous patches and then scoring the entire image based on these segmentation maps. Recently, the MVTec-LOCO datasetBergmann et al. (2022) has put the spotlight on fine-grained anomalies which cannot be identified using single patches, but only when examining the connection between different (otherwise normal) elements in an image. Here, we will focus on detecting such logical anomalies. Time series Anomaly detection. The task of anomaly detection in time series has been studied over several decades (Blázquez-García et al., 2021). In this paper, we are concerned with anomaly detection of entire sequences, i.e. cases where an entire signal may be abnormal. Traditional approaches for this task include generic anomaly detection approaches such as k nearest neighbors (kNN) based methods e.g. vanilla kNN (Eskin et al., 2002) and Local Outlier Factor (LOF) (Breunig et al., 2000), Tree-based methods (Liu et al., 2008), One-class classification methods (Tax & Duin, 2004) and SVDD (Schölkopf et al.). Some traditional methods such as auto-regressive methods are particular to time series anomaly detection (Rousseeuw & Leroy, 2005). With the advent of deep learning, the traditional approaches were augmented with deep-learned features. Deep one-class classification methods include DeepSVDD (Ruff et al., 2018) and DROCC (Goyal et al., 2020). Deep auto-regressive methods include RNN-based prediction and auto-encoding methods (Bontemps et al., 2016; Malhotra et al., 2016). In addition, some deep learning anomaly detection approaches were proposed that are conceptually different from traditional approaches. These methods are based on the premise that classifiers trained on normal data will struggle to generalize to anomalous data. These 2 Figure 1: In logical anomalies, each image element (e.g., patch) may be normal even when their combination is anomalous. These cases are challenging as the variation among the normal data can be large while anomalies are fine-grained (e.g., swapping a bolt and a washer in the screw bag class). approaches were originally developed for image anomaly detection (Golan & El-Yaniv, 2018) but have been extended to tabular and time series data (Bergman & Hoshen, 2020; Qiu et al., 2021). Discretized Projections. Discretized projections of multivariate data have been used in many previous works. Locally sensitive hashing Dasgupta et al. (2011) uses random projection and subsequent binary quantization as a hash for high-dimensional data. It was used to facilitate fast k nearest neighbor search. Random projections transformation is also highly related to the Radon transform Radon (1917). Kolouri et al. (Kolouri et al., 2015) used this representation as a building block in their set representation. HBOS Goldstein & Dengel (2012) performs anomaly detection by representing each dimension of multivariate data using a histogram of discretized variables and subsequent density estimation. LODA Pevn`y (2016) extends this work, by first projecting the data using a random projection matrix (followed by discretization). We differ from LODA in the use of a different density estimator and in using sets of multiple elements rather than single sample descriptions. Rocket and mini-rocket Dempster et al. (2020, 2021) represent time series for classification using the averages of their window projection. 3 Set Features for Anomaly Detection 3.1 A Set is More Than the Sum of Its Parts Detecting logical image anomalies, or collective time series anomalies, requires understanding how the different parts of each sample interact with one another. As a motivating example let us consider the screw bag class from the MVTec-LOCO dataset (Fig. 1). Each normal sample in this class contains two screws (of different lengths), two nuts, and two washers. Anomalies may occur for example when one screw is missing, or when an additional nut replaces one of the washers. Detecting anomalies such as these requires a joint description of all elements within the sample since each local element could have come from a normal sample. The typical way to aggregate element descriptor features is by average pooling. However, this is not always suitable for set anomaly detection. In supervised learning, average pooling is often built into architectures such as ResNet He et al. (2016) or DeepSets Zaheer et al. (2017), in order to aggregate local features. Therefore, deep features learnt with a supervised loss are already trained to be effective for pooling. However, for lower-level feature descriptors, such as the ones we use here, this may not be the case. As demonstrated in Fig.2, the average of a set of features is far from a complete description of the set. This is especially true in anomaly detection, where density estimation approaches require more discriminative features than those needed for supervised learning Reiss et al. 3 Figure 2: Random projection histograms allow us to distinguish between sets where other methods could not. The two sets are similar in their averages and histograms along the original axes, but result in different histograms when projected along a random axis. (2022). This means that even when an average pooled set of features worked for a supervised task, it might not work for anomaly detection. Here, we wish to describe a set by modeling the distribution of its elements, ignoring the ordering between them. A naive way of doing so is by a discretized, volumetric representation, similarly to 3D voxels for point clouds. Unfortunately, such approaches cannot scale to high dimensions, and more compact representations are required. In this work, we choose to represent sets using a collection of 1D histograms. Each histogram represents the density of the elements of the set when projected along a particular direction. We provide an illustration of this idea in Figure 2. Projecting a set along its original axes may not be discriminative enough. Histograms along the original axes correspond to 1D marginals, and may map distant elements to the same histogram bins (see 2 for an illustration). On the other side, we can see at the bottom of the figure that when the set elements are first projected along another direction, the histograms of the two sets are distinct. This suggests a method for set description: first project each set along a shared random direction and then compute a 1D histogram for each set along this direction. We can obtain a more powerful descriptor by repeating this procedure with projections along multiple random directions. 3.2 Preliminaries We are provided a training set S containing a set of NS samples x1, x2..xNS ∈ S. All the samples at training time are known to be normal. At test time, we are presented with a new sample ̃x. Our objective is to learn a model, which operates on each sample ̃x and outputs an anomaly score. Samples with anomaly scores higher than a predetermined threshold value are labeled as anomalies. The unique aspect of our method is its treatment of each sample x as consisting of a set of NE elements x = [e1, e2..eNE ]. Examples of such elements include patches for images and temporal windows for time series. We assume the existence of a powerful feature extractor F that maps each raw element e into an element feature descriptor fe. We will describe specific implementations of the feature extraction for two important applications: images and time series, in section 4. 4 Figure 3: For both image and time series samples we extract set elements of different granularity. In image samples (left), the sets of elements are extracted from different ResNet levels. For time series data (right), we take pyramids of windows at different strides around each time step (noted in blue circles). 3.3 Set Features by Histogram of Projections Motivated by the toy example in section 3.1, we propose to model each set x by computing a histogram of the values of its elements along each direction. As the given raw axes of the representation may mask out interesting degrees of variation, we perform a random projection prior to building the histograms. Histogram descriptor. As explained in section 3.1, average pooling the features of all elements in the set may result in insufficiently informative representations. Instead, we describe the set using the histogram of values along each dimension. We note the set of the values of the jth feature in each element of each sample as s[j] = {f1[j], f2[j]..fNS [j]}. We compute the maximal and minimal values for sets s[j] across all the samples, and divide the region between them into K bins. We compute histograms Hj for each of the ND dimensions and concatenate them into a single set descriptor h. The descriptor of each set therefore has a dimension of ND * K. Projection. As discussed before, not all projection directions are equally informative for describing the distributions of sets. In the general case, it is unknown which directions will be the most informative ones for capturing the difference between normal and anomalous sets. As we cannot tell the best projection directions in advance, we propose to randomly project the features. This ensures a low likelihood for catastrophically poor projection directions, such as those in the example in Fig.2. In practice, we generate a random projection matrix P ∈ R(ND,NP ) by sampling values for each dimension from the Gaussian distribution N(0, 1). We project the features f of each element of x, yielding projected features f (cid:48): f (cid:48) = P f (1) We run the histogram descriptor procedure described above on the projected features. The final set descriptor hx therefore becomes the concatenation of NP histograms, resulting in a dimension of NP * K. 3.4 Anomaly scoring We now wish to use the histogram features hx to detect anomalous samples. We estimate the probability density function (PDF) of the normal data features {hx} ∈ S using a Gaussian density estimator. We provide theoretical justification for the distributional assumption in App. F. We compute the mean μ and covariance Σ of the descriptors of all sets. The estimated PDF is given by: p(h) = N (h|μ, Σ) (2) 5 As the anomaly score is correlated with the negative-likelihood of a sample, we define the anomaly score a(h) as the negative log-likelihood. Ignoring constant terms, this becomes the Mahalanobis distance: a(h) = (h − μ)T Σ−1(h − μ) (3) In practice, we found that the Mahalanobis distance to the kNN (kNN with whitening transformation) rather than to μ worked slightly better and is therefore used to compute our results. 4 Application to Image and Time Series Anomaly Detection In this section, we apply our set description method for anomaly detection in image and time series data. 4.1 Images as Sets Images can be seen as consisting of a set of elements of different levels of granularity. This ranges from pixels to small patches and low-level elements such as lines or corners, up to high-level elements such as objects. For anomaly detection, we typically do not know in advance the correct level of granularity for separating between normal and anomalous samples. This depends on the anomalies, which are unknown during training. Instead, we perform anomaly detection for different levels of granularity and combine the scores. These levels of granularity correspond to patches of different sizes. In practice, we use representations from intermediate blocks of a pre-trained ResNet He et al. (2016). As a ResNet network simultaneously embeds many local patches of each image, we pass the image through the network encoder and extract our representations from the intermediate activations at the end of different residual blocks (see Fig.3). We define each spatial location in the activation map as an element. Note that as different blocks have different resolutions, they yield different numbers of elements. We take the elements at the end of each residual block as our sets. 4.2 Time Series as Sets Time series data can be viewed as a set of temporal windows. Similarly to images, it is generally not known in advance which temporal scale is relevant for detecting anomalies; i.e. the duration of windows which includes the semantic phenomenon. Inspired by Rocket Dempster et al. (2020), we define the basic elements of a time series as a collection of temporal window pyramids. Each pyramid contains L windows. All the windows in a pyramid are centered at the same time step, each containing τ samples (Fig.3). The first level window includes τ elements with stride 1, the second level window includes τ elements with stride 2, etc. Such window pyramid is computed for each time step in the time series, and the entire series is represented as the set of its pyramid elements. More implementation details are described in Sec.C.2. 5 Results 5.1 Logical Anomaly Detection Results Logical Anomalies Dataset. We use the recently published MVTec-LOCO dataset Bergmann et al. (2022) to evaluate our method's ability to detect anomalies caused by unusual configurations of normal elements. This dataset features five different classes: breakfast box, juice bottle, pushpins, screw bag and splicing connector (see Fig.1). Each class includes: (i) a training set of normal samples exhibiting the normal variation of the class (∼ 350 samples). (ii) a validation set, containing another, smaller, set of normal samples (∼ 60 samples). (iii) a test set, containing normal samples, structural anomalies, and logical anomalies (∼ 100 samples each). The anomalies in each class are divided into structural anomalies and logical anomalies. Structural anomalies feature local defects, somewhat similar to previous datasets such as Bergmann et al. (2019). Conversely, logical anomalies may violate 'logical' conditions expected from the normal data. As 6 Table 1: Anomaly detection on MVTec-LOCO. ROC-AUC (%). See Tab.5 for the full table. f-AnoGAN MNAD ST SPADE PCore GCAD SINBAD e i l a m o n A s Breakfast box Juice bottle Pushpins Screw bag Splicing connectors Avg. Logical l a c i g o L .Breakfast box a m Juice bottle o n Pushpins A Screw bag Splicing connectors Avg. Structural l a r u t c u r t S Avg. Total 69.4 82.4 59.1 49.7 68.8 65.9 50.7 77.8 74.9 46.1 63.8 62.7 64.3 59.9 70.5 51.7 60.8 57.6 60.1 60.2 84.1 76.7 56.8 73.2 70.2 65.1 68.9 82.9 59.5 55.5 65.4 66.4 68.4 99.3 90.3 87.0 96.8 88.3 77.4 81.8 91.9 60.5 46.8 73.8 71.0 74.7 84.9 58.1 59.8 57.1 66.9 68.9 77.7 83.7 62.2 55.3 63.3 69.0 74.8 86.7 77.6 86.6 68.7 78.9 74.0 87.0 100.0 97.5 56.0 89.7 86.0 80.9 98.9 74.9 70.5 78.3 80.7 83.4 96.5 ± 0.1 96.6 ± 0.1 83.4 ± 3.0 78.6 ± 0.1 89.3 ± 0.2 88.9 ± 0.6 87.5 ± 0.1 93.1 ± 0.3 74.2 ± 17.4 92.2 ± 0.8 76.7 ± 0.2 84.7 ± 3.4 86.8 ± 1.8 one example, an anomaly may include a different number of objects than the numbers expected from a normal sample (while all the featured object types exist in the normal class (Fig.1)). Other types of logical anomalies in the dataset may include cases where distant parts of an image must correlate with one another. E.g., within the normal data, the color of one object may correlate with the length of another object. These correlations may break in an anomalous sample. Metric. Following the standard in image-level anomaly detection we report image level ROC-AUC metric. We report this metric individually for each anomaly type, for each data class. Baselines. We compare to baseline methods used by the paper which presented the MVTec-LOCO dataset Bergmann et al. (2022). Namely, we compare to Variational Model (VM) Steger (2001) - a handcrafted similarity measure designed for robustness to different conditions, MNAD Park et al. (2020) - an autoencoder with a memory module, f-AnoGAN Schlegl et al. (2017) - a generative model trained for the reconstruction of anomaly free images, AE / VAE Sakurada & Yairi (2014) - an autoencoder / variational autoencoder, Student Teacher (ST) Bergmann et al. (2020) - a student network aimed to give better reconstruction for the normal data, SPADE Cohen & Hoshen (2020) - a density estimation method using a pyramid of deep ResNet features, PatchCore (PCore) Roth et al. (2022) - a state-of-the-art method for structural anomalies, improving SPADE scoring function, GCAD Bergmann et al. (2022) - a reconstruction based method, based on both local and global deep ResNet features. Results. We report our results on image-level detection of logical anomalies and structural anomalies in Tab.1. Interestingly, we find complementary strengths between our approach and GCAD, a reconstruction-based approach by Bergmann et al. (2022). Although GCAD performed better on specific classes (e.g., pushpins), our approach provides better results on average. Most notably, our approach provides non-trivial anomaly detection capabilities on the screw bag class, while baseline approaches are close to the random baseline. The rest of the compared approaches performed significantly worse on all logical anomaly classes, as they rely on the abnormality of single patches. Our approach also provides an improvement in the detection of structural anomalies in some classes. This is somewhat surprising, as one may assume that detection-by-segmentation approaches would perform well in these cases. One possible reason for that is the high variability of the normal data in some of the classes (e.g., breakfast box, screw bag, Fig.1). This high variability may induce false positive detections for detection-by-segmentation approaches. Taken together, while different methods provide complementary strengths, on average, our method provides state-of-the-art results on logical anomaly detection, and on the dataset as a whole. 5.2 Time series anomalies detection results Time series dataset. We compared on the five datasets used in NeurTraL-AD Qiu et al. (2021): RacketSports (RS). Accelerometer and gyroscope recording of players playing four different racket sports. Each sport is designated as a different class. Epilepsy (EPSY). Accelerometer recording of healthy actors simulating four different activity classes, one of them being an epileptic shock. 7 Table 2: Anomaly detection on the UEA datasets, average ROC-AUC (%) over all classes. See Tab.6 for the full table. σ presented in Tab. 7 OCSVM IF RNN ED DSVDD DAG GOAD DROCC NeuTraL Ours EPSY NAT SAD CT RS Avg. 61.1 86.0 95.3 97.4 70.0 82.0 67.7 85.4 88.2 94.3 69.3 81.0 80.4 89.5 81.5 96.3 84.7 86.5 82.6 91.5 93.1 79.0 65.4 82.3 57.6 88.6 86.0 95.7 77.4 81.1 72.2 78.9 80.9 89.8 51.0 74.6 76.7 87.1 94.7 97.7 79.9 87.2 85.8 87.2 85.8 95.3 80.0 86.8 92.6 94.5 98.9 99.3 86.5 94.4 98.1 96.1 97.8 99.7 92.3 96.8 Naval air training and operating procedures standardization (NAT). Positions of sensors mounted on different body parts of a person performing activities. There are six different activity classes in the dataset. Character trajectories (CT). Velocity trajectories of a pen on a WACOM tablet. There are 20 different characters in this dataset. Spoken Arabic Digits (SAD). MFCC features of ten Arabic digits spoken by 88 different speakers. Metric. Following Qiu et al. (2021), we use the series-level ROC-AUC metric. Baselines. We compare the results of several baseline methods reported by Qiu et al. (2021). The methods cover the following paradigms: One-class classification: One-class SVM (OC-SVM), and its deep versions DeepSVDD ("DSVDD") Ruff et al. (2018), and the recently published DROCC Goyal et al. (2020). Tree-based detectors: Isolation Forest (IF) Liu et al. (2008). Density estimation: LOF, a specialized version of nearest neighbor anomaly detection Breunig et al. (2000). DAGMM ("DAG") Zong et al. (2018): density estimation in an auto-encoder latent space Auto-regressive methods - RNN and LSTM-ED ("ED") - deep neural network-based version of auto-regressive prediction models Malhotra et al. (2016). Transformation prediction - GOAD Bergman & Hoshen (2020) and NeuTraL-AD Qiu et al. (2021) are based on transformation prediction, and are adaptations of RotNet-based approaches (such as GEOM Golan & El-Yaniv (2018)). Results. Our results are presented in Tab. 2. We can observe that different baseline approaches are effective for different datasets. kNN-based LOF is highly effective for SAD which is a large dataset but achieves worse results for EPSY. Auto-regressive approaches achieve strong results on CT. Transformation-prediction approaches, GOAD and NeuTraL achieve the best performance of all the baselines. The learned transformations of NeuTraL achieved better results than the random transformations of GOAD. Our method achieves the best overall results both on average and individually on all datasets apart from SAD (where it is comparable but a little lower than NeuTraL). Note that differently from NeuTraL, our method is far simpler, does not use deep neural networks and is very fast to train and evaluate. It also has fewer hyperparameters. 5.3 Implementation Details We provide here the main implementation details for our image anomaly detection application. Further implementation details for the image application can be found in App.C.1. Implementation details for the time series experiments can be found in App.C.2. ResNet levels. We use the representations from the third and fourth blocks of a WideResNet50×2 (resulting in sets size 7 × 7 and 14 × 14 elements, respectively). We also use all the raw pixels in the image as an additional set (resized to 224 × 224 elements). The total anomaly score is the average of the anomaly scores obtained for the set of 3rd ResNet block features, the set of 4th ResNet block features, and the set of raw pixels. The average anomaly score is weighted by the following factors (1, 1, 0.1) respectively (see App.D for our robustness to the choice of weighting factor). Multiple crops for image anomaly detection. Describing the entire image as a single set might sometime lose discriminative power when the anomalies are localized. To mitigate this issue, we can treat only a part of an image as our entire set. To do so, we crop the image to a factor of c, and compare the elements taken only from these crops. We compute an anomaly score for each crop 8 Table 3: Ablation for logical image AD. ROC-AUC (%) . Only 3 Only 4 No pixels Only full Ours Breakfa. Juice bo. Pushpins Screw b. Splicing. Average 93.9 93.3 78.0 79.5 85.3 86.0 95.6 97.4 66.8 71.0 85.0 83.2 95.7 96.4 73.4 77.2 86.3 85.8 97.1 96.7 77.5 76.6 91.3 87.8 96.5 96.6 83.4 78.6 89.3 88.9 Table 4: Ablation for logical image AD. Compared using no multiple crops and no raw-pixels level. ROC-AUC (%). Sim. Avg. No Proj. No Whit. Ours Breakfa. Juice bo. Pushpins Screw b. Splicing. Average 88.4 95.7 64.1 56.5 87.7 78.5 91.2 94.7 68.9 62.3 89.2 81.3 94.2 93.4 69.6 66.4 88.0 82.3 95.1 95.2 73.4 70.2 86.7 84.1 factor and for each center location. We then average over the anomaly scores of the different crop center locations for the same crop factor c. Finally, for each ResNet level (described above), we average the anomaly scores over the different crop ratios c. We use crop ratios of {1.0, 0.7, 0.5, 0.33}. The different center locations are taken with a stride of 0.25 of the entire image. Parameters. For the image experiments, we use histograms of K = 5 bins and r = 1000 projections. For the raw-pixels layer, we used a projection dimension of r = 10 and no whitening due to its low number of channels. To avoid high variance between runs, we averaged 16 different repetitions for the raw-pixel scoring. We use k = 1 for the kNN density estimation. 5.4 Ablations Here, we present ablations for the image logical AD methods. For time series ablations, see appendix E. Using individual ResNet levels. In Tab.3 we report the results of our method when different components of our multi-level ResNet ensemble are removed. We report the results using only the representation from the third or fourth ResNet block ("Only 3 / 4"). We also report the results of using both ResNet blocks, but without the raw-pixels level ("No Pixels"). While specific variants may outperform on specific classes, our combination outperforms on average. No multiple crops ablation. We also report our results without the multiple crops ensemble (de- scribed in Sec.5.3). In this ablation we feed only the entire image for the set extraction stage ("Only full"). As expected, using multiple crops field is beneficial for classes where small components are relatively important. Simple averaging. We compare to a simple averaging of the set features (Fig. 2), ablating our entire set-features approach. This yields a significantly worse performance (Tab.4 "Sim. Avg."). No random projection. We also ablate our use of random projections as described in Sec.3.3. We replace the random histograms with similar histograms using the raw given features. The advantage of our approach can be seen in Tab.4 ("No Proj."). No whitening. Finally, we also ablate our Gaussian model of the set features. Our method uses the collection of all the normal samples to calculate the covariance of the set features of the normal sample and modify our set distance measure as described in Sec.3.4. Also here our approach outperforms, highlighting the benefits of describing the normal data as a collection of sets (Tab.4 "No Whit."). 9 6 Discussion Complementary strength of density estimation and reconstruction based approaches for logi- cal anomaly detection. As our method and GCAD Bergmann et al. (2022), a reconstruction based approach, exhibit complementary strengths, it is a natural direction to try and use them together. A practical way to take advantage of both approaches would be ensembling. A better understanding of the reasons for each method's different performance across classes is likely to lead to the development of better approaches, combining the strengths of each method. Is our set descriptor approach beneficial for detecting structural image anomalies? While our method slightly lags behind the top segmentation-by-detection approach on structural anomalies, it achieves the top performance on specific classes. We hypothesize this may be due to the high variation among the normal samples in these classes. In this case too, future research may allow the construction of better detectors, enjoying the combined strength of both approaches. Incorporating deep features for time series data. We demonstrated that our method is able to outperform the state-of-the-art in time series anomaly detection without using deep neural networks. While this is an interesting and surprising result, we believe that deep features will be incorporated into similar approaches in the future. One direction for doing this is replacing the window projection features with a suitable deep representation, while keeping the averaging and Gaussian modeling steps unchanged. Relation to previous methods and optimal transport. Our method is related to several previous methods. HBOS (Goldstein & Dengel, 2012) and LODA (Pevn`y, 2016) also used similar projection features for anomaly detection. Yet, these methods perform histogram-based density estimation by ignoring the dependency across projections. As they can only be applied to a single element (time-window), they do not achieve competitive performance for time series AD. Rocket/mini-rocket (Dempster et al., 2020, 2021) also average projection features across windows but do not tackle anomaly detection nor do they apply to image data. Finally, there is a subtle connection to Radon transform (Kolouri et al., 2015) and sliced Wasserstein distance in L1 (SWD) based methods (Bonneel et al., 2015) which also use similar projection and histogram features. 7 Limitations Element-level anomaly detection. Our method focuses on sample-level time series and image- level anomaly detection. In some applications, a user may also want a segmentation of the most anomalous elements of each sample. We note that for logical anomalies, this is often not very well defined. E.g., when we have an image with 3 nuts as opposed to the normal 2, each of them may be considered anomalous. To provide element-level information, our method can be combined with current segmentation approaches by incorporating the knowledge of a global anomaly (e.g., removing false positive segmentation if an image is normal). However, directly applying our set features for anomaly segmentation is left for future research. Pre-trained features. Similarly to the other top-performing approaches, our approach for image anomaly detection relies on pre-trained features. While the use of pre-trained features for anomaly detection in images is standard, it has failure modes. There are a handful of datasets where ImageNet pretraining is known to fail Yousef et al. (2023). Class-specific performance. While our method outperforms on average, in some classes we do not perform as well compared to baseline approaches. A better understanding of the cases when our method fails would be beneficial for deploying it in practice. Non-IID elements. Our method uses a Gaussian anomaly scoring function. By the central limit theorem, this is justifiable when the elements are IID (see appendix F). However, this is not precisely true for either of our settings as elements have a strong overlap. In general, we find the Mahalanobis scoring function is highly effective, and the combination with kNN relaxes the Gaussian assumption. A more careful analysis is left for future work. 10 8 Conclusion We presented a method for detecting anomalies caused by unusual combinations of normal elements. We introduce set features dedicated to capturing such phenomena, and demonstrate their applicability for images and time series. Extensive experiments established the strong performance of our method. 9 Acknowledgement Niv Cohen was funded by Israeli Science Foundation and the Hebrew University Data Science grants (CIDR). We thank Paul Bergmann for kindly sharing numerical results for many of the methods compared on the MVTec-LOCO dataset. References Bergman, L. and Hoshen, Y. Classification-based anomaly detection for general data. In International Conference on Learning Representations, 2020. Bergmann, P., Fauser, M., Sattlegger, D., and Steger, C. Mvtec ad–a comprehensive real-world dataset for unsupervised anomaly detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9592–9600, 2019. Bergmann, P., Fauser, M., Sattlegger, D., and Steger, C. Uninformed students: Student-teacher In Proceedings of the IEEE/CVF anomaly detection with discriminative latent embeddings. Conference on Computer Vision and Pattern Recognition, pp. 4183–4192, 2020. Bergmann, P., Batzner, K., Fauser, M., Sattlegger, D., and Steger, C. The mvtec anomaly detection dataset: a comprehensive real-world dataset for unsupervised anomaly detection. International Journal of Computer Vision, 129(4):1038–1059, 2021. Bergmann, P., Batzner, K., Fauser, M., Sattlegger, D., and Steger, C. Beyond dents and scratches: Logical constraints in unsupervised anomaly detection and localization. International Journal of Computer Vision, 130(4):947–969, 2022. Blázquez-García, A., Conde, A., Mori, U., and Lozano, J. A. A review on outlier/anomaly detection in time series data. ACM Computing Surveys (CSUR), 54(3):1–33, 2021. Bonneel, N., Rabin, J., Peyré, G., and Pfister, H. Sliced and radon wasserstein barycenters of measures. Journal of Mathematical Imaging and Vision, 51(1):22–45, 2015. Bontemps, L., Cao, V. L., McDermott, J., and Le-Khac, N.-A. Collective anomaly detection based on long short-term memory recurrent neural networks. In International conference on future data and security engineering, pp. 141–152. Springer, 2016. Breunig, M. M., Kriegel, H.-P., Ng, R. T., and Sander, J. Lof: identifying density-based local outliers. In Proceedings of the 2000 ACM SIGMOD international conference on Management of data, pp. 93–104, 2000. Carrera, D., Manganini, F., Boracchi, G., and Lanzarone, E. Defect detection in sem images of nanofibrous materials. IEEE Transactions on Industrial Informatics, 13(2):551–561, 2016. Cohen, M. J. and Avidan, S. Transformaly-two (feature spaces) are better than one. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4060–4069, 2022. Cohen, N. and Hoshen, Y. Sub-image anomaly detection with deep pyramid correspondences. arXiv preprint arXiv:2005.02357, 2020. Dasgupta, A., Kumar, R., and Sarlós, T. Fast locality-sensitive hashing. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 1073–1081, 2011. Deecke, L., Ruff, L., Vandermeulen, R. A., and Bilen, H. Transfer-based semantic anomaly detection. In International Conference on Machine Learning, pp. 2546–2558. PMLR, 2021. 11 Defard, T., Setkov, A., Loesch, A., and Audigier, R. Padim: a patch distribution modeling framework for anomaly detection and localization. In Pattern Recognition. ICPR International Workshops and Challenges: Virtual Event, January 10–15, 2021, Proceedings, Part IV, pp. 475–489. Springer, 2021. Dempster, A., Petitjean, F., and Webb, G. I. Rocket: exceptionally fast and accurate time series classification using random convolutional kernels. Data Mining and Knowledge Discovery, 34(5): 1454–1495, 2020. Dempster, A., Schmidt, D. F., and Webb, G. I. Minirocket: A very fast (almost) deterministic transform for time series classification. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp. 248–257, 2021. Eskin, E., Arnold, A., Prerau, M., Portnoy, L., and Stolfo, S. A geometric framework for unsupervised anomaly detection. In Applications of data mining in computer security, pp. 77–101. Springer, 2002. Glodek, M., Schels, M., and Schwenker, F. Ensemble gaussian mixture models for probability density estimation. Computational Statistics, 28(1):127–138, 2013. Golan, I. and El-Yaniv, R. Deep anomaly detection using geometric transformations. In Advances in Neural Information Processing Systems, pp. 9758–9769, 2018. Goldstein, M. and Dengel, A. Histogram-based outlier score (hbos): A fast unsupervised anomaly detection algorithm. KI-2012: Poster and Demo Track, 2012. Goyal, S., Raghunathan, A., Jain, M., Simhadri, H. V., and Jain, P. Drocc: Deep robust one-class classification. In International Conference on Machine Learning, pp. 3711–3721. PMLR, 2020. He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016. Hendrycks, D., Mazeika, M., Kadavath, S., and Song, D. Using self-supervised learning can improve model robustness and uncertainty. In Advances in Neural Information Processing Systems, pp. 15663–15674, 2019. Horwitz, E. and Hoshen, Y. An empirical investigation of 3d anomaly detection and segmentation. arXiv preprint arXiv:2203.05550, 2022. Jezek, S., Jonak, M., Burget, R., Dvorak, P., and Skotak, M. Deep learning-based defect detection of metal parts: evaluating current methods in complex conditions. In 2021 13th International Congress on Ultra Modern Telecommunications and Control Systems and Workshops (ICUMT), pp. 66–71. IEEE, 2021. Johnson, J., Douze, M., and Jégou, H. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3):535–547, 2019. Kolouri, S., Park, S. R., and Rohde, G. K. The radon cumulative distribution transform and its application to image classification. IEEE transactions on image processing, 25(2):920–934, 2015. Larsson, G., Maire, M., and Shakhnarovich, G. Learning representations for automatic colorization. In ECCV, 2016. Latecki, L. J., Lazarevic, A., and Pokrajac, D. Outlier detection with kernel density functions. In International Workshop on Machine Learning and Data Mining in Pattern Recognition, pp. 61–75. Springer, 2007. Li, C.-L., Sohn, K., Yoon, J., and Pfister, T. Cutpaste: Self-supervised learning for anomaly detection and localization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9664–9674, 2021. Liu, F. T., Ting, K. M., and Zhou, Z.-H. Isolation forest. In 2008 Eighth IEEE International Conference on Data Mining, pp. 413–422. IEEE, 2008. 12 Malhotra, P., Ramakrishnan, A., Anand, G., Vig, L., Agarwal, P., and Shroff, G. Lstm-based encoder-decoder for multi-sensor anomaly detection. arXiv preprint arXiv:1607.00148, 2016. Park, H., Noh, J., and Ham, B. Learning memory-guided normality for anomaly detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14372–14381, 2020. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., and Duchesnay, E. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. Perera, P. and Patel, V. M. Learning deep features for one-class classification. IEEE Transactions on Image Processing, 28(11):5450–5463, 2019. Pevn`y, T. Loda: Lightweight on-line detector of anomalies. Machine Learning, 102(2):275–304, 2016. Qiu, C., Pfrommer, T., Kloft, M., Mandt, S., and Rudolph, M. Neural transformation learning for deep anomaly detection beyond images. ICML, 2021. Radon, J. 1.1 über die bestimmung von funktionen durch ihre integralwerte längs gewisser mannig- faltigkeiten. Proceedings of the Royal Saxonian Academy of Sciences at Leipzig, 1917. Reiss, T. and Hoshen, Y. Mean-shifted contrastive loss for anomaly detection. arXiv preprint arXiv:2106.03844, 2021. Reiss, T., Cohen, N., Bergman, L., and Hoshen, Y. Panda: Adapting pretrained features for anomaly detection and segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2806–2814, 2021. Reiss, T., Cohen, N., Horwitz, E., Abutbul, R., and Hoshen, Y. Anomaly detection requires better representations. arXiv preprint arXiv:2210.10773, 2022. Roth, K., Pemula, L., Zepeda, J., Schölkopf, B., Brox, T., and Gehler, P. Towards total recall in industrial anomaly detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14318–14328, 2022. Rousseeuw, P. J. and Leroy, A. M. Robust regression and outlier detection, volume 589. John wiley & sons, 2005. Ruff, L., Vandermeulen, R., Goernitz, N., Deecke, L., Siddiqui, S. A., Binder, A., Müller, E., and Kloft, M. Deep one-class classification. In International conference on machine learning, pp. 4393–4402, 2018. Ruff, L., Vandermeulen, R. A., Görnitz, N., Binder, A., Müller, E., Müller, K.-R., and Kloft, M. Deep semi-supervised anomaly detection. In International Conference on Learning Representations, 2019. Ruff, L., Kauffmann, J. R., Vandermeulen, R. A., Montavon, G., Samek, W., Kloft, M., Dietterich, T. G., and Müller, K.-R. A unifying review of deep and shallow anomaly detection. Proceedings of the IEEE, 2021. Sakurada, M. and Yairi, T. Anomaly detection using autoencoders with nonlinear dimensionality reduction. In Proceedings of the MLSDA 2014 2nd workshop on machine learning for sensory data analysis, pp. 4–11, 2014. Salehi, M., Sadjadi, N., Baselizadeh, S., Rohban, M. H., and Rabiee, H. R. Multiresolution knowledge distillation for anomaly detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 14902–14912, 2021. Schlegl, T., Seeböck, P., Waldstein, S. M., Schmidt-Erfurth, U., and Langs, G. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International conference on information processing in medical imaging, pp. 146–157. Springer, 2017. 13 Schölkopf, B., Platt, J. C., et al. Support vector method for novelty detection. Citeseer. Steger, C. Similarity measures for occlusion, clutter, and illumination invariant object recognition. In Joint Pattern Recognition Symposium, pp. 148–154. Springer, 2001. Tack, J., Mo, S., Jeong, J., and Shin, J. Csi: Novelty detection via contrastive learning on distribution- ally shifted instances. NeurIPS, 2020. Tax, D. M. and Duin, R. P. Support vector data description. Machine learning, 54(1):45–66, 2004. Yousef, M., Ackermann, M., Kurup, U., and Bishop, T. No shifted augmentations (nsa): compact distributions for robust self-supervised anomaly detection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 5511–5520, 2023. Zaheer, M., Kottur, S., Ravanbakhsh, S., Poczos, B., Salakhutdinov, R. R., and Smola, A. J. Deep sets. Advances in neural information processing systems, 30, 2017. Zong, B., Song, Q., Min, M. R., Cheng, W., Lumezanu, C., Cho, D., and Chen, H. Deep autoencoding gaussian mixture model for unsupervised anomaly detection. In International Conference on Learning Representations, 2018. 14 A Full Results Tables The full table image logical anomaly detection experiments can be found in Tab.5. The full table for the time series anomaly detection experiments can be found in Tab.6. B UEA Results with Standard Errors We present an extended version of the UEA results including error bounds for our method and baselines that reported them. The difference between the methods is significantly larger than the standard error. C Implementation Details Histograms. In practice, we use the cumulative histograms as our set features for both data modalities (of Sec.3.3). C.1 Image anomaly detection Preprocessing. Before feeding each image sample to the pre-trained network we resize it to 224 × 224 and normalize it according to the standard ImageNet mean and variance. Considering that classes in this dataset are provided in different aspect ratios, and that similar objects may look different when resized to a square, we found it beneficial to pad each image with empty pixels. The padded images have a 1 : 1 aspect ratio, and resizing them would not change the aspect ratio of the featured objects. Software. For the whitening of image features we use the ShrunkCovariance function from the scikit-learn library Pedregosa et al. (2011) with its default parameters. For kNN density estimation we use the faiss library Johnson et al. (2019). Computational resources. The experiments were run on a single RTX2080-GT GPU. C.2 Time Series anomaly detection Padding. Prior to window extraction, the series x is first right and left zero-padded by τ 2 to form padded series x(cid:48). The first window w1 is defined as the first τ observations in padded series S(cid:48), τ . We further define windows at higher scales W s, which include observations i.e. w1 = x(cid:48) sampled with stride c. At scale c, the original series x is right and left zero-padded by c*τ 2 to form padded series S(cid:48)c. 2..x(cid:48) 1, x(cid:48) UEA Experiments. We used each time series as an individual training sample. We chose a kernel size of 9, 100 projection, 20 quantiles, and a maximal number of levels of 10. The results varied only slightly within a reasonable range of the hyperparameters e.g. using 5, 10, 15 levels yielded an average ROCAUC of 97, 96.8, 96.8 across the five UEA datasets. Spoken Arabic Digits processing We follow the processing of the dataset as done by Qiu et al. Qiu et al. (2021). In private communications the authors explained that only sequences of lengths between 20 and 50 time steps were selected. The other time series were dropped. Computational resources. The experiments were run on a modest number of CPUs on a computing cluster. The baseline methods were run on a single RTX2080-GT GPU D Logical Anomaly detection Robustness We check the robustness of our results for the parameter λ - the weighting between the raw-pixels level anomaly score to the anomaly score derived from the ResNet features (Sec.5.3). As can be seen in Tab.8, our results are robust to the choice of λ. 15 Figure 4: Ablation of accuracy vs. the number of projections (left) and the number of bins (right). E Time Series Ablations Number of projections. Using a high output dimension for projection matrix P increases the expressively but also increases the computation cost. We investigate the effect of the number of projections on the final accuracy of our method. The results are provided in Fig. 4. We can observe that although a small number of projections hurts performance, even a moderate number of projections is sufficient. We found 100 projections to be a good tradeoff between performance and runtime. Number of bins. We compute the accuracy of our method as a function of the number of bins per projection. Our results ( Fig. 4) show that beyond a very small number of bins - larger numbers are not critical. We found 20 bins to be sufficient in all our experiments. Effect of Gaussian density estimation. Standard projection methods such as HBOS Goldstein & Dengel (2012) and LODA Pevn`y (2016) do not use a multivariate density estimator but instead estimate the density of each dimension independently. We compare using a full and per-variable density estimation in Tab. 9. We can see that our approach achieves far better results, attesting to the importance of modeling the correlation between projections. Comparing projection sampling methods. We compare three different projection selection pro- cedures: (i) Gaussian: sampling the weights in P from a random Normal Gaussian distribution (ii) Using an identity projection matrix: P = I . (iii) PCA: selecting P from the eigenvectors of the matrix containing all (raw) features of all training windows. PCA selects the projections with maximum variation but is computationally expensive. The results are presented in Tab. 10. We find that the identity projection matrix under-performed the other approaches (as it provides no variable mixing). Surprisingly, we do not see a large difference between PCA and random projections. F Using the Central Limit Theorem for Set anomaly detection We model the features of each window f as a normal set as IID observations coming from a probability distribution function p(f ). The distribution function is not assumed to be Gaussian. Using a Gaussian density estimator trained on the features of elements observed in training is unlikely to be effective for element-level anomaly detection (due to the non-Gaussian p(f )). An alternative formulation to the one presented in section 3, is that each feature f is multiplied by projection matrix P , and then each dimension is discretized and mapped to a one-hot vector. This formulation therefore maps the representation of each element to a sparse binary vector. The mean of the representations of elements in the set recovers the normalized histogram descriptor precisely (therefore this formulation is equivalent to the one in section 3). As the histogram is a mean of the set of elements, it has superior statistical properties. In particular, the Central Limit Theorem states that under some conditions the sample mean follows the Gaussian distribution regardless of the distribution of windows p(f ). While typically in anomaly detection only a single sample is presented at a time, the situation is different when treating samples as sets. Although the windows are often not IID, given a multitude of elements, an IID approximation may be approximately correct. This explains the high effectiveness of Gaussian density estimation in our formulation. 16 Table 5: Anomaly detection on the MVTec-LOCO dataset. ROC-AUC (%). AE MNAD f-AG VAE VM e i l a m o n A s Breakfast box Juice bottle Pushpins Screw bag Splicing connectors Avg. Logical l a c i g o L .Breakfast box m Juice bottle o n A Pushpins Screw bag Splicing connectors Avg. Structural l a r u t c u r t S Avg. Total e i l a m o n A s Breakfast box Juice bottle Pushpins Screw bag Splicing connectors Avg. Logical l a c i g o L .Breakfast box m Juice bottle o n A Pushpins Screw bag Splicing connectors Avg. Structural l a r u t c u r t S Avg. Total 70.3 59.7 42.5 45.3 64.9 56.5 70.1 69.4 65.8 37.7 51.6 58.9 57.7 58.0 67.9 62.0 46.8 56.2 58.2 47.7 62.6 66.4 41.5 64.8 56.6 57.4 47.3 61.3 54.3 47.0 59.4 53.8 38.3 57.3 75.1 49.0 54.6 54.8 54.3 69.4 82.4 59.1 49.7 68.8 65.9 50.7 77.8 74.9 46.1 63.8 62.7 64.3 59.9 70.5 51.7 60.8 57.6 60.1 60.2 84.1 76.7 56.8 73.2 70.2 65.1 ST SPADE PCore GCAD SINBAD 68.9 82.9 59.5 55.5 65.4 66.4 68.4 99.3 90.3 87.0 96.8 88.3 77.4 81.8 91.9 60.5 46.8 73.8 71.0 74.7 84.9 58.1 59.8 57.1 66.9 68.9 77.7 83.7 62.2 55.3 63.3 69.0 74.8 86.7 77.6 86.6 68.7 78.9 74.0 87.0 100.0 97.5 56.0 89.7 86.0 80.9 98.9 74.9 70.5 78.3 80.7 83.4 96.5 ± 0.1 96.6 ± 0.1 83.4 ± 3.0 78.6 ± 0.1 89.3 ± 0.2 88.9 ± 0.6 87.5 ± 0.1 93.1 ± 0.3 74.2 ± 17.4 92.2 ± 0.8 76.7 ± 0.2 84.7 ± 3.4 86.8 ± 1.8 Table 6: UEA datasets, average ROC-AUC (%) over all classes. (σ presented in Tab. 7) LOF OCSVM RNN ED IF EPSY NAT SAD CT RS Avg. EPSY NAT SAD CT RS Avg. 61.1 86.0 95.3 97.4 70.0 82.0 67.7 85.4 88.2 94.3 69.3 81.0 56.1 89.2 98.3 97.8 57.4 79.8 80.4 89.5 81.5 96.3 84.7 86.5 82.6 91.5 93.1 79.0 65.4 82.3 DSVDD DAGMM GOAD DROCC NeuTraL Ours 85.8 87.2 85.8 95.3 80.0 86.8 92.6 94.5 98.9 99.3 86.5 94.4 98.1 96.1 97.8 99.7 92.3 96.8 57.6 88.6 86.0 95.7 77.4 81.1 72.2 78.9 80.9 89.8 51.0 74.6 76.7 87.1 94.7 97.7 79.9 87.2 17 Table 7: UEA datasets, average ROC-AUC (%) over all classes including error bounds OCSVM 61.1 86 95.3 97.4 70 82.0 IF 67.7 85.4 88.2 94.3 69.3 81.0 LOF 56.1 89.2 98.3 97.8 57.4 79.8 RNN LSTM-ED 80.4 ± 1.8 89.5 ± 0.4 81.5 ± 0.4 96.3 ± 0.2 84.7 ± 0.7 82.6 ± 1.7 91.5 ± 0.3 93.1 ± 0.5 79.0 ± 1.1 65.4 ± 2.1 86.5 82.3 DeepSVDD DAGMM GOAD DROCC NeuTraL Ours 57.6 ± 0.7 88.6 ± 0.8 86.0 ± 0.1 95.7 ± 0.5 77.4 ± 0.7 72.2 ± 1.6 78.9 ± 3.2 80.9 ± 1.2 89.8 ± 0.7 51.0 ± 4.2 76.7 ± 0.4 87.1 ± 1.1 94.7 ± 0.1 97.7 ± 0.1 79.9 ± 0.6 85.8 ± 2.1 87.2 ± 1.4 85.8 ± 0.8 95.3 ± 0.3 80.0 ± 1.0 92.6 ± 1.7 94.5 ± 0.8 98.9 ± 0.1 99.3 ± 0.1 86.5 ± 0.6 98.1 ± 0.3 96.1 ± 0.1 97.8 ± 0.1 99.7 ± 0.1 92.3 ± 0.3 81.1 74.6 87.2 86.8 94.4 96.8 EPSY NAT SAD CT RS Avg. EPSY NAT SAD CT RS Avg. Table 8: Robustness to the choice of λ. Average Results on the Logical Anomalies classes. Average ROC-AUC (%). λ 0.2 0.1 (Ours) 88.8 88.9 0.05 88.7 0.02 88.5 Table 9: An ablation of projection sampling methods. ROC-AUC (%). EPSY RS No whitening Whitening 62.1 98.1 70.9 92.3 NA 93.6 96.1 CT SAD 98.5 99.7 78.8 97.8 Table 10: An ablation of projection sampling methods. ROC-AUC (%). EPSY RS Id. PCA Rand 97.1 98.2 98.1 90.2 91.6 92.3 NA 91.8 95.8 96.1 CT SAD 98.2 99.7 99.7 78.3 96.7 97.8 18
http://arxiv.org/abs/2302.12244v3
2023-06-15T18:06:12
2023-02-23T18:58:36
To the Noise and Back: Diffusion for Shared Autonomy
Shared autonomy is an operational concept in which a user and an autonomous agent collaboratively control a robotic system. It provides a number of advantages over the extremes of full-teleoperation and full-autonomy in many settings. Traditional approaches to shared autonomy rely on knowledge of the environment dynamics, a discrete space of user goals that is known a priori, or knowledge of the user's policy -- assumptions that are unrealistic in many domains. Recent works relax some of these assumptions by formulating shared autonomy with model-free deep reinforcement learning (RL). In particular, they no longer need knowledge of the goal space (e.g., that the goals are discrete or constrained) or environment dynamics. However, they need knowledge of a task-specific reward function to train the policy. Unfortunately, such reward specification can be a difficult and brittle process. On top of that, the formulations inherently rely on human-in-the-loop training, and that necessitates them to prepare a policy that mimics users' behavior. In this paper, we present a new approach to shared autonomy that employs a modulation of the forward and reverse diffusion process of diffusion models. Our approach does not assume known environment dynamics or the space of user goals, and in contrast to previous work, it does not require any reward feedback, nor does it require access to the user's policy during training. Instead, our framework learns a distribution over a space of desired behaviors. It then employs a diffusion model to translate the user's actions to a sample from this distribution. Crucially, we show that it is possible to carry out this process in a manner that preserves the user's control authority. We evaluate our framework on a series of challenging continuous control tasks, and analyze its ability to effectively correct user actions while maintaining their autonomy.
[ "Takuma Yoneda", "Luzhe Sun", "and Ge Yang", "Bradly Stadie", "Matthew Walter" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12244v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12244v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.RO", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.RO", "cs.LG" ]
3 2 0 2 n u J 5 1 ] O R . s c [ 3 v 4 4 2 2 1 . 2 0 3 2 : v i X r a To the Noise and Back: Diffusion for Shared Autonomy Takuma Yoneda1, Luzhe Sun2, Ge Yang3,4, Bradly Stadie5, and Matthew R. Walter1 1Toyota Technological Institute at Chicago (TTIC) 2Department of Computer Science, University of Chicago 3Institute of Artificial Intelligence and Fundamental Interactions (IAIFI) 4Computer Science and Artificial Intelligence Laboratory (CSAIL), MIT 5Department of Statistics and Data Science, Northwestern University Abstract-Shared autonomy is an operational concept in which a user and an autonomous agent collaboratively control a robotic system. It provides a number of advantages over the extremes of full-teleoperation and full-autonomy in many settings. Traditional approaches to shared autonomy rely on knowledge of the envi- ronment dynamics, a discrete space of user goals that is known a priori, or knowledge of the user's policy-assumptions that are unrealistic in many domains. Recent works relax some of these assumptions by formulating shared autonomy with model-free deep reinforcement learning (RL). In particular, they no longer need knowledge of the goal space (e.g., that the goals are discrete or constrained) or environment dynamics. However, they need knowledge of a task-specific reward function to train the policy. Unfortunately, such reward specification can be a difficult and brittle process. On top of that, the formulations inherently rely on human-in-the-loop training, and that necessitates them to prepare a policy that mimics users' behavior. In this paper, we present a new approach to shared autonomy that employs a modulation of the forward and reverse diffusion process of diffusion models. Our approach does not assume known environment dynamics or the space of user goals, and in contrast to previous work, it does not require any reward feedback, nor does it require access to the user's policy during training. Instead, our framework learns a distribution over a space of desired behaviors. It then employs a diffusion model to translate the user's actions to a sample from this distribution. Crucially, we show that it is possible to carry out this process in a manner that preserves the user's control authority. We evaluate our framework on a series of challenging continuous control tasks, and analyze its ability to effectively correct user actions while maintaining their autonomy. I. INTRODUCTION Contemporary robots primarily operate in one of two differ- ent ways-full teleoperation or full autonomy. Teleoperation is common in unstructured environments (e.g., underwater), where the proficiency with which robots are able to understand their surroundings is insufficient for fully autonomous robots to operate reliably. However, direct teleoperation requires users to interpret the robot's environment observations while si- multaneously controlling its low-level actions, a responsibility that is particularly challenging for highly dynamic tasks. This operational gap motivates a setting in which a human and an autonomous agent collaborate and share control of the robot. Shared autonomy [2] is a framework in which a human user (also referred to as the pilot) performs a task with an assistance of an autonomous agent (also referred to as the Fig. 1: Our framework utilizes a diffusion model to adapt a user's action (red) to those from a demonstration distribution (green) in a manner (blue) that balances a user's desire to maintain control authority with the benefits (e.g., safety) of conforming to the desired (demonstration) distribution. With- out knowledge of the user's specific goal (e.g., the landing location), the demonstration distribution reflects different goals that the demonstration trajectories previously reached. copilot) [21, 41, 3, 13, 14, 22, 5]. The role of the agent is to complement the control authority of the user, whether to improve the robot's performance on the current task or to encourage/ensure safe behavior. An important consideration when providing assistance via shared autonomy is the degree to which the agent balances the user's preference for maintain- ing control authority (i.e., the fidelity of the assisted behavior relative to the user's actions), and the potential benefits of endowing more control to the agent (i.e., the conformity of the assisted behavior to that of an autonomous agent). A core difficulty of shared autonomy lies in the fact that the user's goal (intent) is typically not known. Many approaches to shared autonomy assume that there is a fixed, discrete set of candidate goals and seek to infer the user's specific goal at test-time based on observations, including the user's control input [34, 28, 37, 24, 14]. Such assumptions may be reasonable in structured environments (e.g., in the context of a manipulation task when there is a small number of graspable objects sitting on a table). However, they can be limiting in unstructured environments that lack well-defined goals or that have a very large set of potential goals. Bootstrapped by function approximation with neural- networks, recent deep reinforcement learning (RL) algorithms w/ AssistanceDemonstrationsw/o Assistance seek to learn assistive policies without assumptions on the the knowledge of the goal space, or the assumption that environment dynamics are known. Reddy et al. [39] propose a deep RL approach to shared autonomy for domains with discrete actions, nominally relying on reward feedback from the user as an alternative to assuming that the goal space is known. In an effort to balance the user's control authority with task performance, the assistant chooses the action most similar to that of the user while also satisfying a state-action value constraint. Schaff and Walter [43] treat the copilot as providing a residual that is added to the user's actions to correct for unsafe behavior. They train their model to minimize the norm of the residual, subject to a goal-agnostic reward constraint that represents safe behavior. These methods treat the pilot as a part of the environment, using an augmented state that includes the user's action. Framing the problem in this way has a clear and significant advantage-it enables the direct utilization of the modern suite of tools for deep RL. However, these methods have two notable limitations. First, they nominally require human-in- the-loop interaction during training in order to generate user actions while learning the assistant's policy. Since the sample complexity of deep RL makes this interaction intractable, these methods replace the human with a surrogate policy. If this surrogate is misspecified or invalid, this approach can lead to copilots that are incompatible with actual human pilots [43]. Second, these methods require access to task-specific reward during training, which may be difficult to obtain in practice. In light of these limitations, we propose a model-free approach to shared autonomy that interpolates between the user's action and an action sampled from a generative model that provides a distribution over desired behavior (Fig. 1).1 Our approach has the distinct advantage that it does not require knowledge of or access to the user's policy or any reward feedback during training, thus eliminating the need for reward engineering. Instead, our training process, which involves learning the generative model, only requires access to trajectories that are representative of desired behavior. The generative model that underlies our approach is a diffusion model [49, 45, 46, 25], which has proven highly effective for complex generation tasks including image syn- thesis [12, 42]. Diffusion models consist of two key processes: the forward process and the reverse process. The forward process iteratively adds Gaussian noise to the input with an increasing noise scale, while the reverse process is trained to iteratively denoise a noisy input in order to arrive at the target distribution. As part of this denoising process, the model produces the gradient direction in which the likelihood of its input increases under the target distribution. Once the model is trained, generating a sample from the (unknown) target distribution involves running the reverse process on a sample drawn from a zero-mean isotropic Gaussian distribution. As we will see in the following sections, a direct use of diffusion models for shared autonomy ends up in generating an 1For video and code, see https://diffusion-for-shared-autonomy.github.io. Fig. 2: (Top) A visualization of diffusion processes of action distributions at state st. The black arrow at the top shows the forward diffusion of a source user distribution Puser and the blue arrow below shows the reverse diffusion to the target demonstration distribution Pdemo. We switch these two processes in the intermediate step k = ksw to achieve partial forward and reverse diffusion shown in the black and blue arrow on the left. (Bottom) The result of forward and reverse diffusion for different switching times ksw, where standard reverse diffusion process corresponds to ksw = K. action that ignores user's intent (i.e., low fidelity to user intent), even though the action would be consistent with the desired behaviors (i.e., high conformity to the target behaviors). To address this, we propose a new algorithm that controls the effect of the forward and reverse process through a forward diffusion ratio γ that regulates the balance between the fidelity and the conformity of the generated actions. The forward diffusion ratio provides a formal bound on the extent to which the copilot's action deviates from that of the user. We evaluate our shared autonomy algorithm using a series of continuous control tasks. In each case, we demonstrate that our algorithm significantly improves the performance of a variety of different pilots, and we analyze the effects of a range of different forward diffusion ratios. II. METHOD An integral part of our shared autonomy approach is the utilization of diffusion models as a generative model that serves to correct the actions of the user. As such, we begin this section with an in-depth review of diffusion models. A. Background on diffusion models We first present the mathematical formulation of diffusion models, with a particular emphasis on the denoising diffusion probabilistic model (DDPM) [25], which we employ. Forward ProcessReverse Processk=kswγ=1ksw=Kksw=0γ=0Forward Diffusion Ratio k=0k=K that A probabilistic diffusion model [45] is a type of generative is characterized by two processes (Fig. 2): a model forward diffusion process and a reverse diffusion process. The forward diffusion process is an iterative first-order Markov chain that adds noise to a sample from a data distribution x0 ∼ q(x0). Assuming a predefined sequential noise schedule of K steps, β1, . . . , βK and αk := 1 − βk, a single step in the forward process operates as √ xk = αkxk−1 + √ 1 − αkε, ε ∼ N (0, I). (1) Applying this recursively, multiple steps of forward process can be written in a closed form as √ √ xk = ̄αkx0 + 1 − ̄αkε, ε ∼ N (0, I), where ̄αk := Πk s=1αs. Equivalently, √ √ q(xk | xk−1) = N (xk; q(xk | x0) = N (xk; αkx0, (1 − αk)I) ̄αkx0, (1 − ̄αk)I) (2) (3a) (3b) Meanwhile, the reverse diffusion process is a Markov chain that iteratively denoises a noisy input, starting from xK ∼ N (0, I). The conditional distribution over the output at each step q(xk−1|xk) is Gaussian. However, computing these intermediate steps depends upon the entire data distri- bution and is generally not tractable in closed-form. Thus, we train a model that approximates it as pθ(xk−1 | xk) = N (xk−1; μθ(xk, k), σ2 kI) to run the reverse process. The probability q(xk−1 | xk) that we want to model becomes tractable when conditioned on x0. By Bayes' rule, we have q(xk−1 | xk, x0) = q(xk | xk−1, x0) q(xk−1 | x0) q(xk | x0) = q(xk | xk−1) q(xk−1 | x0) q(xk | x0) = N (xk−1; ̃μ(xk, x0), ̃βkI) (4a) (4b) (4c) Crucially, Equation 4b only contains known terms from the Gaussian distributions in Equations 3a and 3b. In the last expression, we have dropped the exact forms of mean and covariance for notational brevity. Intuitively, we can train the model pθ(xk−1 | xk) by minimizing its divergence from q(xk−1 | xk, x0) over samples from the data distribution q(x0). Utilizing the evidence lower bound of Eq[− log pθ(x0)], we can formulate the loss as: (cid:34)K−1 (cid:88) L := Eq Lk − log pθ(x0 | x1) + C , (cid:35) Lk = DKL k=2 (cid:0)q(xk−1 | xk, x0)∥pθ(xk−1 | xk)(cid:1), (5) where DKL is the Kullback-Leibler (KL) divergence, C is a constant that corresponds to fixed parameters of the forward diffusion process [25]. The term Lk is the KL divergence between two Gaussian distributions, which can be computed in closed form as the squared error between two means Lk = Exk∼q (cid:20) 1 2σ2 k ∥ ̃μ(xk, x0) − μθ(xk, k)∥2 2 (cid:21) + C ′, (6) where C ′ is a constant independent of θ. Now we note the fact that predicting ˆxk−1 = μθ(xk, k) given xk is equivalent to predicting the noise ε that was added to xk−1 (see Equation 1). We can thus reformulate the problem as one of minimizing the error in the noise prediction. By parameterizing μθ(xk, k) as a function of predicted noise εθ(xk, k), we can simplify Equation 6 to Eq,ε∼N (0,I) (cid:2)ck(β1:K, σk)∥ε − εθ(xk, k)∥2 2 (cid:3) , (7) where ck(β1:K, σk) is a constant computed from the beta schedule for each timestep k. Ho et al. [25] further simplify this equation to arrive at the final loss that, with a slight abuse of notation, becomes Lsimple := Ek,x0,ε∼N (0,I) √ √ xk(x0, ε) := ̄αkx0 + 1 − ̄αkε, (cid:2)∥ε − εθ(xk(x0, ε), k)∥2 2 (cid:3) (8a) (8b) where k is sampled uniformly as k ∈ [1, K]. After training, we can generate a sample x0 by running the reverse diffusion process recursively from xK ∼ N (0, I) xk−1 = μθ∗ (xk, k) + σkz, (9) where z ∼ N (0, I) for k > 1, else z = 0. B. Diffusion model guidance for distribution transformation Consider generally the problem of transforming one dis- tribution Psrc onto another distribution Ptgt. This problem is challenging, because finding such a correspondence between distributions has an inherent dependence on the intrinsic geometrical match between the two distributions. However, there is an enticing shortcut that presents itself in the form of diffusion processes. In particular, we note that the forward diffusion process should allow us to map Psrc into a noise distribution Pnoise (i.e., zero-mean isotropic Gaussian noise). Drawing samples from this noise distribution, we can execute the reverse diffusion process to guide the sample to being drawn from Ptgt, assuming of course that the reverse process was trained on data samples from Ptgt. Although this diffusion process will ultimately take points xsrc from Psrc and map to samples drawn from Ptgt, resulting in ˆxtgt, it will do so in a destructive manner. In particular, as the forward diffusion process is applied to xsrc, the dis- tribution of these points becomes progressively more random (by design). In the end, its distribution reaches an isotropic Gaussian distribution, completely corrupting the information in the original sample. At this point, there is no relationship between the source points xsrc and the derived points ˆxtgt. We may as well have simply started from Gaussian noise and run reverse diffusion onto Ptgt. We would like to learn a transformation F : xsrc → ˆxtgt that preserves information. Such a transformation between distributions can be achieved by running the forward diffusion process on Psrc(x) partway through, up to k = ksw, followed by the reverse diffusion process for the same number of steps (ksw), in order to transform these partially diffused points onto Ptgt. Crucially, this process trades off the amount of information present in xsrc that is preserved as a result of forward diffusion, and the consistency (in terms of likelihood) of the sample generated via reverse diffusion with respect to the target distribution Ptgt (i.e., the distribution over desired behaviors). Very recently, Meng et al. [32] proposed a similar partial diffusion process for the task of generating realistic images based upon a user-provided sketch. The authors derive a bound on the distance between ˆxtgt and xsrc as follows.2 Assuming that ∥εθ(x, k)∥ ≤ K for all x ∈ X and k ∈ [0, K], then for all δ ∈ (0, 1) with probability at least (1 − δ), (Kσ2 ksw 2 ≤ σ2 ksw ∥xsrc − ˆxtgt∥2 + d + 2(cid:112)−d * log δ − 2 log δ), (10) where d is the dimensionality of x. From this bound, we can see that the distance between xsrc and ˆxtgt increases with ksw, since σksw increases with ksw while other terms are not affected. This expression allows us to bound the difference between the action generated by the assistant ˆxtgt and that of the user xsrc. Figure 2 visualizes this property in two dimensions. Here, temporarily ignoring state condition, samples from Puser (i.e., source distribution Psrc) form the shape of a triangle, and samples from Pdemo (i.e., target distribution Ptgt) follow a distribution with three modes, each centered on one of the vertices of a triangle. The black and blue arrow represents the idea of executing partial diffusion-running the forward (black) and reverse (blue) processes for ksw steps. At the bottom of Figure 2, we visualize the result of partial forward and reverse diffusion for different values of ksw. Here, we color points based on their original spatial location in Psrc (e.g., green points in the lower-right, red at the top, and blue at the lower-left), and track their location over different degrees of forward and reverse diffusion. Based on the visualization of the resulting distributions, we see that the distance between the initial points xsrc and ˆxtgt increases with ksw, consistent with Equation 10. More generally, we find that: When ksw is small • The original information is well-preserved (small dis- placements; high fidelity) • The obtained distribution is far from Ptgt (low conformity) When ksw is large • The original information is corrupted (large displace- ments; low fidelity) • The obtained distribution is close to Ptgt (high conformity) To discuss the effect of ksw independent of the number of diffusion steps K, we herein define the Forward Diffusion Ratio as γ := ksw/K, and will refer to this throughout the paper. A similar idea in diffusion models has been adopted in image generation, manipulation, and 3D geometry genera- tion [32, 50, 38, 52]. 2Their bound is for a variance exploding (VE) formulation of diffusion, whereas we employ DDPM that uses a variance preserving (VP) formulation. Despite the difference, they share the same mathematical intuition. Algorithm 1 Shared autonomy as partial diffusion Input: Observation st and pilot's action ah t Output: Shared action as t Require: A pretrained state-conditioned denoising model μθ∗ (a, k | s), forward diffusion ratio γ, diffusion timestep K 1: Compute the switching timestep ksw ← ToInteger(γK) 2: Sample a Gaussian noise ε ∼ N (0, I) 3: ̃ah 4: as 5: for k in ksw, . . . , 2 do 6: 7: 8: end for 9: as t,0 ← μθ(as 10: return as t,0 Sample a noise vector z ∼ N (0, I) as t,ksw ← t,ksw ← ̃ah t,k−1 ← μθ∗ (as ̄αksw ah t,ksw t,k, k | st) + σkz ▷ Forward process ▷ Reverse process 1 − ̄αksw ε t,1, 1 | st) t + √ √ C. Distribution transformation for shared autonomy t . The goal In a shared autonomy task, a copilot is asked to produce a shared action as t , given the current state st and the pilot's action ah to intervene in a manner that preserves the pilot's "intention" while correcting the action. However, formulating the pilot's "intention" is challenging, especially when the space of goals is unknown or not well-defined. is for the copilot Our algorithm assumes that the latent intent of the user has non-zero likelihood under the distribution over target behaviors that we learn to sample from using a diffusion model. In other words, if we have a finite set of demonstrations to train the diffusion model, the states or state-action pairs that a user would want to achieve need to exist in the demonstrations. With our formulation to shared autonomy, the copilot manages the trade-off between respecting pilot's action (i.e., fidelity to the pilot) and executing an action that is likely under the learned behavior distribution (i.e., conformity to the target behaviors). This is illustrated in Fig. 8, and it bears similarity to the trade-off discussed in Section II-B based on Figure 2. Now, given a state st, Puser in Figure 2 is an (unknown) distribution over pilot actions and Pdemo is a distribution over target behaviors where each point represents a single action. We can interpret that each cluster in Pdemo corresponds to a set of actions, each of which causes distinct transitions. Hence, each cluster can be thought of as a pilot's "intention", and the actions outside of the cluster as being undesirable. Considering the visualization of the different partially forward and reverse diffused distributions at the bottom of the figure, we see that as we increase γ from 0.0 to 1.0, most of the pilot's actions begin to go inside of the set of ideal actions. This captures the notion that conformity to the target behavior increases with γ. On the other hand, once γ exceeds 0.5, the displacement of pilot actions (signified by the mixture of colors) begin to enlarge, which is equivalent to the copilot producing an action that ignores the pilot's "intention". This captures the notion that the fidelity to the pilot decreases as we increase γ. Algorithm 1 summarizes the procedure of applying partial t and gen- t . In Section III, we investigate the forward and reverse diffusion to a pilot action as erating a shared action as (a) 2D Control (b) Lunar Lander (c) Lunar Reacher (d) Block Pushing Fig. 3: We evaluate our algorithm in the context of four shared autonomy environments including a (a) 2D Control task in which an agent navigates to one of two different goals, (b) Lunar Lander that tasks a drone with landing at a designated location, (c) a Lunar Reacher variant in which the objective is to reach a designated region in the environment, and (d) Block Pushing, in which the objective is to use a robot arm to push an object into one of two different goal regions. fidelity-conformity trade-off by modulating γ empirically for various environments with different pilots. III. EXPERIMENTS We evaluate our approach to shared autonomy by pairing our copilot with various pilots on a variety of simulated continuous control tasks (Fig. 3): 2D Control, Lunar Lander, Lunar Reacher and Block Pushing. Each of these tasks provide the opportunity for the pilot to execute one of several different behaviors that is not known to the copilot. We design each domain to include a randomly sampled target state the pilot intends to reach (herein referred to as the goal). For example, in Lunar Reacher, a goal location is sampled randomly above ground. Across all tasks, we reveal the goal only to the pilot, by including it as part of the state. The copilot never has access to the goal. This results in a scenario in which pilot's intention (i.e., the goal) is unknown to the copilot. We seek to answer the following questions: (1) How much can our copilot assist a pilot? (2) Does our copilot generalize to different pilots? and (3) What is the effect of the forward diffusion ratio γ, and how can we interpret it? A. Continuous control domains 1) 2D Control: We build a simple 2D continuous control domain based on the maze-2D environment in D4RL [18] built on the MuJoCo simulator [48], where the goal is located either at the lower-left or lower-right corners of the large open space (Fig. 3(a)). The agent is represented as a point mass, and the actions are 2D forces applied to itself. The state consists of the agent's location and velocity, as well as the goal location. Episodes are terminated if a timeout of 300 steps is reached. 2) Lunar Lander: Lunar Lander (Fig. 3(b)) is a continuous control environment adopted from Open AI Gym [7] that involves landing a spaceship on a landing pad. The actions consist of continuous left, right and upward forces that emulate thrusters on the spaceship. The state contains the position, orientation, linear and rotational velocity of the spaceship, whether each leg touches the ground, and the landing pad location (provided only to the pilot). An episode ends when the spaceship lands on the landing pad and becomes idle, crashes, flies out of bounds, or it reaches a timeout of 1000 steps. (a) γ = 0.0 (b) γ = 0.1 (c) γ = 0.2 (d) γ = 0.4 (e) γ = 0.6 (f) γ = 0.8 Fig. 4: A visualization of the resulting trajectories in the 2D Control environment for different settings for the forward diffusion ratio γ. The user's objective is to reach the left-hand goal. Without assistance (a) the user successfully reaches the goal two times, while the eight others timeout. As we increase γ, we see that (b)–(d) the user reaches the desired goal a vast majority of the time. As γ gets closer to 1.0, (e) (f) the assisted policy conforms to the expert policy, which avoids timeouts, but without knowledge of the user's goal distributes the trajectories evenly between the left and right goals. 3) Lunar Reacher: A variant of Lunar Lander adopted from previous work [43, 7], where the goal is not to land, but to reach a random target location above the ground (Fig. 3(c)). The setting otherwise matches that of Lunar Lander. 4) Block Pushing: A variant of the Simulated Pushing environment [17]. The environment (Fig. 3(d)) consists of a simulated six-DoF robot xArm6 in PyBullet [9] equipped with a small cylindrical end effector. The task is to push an object into one of two target zones in the robot's workspace. The episode terminates when the target reaches one of the two locations or the number of steps exceeds a timeout of 100. left: 2 right: 0 timeout: 8left: 8 right: 1 timeout: 1left: 10 right: 0 timeout: 0left: 8 right: 2 timeout: 0left: 5 right: 5 timeout: 0left: 5 right: 5 timeout: 0 TABLE I: Success and crash/out-of-bounds (OOB) rates on Lunar Lander and Lunar Reacher for different pilots with (γ = 0.4) and without assistance. Each entry corresponds to 10 episodes across 30 random seeds. Note that the Zero and Random pilots have no knowledge of the goal. Lunar Lander Lunar Reacher Pilot Noisy Laggy Success Rate ↑ Crash/OOB Rate ↓ Success Rate ↑ Crash/OOB Rate ↓ w/o Copilot w/ Copilot w/o Copilot w/ Copilot w/o Copilot w/ Copilot w/o Copilot w/ Copilot 20.67 ± 4.50 21.33 ± 2.05 68.00±5.35 75.00±3.56 28.33 ± 2.62 76.67 ± 2.49 7.67±2.87 9.67±3.86 14.33 ± 2.49 30.67 ± 5.56 45.33±3.30 55.33±6.13 77.33 ± 3.09 69.33 ± 5.56 38.00±2.94 31.33±2.87 Zero Random Expert 0.00 ± 0.00 0.00 ± 0.00 77.67 ± 2.62 27.00 ± 0.82 25.00 ± 4.32 78.67 ± 2.87 100.00 ± 0.00 100.00 ± 0.00 12.33 ± 0.94 19.00 ± 2.94 19.33 ± 5.25 8.00 ± 1.63 0.00 ± 0.00 4.33 ± 1.89 49.33 ± 4.78 19.67 ± 2.62 22.33 ± 2.87 55.00 ± 2.16 100.00 ± 0.00 95.33 ± 1.70 44.00 ± 3.56 58.33 ± 3.09 59.00 ± 0.82 31.67 ± 2.87 (a) Noisy Pilot (b) Laggy Pilot (a) Noisy Pilot (b) Laggy Pilot Fig. 6: The rates of block pushing task to terminate at correct goal, wrong goal or timeout with (c) noisy and (d) laggy pilot. The dashed blue line denotes the rate at which an expert policy reaches the correct goal, while the dotted blue line denotes the same rate for our model with full-diffusion (γ = 1.0). (Eqn. 8). The details of the model architecture are described in Appendix A. As we hide a goal from our copilot, we remove goal locations from each observation prior to training. The following experiments use a single diffusion model trained separately for each task. We note that the copilot's behavior changes only according to γ given a diffusion model. To collect demonstrations, we first train an expert policy with soft actor-critic [23] for 3M timesteps in Lunar Lander and Lunar Reacher, and 1M timesteps in Block Pushing. We then roll out the policies in each environment to collect demonstrations of state-action pairs Dexpert for various goals. Appendix A details the model architecture and the hyperpa- rameter settings. C. Surrogate pilots for evaluation Our method does not require access to a pilot (surrogate or otherwise) when training the copilot. However, surrogate pilots are useful when we want to perform a large number of evaluations in a reproducible manner. Thus, we prepare two surrogate pilots consistent with previous work [39, 43]: a Laggy pilot and a Noisy pilot, both of which are corrupted versions of a single expert. At each time step, the Laggy pilot repeats its previous action with probability plaggy, and otherwise executes an action drawn from the expert's policy. (c) Noisy Pilot (d) Laggy Pilot Fig. 5: Success (higher is better), floating, and crash (lower is better) rates for Lunar Lander (top) and Lunar reacher (bottom) with (a) (c) noisy and (b) (d) laggy pilots. The dashed blue line denotes the success rate of an expert policy, while the dotted blue line denotes the success rate of our model with full-diffusion (γ = 1.0). The position and orientation of the block and end effector are randomly initialized at the start of each episode, while the target locations are fixed. B. Training To understand the pilot's intent, our copilot relies on a state- conditioned diffusion model pθ(at|st). This diffusion model is trained as follows. First, we collect expert demonstrations, each containing a sequence of goal-embedded state-action pairs for each domain, where the goal is randomly sampled at each episode. We then use the resulting demonstrations to train a state-conditioned diffusion model using the DDPM loss 0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 0204060801000.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 0204060801000.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100 TABLE II: Correct goal and timeout rates on the Block Pushing task for different pilots with (γ = 0.2) and without assistance. Each entry corresponds to 10 episodes across 30 random seeds. Note that the Zero and Random pilots have no knowledge of the goal. Pilot Noisy Laggy Correct Goal Rate ↑ Timeout Rate ↓ w/o Copilot w/ Copilot w/o Copilot w/ Copilot 62.33 ± 2.49 75.67±2.05 42.00 ± 4.90 74.33±2.87 37.33 ± 2.05 20.00±3.27 58.00 ± 4.90 21.33±4.50 0.00 ± 0.00 Zero Random 0.00 ± 0.00 99.00 ± 0.82 Expert 40.67 ± 2.62 100.00 ± 0.00 6.67 ± 1.70 16.33 ± 3.09 100.00 ± 0.00 68.00 ± 1.63 5.33 ± 2.05 94.67 ± 2.05 1.00 ± 0.82 With probability pnoisy, the Noisy pilot samples an action from a uniform distribution over the action space, and otherwise executes an action sampled from the expert policy. We evaluate our shared autonomy algorithm for pilots across a broad range of parameters pnoisy and plaggy. Due to space constraints, we only include results for a representative subset of the pilot parameters for Lunar Lander (plaggy = 0.85, pnoisy = 0.3), Lunar Reacher (plaggy = 0.85, pnoisy = 0.6), and Block Pushing (plaggy = pnoisy = 0.6), but include results for the full range of pilot parameters in Figures 9–14 of Appendix B. D. Various pilots with our copilot We evaluate our copilot with various surrogate pilots in all four environments. Table I shows success and crash/out-of- bound rates when various pilots are paired with our copilot in Lunar Lander and Lunar Reacher. We see that adopting our copilot significantly improves the success and crash rates for all but the expert policy (as expected). We note that each task involves reaching or landing on a randomly sampled target that is not known to the copilot. Consequently, one can not expect the copilot to have significant effect on the success rate of the Random or Zero pilot. Nevertheless, the results show that our copilot improves their success rates with performance similar to that of full diffusion (γ = 1.0) and significantly decreases the rate at which the pilots crash. For the Block Pushing task, the Laggy and Noisy policy are based on an expert whose intent is always to push the block to the green zone, which we refer to as the correct goal. The set of state-action pairs on which we trained the diffusion model also include trajectories that reach the red zone. As such, without knowledge of the pilot's goal, the copilot may generate actions that push the block into the red zone (referred to as the incorrect goal), causing the episode to terminate. As we see in Table II, our copilot improves the rate at which all but an expert pilot reach the correct goal, while decreasing the rate at which episodes timeout without reaching any goal. E. The effects of the forward diffusion ratio γ The forward diffusion ratio γ determines how many steps of forward diffusion process to apply on pilot's action ah t . This value changes the balance of interpolating between source and target distributions, which in turn controls the trade-off between fidelity and conformity of an action. In this section, we demonstrate this trade-off with different γ values in various environments. We deployed our copilot with various surrogate pilots as discussed in Section III-C for each γ value. Figure 4 shows the effect of γ for the 2D Control domain. Although the copilot is trained on demonstrations for both goals, the pilot's goal is fixed to the left. As γ increases, we see that the number of trajectories that reach the correct goal increases. Qualitatively, we also see that the stochasticity of the trajectories lessens, and the paths towards the goal become smoother. However, when γ is too high, the copilot ignores the pilot's actions. Without knowledge of the pilot's goal, the copilot ends up distributing trajectories evenly between the left and right goals, consistent with the set of trajectories on which the model was trained. Figures 5 summarizes the results on Lunar Lander and Lunar Reacher, respectively, by categorizing the trajectories into success, crash and float. Here, float denotes a trajectory where the spaceship does not crash nor go out of bounds, but nevertheless fails to complete the task within the time limit. In all cases, we observe that the success rate follows a distinct pattern. First, the success rate monotonically increases with γ as the copilot improves task performance. After reaching a peak success rate at a critical value of γ, the success rate gradually decreases. The drop in the success rate reflects the copilots infidelity to the user's intent. The pilot's original actions provide a signal of which goal or landing pad is correct. When γ is too large, the copilot totally ignores the pilot's actions and instead chooses to land in a manner following the copilot's original training distribution. In general, the crash rate monotonically decreases with γ, with the exception of Lunar Reacher. This demonstrates that the quality of the generated actions improves as γ increases. In Lunar Reacher, many of the demonstrations go straight to a target, which is often placed at the edge of the the environment. Consequently, if the agent overshoots and misses the target, it is very likely that it will go out of bounds, which is counted as a crash. This is likely why increasing γ does not necessarily result in lower crash rates for Lunar Reacher. F. Real Human User Experiments We conducted a set of human user experiments involving the Lunar Lander and Lunar Reacher continuous control domains. For the experiments, we recruited 17 participants (9 who identified as male, and 8 as female, with an average age of 25).3 We asked each user to interact with one of two different co-pilots within each episode, one corresponding to direct teleoperation (i.e., no assistance) and the other being our diffusion-based shared autonomy assistant. The identity of the co-pilot was not disclosed to the participant. At the beginning of each experiment, we allowed the user to practice for 10 episodes with each co-pilot. In the subsequent testing phase, the user controlled the system for another 10 episodes 3None of the participants were co-authors or otherwise involved in this research. with each of the co-pilots. We conducted this experiment for both Lunar Lander and Lunar Reacher and emphasize that the location of the goal (the landing pad for Lunar Lander and goal region for Lunar Reacher) was chosen randomly from the continuous space of goals for each episode. TABLE III: Success, crash/out-of-bounds (OOB), and float rates on Lunar Lander and Lunar Reacher for human user experiments. Lunar Lander Lunar Reacher Success Rate ↑ Crash Rate ↓ w/o Copilot w/ Copilot 1.76 32.35 98.24 61.18 Float Rate 0.00 6.47 Success Rate ↑ Crash Rate ↓ 17.06 34.71 82.94 65.29 Float Rate 0.00 0.00 We consider both the quantitative and qualitative perfor- mance of our shared autonomy algorithm. Quantitatively, Table III compares the average performance of human pilots on Lunar Lander and Lunar Reacher in terms of success, crash/out-of-bounds, and float (i.e., neither crashing, going out-of-bounds, nor succeeding) with and without the assistance of our diffusion-based shared autonomy. We performed a Welch t-test for the success rate of each participant and find p-values of p = 3.363 × 10−7 for Lunar Lander and p = 9.033 × 10−3 for Lunar Reacher, based on which we can reject the null hypothesis that our diffusion-based co-pilot does not improve success rate. Qualitatively, we asked participants to rate their agreement with five statements about whether they felt that each co- pilot behaved in a manner that was "helpful", "consistent", "responsive", "collaborative", and "trustworthy" using a five- point Likert scale. Figure 15 in Appendix C visualizes the survey results for all four combinations of tasks and co-pilots. The results reveal that human users rated our shared autonomy co-pilot higher than the no-assistance co-pilot (i.e., teleopera- tion) with regards to all five qualities for both environments. G. Real-Robot Experiments We consider an real-world task (Fig. 7) in which a user commands a UR5 manipulator equipped with a pinch gripper to place a donut-shaped object (e.g., a disk with a hole in the center) held by the robot onto one of two posts in the robot's workspace (e.g., analogous to Towers of Hanoi, but with two poles and one disk). Emulating remote operation, the user observes a real-time (i.e., little-to-no latency) video feed of the robot and its workspace from a third-person view. The user controls the three-dimensional velocity of the end- effector in Cartesian space using a game controller with two joysticks (velocity in the x− and y−directions using the right joystick, and the z-direction using the left joystick). The arm position is initialized to a random location. As in the human user experiments discussed above, we presented the user with two unidentified co-pilots, one being our diffusion-based shared autonomy assistant and the other being direct teleoperation (i.e., no assistance). We allowed Fig. 7: The real-robot experiments involved (left) placing a disk on one of two posts. Human operators (right) controlled the 3D motion of the end-effector while observing images of the robot's workspace streamed in real-time. TABLE IV: Success rate and episode length with and without copilot for the real-robot experiment with human users. success rate ↑ w/o Copilot w/ Copilot 0.89 1.00 episode length ↓ 209.23 ± 83.71 143.66 ± 68.42 each user to practice with each co-pilot for three episodes. In the subsequent testing phase, participants controlled the arm using both interfaces for five episodes each. We made sure to use the same set of (random) initial arm positions for both test phases. We set the time limit to be 500 steps (where each velocity command is considered a single step), and treat any episode that exceeds this limit as a failure. After the testing phase, we asked each participant to rate their agreement with the same quantitative questions in the same manner as the Lunar Lander and Lunar Reacher experiments using a five- point Likert scale. We recruited 14 participants (10 who identified as male, 4 who identified as female, average age of 27.7)4 for human user experiments with the real robot. Table IV shows the success rate and episode length that users took to reach the goal. We found that providing users with the assistance of our diffusion-based shared autonomy algorithm both improved their success rate and decreased the time required to complete the task. The results of the qualitative evaluation reveal that users preferred commanding the manipulator with the assistance of our algorithm as detailed in Appendix C. IV. RELATED WORK Shared autonomy has appeared in many problem domains, including remote telepresense [11, 21, 41], assistive robotic manipulation [29, 34, 44], and assistive navigation [4, 20]. In 4None of the participants were co-authors or otherwise involved in this research. shared autonomy, one of the most persistent challenges has been correctly identifying the pilot's intentions or goals. Early work sidesteps this challenge by assuming a priori knowledge of the pilot's goals [10, 30]. Recent work has managed to relax this assumption by treating the pilot's goal as a latent random variable which can be inferred from environ- mental observations and pilot actions [1, 6, 14, 26, 28, 30, 33, 37, 53]. In spite of this forward progress, these methods still assume knowledge about some combination of the transition dynamics, the pilot's goals, or pilot's policy, making them difficult to deploy in many unstructured scenarios. Reddy et al. [39], and subsequently [47, 43] introduce model-free deep reinforcement learning (RL) to the shared autonomy setting. Because these methods are model free, knowledge of environment dynamics is no longer required, allowing one to train a policy that is not limited to a specific model class. Several follow up works have adapted deep RL to a variety of shared autonomy problems [15, 40, 35, 8]. To the best of our knowledge, all previous work on shared autonomy with deep RL either explicitly or implicitly assumes a human-in-the-loop setting. In particular, the main training loop typically contains a step to query a pilot (i.e., human user) to obtain its action. This constraint often makes training inefficient or impractical. Chen et al. [8] addresses this issue by proposing a two-phase training scheme. In the first phrase, an autonomous agent learns a task-conditioned policy that can be helpful for assisting a pilot. This is followed by the second phase, which incorporates sparse feedback from humans. Although such approach improves the efficiency of the training pipeline, it does not change the fact that these methods inherently rely on human feedback. image editing, Diffusion models [45] have recently been applied to many problems including image generation, text- conditioned image generation and video generation. In the field of robotics, Janner et al. [27] trained a diffusion model over trajectories, demonstrating that diffusion is capable of generating a diverse set of trajectories reaching a goal loca- tion. Pearce et al. [36] applies diffusion models to imitation learning. Meanwhile, Wang et al. [51] show that the policy parameterized with diffusion can generate a multi-modal dis- tributions over possible actions. As far as we are aware, ours is the first approach that uses diffusion models in a shared control scenario, where a copilot learns from expert demonstrations and provides guidance by denoising noisy pilot action. The core idea of our approach is in the partial forward and reverse diffusion that enables us to generate an output that effectively interpolates between the original input and one from target distribution that we train our diffusion models on. Although we independently came up with this idea, a others have explored a similar approach for image editing [32]. Related, many recent papers have consider running reverse dif- fusion from some intermediate step rather than pure Gaussian noise [31, 50, 38, 52], as we do in this paper. V. CONCLUSION In this paper, we presented a new approach to shared autonomy based on diffusion models. Our approach only requires access to demonstrations that are representative of desired behavior, and does not assume access to or knowledge of the user's policy, reward feedback, or knowledge of the goal space or environment dynamics. Integral to our approach is its modulation of the forward and reverse diffusion pro- cesses in a manner that seeks to balance the user's desire to maintain control authority with the benefits of generating actions that are consistent with the distribution over desired behaviors. We evaluated our copilot on various continuous control environments and demonstrated that our diffusion- based copilot generalizes across a variety of pilots, improving their performance, while preserving their intention. We further presented an analysis of the effects of different degrees of partial diffusion on task performance. One limitation of our approach is that there is no component that explicitly addresses the likely mismatch in state distributions between Ppilot(s) and Ptarget(s). Intuitively, the target state visitation distribution (i.e., expert demonstrations) is different from that of the pilot. However, our empirical results suggest that this is not a critical limitation, possibly because executing corrected actions tends to encourage the agent to visit states that are close to those visited as part of the expert demonstrations. One means of addressing this is to design a goal-conditioned policy that can navigate itself to an in- distribution state at test time. We leave this for a future work. is very likely that it ACKNOWLEDGMENTS Ge Yang is supported by the National Science Foundation Institute for Artificial Intelligence and Fundamental Interac- tions (IAIFI, https://iaifi.org/) under the Cooperative Agree- ment PHY-2019786. This work was supported in part by ARO grant W911NF-17-1-0188 and NSF HDR TRIPODS grant 2216899. We would like to thank the members of the TTIC robotics group for insightful discussions. We also appreciate the conversations we had with Haochen Wang. His in-depth knowledge of diffusion models was invaluable to us. REFERENCES [1] Daniel Aarno, Staffan Ekvall, and Danica Kragic. Adap- tive virtual fixtures for machine-assisted teleoperation In Proceedings of the IEEE International Con- tasks. ference on Robotics and Automation (ICRA), 2005. [2] David A Abbink, Tom Carlson, Mark Mulder, Joost C.F. de Winter, Farzad Aminravan, Tricia L. Gibo, and Er- win R Boer. A topology of shared control systems- finding common ground in diversity. IEEE Transactions on Human-Machine Systems, 48(5), 2018. [3] Peter Aigner and Brenan McCarragher. Human inte- gration into robot control utilising potential fields. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), 1997. [4] Brenna D. Argall. Modular and adaptive wheelchair au- tomation. In Proceedings of the International Symposium on Experimental Robotics (ISER), 2016. [5] Gideon Billings, Matthew R. Walter, Oscar Pizarro, Matthew Johnson-Roberson, and Richard Camilli. To- wards automated sample collection and return in arXiv preprint extreme underwater environments. arXiv:2112.15127, 2021. [6] Alexander Broad, Todd Murphey, and Brenna Argall. Highly parallelized data-driven MPC for minimal in- In Proceedings of Robotics: tervention shared control. Science and Systems (RSS), 2019. [7] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym, 2016. [8] Sean Chen, Jensen Gao, Siddharth Reddy, Glen Berseth, Anca D. Dragan, and Sergey Levine. ASHA: Assistive teleoperation via human-in-the-loop reinforcement learn- ing. arXiv preprint arXiv:2202.02465, 2022. [9] Erwin Coumans and Yunfei Bai. PyBullet, a Python module for physics simulation for games, robotics and machine learning. http://pybullet.org, 2016–2021. [10] Jacob W. Crandall and Michael A. Goodrich. Character- izing efficiency of human robot interaction: A case study In Proceedings of the of shared-control teleoperation. IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2002. [11] Thomas Debus, Jeffrey Stoll, Robert D. Howe, and Pierre Dupont. Cooperative human and machine perception In Proceedings of the Inter- in teleoperated assembly. national Symposium on Experimental Robotics (ISER), 2000. [12] Prafulla Dhariwal and Alexander Nichol. Diffusion models beat GANs on image synthesis. In Advances in Neural Information Processing Systems (NeurIPS), 2021. [13] Anca D. Dragan and Siddhartha S. Srinivasa. Formaliz- ing assistive teleoperation. In Proceedings of Robotics: Science and Systems (RSS), 2012. [14] Anca D. Dragan and Siddhartha S. Srinivasa. A policy- International blending formalism for shared control. Journal of Robotics Research, 32(7), 2013. [15] Yuqing Du, Stas Tiomkin, Emre Kiciman, Daniel Polani, Pieter Abbeel, and Anca Dragan. AvE: Assistance In Advances in Neural Information via empowerment. Processing Systems (NeurIPS), 2020. [16] Charles Dugas, Yoshua Bengio, Franc ̧ois B ́elisle, Claude Nadeau, and Ren ́e Garcia. Incorporating second-order functional knowledge for better option pricing. In Advances in Neural Information Processing Systems (NeurIPS), 2000. [17] Pete Florence, Corey Lynch, Andy Zeng, Oscar Ramirez, Ayzaan Wahid, Laura Downs, Adrian Wong, Johnny Implicit Lee, Igor Mordatch, and Jonathan Tompson. behavioral cloning. In Proceedings of the Conference on Robot Learning (CoRL), 2021. and Sergey Levine. data-driven reinforcement arXiv:2004.07219, 2020. D4RL: Datasets learning. for deep arXiv preprint [19] Cristian Garcia. Denoising diffusion probabilistic mod- els, 2021. URL https://github.com/acids-ircam/diffusion models. Online. [20] Mahmoud Ghorbel, Joelle Pineau, Richard Gourdeau, Shervin Javdani, and Siddhartha Srinivasa. A decision- theoretic approach for the collaborative control of a smart wheelchair. International Journal of Robotics Research, 10:131–145, 2017. [21] Ray C. Goertz. Manipulators used for handling radioac- tive materials. Human Factors in Technology, 1963. [22] Matthew C Gombolay, Reymundo A Gutierrez, Gian- carlo F Sturla, and Julie A Shah. Decision-making au- thority, team efficiency and human worker satisfaction in mixed human-robot teams. In Proceedings of Robotics: Science and Systems (RSS), 2014. [23] Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. CoRR, abs/1801.01290, 2018. [24] Kris Hauser. Recognition, prediction, and planning for assisted teleoperation of freeform tasks. Autonomous Robots, 35(4), 2013. [25] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. CoRR, abs/2006.11239, 2020. [26] Guy Hoffman and Cynthia Breazeal. Effects of anticipa- tory action on human-robot teamwork efficiency, fluency, and perception of team. In Proceedings of the ACM/IEEE International Conference on Human-Robot Interaction (HRI), 2007. [27] Michael Janner, Yilun Du, Joshua Tenenbaum, and Sergey Levine. Planning with diffusion for flexible behavior synthesis. In Proceedings of the International Conference on Machine Learning (ICML), 2022. [28] Shervin Javdani, Siddhartha S. Srinivasa, and J. Andrew Bagnell. Shared autonomy via hindsight optimization. In Proceedings of Robotics: Science and Systems (RSS), 2015. [29] Hyun K. Kim, J. Biggs, W. Schloerb, M. Carmena, Mikhail A. Lebedev, Miguel A.L. Nicolelis, and Man- dayam A. Srinivasan. Continuous shared control for stabilizing reaching and grasping with brain-machine in- terfaces. IEEE Transactions on Biomedical Engineering, 53(6), 2006. [30] Jonathan Kofman, Xianghai Wu, Timothy J Luu, and Sid- dharth Verma. Teleoperation of a robot manipulator using a vision-based human-robot interface. IEEE Transactions on Industrial Electronics, 52(5), 2005. [31] Zhaoyang Lyu, Xu Xudong, Ceyuan Yang, Dahua Lin, and Bo Dai. Accelerating diffusion models via arXiv preprint early stop of the diffusion process. arXiv:2205.12524, 2022. [18] Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, [32] Chenlin Meng, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. SDEdit: Image syn- thesis and editing with stochastic differential equations. arXiv preprint arXiv:2108.01073, 2021. [33] Katharina Muelling, Abdeslam Boularias, Betty Mohler, Bernhard Sch ̈olkopf, and Jan Peters. Learning strategies in table tennis using inverse reinforcement learning. Biological Cybernetics, 108(5), 2014. [34] Katharina Muelling, Arun Venkatraman, Jean-Sebastien Valois, John E. Downey, Jeffrey Weiss, Shervin Jav- dani, Martial Hebert, Andrew B. Schwartz, Jennifer L. Collinger, and J. Andrew Bagnell. Autonomy infused teleoperation with application to brain computer interface Autonomous Robots, 41(6), controlled manipulation. August 2017. [35] Yoojin Oh, Marc Toussaint, and Jim Mainprice. Learning to arbitrate human and robot control using disagreement between sub-policies. arXiv preprint arXiv:2108.10634, 2021. [36] Tim Pearce, Tabish Rashid, Anssi Kanervisto, Dave Bignell, Mingfei Sun, Raluca Georgescu, Sergio Valcar- cel Macua, Shan Zheng Tan, Ida Momennejad, Katja Hofmann, and Sam Devlin. Imitating human behaviour In Proceedings of the Interna- with diffusion models. tional Conference on Learning Representations (ICLR), 2023. [37] Claudia P ́erez-D'Arpino and Julie A Shah. Fast target prediction of human reaching motion for cooperative human-robot manipulation tasks using time series clas- In Proceedings of the IEEE International sification. Conference on Robotics and Automation (ICRA), 2015. [38] Ben Poole, Ajay Jain, Jonathan T. Barron, and Ben Mildenhall. DreamFusion: Text-to-3D using 2D diffu- sion. arXiv preprint arXiv:2209.14988, 2022. [39] Siddharth Reddy, Anca Dragan, and Sergey Levine. Shared autonomy via deep reinforcement learning. In Proceedings of Robotics: Science and Systems (RSS), 2018. [40] Siddharth Reddy, Sergey Levine, and Anca D. Dra- gan. First contact: Unsupervised human-machine co- adaptation via mutual information maximization. arXiv preprint arXiv:2205.12381, 2022. [41] Louis B. Rosenberg. Virtual fixtures: Perceptual tools for telerobotic manipulation. In Proceedings of the Virtual Reality Annual International Symposium (VRAIS), 1993. [42] Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi, Rapha Gontijo Lopes, et al. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022. [43] Charles Schaff and Matthew R. Walter. Residual pol- In Proceedings of icy learning for shared autonomy. Robotics: Science and Systems (RSS), 2020. [45] Jascha [44] Sebastian Schr ̈oer, Ingo Killmann, Barbara Frank, Martin V ̈olker, Lukas Fiederer, Tonio Ball, and Wolfram Bur- gard. An autonomous robotic assistant for drinking. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), 2015. Sohl-Dickstein, Eric and Surya Ganguli. using Niru Deep nonequilibrium In Proceedings of the International Maheswaranathan, unsupervised thermodynamics. Conference on Machine Learning (ICML), 2015. [46] Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems (NeurIPS), 2019. learning Weiss, [47] Weihao Tan, David Koleczek, Siddhant Pradhan, Nicholas Perello, Vivek Chettiar, Vishal Rohra, Aaslesha Rajaram, Soundararajan Srinivasan, H. M. Sajjad Hos- sain, and Yash Chandak. On optimizing interventions in shared autonomy. arXiv preprint arXiv:2112.09169, 2021. [48] Emanuel Todorov, Tom Erez, and Yuval Tassa. Mu- JoCo: A physics engine for model-based control. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2012. [49] Pascal Vincent. A connection between score matching and denoising autoencoders. Neural Computation, 23(7): 1661–1674, 2011. [50] Haochen Wang, Xiaodan Du, Jiahao Li, Raymond A. Yeh, and Greg Shakhnarovich. Score Jacobian chaining: Lifting pretrained 2D diffusion models for 3D generation. arXiv preprint arXiv:2212.00774, 2022. [51] Zhendong Wang, Jonathan J Hunt, and Mingyuan Zhou. Diffusion policies as an expressive policy class for offline reinforcement learning. arXiv preprint arXiv:2208.06193, 2022. [52] Wang Yinhuai, Yu Jiwen, and Zhang Jian. Zero shot image restoration using denoising diffusion null-space model. arXiv preprint arXiv:2212.00490, 2022. [53] Wentao Yu, Redwan Alqasemi, Rajiv Dubey, and Norali Pernalete. Telemanipulation assistance based on mo- In Proceedings of the IEEE tion intention recognition. International Conference on Robotics and Automation (ICRA), 2005. APPENDIX A MODEL ARCHITECTURE AND HYPERPARAMETERS We implement the state-conditioned denoising network εθ(at, k | st) that makes up the diffusion model as a 4- layer multi-layer perceptron (MLP) with latent dimension hdim = 128 and softplus [16] activation after every layer except for the last one. The network outputs a vector that has same dimension as in the input. Each layer is conditioned on a diffusion timestep k that looks up a corresponding embedding with dimension hdim = 128, and is subsequently fused with the output of the linear layer by an element-wise product. To accommodate its conditioning on st, our denoising network works on a concatenation of state-action pairs (st, at), and during training, we add Gaussian noise only to the action component to produce a target output. The input x and the target y are then follow as x = (st, at + ε), ε ∼ N (0, I) y = (0, ε). (11a) (11b) We generate the set of demonstrations used to train our diffusion model by collecting 100k transitions for each goal in the 2D Control environment using the scripted expert policy provided in the original implementation [18], 3M transitions for each goal in the Block Pushing environment using the pretrained expert, and 10M transitions for Lunar Lander and Lunar Reacher using the corresponding pretrained expert. When we collect expert demonstrations, we filter out episodes that do not succeed, effectively making the quality of the demonstrations better than the original expert. This explains why the assisted expert often performs better than the expert (e.g., Table I-Lunar Reacher). We use a publicly available implementation of DDPM [19]. For the sake of faster action generation, we set the number of diffusion steps to K = 50, and use settings of βmin = 10−4 and βmax = 0.26 with sigmoid scheduling. An implementation of our method as source code to- gether with video demonstrations are available at https:// diffusion-for-shared-autonomy.github.io/. APPENDIX B EFFECT OF γ FOR DIFFERENT SURROGATE PILOTS Our framework modulates the amount of forward and reverse diffusion as a means of trading off a user's desire to maintain control authority with the general benefits that come with emulating behavior that may be seen as more desirable. Figure 8 provides a visualization of how the forward diffusion ratio may influence the "fidelity" of the diffused state-conditioned action with respect to the user's input and the extent to which it "conforms" to the desirable behavior. As discussed in Section III-C, we investigate the effec- tiveness of our shared autonomy algorithm when used in conjunction with pilots that seek to emulate the deficiencies typical of human control. Following previous work [39, 43], we employ two surrogate policies for evaluation, namely a Laggy pilot and a Noisy pilot, both of which are corrupted versions of a single expert. Fig. 8: Our algorithm uses the forward diffusion ratio γ to regulate the extent of forward and reverse diffusion. When γ is small, the assistant generates actions nearly identical to those of the user (i.e., high fidelity) but may be far from the desired behaviors (i.e., low conformity). Depending on the competency of the user, these actions may result in poor task performance (e.g., due to crashes). As with standard diffusion, when γ is large, the assistant will generate actions that have high likelihood under the distribution over desired behavior (i.e., high conformity), with little-to-no regard for their similar- ity to the user's actions (i.e., low fidelity). While these actions will be safe, they will likely result in poor performance since the forward process has removed any information about user's intention. By controlling γ, our algorithm identifies a regime that trades off between fidelity and conformity to generate actions that preserve the user's intent and, in turn, the critical information to complete the task. At each time step, with probability pnoisy, the Noisy pilot samples an action from a uniform distribution over the action space, and otherwise executes an action sampled from the expert policy. Similarly, the Laggy pilot repeats its previous action at each timestep with probability plaggy, and otherwise carries out an action drawn from the expert policy. We evaluate our shared autonomy algorithm for pilots with a broad range of different parameters pnoisy ∈ {0.2, 0.3, . . . , 0.8, 0.9} and plaggy ∈ {0.2, 0.3, . . . , 0.8, 0.9} for Lunar Lander, Lunar Reacher, and Block Pushing. A. Lunar Lander and Lunar Reacher Figure 9 plots the effect of different settings for the forward diffusion ratio γ in terms of success, crash, and float rates on Lunar Lander for different parameterizations of the Noisy pilot. At the smallest noise setting pnoisy = 0.2, the Noisy pilot is not significantly worse than the expert pilot without assistance (γ = 0.0). The Noisy pilot successfully lands the goal approximately 66% of the time compared to at approximately 78% for the expert pilot, and crashes (or goes out of bounds) approximately 19% of the time compared to approximately 12% for the expert pilot. As the noise level the performance of the noisy pilot significantly increases, 01Forward DiffusionRatio: γFidelityConformityPerformance (a) pnoise = 0.2 (b) pnoise = 0.3 (c) pnoise = 0.4 (d) pnoise = 0.5 (e) pnoise = 0.6 (f) pnoise = 0.7 (g) pnoise = 0.8 (h) pnoise = 0.9 Fig. 9: Lunar Lander Performance as a function of the forward diffusion ratio γ for a noisy pilot with noise values ranging from (a) pnoisy = 0.2 to (h) pnoisy = 0.9. In all plots, the dashed blue line denotes the success rate of the expert pilot, while the dotted blue line is the success rate of our model when performing "full" diffusion (i.e., γ = 1.0) on an action sampled from a zero-mean isotropic Gaussian distribution, which we refer to as a "Random" pilot in the paper. deteriorates without assistance-the pilot rarely lands and instead either crashes (or goes out-of-bounds) or floats around until the episode times out. However, for each parameterization of the Noisy pilot, we see that the assistance of the copilot gives rise to a noticeable increase in task success rate and decrease in crash rate as we increase the forward diffusion ration to γ = 0.4. As the forward diffusion ratio increases further, the success rate decreases as expected given that the copilot does not have knowledge of the goal (i.e., the landing location). In this case, the copilot chooses actions that are consistent with the different goals that one or more previous experts reached. At the same time, we see only a slight or no increase in the crash rate as the forward diffusion ratio increases, particularly for pilots with higher noise settings. Figure 10 presents the results for the same set of exper- iments on Lunar Lander with different parameterizations of the Laggy pilot. Consistent with previous work [39], Lunar Lander and, as we will see, Lunar Reacher are more tolerant of repeated actions than they are of noisy actions. Consequently, the performance of Laggy Pilots is only slightly worse than that of an expert pilot until plaggy exceeds 0.8. As with the Noisy pilot, we see that providing a Laggy pilot with the assistance of a copilot increases the task success rate, while decreasing the crash rate up to a forward diffusion ration of γ = 0.4 for all parameterizations of the Laggy pilot. Increasing the forward diffusion ratio beyond γ = 0.4 decreases the success rate since the copilot does not have access to the pilot's goal, while the crash rate increases only slightly. Figure 11 plots the performance of a Noisy pilot on Lunar Reacher for different noise settings. As with Lunar Lander, the success rate of the unassisted Noisy pilot is similar to that of the expert pilot when pnoisy is low, yet for pnoisy ≥ 0.6 the success rate is below 20% and the pilot often goes out- of-bounds as indicated by the high crash rate. Again, we see that the assistance of a copilot increases the task success rate while decreasing the crash rate with a clear peak at γ = 0.4 for all but the highest noise settings, for which performance only changes slightly as γ approaches 1.0. Again, this decrease in success rate is expected since without access to the region that the pilot is attempting to reach, the copilot chooses actions that are consistent with the set of expert demonstrations on which the diffusion model was trained. Figure 12 plots the performance of the Laggy pilot on the Lunar Reacher task for different settings of plaggy. Similar to Lunar Lander, we find that Lunar Reacher is tolerant of an otherwise (near-)expert policy that randomly repeats its previous actions. Due to the nature of the task, the success rate of the Laggy Pilot is only slightly worse than that of the expert until plaggy exceeds 0.8. For all parameterizations of the Laggy pilot, we see that the assistance of a copilot with γ = 0.4 decreases the crash rate, while simultaneously maintaining or, in the case of plaggy ≥ 0.8, increasing the success rate. Table V expands upon the analysis presented in Table I and makes explicit the effect of different settings for the forward diffusion ratio between γ = 0.0 (no assistance), our chosen setting of γ = 0.4, and to γ = 1.0 (full assistance) when paired with different pilots. Consistent with the plots in Figures 9– 12, setting the forward diffusion ratio to γ = 1.0 results in similar performance across all pilots both in terms of success 0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash (a) plaggy = 0.2 (b) plaggy = 0.3 (c) plaggy = 0.4 (d) plaggy = 0.5 (e) plaggy = 0.6 (f) plaggy = 0.7 (g) plaggy = 0.8 (h) plaggy = 0.9 Fig. 10: Lunar Lander performance as a function of the forward diffusion ratio γ for a laggy pilot with values ranging from (a) plaggy = 0.2 to (h) plaggy = 0.9. In all plots, the dashed blue line denotes the success rate of the expert pilot, while the dotted blue line is the success rate of our model when performing "full" diffusion (i.e., γ = 1.0) on an action sampled from a zero-mean isotropic Gaussian distribution, which we refer to as a "Random" pilot in the paper. (a) pnoisy = 0.2 (b) pnoisy = 0.3 (c) pnoisy = 0.4 (d) pnoisy = 0.5 (e) pnoisy = 0.6 (f) pnoisy = 0.7 (g) pnoisy = 0.8 (h) pnoisy = 0.9 Fig. 11: Lunar Reacher performance as a function of the forward diffusion ratio γ for a Noisy pilot with noise values ranging from (a) pnoisy = 0.2 to (h) pnoisy = 0.9. In all plots, the dashed blue line denotes the success rate of the expert pilot, while the dotted blue line is the success rate of our model when performing "full" diffusion (i.e., γ = 1.0) on an action sampled from a zero-mean isotropic Gaussian distribution, which we refer to as a "Random" pilot in the paper. 0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash (a) plaggy = 0.2 (b) plaggy = 0.3 (c) plaggy = 0.4 (d) plaggy = 0.5 (e) plaggy = 0.6 (f) plaggy = 0.7 (g) plaggy = 0.8 (h) plaggy = 0.9 Fig. 12: Lunar Reacher performance as a function of the forward diffusion ratio γ for a Laggy pilot with values ranging from (a) plaggy = 0.2 to (h) plaggy = 0.9. In all plots, the dashed blue line denotes the success rate of the expert pilot, while the dotted blue line is the success rate of our model when performing "full" diffusion (i.e., γ = 1.0) on an action sampled from a zero-mean isotropic Gaussian distribution, which we refer to as a "Random" pilot in the paper. rate and crash rate, consistent with the copilot selecting actions that conform to the distribution over expert actions. B. Block Pushing Figure 13 provides plots of the performance of the Noisy pilot on the Block Pushing task in terms of the correct goal, incorrect goal, and timeout rates for different settings of pnoisy. When the noise level is at or below 0.5, the Noisy pilot pushes the block to the correct goal more than 75% of the time without assistance (vs. nearly 100% for the expert) and never pushes the block to the incorrect goal. As the noise level increases from pnoise = 0.6, the rate at which the unassisted Noisy pilot times out significantly increases, while the rate with which it reaches the correct goal precipitously drops for pnoisy ≥ 0.8. With the assistance of a copilot, the rate at which the pilot pushes the block to the correct goal increases and the timeout rate decreases, both significantly, as the forward diffusion ratio increases to γ = 0.2 for Noisy pilots with pnoisy ≥ 0.6. As the forward diffusion ratio increases further and information about the assisted policy reaches one of the two candidate goals with roughly equal likelihood, while the timeout rate remains low, consistent with the set of expert demonstrations. For Noisy pilots with pnoise ≤ 0.5, assistance does not negatively affect the correct goal is diminished, performance until the forward diffusion ratio exceeds γ = 0.2. Figure 14 presents the performance of the Laggy pilot as a function of the forward diffusion ratio γ for different settings of plaggy. The behavior is similar to that of the Noisy pilot (Fig. 13) except increasing the level of copilot assitance to γ = 0.2 improves the correct goal rate for all parameterizations of the Laggy pilot. Again, as the forward diffusion ratio approaches γ = 1.0, the copilot effectively chooses randomly between the two goals, while maintaining a low timeout rate. that APPENDIX C REAL HUMAN USER EXPERIMENTS In Lunar Lander, Lunar Reacher and real robot experiment, we asked the same set of quantitative questions using a five- point Likert scale. Figure 15 shows the results of Lunar Lander and Lunar Reacher. The users preferred our copilot over the placebo copilot in all of the metrics we asked in the question. is summarized in Figure 16. Our copilot got better scores in all metrics but for "responsive". We believe that this is because unreasonable user control inputs (e.g., going away from any of the goal locations) are often strongly corrected by our copilot, which in turn gives the user an impression that their action is disrespected. The results of real robot experiment 0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100SuccessFloatCrash (a) pnoisy = 0.2 (b) pnoisy = 0.3 (c) pnoisy = 0.4 (d) pnoisy = 0.5 (e) pnoisy = 0.6 (f) pnoisy = 0.7 (g) pnoisy = 0.8 (h) pnoisy = 0.9 Fig. 13: Block Pushing performance in terms of the correct goal, wrong goal, and timeout rates as a function of the forward diffusion ratio γ for a Noisy pilot with noise values ranging from (a) pnoisy = 0.2 (h) pnoisy = 0.9. In all plots, the dashed blue line denotes the success rate of the expert pilot, while the dotted blue line is the success rate of our model when performing "full" diffusion (i.e., γ = 1.0) on an action sampled from a zero-mean isotropic Gaussian distribution, which we refer to as a "Random" pilot in the paper. (a) plaggy = 0.2 (b) plaggy = 0.3 (c) plaggy = 0.4 (d) plaggy = 0.5 (e) plaggy = 0.6 (f) plaggy = 0.7 (g) plaggy = 0.8 (h) plaggy = 0.9 Fig. 14: Block Pushing performance in terms of the correct goal, wrong goal, and timeout rates as a function of the forward diffusion ratio γ for a Laggy pilot with values ranging from (a) plaggy = 0.2 to (h) plaggy = 0.9. In all plots, the dashed blue line denotes the success rate of the expert pilot, while the dotted blue line is the success rate of our model when performing "full" diffusion (i.e., γ = 1.0) on an action sampled from a zero-mean isotropic Gaussian distribution, which we refer to as a "Random" pilot in the paper. 0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout0.00.20.40.60.81.0Forward Diffusion Ratio: 020406080100Correct goalIncorrect goalTimeout TABLE V: Success and crash/out-of-bounds (OOB) rates on Lunar Lander and Lunar Reacher for different pilots with and without assistance, where we show the results for our chosen value for γ = 0.4 as well as the result of using full diffusion (γ = 1.0), which has the effect of removing information about the goal provided by the pilot. The plots corresponding to the data in the table is figure 5. Each entry corresponds to 10 episodes across 30 random seeds. Note that the Zero and Random pilots have no knowledge of the goal. Pilot w/o Copilot (γ = 0.0) Success Rate w/ Copilot (ours) (γ = 0.4) Noisy Laggy Zero Random Expert Noisy Laggy Zero Random Expert 20.67 ± 4.50 21.33 ± 2.05 0.00 ± 0.00 0.00 ± 0.00 77.67 ± 2.62 14.33 ± 2.49 30.67 ± 5.56 0.00 ± 0.00 4.33 ± 1.89 49.33 ± 4.78 68.00 ± 5.35 75.00 ± 3.56 27.00 ± 0.82 25.00 ± 4.32 78.67 ± 2.87 45.33 ± 3.30 55.33 ± 6.13 19.67 ± 2.62 22.33 ± 2.87 55.00 ± 2.16 w/ Copilot (γ = 1.0) w/o Copilot (γ = 0.0) Lunar Lander 29.00 ± 2.94 26.33 ± 4.78 28.00 ± 2.16 27.67 ± 1.70 29.33 ± 6.18 Lunar Reacher 30.67 ± 4.11 30.67 ± 2.62 31.00 ± 6.98 30.00 ± 4.08 28.67 ± 4.50 28.33 ± 2.62 76.67 ± 2.49 100.00 ± 0.00 100.00 ± 0.00 12.33 ± 0.94 77.33 ± 3.09 69.33 ± 5.56 100.00 ± 0.00 95.33 ± 1.70 44.00 ± 3.56 Crash/OOB Rate w/ Copilot (ours) (γ = 0.4) 7.67 ± 2.87 9.67 ± 3.86 19.00 ± 2.94 19.33 ± 5.25 8.00 ± 1.63 38.00 ± 2.94 31.33 ± 2.87 58.33 ± 3.09 59.00 ± 0.82 31.67 ± 2.87 w/ Copilot (γ = 1.0) 18.33 ± 4.92 15.67 ± 0.94 13.33 ± 2.49 15.67 ± 1.25 15.33 ± 1.70 47.00 ± 3.56 45.67 ± 0.94 45.33 ± 5.56 45.00 ± 2.16 50.00 ± 1.41 TABLE VI: Correct goal and timeout rates on the Block Pushing task for different pilots with and without assistance. where we show the results for our chosen value for γ = 0.2 as well as the result of using full diffusion (γ = 1.0), which has the effect of removing information about the goal provided by the pilot. The plot corresponding to the data in the table is figure 6. Each entry corresponds to 10 episodes across 30 random seeds. Note that the Zero and Random pilots have no knowledge of the goal. Pilot Noisy Laggy Zero Random Expert w/o Copilot (γ = 0.0) 62.33 ± 2.49 42.00 ± 4.90 0.00 ± 0.00 0.00 ± 0.00 99.00 ± 0.82 Correct Goal Rate w/ Copilot (ours) (γ = 0.2) 75.67 ± 2.05 74.33 ± 2.87 40.67 ± 2.62 16.33 ± 3.09 94.67 ± 2.05 w/ Copilot (γ = 1.0) 52.67 ± 7.41 53.33 ± 4.19 52.33 ± 0.47 52.00 ± 3.74 51.00 ± 2.45 w/o Copilot (γ = 0.0) 37.33 ± 2.05 58.00 ± 4.90 100.00 ± 0.00 100.00 ± 0.00 1.00 ± 0.82 Timeout Rate w/ Copilot (ours) (γ = 0.2) 20.00 ± 3.27 21.33 ± 4.50 6.67 ± 1.70 68.00 ± 1.63 5.33 ± 2.05 w/ Copilot (γ = 1.0) 5.67 ± 1.25 5.67 ± 1.70 3.67 ± 2.36 4.33 ± 2.05 5.67 ± 2.49 (a) Lunar Lander (w/o Co-pilot) (b) Lunar Lander (w/ Co-pilot) (c) Lunar Reacher (w/o Co-pilot) (d) Lunar Reacher (w/ Co-pilot) Fig. 15: Results of the human user qualitative surveys for Lunar Lander and Lunar Reacher without and with the assistance of our shared autonomy algorithm. helpfulconsistentresponsivecollaboratetrustworthy020406080100strongly disagreedisagreeneutralagreestrongly agreehelpfulconsistentresponsivecollaboratetrustworthy020406080100strongly disagreedisagreeneutralagreestrongly agreehelpfulconsistentresponsivecollaboratetrustworthy020406080100strongly disagreedisagreeneutralagreestrongly agreehelpfulconsistentresponsivecollaboratetrustworthy020406080100strongly disagreedisagreeneutralagreestrongly agree (a) UR5 (w/o Co-pilot) (b) UR5 (w/ Co-pilot) Fig. 16: Results of the human user qualitative surveys for the UR5 manipulation experiments (left) without and (right) with the assistance of our method. helpfulconsistentresponsivecollaboratetrustworthy020406080100strongly disagreedisagreeneutralagreestrongly agreehelpfulconsistentresponsivecollaboratetrustworthy020406080100strongly disagreedisagreeneutralagreestrongly agree
http://arxiv.org/abs/2302.12238v1
2023-02-23T18:57:14
2023-02-23T18:57:14
Improving Adaptive Conformal Prediction Using Self-Supervised Learning
Conformal prediction is a powerful distribution-free tool for uncertainty quantification, establishing valid prediction intervals with finite-sample guarantees. To produce valid intervals which are also adaptive to the difficulty of each instance, a common approach is to compute normalized nonconformity scores on a separate calibration set. Self-supervised learning has been effectively utilized in many domains to learn general representations for downstream predictors. However, the use of self-supervision beyond model pretraining and representation learning has been largely unexplored. In this work, we investigate how self-supervised pretext tasks can improve the quality of the conformal regressors, specifically by improving the adaptability of conformal intervals. We train an auxiliary model with a self-supervised pretext task on top of an existing predictive model and use the self-supervised error as an additional feature to estimate nonconformity scores. We empirically demonstrate the benefit of the additional information using both synthetic and real data on the efficiency (width), deficit, and excess of conformal prediction intervals.
[ "Nabeel Seedat", "Alan Jeffares", "Fergus Imrie", "Mihaela van der Schaar" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12238v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12238v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 8 3 2 2 1 . 2 0 3 2 : v i X r a Improving Adaptive Conformal Prediction Using Self-Supervised Learning Nabeel Seedat* University of Cambridge Alan Jeffares* University of Cambridge Fergus Imrie University of California, Los Angeles Mihaela van der Schaar University of Cambridge The Alan Turing Institute Abstract Conformal prediction is a powerful distribution- free tool for uncertainty quantification, establish- ing valid prediction intervals with finite-sample guarantees. To produce valid intervals which are also adaptive to the difficulty of each instance, a common approach is to compute normalized nonconformity scores on a separate calibration set. Self-supervised learning has been effectively utilized in many domains to learn general repre- sentations for downstream predictors. However, the use of self-supervision beyond model pretrain- ing and representation learning has been largely unexplored. In this work, we investigate how self- supervised pretext tasks can improve the quality of the conformal regressors, specifically by im- proving the adaptability of conformal intervals. We train an auxiliary model with a self-supervised pretext task on top of an existing predictive model and use the self-supervised error as an additional feature to estimate nonconformity scores. We em- pirically demonstrate the benefit of the additional information using both synthetic and real data on the efficiency (width), deficit, and excess of conformal prediction intervals. 1 INTRODUCTION Much of machine learning (ML) research can be summa- rized as the task of minimizing a model's predictive error on unseen data. In the regression setting, this might corre- spond to minimizing the mean squared error. However, for real-world applications, particularly in high-stakes domains *These authors contributed equally to this work. Proceedings of the 26th International Conference on Artificial Intel- ligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). such as healthcare and finance, we seek various forms of model trustworthiness. One such factor considered in this work is estimates of, or even better guarantees, concern- ing a model's predictive uncertainty, i.e. quantifying the uncertainty in a model's prediction. Conformal prediction (Vovk et al., 2005) has received sig- nificant attention in recent years for this purpose. This powerful method provides valid prediction intervals with finite-sample, frequentist guarantees on the marginal cov- erage of the intervals. More precisely, for a random vector Rp R drawn from a joint distribution and label (X, Y ) ∈ PXY and a conformal predictor ˆC : Rp subsets in R , } then for a user-defined level of coverage (1 α), conformal prediction provides guarantees of the form → { − × Y P { ∈ ˆC(X) } ≥ α. 1 − (1) This method requires minimal assumptions on the data (i.e. exchangeability) and may be applied to any model upon which we can define a non-conformity score quantifying the disagreement between the model output and ground truth target (e.g. mean squared error). It can even be applied post hoc to already trained models, assuming exchangeability of a calibration dataset with the test data of interest. For more details, see Shafer and Vovk (2008). A widely used paradigm is inductive conformal prediction (ICP) Papadopoulos, 2008; Lei et al., 2018, which formu- lates conformal prediction using a dataset to train the pre- dictive model and a calibration dataset on which to compute a critical non-conformity score, used to define the width of the prediction interval. However, despite guarantees of marginal coverage, these intervals are fixed and do not adapt to sample difficulty. In practice, we often desire wider in- tervals for challenging samples and narrower intervals for easier samples. Locally adaptive conformal prediction (Pa- padopoulos et al., 2008; Johansson et al., 2015a; Lei et al., 2018) aims to address this with a conformal normalization model, which predicts the residual errors of the predictive model (also known as conformalized residual fitting - CRF). Improving Adaptive Conformal Prediction Using Self-Supervised Learning Figure 1: Left. Standard inductive conformal prediction results in constant width confidence intervals. Center. Conformal residual fitting produces adaptive intervals but can be inefficient in regions. Right. The errors of a self-supervised task are included above the plot with red indicating larger self-supervised errors. SSCP leverages these errors to improve the efficiency of conformal residual fitting. The predicted residuals (representing sample prediction dif- ficulty) are then used to adapt the intervals. In this work, we tackle the case of ICP with locally adaptive intervals and seek to improve the quality of the prediction in- tervals. Although we primarily focus on the CRF approach, the core ideas of this work can be trivially adapted to other methods for local adaptivity such as Conformalized Quan- tile Regression (CQR) as we discuss in Sec. 4.5 (Romano et al., 2019). However, a key benefit of the CRF approach is that the method does not directly modify the underlying base predictive model when adapting the prediction inter- vals. This enables post hoc conformalization in cases where we cannot augment or retrain such as a fixed/pre-trained regressor (e.g. behind an API) or in the case of a theoreti- cally derived model (e.g. quantifying model error around the Navier-Stokes equations in fluid mechanics). Specifically, we consider how to improve the conformal normalization function in order to improve the prediction in- tervals. To do so, we diverge from the typical conformal pre- diction setting and consider how auxiliary self-supervised tasks can be leveraged to improve conformal predictors. Self-supervised learning has been employed effectively to learn representations to improve performance for down- stream tasks; however, we also diverge from this standard setting of model pretraining and representation learning and address an under-explored avenue of using the error from a self-supervised task to help determine more challenging regions in input space such that conformal intervals can adapt appropriately. Consequently, we propose Self-Supervised Conformal Pre- diction (SSCP), a framework that provides a recipe to lever- age information from self-supervised pretext tasks to im- prove prediction intervals (see Fig. 1 for a contrast to alterna- tive approaches). We note that the auxiliary self-supervision information does not impact the theoretical guarantees of conformal prediction (see Sec. 4.6). To the best of our knowledge, this is the first work to integrate and examine the benefit of self-supervised errors to improve conformal prediction making the following contributions: Contributions: 1(cid:13) Self-supervision improves the resid- ual estimates, especially in challenging and sparser re- gions: We empirically demonstrate that self-supervised losses improve residual estimates thereby improving the prediction interval adaptiveness (Sec.5.1), especially for more challenging examples and in sparser regions (Sec.5.3). 2(cid:13) Labeled data can be repurposed: We empirically demonstrate that labeled data can be repurposed for the self-supervised task to improve the quality of conformal pre- diction intervals (Sec.5.2.1). 3(cid:13) Unlabeled data improves CP: We empirically demonstrate the value of unlabeled data to improve the quality of conformal prediction intervals beyond a standard application of self-supervision represen- tation learning (Sec.5.2.2). 2 RELATED WORK ∈ ˆC(X) X = x | Adaptive Conformal Prediction. While standard con- formal prediction does provide marginal coverage (Equa- tion 1), in practice we often desire conditional coverage α. Although it has been 1 Y P { shown that exact conditional coverage cannot be guaranteed in finite samples (Foygel Barber et al., 2021; Vovk, 2012), many works have improved the situation by relaxing the requirement of guarantees on coverage or by maintaining marginal coverage whilst seeking to improve adaptivity to a given test point. } ≥ − Locally adaptive conformal prediction (Papadopoulos et al., 2008, 2011; Johansson et al., 2015b) uses an independent model to induce adaptiveness, hence its mechanism is inde- pendent of the base predictive model. This flexibility means it can be applied to any architecture of predictive model or to an already trained model. In contrast, typically, other methods are not independent of the predictive model as they require specialized model architectures to obtain adaptive intervals, they require ad- ditional assumptions, and/or they sacrifice coverage guar- antees. For example, Conformalized Quantile Regression (CQR) Romano et al., 2019 has a modified neural network that predicts the two quantiles. Parallel lines of research con- sider non-parametric density estimation-based approaches InputDimensionResidualsInductiveConformalPredictionInputDimensionConformalResidualFittingInputDimensionSelf-supervisedConformalPrediction Nabeel Seedat*, Alan Jeffares*, Fergus Imrie, Mihaela van der Schaar (Chernozhukov et al., 2021; Izbicki et al., 2020) and confor- mal histogram regression (Sesia and Romano, 2021) which discretely approximates the conditional density f (y x). | Finally, conformal prediction splits the dataset into training and calibration datasets. While this may not be an issue with sufficient labeled data, in many settings we only have access to small/limited labeled datasets, which might significantly affect performance. In such settings, we often have access to large amounts of unlabeled data. To the best of our knowledge, SSCP is the first work to take advantage of such unlabeled data for conformal prediction in the context of self-supervised learning. We note that SSCP requires no additional splits in the labeled data over the underlying ICP method. Self-Supervised Learning. Self-supervised learning has been effectively utilized in many domains, from computer vision (Chen et al., 2020; Grill et al., 2020) to NLP (Kenton and Toutanova, 2019; Brown et al., 2020) to learn informa- tive representations from raw input features, with the goal of improving the performance of downstream models. In the tabular domain, masking and reconstruction methods are often popular pretext tasks, using methods such as au- toencoder reconstruction, VIME (Yoon et al., 2020), where the task is to recover a mask vector in addition to the origi- nal sample from a corrupted version of the input, and other variants, e.g. (Lee et al., 2022). Although self-supervision has had great success, its use be- yond model pretraining and representation learning has been largely unexplored. This work bridges this gap by studying how self-supervised losses can be used to provide additional information about the difficulty of a sample, making use of this information to improve the quality of conformal prediction intervals. 3 BACKGROUND: Conformal Prediction In this section, we provide a brief summary of both ICP and CRF, two methods that are fundamental to our proposed framework. For proofs of the theoretical properties refer- enced in this section, we refer the reader to Vovk (2012). We begin with a brief description of the general setting. Consider the supervised learning setting in which we are RdY . We provided with features Y ⊆ wish to learn a prediction interval ˆC : subsets of R } X → { such that, for a desired coverage rate 1 R and a test ∈ − point (X, Y ) , we ensure that Equation 1 holds. To train such a model, we assume access to labeled data . We consider regression predictive tasks; RdX and labels ∈ X × Y X ⊆ α labeled D ⊂ X × Y hence, the label yi is a scalar. ∈ Y Throughout this work, we consider inductive (or split) con- formal prediction. The standard practice in the literature is to subdivide the labeled data into training, calibration and cal D train {D labeled = . One might wish testing } to also consider including an (optional) fourth subdivision res, however, we defer considering this detail until Sec. D 4.1. In this setting, the conformal predictor f , around whose predictions we desire confidence intervals, is trained on ∪ D ∪ D test train. D 3.1 Inductive conformal prediction (ICP) Given the trained predictive model f , we wish to produce conformal predictive intervals as a measure of uncertainty, [l(x), r(x)] for each test instance x test. These intervals should guarantee that the target y of an instance x lies within the interval such that E (cid:2)1y∈[l(x),r(x)] α where the 1 (0, 1) can be chosen1 i.e. valid significance level α intervals with desired marginal coverage. In performing ICP, we only require the mild assumption of exchangeability between test as defined in Def. 3.1. ∈ D (cid:3) cal and ≥ − ∈ D D Definition 3.1 (Exchangeability). A dataset of n observa- tions is exchangeable if the data points do not follow any particular order, i.e., all n permutations are equiprobable. Exchangeability is a weaker assumption than i.i.d.; indeed, i.i.d. observations satisfy exchangeability. To obtain these intervals, we carry out a calibration step. cal is used to compute a non-conformity score μ, which D estimates how different a new instance looks from other In practice, absolute error is a popular non- instances. conformity score (i.e. μ(x) = y ). We then | | obtain an empirical distribution of non-conformity scores μ(x) { The critical non-conformity score (cid:15), then corresponds to ( α) -th smallest residual from the set the − (cid:101) (cid:100) . Finally, we use (cid:15) to construct the μ(x) { } ∈ D (cid:15), f (x) + (cid:15)]. intervals [l(x), r(x)] = [f (x) over the calibration instances. + 1)(1 |D | cal | x f (x) ∈ D − x cal cal } | − 3.2 Conformal residual fitting (CRF) Unfortunately, the width of the ICP confidence intervals de- scribed in the previous section are constant for all instances. While they do obtain valid coverage, they do not reflect the difficulty of individual samples and are inefficient as a result (see Fig. 1). To remedy this, CRF proposes to pro- duce locally adaptive intervals based on an estimate of the predictive model's residuals. Specifically, to enable locally adaptive intervals (i.e. lo- cally adaptive conformal prediction), a normalized non- conformity function γ is used (Equation 2). The numerator is computed as before based on μ, however, the function σ in the denominator permits us to normalize the non-conformity score per sample (i.e. as an estimate of difficulty), where σ is a conformal normalization model. 1We select α = 0.1 in our experiments. Improving Adaptive Conformal Prediction Using Self-Supervised Learning y γ(x) := | f (x) | − σ(x) , Our proposed SSCP method consists of three steps which we also summarize graphically in Fig. 2 and algorithmically in Algorithm 1. (2) The critical non-conformity score (cid:15) is then computed simi- larly to before using the -th smallest cal |D residual of the empirical distribution of normalized non- conformity scores + 1)(1 α) (cid:101) − x (cid:100) ( | γ(x) { | cal . } ∈ D D To train σ, a sensible approach is to use an additional, typi- cally disjoint dataset res upon which we can evaluate the trained predictive model f to obtain predictions which will be used as targets. This allows us to construct the set of . This set is used to tuples | R+, train the conformal normalization model, σ : X to predict the residuals. σ is then applied at testing time to estimate the predictive model's residuals on samples in X ) f (x) | (x, { ∈ D → − x res } y | test. ∈ D 4 METHOD: Self-Supervised Conformal Prediction In this section, we describe our proposed method to lever- age self-supervision to improve locally adaptive conformal prediction, which we refer to as Self-Supervised Conformal Prediction (SSCP). Recall CRF adapts confidence intervals by predicting the residuals of the main model using an auxiliary residual model. By predicting regions in which the predictive model will make greater or smaller errors, the intervals can be adapted appropriately. However, the task of predicting resid- uals can be challenging; indeed, presumably they would not be residuals in the first place otherwise. Therefore, we propose to improve the performance of the residual model with the additional signal. Our method is motivated by the following idea: can self- supervised tasks provide this added signal? With an appro- priately selected self-supervised task, not only do we get its prediction at test time but also its ground truth target. Therefore, we have access to the self-supervised error even at test time. If this error has a relationship with the error of the main model, then it can provide a useful input feature to the residual model. While correlated errors will often occur naturally due to factors such as noise or complexity in the data distribution, we can encourage this relationship in errors by careful selection of the self-supervised task and/or shared representation between the main model and the self-supervised model. Furthermore, the self-supervised model can simply be trained on the labeled training data as an extra step or, even better, it can also leverage any additional unlabeled data that is available. We highlight that this method can be applied orthogonally and in addition to any standard self-supervised representation learning of the main model. • (S1) Predictive and self-supervised phase: First, we train a predictive model to solve the regression task, as normal. Then, we share the learnt representations from the predictive model, and solve the self-supervised pretext task on top of these representations. • (S2) Conformal normalizer phase: Train a confor- mal normalizer to learn the residuals of the predic- tive model using the data features as well as the self- supervised errors on the same instances. • (S3) Conformalization phase: Finally, we apply CRF using the prediction model, self-supervised model, and residual model trained in the previous steps. In the following sections, we describe each step in more detail. First, however, we take a brief detour to describe the data splits and any assumptions on their distributions. 4.1 Data splits and assumptions D We begin by briefly summarizing the required data splits for performing SSCP. We also highlight that our method requires no further data splits beyond CRF and is therefore more data efficient due to its reuse of labeled data and ability to additionally use unlabeled data for the self-supervised tasks. train refers to the data on which the predictive and self-supervised models are trained. This may consist of a mixture of labeled and unlabeled data, where in many practical cases we have access to an unlabeled set with cardinality significantly greater than that of the labeled set. We also note that neither model is required to use this full set for training (e.g. the predictive model might only use the labeled data while the self-supervised model uses both labeled and unlabeled). Although not typically discussed in the literature, the resid- ual model should ideally be trained on disjoint data from the predictive model. We refer to this as res and, by us- D ing a separate dataset, we ensure that the residual model train residuals.2 does not learn on the potentially overfit Then, as usual, we have calibration and testing data cal and test, respectively. The only assumption required on the data to achieve valid coverage is that these two datasets are exchangeable. We require no assumptions on the remaining data although, as in any learning problem, model perfor- mance is likely to be affected by a divergence between their distributions. D D D 2We note that training both f & σ on Dtrain is possible, but comes with the associated overfitting risk of training σ on training residuals instead of testing residuals. We used a principled experi- mental design by including this additional split resulting in Dres, but practitioners may obtain better performance by double dipping on Dtrain. Nabeel Seedat*, Alan Jeffares*, Fergus Imrie, Mihaela van der Schaar Figure 2: SSCP produces adaptive conformal prediction intervals leveraging self-supervised learning to improve the conformal normalizer (σ) and consists of 3 phases. (S1) where (i) train the predictive regressor f = e ◦ g, thereafter (ii) the encoder representation (e) is transferred to use for the self-supervised task, where we train the self-supervised predictor h. (S2) the conformal normalizer phase is then carried out, with the conformal normalizer, augmented with the self-supervised input, trained to predict residuals (representing difficulty of prediction). Finally, (S3) the conformalization phase, computes non-conformity scores (μ) on Dcal, with the critical non-conformity score ((cid:15)) chosen as the (1 − α)-smallest. At test time, the adaptive prediction intervals [l(x), r(x)] are produced by adapting the critical non-conformity score (cid:15) using the conformal normalizer, i.e (cid:15)σ(x). The "shaded blocks" in each phase are trainable. 4.2 Predictive and self-supervised phase (S1) X → Y Predictive task. The goal of the predictive stage is to ob- tain a regressor f : mapping inputs to targets. Typically, this is a machine learning model (e.g. a neural network) trained on train. However, we place no assump- tions on this model, which could be any predictive model. An example of such a scenario beyond standard models might appear in a healthcare setting in which our model is the decision process of a doctor around which we would like to obtain valid confidence intervals. D In this work, we focus on the more conventional set- train to minimize ting of a data-based model trained on D the supervised loss (usually mean squared error), i.e. min E(x,y)∼Dtrain [ (y, f (x))]. We select this model to be f L a neural network consisting of an encoder e and a predictor e. This provides us with the ability to g such that f = g share an encoding representation between the supervised and self-supervised task, which enforces a relationship be- tween the two models. ◦ L We also highlight that a standard application of self- supervised learning could be applied in learning the predic- tive model in addition to the SSCP procedure we describe in this work. This would consist of applying standard self- supervision prior to the predictive task (S1). Our SSCP framework is orthogonal to such an application. Self-supervised task. The self-supervised task consists of training some model fss also on train but this time for some D pretext task. We also place no restrictions on the choice of self-supervised task. However, we wish its errors to have a useful relationship with those of the predictive model. In this work, we focus on tabular data where tasks such as input reconstruction-based tasks (such as autoencoders or VIME Yoon et al., 2020) are popular. Depending on the task, various domain-specific tasks have been proposed in the self-supervised literature which may be leveraged in this step. We also use a neural network fss = h e where e is the pre-trained encoder of the predictive model and h is a task-specific decoder. We fix the weights of e, such that it retains the desired connection with the predictive task. We then optimize h to solve the pretext task, minimizing the ss as part of the following objective: self-supervised loss ◦ L E(X)∼Dtrain [ min h ss(x, (h ◦ e)(x))]. (3) L 4.3 Conformal normalizer phase (S2) The conformal normalization model σ is directly responsible for the adaptiveness of the prediction intervals. Hence, by improving σ, we can in turn improve the adaptiveness of the intervals. As previously discussed, this model is fit to res to avoid learning the training residuals, which may D not generalize. In this work, we propose to incorporate ss as an additional feature to σ. the self-supervised error Fundamental to this, we can compute ss at both training and test time, since we do not need access to labels. L L Furthermore, to reiterate, if the self-supervised loss for Transfer(i) Predictive task(ii) Self-Supervised taskSS PredictorPredictorEncoderEncoder(S1) Predictive and self-supervised phaseConformalNormalizer EncoderSS Predictor(S2) Conformal Normalizer phase Predictor(S3) Conformalization phase EncoderPredictorConformalNormalizer SS PredictorTrainableKEY:FixedAdaptive conformalprediction intervals Improving Adaptive Conformal Prediction Using Self-Supervised Learning L a specific sample has a relationship to the difficulty of the predictive task, then, by adding ss as a feature, we pass this information to σ when predicting the normalizing residuals. To do so, we augment the input space of σ as ˆX = and train σ as usual. The decision of which residual normalizer model to use should be selected on a problem-specific basis. We successfully apply a ran- dom forest (Sec. 5.1) and a neural network (Sec. 5.2) in our experiments. ss(X) } X, L { 4.4 Conformalization phase (S3) Finally, given our trained predictive model f , self- supervised model fss, and residual model σ, we can apply the same calibration procedure as standard CRF on cal (as described in Sec. 3.2) to obtain the α-quantile non- conformity score (cid:15). Then for a new test example x, we obtain adaptive and valid intervals. D [l(x), r(x)] = [f (x) − (cid:15)σ(ˆx), f (x) + (cid:15)σ(ˆx)], (4) where ˆx = ss(x) } framework algorithmically in Algorithm 1. x, L { . We summarize the complete SSCP Algorithm 1 Self-supervised Conformal Prediction D train, e on cal, e, g, h, σ D 1: Input: res, D 2: procedure SSCP 3: 4: 5: 6: 7: 8: Train f = g ◦ Train fss = h ◦ Calculate self-supervised errors Train σ on Apply standard CRF calibration (Sec. 4.3) Return: e, g, h, σ for test evaluation train (Sec. 4.2 S1 (ii)) res L ss (Sec. 4.3 S2) train (Sec. 4.2 S1 (i)) D e on ss on ∪ L D D D res 4.5 Other locally adaptive methods The SSCP framework described throughout this section has primarily focused on CRF as a method for achieving lo- cally adaptive intervals. However, simple adaptations to the procedure permit alternative methods to be considered. A powerful alternative that has emerged in recent years is CQR (Romano et al., 2019). In Appendix C.3, we describe the adaption required to integrate CQR into our SSCP frame- work and provide an empirical evaluation of CQR as an alternative method. 4.6 Remark on SSCP and coverage guarantees Conformal prediction provides theoretical guarantees on the validity of coverage of the prediction intervals based on the exchangeability assumption (see Def. 3.1). SSCP inherits these same guarantees. Just as in the case of CRF, SSCP provides valid coverage provided the calibration set and test set satisfy exchangeability (see e.g. Tibshirani et al. (2019) for proof of these guarantees). We provide an extended comment on this point in Appendix A. 5 EXPERIMENTS In this section, we empirically assess the benefit provided by SSCP 34 compared to CRF. We begin with a synthetic example to highlight why adding a self-supervised loss to the conformal normalization model can improve prediction intervals. Then, we demonstrate the performance of SSCP on a diverse range of real-world datasets, which differ in terms of numbers of samples, features, and difficulty. Evaluation metrics We desire that the self-supervised in- formation improves the quality of the conformal prediction intervals on average. We assess the quality based on the following commonly used metrics (Romano et al., 2019; Navratil et al., 2020). Note, that in all cases, we still obtain intervals with valid coverage. Decreases in these metrics whilst still maintaining coverage implies superior adaptation and improvement to the quality of the prediction intervals: • Width: The size of the conformal prediction interval, X i.e. E[r(x) l(x)], x − ∈ • Deficit: The interval shortfall, when the true value y lies outside the predicted interval. i.e. E[1y /∈[l(x),r(x)] * min |} l(x) | y {| r(x) ], x X − − ∈ y , | • Excess: The additional width included not needed to capture the true value y. E[1y∈[l(x),r(x)] * X l(x), r(x) ∈ ], x } y { min − − y Experimental setup. We use the same underlying predic- tive model in all comparisons to isolate the effects of the conformal prediction method (since by definition a better predictive model can achieve narrower intervals). Our base- line is locally adaptive conformal prediction (denoted CRF), where the non-conformity score is the absolute error of the residuals. In our experiments, we illustrate SSCP using VIME (Yoon et al., 2020) as an example of a potential self-supervision task. We selected VIME as it is regarded as highly per- formant on tabular data. As a pretext task, from a partially masked input, VIME aims to reconstruct the original sample in addition to recovering the mask vector. We provide ad- ditional experiments and ablations in Appendix C. Further experimental details can be found in Appendix B. 5.1 Synthetic demonstration We begin by illustrating our method on a synthetic dataset. While a standard application of self-supervision to improve the predictive model is likely to improve performance, the primary contribution of this work is to apply self-supervision 3https://github.com/seedatnabeel/SSCP 4https://github.com/vanderschaarlab/SSCP Nabeel Seedat*, Alan Jeffares*, Fergus Imrie, Mihaela van der Schaar to achieve a more adaptive conformal normalization model σ. We isolate this effect by generating synthetic residuals from a hypothetical predictive model and comparing the perfor- mance of a conformal normalization model with and without access to the errors of a self-supervised task. Therefore, any improvements in this setting are exclusively due to this ad- ditional information. Data Generation. In order to visualize the results, we assume both the inputs x and the model residuals r are gen- erated as a function of a single, uniformly distributed latent dimension L (0, 1). We assume that there are discrete regions in which the model has made larger errors and there- fore its residuals are distributed as r (step(L), 0.1), where step() denotes a step function defined as ∈ N ∈ U step(x) = (cid:40) 1.5 0.1 (0.2, 0.4) or x if x ∈ otherwise. (0.6, 0.8) ∈ (5) The sign of the residual is chosen at random. A visualization of these residuals (plotted prior to taking their absolute value, which maps them to R+ as required) is provided in Fig. 3. linearly correlated with L (i.e. the autoencoder could rea- sonably model the single ground truth latent dimension L). Since the residuals are a function of L, this self-supervised error provides a useful feature. In Fig. 4 we compare the conformal prediction intervals (α = 0.1) of a random forest of 1000 trees with and with- out the additional self-supervised feature, where out-of-bag predictions are used for calibration. We observe that while both methods achieve the desired level of marginal coverage, the additional information from the self-supervised input results in adaptive intervals. How- ever, the standard approach is unable to model the relation- ship between inputs and residuals, and is forced to default to more conservative intervals in order to maintain coverage. This example illustrates that, for a given sample, strictly narrower intervals might not be optimal. Indeed, for sam- ples with large residuals, CRF achieves narrower intervals than SSCP. However, these intervals are overly tight, and coverage is only maintained over the entire dataset due to overly conservative coverage in low residual regions. Figure 3: 200 observations drawn from our synthetic distribu- tion with the distributions ground truth 90% prediction intervals highlighted with a dashed line. The input features x are also sampled as a function of L. We consider a 20-dimensional input consisting of 10 uniformly sampled pairs of points along the circumference of a circle with its base at the origin and a radius of L. This results in an increasingly sparse input space for larger values of L. Results. Predicting r from x is challenging in the small data setting. However, by applying self-supervision to the inputs x, we can better learn the latent process, which in turn can provide useful information for the supervised conformal nor- malization model. One of the most simple self-supervised tasks is a standard autoencoder that reconstructs the input. Taking advantage of our knowledge of the data generation process, we consider a single latent unit in the bottleneck layer. Due to the increasing sparsity of inputs with increas- ing L, this would result in self-supervised errors that are Figure 4: Conformal prediction intervals. Standard CRF (pink) fails on this synthetic task due to a complex relationship between the inputs and the latent dimension. By including the errors of a self-supervised task as an input, SSCP (green) is able to learn much more efficient prediction intervals. Takeaway. Augmenting the conformal normalization model's inputs with a self-supervised loss better models the heteroscedasticity in the predictive model's residuals, which results in more adaptive conformal prediction inter- vals. 5.2 Real data We now assess the performance of SSCP on multiple real- world regression datasets. These datasets have been used in Romano et al. (2019). We assess the utility of using self-supervision in two plausible scenarios. 5.2.1 Fully labeled data setting Setup. This experiment evaluates the utility of SSCP if we only have access to fully labeled data (i.e. only the data 0.00.20.40.60.81.0LatentdimensionL−1.50.01.5Residualr0.00.20.40.60.81.0LatentdimensionL−1.50.01.5ResidualrCRFSSCP Improving Adaptive Conformal Prediction Using Self-Supervised Learning used to train the predictive model). We evaluate whether the same labeled data can be repurposed for self-supervision simply by ignoring the label (i.e. we have no unlabeled data train). The benefit of this setup is that it is applicable to in labeled is split any supervised learning setting. Formally, as follows test labeled = D res train D cal D {D ∪ D ∪ D ∪ D . } The datasets as described in Sec. 4 are used for both the predictive and normalization models. We can use train for the self-supervised tasks, simply by ignoring the label. D Analysis. We assess the aforementioned setup on multiple real-world datasets. Table 1 highlights that indeed the SSL task on labeled data improves the conformal prediction in- tervals across all datasets in terms of reduced width and excess, occasionally at the expense of slightly larger deficit. However, coverage is maintained in all scenarios. We also note that, of course, the smaller datasets (with respect to samples) see the smallest improvements when compared to those datasets where we have more samples. This is expected, as we simply have fewer data samples on which the SSL task can learn. That said, irrespective of the number of samples, there is still a benefit in repurposing existing labeled data to extract self-supervised information. Table 1: Assessing the impact of the SSL task on improving CRF, even without additional data. We find in all cases, averaged over 5 runs, that the additional SSL information can help to improve width, deficit, and excess (↓ better). Dataset Metric CRF SSCP concrete (n=1030) community (n=1994) star (n=2161) bike (n=10886) Blog data (n=52397) Facebook (n=81311) Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess 0.768 0.099 0.263 2.602 0.355 1.030 0.293 0.036 0.120 0.720 0.164 0.244 3.474 3.084 1.292 1.917 1.956 0.584 0.743 0.098 0.253 2.462 0.361 0.967 0.263 0.031 0.100 0.690 0.161 0.232 3.360 3.155 1.227 1.860 1.998 0.554 Takeaway. Self-supervision improves the quality of con- formal prediction intervals, even on a fixed dataset without additional data, simply by repurposing the labeled data. Figure 5: Relative prediction interval widths of SSCP compared to CRF for varying proportions of labeled data (↓ better). Avg. inter- val width across datasets is lower with the inclusion of unlabeled data across all p. 5.2.2 Augmented with unlabeled data setting Setup. This experiment highlights the value of self- supervision, coupled with unlabeled data, to improve CRF- based models. We consider the typical setup in self- supervised learning, with labeled and unlabeled. D D We evaluate the effect for varying proportions p of labeled examples. labeled is then split and used for the predictive and normalization models, as in Sec. 5.2.1. unlabeled augments the dataset used to train the self-supervised model (i.e. VIME). D D Analysis. What happens for varying p? For different val- ues of p, the inclusion of the unlabeled data through self- supervision reduces the width of the prediction intervals (Fig. 5). Of course, as p increases, so too does the quality of the predictive and normalization models. This explains the natural increase in relative width of SSCP vs. CRF for increasing p, i.e. as expected, with more su- pervised data to train on (and less unlabeled data), there is a reduced benefit of the unlabeled data. However, even as p increases, we still note the benefit of the self-supervised signal in reducing the width of the intervals relative to CRF. As an ablation, to quantify the benefit of the unlabeled data, we train the self-supervised task on ONLY the smaller labeled, rather than the larger combination which includes D unlabeled. The results indicate that the inclusion of unla- D beled data is indeed beneficial with tighter intervals. These results can be found in Appendix C.1. Finally, we expect that the choice and nature of the SSL task is impactful, and specific pretext tasks might provide superior signal to the normalization model. We discuss this in greater detail in Appendix C.4 by assessing alternative modes of self-supervision. 0.10.20.30.40.5Proportion labeled data0.60.70.80.91.01.1Relative width (v. CRF)CRFSSCP Nabeel Seedat*, Alan Jeffares*, Fergus Imrie, Mihaela van der Schaar Takeaway. Self-supervision using unlabeled data helps to improve the quality of conformal intervals, across different proportions of labeled vs. unlabeled data. 5.3 Insights Let us now examine where SSCP helps the most. First, we compare the prediction intervals of samples with CRF vs. the same samples with SSCP. We find that the main source of improvement over CRF is for those samples with the largest interval width. Fig. 6 highlights that SSCP significantly reduces the interval width for these samples, which is the key source of the reduction in average width. (a) CRF (b) SSCP Figure 6: Prediction interval width for most challenging samples on Star. SSCP reduces interval width This begs the question on what type of samples/regions SSCP helps? To facilitate visualization, we reduce the di- mensionality of the input features X using principal compo- nent analysis (PCA). We plot PC1 vs. output y and compare the prediction intervals for SSCP vs. CRF. In Fig. 7, we examine two coarse regions of the PC1 space: dense and sparse. In the denser regions, CRF has narrower intervals, similar to SSCP. Whilst, in the sparser regions, CRF often has much wider prediction intervals compared to SSCP. It is in these sparse regions that SSCP clearly helps. (a) Star dataset (b) Facebook dataset Figure 7: Comparing the prediction intervals in different regions. SSCP provides benefit in the sparser regions. lenging regions. Quantitatively, this improvement to σ in 5% for Fig. 7 (a) and (b) respectively. MAE is Further analysis is found in Appendix C.4.2 and C.4.3. 14% and ± ± Takeaway. SSCP improves prediction interval width on the most challenging samples and sparser regions. 6 DISCUSSION Improving the quality of prediction intervals is crucial for more reliable uncertainty quantification. In this work, we show the value of self-supervised learning beyond model pretraining and representation learning. We propose a frame- work to integrate self-supervised losses to improve confor- mal prediction intervals. We empirically show on both synthetic and real data that self-supervision improves the prediction intervals of locally adaptive conformal prediction, specifically CRF. In addition, the self-supervision assists in more challenging and sparser regions. Limitations. SSCP provides a framework to highlight the value of self-supervision for conformal prediction. Our evaluation of pretext tasks (in the main paper and appendix) are provided as examples and additional tasks could be evaluated using the provided "recipe", inclusive of future work to design a conformal prediction-specific pretext task. Societal impact. Quantifying predictive uncertainty is im- portant for ML, especially in high-stakes settings such as medicine and finance. SSCP seeks to improve this and pro- vide more trustworthy predictions, by providing end users with reliable prediction intervals as a measure of confidence. Future work. The findings of this paper open up avenues for future research, leveraging the idea that self-supervision can be used to improve conformal prediction. The fol- lowing are proposed areas of future exploration: (i) as- sessing alternative self-supervised approaches (e.g. Chen et al., 2020; Lee et al., 2022), (ii) development of new conformal-aware self-supervised tasks, (iii) application of self-supervision to improve feature-wise conformal predic- tion (as per Seedat et al., 2022, Teng et al., 2022), (iv) the use of self-supervision with other data modalities such as images, where the self-supervised tasks tend to be distinct from the tabular setting. ACKNOWLEDGEMENTS The rationale is that in the sparser regions, the conformal normalization model σ does not perform well. Hence, to satisfy the coverage constraint, the CRF intervals are more conservative and therefore more inefficient in these chal- lenging sparser regions. In contrast, SSCP with the SS signal helps to improve the conformal normalization model (i.e. the residuals are pre- dicted more accurately) and hence by virtue of the improved σ it achieves intervals with lower width on the sparser chal- The authors are grateful to Alicia Curth, Boris van Breugel, Nicolas Huynh, Paulius Rauba, Tennison Liu, and the anony- mous AISTATS reviewers for their comments and feedback on an earlier manuscript. Nabeel Seedat and Alan Jeffares are funded by the Cystic Fibrosis Trust. Fergus Imrie and Mihaela van der Schaar are supported by the National Sci- ence Foundation (NSF, grant number 1722516). Mihaela van der Schaar is additionally supported by the Office of Naval Research (ONR). 5.02.50.02.55.0PC142024PC2CRF widths (Mean:0.956)Width0.91.21.51.82.15.02.50.02.55.0PC142024PC2SSCP interval widths (Mean:0.264)Width0.10.20.30.40.50.65.02.50.02.55.0PC1012ySSCP (VIME)CRF IntervalTrue010203040PC12001000100200ySSCP IntervalCRF IntervalTrue Improving Adaptive Conformal Prediction Using Self-Supervised Learning References Vladimir Vovk, Alexander Gammerman, and Glenn Shafer. Algorithmic learning in a random world. Springer Sci- ence & Business Media, 2005. Glenn Shafer and Vladimir Vovk. A tutorial on conformal prediction. Journal of Machine Learning Research, 9(3), 2008. Harris Papadopoulos. Inductive conformal prediction: The- ory and application to neural networks. In Tools in Artifi- cial Intelligence. Citeseer, 2008. Jing Lei, Max G'Sell, Alessandro Rinaldo, Ryan J Tibshi- rani, and Larry Wasserman. Distribution-free predictive inference for regression. Journal of the American Statis- tical Association, 113(523):1094–1111, 2018. Harris Papadopoulos, Alex Gammerman, and Volodya Vovk. Normalized nonconformity measures for regression con- formal prediction. In Proceedings of the IASTED Inter- national Conference on Artificial Intelligence and Appli- cations (AIA 2008), pages 64–69, 2008. Ulf Johansson, Cecilia S ̈onstr ̈od, and Henrik Linusson. Effi- cient conformal regressors using bagged neural nets. In 2015 International Joint Conference on Neural Networks (IJCNN), pages 1–8, 2015a. doi: 10.1109/IJCNN.2015. 7280763. Yaniv Romano, Evan Patterson, and Emmanuel Candes. Conformalized quantile regression. Advances in Neural Information Processing Systems, 32, 2019. Rina Foygel Barber, Emmanuel J Candes, Aaditya Ramdas, and Ryan J Tibshirani. The limits of distribution-free con- ditional predictive inference. Information and Inference: A Journal of the IMA, 10(2):455–482, 2021. Vladimir Vovk. Conditional validity of inductive conformal predictors. In Asian Conference on Machine Learning, pages 475–490. PMLR, 2012. Harris Papadopoulos, Vladimir Vovk, and Alexander Gam- merman. Regression conformal prediction with nearest neighbours. Journal of Artificial Intelligence Research, 40:815–840, 2011. Ulf Johansson, Cecilia S ̈onstr ̈od, and Henrik Linusson. Effi- cient conformal regressors using bagged neural nets. In 2015 International Joint Conference on Neural Networks (IJCNN), pages 1–8, 2015b. doi: 10.1109/IJCNN.2015. 7280763. Victor Chernozhukov, Kaspar W ̈uthrich, and Yinchu Zhu. Distributional conformal prediction. Proceedings of the National Academy of Sciences, 118(48):e2107794118, 2021. Rafael Izbicki, Gilson T Shimizu, and Rafael B Stern. Flex- ible distribution-free conditional predictive bands using density estimators. In Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics (AISTATS), pages 3068–3077. PMLR, 2020. Matteo Sesia and Yaniv Romano. Conformal prediction using conditional histograms. Advances in Neural Infor- mation Processing Systems, 34:6304–6315, 2021. Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In International Con- ference on Machine Learning, pages 1597–1607. PMLR, 2020. Jean-Bastien Grill, Florian Strub, Florent Altch ́e, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Do- ersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent A new approach to self-supervised learning. Advances in Neural Information Processing Systems, 33:21271–21284, 2020. Jacob Devlin Ming-Wei Chang Kenton and Lee Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL-HLT, pages 4171–4186, 2019. Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Lan- guage models are few-shot learners. Advances in Neural Information Processing Systems, 33:1877–1901, 2020. Jinsung Yoon, Yao Zhang, James Jordon, and Mihaela van der Schaar. VIME: Extending the success of self-and semi-supervised learning to tabular domain. Advances in Neural Information Processing Systems, 33:11033– 11043, 2020. Changhee Lee, Fergus Imrie, and Mihaela van der Schaar. Self-supervision enhanced feature selection with corre- In International Conference on Learning lated gates. Representations, 2022. Ryan J Tibshirani, Rina Foygel Barber, Emmanuel Candes, and Aaditya Ramdas. Conformal prediction under co- variate shift. Advances in Neural Information Processing Systems, 32, 2019. Jiri Navratil, Matthew Arnold, and Benjamin Elder. Un- certainty prediction for deep sequential regression using meta models. arXiv preprint arXiv:2007.01350, 2020. Nabeel Seedat, Jonathan Crabb ́e, and Mihaela van der Schaar. Data-suite: Data-centric identification of in- In International distribution incongruous examples. Conference on Machine Learning, pages 19467–19496. PMLR, 2022. Jiaye Teng, Chuan Wen, Dinghuai Zhang, Yoshua Ben- gio, Yang Gao, and Yang Yuan. Predictive infer- ence with feature conformal prediction. arXiv preprint arXiv:2210.00173, 2022. Yao Zhang, William Zame, and Mihaela van der Schaar. AutoCP: Automated pipelines for accurate prediction in- tervals. arXiv preprint arXiv:2006.14099, 2020. Nabeel Seedat*, Alan Jeffares*, Fergus Imrie, Mihaela van der Schaar Harris Papadopoulos and Haris Haralambous. Neural net- works regression inductive conformal predictor and its application to total electron content prediction. In Inter- national Conference on Artificial Neural Networks, pages 32–41. Springer, 2010. Arthur Asuncion and David Newman. UCI machine learn- ing repository, 2007. Roger Koenker and Gilbert Bassett Jr. Regression quantiles. Econometrica: journal of the Econometric Society, pages 33–50, 1978. Improving Adaptive Conformal Prediction Using Self-Supervised Learning A COMMENT ON SSCP COVERAGE Conformal prediction was originally introduced in Vovk et al. (2005). However, this so-called transductive method is impractical for naive use with most modern algorithms due to multiple refits of the model being required per test point. Inductive (or split) conformal prediction (Papadopoulos, 2008) provides a satisfying solution to this limitation by separating the fitting of the model and the calibration of the conformal predictor across two disjoint datasets. As noted in Tibshirani et al. (2019); Zhang et al. (2020), by considering the trained model μ fixed, the non-conformity scores on the calibration and test data are clearly exchangeable provided the data itself is exchangeable. Of course, this method results in constant interval width across all test points, which is determined by the critical non-conformity score (cid:15). In order to provide adaptive width intervals that reflect the difficulty of a particular example, Papadopoulos and Haralambous (2010) introduced a residual estimator σ resulting in CRF. By adjusting the denominator of the non-conformity score function to γ(x) = |y−f (x)| , the prediction intervals become (μ(x) σ(x)) and still enjoy marginal coverage in the inductive setting. We emphasize that it is only required that the calibration data and test data are exchangeable, both μ and σ can be trained on any disjoint data provided they are subsequently held fixed. σ(x), μ(x) + (cid:15) σ(x) − (cid:15) * * It is straightforward to check that the method proposed in this work (SSCP) can be viewed as a special case of CRF as described in the previous section and, therefore, maintains the same coverage guarantees. The additional self-supervised x, fss(x)). function fss can simply be viewed as a sub-component of an alternative residual model, defined as ˆσ(x) = σ( { Just as before, and provided this model remains fixed during calibration and testing, the same conformal prediction coverage guarantees hold. Nabeel Seedat*, Alan Jeffares*, Fergus Imrie, Mihaela van der Schaar B EXPERIMENTAL DETAILS In this section, we outline further details of the experimental setup used in Section 5. We assess SSCP on multiple open-source regression datasets from the UCI repository (Asuncion and Newman, 2007). These datasets vary both in the number of features as well as in the number of samples (documented in Table 1). Similar to Romano et al. (2019), we standardize the features to have zero mean and unit variance. The output y is rescaled by the mean absolute value. We compute the performance metrics averaged over 5 random runs. In each run, we change the train-test split sampling, where the split proportion of 80-20. cal split 80-20 with the remaining train and then subsequently res is then split 80-20 with train. We fix α=0.1. D D D D B.1 Predictive and conformal normalization models. Our baseline models, both the predictive model and conformal normalization model, are implemented using neural networks. Our architectures are similar to those used in Romano et al. (2019). The neural network is an MLP with three fully connected layers, each with ReLU activations. The input is an n-dimensional feature vector X passed to an input layer with 64 hidden units. The hidden layer also contains 64 units. Finally, the output layer is a single neuron corresponding to the regression output y. Mean squared error loss is used throughout our experiments, optimized using Adam with a learning rate of 5e-4. Batch size is 128 and we apply dropout regularization with dropout probability of 0.1. Finally, we train using early stopping with patience of 20. We extract up to the second fully connected layer as the encoder e. B.2 Self-supervised learning VIME. We specifically leverage the self-supervised component of VIME. This consists of an encoder together with an output mask estimator and feature estimator, which are jointly optimized. We keep the default architecture as per Yoon et al. (2020) with a dense layer for each. We train with a batch size of 128 for 500 epochs with early stopping enabled. The probability of corruption used is 0.3 and the weight of the feature to mask loss α is set to 2. Future work could assess how to optimally set these parameters specific to the conformal prediction setting. A minor difference to standard VIME in our application is that rather than the input being raw features, we provide the output from encoder e as the task input, and train VIME as the self-supervised predictor h. Autoencoder. Similar to VIME rather than the input being raw features, we provide the output from the encoder e as the input, and simply train the autoencoder decoder portion as the self-supervised predictor h. The decoder has the same layers and dimensionality as the encoder e, simply being reversed such that the reconstructed output matches the dimensionality of the raw features. We train with a batch size of 128 for 500 epochs with early stopping enabled. MSE is the loss function. Similar to VIME, the nature and depth of the autoencoder could be assessed as future work concerning how to optimally set these parameters specific to the conformal prediction setting. Improving Adaptive Conformal Prediction Using Self-Supervised Learning C ADDITIONAL EXPERIMENTS C.1 Ablation: unlabeled data experiment Goal. This experiment seeks to understand the benefit of the unlabeled data to SSCP. To do so, we perform an ablation of the unlabeled data when used with SSCP for varying proportions p of labeled data. In the ablation variant, i.e. SSCP (Labeled), we only re-use the fully labeled data for the self-supervised task and compare it to SSCP (ALL) which augments the self-supervised dataset with the unlabeled data. Analysis. The results outlined in Table 2 highlight the benefit of the unlabeled data, especially true in the low data regime when the labeled dataset is small (i.e. low p), where the ablation SSCP (Labeled) showcases an increased average interval width, i.e. when not including the unlabeled data. Table 2: Avg. width of intervals with and without unlabeled data (↓ is better) p 0.1 0.2 0.3 0.4 0.5 SSCP (ALL) 3.603 2.878 1.796 1.505 1.465 SSCP (Labeled) Difference 3.893 3.000 1.752 1.459 1.490 0.290 0.122 -0.044 -0.045 0.025 C.2 Sanity check: alternative sources of signal Goal. We aim to assess the value of alternative sources of signal with respect to the residual prediction, in order to highlight the value imbued by the self-supervision. We assess (i) using an isolation forest instead of SSL and (ii) using the self-supervised signal directly, rather than as input to a residual/normalization model σ. Analysis. Sanity check comparing alternative self-supervised signals to SSCP (VIME). We analyze adding an isolation forest in place of VIME i.e. SSCP (IF) and simply using the SSL signal for normalization, instead of training σ (SSL- normalizer). The results are shown in Table 3 and indicate that indeed overall the usage of VIME provides the best intervals in the most stable manner. Table 3: Sanity check comparing alternative self-supervised signals to SSCP (VIME). We report mean average interval width over 5 runs. (↓ better) Dataset Overall concrete(n=1030) community(n=1994) star(n=2161) bike(n=10886) Blog data (n=52397) Facebook (n=81311) SSCP (VIME) SSCP (IF) SSCP (SSL-normalizer) 1.587 0.743 2.462 0.263 0.690 3.360 1.860 1.652 0.904 2.581 0.230 0.711 3.360 2.127 4.139 0.761 2.468 0.207 1.016 11.823 8.562 Nabeel Seedat*, Alan Jeffares*, Fergus Imrie, Mihaela van der Schaar C.3 Conformalized Quantile Regression Conformalized Quantile Regression (CQR) (Romano et al., 2019) provides a powerful alternative to CRF for achieving locally adaptive intervals for conformal prediction. The method builds upon conditional quantile regression (Koenker and Bassett Jr, 1978) in which the pinball loss objective is utilized such that a model predicts upper and lower quantiles around a target by enforcing non-symmetric and opposite loss functions for the two model outputs. This method was then conformalized in Romano et al. (2019) using an inductive conformal prediction procedure. Although CQR removes the flexibility of post hoc conformalization of an arbitrary model, it often benefits from more efficient intervals in practice. Therefore, one might wish to consider it as an alternative to CRF in our SSCP framework. The key difference between the two methods is that CQR no longer requires a separate conformal normalizer model, as the prediction intervals [l(x), r(x)] are derived from the main model's quantile predictions. Instead, we pass the self-supervised errors as an additional input into the encoder of the main model. Sharing the encoder between the self-supervised model fss and the main model f (i.e. e = ess) can still be achieved by passing a placeholder (0) for the additional feature during the self-supervised phase. In our experiments, we consider both a shared encoder between the two models (Shared) and an independent encoder per model (Indep). This procedure is summarized in Algorithm 2. Algorithm 2 Self-supervised Conformal Prediction with CQR D train, cal, e, ess, g, h 1: Input: D 2: procedure SSCP Train fss = h 3: ◦ Calculate self-supervised errors 4: train Train f = g e on 5: ss Apply standard CQR calibration on 6: cal Return: e, ess, f , g, h for test evaluation 7: ess on train ss ∪ L on train train D D D L ◦ cal ss ∪ L train and D cal ss on L cal D We include the results of applying SSCP with CQR to the same experiments described in Sections 5.2.1 & 5.2.2 in Table 4 & Figure 8 respectively. In the fully labeled setting we find that (1) independent encoders outperform shared encoders using the method we describe, and (2) CQR augmented with a self-supervised signal is competitive with and often improves vanilla CQR in terms of average interval width. In the partially labeled setting, we observe a similar trend that for lower quantities of labeled data, SSCP provides the largest gains over standard CQR. The trend between the four methods indicates, consistent with the labeled setting, that independent encoders outperform a shared representation. However, evidence for improved performance with additional unlabeled data is inconclusive in these experiments. Hence, further research on more effective ways to (1) share a representation in this context and (2) integrate unlabeled data provide exciting directions for future work. Table 4: Repeating the fully labeled experiments from Section 5.2.1 with CQR. We report mean average interval width (↓ better) over 5 runs. These results indicate that using CQR augmented with a self-supervised loss (SSCP-CQR), often improves vanilla CQR. CQR SSCP-CQR (Indep) SSCP-CQR (Shared) Dataset Overall concrete(n=1030) 0.904 0.532 community(n=1994) 1.733 star(n=2161) bike(n=10886) 0.196 0.620 Blog data (n=52397) 1.441 Facebook (n=81311) 1.274 0.866 0.505 1.603 0.198 0.623 1.402 1.220 0.894 0.512 1.685 0.208 0.650 1.405 1.292 Improving Adaptive Conformal Prediction Using Self-Supervised Learning Figure 8: Repeating the partially labeled experiments from Section 5.2.2 with CQR. Evaluating independent vs. shared representations and the inclusion of additional unlabeled data for various proportions of labeled data. Lower proportions of labeled data achieve the largest gains over standard CQR. C.4 Evaluating alternative self-supervised tasks & the source of gain C.4.1 High-level Goal. In the main manuscript, we have examined VIME as an example self-supervised task coupled with SSCP. We extend this analysis and explore a reconstructing autoencoder (AE) as an alternative self-supervised task. We refer to these as SSCP (AE) and SSCP (VIME). Analysis. We compare the performance of SSCP (VIME) and SSCP (AE) to CRF in Table 5. We find that, in general, the addition of the self-supervised loss is a useful feature, resulting in more adaptive intervals. That being said, VIME seems to provide greater performance improvements across a variety of datasets when compared to the AE. This is of course reasonable, as VIME has been shown to be a more performant self-supervised task in general for tabular data. Next, we take a deep-dive to understand the impact of the self-supervised task and where the improvements lie. Table 5: Assessing the impact of the SSL task on improving CRF, for two different self-supervised tasks (i.e. VIME and AE). We find in general that the self-supervision helps with VIME being more performant than AE as the self-supervised task. (↓ better) Dataset Method CRF SSCP(AE) SSCP(VIME) concrete(n=1030) community(n=1994) star(n=2161) bike(n=10886) Blog data (n=52397) Facebook (n=81311) Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess Avg.Width Avg.Deficit Avg.Excess 0.768 0.099 0.263 2.602 0.355 1.030 0.293 0.036 0.120 0.720 0.164 0.244 3.474 3.084 1.292 1.917 1.956 0.584 0.794 0.117 0.276 2.667 0.382 1.068 0.261 ↓ 0.040 0.110 0.706 0.161 0.241 3.400 ↓ 3.095 1.246 1.872 ↓ 2.010 0.563 ↓ ↓ ↓ ↓ ↓ ↓ 0.743 0.098 0.253 2.462 0.361 0.967 0.263 0.031 0.100 0.690 0.161 0.232 3.360 ↓ 3.155 1.227 1.860 ↓ 1.998 0.554 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 0.10.20.30.40.5Proportion labeled data0.60.70.80.91.01.1Relative width (v. CQR)CQRSSCP (Labeled Only) - IndependentSSCP (Labeled + Unlabeled) - IndependentSSCP (Labeled Only) - SharedSSCP (Labeled + Unlabeled) - Shared Nabeel Seedat*, Alan Jeffares*, Fergus Imrie, Mihaela van der Schaar C.4.2 Deep-dive Goal. We now take a deep-dive to better understand the differences for SSCP with different self-supervised tasks, SSCP (VIME) and SSCP (AE). In addition, we seek to understand the gains from SSCP better. The analysis in this section is performed on the Star dataset. Analysis. We first compare the prediction intervals in low-dimensional space. Similar to the main manuscript, we reduce the dimensionality of the input features (X) using PCA to facilitate visualization. We plot PC1 vs. output y and compare the prediction intervals for SSCP (VIME) vs. SSCP (AE) vs. CRF. The results can be seen in Figure 9. We see that, in general, CRF results in wider intervals compared to the SSCP variants. Additionally, SSCP (VIME) generally outperforms SSCP (AE) with narrower intervals. In the analysis that follows, we show that the majority of this gain in performance is achieved on the most uncertain examples in the more sparsely populated regions of input space. The implication is that the self-supervised loss is useful in informing the interval widths on the most uncertain examples where the highest inefficiency occurs. We also seek to better understand why SSCP (VIME) outperforms SSCP (AE). Beyond simply being a better self-supervised task in general (Yoon et al., 2020), we find that VIME loss also appears to have a stronger relationship with the predictive model's errors when compared to the autoencoder, with correlations of 0.33 and 0.06 respectively. Delving deeper beyond the mean correlation of SS loss with the main predictive model error. We find that the largest improvements in reducing interval width occur for samples that have the largest correlation of SS loss with the predictive model error ( 0.11-0.20), highlighting the importance of the relationship between SS loss and the predictive error itself. 0.35-45). We find limited improvement for samples with the lowest correlation ( ± ± As described in the main text, a stronger relationship between the self-supervised loss and the predictive model errors should typically result in a better residual model and, in turn, more efficient prediction intervals. This result confirms that hypothesis. The broader implication is that such considerations should be kept in mind when selecting the self-supervised task. Furthermore, these findings could be leveraged in future works for designing specific self-supervised tasks in the SSCP setting such that the task should seek to explicitly increase this correspondence. Figure 9: Comparing the prediction intervals in different regions. All variants of SSCP provide benefit in the sparser regions. The intervals are similar for SSCP (VIME) and SSCP (AE) in the denser regions, with SSCP (VIME) generally performing better. This is especially the case in the sparser regions with narrower intervals. We then continue the deep-dive to better understand the performance improvements. We specifically analyze the types of samples for which the self-supervised loss provides the greatest gains. Figure 10 orders the metrics sample-wise from largest to smallest. We can clearly see that the SSCP improvements are, in general, for those samples for which the metric is the highest in CRF. In other words, the self-supervision helps to improve the prediction intervals where the greatest inefficiency occurs on the most challenging samples with the greatest uncertainty. This is of course also the most natural target, as it is more challenging to improve prediction intervals that are already close to optimal. Figure 11 which illustrates the distribution of said metrics also confirms this insight. We note the reduction in the long tails of the distributions when augmenting with the self-supervised loss. To summarize, in general, SSCP largely improves the intervals on samples with higher uncertainty (i.e. larger intervals) which often correspond to regions of sparsity in the input space. These fine-grained improvements at the sample-level then translate into the dataset-level improvements to the prediction intervals reported in our experiments (Section 5). 5.02.50.02.55.0PC1012ySSCP (VIME)CRF IntervalSSCP (AE)True Improving Adaptive Conformal Prediction Using Self-Supervised Learning (a) Width (b) Excess (c) Deficit Figure 10: Comparing the metrics - ordered from the largest to smallest. We note that the benefit of SSCP for both VIME and AE is largely in reducing the excess width of the intervals on those samples for which it is greatest (i.e. the most inefficient intervals). (a) Width. (b) Excess (c) Deficit Figure 11: Comparison of the distributions of the metrics. We can clearly see that the addition of the self-supervision helps to reduce the long tails of the distributions corresponding to the most inefficient intervals. C.4.3 Robustness study Goal. We wish to assess the robustness of the intervals and their improvements over the different random runs. Conse- quently, we aim to assess the confidence interval (CI) gains (i.e. reductions) for SSCP (VIME) vs. CRF. Analysis. We assess the 90% CI's of the reduction in interval width (i.e. performance gain) across all datasets averaged across runs. The results are shown in Fig. 12. We find that SSCP is robust in the improvements, showing a net gain over CRF (with interval reductions) across all datasets. This result is indicative of the robustness of including the self-supervised signal to improve the conformal intervals. Figure 12: Assessing the 90% confidence interval gains - which implies width reductions across datasets, averaged across runs. We find that SSCP has a net reduction in intervals across all datasets, highlighting the robustness of the approach 0100200300400Samples0.00.51.01.52.0widthCRF: 0.48+-0.34SSCP (VIME): 0.25+-0.11SSCP (AE): 0.27+-0.100100200300400Samples0.000.250.500.751.00excessCRF: 0.21+-0.17SSCP (VIME): 0.09+-0.05SSCP (AE): 0.09+-0.05010203040Samples0.000.050.100.150.20deficetCRF: 0.03+-0.03SSCP (VIME): 0.03+-0.03SSCP (AE): 0.04+-0.04012width012345DensityCRF: 0.48+-0.34SSCP(VIME): 0.25+-0.11SSCP (AE): 0.27+-0.100.00.51.0excess02468DensityCRF: 0.21+-0.17SSCP(VIME): 0.09+-0.05SSCP (AE): 0.09+-0.050.00.10.20.3deficet0510152025DensityCRF: 0.03+-0.03SSCP(VIME): 0.03+-0.03SSCP (AE): 0.04+-0.04BikeBlogCommConcreteFbStarDataset0.000.050.100.15Mean interval width gain
http://arxiv.org/abs/2302.12645v1
2023-02-23T18:57:08
2023-02-23T18:57:08
Learning stiff chemical kinetics using extended deep neural operators
We utilize neural operators to learn the solution propagator for the challenging chemical kinetics equation. Specifically, we apply the deep operator network (DeepONet) along with its extensions, such as the autoencoder-based DeepONet and the newly proposed Partition-of-Unity (PoU-) DeepONet to study a range of examples, including the ROBERS problem with three species, the POLLU problem with 25 species, pure kinetics of the syngas skeletal model for $CO/H_2$ burning, which contains 11 species and 21 reactions and finally, a temporally developing planar $CO/H_2$ jet flame (turbulent flame) using the same syngas mechanism. We have demonstrated the advantages of the proposed approach through these numerical examples. Specifically, to train the DeepONet for the syngas model, we solve the skeletal kinetic model for different initial conditions. In the first case, we parametrize the initial conditions based on equivalence ratios and initial temperature values. In the second case, we perform a direct numerical simulation of a two-dimensional temporally developing $CO/H_2$ jet flame. Then, we initialize the kinetic model by the thermochemical states visited by a subset of grid points at different time snapshots. Stiff problems are computationally expensive to solve with traditional stiff solvers. Thus, this work aims to develop a neural operator-based surrogate model to solve stiff chemical kinetics. The operator, once trained offline, can accurately integrate the thermochemical state for arbitrarily large time advancements, leading to significant computational gains compared to stiff integration schemes.
[ "Somdatta Goswami", "Ameya D. Jagtap", "Hessam Babaee", "Bryan T. Susi", "George Em Karniadakis" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12645v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12645v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "physics.chem-ph", "@scheme": "http://arxiv.org/schemas/atom" }
[ "physics.chem-ph", "cs.LG" ]
Learning stiff chemical kinetics using extended deep neural operators Somdatta Goswami1,†, Ameya D. Jagtap1,†, Hessam Babaee2, Bryan T. Susi3, and George Em Karniadakis1,∗ 1 Division of Applied Mathematics, Brown University, 182 George Street, Providence, RI, 02912, USA 2 Department of Mechanical Engineering and Materials Science, University of Pittsburgh, Pittsburgh, PA 15261, USA 3 Applied Research Associates, Inc., Raleigh, NC, 27615-6545, USA 3 2 0 2 b e F 3 2 ] h p - m e h c . s c i s y h p [ 1 v 5 4 6 2 1 . 2 0 3 2 : v i X r a Abstract We utilize neural operators to learn the solution propagator for challenging systems of differential equations that are representative of stiff chemical kinetics. Specifically, we apply the deep operator network (DeepONet) along with its extensions, such as the autoencoder-based DeepONet and the newly proposed Partition-of-Unity (PoU-) DeepONet to study a range of examples, including the ROBERS problem with three species, the POLLU problem with 25 species, pure kinetics of a skeletal model for CO/H2 burning of syngas, which contains 11 species and 21 reactions and finally, a temporally developing planar CO/H2 jet flame (turbulent flame) using the same syngas mechanism. We have demonstrated the advantages of the proposed approach through these numerical examples. Specifically, to train the DeepONet for the syngas model, we solve the skeletal kinetic model for different initial conditions. In the first case, we parameterize the initial conditions based on equivalence ratios and initial temperature values. In the second case, we perform a direct numerical simulation of a two-dimensional temporally developing CO/H2 jet flame. Then, we initialize the kinetic model by the thermochemical states visited by a subset of grid points at different time snapshots. Stiff chemical kinetics are computationally expensive to solve within the context of reactive computational fluid dynamics simulations, thus, this work aims to develop a neural operator-based surrogate model to efficiently solve stiff chemical kinetics. The operator, once trained offline, can accurately integrate the thermochemical state for arbitrarily large time advancements, leading to significant computational gains compared to stiff integration schemes. Keywords: Stiff problems, Scientific machine learning, Neural operators, Combustion. 1. Introduction The pace of discovery and advancement within the field of Scientific Machine Learning (SciML) is extraordinary, but equally impressive or even more so is the pace at which machine learning is successfully improving existing tech- nologies in classical engineering applications. Across the many disciplines comprising machine learning research, applications have been explored in the various fields of computational science and engineering; see, for example, [1, 2, 3, 4, 5]. This is significant because these diverse and independent computational modeling fields generally re- quire different solution algorithms, different levels of numerical resolution, or even vary in their sensitivity to physical principles. The efficacy of machine learning for applications that need to solve systems of ordinary or partial differ- ential equations (ODEs or PDEs) fast makes it particularly useful in the context of numerical modeling of transient combustion. Computational Fluid Dynamics (CFD) [6] practitioners who model combustion processes recognize that the state of practice in their field is limited by contemporary computational power. There is a great disparity between the depth of collective knowledge about how to properly model transiently reacting fluid flows versus the accommoda- tions and simplifications that are necessary given currently accessible computational resources. Be it the cost barrier for scalable cloud computing, the exclusivity of access to high-performance computing clusters, or even just finite memory or processing resources on personal computers, there are extant limitations that force various computational ∗Corresponding author Emails: george [email protected] † First two authors contributed equally. Preprint submitted to Journal modeling fields to make compromises between what should be done from a physical perspective, and what contempo- rary computational resources can actually realize. This is because the physical processes for transient, non-premixed combustion lead to a multi-scale problem, spanning orders of magnitude differences in spatio-temporal scales. Sub- tle inaccuracies or under-resolution of the most minute Kolmogorov scales manifest as much larger inaccuracies in the predicted macro-scale fluid behavior. In a typical transient combustion simulation, computational models must resolve processes occurring on the order of nanoseconds and at sub-micron spatial scales to properly capture relevant macro-scale effects that occur over milliseconds or more, and at meter-length scales. CFD codes can resolve these phenomena, but either the computational resources required or the wall-clock time to wait for a simulation preclude simulations of anything but simplified scenarios at such high resolutions. This severely limits the computational fidelity for realistically sized scenarios. Many techniques to alleviate the limitations imposed by stiff chemical reaction systems have been explored within the combustion modeling field. Time step splitting is still common practice to separate the chemistry evolution from the hydrodynamic evolution for example. It is also common to reduce full chemical kinetics models to their most skeletal form for more performant computations [7] or to further reduce certain reaction system equations through Quasi-Steady State (QSS) assumptions [8, 9] to help alleviate system stiffness. There are also procedures to bypass chemistry integration completely if possible, using techniques like Pope's In-Situ Adaptive Tabulation (ISAT) scheme [10, 11]. What these approaches all share in common, is an objective to reduce the computational burden of integrating finite rate chemistry. They vary in how this is achieved and in the consequences of their assumptions, but together they demonstrate the prevalence of simplifying combustion modeling problems at the cost of physical fidelity. The skeletal model and QSS approaches minimize the effects of deviating from a full mechanism, but fundamentally, they change the kinetic model. This could affect accuracy, but it also begets uncertainty in the simulation because the effect of the kinetic system simplification becomes one more variable that needs to be quantified to validate the simulation's results. Tabulation schemes like ISAT allow for error control such that inaccuracy can theoretically be minimized, but in the limit of zero introduced error, these methods are actually slower than finite rate chemistry because not much of the chemistry is being skipped but additionally the lookup step becomes more expensive as the state space grows. New approaches that enable very fast computation of changes to thermochemical states without compromising accuracy are highly desired, and Scientific Machine Learning is well suited to significantly improve the size and scope, or the speed, of transient reactive CFD simulations for combustion modeling. Holistic approaches of using Physics Informed Neural Networks (PINNs) [5], Deep Operator Networks (Deep- ONets) [12], or other deep learning approaches for emulating the solutions of ODEs or PDEs in their entirety have yielded impressive results. Methods from SciML offer many opportunities to propel combustion modeling research toward greater physical fidelity, but completely dispensing with conventional continuum PDE solvers like spectral methods or finite element/volume approaches is unlikely at this juncture. Reactive CFD is one application where the variety of specific problem parameters and variations in computational topologies span an intractable training set from which to learn entire solutions. Formulating SciML methods specifically for finite rate chemistry, however, is advantageous for multiple reasons. The first and most notable advantage is that finite-rate chemistry is known to be a bottleneck for the whole hydrodynamic system. Improvements to the speed of execution of finite-rate chemistry within the context of a reactive CFD simulation will therefore have a significant and positive impact. Additionally, the thermochemical behavior of a reacting system is inherently constrained to a low-dimensional manifold, and machine learning is adept at capitalizing on low-dimensional intrinsic dimensionalities. There are also inviolable physical parameters that can be built into loss functions to ensure physical inference predictions from learned models. In the literature, SciML methods are used to solve stiff ODEs effectively and efficiently. In the earlier work of Brown et al., [13], ResNet was used to solve the stiff-ODEs governed by the chemically reacting flows. They used the reduced hydrogen-air reaction model with eight species and 18 reactions [14]. In [15], Ji et al. employed PINNs for stiff chemical kinetics. In [16], Kim et al. proposed novel derivative calculation techniques for the stability of stiff ODE systems, and they were employed with deep neural networks with proper scaling. In [17], the authors proposed physics-informed random projection neural networks for solving the initial value problem for stiff ODE problems. For this purpose, the authors employed an extreme learning machine with one hidden layer network with radial basis functions. Similarly, De et al. [18] employed PINNs with a theory of functional connections and extreme learning machines for stiff chemical kinetics. In [19] Anantharaman et al. employed continuous-time Echo state networks for stiff quantitative systems pharmacology models. Recently, Zhang and Sankaran [20] proposed an autoencoder neural network-based reduced model to accelerate the simulation of chemical kinetic models with a large number of 2 thermochemical state variables. Our work develops procedures on how to learn solutions to stiff initial value problems using Deep Operator Networks (DeepONets), and how these algorithms are applied to finite rate chemical kinetics systems. DeepONets learn the stiff temporal evolution of chemical species' mass fractions over a given duration during offline training, so that inference from the learned algorithm can evolve the thermochemical state during a prospective simulation at a rate comparable to the hydrodynamic time scale, but without sacrificing the fidelity of the chemical system's transition path. Chemically reacting systems can frequently include many species that are not present for substantial periods of time, but that might only come into existence as products of one reaction and then immediately catalyze another reaction and be consumed just as quickly. These species are important to model but present a challenge to deep learning methods. We present results of using the DeepONet framework in several configurations to improve inference prediction accuracy with non-participatory species for stiff ODE systems, including finite rate kinetic models. 2. Problem Statement In this work, we consider four cases, the first case is the 3 species ROBER problem, the second case is the POLLU problem with 20 species, and the third and the fourth cases deal with a skeletal syngas mechanism for pure kinetics and turbulent flame, respectively. A brief discussion of the first two problems is provided alongside the results in Section 4. In this section, we will provide context for problems 3 and 4. This work aims to learn the solution propagator for ∆t = ∆tCFD, which is the time increment of advancing a CFD simulation for one iteration without the chemical source term, i.e. for passive transport. This time increment is dictated by the smallest flow time scale, which can be orders of magnitude larger than the chemistry time scales ∆tchm, i.e., ∆tCFD (cid:29) ∆tchm. The chemistry time-advancement ∆tchm is small either because of the difference between flow time scales and chemistry time scales, and/or because of the stiffness of the chemical reactions. Consider the chemical kinetics equation: dΦ dt = S (Φ), (1) where Φ ∈ Rns+1 is the time-dependent vector of the thermochemical (TC) state of the system that contains the mass fraction of ns species and temperature and S (Φ) : Rns+1 −→ Rns+1 is the chemical source term. The solution propagator is denoted by Ft+∆t : Rns+1 −→ Rns+1, whose action can be defined as: t Φ(t + ∆t) = Ft+∆t t (Φ(t)). (2) Eq. 1 governs the evolution of Φ(t). The kinetics evolution equation is an autonomous dynamical system and therefore, it is possible to learn Ft+∆t irrespective of t. Adopting this viewpoint, Φ(t) for any t represents an "initial condition" with ∆t = ∆tCFD. Learning Ft+∆t and Ft+∆t t can eliminate the stiffness issues imposed by Eq. 1 which is consequential for reactive flow simulations. advances this initial condition to the next time step. We aim to learn Ft+∆t t t t 3. Operator based frameworks To establish an accurate description of reacting flows, detailed chemical kinetic models with a large number of chemical species must be incorporated, resulting in a complex and stiff system of ODEs and PDEs. This section will examine three methodologies for building a surrogate solution operator that is accurate and effective for chemical processes and interactions with fluid dynamics that involve several scales and significant nonlinearity. In the first methodology, all TC state variables are learned to map to the same states in advance using a neural operator called DeepONet [12]. In the second, we proposed a Partition-of-Unity (PoU)-based DeepONet method, where the evolving basis of the trunk net satisfies the property of PoU. Finally, in the third methodology, a compact latent representation of the chemical kinetics model is created using an autoencoder, and this representation is used to train the neural operator to improve the kinetics model over time. Details of the three methodologies are presented in this section. 3 Figure 1: (a) DeepONet: The DeepONet architecture consists of two deep neural networks (DNNs), namely the branch and the trunk networks. The branch network encodes the input function and comprises of concentration of species and temperature at a given time step. The trunk network encodes the information related to the temporal coordinates at which the solution operator is evaluated to compute the loss function. (b) Multi-layer autoencoder integrated DeepONet to obtain a compact latent representation of the chemical kinetics model for a given time step. 4 3.1. Deep neural operator Building quick simulators for solving parametric PDEs [21] has become possible, thanks to the development of modern ML models. A new wave of techniques for speeding up the simulation of ODEs and PDEs is being proposed as the ML revolution continues to sweep the scientific community. Instead of discovering the PDE in an explicit form, it is usually important to have a substitute model of the PDE solution operator that can repeatedly simulate PDE solutions for different initial and boundary conditions. The neural operator, introduced in 2019 in the form of deep operator networks (DeepONet) [12], which is inspired by the universal approximation theorem of operators, fulfills this promise. The theory that ensures a small approximation error (that is, the error between the target operator and the class of neural networks in a given finite-size architecture) has a particular influence on the architecture of DeepONet. A nonlinear continuous operator is used in operator regression to map one infinite-dimensional function to another. The DeepONet architecture consists of two deep neural networks (DNNs): the branch, and the trunk networks. The branch network encodes the input function, X, comprising mass fractions, Y of ns species and temperature, T at a given time step, t. Specifically, X = {x1, x2, . . . , xNs }, where Ns is the total number of samples, xi = {Y 1 , Ti}, and i ∈ {1, Ns}. The trunk network encodes the information related to the temporal coordinates, ζ = {ti+ˆt1, ti+ˆt2, . . . , ti+ˆtnt }, at which the solution operator is evaluated to compute the loss function. Here, nt is the number of time steps. Consider an analytical or a computational model which simulates a physical process and represents a mapping between a vector of random variables, X ∈ RDin, and corresponding output quantities of interest (QoIs), y(ζ) ∈ RDout where Din = ns + 1 and Dout = nt × (ns + 1). The goal of the DeepONet is to learn the solution operator, G(X) that approximates the computational model and can be evaluated at continuous temporal coordinates, ζ (input to the trunk net). The output of the DeepONet for a specified input vector, xi ∈ X, is a scalar-valued function of ζ expressed as Gθ(xi)(ζ), where θ = (W, b) includes the trainable parameters (weights, W, and biases, b) of the networks. In DeepONet [12], the solution operator for an input realization, xi, is expressed as: i , . . . , Y ns i , Y 2 i Gθ(xi)(ζ) = p(cid:88) j=1 br j * tr j = p(cid:88) j=1 br j(xi) * tr j(ζ), (3) where br1, br2, . . . , brp are outputs of the branch network and tr1, tr2, . . . , trp are outputs of the trunk network. The trainable DeepONet parameters, denoted by θ in Eq. (3) are typically optimized by minimizing a typical regression loss. Although the original DeepONet architecture proposed in [12] has shown remarkable success, several exten- sions have been proposed in [22, 23] to modify its implementation and produce efficient and robust architectures. A schematic representation of the original DeepONet architecture is shown in Fig. 1(a). 3.2. Partition-of-Unity (PoU) based deep neural operator In PoU-DeepONet, the Partition-of-Unity (PoU) constraint is enforced on the outputs of the trunk net where the evolving basis satisfies the (cid:80)p j=1 tr j = 1 condition, where tr j are the outputs of the trunk net. The PoU is crucial for data interpolation. Additionally, PoU frequently allows extending local constructions to the whole space. The PoU-DeepONet is quite easy to implement. The loss function directly incorporates the PoU-based constraint as an additional penalty term. 3.3. Autoencoder integrated deep neural operator Solving the governing equations that evolve a large number of TC state variables becomes challenging for real- world applications. These equations also often involve multiple state variables, such as temperature, pressure, density, and species concentrations, which interact in complex ways. Hence, the solution to these equations often involves trade-offs between accuracy, computational efficiency, and simplicity. To accelerate such simulations, we present an autoencoder (AE)-based DeepONet approach in this section. An AE is a prominent nonlinear dimensionality reduction method that allows for increased compressibility of nonlinear data. As a result, it is extremely appealing for highly nonlinear chemical reaction systems. With AE, a more compact latent representation can be achieved to mitigate the negative effects induced by the acceptable and prevalent circumstance that many species' mass fractions are zero during combustion system integration. The fact that most of the potential TC states in a combustion system reside on or near a lower-dimensional manifold in spite of the vast number of species in detailed chemical kinetic models serves as the impetus for using an AE to resolve the highly nonlinear chemical kinetics. 5 i , z2 i , ..., znz In this work, we have employed multi-layer autoencoders (AE) [24] to obtain a compact latent representation of the chemical kinetics model for a given time step, t. Essentially, the AE defines the mapping between the full system, i }, i.e., F : Rns+1 → Rnz and H : Rnz → Rns+1, where nz (cid:28) ns + 1. In xi and a reduced system zi = {z1 AE, the encoding and decoding mappings are obtained via self-supervised learning. An encoder and a decoder, which are represented by the mappings F and G, respectively, make up the two components of the AE. The encoder takes the TC state vector X as input and compresses it into a much smaller vector Z at the latent layer, where zi ∈ Z. The compressed vector Z is referred to as the latent representation of X. The decoder takes the latent representation Z as input and reconstructs or maps it back to the original space, ˆX, where ˆx ∈ ˆX. The AE learns the representation by finding the optimal weights that minimize the difference between the output, i.e., reconstructed dataset ˆX and the input, i.e., the original dataset X composed of a large collection of TC state samples. To find a low-dimensional latent representation of the TC states, the AE is initially trained using a common regression loss. This makes it possible to trace the development of a chemical system by solving the initial TC equations and the equations of the latent representation. The DeepONet is then trained to learn the evolving kinetics of the latent space in the following step. To this end, the DeepONet learns the mapping, Gθ : Rnz → Rnt×nz , where the input to the branch network is the latent representation at time t, while the trunk network inputs ζ = {ti + 250, ti + 500, ti + 750, ti + 1000}, and nt = 4. We deploy the DeepONet for unobserved test samples after it has been trained and its parameters optimized. To obtain a representation of all the TC states at the time steps taken into account by ζ, the output of the DeepONet is used as input to the decoder, H. A schematic representation of the AE-integrated DeepONet architecture is shown in Fig. 1(b). 4. Results In this section, we discuss four examples that make use of the three DeepONet architectures we covered in Sec- tion 3. The TensorFlow library [25] has been used for the implementation. Tables 1 and 2 contain a list of the architectures employed for learning the dynamics of the problems discussed in this section. Table 1: DeepONet architectures for all four examples. Model Branch net Trunk net Activation function [1, 120, 120, 120, 100] [1, 120, 120, 120, 100] [14, 128, 128, 128, 120] [ld+2, 128, 128, 128, 10×ld] [12, 128, 128, 128, 120] [ld, 128, 128, 10×ld] Example 1 Example 2 Example 3(a) Example 3(b) Example 4(a) Example 4(b) (a) denotes the architecture for learning dynamics using the DeepONet framework. (b) denotes the architecture for learning dynamics using the Autoencoder-integrated DeepONet framework. [1, 120, 120, 120, 120, 100] [1, 120, 120, 120, 120, 100] [1, 128, 128, 128, 120] [1, 128, 128, 128, 10×ld] [1, 128, 128, 128, 120] [1, 128, 128, 10×ld] Sine (Adaptive [26, 27]) Sine (Adaptive [26, 27]) Tanh Leaky ReLU Tanh Tanh Table 2: Architecture of multi-layer autoencoders (MLAE). Application MLAE Example 3 Example 4 [12, 128, 128, 128, ld, 128, 128, 128, 12] [10, 256, 64, ld, 64, 128, 10] ld 6 2 Activation function Leaky ReLU Leaky ReLU 6 4.1. Example 1: ROBER problem Robertson's equations, denoted as ROBER, are one of the prominent stiff systems of ODEs. It is given by the following reaction network: A B + B B + C k1−→ B, k2−→ C + B, k3−→ A + C. (4) (5) (6) The reaction rate constants are given by k1 = 0.04, k2 = 3 × 107, k3 = 104, and the initial conditions are given by y1(0) = 1, y2(0) = 0, y3(0) = 0, where y1, y2, y3 denote the concentrations of the species A, B, C, respectively. The evolution of the species concentrations can be described by the following ODEs: dy1 dt dy2 dt dy3 dt = −k1y1 + k3y2y3, = k1y1 − k2y2 2 − k3y2y3, = k2y2 2. (7) (8) (9) In this section, we shall solve the ROBER problem using PoU-DeepONet. The PoU constraint is enforced on the outputs of the trunk net where the formed basis satisfies the (cid:80)p j=1 tr j = 1 condition. The input/output dataset is generated for three species y1, y2, y3 by parameterizing them. The data is divided into training and testing (validation). We used a sine activation function that is locally adaptive [26, 27]. Rowdy activations [28] can also be used to accelerate the training, especially when a multi-modal dataset is involved. The comprehensive survey about the activation functions is given in [29]. Once the PoU-DeepONet is trained over these data sets, we use extrapolated input data to infer the output. Figure 2 shows the training and validation data sets for y1, y2 and y3 in the first two columns, and the corresponding PoU-DeepONet result (last column) for extrapolated data, respectively. Table 3 shows the number of training, validation, and extrapolation data sets along with their domain range for all the species, y1, y2, and y3. The maximum point-wise errors with mean and standard deviation (for 10 different realizations) are given in the last row. Table 3: ROBER problem: The details of training, validation (testing), and extrapolation data sets for the three species, y1, y2, and y3. The corresponding maximum point-wise errors with mean and standard deviation (for 10 different realizations) are shown in the last row. Note that, each species is approximated by individual PoU-DeepONet with the same architecture shown in table 1. #Training Data (Range) # Validation Data (Range) # Extraploation Data (Range) Max. Point-wise error (Mean & Std. Deviation) y1 901 (1 ≤ y1 ≤ 10) 401 (0.1 ≤ y1 ≤ 2) 10 (12 ≤ y1 ≤ 16) DeepONet-1 601 (0 ≤ y2 ≤ 5e − 5) 401 (3e − 5 ≤ y2 ≤ 8e − 5) 23 (0.8e − 4 ≤ y2 ≤ 3e − 4) y2 DeepONet-2 601 (2.5e − 6 ≤ y2 ≤ 4.85e − 5) 401 (3.2e − 6 ≤ y2 ≤ 7.2e − 5) 23 (0.7e − 4 ≤ y2 ≤ 1.9e − 4) DeepONet-3 601 (2.5e − 5 ≤ y2 ≤ 4e − 5) 401 (3.5e − 5 ≤ y2 ≤ 4.5e − 5) 23 (0.4e − 4 ≤ y2 ≤ 0.5e − 4) y3 901 (0 ≤ y3 ≤ 9) 301 (7 ≤ y3 ≤ 11) 40 (10 ≤ y3 ≤ 14) 2.386e-2 ± 5.563e-3 5.752e-3 ± 7.462e-4 2.573e-3 ± 2.753e-4 1.543e-2 ± 6.930e-4 4.75e-2 ± 3.753e-3 4.2. Example 2: POLLU problem POLLU is an air pollution model developed at the Dutch National Institute of Public Health and Environmental Protection. It has 20 species and 25 reactions, given by dy dt = g(y(t)), y(0) = y0, y ∈ R20, t > 0, (10) 7 Figure 2: ROBER problem: Training data is shown in the left column, where the input and output datasets for species y1, y2 and y3 are shown in black and red ×, respectively. The green line shows the exact solution for the ROBER system. Similarly, the testing data is shown in the middle, and the corresponding PoU-DeepONet result for extrapolated data is shown in the right column for species y1, y2 and y3. 8 10-510-210110401234567891010-510-210110400.20.40.60.811.21.41.61.8210-510-210110402468101214161810-510-210110400.511.522.533.544.5510-510-510-210110401234567810-510-510-210110400.511.522.5310-410-510-210201234567891010-510-210277.588.599.51010.51111.510-510-21021010.51111.51212.51313.51414.5 where y = [y1, y2, * * * , y20], y0 = [0, 0.2, 0, 0.04, 0, 0, 0.1, 0.3, 0.01, 0, 0, 0, 0, 0, 0, 0, 0.007, 0, 0, 0], g(y(t)) =   −r1 − r10 − r14 − r23 − r24 + r2 + r3 + r9 + r11 + r12 + r22 + r25 −r2 − r3 − r9 − r12 + r1 + r21 −r15 + r1 + r17 + r19 + r22 −r2 − r16 − r17 − r23 + r15 −r3 + 2r4 + r6 + r7 + r13 + r20 −r6 − r8 − r14 − r20 + r3 + 2r18 −r4 − r5 − r6 + r13 r4 + r5 + r6 + r7 −r7 − r8 −r12 + r7 + r9 −r9 − r10 + r8 + r11 r9 −r11 + r10 −r13 + r12 r14 −r18 − r19 + r16 −r20 r20 −r21 − r22 − r24 + r23 + r25 −r25 + r24   , and the reaction rates for all the species is given in table 4. The first two columns of Figure 3 show the training and Table 4: Reaction rates for POLLU model Reaction 1 2 3 4 5 6 7 8 9 10 11 12 13 r k1y1 k2y2y4 k3y5y2 k4y7 k5y7 k6y7y6 k7y9 k8y9y6 k9y11y2 k10y11y1 k11y13 k12y10y2 k13y14 k .350E+00 .266E+02 .120E+05 .860E-03 .820E-03 .150E+05 .130E-03 .240E+05 .165E+05 .900E+04 .220E-01 .120E+05 .188E+01 Reaction 14 15 16 17 18 19 20 21 22 23 24 25 r k14y1y6 k15y3 k16y4 k17y4 k18y16 k19y16 k20y17y6 k21y19 k22y19 k23y1y4 k24y19y1 k25y20 k .163E+05 .480E+07 .350E-03 .175E-01 .100E+09 .444E+12 .124E+04 .210E+01 .578E+01 .474E-01 .178E+04 .312E+01 validation datasets for y1, y2, y4, y7, and y12, and the corresponding PoU-DeepONet result (last column) for extrapo- lated data. Table 5 shows the number of training, validation, and extrapolation datasets along with their domain range for all the species yi, i = 1, * * * , 12. The mean and standard deviation of the maximum point-wise error (10 different realizations) in the PoU-DeepONet results are given in the last column. In all cases, PoU-DeepONet predictions are accurate for the extrapolated data. 4.2.1. Example 3: Syngas (Pure kinetics) In this example, we consider the kinetics of a skeletal model of syngas for CO/H2 burning. The skeletal mecha- nism has ns = 11 species and 21 reactions. This fuel is a key subset of higher hydrocarbon fuels, and it represents 9 Figure 3: POLLU problem: Training data is shown in the left column where the input and output dataset for species y1, y2, y4, y7 and y12 are shown in black and red ×, respectively. The green line shows the exact solution for the POLLU system. Similarly, the testing data is shown in the middle and the corresponding PoU-DeepONet result for extrapolated data is shown in the right column. 10 010203040506000.020.040.060.080.10.1201020304050600.050.060.070.080.090.10.110.120.130.1401020304050600.090.10.110.120.130.140.150.16010203040506000.10.20.30.40.50.60.70.801020304050600.40.50.60.70.80.9101020304050600.70.750.80.850.90.9511.051.11.151.2010203040506000.010.020.030.040.050.060.070.080.090.1010203040506000.020.040.060.080.10.120.14010203040506000.020.040.060.080.10.120.140.160.18010203040506000.050.10.150.20.250.30.350.401020304050600.20.250.30.350.40.450.501020304050600.250.30.350.40.450.50.550.60.650.70102030405060012345610-3010203040506022.533.544.555.566.510-30102030405060345678910-3 Table 5: Traning, validation (testing), and extrapolation data sets for POLLU problem using PoU-DeepONet. The corresponding maximum point-wise errors in terms of mean and standard deviation (for 10 different realizations) are shown in the last column. Note that, each species is approximated by individual PoU-DeepONet with the same architecture shown in table 1. Species y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 #Training Data (Range) 801 (0 ≤ y1 ≤ 0.08) 501 (0.1 ≤ y2 ≤ 0.8) 601 (0.0 ≤ y3 ≤ 0.4) 401 (0.0 ≤ y4 ≤ 0.1) 341 (0.0 ≤ y5 ≤ 0.5) 391 (0.01 ≤ y6 ≤ 0.4) 401 (0.2 ≤ y7 ≤ 0.3) 521 (0.3 ≤ y8 ≤ 0.5 ) 401 (0.01 ≤ y9 ≤ 0.03) 451 (0.0 ≤ y10 ≤ 0.25) 501 (0.0 ≤ y11 ≤ 0.4 301 (0.0 ≤ y12 ≤ 0.003 601 (0.0 ≤ y13 ≤ 0.01 801 (0.0 ≤ y14 ≤ 0.3 601 (0.0 ≤ y15 ≤ 0.25 501 (0.0 ≤ y16 ≤ 0.3 301 (0.007 ≤ y17 ≤ 0.01 601 (0.0 ≤ y18 ≤ 0.3 801 (0.0 ≤ y19 ≤ 0.2 501 (0.0 ≤ y20 ≤ 0.35 #Validation Data (Range) 351 (0.05 ≤ y1 ≤ 0.1) 301 (0.5 ≤ y2 ≤ 1) 331 (0.25 ≤ y3 ≤ 0.4) 201 (0.3 ≤ y4 ≤ 0.5) 251 (0.35 ≤ y5 ≤ 0.55) 221 (0.3 ≤ y6 ≤ 0.5) 301 (0.2 ≤ y7 ≤ 0.35) 401 (0.4 ≤ y8 ≤ 0.55) 261 (0.025 ≤ y9 ≤ 0.035) 281 (0.2 ≤ y10 ≤ 0.35) 421 (0.3 ≤ y11 ≤ 0.45) 201 (0.002 ≤ y12 ≤ 0.004 ) 501 (0.005 ≤ y13 ≤ 0.015) 501 (0.2 ≤ y14 ≤ 0.35) 421 (0.2 ≤ y15 ≤ 0.3) 301 (0.25 ≤ y16 ≤ 0.35) 231 (0.009 ≤ y17 ≤ 0.014) 441 (0.24 ≤ y18 ≤ 0.34 ) 511 (0.15 ≤ y19 ≤ 0.3) 321 (0.3 ≤ y20 ≤ 0.4) 11 #Extrapolation Data (Range) 11 (0.09 ≤ y1 ≤ 0.12) 14 (0.8 ≤ y2 ≤ 1.2) 12 (0.35 ≤ y3 ≤ 0.6) 6 (0.12 ≤ y4 ≤ 0.18) 10 (0.45 ≤ y5 ≤ 0.7) 8 (0.4 ≤ y6 ≤ 0.7) 20 (0.3 ≤ y7 ≤ 0.45) 14 (0.5 ≤ y8 ≤ 0.65 ) 12 (0.03 ≤ y9 ≤ 0.05) 8 (0.3 ≤ y10 ≤ 0.5) 12 (0.4 ≤ y11 ≤ 0.8 ) 12 (0.003 ≤ y12 ≤ 0.006) 20 (0.01 ≤ y13 ≤ 0.03) 20 (0.3 ≤ y14 ≤ 0.45) 14 (0.25 ≤ y15 ≤ 0.35) 16 (0.3 ≤ y16 ≤ 0.5) 16 (0.012 ≤ y17 ≤ 0.016) 20 (0.3 ≤ y18 ≤ 0.4) 12 (0.25 ≤ y19 ≤ 0.4) 18 (0.35 ≤ y20 ≤ 0.45) Max. Point-wise error (Mean & Std. Deviation) 2.692e-3 ± 6.493e-4 1.893e-2 ± 9.426e-4 2.129e-2 ± 2.480e-3 4.495e-3 ± 7.426e-4 1.495e-2 ± 2.006e-3 5.484e-3 ± 4.727e-4 7.633e-3 ± 2.523e-4 1.009e-3 ± 4.065e-4 3.683e-3 ± 7.473e-4 5.388e-3 ± 4.331e-4 3.638e-2 ± 6.999e-4 6.673e-3 ± 4.425e-4 1.405e-2 ± 3.539e-3 2.993e-3 ± 5.536e-4 3.699e-3 ± 6.678e-4 9.076e-3 ± 1.538e-4 3.584e-2 ± 7.858e-4 5.526e-3 ± 4.426e-4 4.411e-3 ± 5.748e-4 5.308e-3 ± 3.759e-4 syngas. The fuel consists of 50% CO, 10% H2 and 40% N2 and the oxidizer consists of 25% O2 and 75% N2. For training, we generated data for different equivalence ratios in the range of φ0 = [0.7, 1.4] and different initial tempera- tures in the range of T 0 = [500, 1250] (K). The initial temperature was sampled at 300 uniformly distributed points in this range. The equivalence ratio was sampled at 100 uniformly distributed points in the range shown above. Overall, we performed 300 × 100 = 30,000 simulations of the kinetics equation for all the combinations of initial temperature values and equivalence ratios. For time integration, we use explicit fourth-order Runge Kutta with ∆tchm = 10−8 (sec). For this example, to develop an efficient surrogate model, we learn the dynamics with a DeepONet as well as with an autoencoder integrated with DeepONet. Learning the dynamics using DeepONet: To train the DeepONet, we randomly chose Ntrain = 10,000 realizations (out of 30,000) of xi, such that each realization consists of the mass fractions, Y j i of ns = 11 species, where j = {1, 2, . . . , 11}, temperature, Ti at time step ti, where i = {1, 2, . . . , Ntrain} and the parameterized initial conditions, φ0 i , which denote the initial equivalence ratio and the initial temperature, respectively. Hence, xi = {Y 1 i , Y 2 i=1 . The trunk net inputs the temporal coordinate which is the time steps ahead of the initial time step at which the species concentration and the temperature are to be computed. The input and the output space of the training data are normalized using QoI specific mean, μi, and standard deviation, σi of the logarithmic value of the corresponding values. For testing the accuracy of the trained DeepONet model, we sampled Ntest = 30,000 realizations from the generated data. The DeepONet model trained with Eq. 3, reported a mean relative L2 error of 0.3% for the unseen test dataset. The plots for the one sample testing case are presented in Fig. 4. i } and Xtrain = {xi}Ntrain i and T 0 i i , . . . , Y ns , Ti, φ0 i , T 0 Figure 4: DeepONet (without AE) for syngas (pure kinetics): Representative plots for two testing cases with initial temperature, T0 = 1051.7241 (red solid line and blue ∗ markers) and T0 = 1155.1724 (blue solid line and green ∗ markers) and the same equivalence ratio, φ0 = 0.77778. The solid lines represent the ground truth, and the ∗ markers represent the predicted values for the QoIs. 12 Figure 5: AE+DeepONet results for syngas (Pure kinetics): Representative plots for two testing cases with T0 = 1051.7241 (red solid line and blue ∗ markers) and T0 = 1155.1724 (blue solid line and green ∗ markers) with the same equivalence ratio, φ0 = 0.77778. The solid lines represent the ground truth, and the ∗ markers represent the predicted values for the QoIs. 200 Learning the dynamics using Autoencoder + DeepONet: Now we explore the methodology discussed in Section 3.3 to build an efficient surrogate model for approximating the dynamics of the chemical reaction. For the syngas combustion with an original dimension of ns + 1 = 11 + 1, we examine the dimension of the latent versus different levels of accuracy loss. To train the AE, we sampled Ntrain = 30,000 realizations of xi, such that each realization consists of the mass fractions, Y j i of ns = 11 species, where j = {1, 2, . . . , 11} and temperature, Ti at time step ti. The training and testing data is normalized with a mean and standard deviation on the logarithmic value of the values. Fig. 6 shows the errors with the reconstruction error of the AE for different nz = {1, 2, ..., 6} which is computed Ntest = 20,000 unseen samples. We observe that for nz > 6, the reconstruction error saturates. Therefore, we use nz = 6 as the latent dimension for further training in the DeepONet. To prepare training data for DeepONet, we define Z = {z1, x2, . . . , zNtrain}, where zi = {z1 i }. In this setup, we learn the mapping Gθ : Rnz+2 → Rnt×nz . We perform a standard scaling before we train the DeepONet with Z. The DeepONet model trained with Eq. 3, reported a mean relative L2 error of 0.01% for the unseen test dataset on the latent dimension. The solution predicted by DeepONet on the latent dimension is used as inputs to the pre-trained decoder and the mean relative L2 error of the integrated setup is 0.1%. The plots for the one testing case are presented in Fig.5. Additionally, we report the training cost of two approaches discussed previously for this problem in Table 6 (first row) and show that learning the dynamics using the AE+DeepONet framework is significantly cheaper than training the DeepONet on the full-dimension dataset. After training the networks, the inference time for testing new samples is typically very fast, taking only a fraction of a second, ∼ O(10−2) second. i , ..., znz i , φ0 i , T 0 i , z2 13 Figure 6: Relative L2 errors obtained for the test cases while learning the dynamics of syngas (Pure kinetics) with AE+DeepONet and DeepONet framework. The computed error for the AE+DeepONet framework consists of the reconstruction error of the AE (shown with blue bars) and the generalization error of the DeepONet (shown with red bars), which has been trained on the latent space obtained from the AE. The plot shows the reconstruction error of AE and the generalization error of DeepONet with different latent dimensions, ld. Furthermore, the accuracy of the AE+DeepONet framework is compared with the accuracy when DeepONet is trained on the full dimension (shown with a yellow bar). 4.2.2. Example 4: Syngas (Turbulent flame) For the final demonstration, we consider the same syngas mechanism as in the previous demonstration for a temporally developing planar CO/H2 jet flame. This turbulent flame has been the subject of previous detailed direct numerical simulation (DNS) [30, 31, 32, 33, 34, 35, 36, 37]. In particular, the problem setup considered here is identical to the one used recently in [37]. The configuration as considered here is the two-dimensional version of that in [30]. The flame is rich with strong flame-turbulence interactions, resulting in local extinction followed by re-ignition. The jet consists of a central fuel stream of width H = 0.72mm surrounded by counter-flowing oxidizer streams. The fuel stream is comprised of 50% of CO, 10% H2 and 40% N2 by volume, while oxidizer streams contain 75% N2 and 25% O2. The initial temperature of both streams is 500K and thermodynamic pressure is set to 1 atm. The velocity difference between the two streams is U = 145m/s. The fuel stream velocity and the oxidizer stream velocity are U/2 and −U/2, respectively. The initial conditions for the velocity components and mixture fraction are taken directly from center-plane DNS in [30], and then the spatial fields of species and temperature are reconstructed from a flamelet table generated with χ = 0.75χcrit, where χ and χcrit are scalar dissipation rate and its critical value respectively. The boundary conditions are periodic in stream-wise (x) and cross-stream-wise (y) directions. The Reynolds number based on U and H is Re = 2510. The sound speeds in the fuel and the oxidizer streams are denoted by C1 and C2, respectively, and the Mach number Ma = U/ (C1 + C2) ≈ 0.16. The combustion chemistry is modeled via the syngas mechanism [33] containing 11 species with 21 reaction steps. The computational domain is a rectangle with a length of Lx = 8.625 mm and a height of Ly = 10.065 mm, where 0 ≤ x ≤ Lx and −Ly/2 ≤ y ≤ Ly/2. The DNS of the base reactive flow is conducted via a Fourier spectral solver with Nx = 576 and Ny = 672 Fourier modes in x and y directions, respectively. Therefore, the total number of grid points is roughly equal to 387,000. This amounts to a uniform mesh in both x and y directions with an approximate size of ∆x = ∆y = 0.015 mm. Simulations are conducted for the duration 0 ≤ t ≤ 26t j, t j = H/U. The compressible Navier Stokes equations and the species transport equation are solved using the fourth-order Runge Kutta scheme with the constant ∆t = 10−8 (sec). This amounts to roughly 13,000 time steps for the entire simulation. This ∆t is small enough to allow an explicit time to be used for the integration of the kinetic terms. Only a subset of the data generated by the DNS is used for DeepONet training. In particular, the training data are taken from a rectangle with the bounds of 0 ≤ x ≤ 8.625 mm and −2 ≤ y ≤ 2 mm. This selected region includes the 14 23456710-210-1100AutoencoderDeepONetDeepONet w/o AE entire width of the computational domain (in the x direction) and only a segment of the computational domain in the y direction, which is large enough to encompass the jet stream evolution during the time of the simulation. Moreover, not all of the DNS grid points within this region are used for DeepONet training. In particular, only 5, 000 grid points that are uniformly distributed in this region are chosen for training. Note that there are roughly 154, 000 DNS grid points within this region. Therefore, the selected points are about 3.25 % of the DNS grid points in this rectangle. The DeepONet is trained for ζ = {ti + ˆt1, ti + ˆt2, . . . , ti + ˆtnt }, where nt = 4 and t1 = 250∆t, t2 = 500∆t, t3 = 500∆t, and t4 = 1, 000∆t. For preparing the training dataset, we take input to the branch network as the chemical description at the time step following the reset of the CFD solver, to learn the kinetics description after 250, 500, 750, and 1000 time steps. The details of preparing the training dataset are discussed in subsequent sections. For testing the trained model, we use a new simulation, where the trained operator network is employed to predict the kinetics description from time = [0, 13000]∆t, when the kinetics solver is not reset. The output of the DeepONet at the 1000-th time step is considered an initial condition for the next 1000 time steps and is taken as an input to the branch network. Details regarding the training and testing of the two frameworks are presented below. Figure 7: DeepONet (without AE) for syngas (turbulent flame): Representative plots of temperature and 5 species to show the advancement of 1000 time steps for a given initial condition. The remaining species are shown in Fig. 8. The plots presented here are for a non-recursive update of the input to the branch network of DeepONet. Learning the dynamics using DeepONet: To train the DeepONet, we sample Ntrain = Nt × Np realizations, where 15 Figure 8: DeepONet (without AE) for syngas (turbulent flame): Representative plots of 5 species to show the advancement of 1000 timesteps for a given initial condition. The species shown in this plot are in addition to the species presented in Fig. 7. The plots presented here are for a non-recursive update of the input to the branch network of DeepONet. 16 Figure 9: Error growth in DeepONet (without AE) for syngas (turbulent flame): The plot presents the growth of error when the inputs of the model are recursively updated with the outputs of the model from the previous timestep. In this plot, the red line depicts a scenario when the temperature, as well as the mass fractions, are recursively updated from outputs of the model, while the blue line depicts a scenario when only the mass fractions of the species are updated but the temperature of the current step is provided from the ground truth. The green line is shown as a benchmark line to show that in both scenarios, the error growth is sub-linear. i i , Y 2 i , . . . , Y ns , Ti} and Xtrain = {xi}Ntrain Nt = 13 is the number of times the CFD solver has been reset and Np = 5000 is the discretization of the domain of study. Each realization xi ∈ X comprises of the mass fractions, Y j i of ns = 11 species, where j = {1, 2, . . . , 11} and temperature, Ti, where i = {1, 2, . . . , Ntrain}. Hence, xi = {Y 1 i=1 . The trunk net inputs the temporal coordinates, which are the time steps ahead of the initial time step at which the species concentration and the temperature are to be computed. The input and the output space of the training data are normalized using QoI specific mean, μi, and standard deviation, σi of the corresponding species. For testing the accuracy of the trained DeepONet model, we sampled Ntest = Nt,test × Np realizations, where Nt,test = 50,000 time steps. The testing is carried out as two experiments. In the first experiment, we consider Ntest initial conditions as input to the branch net and predict the dynamics of the setup which would be 250, 500, 750, and 1000 time steps ahead. This experiment reported a mean relative L2 error of 0.03% for the test dataset. The plots for the one sample testing case is presented in Figs. 7 and 8. In the second experiment, we recursively obtain the kinetics description of t = {2, 50000}, by starting with the first time step as inputs to the branch net and then using the prediction of the trained model as input to the DeepONet to predict the next time steps. In this experiment, we observe the accumulation of errors as we march ahead in time. In Fig. 9, we present the error accumulation plot for two different test cases. The error growth curve shown with the red line is a scenario when the input to the DeepONet model is recursively updated with the temperature and the mass fractions obtained as outputs from the DeepONet at an earlier time step. Additionally, the blue line denotes the scenario for obtaining the predictions at 1000 timesteps ahead, only the mass fractions of the species are recursively updated as inputs to the model, but the ground truth of temperature is provided from the labeled dataset for the current timestep. The results indicate that some sort of information needs to be updated in the model to correct the dynamics and approximate the time evolution accurately. To control the error growth over time, one approach is to employ the hybrid scheme proposed in [24]. The approach involves iterating between the high-fidelity solver and the surrogate model, such that the high-fidelity model acts as a corrector of the dynamics and the surrogate model helps the leap in time. Furthermore, in Fig. 9, we also show that the error growth in both test cases is sub-linear. Additionally, exploring the ideas of operator-level transfer learning [38, 39] can also help in keeping the error growth within a certain pre-decided bound. This will be considered in future work. Learning the dynamics using Autoencoder + DeepONet: Now we explore the framework discussed in Section 3.3 to build an efficient and robust surrogate model for ap- 17 10002000300040005000600070008000900010000Time steps024681012141618Temperature and mass fractions recurvisely updatedMass fractions recurvisely updatedHypothesis: Linear error growth proximating the dynamics of the chemical reaction in latent space. For this example, the original dimensionality is ns + 1 = 11 + 1. To train the AE, we used 0.8 × Ntrain realizations of X and tested the reconstruction error on 0.2 × Ntrain realizations. The training and testing data is normalized with a mean and standard deviation on the logarithmic value of the training data. In this example, we observed that for nz > 2, the reconstruction error saturates. So we use nz = 2 as the latent dimension for further training in the DeepONet. To prepare training data for DeepONet, we define Z = {z1, x2, . . . , zNtrain}, where zi = {z1 i }, which is the latent representation of the training data discussed above. Essentially, we learn the mapping Gθ : Rnz → Rnt×nz . We perform a standard scaling on Z before we train the DeepONet. The DeepONet model trained with Eq. 3, reported a mean relative L2 error of 0.01% for the test dataset on the latent dimension. The solution predicted by DeepONet on the latent dimension is used as inputs to the pre-trained decoder and the mean relative L2 error of the integrated surrogate model is 0.01%. The plots for the one sample testing case are presented in Figs. 10 and 11. Finally, the training cost of the two approaches used for this problem is shown in Table 6 (second row). Consistent with the previous example, learning the dynamics using the AE+DeepONet framework is significantly cheaper than training the DeepONet on the full-dimension dataset. Once the networks are trained, the inference time on unknown test samples is ∼ O(10−2) seconds. i , z2 Figure 10: AE + DeepONet for syngas (turbulent flame): Representative plots of temperature and 5 species to show the advancement of 1000 time steps for a given initial condition. The remaining species are shown in Fig. 11. The plots presented here correspond to a non-recursive update of the input to the branch network of DeepONet. 18 Figure 11: AE + DeepONet for syngas (turbulent flame): Representative plots of 5 species to show the advancement of 1000 timesteps for a given initial condition. The species shown in this plot are in addition to the species presented in Fig. 10. The plots presented here correspond to a non-recursive update of the input to the branch network of DeepONet. 19 Table 6: Comparison of the computational training time in seconds (s) for training DeepONet and AE+DeepONet frameworks across Examples 3 and 4 on an NVIDIA A6000 GPU. Once the networks are trained, the inference time on unknown test samples is of the order of 10−2 seconds. Test Case Example 3 Example 4 DeepONet AE+DeepONet 33,443 s 13,506 s 5,915 s 3,566 s 5. Summary In this study, we utilized the Deep Operator Network (DeepONet) to solve stiff problems, with a focus on chal- lenging chemical kinetics equations. The primary objective is to discover a solution propagator for time advancement that could exceed chemistry time scales by several orders of magnitude. We accomplished this by employing Deep- ONet, as well as its extensions, including the newly proposed Partition-of-Unity-based DeepONet and an autoencoder- integrated DeepONet. The neural operator-based approach has several advantages, with one of the most significant being the ability to train DeepONet offline, and later this model can be employed to approximate the solution for any arbitrary time advancements. In the first two examples, we solved the ROBERS problem, which includes three species, and the POLLU problem with 20 species and 25 reactions, and the operator was examined for its ability to extrapolate in the out-of-distribution zone. The results obtained show the accuracy of the DeepONet, which can be efficiently used as a solution propagator. In the third and the fourth example, we investigated the pure kinetics and the temporally developing turbulent flame of a skeletal model of syngas for CO/H2 burning, which involved 11 species and 21 reactions. The results of the DeepONet and autoencoder-based DeepONet frameworks show high accuracy. Moreover, compared to traditional CFD solvers for stiff-chemical kinetics, DeepONet is computationally very effi- cient. In future work, our aim is to integrate the DeepONet framework into the actual CFD code for solving such stiff chemically reacting problems, which can drastically reduce the computational cost. Data and materials availability All the associated codes accompanying this manuscript will be made publicly available upon the acceptance of the manuscript. Acknowledgement We would like to acknowledge the financial support of Small Business Technology Transfer (STTR) program, USA (Grant No: GR5291245). References [1] S. L. Brunton, J. L. Proctor, J. N. Kutz, Discovering governing equations from data by sparse identification of nonlinear dynamical systems, Proceedings of the National Academy of Sciences 113 (15) (2016) 3932–3937. [2] J.-X. Wang, J.-L. Wu, H. Xiao, A Physics-Informed Machine Learning Approach for Reconstructing Reynolds Stress Modeling Discrepancies Based on DNS Data, Physical Review Fluids 2 (3) (2017) 034603. [3] A. Karpatne, G. Atluri, J. H. Faghmous, M. Steinbach, A. Banerjee, A. Ganguly, S. Shekhar, N. Samatova, V. Kumar, Theory-guided data science: A new paradigm for scientific discovery from data, IEEE Transactions on Knowledge and Data Engineering 29 (10) (2017) 2318– 2331. [4] R. T. Chen, Y. Rubanova, J. Bettencourt, D. K. Duvenaud, Neural Ordinary Differential Equations, Advances in Neural Information Processing Systems 31. [5] M. Raissi, P. Perdikaris, G. E. Karniadakis, Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations, Journal of Computational physics 378 (2019) 686–707. [6] K. Aditya, A. Gruber, C. Xu, T. Lu, A. Krisman, M. R. Bothien, J. H. Chen, Direct numerical simulation of flame stabilization assisted by autoignition in a reheat gas turbine combustor, Proceedings of the Combustion Institute 37 (2) (2019) 2635–2642. [7] A. Nouri, H. Babaee, P. Givi, H. Chelliah, D. Livescu, Skeletal Model Reduction with Forced Optimally Time Dependent Modes, Combustion and Flame 235 (2022) 111684. [8] D. A. Goussis, Quasi steady state and partial equilibrium approximations: their relation and their validity, Combustion Theory and Modelling 16 (5) (2012) 869–926. [9] D. R. Mott, E. S. Oran, B. van Leer, A quasi-steady-state solver for the stiff ordinary differential equations of reaction kinetics, Journal of Computational physics 164 (2) (2000) 407–428. 20 [10] S. Pope, Computationally efficient implementation of combustion chemistry using in situ adaptive tabulation, Combustion Theory and Mod- elling 1 (1) (1997) 41–63. [11] L. Lu, S. B. Pope, An improved algorithm for in situ adaptive tabulation, Journal of Computational Physics 228 (2) (2009) 361–386. [12] L. Lu, P. Jin, G. Pang, Z. Zhang, G. E. Karniadakis, Learning nonlinear operators via DeepONet based on the universal approximation theorem of operators, Nature Machine Intelligence 3 (3) (2021) 218–229. [13] T. S. Brown, H. Antil, R. L ̈ohner, F. Togashi, D. Verma, Novel DNNs for Stiff ODEs with Applications to Chemically Reacting Flows, in: International Conference on High Performance Computing, Springer, 2021, pp. 23–39. [14] E. L. Petersen, R. K. Hanson, Reduced Kinetics Mechanisms for Ram Accelerator Combustion, Journal of Propulsion and power 15 (4) (1999) 591–600. [15] W. Ji, W. Qiu, Z. Shi, S. Pan, S. Deng, Stiff-PINN: Physics-Informed Neural Network for Stiff Chemical Kinetics, The Journal of Physical Chemistry A 125 (36) (2021) 8098–8106. [16] S. Kim, W. Ji, S. Deng, Y. Ma, C. Rackauckas, Stiff Neural Ordinary Differential Equations, Chaos: An Interdisciplinary Journal of Nonlinear Science 31 (9) (2021) 093122. [17] E. Galaris, G. Fabiani, F. Calabro, D. Serafino, C. Siettos, Numerical Solution of Stiff ODEs with Physics-Informed Random Projection Neural Networks, arXiv preprint arXiv:2108.01584. [18] M. De Florio, E. Schiassi, R. Furfaro, Physics-informed neural networks and functional interpolation for stiff chemical kinetics, Chaos: An Interdisciplinary Journal of Nonlinear Science 32 (6) (2022) 063107. [19] R. Anantharaman, A. Abdelrehim, A. Jain, A. Pal, D. Sharp, C. Rackauckas, et al., Stably Accelerating Stiff Quantitative Systems Pharma- cology Models: Continuous-Time Echo State Networks as Implicit Machine Learning, bioRxiv. [20] P. Zhang, R. Sankaran, Autoencoder Neural Network for chemically reacting systems, Journal of Machine Learning for Modeling and Computing 3 (4). [21] S. Goswami, A. Bora, Y. Yu, G. E. Karniadakis, Physics-Informed Deep Neural Operators Networks, arXiv preprint arXiv:2207.05748. [22] L. Lu, X. Meng, S. Cai, Z. Mao, S. Goswami, Z. Zhang, G. E. Karniadakis, A comprehensive and fair comparison of two neural operators (with practical extensions) based on FAIR data, Computer Methods in Applied Mechanics and Engineering 393 (2022) 114778. [23] K. Kontolati, S. Goswami, M. D. Shields, G. E. Karniadakis, On the influence of over-parameterization in manifold based surrogates and deep neural operators, Journal of Computational Physics (2023) 112008. [24] V. Oommen, K. Shukla, S. Goswami, R. Dingreville, G. E. Karniadakis, Learning two-phase microstructure evolution using neural operators and autoencoder architectures, npj Computational Materials 8 (1) (2022) 190. [25] A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, TensorfFlow: A System for Large-Scale Machine Learning, in: Proceedings of the 12th USENIX Conference on Operating Systems Design and Implementation, USENIX Association, 2016. [26] A. D. Jagtap, K. Kawaguchi, G. E. Karniadakis, Adaptive activation functions accelerate convergence in deep and physics-informed neural networks, Journal of Computational Physics 404 (2020) 109136. [27] A. D. Jagtap, K. Kawaguchi, G. Em Karniadakis, Locally adaptive activation functions with slope recovery for deep and physics-informed neural networks, Proceedings of the Royal Society A 476 (2239) (2020) 20200334. [28] A. D. Jagtap, Y. Shin, K. Kawaguchi, G. E. Karniadakis, Deep kronecker neural networks: A general framework for neural networks with adaptive activation functions, Neurocomputing 468 (2022) 165–180. [29] A. D. Jagtap, G. E. Karniadakis, How important are activation functions in regression and classification? a survey, performance comparison, and future directions, arXiv preprint arXiv:2209.02681 (2022). [30] E. R. Hawkes, R. Sankaran, J. C. Sutherland, J. H. Chen, Scalar mixing in direct numerical simulations of temporally evolving plane jet flames with skeletal CO/H2 kinetics, Proc. Combust. Inst. 31 (1) (2007) 1633–1640. [31] A. Aitzhan, A. G. Nouri, P. Givi, H. Babaee, Reduced Order Modeling of Turbulence-Chemistry Interactions using Dynamically Bi- Orthonormal Decomposition, arXiv preprint arXiv:2201.02097. [32] Y. Yang, H. Wang, S. B. Pope, J. H. Chen, Large-eddy simulation/probability density function modeling of a non-premixed CO/H2 temporally evolving jet flame, Proceedings of the Combustion Institute 34 (1) (2013) 1241–1249. [33] N. Punati, J. C. Sutherland, A. R. Kerstein, E. R. Hawkes, J. H. Chen, An evaluation of the one-dimensional turbulence model: Comparison with direct numerical simulations of CO/H2 jets with extinction and reignition, Proceedings of the Combustion Institute 33 (1) (2011) 1515– 1522. [34] S. Vo, A. Kronenburg, O. T. Stein, M. J. Cleary, MMC-LES of a syngas mixing layer using an anisotropic mixing time scale model, Combus- tion and Flame 189 (2018) 311–314. [35] S. Yang, R. Ranjan, V. Yang, W. Sun, S. Menon, Sensitivity of predictions to chemical kinetics models in a temporally evolving turbulent non-premixed flame, Combustion and Flame 183 (2017) 224–241. [36] B. A. Sen, E. R. Hawkes, S. Menon, Large eddy simulation of extinction and reignition with artificial neural networks based chemical kinetics, Combustion and Flame 157 (3) (2010) 566–578. [37] A. Aitzhan, S. Sammak, P. Givi, A. G. Nouri, PeleLM-FDF Large Eddy Simulator of Turbulent Combustion, arXiv preprint arXiv:2201.00898. [38] M. Zhu, H. Zhang, A. Jiao, G. E. Karniadakis, L. Lu, Reliable extrapolation of deep neural operators informed by physics or sparse observa- tions, arXiv preprint arXiv:2212.06347. [39] S. Goswami, K. Kontolati, M. D. Shields, G. E. Karniadakis, Deep transfer operator learning for partial differential equations under conditional shift, Nature Machine Intelligence (2022) 1–10. 21
http://arxiv.org/abs/2302.12235v2
2023-06-06T22:00:01
2023-02-23T18:54:27
Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows
Studying the dynamics of open quantum systems can enable breakthroughs both in fundamental physics and applications to quantum engineering and quantum computation. Since the density matrix $\rho$, which is the fundamental description for the dynamics of such systems, is high-dimensional, customized deep generative neural networks have been instrumental in modeling $\rho$. However, the complex-valued nature and normalization constraints of $\rho$, as well as its complicated dynamics, prohibit a seamless connection between open quantum systems and the recent advances in deep generative modeling. Here we lift that limitation by utilizing a reformulation of open quantum system dynamics to a partial differential equation (PDE) for a corresponding probability distribution $Q$, the Husimi Q function. Thus, we model the Q function seamlessly with off-the-shelf deep generative models such as normalizing flows. Additionally, we develop novel methods for learning normalizing flow evolution governed by high-dimensional PDEs based on the Euler method and the application of the time-dependent variational principle. We name the resulting approach $Q$-$Flow$ and demonstrate the scalability and efficiency of Q-Flow on open quantum system simulations, including the dissipative harmonic oscillator and the dissipative bosonic model. Q-Flow is superior to conventional PDE solvers and state-of-the-art physics-informed neural network solvers, especially in high-dimensional systems.
[ "Owen Dugan", "Peter Y. Lu", "Rumen Dangovski", "Di Luo", "Marin Soljačić" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12235v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12235v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "quant-ph", "@scheme": "http://arxiv.org/schemas/atom" }
[ "quant-ph", "cond-mat.dis-nn", "cond-mat.quant-gas", "cs.LG", "physics.comp-ph" ]
Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Owen Dugan 1 2 Peter Y. Lu 3 2 Rumen Dangovski 4 2 Di Luo 2 5 6 Marin Soljaˇci ́c 1 2 3 2 0 2 n u J 6 ] h p - t n a u q [ 2 v 5 3 2 2 1 . 2 0 3 2 : v i X r a Abstract Studying the dynamics of open quantum systems can enable breakthroughs both in fundamental physics and applications to quantum engineer- ing and quantum computation. Since the den- sity matrix ρ, which is the fundamental descrip- tion for the dynamics of such systems, is high- dimensional, customized deep generative neural networks have been instrumental in modeling ρ. However, the complex-valued nature and normal- ization constraints of ρ, as well as its compli- cated dynamics, prohibit a seamless connection between open quantum systems and the recent advances in deep generative modeling. Here we lift that limitation by utilizing a reformulation of open quantum system dynamics to a partial differential equation (PDE) for a corresponding probability distribution Q, the Husimi Q func- tion. Thus, we model the Q function seamlessly with off-the-shelf deep generative models such as normalizing flows. Additionally, we develop novel methods for learning normalizing flow evo- lution governed by high-dimensional PDEs based on the Euler method and the application of the time-dependent variational principle. We name the resulting approach Q-Flow and demonstrate the scalability and efficiency of Q-Flow on open quantum system simulations, including the dis- sipative harmonic oscillator and the dissipative bosonic model. Q-Flow is superior to conven- tional PDE solvers and state-of-the-art physics- informed neural network solvers, especially in high-dimensional systems. 1Department of Physics, Massachusetts Institute of Technol- ogy 2NSF AI Institute for Artificial Intelligence and Fundamental Interactions 3Data Science Institute, University of Chicago 4MIT EECS 5Center for Theoretical Physics, Massachusetts Institute of Technology 6Department of Physics, Harvard University. Corre- spondence to: Di Luo <[email protected]>. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 Figure 1. Q-Flow. We reformulate differential equations for den- sity matrix dynamics as PDEs for probability distribution dynamics. We use off-the-shelf normalizing flows and our Euler-KL method for solving such PDEs. 1. Introduction Understanding open quantum system dynamics is crucial for fundamental physics and high-impact scientific applica- tions such as quantum engineering and quantum computa- tion (Verstraete et al., 2009; Barreiro et al., 2011). The state of an open quantum system is given by the den- sity matrix ρ, which is an exponentially scaling object with a size that grows as N 2k for k subsystems each with a Hilbert space of dimension N . Thus, computing or evolv- ing ρ becomes infeasible as k increases due to the curse of dimensionality. Pioneering work on representing ρ in a compact form as a customized deep generative neural net- work has shown great promise in advancing the frontier of understanding high-dimensional quantum systems (Vicen- tini et al., 2019; Yoshioka & Hamazaki, 2019; Hartmann & Carleo, 2019; Nagy & Savona, 2019). However, a num- ber of computational challenges remain when solving for ρ, which motivates the development of novel machine learning methods. Notable challenges are: 1. The density matrix ρ is complex-valued and has the constraint tr[ρ] = 1. That makes it non-trivial to model with standard generative models that are real-valued. 2. The differential equation that governs the dynamics of ρ models complicated interactions in high-dimensional modeled with normalizing flows (ours) reformulation used in our work Euler method (ours) Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows space, which hampers the application of conventional differential equation solvers. ulating various open quantum systems. Our contributions can be summarized as follows: 3. Previous efforts to model ρ with neural networks are restricted to discrete spin systems, and it is unclear how to model ρ in continuous or bosonic systems. The state-of-the-art literature has addressed Challenge 1 by developing customized neural architectures for ρ in spin sys- tems with discrete degrees of freedom only (Vicentini et al., 2019; Yoshioka & Hamazaki, 2019; Hartmann & Carleo, 2019; Nagy & Savona, 2019; Luo et al., 2022b; Reh et al., 2021). Challenge 2 has been attempted by exploring physics- inspired training objectives, such as Physics-informed neu- ral networks (PINNs) (Raissi, 2018; Raissi et al., 2019). PINNs have shown promise in low-dimensional systems, but it is not clear how they can be scaled to high-dimensional PDEs. Furthermore, the existing literature has not addressed Challenge 3 and missed an opportunity to establish a di- rect connection between modeling continuous variable open quantum dynamics and novel deep generative models for standard machine learning benchmarks. Such a connection would drive progress in both machine learning applications for open quantum dynamics and deep generative modeling. In this paper, we address Challenges 1-3 by establishing a bridge between open quantum systems in a continuous Hilbert space and continuous-variable generative modeling. Firstly, we reformulate the problem by replacing the density matrix ρ with an alternative representation, the Husimi Q function Q (Carmichael, 1999b), which can be practically considered as a probability distribution. Thus, we enable the use of off-the-shelf generative neural networks to model Q. Because the optimization of high dimensional quantum sys- tems requires access to both easy sampling and probability density values, we use normalizing flows (Dinh et al., 2014; Rezende & Mohamed, 2015) as our generative model. Secondly, we develop novel methods for training normal- izing flows that obey complicated high-dimensional PDEs, which are an excellent fit for approximating Q. We propose a training method, the stochastic Euler-KL method, which is based on the forward discretization of the differential equa- tion for Q and the Kullback-Lieber matching of probability distributions. Our normalizing flows approach can also be equipped with the Time-Dependent Variational Principle (TDVP) method (McMillan, 1965), which can be derived from the Euler method and can be thought of as an analog of the natural gradient method (Amari, 1996; 1998). We name our contributions Q-Flow (see Figure 1). Q-Flow is a new approach to solving open quantum systems based on off-the-shelf normalizing flows and the Euler/TDVP methods for evolving such flows in complicated PDEs. We demonstrate that Q-Flow is scalable and efficient for sim- • A new generative modeling approach for open quantum dynamics with continuous degrees of freedom based on the Husimi Q function, which allows for using nor- malizing flows off the shelf. • New methods for solving open quantum dynamics PDEs using normalizing flows with stochastic Euler- KL method and TDVP. • Demonstration of the scalability and efficiency of our methods on simulations of dissipative harmonic os- cillator and dissipative bosonic models by surpassing conventional PDE solvers and state-of-the-art machine learning PDE solvers, physics-informed neural net- works (PINN). Importantly, with Q-Flow, the difficulty in simulating quan- tum dynamics is no longer the dimension of the simulation but instead the complexity of the Q function and its evolu- tion, which opens a new avenue for research. 2. Related Work 2.1. Neural Network Quantum States Neural network quantum states are generative neural net- work architectures-including restricted Boltzmann ma- chines (Carleo & Troyer, 2017), autoregressive models (Sharir et al., 2020; Luo et al., 2022a; Chen et al., 2022; Luo et al., 2021), and determinant neural network models (Pfau et al., 2020; Hermann et al., 2020; Luo & Clark, 2019)- that have been adapted to represent quantum wave functions or density matrices (in the case of open quantum systems) rather than probability distributions. They are optimized using variational quantum Monte Carlo methods and have primarily been applied to model discrete spin systems (Car- leo & Troyer, 2017; Sharir et al., 2020; Luo et al., 2022a) as well as tackle the continuous many-body wave function in quantum chemistry applications (Pfau et al., 2020; Hermann et al., 2020) and quantum field theories (Luo et al., 2022c; Martyn et al., 2022). In contrast with prior deep learning-based approaches that directly model the wave function or density matrix, our work focuses on the Q function representation of the quantum state-a continuous quasiprobability distribution (Carmichael, 1999b) that can be modeled using an appropri- ate generative model, e.g., normalizing flows. 2.2. Partial Differential Equation (PDE) Solvers To model the dynamics of an open quantum system using the Q function formulation, we are required to solve a high- 2 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows dimensional PDE. By parameterizing the Q function using a normalizing flow, our approach can efficiently solve this PDE. For comparison, we benchmark our work against alternative PDE solvers. Traditional PDE solvers struggle to handle high-dimensional PDEs due to the curse of dimensionality, where storing the state of the system on a grid or mesh grows expontentially with the dimension of the problem. As traditional solver benchmarks, we use finite-difference and pseudo-spectral methods (Courant et al., 1928; Fornberg, 1998). While there are specialized methods for solving high-dimensional PDEs, they are often complex to set up and only apply to a few restricted classes of PDEs, e.g., parabolic PDEs (Weinan et al., 2021). From such specialized methods, we benchmark against a Stochastic method (Martin et al., 2016). We also benchmark against physics-informed neural net- works (PINNs)-a promising deep learning-based varia- tional approach for solving PDEs (Raissi, 2018; Raissi et al., 2019; Berg & Nystr ̈om, 2019). PINNs, however, have been shown to have limitations related to the difficulty of the vari- ational optimization problem (Krishnapriyan et al., 2021) and, in their standard form, may also suffer from the curse of dimensionality. 3. Solving Open Quantum Dynamics with Q-Flow In this work, we develop Q-Flow, an approach to solving open quantum dynamics based on flow-based models un- der the Q function partial differential equation formulation. The key contributions of our work are twofold. Firstly, we establish a general framework for solving open quantum dynamics learning through the flow-based model represen- tation. Secondly, we develop optimization algorithms for solving high dimensional partial differential equations and apply them to PDEs for the Q function. Note that a more thorough review of the relevant Quantum Mechanics is pro- vided in Appendix A.1. 3.1. Quantum Overview The fundamental mathematical object in quantum mechan- ics is a complex vector space known as the Hilbert space. It is customary to use the notation |*⟩, known as a ket, for vectors in the Hilbert space. We also denote the conjugate transpose of |a⟩ as ⟨a|, where ⟨*| is known as a bra. The inner product of two kets |a⟩ and |b⟩ can be written as a bra-ket ⟨a|b⟩ . Operators on the Hilbert space can be thought of as complex- valued matrices. The most important operators are the Hamiltonian H, which governs the evolution of quantum systems, and the density matrix ρ, which describes the state of an open quantum system. A particularly ubiquitous Hilbert space is that corresponding to particle number. The particle number Hilbert space has basis kets written |n⟩, for n ∈ {0, 1, 2, . . .}, where |n⟩ represents a system with n particles. This Hilbert space is ubiquitous; it can also be used to represent many 1d bound systems. In particular, this Hilbert space appears in most bosonic and continuous quantum systems. In the particle number Hilbert space, there are special opera- tors, the creation and annihilation operators, which increase and decrease the number of particles, respectively. The cre- ation operator a† satisfies a† |n⟩ = n + 1 |n + 1⟩ and the annihilation operator a satisfies a |n⟩ = n |n − 1⟩ with a |0⟩ = 0. √ √ The coherent state |α⟩ with a complex number α is defined as |α⟩ = eαa†−α∗a |0⟩, where e should be interpreted as the matrix exponential function. Hilbert spaces of systems with multiple subsystems are tensor products of the subsystems' Hilbert spaces. Sup- pose we have two Hilbert spaces, H1 and H2. For ev- ery two kets |a⟩ ∈ H1 and |b⟩ ∈ H2, there exists a ket |a⟩ ⊗ |b⟩ ∈ H1 ⊗ H2, where |a⟩ ⊗ |b⟩ is the tensor product of |a⟩ and |b⟩ and H1 ⊗ H2 is the tensor prod- uct space of Hilbert spaces H1 and H2. The inner prod- uct for tensor products of Hilbert spaces is defined as (⟨a| ⊗ ⟨b|) (|c⟩ ⊗ |d⟩) = ⟨a|c⟩ ⟨b|d⟩, where ⟨a| ⊗ ⟨b| is the conjugate transpose of |a⟩ ⊗ |b⟩. If an operator O1 acts on H1 and O2 acts on H2, then (O1 ⊗ O2) acts on H1 ⊗ H2 according to (O1 ⊗ O2) |a⟩ ⊗ |b⟩ = (O1 |a⟩) ⊗ (O2 |b⟩). Finally, note that we often use shorthands such as O1 or O2 to referer to O1 ⊗ 1 or 1 ⊗ O2, respectively. 3.2. Open Quantum System As discussed in Section 1, in an open quantum system, the state is described as a complex-valued, unit-trace positive definite matrix ρ, known as the density matrix. The den- sity matrix is a generalization of the wave function in the Schr ̈odinger equation, which can be viewed as an ensemble of wave functions. A generic Markovian open quantum system has an evolution equation of the form ̇ρ = Lρ = −i[H, ρ] + Llossρ, (1) where H is the Hamiltonian matrix, Lloss is a dissipative operator, and [*, *] is the commutation operator between matrices, i.e., [A, B] = AB − BA. Often, H is composed of raising and lowering operators, a and a†. Here, L is a superoperator; given a matrix ρ, it returns a new matrix Lρ. Eq. 1 is a complex-valued high-dimensional differential equation, which is challenging to solve in general. Our work applies to open quantum systems with continuous degrees of freedom. Such systems include bosonic systems, 3 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows which arise in a variety of contexts (Cazalilla et al., 2011; Adesso et al., 2014). A bosonic particle, also known as a bo- son, is a type of fundamental particle in quantum mechanics that has continuous degrees of freedom. Bosonic systems may be composed of multiple sites, which are subsystems described by the particle number Hilbert space. Simulating quantum systems with continuous variables in- troduces higher-dimensional complexity compared to those with discrete variables, such as spin systems. Even for a 1-site continuous variable system, there is infinite degree of freedom. In practice, one workaround is to truncate the infinite degree of freedom to some large finite degree N . Even with truncation, k sites live in an exponentially-large- dimensional Hilbert space of size N k, which is generally intractable to simulation. In contrast, our approach works with the infinite degree-of-freedom Hilbert space directly. 3.3. Q Function Formulation The Husimi Q function (Carmichael, 1999a) provides an exact reformulation of Eq. 1 into a probabilistic differential equation: ̇Q = ̃LQ (2) where Q is the Husimi Q function, and ̃L is the Q-function evolution operator including the effects of H and Lloss. Mathematically, the Q function of n sites is defined as Q(⃗q, ⃗p) = Q(⃗α, ⃗α∗) = 1 π ⟨⃗α| ρ |⃗α⟩ , where ⃗α = ⃗q + i⃗p is a complex number, and |⃗α⟩ = |α1⟩ ⊗ * * * ⊗ |αn⟩ is a tensor product of coherent states.1 Q(⃗α, ⃗α∗) ≥ 0 for any ⃗α and (cid:82) Q = 1, so Q can be interpreted as a probability distribution in practice. We use the notations Q(⃗q, ⃗p) and Q(x) interchangeably. To use the Q function formalism, we must convert between the ρ and Q functions and obtain ̃L. We provide the key conversion formulas and the corresponding proofs in Ap- pendix A. 3.4. Q-Flow representation: Flow-based Generative Models of Q function One important feature of our work is to represent the Q function with off-the-shelf flow-based generative models. This distinguishes our work from previous works (Vicen- tini et al., 2019; Yoshioka & Hamazaki, 2019; Hartmann & Carleo, 2019; Nagy & Savona, 2019) that represent the 1Although α and α∗ are both input to Q, it is customary in physics and complex analysis to write Q(α, α∗) instead of Q(α). high dimensional complex-valued density matrix using cus- tomized neural networks. There are several advantages of our approach: i) we do not work with complex-valued func- tions, which could be complicated by the sign structure problem (Westerhout et al., 2020). ii) Q-Flow is natural iii) Q- for systems with continuous degrees of freedom. Flow allows normalized probability modeling with exact sampling, which is important for solving high dimensional probabilistic PDEs with the stochastic Euler method. Normalizing Flows. Normalizing flows are generative models for continuous probability distributions that provide both normalized probabilities and exact sampling-making them ideal for modeling the continuous Q function in our ap- proach. Normalizing flows transform a simple initial density pX (often a unit-normal distribution) to a target density pY (i.e., the distribution that we want to model) via a sequence of invertible transformations (Dinh et al., 2014; Rezende & Mohamed, 2015). The invertible transformations are usually parameterized by an invertible neural network architecture y = fθ(x) with x ∼ pX and y ∼ pY . The target probability density is then given by pY (y) = pX (f −1 θ (y)) (cid:12) (cid:12) (cid:12) (cid:12) (y) ∂f −1 θ ∂y (cid:12) (cid:12) (cid:12) (cid:12) . Many choices of fθ are available, including affine coupling layers (RealNVP) (Dinh et al., 2017), continuous normal- izing flows (CNF) (Grathwohl et al., 2019), and convex potential flows (CP-Flow) (Huang et al., 2021). While Real- NVP is the simplest to implement, affine coupling layers are less expressive than CNFs or CP-Flows, which are provably universal density estimators (Huang et al., 2021). Because of Equation 12, we would like our flow to be infinitely differ- entiable, which is satisfied by the above flow architectures. Theorem 3.1. For a Q function from a given density matrix ρ, there exists a universal approximation with a Q-Flow representation. Proof. For any given density matrix ρ, there is a correspond- ing Qρ which satisfies Qρ ≥ 0 and (cid:82) Qρ = 1. Since it has been shown that normalization flow is a universal ap- proximator of probability distribution (Huang et al., 2021), there exists a Q-Flow representation Qf such that it can be arbitrarily close to Qρ. Theorem 3.2. For any local observable expected value to be computed with respect to ρ, there exists a Q-Flow representation which can compute the observable efficiently. Proof. We prove the single-site case here and the multi-site case follows from the tensor product structure of the Hilbert space. Consider the corresponding Q function Qρ of ρ. Con- sider a local observable in the form of O = ama†n +ana†m. WLOG, we can consider O = ama†n and the other part can 4 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows be done in a similar way. its expectation⟨O⟩ρ = tr(ρama†n). Eq. A.5 in Appendix shows that it can be equivalently com- puted by (cid:82) (q + ip)m(q − ip)nQρ(p, q)dpdq, which is a polynomial moment of the Q function. Since normaliza- tion flow is a universal approximator, there exists a Q-Flow representation Qf can be arbitrarily close to Qρ, which implies that ⟨Q⟩f can be arbitrarily close to ⟨Q⟩ρ. Even though computing ⟨Q⟩f = (cid:80) (q + ip)m(q − ip)n has stochastic fluctuation, the exact sampling nature of the flow-based model can suppress the statistical error, which will decay with increasing sample size Ns as due to the Central Limit Theorem. (q,p)∼Qf 1√ Ns 3.5. Q-Flow Optimization: Stochastic Euler-KL Method In the previous section, we discuss the representation of the Q function with flow-based models. To solve the real- time dynamics given by Eq. 2, we further develop the high dimensional stochastic Euler-KL method. The algorithm represents the Q function at time t with a flow-based model and iteratively updates the representation at the next time t + dt based on the Euler method. It requires two copies of flow-based models for Qt+dt and Qt. Based on the first-order Euler method with time step dt, Eq. 2 yields Qt+dt = Qt + ̃LQtdt = (I + ̃Ldt)Qt ≡ Qt L. (3) Notice that Qt+dt represents the Q function that we obtain in the next time step. At each learning step, we fix Qt and optimize the parameters θ in Qt+dt to match the above relation. Hence, we also denote Qt+dt by Qt+dt . We train θ Qt+dt using the KL divergence loss function θ KL(Qt+dt θ ||Qt L) = (cid:90) Qt+dt θ ln Qt+dt θ Qt L . (4) The gradient of Eq. 4 can be derived with a control variance technique as follows (see Appendix for a derivation): Algorithm 1 Stochastic Euler-KL Method Input: normalizing flow models for Qt+dt θ T , time step dt, niter, optimizer Adam. Output: Optimal parameters θ∗ at time step t + dt Initialization: Random θ(t0) for j in range(T /dt) do for i = 0 to niter do and Qt, total time update θ using Eq. 5 and optimizer Adam end for Qt ← Qt+dt θ∗ end for E ) + (Qtn N N = (Qtn − Qtn N N ) ≡ εE(tn) + εN N (tn), where Qtn Proof. ε(tn) = Qtn − Qtn E − Qtn N N are the Q function from the exact Euler method and the neural network Q-Flow at time step tn. By the triangular inequality, |ε(tn)| ≤ |εE(tn)| + |εN N (tn)|. Since the Euler method is a first-order method, it has global error of order O(dt) where dt the time step. E and Qtn N N − P Qtn E − εN N (tn+1) − P (Qtn Denote the optimization error of Eq. 4 in time step tn+1 as rn+1, such that Qtn+1 N N = rn+1. It follows that Qtn+1 E − εN N (tn)) = rn+1, which implies that εN N (tn+1) = P εN N (tn) − rn+1 due to the cancellation of Qtn+1 E from the exact Euler method. By induction, εN N (tn) = −P −1 (cid:80)n i=1 P irn+1−i. E − P Qtn Time Dependent Variational Principle (TDVP). Instead of taking the gradient with respect to the KL divergence as Eq. 5 shows, Reh & G ̈arttner (2022) demonstrate that the minimization of Eq. 4 is equivalent to the time-dependent variational principle, which provides a nonlinear differential equation on the parameter space θ as follows. Skk′ ̇θk′ = Fk (6) where Skk′ = E[(∂θk ln Q)(∂θ′ ln Q)] is the Fisher in- formation matrix, and Fk = E[(∂θk ln Q)(∂t ln Q)] with ∂t ln Q = (∂tQ)/Q = ( ̃LQ)/Q. k 1 N (cid:88) x∼Qt+dt θ (cid:34) ln Qt+dt θ Qt (x) L(x) (cid:35) − b ∇θ ln Qt+dt θ (x) (5) Reh & G ̈arttner (2022) has only applied TDVP to solving classical PDEs. Under our Q-Flow approach, we can also apply TDVP to simulate open quantum dynamics. where b = 1 N trol variance. (cid:80) x∼Qt+dt θ ln Qt+dt θ Qt L(x) (x) is the baseline for con- The stochastic Euler-KL method is summarized in Algo- rithm. 1. We further provide an error bound by developing the analysis in Guti ́errez & Mendl (2022) to Q-Flow. Theorem 3.3. The global error ε(tn) of the n-step stochas- tic Euler method is bounded by |εE(tn)|+|εN N (tn)|, where εE(tn) is the global error of the exact Euler method and εN N (tn) = −P −1 (cid:80)n i=1 P irn+1−i with P = I + ̃Ldt and ri being the i-th step stochastic Euler optimization error with neural network representation of the Q-Flow. 5 Complexity Analysis. Even though the stochastic Euler-KL method and the TDVP method are equivalent mathemati- cally, they share different algorithmic complexity. TDVP requires solving the nonlinear differential equation in Eq. 6, which requires explicitly inverting the Fisher information matrix Skk′. Besides potential instability, this procedure has complexity scaling as O(N 3) for explicit inversion, or O(N 2) with the conjugate gradient approach, where N is the number of parameters. This may limit its application for parameters beyond the orders of ten thousands. Mean- while, the stochastic Euler method only requires first order optimization based on Eq. 5, the main cost of which comes from the number of optimization steps in each dt. Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows 1-site Time Q-Flow Euler (ours) Q-Flow TDVP (ours) PINN PS FD 3 6 9 12 15 3 6 9 12 15 3 6 9 12 15 2.08e-3 5.10e-4 1.01e-4 1.68e-5 1.58e-5 3.91e-3 1.91e-3 7.59e-4 2.92e-4 1.47e-4 9.94e-2 3.29e-2 2.02e-2 1.46e-2 1.07e-2 5.11e-3 1.17e-3 2.16e-4 3.58e-5 5.55e-6 2-site 1.23e-2 4.66e-3 1.77e-3 6.21e-4 2.05e-4 20-site 1.08e-1 4.10e-2 2.44e-2 1.68e-2 1.23e-2 1.79e-1 1.84e-1 1.91e-1 1.91e-1 1.98e-1 1.00e0 1.00e0 1.00e0 1.00e0 1.00e0 2.17e31 2.38e30 1.34e29 1.46e28 7.07e26 3.47e-4 3.47e-4 3.47e-4 3.47e-4 3.47e-4 1.83e-1 1.82e-1 1.81e-1 1.81e-1 1.81e-1 - - - - - 8.90e-4 9.01e-4 9.01e-4 9.01e-4 9.01e-4 6.12e-2 6.09e-2 6.09e-2 6.09e-2 6.09e-2 - - - - - Table 1. L1[Qsim, Qexact] for each simulation method over time. For each row, we mark the best result in bold. 3.6. Q-Flow Initialization: Initial State Pretraining Using a Q-Flow to simulate a quantum system requires ini- tializing the flow to the correct starting Q function. For some simple initial states, we find that it is sufficient to simply make the initial state the prior for the flow and ini- tialize the flow to the identity. However, we find that using more complex initial distributions as priors to a flow tends to hamper their ability to model a system's evolution. In these cases, we instead use the standard Gaussian prior, but we use a two-step process to pretrain the flow to match the initial distribution Qinit. First, we sample from the desired initial distribution using the Metropolis-Hastings Monte Carlo method and update the flow parameters to minimize the negative log-likelihood − (cid:80) ln Qθ(x). This ensures that the model has some overlap with Qinit, which helps the next step's training algo- rithm converge more quickly. x∼Qinit Second, we sample from the flow and update the flow pa- rameters to minimize the KL Loss, KL(Qinit||Qθ). We compute the gradient according to ∇θKL ≈ − 1 N (cid:88) x∼Qθ Qinit(x) Qθ(x) ∇θ ln Qθ(x). (7) 4. Experiments For our experiments, we focus on two types of open quan- tum systems: dissipative harmonic oscillators and dissi- pative bosonic systems. We test on dissipative harmonic oscillators because they have an analytic solution, which makes them useful for benchmarking high-dimensional PDE solvers beyond the limits of conventional solvers. We then test on dissipative bosonic systems because they are com- monly studied and of practical use in physics. In these experiments, we compare Euler and TDVP methods to PINNs, Pseudo-spectral solvers, Finite Difference solvers, and stochastic solvers. Although we do not develop the TDVP method, we propose a method to apply it to open bosonic quantum systems. As such, we sometimes describe the Euler and TDVP methods as "our methods." For our experiments, we use Affine Coupling Flows and Convex-Potential Flows for the Euler and TDVP methods. Affine Coupling Flows are fast but less expressive, so we use them for the dissipative harmonic oscillator experiments. Convex Potential Flows are slow but more expressive, so we use them for problems involving more complex Q functions. To run our experiments (Dugan et al., 2023), we use the Jax library (Bradbury et al., 2018) for Euler and TDVP methods. We make use of the jax-flows library. To imple- ment the TDVP method, we make use of the NetKet library (Carleo et al., 2019; Vicentini et al., 2022) and its Stochas- tic Reconfiguration (Sorella, 1998; 2001) feature, which is mathematically equivalent to TDVP. For distributed train- ing, NetKet uses the mpi4jax package (H ̈afner & Vicentini, 2021). For PINNs, we use the PINA library, which is built on top of PyTorch. Finally, for the other three baselines we use Julia (Rackauckas & Nie, 2017). Further explanation of the observables chosen and their significance can be found in Appendix A.6. More details about the Normalizing Flow models we use are provided in Appendix C. More details about experimental setup, hyper- parameters, and baselines are provided in Appendix D. 4.1. Dissipative Harmonic Oscillator Experimental Setup. The multi-site dissipative harmonic oscillator evolves according to Equation 1 with Hamiltonian (Carmichael, 1999a) H = (cid:80) jaj and loss term j ωja† Llossρ = (cid:88) γj j (cid:20) 1 2 (2ajρa† j − a† jajρ − ρa† jaj) + ̄nj(ajρa† j + a† jρaj − a† (cid:21) jajρ − ρaja† . j) (8) Here, j labels what we will call sites. Converting to the Q function formalism gives (Carmichael, 1999b) (cid:33) (cid:32) (cid:34) (cid:88) ̃L = γj + γj( ̄nj + 1) 1 4 ∂2 ∂q2 j + ∂2 ∂p2 j j + (cid:16) γj 2 qj − ωjpj (cid:17) ∂ ∂qj + (cid:16) γj 2 pj + ωjqj (cid:35) . (cid:17) ∂ ∂pj We test the simulation methods on three problems of in- creasing dimensionality: a 1-site system, a 2-site system, 6 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Time Q-Flow (Euler) Q-Flow (TDVP) 3 6 9 12 15 1.30 * 10−7 7.64 * 10−9 3.16 * 10−10 7.49 * 10−12 4.30 * 10−12 8.18 * 10−7 4.06 * 10−8 1.38 * 10−9 3.79 * 10−11 9.21 * 10−13 PINN 2.43 * 10−3 2.66 * 10−3 2.68 * 10−3 2.34 * 10−3 1.89 * 10−3 Table 2. L2 loss for each simulation method's density matrix over time for the 1-site system. We mark each row's best result in bold. Figure 2. The trajectory of the centroids of the simulated distribu- tions. The PINN baseline is excluded from the inset. Error bars are included for all but the FD and PS methods but are small. and a 20-site system. For each system, we use a coher- ent state initial condition, which corresponds to a Gaussian with variance 1/2. We center the Gaussian at (−1, . . . , −1). As time passes this Gaussian spirals toward the origin and changes its standard deviation. To make the simulation more challenging, for every site j we uniformly sample the system's parameters ̄nj ∈ [3, 7), γj ∈ [0.5, 1.5), and ωj ∈ [0.5, 1.5). See Appendix D.1 for more details about the choice of system parameters. Metrics. To evaluate performance, we compute the L1 Loss between each simulation and the exact distribution: L1[Qsim, Qexact] ≡ (cid:90) ddx |Qsim(x) − Qexact(x)| ≈ 1 N (cid:88) x∼Qexact (cid:12) (cid:12) (cid:12) (cid:12) Qsim(x) Qexact(x) (cid:12) (cid:12) − 1 (cid:12) (cid:12) . (9) Although the L1 Loss is a useful metric, it is also illustrative to examine observables of the system. One observable is the centroid, E[⃗x] ≈ 1 ⃗x. With more sites, we cannot N easily plot the centroid trajectory, so instead we compute the centroid's distance from the origin, ∥E[⃗x]∥. x∼Qsim (cid:80) Additionally, we compute the Liouvillian loss, (cid:90) dx (cid:12) (cid:12) (cid:12)[ ̃LQ](x) (cid:12) = E[| ̃LQ|/Q]. (cid:12) (cid:12) The Liouvillian loss measures the magnitude of the dynam- ics relative to the distribution, an indicator of how perturbed the system is from equilibrium. For the Euler and TDVP methods, we sample directly from the flow to compute expected values. For PINNs, we use Markov chain Monte Carlo (MCMC) to obtain samples. For pseudo-spectral results, we compute expected values by summing over the grid and scaling by Q. Finally, for the 1-site system, we compute the first 4x4 block of the density matrix according to Equation 12 and compute its L2 distance from the exact density matrix: L2[ρpred, ρexact] = (cid:88) 1≤i,j≤4 |(ρpred)ij − (ρexact)ij|2 . (10) Because the density matrix is the standard parametrization of a quantum system, this comparison is another useful benchmark for performance. Equation 12 requires spatial derivatives of the Q-function, so we only compute this loss for solvers that return spatially differentiable Q functions. Results and Discussion. Table 1 shows the L1 Loss be- tween each simulation and the exact distribution for a num- ber of simulation times. Although we do not include error bounds in the table for ease of viewing, the error is usually at least an order of magnitude smaller than the L1 Loss (see Appendix. E). Error bounds for the pseudo-spectral and finite-difference results (standard solvers) are not computed because these methods are deterministic. We exclude stan- dard solvers from the 20-site system because a grid size of only 10 would require storing at least 1040 values. Both the Euler and TDVP methods have extremely low L1 Loss. Both methods perform better than the standard solvers in the 2-site case and in the later times of the 1-site case. Increasing the number of sites, we find that the Euler and TDVP methods continue to perform well while PINNs and standard solvers struggle. Standard solvers cannot simu- late the 20-site system due to the curse of dimensionality, and while PINNs can in principle simulate the system, in practice they perform extremely poorly. On the other hand, both the Euler and TDVP methods still consistently report low fidelities. Finally, note that the Euler method has a consistently lower L1 loss than the TDVP method. Figure 2 shows the trajectory of each simulation method's centroid for the 1-site case. Once again, the Euler and TDVP methods both closely match the exact evolution, and the Euler method performs slightly better in general. On the other hand, the PINN solution exhibits consistently bi- ased and rapidly fluctuating estimates of the centroid. As 7 1.00.80.60.40.20.00.2E[q]1.00.80.60.40.20.00.20.40.6E[p]ExactFDPSQ-Flow TDVP (Ours)Q-Flow Euler (Ours)PINNStochastic Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Figure 3. The simulated evolution of two observables for 1-site, 2-site, and 20-site dissipative harmonic oscillators. Error bars are included for all but the Finite Difference and Pseudo-spectral results but are small for most observables. expected, the standard solvers closely track the exact trajec- tory. However, we note that although our methods appear to match the exact results less accurately, the large error bars in the cutout demonstrate that this is in large part due to sampling error. We could have computed the centroid for the Euler and TDVP methods using grid integration as with the pseudo-spectral method, but we instead choose to use sampling because this better generalizes to higher di- mensions. The stochastic method performs comparably to our Euler and TDVP methods, but we note that it applies to a restricted subset of diffusion-type PDEs. Additionally, the stochastic method cannot provide exact values of the Q function, which makes it challenging to evaluate other observables such as the Liouvillian loss or L1 and L2 losses. Figure 3 shows the evolution of the centroid distance and the Liouvillian Loss for all three problems. Euler and TDVP closely match the exact evolution of the two observables. Although the two methods' estimates of the centroid dis- tance begin to diverge from the exact centroid distance at around time 10, once again the large error bars demonstrate that this is due to error in the sampling estimate. Although the PINN centroid distance also begins to diverge from the desired value, the small error bars for this estimate suggest that the deviation does not come from sampling error. The Euler and TDVP methods' Liouvillian losses decrease consistently. At around time 15, the Euler Liouvillian loss jumps slightly. This jump occurs at a Liouvillian loss below 10−7, so the simulation is still likely precise enough for most applications. The Euler method's performance can likely be improved by increasing the number of fitting steps per time step and by decreasing the step size. In practice, we find that decreasing the step size improves both the Euler and TDVP methods' performance. Interestingly, the standard solvers provide very poor estimates of the Liouvillian loss. We suspect that this is due to error in numerical derivatives. Finally, note that unlike the other methods, our methods continue to correctly simulate the system for large numbers of sites. It is only toward the end of time evolution in the 20-site case that our methods begin to show some devia- tion from the exact observables. Again, this can likely be reduced by decreasing the step size and taking more sam- ples. Interestingly, the stochastic method appears to diverge slightly more than our methods in the 20-site case. Table 4.1 shows the L2 loss from Equation 10. The Euler and TDVP methods have extremely low losses, with the Euler method performing slightly better. The PINN L2 loss, while low, is much larger than the Euler and TDVP methods. 4.2. Dissipative Bosonic Model Experimental Setup. The dissipative bosonic model is a frequently studied open quantum system (Kordas et al., 2013; Berg & Nystr ̈om, 2019). We test our methods on this model because it has a more complex evolution equation with rich real-world applicabilitions. 8 105103101101Centroid Distance1-site2-site20-sitePseudo-spectralFinite DifferencePINNQ-Flow TDVP (Ours)Q-Flow Euler (Ours)StochasticExact051015t103101101Liouvillian051015t051015t Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows closely match the exact evolution, demonstrating the wide applicability of our methods. 5. Conclusion In this work, we made an important contribution to the problem of simulating open quantum systems. We used a reformulation of the density matrix to the Husimi Q func- tion, which allowed us to study open quantum systems as an evolution of a probability distribution under dynamics, described by a partial differential equation that we derive for each system. This allowed us to establish a direct connec- tion between simulating continuous or bosonic open quan- tum systems and the rich literature on generative models in standard machine learning. With off-the-shelf normalizing flows, Affine Coupling Flows and Convex Potential Flows, and a new efficient method for solving high-dimensional PDEs, Euler-KL, we established Q-Flow, a new and efficient approach to simulation of open quantum systems. We compared Q-Flow to the state-of-the-art numerical and deep learning approaches on two important systems to the field, the dissipative harmonic oscillator and dissipa- tive bosonic models. We established superior performance across the board, especially for large system dimensionality. We believe the significance of our results is twofold. On one hand, Q-Flow's accurate simulation of open quantum sys- tems can be further developed to aid progress in fundamental physics and engineering applications, such as superconduc- tors and quantum computers. On the other hand, through our reformulation from evolving the density matrix to evolving the Q function, we shifted the modeling challenges from the curse of dimensionality to the accurate evolution of a high-dimensional deep generative model. Q-Flow can aid progress in evolving probability distributions under PDE dy- namics and inspire future work on deep generative models. 6. Acknowledgements The authors acknowledge helpful discussions with Zhuo Chen and Matija Medvidovi ́c. The authors acknowledge support from the National Science Foundation under Coop- erative Agreement PHY-2019786 (The NSF AI Institute for Artificial Intelligence and Fundamental Interactions, http://iaifi.org/). This material is based upon work supported by the U.S. Department of Energy, Office of Science, National Quantum Information Science Research Centers, Co-design Center for Quantum Advantage (C2QA) under contract number DE-SC0012704. This work is also work supported in part by the Air Force Office of Scien- tific Research under the award number FA9550-21-1-0317. P.Y. Lu is grateful for the support of the Eric and Wendy Schmidt AI in Science Postdoctoral Fellowship at the Uni- versity of Chicago. Figure 4. 2-site dissipative bosonic experiment: simulated ⟨n1⟩. The dissipative bosonic model we use has (Kordas et al., 2013) H = −J (cid:80) j+1aj + a† a† j jaj+1 and (cid:16) (cid:17) Llossρ = − 1 2 (cid:88) (cid:16) γj j njρ + ρnj − 2ajρa† j (cid:17) (11) where nj = a† the Q function formalism gives that ̃L is jaj and j enumerates the sites. Converting to (cid:32) (cid:32) 1 4 ∂2 ∂q2 j + ∂2 ∂p2 j (cid:33) (cid:88) γj j + 1 2 (cid:18) qj ∂ ∂qj + pj ∂ ∂pj (cid:19)(cid:33) + 1 (cid:88) + J j (cid:32) pj+1 ∂ ∂qj − qj+1 ∂ ∂pj + pj ∂ ∂qj+1 − qj (cid:33) . ∂ ∂pj+1 Following Figure 3 of (Kordas et al., 2015), we consider a 2-site system with J = 1, U = 0, and γ = [1, 0]. We simulate the evolution of an antisymmetric Bose-Einstein Condensate (BEC) with 50 particles in each site, which has a Q function Q(q1, p1, q2, p2) given by Q = (cid:2)(q1 − q2)2 + (p1 − p2)2(cid:3)100 π2 * 2100 * 100! e−(q2 1 +p2 1+q2 2 +p2 2). Because of the complex multimodal initial distribution, we use the Convex Potential Flow for these experiments. We pretrain the flow as described in Section 3.6. (cid:80) Metric. For this system, we compute the observable ⟨n1⟩ ≈ 1 1 − 1) because it's exact evolution is N given in (Kordas et al., 2015). 1 + p2 (⃗q,⃗p)∼Qsim (q2 Results and Discussion. We show the simulated evolution of ⟨n1⟩ in Figure 4. The existence of the J term is respon- sible for the oscillations shown because it causes the two sites to exchange particles, which could cause challenges for simulations. Even so, both the Euler and TDVP methods 9 02468Jt1001020304050n1FDPSQ-Flow TDVP (Ours)Q-Flow Euler (Ours)PINNExact Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows References Adesso, G., Ragy, S., and Lee, A. R. Continuous variable quantum information: Gaussian states and beyond. Open Systems & Information Dynamics, 21(01n02):1440001, 2014. Amari, S.-i. Neural learning in structured parameter spaces- natural riemannian gradient. Advances in neural informa- tion processing systems, 9, 1996. Amari, S.-I. Natural gradient works efficiently in learning. Neural computation, 10(2):251–276, 1998. Barreiro, J. T., M ̈uller, M., Schindler, P., Nigg, D., Monz, T., Chwalla, M., Hennrich, M., Roos, C. F., Zoller, P., and Blatt, R. An open-system quantum simulator with trapped ions. Nature, 470(7335):486–491, 2011. Berg, J. and Nystr ̈om, K. Data-driven discovery of Journal of Computa- PDEs in complex datasets. tional Physics, 384:239–252, 2019. ISSN 0021- 9991. https://doi.org/10.1016/j.jcp.2019.01. 036. URL http://www.sciencedirect.com/ science/article/pii/S0021999119300944. doi: Bradbury, J., Frostig, R., Hawkins, P., Johnson, M. J., Leary, C., Maclaurin, D., Necula, G., Paszke, A., VanderPlas, J., Wanderman-Milne, S., and Zhang, Q. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax. Carleo, G. and Troyer, M. Solving the quantum many-body problem with artificial neural networks. Science, 355 (6325):602–606, 2017. doi: 10.1126/science.aag2302. Carleo, G., Choo, K., Hofmann, D., Smith, J. E. T., Wester- hout, T., Alet, F., Davis, E. J., Efthymiou, S., Glasser, I., Lin, S.-H., Mauri, M., Mazzola, G., Mendl, C. B., van Nieuwenburg, E., O'Reilly, O., Th ́eveniaut, H., Torlai, G., Vicentini, F., and Wietek, A. Netket: A machine learning toolkit for many-body quantum systems. SoftwareX, pp. 100311, 2019. doi: 10.1016/j.softx.2019.100311. URL http://www.sciencedirect.com/science/ article/pii/S2352711019300974. Carmichael, H. J. Dissipation in Quantum Me- chanics: The Master Equation Approach, pp. 1– 28. Springer Berlin Heidelberg, Berlin, Heidelberg, 1999a. doi: 10.1007/ 978-3-662-03875-8 1. URL https://doi.org/10. 1007/978-3-662-03875-8_1. ISBN 978-3-662-03875-8. Carmichael, H. J. Quantum-Classical Correspondence for the Electromagnetic Field II: P, Q, and Wigner Rep- resentations, pp. 101–145. Springer Berlin Heidelberg, Berlin, Heidelberg, 1999b. ISBN 978-3-662-03875-8. doi: 10.1007/978-3-662-03875-8 4. URL https:// doi.org/10.1007/978-3-662-03875-8_4. 10 Cazalilla, M. A., Citro, R., Giamarchi, T., Orignac, E., and Rigol, M. One dimensional bosons: From condensed matter systems to ultracold gases. Reviews of Modern Physics, 83(4):1405, 2011. Chen, Z., Luo, D., Hu, K., and Clark, B. K. Simulating 2+ 1d lattice quantum electrodynamics at finite density with neu- ral flow wavefunctions. arXiv preprint arXiv:2212.06835, 2022. Courant, R., Friedrichs, K., and Lewy, H. ̈Uber die partiellen differenzengleichungen der mathematischen physik. Mathematische Annalen, 100:32–74, 1928. doi: 10.1007/BF01448839. URL https://doi.org/10. 1007/BF01448839. Dinh, L., Krueger, D., and Bengio, Y. Nice: Non-linear arXiv preprint independent components estimation. arXiv:1410.8516, 2014. Dinh, L., Sohl-Dickstein, J., and Bengio, S. Density In International Confer- estimation using real NVP. ence on Learning Representations, 2017. URL https: //openreview.net/forum?id=HkpbnH9lx. Dugan, O., Lu, P. Y., Dangovski, R., Luo, D., and Soljaˇci ́c, M. The code repository is going to be made public in arxiv and the related materials are available on reasonable request from the corresponding author. arXiv preprint arXiv:2302.12235, 2023. Fornberg, B. A practical guide to pseudospectral methods. Number 1. Cambridge university press, 1998. Grathwohl, W., Chen, R. T. Q., Bettencourt, J., and Du- venaud, D. Scalable reversible generative models with free-form continuous dynamics. In International Confer- ence on Learning Representations, 2019. URL https: //openreview.net/forum?id=rJxgknCcK7. Guti ́errez, I. L. and Mendl, C. B. Real time evolution with neural-network quantum states. Quantum, 6:627, 2022. Hartmann, M. J. and Carleo, G. Neural-network approach to dissipative quantum many-body dynamics. Phys. Rev. Lett., 122:250502, Jun 2019. doi: 10.1103/PhysRevLett. 122.250502. URL https://link.aps.org/doi/ 10.1103/PhysRevLett.122.250502. Hendrycks, D. and Gimpel, K. Gaussian Error Linear Units (GELUs). arXiv e-prints, art. arXiv:1606.08415, June 2016. doi: 10.48550/arXiv.1606.08415. Hermann, J., Sch ̈atzle, Z., and No ́e, F. Deep-neural-network solution of the electronic schr ̈odinger equation. Nature Chemistry, 12(10):891–897, Oct 2020. ISSN 1755-4349. doi: 10.1038/s41557-020-0544-y. Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Huang, C.-W., Chen, R. T. Q., Tsirigotis, C., and Courville, A. Convex potential flows: Universal probability distribu- tions with optimal transport and convex optimization. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum? id=te7PVH1sPxJ. H ̈afner, D. and Vicentini, F. mpi4jax: Zero-copy mpi com- munication of jax arrays. Journal of Open Source Soft- ware, 6(65):3419, 2021. doi: 10.21105/joss.03419. URL https://doi.org/10.21105/joss.03419. Kingma, D. P. and Dhariwal, P. Glow: Generative Flow with Invertible 1x1 Convolutions. arXiv e-prints, art. arXiv:1807.03039, July 2018. doi: 10.48550/arXiv.1807. 03039. Kordas, G., Wimberger, S., and Witthaut, D. Decay and fragmentation in an open bose-hubbard chain. Phys. Rev. A, 87:043618, Apr 2013. doi: 10.1103/PhysRevA.87. 043618. URL https://link.aps.org/doi/10. 1103/PhysRevA.87.043618. Kordas, G., Witthaut, D., Buonsante, P., Vezzani, A., Buri- oni, R., Karanikas, A. I., and Wimberger, S. The dissipa- tive Bose-Hubbard model. European Physical Journal Special Topics, 224(11):2127–2171, November 2015. doi: 10.1140/epjst/e2015-02528-2. Krishnapriyan, A., Gholami, A., Zhe, S., Kirby, R., and Mahoney, M. W. Characterizing possible failure modes in physics-informed neural networks. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 26548–26560. Curran Asso- ciates, Inc., 2021. URL https://proceedings. neurips.cc/paper/2021/file/ df438e5206f31600e6ae4af72f2725f1-Paper. pdf. systems via a probabilistic formulation. Physical review letters, 128(9):090501, 2022b. Luo, D., Yuan, S., Stokes, J., and Clark, B. K. Gauge equivariant neural networks for 2+ 1d u (1) gauge theory simulations in hamiltonian formulation. arXiv preprint arXiv:2211.03198, 2022c. Martin, R. M., Reining, L., and Ceperley, D. M. In- teracting Electrons: Theory and Computational Ap- proaches. Cambridge University Press, 2016. doi: 10.1017/CBO9781139050807. Martyn, J. M., Najafi, K., and Luo, D. Variational neural- network ansatz for continuum quantum field theory. arXiv preprint arXiv:2212.00782, 2022. McMillan, W. L. Ground state of liquid he 4. Physical Review, 138(2A):A442, 1965. Mohamed, S., Rosca, M., Figurnov, M., and Mnih, A. Monte carlo gradient estimation in machine learning. The Journal of Machine Learning Research, 21(1):5183–5244, 2020. Nagy, A. and Savona, V. Variational quantum monte carlo method with a neural-network ansatz for open Phys. Rev. Lett., 122:250501, quantum systems. Jun 2019. 10.1103/PhysRevLett.122.250501. doi: URL https://link.aps.org/doi/10.1103/ PhysRevLett.122.250501. Nocedal, J. and Wright, S. J. (eds.). Large-Scale Quasi-Newton and Partially Separable Optimization, pp. 222–249. Springer New York, New York, NY, 1999. doi: 10.1007/ URL https://doi.org/10. 0-387-22742-3 9. 1007/0-387-22742-3_9. ISBN 978-0-387-22742-9. Luo, D. and Clark, B. K. Backflow transformations via neural networks for quantum many-body wave functions. Physical review letters, 122(22):226401, 2019. Luo, D., Chen, Z., Hu, K., Zhao, Z., Hur, V. M., and Clark, B. K. Gauge invariant autoregressive neural networks for quantum lattice models. arXiv preprint arXiv:2101.07243, 2021. Luo, D., Chen, Z., Carrasquilla, J., and Clark, B. K. Au- toregressive neural network for simulating open quantum systems via a probabilistic formulation. Phys. Rev. Lett., 128:090501, Feb 2022a. doi: 10.1103/PhysRevLett.128. 090501. Luo, D., Chen, Z., Carrasquilla, J., and Clark, B. K. Au- toregressive neural network for simulating open quantum Pfau, D., Spencer, J. S., Matthews, A. G. D. G., and Foulkes, W. M. C. Ab initio solution of the many- electron schr ̈odinger equation with deep neural net- works. Phys. Rev. Res., 2:033429, Sep 2020. doi: 10.1103/PhysRevResearch.2.033429. Rackauckas, C. and Nie, Q. Differentialequations.jl–a per- formant and feature-rich ecosystem for solving differen- tial equations in julia. Journal of Open Research Software, 5(1):15, 2017. Raissi, M. Deep hidden physics models: Deep learn- Jour- ing of nonlinear partial differential equations. nal of Machine Learning Research, 19(25):1–24, 2018. URL http://jmlr.org/papers/v19/18-046. html. 11 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Weinan, E., Han, J., and Jentzen, A. Algorithms for solving high dimensional pdes: from nonlinear monte carlo to machine learning. Nonlinearity, 35(1):278, 2021. Westerhout, T., Astrakhantsev, N., Tikhonov, K. S., Katsnel- son, M. I., and Bagrov, A. A. Generalization properties of neural network approximations to frustrated magnet ground states. Nature communications, 11(1):1593, 2020. Yoshioka, N. and Hamazaki, R. Constructing neural station- ary states for open quantum many-body systems. Phys. Rev. B, 99:214306, Jun 2019. doi: 10.1103/PhysRevB.99. 214306. URL https://link.aps.org/doi/10. 1103/PhysRevB.99.214306. Zhuang, J., Tang, T., Ding, Y., Tatikonda, S., Dvornek, N., Papademetris, X., and Duncan, J. S. AdaBelief Optimizer: Adapting Stepsizes by the Belief in Observed Gradients. arXiv e-prints, art. arXiv:2010.07468, October 2020. doi: 10.48550/arXiv.2010.07468. Raissi, M., Perdikaris, P., and Karniadakis, G. Physics- informed neural networks: A deep learning frame- work for solving forward and inverse problems involv- Journal ing nonlinear partial differential equations. of Computational Physics, 378:686–707, 2019. ISSN 0021-9991. doi: https://doi.org/10.1016/j.jcp.2018.10. 045. URL http://www.sciencedirect.com/ science/article/pii/S0021999118307125. Reh, M. and G ̈arttner, M. Variational monte carlo approach to partial differential equations with neural networks. Ma- chine Learning: Science and Technology, 3(4):04LT02, 2022. Reh, M., Schmitt, M., and G ̈arttner, M. Time-dependent variational principle for open quantum systems with arti- ficial neural networks. Physical Review Letters, 127(23): 230501, 2021. Rezende, D. and Mohamed, S. Variational inference with normalizing flows. In International conference on ma- chine learning, pp. 1530–1538. PMLR, 2015. Shankar, R. Principles of quantum mechanics. Springer Science & Business Media, 2012. Sharir, O., Levine, Y., Wies, N., Carleo, G., and Shashua, A. Deep autoregressive models for the efficient variational simulation of many-body quantum systems. Phys. Rev. Lett., 124:020503, Jan 2020. doi: 10.1103/PhysRevLett. 124.020503. Sorella, S. Green function monte carlo with stochastic reconfiguration. Physical review letters, 80(20):4558, 1998. Sorella, S. Generalized lanczos algorithm for variational quantum monte carlo. Physical Review B, 64(2):024512, 2001. Verstraete, F., Wolf, M. M., and Ignacio Cirac, J. Quantum computation and quantum-state engineering driven by dissipation. Nature physics, 5(9):633–636, 2009. Vicentini, F., Biella, A., Regnault, N., and Ciuti, C. Variational neural-network ansatz for steady states Phys. Rev. Lett., 122: in open quantum systems. 250503, Jun 2019. doi: 10.1103/PhysRevLett.122. 250503. URL https://link.aps.org/doi/10. 1103/PhysRevLett.122.250503. Vicentini, F., Hofmann, D., Szab ́o, A., Wu, D., Roth, C., Giuliani, C., Pescia, G., Nys, J., Vargas-Calder ́on, V., Astrakhantsev, N., and Carleo, G. NetKet 3: Machine Learning Toolbox for Many-Body Quantum Systems. Sci- Post Phys. Codebases, pp. 7, 2022. doi: 10.21468/ URL https://scipost. SciPostPhysCodeb.7. org/10.21468/SciPostPhysCodeb.7. 12 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows A. Further Details about the Q Function Formalism A.1. Quantum Preliminaries Here, we provide a brief and intuitive introduction to the theory of bosonic systems. We intentionally simplify most of the definitions and focus on the important concepts to our study. For an in-depth discussion, please refer to (Shankar, 2012). We will discuss a few important terms that we use throughout the main text. Hilbert Space. In a closed system, i.e., one which is insulated from the environment, each subsystem's state can be described as a unit vector in a complex vector space Cn, a Hilbert space, for some dimension n which we will from now on denote as the Hilbert space dimension or the degrees of freedom. Open Quantum Systems In an open quantum system, interactions with the environment introduce additional uncertainty about the quantum state of the system. To model open systems, we must thus resort to the density matrix. The density matrix is an n × n positive definite unit-trace complex-valued matrix, where n is the Hilbert space dimension of the system. The space Cn×n of density matrices is sometimes known as the double Hilbert space. This space is spanned by the set of outer products |b1⟩ ⟨b2| of basis vectors. The density matrix can be thought of as an operator on the Hilbert space. Braket notation. Such notation is used throughout the text to denote quantum states. Quantum states are elements of a complex vector space V , equipped with a Hermitian form. In our work we use the standard Hermitian inner product, which in math notation is (v, w) = v†w. Here † denotes the complex conjugate, for any two vectors v, w ∈ V. In physics notation, we write v as |v⟩ (known as a ket) and likewise for w. We also use the notation ⟨v| ≡ v†, and call this a bra. Then, v†w can be written ⟨v| |w⟩, or more concisely as ⟨v|w⟩. Furthermore, |v⟩ ⟨w| denotes the outer product of v and w†. Particle number Hilbert space, Vacuum states, the Fock space. There exists a special Hilbert space known as the particle number Hilbert space or the Fock space. This Hilbert space describes a location, such as a potential well, with varying number of particles. It is spanned by a countably infinite set of orthonormal basis vectors, which we label |0⟩ , |1⟩ , . . ., where |n⟩ represents a system with n particles. To represent a general element of |0⟩ , |1⟩ , . . ., we will use a Roman letter inside the ket or bra. We denote |0⟩ as the vaccum state because it represents a system with no particles. Although a system with varying number of particles can be described by the particle number Hilbert space, there are many other systems that can be similarly described. For example, a particle confined to move in a 1d potential well can be described by this Hilbert space. In this paper, we use the term site to refer to any system with a Hilbert space that is the particle number Hilbert space. For multiple sites, the total Hilbert space is the tensor product of each particle's Hilbert space. Creation, annihilation operators and Coherent state. The creation operator a† satisfies a† |n⟩ = n + 1 |n + 1⟩ and the annihilation operator a satisfies a |n⟩ = n |n − 1⟩ with a |0⟩ = 0. The coherent state |α⟩ with a complex number α is defined as |α⟩ = eαa†−α∗a |0⟩, where e should be interpreted as matrix exponential function. A more practical equivalent definition of the coherent state is √ √ |α⟩ = e−|α|2/2 ∞ (cid:88) n=0 αn √ n! |n⟩ . Compute observables. observable O can be expressed as O = (cid:80) follows that the expectation value of the observable ⟨O⟩ = tr(ρO) = (cid:80) In quantum mechanics, a density matrix ρ can be expressed as ρ = (cid:80) n,m ρn,m |n⟩ ⟨m| and an n,m On,m |n⟩ ⟨m|, where both ρ and O can be viewed as Hermitian matrices. It n,m On,mρm,n. Tensor products. Suppose we have two Hilbert spaces H1 and H2. For every two kets |a⟩ ∈ H1 and |b⟩ ∈ H2, there exists a ket |a⟩ ⊗ |b⟩ ∈ H1 ⊗ H2, where |a⟩ ⊗ |b⟩ is the tensor product of |a⟩ and |b⟩ and H1 ⊗ H2 is the tensor product space H1 and H2. The inner product for tensor products of Hilbert spaces is defined as (⟨a| ⊗ ⟨b|) (|c⟩ ⊗ |d⟩) = ⟨a|c⟩ ⟨b|d⟩, where ⟨a| ⊗ ⟨b| is the conjugate transpose of |a⟩ ⊗ |b⟩. From this it is clear that the basis kets for the new Hilbert space are all pairs of tensor products of basis kets of the two smaller Hilbert spaces. If an operator O1 acts on H1 and O2 acts on H2, then (O1 ⊗ O2) acts on H1 ⊗ H2 according to (O1 ⊗ O2) |a⟩ ⊗ |b⟩ = (O1 |a⟩) ⊗ (O2 |b⟩). Finally, note that we often use shorthands such as O1 or O2 to refer to O1 ⊗ 1 or 1 ⊗ O2, respectively. 13 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows A.2. Q Function to ρ In this section, we show that for a given Q(α, α∗), the density matrix ρ corresponding to it is given by where ⟨m| ρ |n⟩ = π √ m!n! min(m,n) (cid:88) k=0 Qm−k,n−k k! , Qa,b(α, α∗) = 1 a!b! ∂a+b (cid:12) (cid:12) ∂aα ∂bα∗ Q(α, α∗) (cid:12) (cid:12)α=α∗=0 . (12) This result generalizes to multi-site Q functions using the tensor product structure, but for simplicity we consider only a single site here. From expressing ⟨α| and |α⟩ in terms of Harmonic Oscillator eigenstates, we have that ∞ (cid:88) ∞ (cid:88) n=0 m=0 (−1)s s! e−αα∗ (cid:32) ∞ (cid:88) s=0 Q(α, α∗) = = = 1 π 1 π 1 π ⟨m| ρ |n⟩ √ m!n! α∗mαn (αα∗)s (cid:33) ∞ (cid:88) ∞ (cid:88) m=0 n=0 ⟨m| ρ |n⟩ √ m!n! α∗mαn ∞ (cid:88) ∞ (cid:88) ∞ (cid:88) s=0 m=0 n=0 (−1)s s! ⟨m| ρ |n⟩ √ m!n! (α∗)m+s αn+s To determine ⟨m| ρ |n⟩, we must thus invert this series. However, since we know the correct form, we can simply substitute Equation 12 into the expression above and show that it correctly gives Q(α, α∗) : ∞ (cid:88) ∞ (cid:88) ∞ (cid:88) 1 π = 1 π s=0 ∞ (cid:88) m=0 ∞ (cid:88) n=0 ∞ (cid:88) s=0 m=0 n=0 (α∗)m+s αn+s (−1)s s! (−1)s s! ⟨m| ρ |n⟩ √ m!n! m!n! (cid:80)min(m,n) k=0 √ m!n! √ π Qm−k,n−k k! (α∗)m+s αn+s ∞ (cid:88) ∞ (cid:88) ∞ (cid:88) min(m,n) (cid:88) = s=0 m=0 n=0 k=0 (−1)s s! Qm−k,n−k k! (α∗)m+s αn+s. Setting a = m + s and b = n + s gives Then, setting d = s + k gives ∞ (cid:88) ∞ (cid:88) min(a,b) (cid:88) min(a,b)−s (cid:88) a=0 b=0 s=0 k=0 (−1)s s! Qa−k−s,b−k−s k! (α∗)a αb. ∞ (cid:88) ∞ (cid:88) min(a,b) (cid:88) d (cid:88) a=0 b=0 d=0 s=0 (−1)s s! Qa−d,b−d (d − s)! (α∗)a αb ∞ (cid:88) ∞ (cid:88) = a=0 b=0 (α∗)a αb min(a,b) (cid:88) d=0 Qa−d,b−d d (cid:88) (−1)s s=0 (cid:19) (cid:18)d s . Now, by the Binomial Theorem, (cid:80)d s=0(−1)s(cid:0)d s (cid:1) = (1 − 1)d = 0d, which is 0 unless d = 1. So, we get ∞ (cid:88) ∞ (cid:88) a=0 ∞ (cid:88) b=0 ∞ (cid:88) a=0 b=0 = Qa,b(α, α∗) * (α∗)a αb (α∗)a αb a!b! ∂a+b ∂aα∂bα∗ Q(α, α∗) =Q(α, α∗), 14 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows as desired. The last step comes from the Taylor series representation of Q, which is only valid if Q is analytic. So as long as Q is analytic, this result holds. A.3. Coherent State Identities Here we present a few coherent state identities that prove useful in A.4. a† |α⟩ = a†e−|α|2/2 ∞ (cid:88) n=0 αn √ n! |n⟩ = e−|α|2/2 √ ∞ (cid:88) n=0 αn √ n! n + 1 |n + 1⟩ |n + 1⟩ αn+1 (cid:112)(n + 1)! αn √ n! |n⟩ = e−|α|2/2 ∂ ∂α = e−|α|2/2 ∂ ∂α = e−|α|2/2 ∂ ∂α ∂ ∂α ∂ ∂α e−|α|2/2 e−|α|2/2 e−|α|2/2 ∞ (cid:88) n=0 ∞ (cid:88) n=0 ∞ (cid:88) n=0 ∞ (cid:88) n=0 ∞ (cid:88) n=0 ∞ (cid:88) = = = = = ∂ ∂α (cid:18) α∗ 2 (cid:18) α∗ 2 n=0 (cid:19) e−|α|2/2 (cid:19) |α⟩ . + + ∂ ∂α ∂ ∂α αn √ n! αn √ n! αn √ n! αn √ n! |n⟩ |n⟩ − |n⟩ − (cid:18) ∂ ∂α (cid:18) ∂ ∂α (cid:19) ∞ (cid:88) n=0 (cid:19) ∞ (cid:88) e−|α|2/2 e−|α|2/2 αn √ n! |n⟩ αn √ n! |n⟩ |n⟩ + α∗ 2 e−|α|2/2 ∞ (cid:88) n=0 n=0 αn √ n! |n⟩ ∞ (cid:88) n=0 αn √ n! |n⟩ Similarly, Also, and ⟨α| a = (cid:19) (cid:18) α 2 + ∂ ∂α∗ ⟨α| . ∂ ∂α∗ |α⟩ = ∂ ∂α∗ e−|α|2/2 ∞ (cid:88) n=0 αn √ n! |n⟩ = − e−|α|2/2 α 2 ∞ (cid:88) n=0 αn √ n! |n⟩ = − α 2 |α⟩ (13) ∂ ∂α ⟨α| = − α∗ 2 ⟨α| . A.4. ρ Evolution to Q Function Evolution In this section, we demonstrate how to convert to a general equation of motion for a density matrix to an equation of motion for the corresponding Q function using the tensor product structure. This result generalizes to multi-site Q functions, but for simplicity we consider only a single site here. 15 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Note that Also, and ⟨α| a† ˆO1ρ ˆO2 |α⟩ = α∗ ⟨α| ˆO1ρ ˆO2 |α⟩ , ⟨α| ˆO1ρ ˆO2a |α⟩ = α ⟨α| ˆO1ρ ˆO2 |α⟩ . ⟨α| a ˆO1ρ ˆO2 |α⟩ = = = (cid:20)(cid:18) α 2 (cid:18) α 2 (cid:18) α 2 + + + ∂ ∂α∗ (cid:19) ∂ ∂α∗ ∂ ∂α∗ ∂ ∂α∗ (cid:19) (cid:19) (cid:18) = α + (cid:19) (cid:21) ⟨α| ˆO1ρ ˆO2 |α⟩ ⟨α| ˆO1ρ ˆO2 |α⟩ − ⟨α| ˆO1ρ ˆO2 ∂ ∂α∗ |α⟩ ⟨α| ˆO1ρ ˆO2 |α⟩ + α 2 ⟨α| ˆO1ρ ˆO2 |α⟩ ⟨α| ˆO1ρ ˆO2 |α⟩ , ⟨α| ˆO1ρ ˆO2a† |α⟩ = ⟨α| ˆO1ρ ˆO2 (cid:19) (cid:18) α∗ 2 + ∂ ∂α |α⟩ (cid:18) α∗ 2 (cid:18) α∗ 2 + + (cid:18) α∗ + = = = ∂ ∂α ∂ ∂α ∂ ∂α (cid:19) (cid:19) (cid:19) ⟨α| ˆO1ρ ˆO2 |α⟩ − ⟨α| ˆO1ρ ˆO2 |α⟩ + (cid:20) ∂ ∂α α∗ 2 (cid:21) ⟨α| ˆO1ρ ˆO2 |α⟩ ⟨α| ˆO1ρ ˆO2 |α⟩ ⟨α| ˆO1ρ ˆO2 |α⟩ . With these results, we now have that for an equation of the form (cid:88) ̇ρ = j,k,l,m cj,k,l,m(a†)jakρ(a†)lam, we can convert the the Q function equation of motion by inserting 1 π ⟨α| |α⟩ to get 1 π ⟨α| ̇ρ |α⟩ = 1 π (cid:88) cj,k,l,m ⟨α| (a†)jakρ(a†)lam |α⟩ j,k,l,m (cid:88) cj,k,l,m(α∗)j ⟨α| akρ(a†)lam |α⟩ =⇒ ̇Q(α, α∗) = =⇒ ̇Q(α, α∗) = =⇒ ̇Q(α, α∗) = =⇒ ̇Q(α, α∗) = 1 π 1 π 1 π 1 π j,k,l,m (cid:88) j,k,l,m (cid:88) j,k,l,m (cid:88) j,k,l,m cj,k,l,m(α∗)j cj,k,l,m(α∗)j cj,k,l,m(α∗)j (cid:18) (cid:18) (cid:18) α + α + α + ∂ ∂α∗ ∂ ∂α∗ ∂ ∂α∗ (cid:19)k (cid:19)k ⟨α| ρ(a†)lam |α⟩ αm ⟨α| ρ(a†)l |α⟩ (cid:19)k (cid:18) αm α∗ + (cid:19)l ∂ ∂α ⟨α| ρ |α⟩ =⇒ ̇Q(α, α∗) = (cid:88) j,k,l,m cj,k,l,m(α∗)j (cid:18) α + ∂ ∂α∗ (cid:19)k (cid:18) αm α∗ + (cid:19)l ∂ ∂α Q(α, α∗). A.5. Observable calculation with respect to Q function In this section, we demonstrate how to efficiently compute observables by sampling from the Q function using the tensor product structure. This result generalizes to multi-site Q functions, but for simplicity we consider only a single site here. 16 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Consider a general observable ˆO. Its expected value given a density matrix ρ is ⟨ ˆO⟩ = Tr (cid:17) (cid:16) ˆOρ . (14) Inserting the coherent state resolution of the identity, we get that (cid:16) ˆOρ (cid:17) Tr = = (cid:90) dαdα∗ π (cid:90) dαdα∗ π (cid:16) ˆOρ |α⟩ ⟨α| Tr (cid:17) ⟨α| ˆOρ |α⟩ . Depending on the operator, it may be most useful to insert the resolution of the identity elsewhere. Example The expected value of am(a†)n given a density matrix ρ is ⟨am (cid:0)a†(cid:1)n ⟩ = Tr (cid:16) am (cid:0)a†(cid:1)n ρ (cid:17) (cid:16) Tr am |α⟩ ⟨α| (cid:0)a†(cid:1)n ρ (cid:17) ⟨α| (cid:0)a†(cid:1)n ρam |α⟩ αm(α∗)n ⟨α| ρ |α⟩ (cid:90) dαdα∗ π (cid:90) dαdα∗ π (cid:90) dαdα∗ π (cid:90) = = = = dqdp (q + ip)m(q − ip)nQ(q, p). If m ̸= n, this is not an observable, but could be made an observable by adding its Hermitian conjugate. A.6. Choice of observables ̇Q = LQ, when the norm of LQ goes to zero, The Liouvillian is chosen because the differential equation evolution is governed by the Liouvillian. In particular, as Eq. 2 ̇Q approaches zero which is the steady state of interest. Hence, shows that the observable Liouvillian signifies how soon the system evolves to steady state. The centroid is chosen as an observable because it is the macroscopic observable that can be directly measured in the experiment. It behaves as the center of the mass of the system, which naturally connects to the classical limit and provides a good intuition and direct visualization on how the system evolves. B. Stochastic Euler-KL Method Here we derive Equation 5 for the control-variance gradient of the KL-Divergence. We start with KL(Qt+dt θ ||Qt L) = (cid:90) Qt+dt θ ln Qt+dt θ Qt L . Taking the gradient gives ∇θKL(Qt+dt θ ||Qt L) = ∇θ (cid:90) Qt+dt θ ln Qt+dt θ Qt L Qt+dt θ Qt L (cid:90) (cid:90) (cid:90) = = = (cid:0)∇θQt+dt θ (cid:1) ln (cid:90) + Qt+dt θ ∇θ ln Qt+dt θ Qt L Qt+dt θ (cid:0)∇θ ln Qt+dt (cid:34) θ (cid:90) + Qt+dt θ Qt L (cid:1) ln (cid:35) Qt+dt θ ∇θ ln Qt+dt θ Qt+dt θ ln + 1 ∇θ ln Qt+dt θ . Qt+dt θ Qt L 17 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Now, note that (cid:90) Qt+dt θ (x)∇θ ln Qt+dt θ (x) = (cid:90) Qt+dt θ (x) (x) ∇θQt+dt θ Qt+dt θ (x) (cid:90) = ∇θQt+dt θ (x) = ∇θ (cid:90) Qt+dt θ (x) = ∇θ1 = 0. (15) So, letting (cid:90) b = Qt+dt θ ln Qt+dt θ Qt (x) L(x) ≈ 1 N (cid:88) x∼Qt+dt θ ln Qt+dt θ Qt (x) L(x) , (16) we can subtract a control variance to get ∇θKL(Qt+dt θ ||Qt L) = = = = (cid:90) (cid:90) (cid:90) (cid:90) (cid:34) Qt+dt θ ln (cid:34) Qt+dt θ ln (cid:34) Qt+dt θ ln (cid:34) Qt+dt θ ln Qt+dt θ Qt L Qt+dt θ Qt L Qt+dt θ Qt L Qt+dt θ Qt L + 1 (cid:35) (cid:35) ∇θ ln Qt+dt θ + 1 ∇θ ln Qt+dt θ − (b + 1) ∇θ ln Qt+dt θ − b (cid:35) (cid:35) − b ∇θ ln Qt+dt θ (cid:90) Qt+dt θ (x)∇θ ln Qt+dt θ (x) Finally, approximating the integral gives ∇θKL(Qt+dt θ ||Qt L) = (cid:90) Qt+dt θ (cid:34) ln (cid:34) (cid:35) − b ∇θ ln Qt+dt θ Qt+dt θ Qt L ln Qt+dt θ Qt L (cid:35) − b ∇θ ln Qt+dt θ , ≈ 1 N (cid:88) x∼Qt+dt θ as desired. Similar technique on baseline control variance has been used in the context of reinforcement learning (Mohamed et al., 2020). It has been shown that it can reduce the variance of the gradient and helpful for the optimization. C. Additional Normalizing Flow Implementation Details C.1. Affine Coupling Flow For our Affine Coupling models, we use the following architecture: each Affine Coupling layer, we into two equal-sized vectors v1 = For input[:input.shape[0]//2] and v2 = input[input.shape[0]//2:]. We then compute two neu- ral networks s = N N1(W1, v2) and t = N N2(W2, v2). We then return the concatenation of esv1 + t and v2. each input vector split The neural networks used in the Affine Coupling layers are fully-connected feed-forward neural networks. They have a set number of hidden layers of a fixed size. The input is fed into a linear layer with output size equal to the hidden layer size (usually 3) and then fed into a GELU nonlinearity (Hendrycks & Gimpel, 2016). Then, this output is concatenated with the original input vector. We refer to the output concatenated with the previous layer as the "augmented hidden layer." For each subsequent internal layer, we feed the previous augmented hidden layer into a linear layer with output size equal to the hidden layer size. We then feed this output into a GELU and concatenate the previous augmented hidden layer. Finally, for the final linear layer, the output has size equal to the input dimension of the neural network, and we do not apply a GELU or concatenate the previous augmented hidden layer. The Affine Coupling flow is then constructed as follows: We use a unit Gaussian centered at the origin as our flow prior. To transform an input vector from the data coordinate system to the coordinate system of the prior, we apply an Affine Coupling 18 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows layer and then reverse the order of the input vector. We repeat this process a user specified number of times (usually 3). To transform an input vector from the prior coordinate system to the coordinate system of the data, we apply the inverse of the above transformation. For the Affine Coupling model, the number of inputs and outputs of the neural networks defining the coupling transforms are equal to the dimension of the probability distribution. Increasing the number of sites will increase the number of inputs and outputs of these neural networks. We do not increase the dimensions of the hidden layers of the neural networks. However, at each hidden layer, we concatenate the previous hidden layer to the current one. As a result, the input is concatenated to every hidden layer, so the dimension of each hidden layer effectively increases. As a result, the number of parameters grows as a quadratic function of the number of sites currently. However, it is feasible to replace the concatenations with skip connection, so that the number of parameters in the hidden layers will stay constant as a function of the number of sites. C.2. Convex Potential Flows For our implementation of the Convex Potential Flows, we closely follow the methods described in (Huang et al., 2021). Our architecture is described below. For our Input Convex Neural Network (ICNN), we follow the ICNN architecture given in section 5 of (Huang et al., 2021). In particular, given an input vector x, we use the following procedure to compute the output of the ICNN: Following Huang et al. (2021), let L denote a linear layer, L+ denote a linear layer with positive weights, and s denote a softplus. Also, let a denote an ActNorm layer, as defined in (Kingma & Dhariwal, 2018) and cat denote concatenation. We first compute h = L(x). Then, for each layer in the network, we set ̃h = s(a(L+(h) + L(x))) haug = a(s(L(x))) (cid:16) ̃h, haug h = cat (cid:17) . . The output of the neural network is then out = ICN N (x) = a(L+(h) + L(x)). (17) (18) (19) (20) Now, let f (x) = s(a1) ||x||2 of ICN N . f is an input-convex function. 2 + s(a2)ICN N (x), where the parameters of f are the parameters of a1, a2, and the parameters We use a unit Gaussian centered on the origin as our prior. To transform an input from the data distribution coordinates to the prior coordinates, we apply ∇f . To transform an input x from the prior distribution coordinates to the data coordinates, we use LGBFS (Nocedal & Wright, 1999) to find the y that minimizes f (y) − x * y. For the Convex Potential Flow, the number of inputs to the convex neural network is equal to the dimension of the probability distribution, so increasing the number of sites will increase the number of inputs to the convex potential flow. The internal layer sizes all stay constant, so the only change is the input size. Thus, the number of parameters in the hidden layers is constant as a function of the number of sites and only the number of parameters in the first layer is linear in the number of sites. D. Additional Experimental Details D.1. Dissipative Harmonic Oscillator system parameters As mentioned in the main text, we uniformly sample the dissipative harmonic oscillator system's parameters ̄nj ∈ [3, 7), γj ∈ [0.5, 1.5), and ωj ∈ [0.5, 1.5). The values sampled are as follows: For the 1-site system, the sampled parameters were 19 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows n b a r = [ 4 . 8 4 8 7 2 8 0 4 ] gamma = [ 1 . 3 9 6 8 2 8 6 6 ] omega 0 = [ 1 . 0 8 5 6 4 5 2 1 ] , for the 2-site system, the sampled parameters were n b a r = [ 6 . 3 2 8 7 0 5 2 8 , 5 . 2 4 6 8 4 1 2 3 ] gamma = [ 0 . 8 5 6 2 9 2 0 8 , 1 . 1 4 0 2 6 6 8 2 ] omega 0 = [ 1 . 0 4 4 3 6 3 1 8 , 0 . 7 5 8 2 0 8 9 9 ] , and for the 20-site system, the sampled parameters were n b a r = [ 5 . 5 6 5 9 9 5 0 8 , 3 . 6 5 9 6 2 2 1 5 , 4 . 0 0 9 0 6 7 8 4 , 4 . 1 8 7 4 4 7 2 6 , 6 . 6 0 3 4 1 2 5 4 , 6 . 1 1 3 2 9 9 3 2 , 4 . 8 4 0 5 9 5 2 7 , 5 . 8 1 4 6 4 0 3 2 , 5 . 7 9 0 1 8 2 5 6 , 3 . 8 6 0 1 4 3 5 5 , 6 . 8 4 0 4 5 5 0 6 , 4 . 0 5 7 9 0 1 5 1 , 6 . 9 2 6 3 9 7 4 8 , 3 . 4 3 7 8 8 2 4 7 , 4 . 1 7 4 3 9 8 0 5 , 5 . 9 3 0 3 1 1 1 , 5 . 6 3 4 1 2 7 6 9 , 4 . 5 2 1 5 3 3 2 2 , 3 . 5 6 6 0 1 6 8 8 , 4 . 3 8 0 0 5 0 1 4 ] gamma = [ 0 . 7 1 5 8 4 4 4 3 , 1 . 0 8 6 8 6 1 7 2 , 1 . 4 0 5 8 8 9 7 6 , 1 . 4 7 1 2 1 7 1 5 , 0 . 8 7 7 7 5 3 0 5 , 0 . 7 8 1 3 7 4 3 7 , 1 . 2 7 8 4 8 0 8 2 , 1 . 1 4 2 4 7 3 4 5 , 0 . 9 5 7 1 8 4 0 3 , 0 . 7 6 4 8 4 1 8 6 , 1 . 2 2 0 5 6 5 1 6 , 1 . 2 4 7 7 5 5 8 9 , 0 . 5 7 3 3 2 8 9 3 , 1 . 0 6 5 5 7 6 0 9 , 0 . 6 0 1 0 5 4 7 1 , 1 . 3 2 7 1 0 9 0 9 , 0 . 9 0 7 1 2 6 7 4 , 0 . 6 7 5 6 0 1 2 3 , 0 . 9 8 1 4 2 7 2 7 , 0 . 8 4 5 1 5 1 8 9 ] omega 0 = [ 1 . 4 8 9 8 2 0 3 2 , 0 . 5 2 0 7 9 2 3 8 , 1 . 3 0 2 8 5 5 7 5 , 0 . 8 9 8 1 0 0 7 7 , 1 . 3 5 6 2 3 6 8 3 , 0 . 7 8 5 2 8 3 7 9 , 1 . 0 0 1 9 1 6 3 , 0 . 7 7 9 5 4 0 3 5 , 0 . 9 3 7 0 5 8 2 2 , 1 . 3 2 5 0 2 7 9 2 , 0 . 5 3 9 8 2 7 5 3 , 0 . 6 7 0 5 1 7 0 1 , 0 . 9 5 7 4 9 4 3 5 , 0 . 9 8 8 3 3 3 3 6 , 0 . 8 6 0 7 8 7 5 7 , 1 . 0 0 8 7 9 3 6 1 , 0 . 8 8 1 5 3 7 9 8 , 1 . 0 5 1 9 5 0 6 1 , 1 . 1 7 4 8 3 5 4 8 , 1 . 1 7 1 8 4 0 4 ] . D.2. Pseudo-spectral and finite difference baseline details As a baseline approach to solving the Q function evolution PDE (Eq. 2), we implement a pseudo-spectral and finite difference discretization of the PDE (Fornberg, 1998) in a square domain with −10 < qj < 10 and −10 < pj < 10 for each site j, set Q = 0 at the boundaries, and integrate using an adaptive Tsitouras 5/4 Runge-Kutta solver (Tsit5) (Rackauckas & Nie, 2017) while projecting at each time step to ensure the probability density Q remains positive and normalized. The psuedo-spectral method uses periodic boundary conditions and computes spatial derivatives using a fast Fourier transform. The finite difference method uses Dirichlet boundary conditions set at zero and computes spatial derivatives using the standard second-order finite difference stencil. We use a grid size of 256 grid points per dimension for 1-site and 32 grid points per dimension for 2-sites, resulting in a state size of 2562 = 65,536 for 1-site and 324 = 1,048,576 for 2-sites. Note that for a fixed grid size, the state grows exponentially with the number of sites-i.e., the curse of dimensionality. This limits our ability to perform more fine-grained simulations on larger domains and makes this baseline approach intractable for more than a few sites. D.3. PINN baseline details We also use Physics Informed Neural Networks (PINNs) as a baseline. To implement this, we use the PINA library which is built on top of PyTorch. For each problem, we have two loss terms. The first computes the L2 loss between the predicted initial distribution and the actual initial distribution for points sampled uniformly from within the domain of the solver at t = 0. The second computes the L2 loss between the PINN time derivative and the predicted time derivative ̃LQ at points sampled uniformly from within the spacial and temporal domain of the solver. The total loss is the sum of these two losses. We then optimize using gradient decent. Every 500 epochs we re-sample the points with which to compute the loss. For each experiment, we use a fully connected feed forward neural network. The network has layer sizes of [input size, 40, 40, 40, 1]. For the first layer, we feed the input through a linear layer with output dimension 40 and then apply a GELU nonlinearity. We then concatenate the input. We denote a hidden layer with the previous layer concatenated the "augmented 20 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows hidden layer." For each subsequent layer, we take the input, feed it through a linear layer with output the size of the next hidden layer, apply GELU, and then concatenate the previous augmented linear layer. For the final layer, we apply a linear layer with output dimension 1 and do not apply GELU or concatenate. The following are the hyperparameters used for each of the experiments: • 1-site Harmonic Oscillator: We use 1000 samples at a time for the initial condition and 50000 samples at a time for the derivative condition. We train for 25000 epochs with a learning rate of 0.001. • 2-site Harmonic Oscillator: We use 1000 samples at a time for the initial condition and 30000 samples at a time for the derivative condition. We train for 25000 epochs with a learning rate of 0.001. • 20-site Harmonic Oscillator: We use 3000 samples at a time for the initial condition and 3000 samples at a time for the derivative condition. We train for 50000 epochs with a learning rate of 0.001. Here, we have to decrease the number of samples for the derivative condition because of memory limits. • 2-site Dissipative Bosonic Model: We use 1000 samples at a time for the initial condition and 30000 samples at a time for the derivative condition. We train for 25000 epochs with a learning rate of 0.001. D.4. Stochastic baseline details Using the known Green's function for the N -site Harmonic Oscillator system (Carmichael, 1999b), we can construct a stochastic differential equation (SDE) dqi = (−γiqi/2 + ω0pi) dt + (cid:112)γi( ̄ni + 1)/2 dWqi dpi = (−γipi/2 − ω0qi) dt + (cid:112)γi( ̄ni + 1)/2 dWpi, (21) where dWqi, dWpi are independent Wiener processes with unit variance and i ∈ {1, . . . , N }. Starting with samples from the initial Q function, this SDE generates samples qi, pi from Q at each time point, which can be used to compute simple observables, such as the centroid (i.e., the mean of the samples). Note that this approach does not explicitly provide the Q function and so cannot be used to compute observables involving Q or derivatives of Q. This method also only works for a limited set of systems whose evolution equations admit a stochastic description, e.g., a Fokker–Planck equation. In our experiments, we use 100,000 sample points for the 1-site and 2-site Harmonic Oscillators and 10,000 sample points for the 20-site Harmonic Oscillator. D.5. Flow Initialization details As discussed in Section 4.2 of the main text, for the Bose Hubbard simulation, we initialize our Normalizing Flow models to the desired initial state of Q = (cid:2)(q1 − q2)2 + (p1 − p2)2(cid:3)100 π2 * 2100 * 100! e−(q2 1 +p2 1+q2 2 +p2 2). To do this, we use the two pretraining methods described in Section 3.6. We describe our pretraining hyperparameters in more detail below. At any point below, if we mention sampling from the exact distribution, we do so using MCMC algorithms. We first initialize the Convex Potential Flow ActNorm layers by providing 10000 samples from the exact distribution. Next, we perform 200 epochs of the following training algorithm (we use a learning rate of 1e-2): 1. Sample 1000 points from the exact distribution Qinit. 2. Compute the loss L = − (cid:80) ln Qθ(x). x∼Qinit 3. Backpropagate to obtain ∇θL. 4. Take a gradient step using the Adabeleif optimizer (Zhuang et al., 2020). After this, we perform 3000 training steps of the following training algorithm (we use a learning rate of 1e-3): 21 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows 1. Sample 1000 points from the model distribution Qθ. 2. Compute the gradient update ∇θKL ≈ − 1 N (cid:88) x∼Qθ Qinit(x) Qθ(x) ∇θ ln Qθ(x). (22) 3. Take a gradient step using the Adabeleif optimizer (Zhuang et al., 2020). Note that for the dissipative harmonic oscillator systems, we use the exact initial state as the prior and initialize the normalizing flow transformation to be the identity. As such, we do not need to use pretraining for the dissipative harmonic oscillator systems. D.6. Euler experiment details Below are the hyperparameters we use for the Euler method. For the Harmonic Oscillator results, we use a 3 layer RealNVP where each affine transformation is a 2-hidden-layer feed-forward neural network with hidden layers of size 5. Instead of skip connections in the feed-forward neural network, we concatenate the previous activations at each activation layer. For the Dissipative Bosonic Model result, we use a Convex Potential Flow with a 5-hidden-layer input-convex neural network with hidden layers of size 20 and augmented layers of size 4, see (Huang et al., 2021). • 1-site Harmonic Oscillator: We train for 1500 steps with a step size of 0.01. For each step, we use the KL control variance loss to fit for 150 epochs with a learning rate of 0.001. We use 1000 samples per fitting epoch. • 2-site Harmonic Oscillator: We train for 1500 steps with a step size of 0.01. For each step, we use the KL control variance loss to fit for 150 epochs with a learning rate of 0.001. We use 1000 samples per fitting epoch. • 20-site Harmonic Oscillator: We train for 1500 steps with a step size of 0.01. For each step, we use the KL control variance loss to fit for 150 epochs with a learning rate of 0.001. We use 10000 samples per fitting epoch. • 2-site Dissipative Bosonic Model: We train for 400 steps with a step size of 0.02. For each step, we use the KL control variance loss to fit for 200 epochs with a learning rate of 0.002. We use 10000 samples per fitting epoch. D.7. TDVP experiment details Below are the hyperparameters we use for the TDVP method. For the Harmonic Oscillator results, we use a 3 layer RealNVP where each affine transformation is a 2-hidden-layer feed-forward neural network with hidden layers of size 5. Instead of skip connections in the feed-forward neural network, we concatenate the previous activations at each activation layer. For the Dissipative Bosonic Model result, we use a Convex Potential Flow with a 5-hidden-layer input-convex neural network with hidden layers of size 20 and augmented layers of size 4, see (Huang et al., 2021). • 1-site Harmonic Oscillator: We train for 1500 steps with a step size of 0.01. We use 1000 samples per step. We use a diagonal shift of 0.01. • 2-site Harmonic Oscillator: We train for 1500 steps with a step size of 0.01. We use 1000 samples per step. We use a diagonal shift of 0.01. • 20-site Harmonic Oscillator: We train for 1500 steps with a step size of 0.01. We use 10000 samples per step. We use a diagonal shift of 0.01. • 2-site Dissipative Bosonic Model: We train for 2000 steps with a step size of 0.004. We use 10000 samples per step. We use a diagonal shift of 0.01. E. Additional Experimental Results Figure 5 displays the L1 divergence between the simulated Q function and the exact dissipative harmonic oscillator Q function for various simulation methods. Table 3 shows the same information as 1 but with errors included. These give additional information about the L1 Loss evolution for the dissipative harmonic oscillator. 22 Q-Flow: Generative Modeling for Differential Equations of Open Quantum Dynamics with Normalizing Flows Figure 5. The L1 divergence between the simulated Q function and the exact Q function for 1-site, 2-site, and 20-site dissipative harmonic oscillators. Error bars are included for all but the finite difference and pseudo-spectral results but are small for most observables. In the 20-site case, it is not possible to run finite difference (FD) or pseudo-spectral methods (PS). Further, although the PINN method runs, it produces an L1 loss on the order of 1030, so we do not display it here. 1-site Q-Flow Euler (ours) (2.08 ± 0.01) * 10−3 (5.10 ± 0.01) * 10−4 (1.01 ± 0.00) * 10−4 (1.68 ± 0.01) * 10−5 (1.58 ± 0.01) * 10−5 Q-Flow TDVP (ours) (5.11 ± 0.01) * 10−3 (1.17 ± 0.00) * 10−3 (2.16 ± 0.01) * 10−4 (3.58 ± 0.01) * 10−5 (5.55 ± 0.01) * 10−6 PINN (1.79 ± 0.01) * 10−1 (1.84 ± 0.01) * 10−1 (1.91 ± 0.01) * 10−1 (1.91 ± 0.01) * 10−1 (1.98 ± 0.01) * 10−1 PS 3.47 * 10−4 3.47 * 10−4 3.47 * 10−4 3.47 * 10−4 3.47 * 10−4 FD 8.90 * 10−4 9.01 * 10−4 9.01 * 10−4 9.01 * 10−4 9.01 * 10−4 2-site (3.91 ± 0.01) * 10−3 (1.91 ± 0.00) * 10−3 (7.59 ± 0.02) * 10−4 (2.92 ± 0.01) * 10−4 (1.47 ± 0.00) * 10−4 (1.23 ± 0.00) * 10−2 (4.66 ± 0.01) * 10−3 (1.77 ± 0.00) * 10−3 (6.21 ± 0.01) * 10−4 (2.05 ± 0.00) * 10−4 1.00 ± 0.00 1.00 ± 0.00 1.00 ± 0.00 1.00 ± 0.00 1.00 ± 0.00 1.83 * 10−1 1.82 * 10−1 1.81 * 10−1 1.81 * 10−1 1.81 * 10−1 6.12 * 10−2 6.09 * 10−2 6.09 * 10−2 6.09 * 10−2 6.09 * 10−2 20-site (9.94 ± 0.03) * 10−2 (3.29 ± 0.01) * 10−2 (2.02 ± 0.01) * 10−2 (1.46 ± 0.00) * 10−2 (1.07 ± 0.00) * 10−2 (1.08 ± 0.00) * 10−1 (4.10 ± 0.01) * 10−2 (2.44 ± 0.01) * 10−2 (1.68 ± 0.00) * 10−2 (1.23 ± 0.00) * 10−2 (2.17 ± 0.62) * 1031 (2.38 ± 0.81) * 1030 (1.34 ± 0.52) * 1029 (1.46 ± 1.19) * 1028 (7.07 ± 3.66) * 1026 - - - - - - - - - - Time 3 6 9 12 15 3 6 9 12 15 3 6 9 12 15 Table 3. L1[Qsim, Qexact] for each simulation method over time, with errors. For each row, we mark the best result in bold. 23 051015t106104102100L1 Loss1-site051015t2-site051015t20-siteFDPSPINNQ-Flow Euler (Ours)Q-Flow TDVP(Ours)
http://arxiv.org/abs/2302.12232v1
2023-02-23T18:53:09
2023-02-23T18:53:09
Concept Learning for Interpretable Multi-Agent Reinforcement Learning
Multi-agent robotic systems are increasingly operating in real-world environments in close proximity to humans, yet are largely controlled by policy models with inscrutable deep neural network representations. We introduce a method for incorporating interpretable concepts from a domain expert into models trained through multi-agent reinforcement learning, by requiring the model to first predict such concepts then utilize them for decision making. This allows an expert to both reason about the resulting concept policy models in terms of these high-level concepts at run-time, as well as intervene and correct mispredictions to improve performance. We show that this yields improved interpretability and training stability, with benefits to policy performance and sample efficiency in a simulated and real-world cooperative-competitive multi-agent game.
[ "Renos Zabounidis", "Joseph Campbell", "Simon Stepputtis", "Dana Hughes", "Katia Sycara" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12232v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12232v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.RO" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 2 3 2 2 1 . 2 0 3 2 : v i X r a Concept Learning for Interpretable Multi-Agent Reinforcement Learning Renos Zabounidis∗, Joseph Campbell∗, Simon Stepputtis, Dana Hughes, Katia Sycara Carnegie Mellon University {renosz, jacampbe, sstepput, danahugh, sycara} @andrew.cmu.edu Abstract: Multi-agent robotic systems are increasingly operating in real-world environments in close proximity to humans, yet are largely controlled by policy models with inscrutable deep neural network representations. We introduce a method for incorporating interpretable concepts from a domain expert into models trained through multi-agent reinforcement learning, by requiring the model to first predict such concepts then utilize them for decision making. This allows an expert to both reason about the resulting concept policy models in terms of these high-level concepts at run-time, as well as intervene and correct mispredictions to improve performance. We show that this yields improved interpretability and training stability, with benefits to policy performance and sample efficiency in a simulated and real-world cooperative-competitive multi-agent game. Keywords: Multi-Agent Reinforcement Learning, Interpretable Machine Learning 1 Introduction With burgeoning adoption in fields such as autonomous driving, service robotics, and healthcare, multi-agent robotic systems are increasingly operating in real-world environments. The actions of these systems have a tangible and significant impact, particularly so when operating in close proximity to humans. While we expect such systems to exhibit safe and accurate behavior, errors are inevitable, and in such circumstances it is vitally important that the agents are able to explain their behavior to human operators. Operators can then ascertain whether the agent is operating erroneously – thus requiring intervention – or correctly but in a non-obvious manner. However, state-of-the-art multi-agent systems are often controlled by deep neural network models trained with reinforcement learning techniques [1]. While these methods have shown great ability to generate effective and generalizable models, they do so at the expense of interpretability, and the models often remain inscrutable to human operators [2]. This poses a significant risk, especially in end-to-end models, where it is not clear what information has been extracted from raw observations in order to make a policy decision. Domain experts often reason about agent behavior in terms of high-level concepts such as the presence of an obstacle – e.g., "the robot encountered an obstacle and subsequently changed direction". However, standard end-to-end models provide no mechanism for this sort of reasoning, let alone the ability to intervene and correct the model when it is wrong – e.g., "the robot should have detected an obstacle but it didn't". Such a mechanism is particularly important for robotic systems where we often encounter shifts in data distributions, such as when transferring policies from simulated environments to the real world, leading to model errors. These errors are exacerbated in multi-agent systems, where errors in each individual agent are compounded and produce large errors in environment dynamics. In this paper, we propose a method for learning interpretable policies – concept policy models – for multi-agent reinforcement learning (MARL). Our approach is predicated on the insight that we can leverage domain knowledge from an expert in order to regularize the model and influence what information is encoded from observations. We organize this domain knowledge into a set of interpretable concepts and enforce the constraint that the model is able to predict these concepts from observations, after which the concepts are used to predict policy actions. Concepts are semantically ∗Equal contribution 6th Conference on Robot Learning (CoRL 2022), Auckland, New Zealand. Figure 1: Concept policy models predict a set of interpretable concepts from observations, which are then used along with an (optional) residual to predict a policy action. A domain expert may intervene and provide corrective concept values to the policy if mis-predicted. meaningful labels that can be extracted from observations, such as the presence of a concrete or abstract feature in an observation, e.g., the existence of an obstacle or the intention of a human. Crucially, we find that the regularization imposed by the concept information helps stabilize the training process, and as a result leads to improved performance and sample efficiency. A typical end-to-end neural network policy model maps observations to actions [3]. Our approach inserts an intermediate concept layer, as shown in Fig. 1 which is required to predict concepts from observations. While this yields an interpretable model [4], it also imposes the assumption that the set of concepts are sufficient for policy inference. To ease this constraint, we introduce a scalable residual layer which passes additional information to the subsequent policy layers while ensuring it remains decorrelated with the concepts. We posit that the interpretability of the model is proportional to the capacity of the residual layer; intuitively, the more residual information available, the less the model may rely on the concepts. We show that this can result in a trade-off between interpretability and accuracy, given the expressivity of the concepts. Our contributions are as follows, we • Introduce a method for learning concept policy models in MARL utilizing expert domain knowledge, enabling the expert to reason about policy behavior in terms of high-level concepts and improving accuracy, sample efficiency, and training stability. • Develop two specific formulations based on this method: soft-concept models and hard- concept models, and empirically show the trade-off between accuracy and interpretability. • Formulate an intervention methodology and show how this can be used to offset model errors in general and in transfer learning (sim-to-real) scenarios. • Empirically show that our proposed approach produces interpretable, intervenable MARL policy models which exceed the accuracy of baseline MARL policies in a simulated and real-world game of "tag", between two teams of 2, 3, and 5 robots each. 2 Related Work Interpretability in supervised learning: Intepretability has been extensively studied within the field of supervised learning [5], which can be largely grouped into two categories: the explicit creation of an intrinsically interpretable model, or the post-hoc transformation of an uninterpretable model to an interpretable one. The former case typically revolves around considering interpretable classes of models – decision trees [6, 7], linear models [8, 9], or rule-based methods [10, 11] for example – and developing algorithms for these models. In the latter case, uninterpretable models are either transformed into interpretable ones [12, 13, 14], or interpretable models are extracted from an uninterpretable model for the purpose of explaining a model's decision rationale [15, 16]. Concept models often fall into the transformation case, and have been studied within the context of transforming a set of uninterpretable feature embeddings into a set of interpretable concepts [4, 17, 18]. A recent approach [19] similarly uses concepts, but rather than directly predicting such concepts it attempts to align the internal model representation to coincide with them. Interpretability in reinforcement learning: As in supervised learning, interpretability for reinforce- ment learning largely falls into the two categories of intrinsically interpretable models and post-hoc 2 StrategyConceptEnvironmentattConceptPolicyModelRangeConceptEnvironmentatt+1RemovedfromGameObservationEncoderConceptExtractionResidualAgentPolicyConceptsStrategyRange...ActivationSoftConceptOnlyVal.Interv. transformations. However, there is an additional line of work in which methods are devised to explain aspects particular to the Markov decision process model employed by RL methods. Some approaches have focused on interpretable representation learning [20, 21] and hierarchical decompositions [22], while others have opted to tackle MDP-specific explanations such as an interpretable reward sig- nal [23] or action explanation [24, 25, 26]. However, to the best of our knowledge, concept-related methods have not yet been explored in an RL setting, let alone MARL. 3 Preliminaries Multi-Agent Reinforcement Learning: We model the MARL problem as a decentralized partially observable Markov decision process (Dec-POMDP) [27]. A Dec-POMDP is defined as a tuple (cid:104)S, U, P, R, Z, O, n, γ(cid:105) in which S is the state space, U shared action space, P the state transition function, R the shared reward function, Z the observation space, O the observation function, n the number of agents, and γ the discount factor. For a given time step, the environment has a state s ∈ S and each agent a ∈ {a0, . . . , an} samples a partial observation za ∈ Z according to the observation function O(s, a) ∈ Z. The agents simultaneously sample an action ua ∈ U inducing a state transition according to P (s(cid:48)|s, u) ∈ [0, 1]. Each agent receives a reward ra according to the shared reward function R(sa, ua) ∈ R with a discount factor γ ∈ [0, 1]. We follow a centralized training and decentralized execution approach (CTDE), thus learning a central policy πθ(ua|za) ∈ [0, 1] parameterized by θ by maximizing the discounted expected cumulative reward: Et[(cid:80) t γtR(sa, ua)]. Multi-Agent Proximal Policy Optimization: Multi-Agent Proximal Policy Optimization (MAPPO) [28] is a straightforward extension to standard PPO [29] under the CTDE assumption in which we learn a single actor, πθ, and a single critic, Vφ, parameterized by θ and φ respectively. When sampling from the environment, each agent executes the same learned policy with their individual observations and actions. As with all policy gradient methods, PPO seeks to compute the policy gradient by differentiating the following objective function: L(θ) = ˆEt[logπθ(ua|za) ˆAt], (1) where ˆA is the estimated advantage function. PPO extends this objective function by adaptively clipping the update gradient and applying an entropy bonus to the policy to encourage exploration. If the value function and policy function share parameters, i.e., θ = φ, then the objective function must also include the value function loss. 4 Concept Policy Models We propose a method for learning concept policy models, which integrates domain knowledge from an expert in the form of concepts into a neural network policy model. These concepts are intended to serve two purposes: they are useful predictors for the desired policy behavior and as such allow an expert to reason about the policy in terms of high-level concepts, and mispredicted concepts can be corrected at run-time by the expert in order to induce correct behavior. The expert – hereafter referred to as an oracle – provides an oracle function V (*) which can be used to predict a ground truth concept vector of size j given an observation from an agent a, v = V (za) where v ∈ Rj. Concepts may be either continuous or discrete, and represent interpretable features which are assumed to be relevant to the task at hand. As an example, let us consider a cooperative-competitive multi-agent game in which two teams of agents play a game of "tag" during which one side must prevent the other from reaching a specific location. In this game, an expert might identify specific features such as the location of the nearest enemy, or the opposing team's strategy as a concept. 4.1 Policy Concept and Residual Layers We integrate this concept information into an end-to-end neural network policy πθ(ua|za) which predicts the probability for agent a taking action ua given observation za and parameters θ. This is accomplished by inserting an intermediate layer cθc(*) into the network to predict the concept vector, dividing the network into two parts: π(1) θ1 (*) representing the portion of the network before the new layer, and π(2) θ2 (*) representing the portion of the network after the new layer, such that θ2 (c(x) + r(x)) where and r(*) is a residual layer of size k designed to pass through non-concept information and the concept layer acts as a concept predictor, such that ˆv = c(x). In our proposed concept policy model, θ1 (za) (2) π(ua|za) = π(2) x = π(1) 3 π(1) θ1 : R|z| → Rh acts as a feature encoder mapping an observation to a feature embedding. The newly inserted concept layer serves as a bottleneck such that c(*) : Rh → Rj maps the feature embedding to a concept vector, while the residual layer r(*) : Rh → Rk maps the feature embedding to a residual vector. The final policy layer π(2) θ2 (*) : Rj+k → R|u| maps the aggregated concept and residual vectors to a policy action. We train the concept layer c(*) by imposing an additional auxiliary loss Lc(θ) in the objective function optimized by MAPPO: L(θ) = ˆEt[logπθ(ua|za) ˆAt] − Lc(θ) where, (cid:26)FL(vi, ˆvi) j (cid:88) Lc i (θ) and Lc i (θ) = Lc(θ) = i=0 MSE(vi, ˆvi) if discrete if continuous. (3) This loss is summed over each concept: mean squared error (MSE) is used for continuous concepts, and focal loss (FL) [30] for discrete concepts. The focal loss is a cross-entropy variant designed for class imbalanced situations which are likely to occur in our concept setting, as some concepts may be significantly rarer than others. In our above example with the strategy concepts, some strategies may be much less likely to occur than others, for instance. Note that for multi-class discrete concepts, a single abstract concept may consist of multiple nodes, and we refer to this as a concept group. In the strategy case, suppose an agent team may only execute one of strategy A, B, or C at a time, thus these three concepts represent a single concept group and so when we pass the discrete concepts through a softmax activation in order to calculate the focal loss we do so in a group-wise manner. The goal of the residual layer is to pass through information from π(1) θ1 (*) that is not captured by the concept vector. Without the residual, the concept vector must sufficiently represent the observation so that π(2) θ2 accurately infer the agent's action from concepts alone (a strict assumption in practice). We define two concept policy model variants: hard concept policy models which contain no residual (k = 0), and soft concept policy models which do (k > 0). By examining the concept layer activations, an oracle can query the predicted concepts ˆv and understand what concepts the policy model used for prediction. However, we conjecture that there is an inherent trade-off between the size of the residual layer k and the interpretability of these activations. While a full interpretability analysis is outside the scope of this work, we posit that the greater the residual dimension, the less that π(2) θ2 (*) must rely on the concept vector, i.e., there is a larger amount of non-concept information on which to base its prediction – which follows that k is inversely proportional to interpretability. 4.2 Concept and Residual Whitening In order to constrain the residual r(*) such that it does not encode information related to the concepts, we decorrelate the neuron activation vectors via whitening. Given a matrix X ∈ Rb×j+k consisting of the activations from the concatenated concept and residual vectors over a mini-batch of b samples, we aim to produce a whitened matrix X(cid:48) with ZCA whitening via iterative normalization [31] X(cid:48) = DΛ− 1 2 DT (X − μx) (4) where D and Λ are the eigenvectors and eigenvalues of X respectively. Iterative normalization uses an iterative optimization technique to incrementally whiten the matrix X, where the hyperparameter T dictates the number of optimization iterations. This gives us the flexibility of only partially decorrelating the residual and whitening layers, if desired, by setting T to a smaller value, e.g., T = 2. In practice, we find that performing fewer iterations is often necessary to stabilize the training process, as a higher T tends to increase the stochastic normalization disturbance and leads to reduced training efficiency [31], which is particularly noticeable in a MARL setting. At each training iteration, we first perform whitening then backpropagate our computed gradients, thus allowing us to decorrelate the concept and residual layers without requiring an additional optimization step as in prior work [19]. 4.3 Policy Intervention In addition to querying the predicted concepts ˆv, an oracle may also decide to intervene when these predictions are incorrect. This can be achieved by explicitly overwriting the concept layer node activations (or softmax activations for discrete concepts) with the appropriate values. We denote the modified concepts as ̄v which leads to the following intervened concept policy model: 4 Figure 2: A sequence of steps from a single episode during a policy execution in the real-world. The blue circle is the attacking team's (red) goal while the defending team (green) attempts to stop them. πθ(ua|za, ̄v) = π(2) θ2 ( ̄v + r(x)). This policy intervention corrects prediction errors in the feature encoder π(1) θ1 (*). We find that these sorts of errors are particularly prevalent when transferring robot policies from simulation to the real world due to different observation distributions, and show that policy interventions are effective at reducing such errors in Sec. 6. Similar to interpretability, we hypothesize that intervention effectiveness is inversely proportional to the size of the residual k; we cannot intervene on the residual layer activations so any resulting errors will persist. While our empirical results hint in this direction, we save a full exploration for future work. 5 Experimental Setup We show that our proposed concept policy models achieve high policy success rates and concept accuracy, in addition to improved training stability and sample efficiency, over standard MARL models in a cooperative-competitive multi-agent game of "tag" previously described in Sec. 4. We empirically analyze our approach in both simulated and real-world versions of this game, and explore its strengths and weaknesses especially with respect to interventions and sim-to-real transfer in Sec. 6. 5.1 Tag Game In our game shown in Fig. 2, two equally sized teams of agents compete with each other in which one team attempts to reach a specified goal location while the other team defends it and attempts to keep them away, which we refer to as the attacking and defending team respectively. To allow for complex behaviors and strategy, an agent from each team may "tag" an agent from the opposing team as long as it lies within a given proximity and is facing the opposing agent, removing the tagged agent from play. The attacking team wins if any agent is able to reach the goal location, while the defending team wins if the attacking agents are all tagged or the maximum number of time steps elapses. Observation and Action Space: The observations are a set of extracted features consisting of the positions, velocities, orientations and tagged status of all agents. Actions consist of accelerating forward or backward by a fixed amount, rotating left or right by a fixed offset, and tagging. Strategy: Furthermore, we restricted our game such that only the defending team's policy is trained via MAPPO. While it is a straightforward extension to train both an attacker and defender policy iteratively, we opted to restrict the attacking team to sampling strategies from a fixed policy distribution to better investigate the effects of our concept policy model on performance. We sample attacker strategies from a distribution consisting of three "types" with equal probabilities, {random, left, right}, where the attackers execute random actions, move towards the goal by sweeping along the left side of the environment, and move towards the goal by sweeping along the right, respectively. Given a sampled team level strategy, each agent then sampled an individual policy with noise from the strategy distribution, so as to generate stochastic policies. Concepts: We utilized the following concepts: {Range, Strategy, Target, Orientation, Position}, in which Range is a boolean concept indicating whether the opposing agent specified by Target is within tagging range, Strategy is a categorical concept mapping to the above team-level strategies, Target is a categorical concept indicating an opposing agent that should be pursued, and Orientation and Position are continuous concepts encoding the relative orientation and position of each opposing agent, respectively. The hard concept policy models are trained with the full set of concepts, while the soft models only employ a subset consisting of {Range, Strategy, Target}. Real-world Equivalent: The real-world version of our tag game is played in a 2v2 scenario on a 6(cid:48) × 6(cid:48) play area, with four Khepera IV [32] robots. Policies are trained in the simulation environment, then executed in the real-world environment; no additional training and no few-shot conditioning 5 Step0Step18Step38Step56Step75 Figure 3: Left: training curves showing win rate vs iterations over 5 random training seeds for each tested model type in a 2v2 scenario. Right: a sequence of episode steps showing the concept activations for agents on the defending team (green). is employed. The robot positions and orientations are extracted from a Vicon [33] motion capture system and converted into the model's expected observation format. The real-world version of the game exhibits significant differences in the dynamics between the simulated robots and the real- world robots – particularly in velocities, accelerations, and even control – presenting a challenging environment for sim-to-real. Further, tagged agents disappear in simulation while the real-world agents are driven out of the play area, providing a temporary obstacle. 5.2 Concept Policy Models and Baselines We trained a hard and soft concept model for 10M time steps for each scenario – 2v2, 3v3, and 5v5 – along with a standard policy model without concepts. Each model consists of a series of fully connected layers, recurrent layers, and the iterative normalization layer applied over the concatenated concept and residual layers, with full details given in the supplementary material. The concept dimension j for each hard model differ for each scenario due to the number of agents: j = 13, j = 18, and j = 28 for 2v2, 3v3, and 5v5 respectively. The concept dimensions for the soft models are j = 9, j = 12, and j = 18 for 2v2, 3v3, and 5v5. For the soft models, we additionally provide a residual layer with dimension k = 23, k = 52, k = 78 for 2v2, 3v3, and 5v5, respectively, leading to a combined bottleneck size of 32, 64, and 96. The baseline model lacks a concept layer (j = 0) and has a full-width residual k = 128. Residual layers sizes and other hyperparameters are given in the supplementary material and were chosen through extensive hyperparameter optimization. 6 Results The win rates and concept accuracy errors for the defending team in both simulation and real- world are shown in Table 1. These values are computed by training two seeds with the best set of hyperparameters found during optimization, then rolling out each policy for 100 evaluation episodes in simulation, and 20 in real-world. Simulation: We first observe that both concept policy model variants out-perform the baseline model in each scenario, with the hard concept model outperforming the others by a large margin. This in itself is unsurprising, given that the concepts were hand-designed so as to provide a sufficient amount of information for the policy, and the hard concept policy model heavily regularizes the learned model such that it learns this information. The decreased performance in the soft model is due to the fact that it is only trained with a subset of concepts and consequently the residual struggles to reliably encode this information on its own. As evidenced by the large win rate std shown in Table 1 on Lines 1 and 4, some seeds yield similarly strong performance to the hard models while others perform much worse – with the exception of 5v5 where they failed to learn at all. From this we can conclude that the soft concept policy models can offer comparable performance to hard concept models without requiring a fully-descriptive concept set, at the cost of increased training instability (see Figure 3 for a 2v2 scenario). The intervened win rate follows when an algorithmic oracle intervenes at every time step and sets the correct concept value when a concept is incorrectly predicted by the model, improving the win rate, particularly in the more complex 3v3 and 5v5 scenarios. Real-world: In the real-world environment shown in Fig. 2, we can see in Table 1 on Lines 10-12 that the win rates are drastically reduced for the concept policy models, but surprisingly not for the baseline model. Qualitatively, we have observed that this is because the baseline model became 6 0250500750100012501500Time Steps [x 1000]0.00.20.40.60.81.0Win RateBaselineHardSoftG1G2A1A2G1G2A2G1G2(a)G1G2A1A1A1(b)G1G2A2A2Targeting ConceptRange Concept(c)G1G2A2A2A2 Setup Model WR Inter. WR Range Strategy Target Orientation Position v n 2 o i t a l u m i S v 3 2 1 Soft 2 Hard 3 Base 3 4 Soft 5 Hard 6 Base 5 7 Soft 8 Hard 9 Base v 5 0.51 (0.35) 0.83 (0.01) 0.19 (0.07) 0.55 (0.31) 0.74 (0.01) 0.16 (0.06) 0.32 (0.01) 0.78 (0.04) 0.31 (0.04) 0.55 (0.09) 0.84 (0.01) - 0.57 (0.27) 0.80 (0.01) - 0.40 (0.01) 0.86 (0.01) - 0.03 0.04 - 0.03 0.03 - 0.02 0.03 - 0.04 0.07 - 0.10 0.13 - 0.25 0.14 - 0.24 0.20 - 0.17 0.23 - 0.52 0.13 - - 0.10 - - 0.11 - - 0.11 - - 0.11 - - 0.14 - - 0.21 - l a e R 2 10 Soft 11 Hard 12 Base v 2 0.10 0.25 0.35 0.00 0.95 - 0.03 0.04 - 0.53 0.53 - 0.13 0.92 - - 3.48 - - 0.81 - Table 1: The win rate (WR) and concept errors for our proposed models (Soft and Hard) and a baseline without concepts (Base). The Hard model is trained over all concepts, the Soft model over a subset, and the Base model with none. The win rate is the average standard win rate of the policy when the policy is executed over multiple seeds with the standard deviation shown in parentheses, while the intervened win rate (Inter. WR) is the average win rate when an oracle intervenes over all concepts and sets correct values. Range, Strategy, and Target are discrete concepts and as such the error shown is the error in accuracy score, while Orientation and Position are continuous and indicate mean squared error. Orientation is in radians and Position is a unit-less value in [−1, 1]. trapped in a local minima and learned a policy which was semi-performant and independent of the actions of the opposing team, causing it to drive in circles while constantly "tagging". This behavior highlights the difficulties standard MARL algorithms have when attempting to learn meaningful feature embeddings. The other interesting result from this experiment is the gain in performance by the hard model when interventions occur, and similarly the lack of improvement when the soft model is intervened. We can draw two insights from this: the distribution shift from the simulated to the real world environment is largely contained within the feature extractor, which is compensated for by the interventions in the hard model; and that the Orientation and Position concepts are by far the most important as when we are unable to intervene on them and correct for dynamics errors as in the soft model, performance fails to improve. Concept Ablations: Next, we examine ablated hard con- cept policy models which are only trained over a subset of concepts in the 2v2 and 3v3 simulated scenarios. The results are shown in Table 2 (left) and further support the evidence that the Orientation and Position concepts are by far the most important with respect to the win rate. In 2v2, the win rate drops to 0.23 (Line 2) in the absence of those concepts, while in 3v3 it drops to 0.27. Note that the only difference between the hard model and the soft model with this concept set is the presence of a residual layer; when this residual is present and allowed to encode additional information the win rate is nearly doubled to 0.51 as in the soft model in Table 1 (Line 1). Concept Ablation S i r . r t . t g T . s o P Interv. . Concept O . g 2v2 3v3 Sim Real n R 1 (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) 0.83 0.74 0.84 0.95 2 (cid:88) (cid:88) (cid:88) 0.23 0.27 0.84 0.20 3 (cid:88) (cid:88) (cid:88) (cid:88) 0.80 0.69 0.81 0.60 (cid:88) (cid:88) 0.80 0.72 0.78 0.80 4 Table 2: The win rate for concept abla- tions when only a subset of concepts are trained in simulation, and the win rate for intervention ablations in both the real and simulated 2v2 scenarios when only a subset of concepts are intervened over. Intervention Ablations: We performed an ablation over the set of intervened concepts, with the results shown in Table 2 (right). We can first observe that ignoring interventions over the Orientation and Position concepts does not affect the win rate (Line 2) in simulation, likely because the associated errors for those concepts are already low as shown in Table 1 (Line 2). As we intervene over fewer concepts, the win rate further drops; however, paradoxically the win rate drops to below the base win rate without any interventions at all. In the real-world we observe more pronounced effects due to the differing dynamics, where the strategy concept is more difficult to predict and impacts the behavior more significantly. We conjecture that this is because the agents are less agile in the real-world, and errors in the predicted strategy lead to less-than-optimal positioning. We note that there is an unexpected result here: intervening over every concept but Strategy (Line 3) yields a lower win rate than only Orientation and Position (Line 4). This appears to be a consequence of two factors: intervening over Range and Target but not Strategy increases 7 Figure 4: (Left) Intervening over Strategy for the 3v3 hard concept policy model in simulation. Each point is the average position of all the defenders as an episode progresses, where lighter values indicate earlier in the episode, averaged over 100 episodes. (Center) The probability of an agent performing the tag action over 1000 episodes when Range is predicted (None) or intervened (Range = 0/1) in a simulated 2v2 scenario. (Right) The win rate of the defending team over 1000 episodes when Target is predicted (None) or intervened (Target = A/B) such that both defenders share the same target in a simulated 2v2 scenario. The mean and 95% concept intervals are shown. the prediction error of Strategy which in turn lowers the win rate; and the policy resulting from intervening over only Orientation and Position results in more collisions with other agents during execution, making them easier to tag. Behavioral Effects: Figure 4 shows the effects of concept values on concept policy model behavior. The left figure visualizes the average position of the defending team as an episode progresses when the Strategy concept is intervened to always take a specific value, showing that the Strategy concept is clearly correlated with the defending team's movement. Specifically, when the attacking team is predicted to move to the left or the right, the defending team moves in the corresponding direction and towards the attackers to intercept. The two figures on the right further illustrate behavioral effects resulting from concept values; the middle figure shows that the probability of performing the tag action dramatically increases when the Range concept is intervened and forced to 1, while the right figure shows that the win rate decreases when the agents are forced to have the same Target rather than predicting their own independently. These results reveal that high-level concepts can impart meaningful behavioral effects on the down- stream policy that align with the concept's interpretation; thus while the concepts do not provide full transparency into the policy's decision making process they still provide the ability for an expert to understand what high-level pieces of information are informing a policy and how these might influence behavior. Limitations: In order to analyze the performance of our model for a single team of agents, we have restricted the variability in our environment and reduced the complexity of possible behaviors. In the future, we would like to evaluate asymmetric team compositions and learn a policy for the attackers. We have also only considered low-dimensional inputs in our experiments, and although we expect our approach to scale well to rich input representations such as images, since concept models have been traditionally applied in vision domains, this remains an open question. Additionally, we would like to expand the complexity of our real-world environments by incorporating additional robots. 7 Conclusion In this work we have introduced concept policy models for Multi-Agent Reinforcement Learning which incorporate domain knowledge from an expert in the form of concepts. Concept policy models allow an expert to query the model at run-time and analyze policy behavior in terms of high-level concepts, and crucially, intervene and correct concept predictions when errors occur. We empirically show that concept policy models regularize the underlying policy, yielding improved accuracy and sample efficiency while stabilizing training, and demonstrate how oracle-based interventions can be leveraged to partially compensate for distributional shift in sim-to-real transfer scenarios. We find that such interpretability is particularly important in multi-agent settings as even small changes in agent performance can lead to large changes in team coordination. Allowing an expert to understand what high-level concepts are used by a policy and reason about how these concepts affect individual agent behavior provides insight into team dynamics, and provides a mechanism for intervening and correcting behavior when necessary. 8 −0.15−0.10−0.050.000.050.10X Position0.00.10.20.30.40.50.6Y PositionMove LeftMove RightNo InterventionRange = 0Range = 1None0.00.20.40.60.8P(tag)Target = ATarget = BNone0.00.20.40.60.8Win Rate Acknowledgments This work was supported by DARPA award HR001120C0036, AFRL/AFOSR award FA9550-18- 1-0251, AFOSR award FA9550-15-1-0442, ARL W911NF-19-2-0146, NSF IIS-1724222, and the National Science Foundation Graduate Research Fellowship under Grant No. 1745016. References [1] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al. Human-level control through deep rein- forcement learning. Nature, 518(7540):529–533, 2015. [2] F. Doshi-Velez and B. Kim. Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608, 2017. [3] S. Stepputtis, J. Campbell, M. Phielipp, S. Lee, C. Baral, and H. Ben Amor. Language- conditioned imitation learning for robot manipulation tasks. In H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 13139–13150. Curran Associates, Inc., 2020. URL https://proceedings. neurips.cc/paper/2020/file/9909794d52985cbc5d95c26e31125d1a-Paper.pdf. [4] P. W. Koh, T. Nguyen, Y. S. Tang, S. Mussmann, E. Pierson, B. Kim, and P. Liang. Concept In International Conference on Machine Learning, pages 5338–5348. bottleneck models. PMLR, 2020. [5] R. Guidotti, A. Monreale, S. Ruggieri, F. Turini, F. Giannotti, and D. Pedreschi. A survey of methods for explaining black box models. ACM computing surveys (CSUR), 51(5):1–42, 2018. [6] J. Huysmans, K. Dejaeger, C. Mues, J. Vanthienen, and B. Baesens. An empirical evaluation of the comprehensibility of decision table, tree and rule based predictive models. Decision Support Systems, 51(1):141–154, 2011. [7] M. T. Ribeiro, S. Singh, and C. Guestrin. " why should i trust you?" explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pages 1135–1144, 2016. [8] S. Haufe, F. Meinecke, K. G ̈orgen, S. D ̈ahne, J.-D. Haynes, B. Blankertz, and F. Biessmann. On the interpretation of weight vectors of linear models in multivariate neuroimaging. Neuroimage, 87:96–110, 2014. [9] T. Le Nguyen, S. Gsponer, I. Ilie, M. O'Reilly, and G. Ifrim. Interpretable time series classifi- cation using linear models and multi-resolution multi-domain symbolic representations. Data mining and knowledge discovery, 33(4):1183–1222, 2019. [10] X. Yin and J. Han. Cpar: Classification based on predictive association rules. In Proceedings of the 2003 SIAM international conference on data mining, pages 331–335. SIAM, 2003. [11] F. Wang and C. Rudin. Falling rule lists. In Artificial intelligence and statistics, pages 1013– 1022. PMLR, 2015. [12] R. Agarwal, L. Melnick, N. Frosst, X. Zhang, B. Lengerich, R. Caruana, and G. E. Hinton. Neural additive models: Interpretable machine learning with neural nets. Advances in Neural Information Processing Systems, 34:4699–4711, 2021. [13] O. Bastani, C. Kim, and H. Bastani. Interpretability via model extraction. arXiv preprint arXiv:1706.09773, 2017. [14] G. Liu, O. Schulte, W. Zhu, and Q. Li. Toward interpretable deep reinforcement learning with linear model u-trees. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 414–429. Springer, 2018. [15] R. Guidotti, A. Monreale, S. Ruggieri, D. Pedreschi, F. Turini, and F. Giannotti. Local rule-based explanations of black box decision systems. arXiv preprint arXiv:1805.10820, 2018. 9 [16] B. Kim, M. Wattenberg, J. Gilmer, C. Cai, J. Wexler, F. Viegas, et al. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav). In International conference on machine learning, pages 2668–2677. PMLR, 2018. [17] K. Yi, J. Wu, C. Gan, A. Torralba, P. Kohli, and J. Tenenbaum. Neural-symbolic vqa: Disen- tangling reasoning from vision and language understanding. Advances in neural information processing systems, 31, 2018. [18] M. Losch, M. Fritz, and B. Schiele. Interpretability beyond classification output: Semantic bottleneck networks. arXiv preprint arXiv:1907.10882, 2019. [19] Z. Chen, Y. Bei, and C. Rudin. Concept whitening for interpretable image recognition. Nature Machine Intelligence, 2(12):772–782, 2020. [20] T. Lesort, N. D ́ıaz-Rodr ́ıguez, J.-F. Goudou, and D. Filliat. State representation learning for control: An overview. Neural Networks, 108:379–392, 2018. [21] Z. Lin, K.-H. Lam, and A. Fern. Contrastive explanations for reinforcement learning via embedded self predictions. arXiv preprint arXiv:2010.05180, 2020. [22] B. Beyret, A. Shafti, and A. A. Faisal. Dot-to-dot: Explainable hierarchical reinforcement learning for robotic manipulation. In 2019 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 5014–5019. IEEE, 2019. [23] Z. Juozapaitis, A. Koul, A. Fern, M. Erwig, and F. Doshi-Velez. Explainable reinforcement learn- ing via reward decomposition. In IJCAI/ECAI Workshop on explainable artificial intelligence, 2019. [24] F. Cruz, R. Dazeley, P. Vamplew, and I. Moreira. Explainable robotic systems: Understanding goal-driven actions in a reinforcement learning scenario. Neural Computing and Applications, pages 1–18, 2021. [25] H. Yau, C. Russell, and S. Hadfield. What did you think would happen? explaining agent behaviour through intended outcomes. Advances in Neural Information Processing Systems, 33: 18375–18386, 2020. [26] Y. Guo, J. Campbell, S. Stepputtis, R. Li, D. Hughes, F. Fang, and K. Sycara. Explainable action advising for multi-agent reinforcement learning. arXiv preprint arXiv:2211.07882, 2022. [27] F. A. Oliehoek and C. Amato. A concise introduction to decentralized POMDPs. Springer, 2016. [28] C. Yu, A. Velu, E. Vinitsky, Y. Wang, A. Bayen, and Y. Wu. The surprising effectiveness of mappo in cooperative, multi-agent games. Advances in Neural Information Processing Systems, 2022. [29] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. [30] T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Doll ́ar. Focal loss for dense object detection. In Proceedings of the IEEE international conference on computer vision, pages 2980–2988, 2017. [31] L. Huang, Y. Zhou, F. Zhu, L. Liu, and L. Shao. Iterative normalization: Beyond standardization towards efficient whitening. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4874–4883, 2019. [32] J. M. Soares, I. Navarro, and A. Martinoli. The khepera iv mobile robot: performance evaluation, sensory data and software toolbox. In Robot 2015: second Iberian robotics conference, pages 767–781. Springer, 2016. [33] Vicon Motion Systems. Vicon motion capture system. URL https://www.vicon.com/ hardware/cameras/. 10 A Concept Definitions Range: The range concept indicates whether an agent is within range of another agent and facing it, where the range is within 0.8 map units and the angle is within π 5 radians. This value is a one-hot encoded value (within range or not within range) for each opposing agent, such that the total number of output nodes for this concept is 2n where n is the number of agents on the opposing team. Strategy: The strategy concept indicates what team-level strategy the attacking team is following: left, right, or random. The strategy refers to the actions that an attacking team will take; a left strategy indicates that agents will follow a trajectory along the left side of the map leading to the objective, a right strategy indicates that agents will follow a trajectory along the right side of the map, and random indicates that agents will execute random actions. This concept is one-hot encoded and requires p output nodes, where p is the number of strategies – 3 in this work. Target: The target concept indicates which agent on the opposing team an agent is currently targeting. The goal of this concept is to overcome the issue of oscillating targets, e.g., if an agent is equally close to multiple agents this can lead to oscillating behavior where the ego agent is unsure which other agent to pursue, and flips between them as the distance changes. During training, the targeted agent is initially selected to be the closest opposing agent and is only updated when that agent has been tagged. As with the range concept, this is a one-hot encoded value with 2n output nodes. Orientation: The orientation concept is a continuous value representing the relative angle offset between an agent to each other agent on the opposing team. This value consists of n nodes where n is the number of agents on the opposing team. Position: The position concept is a continuous value representing the relative Euclidean distance between an agent and each other agent on the opposing team. This value consists of n nodes where n is the number of agents on the opposing team. B Training Details Models are trained using a centralized-training-decentralized-execution approach, where a single policy is trained for all agents, and then executed individually for each agent during rollouts. True concept values are provided during training via an oracle function V (*) and used to compute the corresponding auxiliary loss, as well as the true concept values for intervention during intervened evaluation rollouts. Attacker strategies during training are sampled with equal probability from the set {left, right, random}, with sampled Left and Right strategies shown in Fig. 6. The random strategy is utilized to encourage the defenders to develop strategies in which they are free to pursue individual attackers, as opposed to remaining stationary near the objective. All policies were trained for 10M timesteps, after which the best policy checkpoint was taken – necessary since some models experienced forgetting and instability. Extensive hyperparameter optimization was performed, with the selected hyperparamters shown in Table 4. Reward: We have simplified the reward function of FortAttack by removing penalties to encourage policy exploration, resulting in a reward of the form R(sa, ua) = −ROri. − RMiss − RTagged − RLose + RTag + RWin, where ROri. is a penalty for not facing an opponent, RMiss is a penalty for missing a tag, RTagged is a penalty for being tagged, RLose is a penalty for losing, RTag is a reward for tagging, and RWin is a reward for winning. Several of these are shaping terms in order to improve sample efficiency, which we found to be necessary for efficient convergence rates in the absence of expert demonstrations. (5) C Detailed Results Analysis Table 3 is an expanded table showing the concept errors for each model in each scenario type with the addition of the standard error, indicating fairly consistent predictions. We have additionally computed statistical significance over the win rates for each model in each scenario type (Table 1 in the main paper) using Fisher's exact test with p < 0.05, finding that in all simulated scenarios (2v2, 3v3, and 5v5), the Hard model wins significantly more than the Soft and Base models over 100 evaluation episodes. In the case of interventions, the only model which exhibits statistically significant improvement to the win rate after intervention is the 2v2 hard concept policy model for the real world, increasing 11 2 v n 2 o i t a l u m i S 3 v 3 5 v 5 2 v 2 l a e R Setup Model Range Strategy Target Orientation Position Soft Hard Base Soft Hard Base Soft Hard Base 0.03 ± 0.0032 0.04 ± 0.0040 - 0.03 ± 0.0029 0.03 ± 0.0031 - 0.02 ± 0.0022 0.03 ± 0.0021 - 0.04 ± 0.0060 0.07 ± 0.0066 - 0.10 ± 0.0085 0.13 ± 0.098 - 0.25 ± 0.012 0.14 ± 0.012 - 0.24 ± 0.012 0.20 ± 0.012 - 0.17 ± 0.0109 0.23 ± 0.012 - 0.52 ± 0.013 0.13 ± 0.0097 - - 0.10 ± 0.0071 - - 0.11 ± 0.0071 - - 0.11 ± 0.0063 - - 0.11 ± 0.014 - - 0.14 ± 0.0014 - - 0.21 ± 0.0142 - Soft Hard Base 0.03 ± 0.0037 0.04 ± 0.0040 - 0.53 ± 0.015 0.53 ± 0.015 - 0.13 ± 0.010 0.92 ± 0.0082 - - 3.48 ± 0.11 - - 0.81 ± 0.039 - Table 3: The concept errors (mean and standard error) for our proposed models (Soft and Hard) and a baseline without concepts (Base). The Hard model is trained over all concepts, the Soft model over a subset, and the Base model with none. Range, Strategy, and Target are discrete concepts and as such the error shown is the error in accuracy score, while Orientation and Position are continuous and indicate mean squared error. Orientation is in radians and Position is a unit-less value in [−1, 1]. Errors are computed over 100 episode rollouts for each model for simulated, and 20 rollouts for real-world. from 25% to 95% – partially due to the small number of evaluation policy rollouts (20). We note that while the soft concept policy's intervened win rate may not be a statistically significant decrease, it is an interesting observation that interventions do not increase the win rate. We conjecture that this is because the residual layer encodes observation information which is affected by the distributional shift from simulation to the real-world, and despite being able to intervene over a subset of the concepts that are encoded, this is not enough to overcome the distribution gap. Furthermore, the intervened hard concept policy model yields a greater improvement to the win rate in the real world than in simulation. This is an interesting outcome, and we conjecture that this is due to the real-world dynamics making it easier for the defenders to win assuming correct concept predictions. For example, the attackers can move and turn faster in simulation as they are not subject to real-world physics, and this makes it harder for the defenders to tag them. D Model Architecture Figure 5: The common model architecture shared by all models, which vary only in j and k. The common model architecture shared by all models is shown in Fig. 5, varying only in the size of the concept and residual layers (as described in the main paper). The observations of each agent in the opposing team are stacked and fed through a series of FC layers. This is then passed through a recurrent LSTM layer to capture temporal information, and then split into the concept and residual layers. Whitening is performed via iterative normalization over the concatenated concept and residual layers, which are then passed into the policy and value heads consisting of more fully connected layers. Each group of (2x 128) fully connected layers are followed by a ReLU activation, with the group-wise softmax following the concept layer after the IterNorm for discrete concepts only. The auxiliary loss Lc(θ) is computed over the concepts after the IterNorm layer. 12 Obs 1...Obs nPolicyValue2x1282x1282x1282x128128jkFCFCLSTMFCFCIterNorm E Hyperparameters Learning Rate Schedule Entropy Schedule LSTM Max Sequence Length Batch Size SGD Minibatch Size Concept Loss Coeff. T Optimizer β1, β2 1e-3 at t=0 to 1e-4 at t=10M 0.1 at t=0 to 0.01 at t=10M 50 10240 1600 (Seq. Length × 32) 10 2 Adam 0.9, 0.999 Table 4: Hyperparameters used for each model type. The MAPPO hyperparameters used for each model during training are given in Table 4. The learning rate and entropy values used a linear scheduler where the values were decreased as training progressed. F Attacker Strategies Figure 6: Sampled attacker strategies from the left and right strategies. Lighter points indicate agent positions earlier in the episode. The objective is at the top of the screen. Attackers randomly spawn in the lower half of the environment. Figure 6 shows a set of sampled individual attacker strategies from the left and right attacker distributions (red and blue respectively). These trajectories illustrate the amount variance that is displayed by the attackers, despite sampling behavior from fixed strategy distributions. 13 1.000.750.500.250.000.250.500.751.00X1.000.750.500.250.000.250.500.751.00YLeftRight
http://arxiv.org/abs/2302.12228v3
2023-03-05T15:48:51
2023-02-23T18:46:41
Encoder-based Domain Tuning for Fast Personalization of Text-to-Image Models
Text-to-image personalization aims to teach a pre-trained diffusion model to reason about novel, user provided concepts, embedding them into new scenes guided by natural language prompts. However, current personalization approaches struggle with lengthy training times, high storage requirements or loss of identity. To overcome these limitations, we propose an encoder-based domain-tuning approach. Our key insight is that by underfitting on a large set of concepts from a given domain, we can improve generalization and create a model that is more amenable to quickly adding novel concepts from the same domain. Specifically, we employ two components: First, an encoder that takes as an input a single image of a target concept from a given domain, e.g. a specific face, and learns to map it into a word-embedding representing the concept. Second, a set of regularized weight-offsets for the text-to-image model that learn how to effectively ingest additional concepts. Together, these components are used to guide the learning of unseen concepts, allowing us to personalize a model using only a single image and as few as 5 training steps - accelerating personalization from dozens of minutes to seconds, while preserving quality.
[ "Rinon Gal", "Moab Arar", "Yuval Atzmon", "Amit H. Bermano", "Gal Chechik", "Daniel Cohen-Or" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12228v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12228v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.GR", "cs.LG" ]
3 2 0 2 r a M 5 ] V C . s c [ 3 v 8 2 2 2 1 . 2 0 3 2 : v i X r a Encoder-based Domain Tuning for Fast Personalization of Text-to-Image Models Rinon Gal∗ Tel Aviv University, NVIDIA Tel Aviv, Israel Amit H. Bermano Tel Aviv University Tel Aviv, Israel Moab Arar Tel Aviv University Tel Aviv, Israel Gal Chechik NVIDIA Tel Aviv, Israel Yuval Atzmon NVIDIA Tel Aviv, Israel Daniel Cohen-Or Tel Aviv University Tel Aviv, Israel Figure 1: Our encoder-based method enables quick personalization of text-to-image models, teaching them novel concepts in seconds rather than dozens of minutes. The personalized model can then be used to create new images of the concept using natural language prompts. ABSTRACT Text-to-image personalization aims to teach a pre-trained diffusion model to reason about novel, user provided concepts, embedding them into new scenes guided by natural language prompts. How- ever, current personalization approaches struggle with lengthy training times, high storage requirements or loss of identity. To overcome these limitations, we propose an encoder-based domain- tuning approach. Our key insight is that by underfitting on a large set of concepts from a given domain, we can improve generaliza- tion and create a model that is more amenable to quickly adding novel concepts from the same domain. Specifically, we employ two components: First, an encoder that takes as an input a single image of a target concept from a given domain, e.g. a specific face, and learns to map it into a word-embedding representing the concept. Second, a set of regularized weight-offsets for the text-to-image model that learn how to effectively ingest additional concepts. To- gether, these components are used to guide the learning of unseen concepts, allowing us to personalize a model using only a single image and as few as 5 training steps - accelerating personalization from dozens of minutes to seconds, while preserving quality. Code and trained encoders will be available at our project page. ∗work was done during an internship at NVIDIA 1 1 INTRODUCTION The ability to personalize large-scale text-to-image models [Ramesh et al. 2022; Rombach et al. 2022; Saharia et al. 2022] has revolution- ized content creation. By injecting an understanding of a new con- cept into pre-trained models, a user can leverage it in new prompts, thereby inserting a subject into new scenes, or invoking a unique artistic style with a single word. However, current personalization methods [Gal et al. 2022; Ruiz et al. 2022] are difficult to scale, with each new concept requir- ing fine-tuning sessions lasting dozens of minutes or even hours on a top-end GPU. Moreover, when tuning the entire model, the resulting checkpoints are typically several GB in size, incurring non-negligible storage and serving costs. Finally, to prevent the model from overfitting spurious image details such as the back- ground, these models typically require painstaking collection of multiple images with varied backgrounds and poses. We propose to tackle these challenges through a novel domain- tuning approach, where the text-to-image model is taught how to personalize well to new concepts from a given domain. For example, we would like to tune the model on a dataset of cats (the domain), such that it can more easily be personalized to individual, unseen cats (the concepts). Our approach is based on the premise that highly regularized models are well suited to learning some averaged behaviour. We thus propose to concurrently personalize Single Input...piloting a fighter jet......colorfulgraffiti ......as a Witcher......as a manga drawing......pencildrawing ......shaking hands with herself...1,0005-15finetuningsteps...as a bulldog......as an astronaut......as wonder woman......watercolor painting......in sunglasses, on the beach......charcoal sketch... Rinon Gal, Moab Arar, Yuval Atzmon, Amit H. Bermano, Gal Chechik, and Daniel Cohen-Or a network on a large collection of concepts from a single domain, while limiting its degrees of freedom. Instead of learning the details of individual concepts, this network then learns a more generalized set of weights that lies close to each of them individually. Our approach is thus similar in spirit to Meta Learning [Finn et al. 2017], and specifically the joint-training scenario outlined by Nichol and Schulman [2018]. To implement our approach, we design two components: A re- stricted set of weights to tune, and an efficient way to invert a large number of concepts. For the weights, we investigate models tuned with prior approaches and propose to modulate the projection ma- trices in the denoising network's attention mechanism. Rather than tuning the weights directly, we employ a learned constant followed by a set of fully connected layers to transform it into an offset for the model's weights. Learning these changes through a network serves to restrict both the rank of the learned offsets and to provide a smoothness prior [Rahaman et al. 2019]. For efficient inversion, we employ an encoder – a neural network tasked with quickly mapping a given concept image into a word embedding that approximately represents it. We draw inspiration from the literature on GAN inversion [ber 2022; Xia et al. 2021] and propose an iterative-refinement [Alaluf et al. 2021a] scheme. Here, instead of predicting an embedding representation for the concept in a single forward-pass, we couple the encoder to the denoising process and predict a novel embedding for each time step. Moreover, through this iterative approach, the encoder can observe both the target image and the current noisy sample at each step. This allows it to correct for mistakes during the synthesis process. The encoder and weight offsets are jointly pretrained on a large dataset from a single given domain, such as FFHQ [Karras et al. 2019], LSUN Cat [Yu et al. 2015], or WikiArt [Saleh and Elgammal 2015]. To learn a new, specific concept at inference time, we fine- tune both components and the diffusion model on a single image portraying the personal concept. Our approach thus serves three goals: (1) a strong initialization to the tuning process for both the model and the word embedding, (2) a means of allowing the net- work to correct for mistakes during the iterative denoising process, and (3) a domain prior that helps identify the target concept even from a single image. Together, these allow us to tune a model for a specific concept with a single image and as few as 5 training itera- tions - roughly 11 seconds of training on a single NVIDIA A100 GPU, or ×60 − 140 faster than previous personalization approaches. Importantly, as tuning now takes a number of steps comparable to the synthesis process, it can be used at inference time to enable one-shot personalization, without requiring a new model for every new identity. We compare our approach with prior personalization baselines and demonstrate that our method can synthesize appealing results, with fewer images, and with a fraction of the tuning time. 2 RELATED WORK Text-guided synthesis. Early text-to-image models employed a Generative Adversarial Network (GAN)-based architecture [Good- fellow et al. 2014] trained on large collections of paired image- caption data [Tao et al. 2020; Xu et al. 2018; Ye et al. 2021; Zhang et al. 2021; Zhu et al. 2019]. However, GANs are prone to mode collapse and are difficult to train at scale [Brock et al. 2019; Heusel et al. 2017]. Motivated by the scaling success of language models, auto-regressive models [Gafni et al. 2022; Ramesh et al. 2021; Yu et al. 2022] treated images as word sequences in a discrete latent space [Esser et al. 2021; van den Oord et al. 2017]. There, text guid- ance could be used by conditioning the generation on text-prefix, or through test-time optimization using text-to-image similarity models [Crowson 2021; Radford et al. 2021]. Recently, diffusion models [Dhariwal and Nichol 2021; Ho et al. 2020; Nichol and Dhari- wal 2021] have taken the front in image generation. They led to a remarkable headway in text-to-image synthesis, achieving unprece- dented diversity and fidelity [Balaji et al. 2022; Nichol et al. 2021; Ramesh et al. 2022; Rombach et al. 2022; Saharia et al. 2022]. Our approach aims to leverage such pre-trained text-to-image diffusion models, and teach them to reason about personalized concepts. Inversion. Image inversion refers to the task of finding a latent code that can be fed into a generator to reconstruct a given target image [Xia et al. 2021; Zhu et al. 2016]. This process typically in- volves direct optimization of the latent on a single image [Abdal et al. 2019, 2020; Gu et al. 2020; Parmar et al. 2022; Zhu et al. 2020a] or training a neural network to predict such a code directly. Such a network is typically referred to as an encoder [Pidhorskyi et al. 2020; Richardson et al. 2020; Tov et al. 2021; Zhu et al. 2020b], and is trained on large datasets, allowing it to generalize to new targets. When the generator's latent spaces exhibit strong semantics, these codes can be manipulated in order to edit the target image [Gal et al. 2021; Patashnik et al. 2021; Shen et al. 2020] or used for regression tasks [Nitzan et al. 2021; Xu et al. 2021]. With diffusion models, inversion often refers to the task of find- ing an initial noise sample that can be denoised into a given tar- get [Dhariwal and Nichol 2021; Ramesh et al. 2022]. Unfortunately, such methods do not lend themselves well to downstream editing, leading to a loss of identity when the conditioning code is modi- fied [Gal et al. 2022; Mokady et al. 2022]. More recently, inversion has been used in the context of text-to-image synthesis to describe the task of finding a latent code that can be used to synthesize novel images of a given concept [Gal et al. 2022], a process also referred to as personalization. Our method falls into the latter category. Personalization. Personalization methods adapt a given model to a unique individual or group by leveraging data specific to the target user. These methods have been used in various applications, such as recommendation systems [Amat et al. 2018; Benhamdi et al. 2017; Cho et al. 2002; Martinez et al. 2009], federated learning [Fal- lah et al. 2020; Jiang et al. 2019; Mansour et al. 2020; Shamsian et al. 2021], and, more recently, in computer vision and graph- ics [Agrawal et al. 2021; Alaluf et al. 2021b; Bau et al. 2019; Cao et al. 2022; Cohen et al. 2022; Dinh et al. 2022; Nitzan et al. 2022; Roich et al. 2021]. In the context of text-to-image diffusion models, prior work aims to teach a pre-trained model to synthesize novel images of a specific target concept, guided by natural language prompts. Current personalization methods either optimize a set of text embeddings to describe the concept [Gal et al. 2022] or tune the denoising network to tie a rarely-used word-embedding to the new concept [Ruiz et al. 2022]. However, both approaches require multiple images of the target concept, and employ lengthy training sessions, lasting dozens of minutes on high-end GPUs. Moreover, 2 Encoder-based Domain Tuning for Fast Personalization of Text-to-Image Models the model-tuning approach requires storing several gigabytes of data for each new concept - making large-scale personalization a costly endeavour. Our work brings the encoder-based approach to the realm of personalization, reducing training times by orders of magnitude, eliminating the need to store models, and allowing for model personalization using only a single image. 3 METHOD Our goal is to design a method for efficient injection of new con- cepts into a pre-trained text-to-image diffusion model. To do so, we propose a domain-tuning approach where the model is taught how to personalize well to new concepts from a given domain. To achieve this goal, we train an encoder for efficient inversion of concepts into the diffusion model, and a set of weight-offsets that modify the model so that it can be quickly tuned for novel concepts. In the following section, we outline the task of encoder inversion, our design choices when creating such an encoder, and the motiva- tions behind them. Then, we discuss our approach for selecting a subset of weights that is expressive enough to enable personaliza- tion, yet restrictive enough to prevent the model from overfitting to the training data. Finally, we discuss our tuning approach and additional tools that can improve the results. 3.1 Inversion and encoder design Inversion encoders are neural networks that take an input image Ic representing a specific concept and predict some latent code zc such that feeding the code back into the generator G will result in a new image of the concept, i.e., I ′ = G (zc ) = G (E (Ic )) ∼ Ic . To train such an inversion encoder, we must first choose a suit- able latent space in which concepts will be represented. In the case of text-to-image diffusion models, a possible candidate is the word embedding space used in Textual Inversion [Gal et al. 2022]. However, as Gal et al. demonstrate, this space exhibits a trade-off between reconstruction and editability. This is because more ac- curate concept representations typically reside far from the real word embeddings, leading to poorer performance when using them in novel prompts. Roich et al. [2021] tackled a similar hurdle for StyleGAN inversion. They proposed a two-step solution which consists of approximate-inversion followed by model tuning. The intuition here is that the initial inversion can be constrained to an editable region of the latent space, at the cost of providing only an approximate match for the concept. The generator can then be briefly tuned to shift the content in this region of the latent space, so that the approximate reconstruction becomes more accurate. Since this change is more localized, it minimizes the loss of the network's prior knowledge. We aim to employ a similar tuning approach here and, therefore, wish the encoder to invert new concepts into an editable region of the word-embedding space, even at the cost of accuracy. Since we train a domain-specific encoder, we elect to maintain editability by constraining our predicted embeddings to reside near the word- embedding of the domain's coarse descriptor (e.g. "face", "cat" or "art"). Our concept-specific embedding ec is thus given by: εc = εdomain + s * E (Ic ) , (1) where E is our encoder, εdomain is the pre-trained model's embed- ding for the domain's coarse descriptor, and s is a scaling factor which we empirically set to 0.1 We additionally constrain the encoder's prediction through a regularization penalty term: Lreg = ||E (Ic ) ||2 2 . (2) Encoder architecture. We design our encoder as a set of feature- refinement blocks built on top of a pre-trained OpenCLIP [Ilharco et al. 2021] ViT-H/14 [Dosovitskiy et al. 2021] feature-extraction backbone. Specifically, we extract the features of the [CLS] token of each 2nd CLIP layer as an hierarchical feature representation [Tu- manyan et al. 2022; Vinker et al. 2022]. Each such feature vector is fed through a linear layer, followed by average-pooling over the hierarchy and LeakyReLU activation. These features are then fed into a final linear layer which predicts the embedding offset, E (Ic ). Iterative refinement. In the GAN literature, Alaluf et al. [2021a] proposed an iterative inversion scheme. There, an encoder first pre- dicts an initial latent z0 for a given target image It . This code is fed into a GAN G to generate an initial reconstruction I ′ 0 = G (z0). The encoder then receives the pair {It , I ′ 0} and is tasked with reasoning over any discrepancies and predicting a refined latent z1 that pro- duces a better reconstruction, I ′ 1 = G (z1). This process continues in an iterative fashion, leading to increased reconstruction quality. Diffusion models already employ an iterative denoising process, and therefore lend themselves well to such an approach. However, in contrast to GAN inversion, the denoising process does not pro- vide us with clean reconstructions to use as an input to the encoder for the next iteration. Moreover, popular diffusion models operate in a latent domain [Rombach et al. 2022], and the codes they pro- duce cannot be naïvely fed into our feature extraction backbone. Using such a model's decoder to map the latents back to the image domain incurs a significant cost in both memory and time. Instead, we propose that the pre-trained diffusion model already contains a feature extraction network that can reason over noisy latents, the denoiser's U-net itself. Therefore, we feed the noisy image into the U-net encoder and extract the pooled features from each of its blocks. These features are then concatenated with the hierarchical features extracted from the concept image through the CLIP back- bone, before being passed to the rest of the encoder. See fig. 2 for an illustration of this process. 3.2 Weight offsets Our approach requires us to determine a subset of model parameters that is expressive enough to allow for downstream personalization, yet restrictive enough that tuning it alone will not shift the entire generator's domain. To do so, we first examine a set of 50 fully tuned networks taken from the HuggingFace concept library [Passos and Sanseviero 2022]. These range from specific objects to more abstract concepts such as artistic styles. To identify which layers underwent the most significant change during tuning, we begin by calculating the unsigned distance between each fine-tuned model's weights and those of the original. Each layer is assigned an importance score by taking the mean distance over its parameters and normalizing it by the mean value of parameters within the layer. Finally, we average each layer's score between all the tuned models and rank 3 Rinon Gal, Moab Arar, Yuval Atzmon, Amit H. Bermano, Gal Chechik, and Daniel Cohen-Or Figure 2: Method overview. Our method efficiently adapts pre-trained diffusion models (middle) to handle novel concepts. We train two components, a word-embedding encoder (left) and weight offsets (right). The encoder predicts a new code in the diffusion model's embedding space which best describes the input concept. In addition, we optimize learned weight offsets to specialize the text-to-image model to the target domain (e.g. cats). Our offsets are learned constants, regularized through a neural network. During training, we use x0 = Ic . Here, we show inference, where xT is sampled from the Gaussian prior as usual and hence xt is no longer a noisy version of Ic . the layers according to their importance score. In table 1 we list the importance score breakdowns according to different types of layers. We observe that the cross- and self-attention layers have higher scores, indicating that they play a crucial part in the tuning effort, and thus focus on modulating the weights of these layers. Specifi- cally, we modify the three attention projection matrices - Wq, Wk and Wv. We note that a similar study was conducted in the con- current work of Kumari et al. [2022]. Their conclusions are largely the same. However, they opted to focus their tuning on a smaller subset of layers. Table 1: Layer importance scores. Attention layers see more drastic changes during the tuning process, and so we focus on them. By Layer Location Location Score (↑) Location Score (↑) Cross-attention Self-Attention Other Upsampling Blocks Downsampling Blocks 59.20 47.35 10.50 Middle Block 24.11 15.57 17.64 By Attention Type Cross-Attention Score (↑) Self-Attention Score (↑) WQ WK WV WO 140.18 WQ 62.93 WK 34.62 WV 30.78 WO 47.35 82.41 74.48 16.26 However, our experiments indicate that this set of weights is still too permissive, leading to poor results at the concept-specific tuning stage. We thus propose to regularize the weight predictions 4 by using a deep neural network as a prior [Ulyanov et al. 2018]. Let W{q,k,v } be an attention projection matrix of size MxN , rather than predicting it directly, we propose to learn an initial parameter vector v0 and four linear layers. The first two are used to project the vector into two components: vy ∈ RMx1 and vx ∈ R1xN . These are multiplied to create an MxN matrix. We further refine the result by applying a linear projection over the matrix rows, followed by a linear projection over the columns. This approach restricts the rank of the learned weights, and promotes a smoother, low-frequency result, preventing the network from overfitting to the concepts. Finally, rather than learning a new set of weights directly, we use the offset formulation of [Alaluf et al. 2021b], i.e.: W i {q,k,v } = W i {q,k,v },0 (cid:16) * 1 + ΔW i {q,k,v } (cid:17) , (3) where W i and ΔW∗,i are the learned offsets for the same layer. ∗,0 are the initial weights of attention matrix ∗ at layer i 3.3 Pre-training We pre-train both the inversion encoder and the weight-offsets over a large image collection portraying our target domain. For faces we use a mix of both FFHQ [Karras et al. 2019] and CelebA-HQ [Karras et al. 2017]. For cats we use LSUN-Cat [Yu et al. 2015] and for artistic styles we use WikiArt [Saleh and Elgammal 2015]. Our loss is a mixture of the regularization loss of section 3.1 and the simple diffusion denoising loss [Ho et al. 2020]: LDi f f usion := Ez,y,ε∼N (0,1),t (cid:104) ∥ε − εθ (zt , t, y)∥2 2 (cid:105) , L = LDi f f usion + λr Lreg, (4) (5) Update attention weightsWord EmbedderText EncoderΔW!=1+ΔW"⋅W!W#=1+ΔW$⋅W#W%=1+ΔW&⋅W%APhotoOfS*Updated U-NETS*Coarse-classStable DiffusionLinearMatrix multiplicationColumnwise LinearRowwise LinearLinearLearned Constants Feature ExtractorPretrained U-NET Encoder Word Embedding Encoder Weight OffsetsPretrained text-to-image Diffusion ModelI!x"x"x"#$ Encoder-based Domain Tuning for Fast Personalization of Text-to-Image Models where t is the time step, zt is an image or latent noised to time t, ε is the unscaled noise sample, and εθ is the denoising network. For pre-training, we empirically set λr to 0.01. 3.4 Inference-time Personalization As a final stage in the personalization process, we tune both of our components as well as the pre-trained diffusion model using a single image of the target concept and the same loss of eq. (5). Importantly, even though the model is tuned with only a single image, we find it crucial to use a large batch size of 16 or more images. This is because the diffusion training process samples a different level of noise for each element in the batch. Hence, a large batch ensures that our model observes the concept across multiple time scales and can better adapt the iterative-refinement approach. Finally, we find that for the human face domain, it is helpful to use an off-the-shelf face segmentation network [Deng et al. 2019] to mask the diffusion loss at this stage. 3.5 Implementation details For a base text-to-image model, we employ Stable Diffusion [Rom- bach et al. 2022], the current state-of-the-art publicly available model. We pre-train our encoders and weight offsets using a base learning rate of 1e − 6 and a batch size of 16 on a single A100 GPU. The Stable Diffusion codebase scales learning rates by the batch size and number of GPUs, giving us an effective learning rate of 1.6e − 5. Our face model was trained for 30, 000 steps, the cat model for 60, 000 steps, and the art model for 100, 000 steps. When fine-tuning for a specific concept, we set λr = 0.1 for the face domain and train for 15 iterations. For the cat and art domains we set λr = 1e − 4, the base learning rate to 3e − 6, and tune the model for 5 iterations. 4 EXPERIMENTS To demonstrate the effectiveness of our approach, which we dub Encoder for Tuning (E4T), we conduct a set of comparisons against the two prior personalization methods: Textual Inversion (TI) [Gal et al. 2022] and DreamBooth (DB) [Ruiz et al. 2022]. For TI, we used the implementation provided by the authors. For DB, official code is not available. We show results using an implementation that follows the paper and tunes only the denoiser's U-Net [Patil and Cuenca 2022], as well as the results of an implementation that also tunes the word embeddings (i.e. performs both DB and TI concurrently). Qualitative Evaluation. We begin with a qualitative evalua- tion, demonstrating that our method can capture a high level of detail using only a single image and a fraction of the training steps. Figure 3 shows the results of face-personalization using the three approaches, across different levels of supervision and for a range of prompts. We follow TI and use the symbol S∗ to represent the personalized concept in the prompts. The results of E4T are com- petitive or better than both baseline approaches, even when these methods have access to additional data. Note that despite training only on aligned face data, our method still enables generation of unaligned or full-body images. In fig. 5 we demonstrate that E4T can be applied to additional domains, including abstract concept classes such as artistic styles. Quantitative Evaluation. We evaluate our approach quanti- tatively using a large-scale identity preservation experiment, as typical in GAN inversion works. Here, we use our encoder and the two baselines to personalize a model for individuals taken from the LFW [Huang et al. 2008] dataset. We train a model on each of the test-set identities that contain between 3 and 10 images. Our model uses only a single randomly chosen image for each identity. Competing methods use either the same single image ("single") or the entire 3-10 image set ("multi"). In total, we train a total of 232 models for each baseline and level of supervision. We then generate a set of images of every identity across a range of prompts, covering a range of modifications such as full- body shots, stylization, accessorizing and background changes. We measure identity preservation by computing the average pair-wise identity similarity [Huang et al. 2020] between each person's train- ing set and the generated results. Following [Gal et al. 2022], we further measure prompt-adherance by computing the average CLIP- space similarity [Radford et al. 2021] between each generated image and its concept-less prompt. The results are shown in fig. 4(a). Our method sits on an appealing point on the pareto-front, representing both high identity-preservation and prompt-adherence, demon- strating that it can be used to effectively capture identities at a fraction of the time. In table 2 we report the average personaliza- tion times using each method. Note that DB and E4T re- quire different numbers of iterations for different do- mains. E4T is significantly quicker than the alternatives. Table 2: Training iterations and times for personalization methods. ∗not including setup time. Iterations Method 5, 000 800 − 1, 200 5-15 Time (seconds)∗ 1, 517 601 − 897 11-30 TI DB Ours Ablation study. Our approach required a significant number of design choices. Here, we study these choices and demonstrate their importance in achieving high-fidelity results. We begin with a qualitative evaluation using the same image-set and metrics of fig. 4(a). We examine the effects of the following changes: (1) Removing the fine-tuning step, (2) tuning only our com- ponents (encoder, offsets) or only the denoiser, (2) removing the iterative refinement module, (3) removing the embedding regular- ization loss, (4) learning weight-offsets directly (rather than through a regularized network), and (5) training only an encoder (with no weight-offsets). We further compare to a HyperNetwork [Ha et al. 2016] baseline, where the constant-offsets are replaced by the predic- tions of a HyperNetwork that feeds the aggregated CLIP-backbone features into our weight-offset prediction architecture. The results are shown in fig. 4(b). As can be observed, our full model enables both high-concept similarity and good editability. Removing the embedding regularization leads to predicted codes that reside in difficult-to-modify regions of the latent space, esen- tially overfitting the personalized model to the given concept. A similar effect can be observed when removing the regularization on the weight-offsets, or when using a HyperNetwork. Here, the extra degrees of freedom lead to quickly overfitting on the target domain. Avoiding the inference-time tuning step or restricting it 5 Input Stable Diffusion Textual Inversion Dreambooth 1-image 5-images 1-image 5-images Textual Inversion + Dreambooth E4T (Ours) 1-image Rinon Gal, Moab Arar, Yuval Atzmon, Amit H. Bermano, Gal Chechik, and Daniel Cohen-Or S ∗ o n t h e b e a c h o f S ∗ M a n g a d r a w i n g a r r a n g e m e n t S ∗ fl o w e r S ∗ F u n k o P o p p a i n t i n g o f S ∗ P o i n t i l l i s m g l a s s w i n d o w S ∗ s t a i n e d S ∗ l a t t e a r t Figure 3: Comparisons with prior personalization methods. We show (left to right): The image used for 1-shot personalizations, the result of prompting Stable Diffusion with the researcher's name, the results of personalization with Textual Inversion and DreamBooth using 1- and 5-images respectively, the results of training a DreamBooth model and an embedding concurrently on 5 images, and finally our own result, and the driving prompt. Our method achieves comparable or better quality with only a single image and a fraction of the time. only to our components leads to significant reduction in identity preservation. Finally, discarding the iterative-refinement module harms the model's ability to modify the concept, highlighting the advantage of being able to focus on different aspects of the target at each synthesis step. We note that similar observations were made by E-Diffi [Balaji et al. 2022] which demonstrated that using differ- ent denoisers at different stages of the cleaning process can help improve visual fidelity and prompt-matching. Refinement analysis. Our iterative refinement approach pro- vides us with a window into the denoising process, allowing us to see which regions of the image the network considers most worth-while to focus on at each denoising stage. To do so, we employ our concept-tuned encoder and model pair to generate novel images of the concept, where we freeze the encoder's predictions once we reach an intermediate time step, tstop . In section 4 we show results along various values of tstop . As can be seen, in the early steps, the network prefers to focus 6 Encoder-based Domain Tuning for Fast Personalization of Text-to-Image Models (a) (b) Figure 4: (a) We compare our method to existing personalization approaches. Our method (green) significantly outperforms other methods with a single image, and sits on the pareto front when compared to few-shot personalization approaches, despite being significantly quicker. (b) Ablation study results. Our full method (green) achieves high identity preservation while maintaining editability. Input image → → → → "Painting of an adorable corgi in the style of S∗" "Edo period pagoda in the style of S∗" "Times square in the style of S∗" Input image "Ukiyo-e painting of S∗" "A photo of S∗ on the beach" "A painting of two S∗ on a boat" Figure 5: Our method can be applied to additional domains, including those that represent abstract concepts like artistic styles. Image credits: @AmliArt, @David Revoy, @Jeanie. on high-level semantics, such as the shape of the head or color schemes. As the process continues, we observe that the network shifts its focus to finer details like the layout of the hair. We further analyze the distance between our predicted embed- dings and those of the coarse class, with and without the embedding 7 regularization. The results are provided in section 4. With regu- larization, we notice that the embeddings begin small, as there is less need to deviate from the core word distribution in order to match rough features like the shape of the head. When adding finer details, the embeddings increase in order to capture the person- specific semantics. At the final steps, the denoiser relies mostly on the image features [Balaji et al. 2022] and so the embedding's role is no longer needed. In contrast, without regularization, the encoder predicts a large embedding right away. We hypothesize that in doing so, it attempts to force a structure on the initial noise which will be cleaned into a semblance of the target (in a similar manner as DDIM inversion [Dhariwal and Nichol 2021; Song et al. 2020]). This gives the denoiser very little room to deviate, and leads to overfitting the concept. Limitations. While our method can achieve high-fidelity per- sonalization with short training times, it is not free of limitations. First, our encoders learn to generalize from large datasets that rep- resent the coarse target class. As such, they are only applicable for classes where large datasets exist. In practice, this includes both faces and artistic styles which are the current primary use-cases for personalization. However, it may limit their applicability to rare, one-of-a-kind objects. In fig. 8 we show the effects of trying to personalize out-of-domain images using our method. When the concepts are from nearby domains (dogs, inverted with a model trained on cats), the method can still produce high-fidelity results. For farther domains (a wooden toy) the method fails to capture concept-specific details. A further limitation is in the need to perform inference-time tuning. While the impact on synthesis times is short, our approach does require the inference-machine to be capable of tuning a model. Moreover, as the encoder and text-to-image models must be tuned in tandem, this process requires more memory than direct fine- tuning approaches. 0.220.240.260.280.30Prompt-Similarity0.250.300.350.400.45Identity SimilarityE4T (Ours, Single)DB (Single)DB (Multi)TI (Single)TI (Multi)DB + TI (Single)DB + TI (Multi)0.220.240.260.280.30Prompt-Similarity0.20.30.40.50.6Identity SimilarityE4T (Ours)Tuning only Stable Diffusionw/ HyperNetworkw/o Finetuningw/o Tuning Stable Diffusionw/o Iterative Refinementw/o Embedding Regularizationw/o Weight-offsetsw/o Weight-offset Regularization Rinon Gal, Moab Arar, Yuval Atzmon, Amit H. Bermano, Gal Chechik, and Daniel Cohen-Or Figure 6: We show the effect of the iterative refinement prediction by freezing our encoder's predicted word-embedding at a specific denoising step tstop . Early on, the model captures high-level details like the shape of the face or prominent accessories. Further steps refine the facial features and the image semantics (e.g. portraying a military hat instead of just a hat). 5 CONCLUSIONS AND FUTURE WORK We introduced an encoder-based domain-tuning method for fast personalization of text-to-image models. At the core of our method is the idea that large, domain-specific datasets can be leveraged to find a good starting point for future optimization, thus allowing the network to better adapt to novel samples from the same domain. In this sense, our work draws inspiration from meta learning meth- ods. As our results demonstrate, large text-to-image models are amenable to such approaches even without resorting to their typi- cally complex machinery. Importantly, our approach allows us to achieve remarkable acceleration while maintaining state-of-the-art quality. In the future, we plan to further investigate encoder-based per- sonalization methods, with a focus on improving the HyperNetwork based approach. We believe that with the proper regularization, this approach can be improved, leading to instant, training-free personalization. → → Input image "S∗ sand sculpture" "Manga drawing of S∗" "Ukiyo-e painting of S∗" → → Figure 7: The distance between our predicted embeddings and the coarse class embedding, as a function of the denois- ing time-step. Iterative refinement enables the network to focus on high-level details in early steps, remaining closer to the domain of real-words. When unique-concept details become more relevant, the distance increases. Without reg- ularization, embeddings deviate significantly from the real- word domain, leading to overfitting and poor editability. Input image "S∗ as a witcher" "A cubism painting of S∗" "A S∗ as a knight in plate armor" Figure 8: Out of domain personalization results. Our method enables personalization of nearby domains (dogs with a model trained on cats, human sketches with a model trained on faces), but it fails when moving further away. Note that succesfully out-of-domain inversions typically require more fine-tuning steps. 8 t!"#$Input ImageA photo of S*50403020100DDIM Timestep0.200.250.300.350.400.450.50Embedding Distancew/o Iterative Refinementw/o Embedding-RegOurs Encoder-based Domain Tuning for Fast Personalization of Text-to-Image Models 6 ETHIC STATEMENT Text-to-image models may be used to create misleading content or promote disinformation. Single-image personalization may increase the ability to forge convincing images of non-public individuals. Text-to-image models are susceptible to biases found in the train- ing data. Our work builds on such models and may exhibit and be used to propagate similar biases. However, as demonstrated in [Gal et al. 2022], personalization can also be used to reduce model biases. Finally, the ability to learn artistic styles may be misused for copyright infringement. However, recent work [Shan et al. 2023] has shown that it is possible to protect artwork from being copied by text-to-image generators, and we hope that future research in this direction could serve to mitigate such risks of infringement. ACKNOWLEDGMENTS This work was partially supported by Len Blavatnik and the Blavat- nik family foundation, the Deutsch Foundation, the Yandex Ini- tiative in Machine Learning, BSF (grant 2020280) and ISF (grants 2492/20 and 3441/21). REFERENCES 2022. State-of-the-Art in the Architecture, Methods and Applications of StyleGAN. In Computer Graphics Forum, Vol. 41. Wiley Online Library, 591–611. Rameen Abdal, Yipeng Qin, and Peter Wonka. 2019. Image2stylegan: How to embed images into the stylegan latent space?. In Proceedings of the IEEE/CVF International Conference on Computer Vision. 4432–4441. Rameen Abdal, Yipeng Qin, and Peter Wonka. 2020. Image2stylegan++: How to edit the embedded images?. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 8296–8305. Harsh Agrawal, Eli A. Meirom, Yuval Atzmon, Shie Mannor, and Gal Chechik. 2021. Known unknowns: Learning novel concepts using reasoning-by-elimination. In Conference on Uncertainty in Artificial Intelligence. Yuval Alaluf, Or Patashnik, and Daniel Cohen-Or. 2021a. ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement. arXiv preprint arXiv:2104.02699 (2021). Yuval Alaluf, Omer Tov, Ron Mokady, Rinon Gal, and Amit H. Bermano. 2021b. HyperStyle: StyleGAN Inversion with HyperNetworks for Real Image Editing. arXiv:2111.15666 [cs.CV] Fernando Amat, Ashok Chandrashekar, Tony Jebara, and Justin Basilico. 2018. Artwork Personalization at Netflix. In Proceedings of the 12th ACM Conference on Recom- mender Systems (Vancouver, British Columbia, Canada) (RecSys '18). Association for Computing Machinery, New York, NY, USA, 487–488. https://doi.org/10.1145/ 3240323.3241729 Yogesh Balaji, Seungjun Nah, Xun Huang, Arash Vahdat, Jiaming Song, Karsten Kreis, Miika Aittala, Timo Aila, Samuli Laine, Bryan Catanzaro, et al. 2022. ediffi: Text- to-image diffusion models with an ensemble of expert denoisers. arXiv preprint arXiv:2211.01324 (2022). David Bau, Hendrik Strobelt, William Peebles, Jonas Wulff, Bolei Zhou, Jun-Yan Zhu, and Antonio Torralba. 2019. Semantic Photo Manipulation with a Generative Image Prior. 38, 4 (2019). https://doi.org/10.1145/3306346.3323023 Soulef Benhamdi, Abdesselam Babouri, and Raja Chiky. 2017. Personalized recom- mender system for e-Learning environment. Education and Information Technologies 22, 4 (2017), 1455–1477. Andrew Brock, Jeff Donahue, and Karen Simonyan. 2019. Large Scale GAN Training for High Fidelity Natural Image Synthesis. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net. https://openreview.net/forum?id=B1xsqj09Fm Chen Cao, Tomas Simon, Jin Kyu Kim, Gabe Schwartz, Michael Zollhoefer, Shunsuke Saito, Stephen Lombardi, Shih-en Wei, Danielle Belko, Shoou-i Yu, Yaser Sheikh, and Jason Saragih. 2022. Authentic Volumetric Avatars From a Phone Scan. ACM Trans. Graph. (2022). Yoon Ho Cho, Jae Kyeong Kim, and Soung Hie Kim. 2002. A personalized recommender system based on web usage mining and decision tree induction. Expert systems with Applications 23, 3 (2002), 329–342. Niv Cohen, Rinon Gal, Eli A. Meirom, Gal Chechik, and Yuval Atzmon. 2022. "This is my unicorn, Fluffy": Personalizing frozen vision-language representations. In European Conference on Computer Vision (ECCV). Katherine Crowson. 2021. VQGAN + CLIP. https://colab.research.google.com/drive/ 1L8oL-vLJXVcRzCFbPwOoMkPKJ8-aYdPN. Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. 2019. ArcFace: Additive Angular Margin Loss for Deep Face Recognition. arXiv:1801.07698 [cs.CV] Prafulla Dhariwal and Alexander Nichol. 2021. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems 34 (2021), 8780–8794. Tan M Dinh, Anh Tuan Tran, Rang Nguyen, and Binh-Son Hua. 2022. Hyperinverter: Improving stylegan inversion via hypernetwork. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 11389–11398. Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. 2021. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. ICLR (2021). Patrick Esser, Robin Rombach, and Björn Ommer. 2021. Taming Transformers for High- Resolution Image Synthesis. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2021, virtual, June 19-25, 2021. Computer Vision Foundation / IEEE, 12873–12883. https://doi.org/10.1109/CVPR46437.2021.01268 Alireza Fallah, Aryan Mokhtari, and Asuman Ozdaglar. 2020. Personalized federated learning: A meta-learning approach. arXiv preprint arXiv:2002.07948 (2020). Chelsea Finn, Pieter Abbeel, and Sergey Levine. 2017. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference on machine learning. PMLR, 1126–1135. Oran Gafni, Adam Polyak, Oron Ashual, Shelly Sheynin, Devi Parikh, and Yaniv Taig- man. 2022. Make-A-Scene: Scene-Based Text-to-Image Generation with Human Pri- ors. In Computer Vision - ECCV 2022 - 17th European Conference, Tel Aviv, Israel, Oc- tober 23-27, 2022, Proceedings, Part XV (Lecture Notes in Computer Science, Vol. 13675), Shai Avidan, Gabriel J. Brostow, Moustapha Cissé, Giovanni Maria Farinella, and Tal Hassner (Eds.). Springer, 89–106. https://doi.org/10.1007/978-3-031-19784-0_6 Rinon Gal, Yuval Alaluf, Yuval Atzmon, Or Patashnik, Amit H Bermano, Gal Chechik, and Daniel Cohen-Or. 2022. An image is worth one word: Personalizing text-to- image generation using textual inversion. arXiv preprint arXiv:2208.01618 (2022). Rinon Gal, Or Patashnik, Haggai Maron, Gal Chechik, and Daniel Cohen-Or. 2021. Stylegan-nada: Clip-guided domain adaptation of image generators. arXiv preprint arXiv:2108.00946 (2021). Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. 2014. Generative adversarial nets. Advances in neural information processing systems 27 (2014). Jinjin Gu, Yujun Shen, and Bolei Zhou. 2020. Image Processing Using Multi-Code GAN Prior. arXiv:1912.07116 [cs.CV] David Ha, Andrew Dai, and Quoc V Le. 2016. Hypernetworks. arXiv preprint arXiv:1609.09106 (2016). Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. 2017. GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium. In Advances in Neural Information Processing Sys- tems 30: Annual Conference on Neural Information Processing Systems 2017, De- cember 4-9, 2017, Long Beach, CA, USA, Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Ro- man Garnett (Eds.). 6626–6637. https://proceedings.neurips.cc/paper/2017/hash/ 8a1d694707eb0fefe65871369074926d-Abstract.html Jonathan Ho, Ajay Jain, and Pieter Abbeel. 2020. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems 33 (2020), 6840–6851. Gary B Huang, Marwan Mattar, Tamara Berg, and Eric Learned-Miller. 2008. Labeled faces in the wild: A database forstudying face recognition in unconstrained en- vironments. In Workshop on faces in'Real-Life'Images: detection, alignment, and recognition. Yuge Huang, Yuhan Wang, Ying Tai, Xiaoming Liu, Pengcheng Shen, Shaoxin Li, Jilin Li, and Feiyue Huang. 2020. Curricularface: adaptive curriculum learning loss for deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 5901–5910. Gabriel Ilharco, Mitchell Wortsman, Ross Wightman, Cade Gordon, Nicholas Carlini, Rohan Taori, Achal Dave, Vaishaal Shankar, Hongseok Namkoong, John Miller, Hannaneh Hajishirzi, Ali Farhadi, and Ludwig Schmidt. 2021. OpenCLIP. https: //doi.org/10.5281/zenodo.5143773 If you use this software, please cite it as below.. Improving federated learning personalization via model agnostic meta learning. arXiv preprint arXiv:1909.12488 (2019). Yihan Jiang, Jakub Konečn`y, Keith Rush, and Sreeram Kannan. 2019. Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. 2017. Progressive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196 (2017). Tero Karras, Samuli Laine, and Timo Aila. 2019. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition. 4401–4410. Nupur Kumari, Bingliang Zhang, Richard Zhang, Eli Shechtman, and Jun-Yan Zhu. 2022. Multi-Concept Customization of Text-to-Image Diffusion. arXiv preprint arXiv:2212.04488 (2022). Yishay Mansour, Mehryar Mohri, Jae Ro, and Ananda Theertha Suresh. 2020. Three approaches for personalization with applications to federated learning. arXiv preprint arXiv:2002.10619 (2020). Ana Belen Barragans Martinez, Jose J Pazos Arias, Ana Fernandez Vilas, Jorge Garcia Duque, and Martin Lopez Nores. 2009. What's on TV tonight? An efficient and 9 Rinon Gal, Moab Arar, Yuval Atzmon, Amit H. Bermano, Gal Chechik, and Daniel Cohen-Or Figure 9: Additional personalized synthesis results created using our method. For each identity, the single input image is shown below. 10 Input ImagesGreek sculpture of S*S* latte artS* piloting a fighter jetFauvism painting of S*Cave mural depicting S*Cubism painting of S*BanksyartofS*S* Funko popS*asaknight in plateS* in the style of ArcherColorfulgraffiti of S*S* by Andy WarholS* ina comic bookWatercolor painting of S*S* as Ziggy Stardusta sand sculpture of S*S* in a SantahatS* as a wizard Encoder-based Domain Tuning for Fast Personalization of Text-to-Image Models effective personalized recommender system of TV programs. IEEE Transactions on Consumer Electronics 55, 1 (2009), 286–294. Ron Mokady, Amir Hertz, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. 2022. Null-text Inversion for Editing Real Images using Guided Diffusion Models. arXiv preprint arXiv:2211.09794 (2022). Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. 2021. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741 (2021). Alex Nichol and John Schulman. 2018. Reptile: a scalable metalearning algorithm. arXiv preprint arXiv:1803.02999 2, 3 (2018), 4. Alexander Quinn Nichol and Prafulla Dhariwal. 2021. Improved Denoising Diffusion Probabilistic Models. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event (Proceedings of Machine Learning Research, Vol. 139), Marina Meila and Tong Zhang (Eds.). PMLR, 8162–8171. Yotam Nitzan, Kfir Aberman, Qiurui He, Orly Liba, Michal Yarom, Yossi Gandelsman, Inbar Mosseri, Yael Pritch, and Daniel Cohen-Or. 2022. MyStyle: A Personalized Generative Prior. arXiv preprint arXiv:2203.17272 (2022). Yotam Nitzan, Rinon Gal, Ofir Brenner, and Daniel Cohen-Or. 2021. LARGE: Latent- Based Regression through GAN Semantics. arXiv:2107.11186 [cs.CV] Gaurav Parmar, Yijun Li, Jingwan Lu, Richard Zhang, Jun-Yan Zhu, and Krishna Ku- mar Singh. 2022. Spatially-Adaptive Multilayer Selection for GAN Inversion and Editing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 11399–11409. Jiaming Song, Chenlin Meng, and Stefano Ermon. 2020. Denoising Diffusion Implicit Models. In International Conference on Learning Representations. Ming Tao, Hao Tang, Songsong Wu, Nicu Sebe, Xiao-Yuan Jing, Fei Wu, and Bingkun Bao. 2020. Df-gan: Deep fusion generative adversarial networks for text-to-image synthesis. arXiv preprint arXiv:2008.05865 (2020). Omer Tov, Yuval Alaluf, Yotam Nitzan, Or Patashnik, and Daniel Cohen-Or. 2021. arXiv preprint Designing an Encoder for StyleGAN Image Manipulation. arXiv:2102.02766 (2021). Narek Tumanyan, Omer Bar-Tal, Shai Bagon, and Tali Dekel. 2022. Splicing vit features for semantic appearance transfer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 10748–10757. Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. 2018. Deep image prior. In Proceedings of the IEEE conference on computer vision and pattern recognition. 9446–9454. Aäron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. 2017. Neural Dis- crete Representation Learning. In Advances in Neural Information Processing Sys- tems 30: Annual Conference on Neural Information Processing Systems 2017, De- cember 4-9, 2017, Long Beach, CA, USA, Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Ro- man Garnett (Eds.). 6306–6315. https://proceedings.neurips.cc/paper/2017/hash/ 7a98af17e63a0ac09ce2e96d03992fbc-Abstract.html Yael Vinker, Yuval Alaluf, Daniel Cohen-Or, and Ariel Shamir. 2022. CLIPascene: Scene Sketching with Different Types and Levels of Abstraction. arXiv preprint arXiv:2211.17256 (2022). Apolinário Passos and Omar Sanseviero. 2022. HuggingFace concept library. https: Weihao Xia, Yulun Zhang, Yujiu Yang, Jing-Hao Xue, Bolei Zhou, and Ming-Hsuan Yang. 2021. GAN Inversion: A Survey. arXiv:2101.05278 [cs.CV] Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huang, and Xiaodong He. 2018. Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition. 1316–1324. Yinghao Xu, Yujun Shen, Jiapeng Zhu, Ceyuan Yang, and Bolei Zhou. 2021. Generative Hierarchical Features from Synthesizing Images. In CVPR. Hui Ye, Xiulong Yang, Martin Takac, Rajshekhar Sunderraman, and Shihao Ji. 2021. Improving text-to-image synthesis using contrastive learning. arXiv preprint arXiv:2107.02423 (2021). Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. 2015. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365 (2015). Jiahui Yu, Yuanzhong Xu, Jing Yu Koh, Thang Luong, Gunjan Baid, Zirui Wang, Vijay Vasudevan, Alexander Ku, Yinfei Yang, Burcu Karagol Ayan, et al. 2022. Scaling Autoregressive Models for Content-Rich Text-to-Image Generation. arXiv preprint arXiv:2206.10789 (2022). Han Zhang, Jing Yu Koh, Jason Baldridge, Honglak Lee, and Yinfei Yang. 2021. Cross- modal contrastive learning for text-to-image generation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 833–842. Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. 2020b. In-domain gan inversion for real image editing. arXiv preprint arXiv:2004.00049 (2020). Jun-Yan Zhu, Philipp Krähenbühl, Eli Shechtman, and Alexei A Efros. 2016. Generative visual manipulation on the natural image manifold. In European conference on computer vision. Springer, 597–613. Minfeng Zhu, Pingbo Pan, Wei Chen, and Yi Yang. 2019. Dm-gan: Dynamic memory generative adversarial networks for text-to-image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 5802–5810. Peihao Zhu, Rameen Abdal, Yipeng Qin, and Peter Wonka. 2020a. Improved StyleGAN Embedding: Where are the Good Latents? arXiv:2012.09036 [cs.CV] //huggingface.co/sd-dreambooth-library. Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. 2021. StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery. arXiv preprint arXiv:2103.17249 (2021). Suraj Patil and Pedro Cuenca. 2022. HuggingFace DreamBooth Implementation. https: //huggingface.co/docs/diffusers/training/dreambooth. Stanislav Pidhorskyi, Donald A Adjeroh, and Gianfranco Doretto. 2020. Adversarial Latent Autoencoders. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 14104–14113. Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. 2021. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020 (2021). Nasim Rahaman, Aristide Baratin, Devansh Arpit, Felix Draxler, Min Lin, Fred Ham- precht, Yoshua Bengio, and Aaron Courville. 2019. On the spectral bias of neural networks. In International Conference on Machine Learning. PMLR, 5301–5310. Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. 2022. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125 (2022). Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. 2021. Zero-shot text-to-image generation. In International Conference on Machine Learning. PMLR, 8821–8831. Elad Richardson, Yuval Alaluf, Or Patashnik, Yotam Nitzan, Yaniv Azar, Stav Shapiro, and Daniel Cohen-Or. 2020. Encoding in Style: a StyleGAN Encoder for Image-to- Image Translation. arXiv preprint arXiv:2008.00951 (2020). Daniel Roich, Ron Mokady, Amit H Bermano, and Daniel Cohen-Or. 2021. Pivotal tuning for latent-based editing of real images. arXiv preprint arXiv:2106.05744 (2021). Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. 2022. High-Resolution Image Synthesis with Latent Diffusion Models. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2022, New Orleans, LA, USA, June 18-24, 2022. IEEE, 10674–10685. https://doi.org/10.1109/CVPR52688. 2022.01042 Nataniel Ruiz, Yuanzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. 2022. DreamBooth: Fine Tuning Text-to-image Diffusion Models for Subject-Driven Generation. (2022). Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Den- ton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi, Rapha Gontijo Lopes, et al. 2022. Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding. arXiv preprint arXiv:2205.11487 (2022). Babak Saleh and Ahmed Elgammal. 2015. Large-scale classification of fine-art paintings: Learning the right metric on the right feature. arXiv preprint arXiv:1505.00855 (2015). Aviv Shamsian, Aviv Navon, Ethan Fetaya, and Gal Chechik. 2021. Personalized federated learning using hypernetworks. In International Conference on Machine Learning. PMLR, 9489–9502. Shawn Shan, Jenna Cryan, Emily Wenger, Haitao Zheng, Rana Hanocka, and Ben Y Zhao. 2023. GLAZE: Protecting Artists from Style Mimicry by Text-to-Image Models. arXiv preprint arXiv:2302.04222 (2023). Yujun Shen, Jinjin Gu, Xiaoou Tang, and Bolei Zhou. 2020. Interpreting the latent space of gans for semantic face editing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 9243–9252. 11
http://arxiv.org/abs/2302.12211v1
2023-02-23T18:04:07
2023-02-23T18:04:07
Federated Nearest Neighbor Machine Translation
To protect user privacy and meet legal regulations, federated learning (FL) is attracting significant attention. Training neural machine translation (NMT) models with traditional FL algorithm (e.g., FedAvg) typically relies on multi-round model-based interactions. However, it is impractical and inefficient for machine translation tasks due to the vast communication overheads and heavy synchronization. In this paper, we propose a novel federated nearest neighbor (FedNN) machine translation framework that, instead of multi-round model-based interactions, leverages one-round memorization-based interaction to share knowledge across different clients to build low-overhead privacy-preserving systems. The whole approach equips the public NMT model trained on large-scale accessible data with a $k$-nearest-neighbor ($$kNN) classifier and integrates the external datastore constructed by private text data in all clients to form the final FL model. A two-phase datastore encryption strategy is introduced to achieve privacy-preserving during this process. Extensive experiments show that FedNN significantly reduces computational and communication costs compared with FedAvg, while maintaining promising performance in different FL settings.
[ "Yichao Du", "Zhirui Zhang", "Bingzhe Wu", "Lemao Liu", "Tong Xu", "Enhong Chen" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12211v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12211v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG" ]
Published as a conference paper at ICLR 2023 FEDERATED NEAREST NEIGHBOR MACHINE TRANSLATION Yichao Du†‡, Zhirui Zhang(cid:92), Bingzhe Wu(cid:92), Lemao Liu(cid:92), Tong Xu†‡ and Enhong Chen†‡ †University of Science and Technology of China ‡State Key Laboratory of Cognitive Intelligence (cid:92)Tencent AI Lab †‡[email protected] {tongxu, cheneh}@ustc.edu.cn (cid:92)[email protected] {bingzhewu, redmondliu}@tencent.com ABSTRACT To protect user privacy and meet legal regulations, federated learning (FL) is attracting significant attention. Training neural machine translation (NMT) models with traditional FL algorithms (e.g., FedAvg) typically relies on multi-round model-based interactions. However, it is impractical and inefficient for translation tasks due to the vast communication overheads and heavy synchronization. In this paper, we propose a novel Federated Nearest Neighbor (FedNN) machine translation framework that, instead of multi-round model-based interactions, leverages one-round memorization-based interaction to share knowledge across different clients and build low-overhead privacy-preserving systems. The whole approach equips the public NMT model trained on large-scale accessible data with a k-nearest- neighbor (kNN) classifier and integrates the external datastore constructed by private text data from all clients to form the final FL model. A two-phase datastore encryption strategy is introduced to achieve privacy-preserving during this process. Extensive experiments show that FedNN significantly reduces computational and communication costs compared with FedAvg, while maintaining promising translation performance in different FL settings. 1 INTRODUCTION In recent years, neural machine translation (NMT) has significantly improved translation quality (Bahdanau et al., 2015; Vaswani et al., 2017; Hassan et al., 2018) and has been widely adopted in many commercial systems. The current mainstream system is first built on a large-scale corpus collected by the service provider and then directly applied to translation tasks for different users and enterprises. However, this application paradigm faces two critical challenges in practice. On the one hand, previous works have shown that NMT models perform poorly in specific scenarios, especially when they are trained on the corpora from very distinct domains (Koehn & Knowles, 2017; Chu & Wang, 2018). The fine-tuning method is a popular way to mitigate the effect of domain drift, but it brings additional model deployment overhead and particularly requires high-quality in-domain data provided by users or enterprises. On the other hand, some users and enterprises pose high data security requirements due to business concerns or regulations from the government (e.g., GDPR and CCPA), meaning that we cannot directly access private data from users for model training. Thus, a conventional centralized-training manner is infeasible in these scenarios. In response to this dilemma, a natural way is to leverage federated learning (FL) (Li et al., 2019) that enables different data owners to train a global model in a distributed manner while leaving raw private data isolated to preserve data privacy. Generally, a standard FL workflow, such as FedAvg (McMahan et al., 2017), contains multi-round model-based interactions between server and clients. At each round, the client first performs training on the local sensitive data and sends the model update to the server. The server aggregates these local updates to build an improved global model. This straightforward idea has been implemented by prior works (Roosta et al., 2021; Passban et al., 2022) that directly apply FedAvg for machine translation tasks 1 3 2 0 2 b e F 3 2 ] L C . s c [ 1 v 1 1 2 2 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 and introduce some parameter pruning strategies during node communication. Despite this, multi-round model-based interactions are impractical and inefficient for NMT applications. Current models heavily rely on deep neural networks as the backbone and their parameters can reach tens of millions or even hundreds of millions, bringing vast computation and communication overhead. In real-world scenarios, different clients (i.e., users and enterprises) usually have limited computation and communication capabilities, making it difficult to meet frequent model training and node communication requirements in the standard FL workflow. Further, due to the capability differences between clients, heavy synchronization also hinders the efficacy of FL workflow. Fewer interactions may ease this problem but suffer from significant performance loss. Inspired by the recent remarkable performance of memorization-augmented techniques (e.g., the k-nearest- neighbor, kNN) in natural language processing (Khandelwal et al., 2020; 2021; Zheng et al., 2021a;b) and computer vision (Papernot & Mcdaniel, 2018; Orhan, 2018), we take a new perspective to deal with above federated NMT training problem. In this paper, we propose a novel Federated Nearest Neighbor (FedNN) machine translation framework, which equips the public NMT model trained on large-scale accessible data with a kNN classifier and integrates the external datastore constructed by private data from all clients to form the final FL model. In this way, we replace the multi-round model-based interactions in the conventional FL paradigm with the one-round encrypted memorization-based interaction to share knowledge among different clients and drastically reduce computation and communication overhead. Specifically, FedNN follows a similar server-client architecture. The server holds large-scale accessible data to construct the public NMT model for all clients, while the client leverages their local private data to yield an external datastore that is collected to augment the public NMT model via kNN retrieval. Based on this architecture, the key is to merge and broadcast all datastores built from different clients, while avoiding privacy leakage. We design a two-phase datastore encryption strategy that adopts an adversarial mode between server and clients to achieve privacy-preserving during the memorization-based interaction process. On the one hand, the server builds (K, V)-encryption model for clients to increase the difficulty of reconstructing the private text from the datastores constructed by other clients. The K-encryption model is coupled with the public NMT model to ensure the correctness of kNN retrieval. On the other hand, all clients use a shared content-encryption model for a local datastore during the collecting process so that the server can not directly access the original datastore. During inference, the client leverages the corresponding content-decryption model to obtain the final integrated datastore. We set up several FL scenarios (i.e., Non-IID and IID settings) with multi-domain English-German (En-De) translation dataset, and demonstrate that FedNN not only drastically decreases computation and commu- nication costs compared with FedAvg, but also achieves the state-of-the-art translation performance in the Non-IID setting. Additional experiments verify that FedNN easily scales to large-scale clients with sparse data scenarios thanks to the memorization-based interaction across different clients. Our code is open-sourced on https://github.com/duyichao/FedNN-MT. 2 FEDNMT: FEDERATED NEURAL MACHINE TRANSLATION Current commercial NMT systems are built on a large-scale corpus collected by the service provider and directly applied to different users and enterprises. However, this mode is difficult to flexibly satisfy the model customization and privacy protection requirements of users and enterprises. In this work, we focus on a more general application scenario, where users and enterprises participate in collaboratively training NMT models with the service provider, but the service provider cannot directly access the private data. Formally, this application scenario consists of |C| clients (i.e., user or enterprise) and a central server (i.e., service provider). The central server holds vast accessible translation data Ds = {(xi i=1 , where 2, ..., xi xi = (xi |yi|) (for brevity, we omit the subscript s here) are text sequences in the source and target languages, respectively. The central server can easily train a public NMT |xi|) and yi = (yi s)}|Ds| 2, ..., xi s, yi 1, xi 1, yi 2 Published as a conference paper at ICLR 2023 c, yi c)}|Dc| model fθ based on this corpus, where θ denotes model parameters. For each client c, it contains private data Dc = {(xi i=1 , which is usually sparse in practice (i.e., |Dc| (cid:28) |Ds|) and only accessible to itself. This setting actually falls into the federated learning framework. The straightforward idea is to apply the vanilla FL method (i.e., FedAvg) or its variants (Roosta et al., 2021; Passban et al., 2022). Generally, FedAvg contains multi-round model-based interaction updates between server and clients. At each round r, each client c downloads a global model fθr from the server and optimizes it using Dc. Then the local updates θr c are uploaded to the server, while the server aggregates these updates to form a new model fθr+1 via a simple parameter averaging technique: θr+1 = (cid:80)C m, where nm denotes the number of data points in the m-th client's private data, and n is the total number of all training data. However, such FL workflow is inefficient for the above application scenario because the parameter of NMT models typically reaches tens of millions or even hundreds of millions, bringing vast computation and communication overhead. The system heterogeneity between server and clients, i.e., mismatch of bandwidth, computation resources, etc., also makes it difficult to satisfy frequent updates and communication requirements in the standard FL workflow. nm n θr m=1 3 FEDNN: FEDERATED NEAREST NEIGHBOR MACHINE TRANSLATION Inspired by the advanced memorization-augmented techniques, e.g., kNN-MT (Khandelwal et al., 2021) that has shown the promising capability of directly incorporating the pre-trained NMT model with external knowledge via kNN retrieval, we explore to leverage one-round memorization-based interaction rather than multi-round model-based interactions to achieve knowledge sharing across different clients. In this work, we design a novel Federated Nearest Neighbour (FedNN) machine translation framework, which extends the promising capability of kNN-MT in the federated scenario and introduces two-phase datastore encryption strategy to avoid data privacy leakage. The whole approach complements the public NMT model built by the central server with a kNN classifier and safely collects the local datastore constructed by private text data from all clients to form the global FL model. The entire workflow of FedNN is illustrated in Figure 1, consisting of initialization, one-round memorization-based interaction and model inference on clients. 3.1 INITIALIZATION FedNN starts with the public NMT model and encryption models. The central server is responsible for opti- mizing the public NMT model fθ with Ds. Following kNN-MT (Khandelwal et al., 2021), the memorization (also called as datastore) is a set of key-value pairs. Given a sentence pair (xs, ys) ∈ Ds, we gain the context representation fθ(xs, ys,<t) in the last decoder layer at each timestep t. The whole datastore Ms = (Ks, Vs) is constructed by taking the representation fθ(xs, ys,<t) as key and ground-truth yt as value: (cid:91) Ms = (Ks, Vs) = {(fθ(xs, ys,<t), ys,t), ∀ys,t ∈ ys}. (1) (xs,ys)∈Ds Based on Ms, the central server further builds K-Encryption model fKE(.) that is coupled with the public NMT model. This design is for clients, which aims to increase the difficulty of reconstructing the private text from datastores constructed by other clients. The fKE(.) should also satisfy the correctness of kNN retrieval during inference and the detailed K-Encryption algorithm selection is described in Section 3.4. All clients prepare the shared content-encryption model fCE(.) and corresponding content-decryption model fDE(.), which are applied to the local datastore so that the server cannot directly access the original datastore. The content-encryption algorithm selection is relatively loose, which is detailed in Section 3.4. 3.2 MEMORIZATION-BASED INTERACTION The entire memorization-based interaction is decomposed into two steps: private memorization construction and global memorization aggregation. The central server broadcasts fθ and fKE(.) for all clients to build the 3 Published as a conference paper at ICLR 2023 Figure 1: The overall workflow of our proposed federated framework (FedNN). local encrypted datastore. Specifically, for each client c, we adopt a similar construction way as Equation 1 to yield the local datastore MfKE via Dc, with the difference that fKE(.) is used to preserve private information: c MfKE c = (KfKE c , Vc) = (cid:91) (xc,yc)∈Dc {(fKE(fθ(xc, yc,<t)), yc,t), ∀yc,t ∈ yc}. (2) In order to ensure that above datastore is not explicitly available to the server, we encrypt key-value pairs by fCE(.) before uploading them to the server, formalized as: MfKE, CE c = (KfKE, CE c , V fCE c ) = (cid:91) (xc,yc)∈Dc {fCE(fKE(fθ(xc, yc,<t)), yc,t), ∀yc,t ∈ yc}. (3) Once the central server has received the private memorization from all clients, it directly aggregates all datastores via simple key-value pair concatenation and performs V-encryption operation (i.e., shuffling on key-value pair to avoid clients identifying the source of datastore) to obtain the global memorization MfKE,VE, CE , which is sent to all clients for model inference. Then each client c decrypts the contents of the received MfKE,VE, CE to gain an accessible integrated datastore MfKE,VE g . g g 3.3 MODEL INFERENCE ON CLIENTS g For model inference on clients, we follow the adaptive kNN-MT (AK-MT) (Zheng et al., 2021a) to incorporate fθ with MfKE,VE via adaptive kNN retrieval. AK-MT introduces a lightweight Meta-k Network fMeta-k to dynamically determine the number of retrieved tokens to consider at each step, and has promising generalization ability. Thanks to this, we could train fMeta-k with a small data in any vertical scenario and then directly apply it to other scenarios. Since the parameters in fMeta-k are negligible, we ignore the additional training and communication costs of AK-MT in FedNN. 4 4 InferencePassing Public Model-Encryption ProcessContent EncryptionIch hunde ... Sie ...Private Data ...IchhundeSie1 InitializationDie Folgen ... für ...Passing Public ModelLearning -Encryption... ...hundeSiefür ...IchhundeSie ...DieFolgenfür... UploadBroadcastClient 1Passing Public ModelDie Folgen ... für ...Passing Public Model-Encryption ProcessContent EncryptionDie Folgen ... für ...Private Data ...DieFolgenfür ...Siehundefürhunde Sie ... für ...Content Decryption hundeClient ServerPublicData2 Private Memorization ConstructionFederated Nearest Neighbor 3 GbobalMemorization Aggregation & -Encryption QueryWeight PredictionDistinct Values2011...540...200.20 40 ... 100Valuehunde Die ... IchFinal PredictionPublic MemorizationPrivate MemorizationPrivate MemorizationGlobal MemorizationIch hunde ... Sie ...I like dogsIch mag Published as a conference paper at ICLR 2023 Concretely, given the already generated words ˆy<t and source input x, AK-MT augments the probability distribution of t-th target token yt via kNN retrieval based on the context representation fθ(x, ˆy<t). It considers a set of possible ks that are smaller than pre-defined K, i.e., k ∈ S where S = {0} ∪ {ki ∈ N | log2 ki ∈ N, ki ≤ K} (k = 0 indicates ignoring kNN retrieval and only utilizing the public NMT model). Then K nearest neighbors of the current representation fθ(x, ˆy<t) are retrieved from MfKE,VE according to the squared L2 distance d(*, *). The L2 distances from fθ(x, ˆy<t) to each neighbor (hi, vi) is denoted as di = d(hi, fθ(x, ˆy<t)) and the count of distinct values in top-i is denoted as ci. The normalized weights of applying different kNN retrieval results are computed as: g pMeta(k) = softmax(fMeta([d1, ..., dK; c1, ..., cK])). The final prediction probability p (yt|x, ˆy<t) is a weighted ensemble over differnt kNN retrieval distributions: pkiNN (yt|x, ˆy<t) ∝ (cid:88) 1yt=vi exp (hi,vi) (cid:88) p (yt|x, ˆy<t) = pMeta (ki) * pkiNN (yt|x, ˆy<t) , (cid:18) −d2 (hi, fθ (x, ˆy<t)) T (cid:19) , (4) where T is the temperature to control the sharpness of softmax function. ki∈S 3.4 ENCRYPTION AND PRIVACY DISCUSSIONS • K-Encryption. In this work, we adopt the Product Quantizer (J ́egou et al., 2011) algorithm to build K- encryption model, which decomposes the space into a Cartesian product of low-dimensional subspaces and quantifies each subspace separately into segment code representations. Further, we map the representation to the above shortcode representation, which cannot be reversed to the original one, further reducing the possibility of reverse-constructing private data. This way also satisfies the correctness of kNN retrieval after encryption. Note that any algorithm that makes representation distorted and irreducible could be adopted in FedNN, such as PCA. • Content-Encryption. We require to generate the ciphertext by content-encryption model and ensure that it is indistinguishable from the chosen plaintext attacks (Oded, 2004). Since each record of the memorization can be regarded as a string, it can be encrypted and decrypted using any asymmetric encryption algorithm, such as Paillier, Elgamal (Gamal, 1984) and RSA (Rivest et al., 1978), etc. • Threat Models and Leakage Quantifying. We consider that all clients involved in the training process are semi-honest following prior works (Zhang et al., 2021; Bonawitz et al., 2016). In this semi-honest setting, each client adheres to the designed protocol but it may attempt to infer information about other participant's input (i.e., memorization). Under this setting, our method has achieved different protection levels for the client and server side. Specifically, for the server side, our mechanism achieves the same protection level to the conventional Public-key cryptography system (e.g., RSA). Thus, the server cannot obtain any useful information from the encrypted data. For the client side, since the client gets shared information generated by Product Quantizer (i.e.,fKE(fθ(xc, yc,<t)), yc,t)) from other clients, the aim of this paper is to prevent the shared information from reconstruction attacks (i.e., recovering private text data from the datastore). To this end, we introduce some metrics to quantify the privacy leakage of the shared datastore information (see more details in Section 4.5). 4 EXPERIMENTS 4.1 SETUP We adopt WMT14 En-De data (Bojar et al., 2014) and multi-domain En-De dataset (Koehn & Knowles, 2017) to simulate two typical FL scenarios for model evaluation: 1) the non-independently identically distribution 5 Published as a conference paper at ICLR 2023 (Non-IID setting) where each client distributes data from different domains; 2) the independently identically distribution (IID setting) where each client contains the same data distribution from all domains. In our experiments, WMT14 and multi-domain En-De dataset are viewed as the server's data and clients' private data, respectively. The multi-domain data provides a natural division for exploring the Non-IID setting, of which we assign IT, Medical, and Law domain data to each of the three clients. For the IID setting, we mix the above domain data and randomly sample the same number of sentence pairs from it for each client. More dataset and implementation details can be found in Appendix A. We compare our method FedNN with several baselines: (i) Centralized Model (C-NMT): A standard centralized-training method uses all clients and server data to obtain a global NMT model. (ii) Public Model (P-NMT): A generic NMT model is trained on only server data and used for initializing the client-side model. (iii) FedAvg: A vanilla FL approach (McMahan et al., 2017) that iteratively optimizes a global model through multi-round model-based interactions. (iv) FT-Ensemble: We use the client's private data to fine-tune P-NMT and ensemble the output probability distributions of all fine-tuned models during inference. Table 1: BLEU score [%] of different methods on clients and server test sets. "(cid:52)" refers to the improvement of methods compared with P-NMT. The subscript "1/∞" indicate that the server perform model aggregation after one or infinite epochs (i.e., client model convergence) of client model updates, respectively. The superscript "s" indicates that the server data is also involved in model training of FedAvg. "Comm." and "Comp." refer to communication and computational overhead in "GB" and "FLOPs" respectively. Methods Client Test Server Test Overall Performance Cost IT Law Medical WMT14 Client (cid:52) Global (cid:52) Comm. Comp. Inference Speed C-NMT 37.30 49.72 47.40 P-NMT FedAvgs 1 FedAvg1 FedAvgs ∞ FedAvg∞ 26.62 35.91 30.27 26.99 37.65 28.26 53.00 27.04 38.37 17.03 47.06 32.36 45.90 32.32 30.61 FT-Ensemble 30.11 38.14 39.15 FedNN FedAvgs 1 FedAvg1 FedAvgs ∞ FedAvg∞ 35.62 55.57 49.21 30.83 43.47 37.99 54.53 29.23 39.67 34.71 48.68 39.22 50.23 34.49 44.79 FT-Ensemble 36.74 51.34 47.49 FedNN 34.64 54.45 47.98 D I I - n o N D I I 26.58 26.63 26.63 13.45 26.33 13.33 17.13 22.29 26.36 14.80 26.28 16.23 16.42 23.15 44.81 30.93 - 40.25 - 29.86 - - - - +1.40 30.91 32.33 42.39 +11.45 35.15 32.66 31.57 +1.72 31.08 +0.63 27.01 +1.05 +5.30 +1.22 - 2.85 35.80 +4.87 31.13 +1.28 46.80 +15.87 40.67 +10.82 37.84 +6.91 34.97 47.58 +16.65 39.39 +3.53 32.42 34.46 42.73 +11.79 36.10 +5.11 +9.53 +2.56 +6.25 45.19 +14.26 38.00 +8.14 45.69 +14.76 40.06 +10.20 388.12 4.85 4.85 5.08 388.12 4.85 4.85 5.08 - - 1.72 × 1019 3.23 × 1018 7.02 × 1017 7.02 × 1017 7.02 × 1017 6.72 × 1015 1.72 × 1019 3.23 × 1018 7.02 × 1017 7.02 × 1017 7.02 × 1017 6.72 × 1015 1.00× 1.00× 1.00× 1.00× 0.39× 0.75× 1.00× 1.00× 0.39× 0.75× 4.2 MAIN RESULTS Table 1 illustrates the performance of all methods. We observe an average 13.88 BLEU gap on the client test set between P-NMT and C-NMT. Restricted by privacy protection, it is not always possible to access private data for centralized training, so we attempt to build high-performance global models using FL techniques. Specifically, we evaluate the performance of different FL methods in both Non-IID and IID settings. For the Non-IID setting, we have the following findings: (i) All FL methods outperform P-NMT on the client test set, but show degradation on the server test set. This indicates that FL fuses helpful information from multiple parties, but suffers from a varying degree of knowledge conflict and catastrophic forgetting. (ii) 6 Published as a conference paper at ICLR 2023 FedAvg is heavily affected by whether the server data is used in training and model aggregation frequency. When server data is exploited during the training of FedAvg, the overall performance of FedAvg is similar to P-NMT, but FedAvg significantly improves performance on client test set without involving the server data. In addition, the performance gain has a positive correlation with the size of the client dataset (Law>Medical>IT), since FedAvg utilizes the size of different datasets as weights to aggregate client models. For the aggregation frequency, FedAvg1 is much better than FedAvg∞ and more details can be found in Appendix C.2. We find that frequent aggregation significantly reduces the parameter conflicts between different models, but it brings high communication cost. (iii) FT-Ensemble is better than FedAvg∞, indicating that the fusion of output probabilities leads to less knowledge conflict compared with model aggregation. (iv) FedNN achieves an average 4.41/1.99 BLEU score improvement on the client test set compared to FedAvg1 and C-NMT respectively, and maintains a competitive performance on the server test set. It demonstrates the effectiveness of FedNN in capturing client-side knowledge by memorization and integrating it with P-NMT. (v) Although FedNN slightly increases inference time, it not only improves translation quality, but also significantly reduces communication and computation overhead compared with other FL baselines, which is tolerable for clients. For the IID setting, we have some different findings: (i) Some FL methods that do not leverage server data in their training process (i.e., FedAvg1, FT-Ensemble and FedNN) outperform C-NMT on the client test set. The reason is that there is no statistical data heterogeneity among clients, resulting in fewer parameter conflicts and less conflict of probability outputs. (ii) The performance of FedNN is slightly weaker than that in the Non-IID setting. It demonstrates that the benefit of the memorization-based interaction is more significant when the data distribution is more heterogeneous. Overall, FedNN shows stable performance with less communication and computational overhead in Non-IID and IID settings, which verifies the practicality of memorization-based interaction mechanisms. More results and analysis are shown in Appendix B. 4.3 THE IMPACT OF CLIENT'S NUMBER We further verify the effectiveness of FedNN on a larger number of clients. We adopt the number of clients ranging from (3, 6, 12, 18) for quick experiments.1 The detailed results are shown in Figure 2. • Comparisons with FL Methods. As the number of clients increases, we observe that: (i) Both FedAvg1 and FT-Ensemble show varying degrees of performance degradation on the client test sets, especially for FT-Ensemble. We conjecture that the limited local data cannot support the training of local models and retain most of the knowledge of P-NMT. (ii) FedNN outperforms FL baselines on both private and global test sets for the Non-IID setting, while for the IID setting it maintains a similar performance to FedAvg1 on private test sets and keeps a higher global performance. These results show that FedNN, benefiting from the memorization-based interaction, could quickly scale to large-scale client scenarios and avoid performance loss due to insufficient local private data. The more analysis of FL methods is described in Appendix E. • Comparisons with Personalized Methods. We also compare FedNN with the personalized methods, including FT (fine-tuning P-NMT with only local client-side data) and AK-MT (constructing a datastore with only local client-side data and decoding with assisted Meta-k network). AK-MT and FT perform similarly, as AK-MT is able to capture the personalized knowledge by local memorization. The performance of both AK-MT and FT tends to decrease in the Non-IID setting as the number of clients increase, while FedNN hardly decreases. For the IID setting, although the performance of all methods degrades, FedNN still achieves the best performance on all clients test sets. It is because that the global memorization capture more similar patterns than the local memorization to assist in inference. 1Due to the limited resources in our experiments, there are no more domains to ensure the Non-IID setting when the number of clients increases. Thus, we directly separate the Non-IID and IID data distributions with the ratio of (1, 1 6 ). Note that the Non-IID setting here is not the strictly one, but it is worth exploring. 4 , 1 2 , 1 7 Published as a conference paper at ICLR 2023 Figure 2: The translation performance of FL and personalized methods when the number of clients increases. Figure 3: The impact of data distribution heterogeneity for different FL and personalized methods. 4.4 THE IMPACT OF DATA HETEROGENEITY To further investigate the effect of data heterogeneity between three clients on FL performance, we adopt a mixed ratio α ∈ {0, 0.2, 0.4, 0.6, 0.8} to construct the data distribution that we want: we randomly take a proportion of α from each domain to construct the IID dataset, and then remain domain data is mixed with one-third of this IID dataset to form the final data distribution. As α → 0, partitions tend to be more heterogeneous (Non-IID), and conversely, the data distribution is more uniform. As shown in Figure 3, the performance of personalized methods (FT and AK-MT) is degraded as data heterogeneity decrease, which is caused by the reduction of available domain-specific data in the client. FT-Ensemble also decreases across all client test sets and is worse than FT, while FedAvg1 shows opposite performance trends between Law and IT, Medical. This is because when FedAvg aggregates, the model weight of each client is proportional to the data size, and as α increases, the data size between clients tends from |DLaw| (cid:29) |DM edical| (cid:29) |DIT | to equally to 1 3 (|DLaw| + |DM edical| + |DIT |). Our FedNN maintains stable and remarkable performance across all client test sets and significantly outperforms other methods in the server test set. It indicates that the memorization-based interaction mechanism could capture and retain the knowledge of all clients, avoiding the knowledge conflict based on traditional model-based interaction. 4.5 QUANTITATIVE ANALYSIS OF PRIVACY We quantify the potential privacy-leaking risks of global memorization. Since all clients obtain the public NMT model, they could utilize their own datastore to train a reverse attack model to reconstruct the private data in 8 FL Methods:FT-EnsembleFedNNFTAK-MTPersonalized Methods:FedAvg1(a) Non-IID Setting(b) IID Setting00.20.40.60.8202428323640BLEU ScoreClient IT00.20.40.60.83540455055Client Law00.20.40.60.8303540455055Client Medical00.20.40.60.81012141618202224Server WMT14FedAvg1FT-EnsembleFTAK-MTFedNN Published as a conference paper at ICLR 2023 global memorization. In this experiment, we task one client (e.g., IT) as the attacker and others as the defenders (e.g., Medical and Law). The reconstruction BLEU (Papineni et al., 2002)/Precision(P)/Recall(R)/F1 scores are used to evaluate the degree of privacy leakage. The more experimental details are shown in Appendix D. As illustrated in Table 2, whether the input is an unencrypted key or a key encrypted by fKE, the threat model has very low scores in all defenders, especially for the recall score, meaning that it is difficult to recover and identify valuable information from global memorization. Furthermore, the fKE increases the difficulty of reconstructing the private text from the memorization constructed by other clients. We also provide some case studies in Appendix D.4, which better help qualitatively assess the safety of FedNN. Table 2: The reconstruction BLEU/Precision(P)/Recall(R)/F1 score [%] of the attack model. Medical→IT Medical→Law IT→Medical Law→IT IT→Law Metric Datastore Law→Medical BLEU P/R/F1 (K, V) (KfKE , V) (K, V) (KfKE , V) 8.21 6.52 5.09 4.27 9.90 7.88 6.16 5.58 7.33 6.35 8.30 6.86 14.55/2.90/4.84 14.73/2.30/3.98 35.78/7.43/12.3 41.26/5.28/9.36 12.18/7.53/9.31 11.88/7.43/9.14 23.18/11.65/15.51 12.18/7.53/9.31 11.15/7.04/8.63 11.81/6.35/8.26 9.75/4.85/6.48 9.62/4.04/5.69 5 RELATED WORK The FL algorithm for deep learning (McMahan et al., 2017) is first proposed for language modeling and image classification tasks. Then theory and framework of FL are widely applied to many fields, including computer vision (Lim et al., 2020), data mining (Chai et al., 2021), and edge computing (Ye et al., 2020). Recently, researchers explore applications of FL in privacy-preserving NLP, such as next word prediction (Hard et al., 2018; Chen et al., 2019), aspect sentiment classification (Qin et al., 2021), relation extraction (Sui et al., 2021), and machine translation (Roosta et al., 2021; Passban et al., 2022). For machine translation, previous works directly apply FedAvg for this task and introduce some parameter pruning strategies during node communication. However, multi-round model-based interactions are impractical and inefficient for NMT because of the huge computational and communication costs associated with large NNT models. Different from them, we design an efficient federated nearest neighbor machine translation framework that requires only one-round memorization interaction to obtain a high-quality global translation system. Memorization-augmented methods have attracted much attention from the community and achieved remark- able performance on many NLP tasks, including language modeling (Khandelwal et al., 2020; He et al., 2021), named entity recognition (Wang et al., 2022), few-shot learning with pre-trained language model (Bari et al., 2021; Nie et al., 2022), and machine translation (Khandelwal et al., 2021; Zheng et al., 2021a;b; Wang et al., 2021; Du et al., 2022). For the NMT system, Khandelwal et al. (2021) first propose kNN-MT, a simple and efficient non-parametric approach that plugs kNN classifier over a large datastore with traditional NMT models (Vaswani et al., 2017; Zhang et al., 2018a;b; Guo et al., 2020; Wei et al., 2020) to achieve significant improvement. Our work extends the promising capability of kNN-MT in the federated scenario and introduces two-phase datastore encryption strategy to avoid data privacy leakage. 6 CONCLUSION In this paper, we present a novel federated nearest neighbor machine translation framework to handle the federated NMT training problem. This FL framework equips the public NMT model trained on large-scale accessible data with a kNN classifier and safely collects all local datastores via a two-phase datastore encryption strategy to form the global FL model. Extensive experimental results demonstrate that our proposed approach significantly reduces computational and communication costs compared with FedAvg, while achieving promising performance in different FL settings. In the future, we would like to explore this approach on other sequence-to-sequence tasks. Another interesting direction is to further investigate the effectiveness of our method on a larger number of clients, such as hundreds of clients with more domains. 9 Published as a conference paper at ICLR 2023 ACKNOWLEDGEMENTS We thank the anonymous reviewers for helpful feedback on early versions of this work. We appreciate Wenxiang Jiao, Xing Wang, Longyue Wang and Zhaopeng Tu for the fruitful discussions. This work was done when the first author was an intern at Tencent AI Lab and supported by the grants from National Natural Science Foundation of China (No.62222213, 62072423), and the USTC Research Funds of the Double First-Class Initiative (No.YD2150002009). Zhirui Zhang, Tong Xu and Enhong Chen are the corresponding authors. REFERENCES Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In EMNLP, 2015. M Saiful Bari, Batool Haider, and Saab Mansour. Nearest neighbour few-shot learning for cross-lingual classification. ArXiv, abs/2109.02221, 2021. Ondrej Bojar, Christian Buck, Christian Federmann, Barry Haddow, Philipp Koehn, Johannes Leveling, Christof Monz, Pavel Pecina, Matt Post, Herve Saint-Amand, Radu Soricut, Lucia Specia, and Ales Tamchyna. Findings of the 2014 workshop on statistical machine translation. In WMT@ACL, 2014. Kallista A. Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H. Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for federated learning on user-held data. CoRR, abs/1611.04482, 2016. URL http://arxiv.org/abs/1611.04482. Di Chai, Leye Wang, Kai Chen, and Qiang Yang. Secure federated matrix factorization. IEEE Intelligent Systems, 36:11–20, 2021. Mingqing Chen, Ananda Theertha Suresh, Rajiv Mathews, Adeline Wong, Cyril Allauzen, Franccoise Beaufays, and Michael Riley. Federated learning of n-gram language models. In CoNLL, 2019. Chenhui Chu and Rui Wang. A survey of domain adaptation for neural machine translation. In COLING, 2018. Yichao Du, Weizhi Wang, Zhirui Zhang, Boxing Chen, Tong Xu, Jun Xie, and Enhong Chen. Non-parametric domain adaptation for end-to-end speech translation. In EMNLP, 2022. Taher El Gamal. A public key cryptosystem and a signature scheme based on discrete logarithms. IEEE Trans. Inf. Theory, 31:469–472, 1984. Junliang Guo, Zhirui Zhang, Linli Xu, Hao-Ran Wei, Boxing Chen, and Enhong Chen. Incorporating bert into parallel sequence decoding with adapters. In NeurIPS, 2020. Andrew Hard, Kanishka Rao, Rajiv Mathews, Franc ̧oise Beaufays, Sean Augenstein, Hubert Eichner, Chlo ́e Kiddon, and Daniel Ramage. Federated learning for mobile keyboard prediction. ArXiv, abs/1811.03604, 2018. Hany Hassan, Anthony Aue, Chang Chen, Vishal Chowdhary, Jonathan Clark, Christian Federmann, Xuedong Huang, Marcin Junczys-Dowmunt, William D. Lewis, Mu Li, Shujie Liu, Tie-Yan Liu, Renqian Luo, Arul Menezes, Tao Qin, Frank Seide, Xu Tan, Fei Tian, Lijun Wu, Shuangzhi Wu, Yingce Xia, Dongdong Zhang, Zhirui Zhang, and Ming Zhou. Achieving human parity on automatic chinese to english news translation. ArXiv, abs/1803.05567, 2018. 10 Published as a conference paper at ICLR 2023 Junxian He, Graham Neubig, and Taylor Berg-Kirkpatrick. Efficient nearest neighbor language models. In EMNLP, 2021. Herv ́e J ́egou, Matthijs Douze, and Cordelia Schmid. Product quantization for nearest neighbor search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33:117–128, 2011. Jeff Johnson, Matthijs Douze, and Herv ́e J ́egou. Billion-scale similarity search with gpus. IEEE Transactions on Big Data, 7:535–547, 2021. Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. Generalization through memorization: Nearest neighbor language models. In ICLR, 2020. Urvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. Nearest neighbor machine translation. In ICLR, 2021. Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2015. Philipp Koehn and Rebecca Knowles. Six challenges for neural machine translation. In NMT@ACL, 2017. Tian Li, Anit Kumar Sahu, Ameet S. Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37:50–60, 2019. Wei Yang Bryan Lim, Nguyen Cong Luong, Dinh Thai Hoang, Yutao Jiao, Ying-Chang Liang, Qiang Yang, Dusit Tao Niyato, and Chunyan Miao. Federated learning in mobile edge networks: A comprehensive survey. IEEE Communications Surveys & Tutorials, 22:2031–2063, 2020. H. B. McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Ag ̈uera y Arcas. Communication- efficient learning of deep networks from decentralized data. In AISTATS, 2017. Feng Nie, Meixi Chen, Zhirui Zhang, and Xuan Cheng. Improving few-shot performance of language models via nearest neighbor calibration. ArXiv, abs/2212.02216, 2022. Goldreich Oded. Foundations of cryptography: Volume 2, basic applications. 2004. A. Emin Orhan. A simple cache model for image recognition. ArXiv, abs/1805.08709, 2018. Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In NAACL, 2019. Nicolas Papernot and Patrick Mcdaniel. Deep k-nearest neighbors: Towards confident, interpretable and robust deep learning. ArXiv, abs/1803.04765, 2018. Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In ACL, 2002. Peyman Passban, Tanya Roosta, Rahul Gupta, Ankit R. Chadha, and Clement Chung. Training mixed-domain translation models via federated learning. In NAACL, 2022. Han Qin, Guimin Chen, Yuanhe Tian, and Yan Song. Improving federated learning for aspect-based sentiment analysis via topic memories. In EMNLP, 2021. Ronald L. Rivest, Adi Shamir, and Leonard M. Adleman. A method for obtaining digital signatures and public-key cryptosystems. Commun. ACM, 21:120–126, 1978. 11 Published as a conference paper at ICLR 2023 Tanya Roosta, Peyman Passban, and Ankit R. Chadha. Communication-efficient federated learning for neural machine translation. ArXiv, abs/2112.06135, 2021. Thibault Sellam, Dipanjan Das, and Ankur P. Parikh. Bleurt: Learning robust metrics for text generation. In ACL, 2020. Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. ArXiv, abs/1508.07909, 2016. Dianbo Sui, Yubo Chen, Kang Liu, and Jun Zhao. Distantly supervised relation extraction in federated settings. In EMNLP, 2021. Ashish Vaswani, Noam M. Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. Dongqi Wang, Hao-Ran Wei, Zhirui Zhang, Shujian Huang, Jun Xie, Weihua Luo, and Jiajun Chen. Non- parametric online learning from human feedback for neural machine translation. In AAAI Conference on Artificial Intelligence, 2021. Shuhe Wang, Xiaoya Li, Yuxian Meng, Tianwei Zhang, Rongbin Ouyang, Jiwei Li, and Guoyin Wang. knn-ner: Named entity recognition with nearest neighbor search. ArXiv, abs/2203.17103, 2022. Hao-Ran Wei, Zhirui Zhang, Boxing Chen, and Weihua Luo. Iterative domain-repaired back-translation. In EMNLP, 2020. Yunfan Ye, Shen Li, Fang Liu, Yonghao Tang, and Wanting Hu. Edgefed: Optimized federated learning based on edge computing. IEEE Access, 8:209191–209198, 2020. Junpeng Zhang, Mengqian Li, Shuiguang Zeng, Bin Xie, and Dongmei Zhao. A survey on security and privacy threats to federated learning. In 2021 International Conference on Networking and Network Applications, NaNA 2021, Lijiang City, China, October 29 - Nov. 1, 2021, pp. 319–326. IEEE, 2021. doi: 10.1109/NaNA53684.2021.00062. URL https://doi.org/10.1109/NaNA53684.2021. 00062. Zhirui Zhang, Shujie Liu, Mu Li, M. Zhou, and Enhong Chen. Joint training for neural machine translation models with monolingual data. In AAAI Conference on Artificial Intelligence, 2018a. Zhirui Zhang, Shuangzhi Wu, Shujie Liu, Mu Li, Ming Zhou, and Enhong Chen. Regularizing neural machine translation by target-bidirectional agreement. In AAAI Conference on Artificial Intelligence, 2018b. Xin Zheng, Zhirui Zhang, Junliang Guo, Shujian Huang, Boxing Chen, Weihua Luo, and Jiajun Chen. Adaptive nearest neighbor machine translation. In ACL, 2021a. Xin Zheng, Zhirui Zhang, Shujian Huang, Boxing Chen, Jun Xie, Weihua Luo, and Jiajun Chen. Non- parametric unsupervised domain adaptation for neural machine translation. In EMNLP(findings), 2021b. 12 Published as a conference paper at ICLR 2023 A IMPLEMENTATION DETAILS AND EVALUATION The statistics of the dataset and datastore used by the server/clients are listed in Table 3 and Table 4, respectively. We follow the recipe 2 to perform data pre-processing. The Moses toolkit 3 is used to tokenize all sentences and learn bpe-code in the publicly available corpus WMT14. Based on this, we split all the words of the above datasets into subword units (Sennrich et al., 2016). All experiments are implemented based on the FAIRSEQ toolkit (Ott et al., 2019). We train the public model on the WMT14 En-De dataset and use it as the initialization model for all methods. We adopt Transformer (Vaswani et al., 2017) as model structure of all baselines, in which it consists of 6 transformer encoder layers, and 6 transformer decoder layers. The input embedding size of the transformer layer is 512, the FFN layer dimension is 2048, and the number of self-attention heads is 8. During training, we deploy the Adam optimizer (Kingma & Ba, 2015) with a learning rate of 5e-4 and 4K warm-up updates to optimize model parameters. Both label smoothing coefficient and dropout rate are set to 0.1. The batch size is set to 16K tokens. We train all models with 4 Tesla-V100 GPU and set patience to 5 to select the best checkpoint on the validation set. The FAISS (Johnson et al., 2021) is leveraged to construct the datastore and we use its IndexIVFPQ strategy to implement Product Quantizer K-encryption and fast nearest neighbor search. We utilize the FAISS to learn 4096 cluster centroids on public datastore, and apply it to client's datastore. During inference, the beam size and length penalty are set to 5 and 1 for all methods and we search 64 clusters for each target token when using FAISS. In all experiments, we report the case-sensitive BLEU score (Papineni et al., 2002) using sacreBLEU4. We estimate the number of floating-point operations (FLOPs) used to train the model by multiplying the training time, the number of GPUs used, and an estimation of the sustained single-precision floating-point capacity of each GPU5. Table 3: The statistics of datasets for server and clients. Server Client WMT14 IT Medical Law Train Dev Test 4,475,414 45,206 3,003 222,927 2,000 2,000 248,009 2,000 2,000 467,309 2,000 2,000 Table 4: The statistics of datastores for server and clients. Server WMT14 Client Medical IT Law Global (K, V) size Hard Disk Space (Datastore) Hard Disk Space (Faiss Index) 117,427,034 114 GB 8,988 MB 5,858,648 3,085,523 25,812,236 3,938 MB 6,890 MB 17,717 MB 28,545 MB 1,978 MB 244 MB 16,868,065 1,266 MB 451 MB 2https://github.com/facebookresearch/fairseq/blob/main/examples/translation/prepare-wmt14en2de.sh 3https://github.com/moses-smt/mosesdecoder 4https://github.com/mjpost/sacrebleu, with a configuration of 13a tokenizer, case-sensitiveness, and full punctuation 5The single-precision floating-point capacity for Tesla-V100 GPU is 14 TFLOPs. 13 Published as a conference paper at ICLR 2023 B MORE RESULTS FOR THE NON-IID SETTING B.1 PERFORMANCE COMPARISONS WITH CONTROLLER We compare the performance (BLEU) and overhead of FedNN, FedAvg, and Controller in the Non-IID setting of the En2De translation task. For the Controller model, as shown in Roosta et al. (2021)'s study, 6E-6D/C-C(0-3) model achieves the best trade-off of performance and efficiency among all FL methods. Thus, we follow their setup and adopt layers 0 and 3 (both for the encoder and decoder) as controllers to participate in the parameter interaction of FedAvg training. The experimental results are shown in the Table 5. We find that the Controller has a significant performance improvement compared to P-NMT, but is still worse than FedAvg1 and FedNN. In addition, since the Controller falls into the multi-round model-based FL interaction paradigm, its communication overhead is still much higher than FedNN. Table 5: The performance and overhead comparison with Controller. communication and computational cost in "GB" and "FLOPs" respectively . "Comm." and "Comp." refer to Methods Client Test Server Test Overall Performance Cost IT Law Medical WMT14 Client (cid:52) Global (cid:52) Comm. Comp. P-NMT 26.62 35.91 30.27 Controller 27.78 46.30 FedAvg1 28.26 53.00 35.62 55.57 FedNN 35.62 45.90 49.21 26.63 18.72 13.45 22.29 B.2 EVALUATION WITH BLEURT 30.93 – 29.86 36.57 +5.63 32.11 42.39 +11.45 35.15 46.80 +15.87 40.67 +10.82 – – – 6.77 × 1017 +2.25 +5.30 388.12 3.23 × 1018 6.72 × 1015 10.86 5.08 We evaluate the two settings in Table 1 using the neural metric - BLEURT (Sellam et al., 2020). The detailed results are shown in Table 6. We can get similar conclusions when using the BLEU score as an evaluation metric, i.e., for the Non-IID setting, our FedNN significantly outperforms all other FL methods; for the IID setting, our FedNN also achieves comparable performance to the FedAvg1 and FT-Ensemble. Table 6: BLEURT score [%] of different methods in Table 1. Methods Client Test Server Test Overall Performance IT Law Medical WMT14 Client (cid:52) Global (cid:52) 70.46 78.49 62.00 72.65 C-NMT P-NMT FedAvgs 63.02 73.71 1 FedAvg1 64.09 78.05 FedAvgs 62.87 74.11 ∞ FedAvg∞ 52.63 77.37 FT-Ensemble 64.08 72.47 68.86 78.12 FedNN FedAvgs 66.38 76.31 1 FedAvg1 69.93 78.67 FedAvgs 64.92 74.32 ∞ FedAvg∞ 68.96 78.08 FT-Ensemble 70.28 78.80 FedNN 67.69 77.74 Non-IID IID 74.97 65.64 67.06 72.74 67.50 65.02 70.01 72.74 71.65 75.68 68.68 74.39 75.04 72.31 14 71.62 71.93 72.19 53.61 72.20 56.26 59.17 67.38 72.46 55.78 72.15 59.44 58.78 68.16 74.64 66.76 - 73.89 - 68.06 - - 67.93 +1.17 69.00 +0.94 71.63 +4.86 67.12 -0.93 68.16 +1.40 69.17 +1.11 65.01 -1.76 62.82 -5.24 68.85 +2.09 66.43 -1.62 73.24 +6.48 71.78 +3.72 71.45 +4.68 71.70 +3.65 74.76 +8.00 70.02 +1.96 69.31 +2.54 70.02 +1.96 73.81 +7.05 70.22 +2.16 74.71 +7.94 70.73 +2.67 72.58 +5.82 71.48 +3.42 Published as a conference paper at ICLR 2023 B.3 SIGNIFICANT TEST FOR TABLE 1 We use the bootstrap re-sampling method to test the significant difference between FedNN and other methods. Table 7 shows the significance test results of English-German direction under the Non-IID setting. The "-" means that FedNN is not significantly better than the method. We can find that FedNN significant outperforms all FL methods, including FedAvg and FT-Ensemble. Table 7: The significant test between FedNN and other methods for the Non-IID setting in Table 1. Client Test Server Test Methods IT Law Medical WMT14 - ≤0.01 ≤0.05 C-NMT ≤0.01 ≤0.01 ≤0.01 P-NMT ≤0.01 ≤0.01 ≤0.05 FedAvg1 FT-Ensemble ≤0.01 ≤0.01 ≤0.01 - ≤0.01 ≤0.01 ≤0.05 B.4 PERFORMANCE COMPARISONS ON GERMAN-ENGLISH DIRECTION As illustrated in Table 8, we report the performance of different FL methods in the Non-IID setting of German-English Direction. We observe that the findings in the German-English direction remain consistent with the English-German direction (shown in Table 1), in which FedNN outperforms other methods in terms of overall performance both client-side and globally. Table 8: Performance of different methods in the German-English direction for the Non-IID setting. Methods Client Test Server Test Overall Performance IT Law Medical WMT14 Client (cid:52) Global (cid:52) P-NMT 31.70 39.86 34.37 FedAvg1 32.22 58.32 FT-Ensemble 35.76 44.07 FedNN 41.11 60.18 48.56 43.20 53.44 31.64 16.83 21.48 27.12 35.31 - 34.39 - 46.37 +11.06 38.98 +4.59 +1.74 +5.70 36.13 41.01 51.58 +16.27 45.46 +11.07 C ABLATION STUDY ON THE NON-IID SETTING C.1 THE IMPACT OF CLIENT DATA SIZE ON DIFFERENT FL METHODS We carry out an ablation study to verify the impact of client data size on different FL methods, including FedAvg1, FT-Ensemble and FedNN. For each domain, we adopt a ratio range of β ∈ {0.0, 0.2, 0.4, 0.6, 0.8} to randomly sample from its complete data to constitute the client data of different scales. The detailed results are shown in the Table 9. We can observe that the performance and cost of all methods increase as the size of the client data increases. Moreover, FedNN significantly outperforms other FL methods in terms of performance, communication and computational overhead. C.2 THE IMPACT OF INTERACTION FREQUENCY ON FEDAVG We conduct experiments to analyze the impact of model interaction frequency on the FedAvg performance. We set the frequency to k ∈ {1, 2, 5, 10, 20, ∞}, i.e., the client interacts the model with the server after k 15 Published as a conference paper at ICLR 2023 Table 9: The impact of client data size on the performance and cost of different methods. "(cid:52)" refers to the improvement of methods compared with P-NMT. "Comm." and "Comp." refer to communication and computational cost in "GB" and "FLOPs" respectively. Server Test Overall Performance Client Test Cost IT Law Medical WMT14 Client (cid:52) Global (cid:52) Comm. Comp. β Methods 0.2 P-NMT 26.62 35.91 30.27 0.2 0.4 0.6 0.8 FedAvg1 20.27 47.42 FT-Ensemble 29.95 40.25 29.65 46.89 FedNN FedAvg1 20.99 48.98 FT-Ensemble 29.60 39.50 30.41 50.30 FedNN FedAvg1 22.36 52.38 FT-Ensemble 28.32 40.55 31.65 52.29 FedNN FedAvg1 24.11 52.71 FT-Ensemble 29.01 38.16 32.15 54.11 FedNN 33.92 37.41 41.46 35.58 38.45 43.89 42.04 40.19 45.65 43.72 39.30 46.62 26.63 15.73 20.81 22.72 16.58 21.43 23.32 12.83 18.61 23.68 12.76 16.87 22.22 30.93 – 29.86 – – – 4.85 2.00 33.87 35.87 39.33 +2.94 29.34 -0.52 111.59 9.27 × 1017 1.40 × 1017 +4.94 32.11 +2.25 1.34 × 1015 +8.40 35.18 +5.32 +4.25 30.53 +0.67 116.44 9.68 × 1017 35.18 2.81 × 1017 +4.92 32.25 +2.39 35.85 2.69 × 1015 41.53 +10.60 36.98 +7.12 +7.99 32.40 +2.55 245.00 2.04 × 1018 38.93 4.21 × 1017 36.35 +2.48 31.92 +2.06 4.03 × 1015 43.20 +12.26 38.32 +8.46 +9.25 33.33 +3.47 354.74 2.92 × 1017 40.18 5.62 × 1017 35.49 +4.56 30.84 +0.98 5.38 × 1015 44.29 +13.36 38.78 +8.92 4.85 2.77 4.85 4.31 4.85 3.54 rounds of local updates. We set the total computation overhead to be the same for a fair comparison of translation performance and communication overhead. The detailed results are shown in the Table 10. We find that the performance decreases significantly as k increases, especially when k = ∞ (i.e., a copy of the server model is trained locally until convergence), and the average performance drops to a level similar to that of P-NMT. The reason is that too many local updates suffer from catastrophic forgetting of knowledge from the previous aggregated models, resulting in strong knowledge conflicts in the new round of interactions. The optimal performance is presented at k = 1, which means that frequent interactions are essential to alleviate the knowledge conflicts for FedAvg. Table 10: BLEU score [%] and communication cost of FedAvg with different interaction frequency. . "Comm. Cost" refer to communication cost in "GB". Methods Client Test Server Test Overall Performance IT Law Medical WMT14 Client (cid:52) Global (cid:52) Comm. Cost P-NMT 26.62 35.91 30.27 28.26 53.00 FedAvg1 FedAvg2 26.37 52.92 FedAvg5 24.93 52.23 FedAvg10 22.63 51.11 FedAvg20 21.82 49.53 FedAvg∞ 17.30 47.06 45.90 44.22 41.08 38.60 36.24 30.61 26.63 13.45 13.07 12.85 12.65 12.75 13.33 30.93 – 29.86 – – 42.39 +11.45 35.15 +5.30 388.12 41.17 +10.24 34.15 +4.29 194.06 77.62 +8.48 32.77 +2.92 39.41 38.81 +6.51 31.25 +1.39 37.45 19.41 +4.93 30.09 +0.23 35.86 4.85 +0.63 27.01 -2.85 31.57 C.3 THE IMPACT OF ENSEMBLE STRATEGY ON FT-ENSEMBLE The ensemble strategy of FT-Ensemble could be implemented in two ways: the first is to directly average the probability distribution of each client model (as used in the Table 1), i.e., FT-Ensemble; the second, similar 16 Published as a conference paper at ICLR 2023 Table 11: BLEU score [%] of FT-Ensemble with different aggregation strategy. Overall Performance Server Test Client Test IT Law Medical WMT14 Client (cid:52) Global (cid:52) Methods Public Model 26.62 35.91 30.27 FT-Ensemble 30.11 38.14 FT-Ensemble-Wei 24.09 48.58 FedNN 35.62 55.57 39.15 34.11 49.21 26.63 17.13 16.06 22.29 30.93 - 29.86 - 1.28 4.87 31.13 35.80 35.59 0.85 4.66 30.71 46.80 15.87 40.67 10.82 Table 12: The impact of P-NMT's quality. "(cid:52)" refers to the improvement of the method compared with the model mentioned in Table 1. Methods IT Global Avg. BLEU (cid:52) BLEU (cid:52) BLEU (cid:52) BLEU (cid:52) BLEU (cid:52) BLEU (cid:52) Clients Avg. WMT14 Medical Law P-NMT 30.72 +4.10 38.69 +2.78 35.90 +5.63 29.77 +3.14 35.10 +4.17 33.77 +3.91 FedAvg1 FedNN 28.63 38.24 +0.37 +2.62 58.32 55.76 +5.32 +0.19 49.08 50.65 +3.18 +1.44 16.05 22.65 +2.60 +0.36 45.34 48.22 +2.95 +1.42 38.02 41.83 +2.87 +1.16 to FedAvg, is to weight the probability distribution of each client model's output by assigning weights to it according to its data size, i.e., FT-Ensemble-Wei. The performance comparison of these two ways in the Non-IID setting are shown in the Table 11. We find that FT-Ensemble outperforms FT-Ensemble-Wei in both client-side and global overall performance. FT-Ensemble has a more balanced performance on the client side, while FT-Ensemble-Wei is similar to FedAvg in that the performance is more biased towards the client Law's model, which has more local data. Our FedNN outperforms both of these methods on all clients. Note that the two implementations of FT-Ensemble described above in the IID setting are equivalent since the data size is the same for all client. C.4 THE IMPACT OF PUBLIC MODEL'S QUALITY Since FedNN performs federated learning based on the P-NMT, we investigate the impact of the P-NMT's quality on performance. We introduce WMT20 En-De data to train the P-NMT, which contains 40 million parallel pairs, and conduct fast experiments in the Non-IID setting. From Table 12, we can observe that as the quality of the P-NMT improves, all methods show better performance. D THE DETAILS OF PRIVACY LEAKAGE ANALYSIS D.1 DATASET CONSTRUCTION Given a local parallel sentence pair (xc, yc) ∈ Dc of client attacker, the public NMT model generates the context representation k = fθ(xc, yc,<t) in the last decoder layer at each timestep t, and the ground-truth is v = yc,t. k has two forms, i.e., whether it is encrypted by K-Encryption or not. Next, we concat them to obtain a training sample rc,t = k ⊕ v ⊕ <2src> ⊕ xc ⊕ <2tgt> ⊕ yc,<t ⊕ v, where ⊕ is the concatenation operation. The language tag <2src> and <2tgt> are used to identify the generation of source and target languages, respectively. By traversing the entire Dc, we obtain the whole dataset R = {r1, r2, . . . , rn} used to train the threat model, where n = (cid:80)|Dc| |yi| + |Dc|. The detailed statistics of dataset used for threat model are shown in Table 13. i 17 Published as a conference paper at ICLR 2023 Table 13: The statistics of datasets for the threat model. IT Medical Law Train Dev Test 3,085,523 34,737 2,000 5,858,648 55,577 2,000 16,868,065 51,423 2,000 Figure 4: The threat model based on the autoregressive paradigm. D.2 THE ARCHITECTURE OF THREAT MODEL The goal of the threat model is to reconstruct the corresponding original text from the memorization (k, v) of client defender. As shown in Figure 4, we use a transformer decoder as the architecture of the threat model, which is similar to the left-to-right language model based on the auto-regressive paradigm. It consists of 6 transformer layers. The input embedding size is 512, the FFN layer dimension is 2048, and the number of self-attention heads is 8. We first transform the first input token k to the same dimension as the word embedding using a linear layer, and then auto-regressive perform left-to-right reconstruction modeling. D.3 EVALUATION OF PRIVACY LEAKAGE We quantify the privacy information leaked by global memorization using sentence-level and word-level metrics, i.e., reconstruction BLEU and privacy word hitting Precision/Recall/F1. Assuming that the text recovered by the threat model from memorization ki ⊕ vi is hi = {hi,1, hi,2, ..h|hi|} and the ground-truth is gi = {gi,1, gi,2, ....g|gi|}, where i = {1, 2, ..., N } is test sample index. Then we calculate the reconstruction BLEU score using sacreBLEU. Before evaluating the word-level privacy leakage, we require to extract the privacy dictionary of the client defender. The privacy dictionary is obtained by computing the difference between the word distribution of the defender's private dataset and the server public dataset. Further, we filter hi and gi according to this dictionary to obtain sentences hp i that contain only privacy words. The i and gp 18 dogs<2tgt>hunde<2src>IlikemagIchEmbdEmbdEmbdLinearEmbdEmbdEmbdEmbdhundeEmbdkeyvaluelikedogshunde<2src>IIch<2tgt>magReconstruction Transformer DecoderPrefix Token:Text Predicted by Autoregressive Paradigm: Published as a conference paper at ICLR 2023 word-level metric then is computed as follows: (cid:80)N i (cid:80)N i Precision = Recall = (cid:80)N i (cid:80)|gp i | j Counthit(gp |hp i | j Counthit(hp |gp i | (cid:80)|hp i | (cid:80)N i i,j, hp i ) i,j, gp i ) , , (5) F1 = 2 × Precision × Recall Precision + Recall , where Counthit(x, y) represents that x has appeared in y. D.4 QUALITATIVE ANALYSIS OF PRIVACY Some qualitative cases are illustrated in Table 15 and we find that the style of all reconstructed texts remained consistent with the attacker's training data, including text length and domain style. For example, in Case1 and Case2, the reconstructed texts from the attack model trained on the Law domain exhibit a domain style of law client. This means that it is difficult to recover and identify valuable information, such as domain and private words, from global memorization. E COST ANALYSIS OF FL METHODS ON DIFFERENT CLIENT'S NUMBER The communication and computational costs of different FL methods are illustrated in Table 14. For communication, the cost of FedAvg is much higher than that of FedNN and FT-Ensemble. The reason is that FedAvg requires multi-round communication based on the model, while both FedNN and FT-Ensemble require only one-round memorization-based communication. For computation, the cost of FT-Ensemble is linearly related to the number of nodes. It cannot be extended to practical applications because of the number of local models that need to be integrated for inference. In contrast, the cost of FedNN is only 1/60 and N/2 of FedAvg1 and FT-Ensemble, respectively. Considering many clients' limited communication bandwidth and computational resources, FedNN is a promising framework selection to save a lot of communication time and computational consumption. Table 14: The communication cost and computation cost of different methods, where "M, N, R and D" respectively represent the model size (414MB), number of client, rounds of communication (160) and the total size of all encrypted datastores (1978MB). Communication Cost (GB) Computation Cost (FLOPs) Compl. M×N×R×2 FedAvg FT-Ensemble M×N×(N+1) FedNN (D+M)×N F LIMITATIONS 3 6 18 12 3 388.12 776.25 1552.50 3105.00 3.23×1018 3.23×1018 3.23×1018 3.23×1018 7.02×1017 1.40×1018 2.11×1018 2.82×1018 4.85 6.72×1015 6.72×1015 6.72×1015 6.72×1015 5.08 138.27 40.12 63.07 26.10 16.98 12.08 18 12 6 In this paper, we utilizes one round of memorization-based interaction to share knowledge among different clients, thus building low-overhead privacy-preserving translation systems. We discuss limitations of our method as follows. • Despite our proposed approach achieves strong performance when exploiting global memorization sharing, it leads to reduced inference efficiency due to the need for kNN retrieval. As shown in Table 1, the inference 19 Published as a conference paper at ICLR 2023 speed of FedNN is about 0.75× that of P-NMT. In practice, these costs may be acceptable since we employ FAISS to speed up kNN retrieval. We encourage future work to improve the efficiency of kNN retrieval. • The communication overhead required for memorization-based interaction is positively correlated with the client data size. Extremely large client data will make our approach inapplicable because it leads to higher communication overhead. Our approach is more applicable to the generic scenario described in Section 2, i.e., private data is sparse (|Dc| (cid:28) |Ds|). We also encourage further exploration of how to build a smaller and more accurate memorization further to mitigate this problem. • This paper is still very preliminary in the privacy leakage analysis of memorization interaction. Although the threat model on shared global memorization has a very low reconstruction scores, privacy leakage is still a potential risk. How to better evaluate and mitigate the privacy leakage of memorization remains an open question, which we leave for future work. Table 15: Examples of qualitative analysis for privacy leakage. Text in green / blue represent the defender- specific ground-truth and private words, respectively. Text in red represents the hit private words by attacker. The bold word represents the threat model of the client-side attacker, where the superscript "fKE" represents the input of training data k is encrypted K-Encryption, otherwise it is not. Case Examples Case 1: Defender is IT <2src> cursor ; quickly moving ; to an object <2tgt> cursor ; schnell zu einem Objekt bewegen MedicalfKE : <2src> curves , fainting, salivation, vomiting, diarrhoea, fainting, fainting, or vomiting, or diarrhoea. chen oder Durchfall oder Erbrechen <2tgt> Kleben, Fainting, Speichelfluss, Erbrechen, Durchfall, Ohnmacht oder Erbre- Medical: <2src> curonium or vecuronium: <2tgt> Vecuronium oder Vecuronium: LawfKE : <2src> palm oil falling within CN code 2710 00 90 <2tgt> Palm ̈ol des KN-Codes 2710 00 90 Law: <2src> curbiting the use of the designation 'butter' in Annex I to Regulation (EEC) No 3143 3143 / 85 85 <2tgt> curbitration der Bezeichnung 'Butter' in Anhang I der Verordnung (EWG) Nr. <2src> Intravenous infusion after reconstitution and dilution. nach Aufl ̈osung und Verd ̈unnung. <2tgt> Intraven ̈ose Infusion Case 2: Defender is Medical ITfKE : <2src> Inserts a placeholder. IT: <2src> Inserts a new row. LawfKE : <2src> Appointment of the date of minimum durability shall be given. <2tgt> F ̈ugt eine neue Zeile ein. <2tgt> Hiermit f ̈ugen Sie einen Platzhalter ein <2tgt> Die Angabe des Law: <2src> The minimum of date durability <2tgt> Angabe des Mindesthaltbarkeitsdatums Case 3: Defender is Law <2src> The Commission consistently takes a favourable view of such aid . hilfen werden von der Kommission stets bef ̈urwortet. ITfKE : <2src> The & kappname; Handbook <2tgt> Das Handbuch zu & kappname; IT: <2src> Following packages depend on the installed packages: von den installierten Pakete ab: <2tgt> Die folgenden Pakete h ̈angen <2tgt> Derartige Bei- MedicalfKE : <2src> Most common side effects with Azarga (seen in between 1 and 10 patients in 100) areheadache, dizziness, somnolence (sleepiness), nausea (feeling sick), diarrhoea, abdominal tummy pain, diarrhoea, flatulence (gas), abdominal (tummy) pain, dyspepsia (indigestion), diarrhoea, nau- sea (feeling sick), vomiting, abdominal (tummy) pain, dyspepsia (indigestion), flatulence (wind)... Medical: <2src> European Commission European Union for Nobilis Influenza H5N6 to Intervet International BV on 24 April 2009. April 2009 erteilte die Europ ̈aische Kommission dem Unternehmen Intervet International BV eine Gene -hmigung f ̈ur das Inverkehrbringen von Nobilis Influenza H5N6 in der gesamten Europ ̈aischen Union. valid throughout the granted a marketing authorisation <2tgt> 20
http://arxiv.org/abs/2302.12202v2
2023-07-28T07:50:22
2023-02-23T17:55:11
A Definition of Non-Stationary Bandits
Despite the subject of non-stationary bandit learning having attracted much recent attention, we have yet to identify a formal definition of non-stationarity that can consistently distinguish non-stationary bandits from stationary ones. Prior work has characterized non-stationary bandits as bandits for which the reward distribution changes over time. We demonstrate that this definition can ambiguously classify the same bandit as both stationary and non-stationary; this ambiguity arises in the existing definition's dependence on the latent sequence of reward distributions. Moreover, the definition has given rise to two widely used notions of regret: the dynamic regret and the weak regret. These notions are not indicative of qualitative agent performance in some bandits. Additionally, this definition of non-stationary bandits has led to the design of agents that explore excessively. We introduce a formal definition of non-stationary bandits that resolves these issues. Our new definition provides a unified approach, applicable seamlessly to both Bayesian and frequentist formulations of bandits. Furthermore, our definition ensures consistent classification of two bandits offering agents indistinguishable experiences, categorizing them as either both stationary or both non-stationary. This advancement provides a more robust framework for non-stationary bandit learning.
[ "Yueyang Liu", "Xu Kuang", "Benjamin Van Roy" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12202v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12202v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
3 2 0 2 l u J 8 2 ] G L . s c [ 2 v 2 0 2 2 1 . 2 0 3 2 : v i X r a A Definition of Non-Stationary Bandits Yueyang Liu1, Xu Kuang2 ∗ , and Benjamin Van Roy1,3 1Department of Management Science and Engineering, Stanford University 2Stanford Graduate School of Business 3Department of Electrical Engineering, Stanford University Abstract Despite the subject of non-stationary bandit learning having attracted much recent attention, we have yet to identify a formal definition of non-stationarity that can consistently distinguish non-stationary bandits from stationary ones. Prior work has characterized non-stationary bandits as bandits for which the reward distribution changes over time. We demonstrate that this definition can ambiguously classify the same bandit as both stationary and non-stationary; this ambiguity arises in the existing definition's dependence on the latent sequence of reward distributions. Moreover, the definition has given rise to two widely used notions of regret: the dynamic regret and the weak regret. These notions are not indicative of qualitative agent performance in some bandits. Additionally, this definition of non-stationary bandits has led to the design of agents that explore excessively. We introduce a formal definition of non-stationary bandits that resolves these issues. Our new definition provides a unified approach, applicable seamlessly to both Bayesian and frequentist formulations of bandits. Furthermore, our definition ensures consistent classification of two bandits offering agents indistinguishable experiences, categorizing them as either both stationary or both non-stationary. This advancement provides a more robust framework for non- stationary bandit learning. 1 Introduction The subject of non-stationary bandit learning has attracted much recent attention. However, what consti- tutes a non-stationary bandit as opposed to a stationary one has yet to be formally defined. Non-stationary bandits have typically been defined as bandits for which the "reward distribution" changes over time. For example, in the seminal paper by Whittle [1], non-stationary bandits are referred to as restless bandits, which are described as bandits where "the objects continue to change state even when they are not being operated". The Bayesian formulation has motivated research in non-stationarity bandit learning that also adopts a Bayesian viewpoint, as we do here. Among these studies, [2] investigate what they call a dynamic multi-armed bandit, in which "the reward functions stochastically and gradually change in time." [3] de- scribe non-stationary bandits as ones where "the environment changes over time", and more specifically, bandits where "arms change their expected rewards." We found that this definition cannot unambiguously distinguish non-stationary bandits from stationary ones. As demonstrated in Example 1 of Section 2, this definition can paradoxically categorize the same bandit as both stationary and non-stationary. This ambiguity stems from the fact that this definition depends on the concept of "reward distributions," which can allow for multiple valid sequences of "reward distributions" to be associated with the same bandit. Consequently, the existing definition can lead to confusion and inconsistency when attempting to classify bandits as either stationary or non-stationary. Furthermore, the existing definition has resulted in several consequential issues. Firstly, it has led to the adoption of regret notions that are less effective in assessing agent performance. Secondly, the existing ∗Xu Kuang published under a different full name in earlier versions of this manuscript. Please use "Y. Liu, X. Kuang and B. Van Roy" when citing this paper. 1 definition has led to the design of agents that explore excessively. In what follows, we delve into each of these issues in greater depth. Dynamic regret [4, 5] and weak regret [6, 7, 8, 9] are two widely-used performance metrics in non- stationary bandit learning. However, we found that these regret notions are ineffective in assessing agent performance and differentiating optimal agents from the rest in some cases. For example, in an intuitively nearly-stationary bandit, an optimal agent may exhibit a large and linear dynamic regret, misleadingly implying poor performance. Conversely, a sufficiently small positive weak regret does not guarantee near- optimal performance, because an optimal agent can incur a substantial, linear, and negative weak regret. These issues arise because the weak regret and dynamic regret are inconsistent with the conventional notion used for stationary bandits [10, 11]. Specifically, in a stationary bandit, the dynamic regret can significantly deviate from the conventional notion of regret; in a non-stationary bandit which closely resembles a stationary one, the weak regret and dynamic regret can differ considerably from the conventional notion in the stationary bandit that the non-stationary bandit closely resembles. These findings highlight the limitations of using It also calls for a formal definition of dynamic regret and weak regret for assessing agent performance. stationarity and non-stationarity that motivates the alignment of regret notions with the conventional notion. The existing definition of non-stationary bandits has also led to the development of algorithms that can explore excessively. Particularly, many variants of Thompson sampling (TS) [12] developed for non- stationary bandits [13, 14, 15, 3, 16, 17, 18] have been found by [19] to exhibit a tendency to over-explore in certain non-stationary bandits. This issue is significantly attributed to the dependence of bandit models on a latent sequence, which leads to inconsistencies between these TS variants and the original TS algorithm. Specifically, we can construct a nearly-stationary bandit and a stationary bandit that it closely resembles; when these TS variants are applied to either bandit, they exhibit notable differences in behavior and per- formance compared to TS applied to the stationary bandit. These findings highlight the inconsistencies between the TS variants and the original TS approach; they emphasize the necessity of formally defining stationarity and non-stationarity, which in turn motivates the development of more effective algorithms that align with their stationary counterparts. To address these issues, we introduce a formal definition of non-stationary bandits. This definition does not depend on the "reward distributions" or other latent sequences and can, therefore, unambiguously classify bandits. In addition, for two bandits that provide agents with indistinguishable experiences, our definition classifies them as both stationary or both non-stationary. By establishing this formal definition, we can motivate alternative notions of regret and algorithms that avoid the limitations associated with weak regret, dynamic regret, and many variants of TS. We provide concrete examples illustrating these concepts. Importantly, our definition of non-stationary bandits seamlessly applies to both Bayesian and frequentist formulations, encompassing restless bandits [1] and bandits with oblivious adversaries [20], respectively, thereby providing a unified framework. This unified framework enhances our understanding of non-stationary bandits and opens up possibilities for the development of more effective notions of regret and algorithms to address the challenges inherent in non-stationary bandits. 2 Existing Definitions Ambiguously Classify Bandits We begin this section by introducing basic definitions and notations that we will use throughout the paper. We start by presenting a formal definition of a bandit, drawing inspiration from the formulation of restless bandits [1]. Definition 1. A bandit with action set A is a stochastic process {Rt}t∈N with state space R|A|. In a bandit {Rt}t∈N with a finite action set A, the reward Rt+1,a represents what an agent receives upon executing action a ∈ A at timestep t ∈ N0. We use N0 to denote the set of all nonnegative integers, and N to denote the set of all positive integers. We sometimes use R1:+∞ to denote the sequence of all rewards {Rt}t∈N and Ri:j to denote the sequence of rewards between timesteps i and j, i.e, {Rt}t∈[j]/[i], where [i] = {1, ..., i}. A formal definition of non-stationarity that distinguishes non-stationary bandits from stationary ones is lacking. Instead, previous works [21, 22, 4, 23, 24, 25, 26, 27, 28, 13, 29, 15, 30, 31, 32, 33, 34, 3, 5, 16, 2, 17, 2 18, 35, 1, 36, 37, 38, 39, 40] refer to a bandit as non-stationary when its "reward distribution" changes over time. The reward distributions are involved in this definition because, in many cases, rewards are generated according to a particular model, and the reward distributions represents one such model. In other cases, the reward distributions can serve as convenient abstractions of how rewards are generated. To apply the existing definition of non-stationarity for classifying bandits, it is necessary to establish a formal definition of a valid reward distribution. Thus, we present the following formal definition. We use P(S) to denote the set of all distributions over a set S. Definition 2 (Reward Distribution of a Bandit {Rt}t∈N). A stochastic process {Qt}t∈N with state space P(R|A|) is a sequence of reward distributions if, conditioned on {Qt}t∈N, {Rt}t∈N are independent, and each Rt is distributed according to Qt. It is important to note that any bandit {Rt}t∈N has a trivial sequence of reward distributions: consider {Qt}t∈N such that Qt = δRt , a Dirac delta function centered at Rt, for all t ∈ N. We can now note the existing definition of non-stationary bandits in Existing Definition 1. Existing Definition 1 (Non-Stationary Bandit, Existing). A bandit {Rt}t∈N with reward distributions {Qt}t∈N is non-stationary if it is not stationary; it is stationary if Qt = Qt+1 a.s. for all t ∈ N. We can now apply Existing Definition 1 to classify bandits. We will use an example to illustrate that this definition can lead to ambiguity, classifying the same bandit as both stationary and non-stationary in some cases. Below we provide a formal definition of a class of Bernoulli bandits followed by the specific example we consider. Definition 3 (Bernoulli Bandit with Independent Actions). For all a ∈ A, let {θt,a}t∈N be an independent stochastic process with state space [0, 1]. Conditioned on the collection of {θt,a}t∈N for all a ∈ A, a reward Rt,a is distributed according to Bernoulli(θt,a), independent of the rewards associated with other timesteps or actions. Example 1 (A Hard-To-Classify Bernoulli Bandit). Consider a Bernoulli bandit with two independent actions 1 and 2, where θt,1 = 0.8 for all t ∈ N and {θt,2}t∈N is i.i.d. according to a uniform distribution over the set {0, 1}. Existing Definition 1 would ambigously classify Example 1 as both stationary and non-stationary. To elaborate, we can take each reward distribution Qt,a to be a Bernoulli distribution determined by its mean θt,a. Consequently, the reward distribution Qt changes over time: Qt 6= Qt+1 with probability 0.5, because θt 6= θt+1 with probability 0.5. Thus, Existing Definition 1 would classify Example 1 as non-stationary. On the other hand, we can alternatively define each Qt,2 as a Bernoulli distribution with mean 0.5, because {Rt,2}t∈N are i.i.d. Bernoulli(0.5). In this case, the reward distribution Qt remains unchanged over time, and Existing Definition 1 would classify Example 1 as stationary. This ambiguity in classifying bandits arises in bandits with continuous rewards as well. We provide a formal definition of a class of Gaussian bandits followed by a specific example that we consider. Definition 4 (Gaussian Bandit with Independent Actions). For all a ∈ A, let {θt,a}t∈N be an independent stochastic process with state space R. Conditioned on the collection of {θt,a}t∈N for all a ∈ A, the reward Rt,a is distributed according to N (θt,a, 1), independent of the rewards associated with other timesteps or actions. Example 2 (A Hard-To-Classify Gaussian Bandit). Consider a Gaussian bandit with two independent actions 1 and 2, where θt,1 = 0.8 for all t ∈ N and {θt,2}t∈N is i.i.d. according to a Gaussian distribution N (0.5, 1). Example 2 can be classified as non-stationary if we take the reward distribution Qt,2 to be N (θt,2, 1), and stationary if we take Qt,2 to be N (0.5, 2) instead. This ambiguity in classifying bandits stems from the dependence of Existing Definition 1 on the concept of reward distribution. Specifically, at least two different {Q}t∈N are valid reward distributions (Definition 2) for each of Examples 1 and 2. A more thoughtful definition of non-stationary bandits would resolve this issue. Indeed, we will propose a definition that does not rely on the concept of reward distribution. 3 3 Issues in Regret and Agent Design This section discusses issues that arise in defining notions of regret. We first introduce useful concepts and notions. We refer to each finite sequence of action-reward pairs as a history. We use H to denote the set of all histories. Below we provide a formal definition of a policy. Definition 5 (Policy). A policy π : H → P(A) is a function that maps each history in H to a probability distribution over the action set A. An agent is capable of selecting and executing a policy, while an algorithm refers to the set of procedures t to denote the action selected t to denote the history generated at timestep t as an agent t be such or steps employed to execute a particular policy. For all policies π, we use Aπ at time t by an agent that executes π, and H π executes π. Specifically, at each timestep t, we let H π that P(Aπ 0 , R1,Aπ t is independent of R1:+∞ conditioned on H π t . t−1 ); we let Aπ t ) and that Aπ t ) = π(*|H π t−1, Rt,Aπ t ∈ *|H π t = (Aπ , . . . , Aπ 0 3.1 Desired Properties of Regret Bandit learning agents seek to maximize cumulative expected reward. However, evaluating an agent's perfor- mance solely based on the reward collected is challenging because it is difficult to distinguish between good and bad outcomes. To address this, it is helpful to compare an agent's performance against a benchmark Benchmark. This comparison is quantified using the notion of regret. Specifically, the regret of a policy π over T ∈ N timesteps in a bandit {Rt}t∈N is defined as Regret({Rt}t∈N; T ; π) = Benchmark({Rt}t∈N; T ) − T −1 E Rt+1,Aπ t . t=0 X (cid:2) (cid:3) When it is clear from the context that we consider a single bandit {Rt}t∈N, we use Benchmark(T ) and Regret(T ; π) as shorthands. The construction of Benchmark plays a crucial role in evaluating agent performance. Ideally, we want to construct Benchmark such that Benchmark({Rt}t∈N; T ) corresponds to the cumulative expected reward collected by an optimal agent in {Rt}t∈N over T timesteps. In the context of stationary bandits, the conventional benchmark, known as BenchmarkC, has gained widespread adoption and is fully satisfactory, because BenchmarkC is only slightly better than, and asymptotically equivalent to, the performance of an optimal agent. Thus, BenchmarkC is already capable to measure the sub-optimality of an agent: a small regret indicates that an agent performs well, while a large regret suggests the opposite. However, the existence of non-stationarity poses a significant challenge when using the performance of an optimal agent as our benchmark. This approach, although useful, can complicate the analysis of regret. To address this issue, we aim to construct an alternative benchmark such that the regret is both easy to analyze and capable of effectively evaluating agent performance. To effectively evaluate agent performance in non-stationary bandit learning, a notion of regret is expected to be consistent with the conventional regret used in stationary bandit learning. This consistency ensures that the two notions are equivalent when applied to a stationary bandit {Rt}t∈N. Furthermore, in an intuitively nearly-stationary bandit {R′ t}t∈N that closely resembles {Rt}t∈N, the regret notion should not deviate significantly from the conventional notion in {Rt}t∈N. By maintaining this consistency, we can effectively evaluate agent performance in {R′ t}t∈N. We introduce the following concept of convergence, and formalize this desired property. Definition 6 (Convergence of Bandits). A sequence {{R(k) to a bandit {Rt}t∈N if and only if for all m ∈ N and all sequences (t1, * * * , tm) ∈ Nm, we have t }t∈N}k∈N of bandits converges in distribution P lim k→+∞ (cid:16) {R(k) t }t∈{t1,...,tm} ∈ * = P({Rt}t∈{t1,...,tm} ∈ *). (cid:17) 4 Remark 1. Definition 6 directly follows from the Kolmogorov extension theorem, which ensures that a sufficiently "consistent" set of finite-dimensional distributions can define a stochastic process [41]. Next, we formalize the desired property using convergence of bandits. Definition 7 (Consistency with the Conventional Notion of Regret). We say that a notion of regret Regret, defined with respect to Benchmark, is consistent with the conventional notion, if for all stationary bandits {Rt}t∈N, and for all sequences of bandits {{R(k) t }t∈N}k∈N that converges to {Rt}t∈N, and for all horizon T ∈ N, Benchmark satisfies lim k→+∞ Benchmark R(k) t (cid:18)n t∈N o ; T = BenchmarkC({Rt}t∈N; T ). (cid:19) In the upcoming discussion, we will introduce two commonly used notions of regret: dynamic regret and weak regret. Through illustrative examples, we will demonstrate that these notions of regret do not satisfy the aforementioned desired property-in other words, are not consistent with the conventional notion of regret defined for stationary bandits. 3.2 Issues of Dynamic Regret Dynamic regret RegretD is defined relative to the performance of an oracle who knows some latent variable, which is usually the reward distribution Qt, at each timestep t and acts optimally. We present a formal definition of dynamic regret below, where we take the latent variable at timestep t ∈ N to be Qt. Existing Definition 2 (Dynamic Regret). For all policies π, bandits {Rt}t∈N, and T ∈ N, the dynamic regret is defined as RegretD({Rt}t∈N; T ; π) = BenchmarkD({Rt}t∈N; T ) − E Rt+1,Aπ t , T −1 where BenchmarkD({Rt}t∈N; T ) = distributions. T −1 t=0 P t=0 X E[maxa∈A E[Rt+1,a|Qt+1]], and {Qt}t∈N is a sequence of reward (cid:3) (cid:2) A limitation of dynamic regret is that its performance benchmark can be large. This is because, given past information, it may be challenging, if not impossible, to accurately learn the reward distribution in the previous timestep, let alone the current reward distribution. As a consequence, even a competent agent may exhibit a substantial dynamic regret, rendering this metric ineffective in distinguishing capable agents in certain scenarios. This limitation is particularly pronounced in nearly-stationary bandits, where the dynamic regret can significantly diverge from the conventional notion of regret defined for stationary bandits. Using such cases, we can show that the dynamic regret is inconsistent with the conventional notion of regret defined for stationary bandits. To illustrate this, below we introduce an example. [19, 3] introduce bandits of similar structures. Example 3 (A Modulated Bernoulli Bandit with Independent Actions). Consider a Bernoulli bandit {Rt(q)}t∈N with two independent actions (Definition 3), where θt,1(q) = 0.8 for all t ∈ N and θ1,2(q) is distributed uniformly over the set {0, 1}. The sequence {θt,2(q)}t∈N transitions according to θt+1,2(q) = ∼ unif({0, 1}), with probability q, θt,2(q), otherwise, ( where q ∈ [0, 1] is deterministic. At each timestep t ∈ N, θt,2(q) can be thought of as "redrawn" uniformly from {0, 1} independently with probability q. 5 This example illustrates that the dynamic regret is not consistent with the conventional notion of regret, i.e., the dynamic regret does not satisfy Definition 7. First, for all q ∈ [0, 1], let Qt(q) to be the distribution of two independent Bernoulli random variables with mean θt,1(q) = 0.8 and θt,2(q), respectively. Therefore, {Qt(q)}t∈N is a valid sequence of reward distributions for {Rt(q)}t∈N. Consequently, for all q ∈ [0, 1], the performance benchmark of the dynamic regret BenchmarkD ({Rt(q)}t∈N; T ) = T −1 E t=0 X max a∈A θt+1,a(q) (cid:21) = (cid:20) T −1 t=0 X E [max{0.8, θt+1,2(q)}] = 0.9T. However, if q = 1, the conventional benchmark BenchmarkC({Rt(q)}t∈N; T ) = BenchmarkC({Rt(1)}t∈N; T ) = 0.8T . Thus, Definition 6 does not hold and the dynamic regret is inconsistent with the conventional notion of regret defined for stationary bandits. As a result, an optimal agent incurs a large and linear dynamic regret in bandits where q is close to 1 (nearly-stationary), and the dynamic regret of an optimal agent converges to 0.1T as q → 1. It is worth highlighting that when q = 1, Example 3 is reduced to Example 1, for which the existing definition fails to unambiguously classify. So a definition of non-stationarity that can unambiguously classify bandits can motivate notions of regret that are consistent with the conventional notion. While Example 3 characterizes bandits with abrupt changes, let us consider another example, where the changes are smooth. Bandits of similar structures have been studied by [23, 15, 42, 43, 19, 2]. Example 4 (An AR(1) Bandit with Independent Actions). Consider a Gaussian bandit {Rt(γ)}t∈N with two independent actions (Definition 4), where θt,1 = 0.8 for all t ∈ N and θ1,2 is distributed according to N (0.5, 1). The sequence {θt,2}t∈N transitions according to where γ ∈ [0, 1] is deterministic, and the sequence {Wt}t∈N is i.i.d. N 0.5, 1−γ2 (1−γ)2 . θt+1,2 = γθt,2 + (1 − γ)Wt+1, We can show that for all γ ∈ [0, 1], the benchmark BenchmarkD({Rt(γ)}t∈N; T ) ≈ 1.07T . When γ = 0, Example 4 is reduced to Example 2, and the conventional benchmark BenchmarkC({Rt(0)}t∈N; T ) = 0.8T . Therefore, the dynamic regret is inconsistent with the conventional regret, and an optimal agent incurs a large and linear dynamic regret in a nearly-stationary bandit. (cid:16) (cid:17) 3.3 Issues of Weak Regret Weak regret assesses agent performance relative to the performance of the best single-action policy with respect to the initial reward distribution, that is, the best policy among those that knows the initial reward distribution and selects the same single action at each timestep. We present a formal definition of weak regret below. Existing Definition 3 (Weak Regret). For all policies π, bandits {Rt}t∈N, and T ∈ N, the weak regret is defined as RegretW({Rt}t∈N; T ; π) = BenchmarkW({Rt}t∈N; T ) − E Rt+1,Aπ t , maxa∈A h (cid:16) where BenchmarkW({Rt}t∈N; T ) = T E limH→+∞ 1 H H−1 t=0 (cid:2) E[Rt+1,a|Q1] (cid:3) . A limitation of the weak regret is that its performance benchmark BenchmarkW is conservative, because an optimal policy does not necessarily select the same single action at each timestep. This limitation has been acknowledged in prior work, but to our knowledge, no studies have characterized the degree of conservatism of weak regret, or in which types of bandits this issue arises and why. P We demonstrate that, strikingly, the weak regret is inconsistent with the conventional notion of regret, i.e., does not satisfy Definition 7, resulting in its conservation and ineffectiveness even in nearly-stationary 6 (cid:17)i bandits. To illustrate this, we reconsider Example 3. When q ∈ (0, 1], the performance benchmark of weak regret BenchmarkW ({Rt(q)}t∈N; T ) = T E[max{0.8, 0.5}] = 0.8T. When q = 0, however, the conventional benchmark BenchmarkC ({Rt(q)}t∈N; T ) = BenchmarkC ({Rt(0)}t∈N; T ) = 0.9T . Therefore, the weak regret is inconsistent with the conventional regret. Additionally, an optimal agent incurs a significant and negative linear weak regret in bandits where q is close to 0 (nearly-stationary), and the regret converges to −0.1T as q → 0. We also reconsider Example 4, to illustrate that the weak regret is inconsistent with the conventional notion of regret in bandits with smooth changes. When γ ∈ [0, 1), benchmark BenchmarkW({Rt(γ)}t∈N; T ) = T E[max{0.8, 0.5}] = 0.8T . However, when γ = 1, the conventional benchmark is BenchmarkC({Rt(1)}t∈N; T ) ≈ 1.07T . Therefore, the weak regret is inconsistent with the conventional notion of regret, and an optimal agent can incur a substantial, negative, and linear weak regret in a nearly-stationary bandit. 3.4 Generalization As discussed earlier, Examples 3 and 4 illustrate how dynamic regret and weak regret are inconsistent with the conventional notion of regret defined for stationary bandits. We now demonstrate that these inconsistencies are not limited to those specific examples but exist among a broader set of scenarios. To do so, we introduce a class of Bernoulli bandits and a class of Gaussian bandits, which encompass Examples 3 and 4, respectively. Through our analysis, we reveal that such inconsistencies persist across many sequences of bandits within these classes. We first introduce the two class of bandits. Modulated Bernoulli bandits represents a class of Bernoulli bandits modulated by a Markov chain. Example 5 (Modulated Bernoulli Bandit with Independent Actions). Consider a Bernoulli bandit with independent actions (Definition 3), where for each a ∈ A, the sequence {θt,a}t∈N transitions according to θt+1,a = ∼ P(θ1,a ∈ *), with probability qa, θt,a, otherwise, ( where qa ∈ [0, 1] is deterministic. At each timestep t ∈ N, θt,a can be thought of as "redrawn" from its initial distribution P(θ1,a ∈ *) independently with probability qa. This formulation encompasses stationary Bernoulli bandits and Example 3. When qa = 0 for all a ∈ A, we recover a stationary Bernoulli bandit; when A = {1, 2}, θ1,1 = 0.8, q1 = 0, and θ1,2 ∼ unif({0, 1}), we recover Example 3. Furthermore, this formulation bears a close resemblance to the non-stationary Bernoulli bandits introduced by [19, 3], as well as bandits with "abrupt changes" or "piece-wise stationary" bandits. We next introduce the class of Gaussian bandits. We refer to it as the AR(1) bandits because each bandit is modulated by AR(1) processes. Example 6 (An AR(1) Bandit with Independent Actions). Consider a Gaussian bandit with inde- pendent actions (Definition 4), where for each a ∈ A, the sequence {θt,a}t∈N transitions according to θt+1,a = γaθt,a + (1 − γa)Wt+1,a, where each γa ∈ [0, 1] is deterministic, and the sequence {Wt,a}t∈N is i.i.d. Gaussian random variables with mean E[θ1,a] and variance 1−γ2 (1−γ)2 Var(θ1,a). This formulation encompasses stationary Gaussian bandits and Example 4. When γa = 1 for all a ∈ A, we obtain a stationary Gaussian bandit; when A = {1, 2}, θ1,1 = 0.8, γ1 = 1, and θ1,2 ∼ N (0.5, 1), we 7 recover Example 4. Furthermore, this formulation bears a close resemblance to the non-stationary Gaussian bandits introduced by [23, 15, 42, 43, 19, 2], and represents bandits with "smooth/continuous changes." We now present Theorem 1, which establishes that both the dynamic regret and the weak regret are inconsistent with the conventional notion of regret defined for stationary bandits, using modulated Bernoulli bandits and AR(1) bandits. Theorem 1. (Inconsistencies of Dynamic Regret and Weak Regret with the Conventional No- tion of Regret). Suppose B is a set of modulated Bernoulli bandits (resp. AR(1) bandits) with the same P(θ1,a ∈ *) across bandits for all a ∈ A. Then, for all sequences of bandits in B, where the k-th bandit is denoted by {R(k) t }t∈N and determined by q(k) a ), we have (resp. γ(k) a 1. if limk→+∞ q(k) a = 1 (resp. a = 0) for all a ∈ A, then there exists a stationary bandit {Rt}t∈N such that the sequence of bandits converges to {Rt}t∈N, and for all T ∈ N, the performance benchmark of dynamic regret satisfies limk→+∞ γ(k) lim k→+∞ BenchmarkD R(k) t (cid:18)n ; T − BenchmarkC({Rt}t∈N; T ) = T E max a∈A θ1,a − max a∈A (cid:21) E[θ1,a] ; (cid:19) (cid:18) (cid:20) 2. if limk→+∞ q(k) a = 0 (resp. a = 1) for all a ∈ A, then there exists a stationary bandit {Rt}t∈N such that the sequence of bandits converges to {Rt}t∈N, and for all T ∈ N, the performance benchmark of weak regret satisifies t∈N (cid:19) o limk→+∞ γ(k) lim k→+∞ BenchmarkW R(k) t t∈N ; T − BenchmarkC({Rt}t∈N; T ) = −T E max a∈A θ1,a − max a∈A E[θ1,a] . o (cid:18)n (cid:19) It is important to highlight that E[maxa∈A θ1,a] − maxa∈A E[θ1,a] ≥ 0 due to Jensen's inequality, and the inequality is typically strict. For instance, the inequality is strict when P(maxa∈A−a⋆ θ1,a > θ1,a⋆ ) > 0, where a⋆ ∈ arg maxa∈A E[θ1,a], and A − a⋆ denotes the set of all actions excluding a⋆. This condition is satisfied, for example, when all θ1,a's have the same non-atomic support. (cid:18) (cid:19) (cid:20) (cid:21) Therefore, Theorem 1 reveals that inconsistencies in notions of regret can be prevalent in various Bernoulli and Gaussian bandits; by applying the theorem to Examples 3 and 4, we can specifically identify the inconsistencies in those examples. It is worth noting that Bernoulli and Gaussian bandits are among the most widely studied bandits in the literature, and that modulated Bernoulli bandits and AR(1) bandits resemble the bandits introduced by [23, 15, 42, 43, 19, 3, 2], as well as others such as bandits with "abrupt changes" or "piece-wise stationary" bandits, or bandits with "smooth changes." These findings suggest that the observed inconsistencies are of a general nature. 4 Issues in Agent Design This section discusses issues that arise in designing agents for non-stationary bandits. 4.1 Desired Properties of Agent Design A number of non-stationary bandit learning algorithms [22, 44, 45, 25, 26, 28, 13, 14, 15, 30, 46, 34, 16, 47, 17, 18, 48, 35, 37, 39] have been developed, drawing from traditional stationary bandit learning algorithms such as TS, Upper-Confidence Bounds (UCB) [49, 10], or Exponential-weight algorithms (EXP3) [50, 51]. These non-stationary variants improve upon the traditional algorithms by incorporating heuristics such as maintaining a sliding-window, discounting past rewards, periodic restart, or detecting change-points. In designing an algorithm for non-stationary bandits, it is desirable for the algorithm to perform well in stationary bandits as well. Thus, the algorithm does not sacrifice its performance in stationary bandits to gain advantages in non-stationary ones. Specifically, for a non-stationary variant π′, it is desirable for it to be consistent with its stationary counterpart π. This consistency ensures that the two policies are 8 equivalent when applied to a stationary bandit {Rt}t∈N. Furthermore, in an intuitively nearly-stationary bandit {R′ t}t∈N that closely resembles {Rt}t∈N, π′ should not deviate substantially from π. By maintaining this consistency, π′ is effective in {Rt}t∈N and {R′ t}t∈N. Below we formalize the desired property using the convergence of bandits (Definition 6). According to Definition 8, a desired property of a non-stationary bandit learning algorithm π′ that is designed based on a stationary bandit learning algorithm π is for π′ to be consistent with π. Definition 8 (Consistency of Policies). We say that policy π′ is consistent with policy π if for all stationary bandits {Rt}t∈N, all sequences of bandits {{R(k) t }t∈N}k∈N that converges to {Rt}t∈N, and all horizon T ∈ N, we have lim k→+∞ T −1 E t=0 X h R(k) t+1,Aπ′ t T −1 = E[Rt+1,Aπ t ]. i t=0 X 4.2 Issues in Agent Design Taking some non-stationary variants of TS [13, 14, 3, 16, 17, 18] as examples, we discuss how various non- stationary bandit learning algorithms are inconsistent with their stationary counterparts. To illustrate this, again, we consider Example 3. At each timestep t ∈ N, a non-stationary variant of TS estimates the posterior P(θt,a(q) ∈ *|Ht) using heuristics such as maintaining a sliding-window, discounting past rewards, periodic restart, or detecting change-points. It then samples ˆθt,a(q) from the estimated posterior ˆP(θt,a(q) ∈ *|Ht) and selects an action that maximizes the sample At ∈ arg maxa∈{1,2} ˆθt,a(q). In Example 3, since θt,1(q) = 0.8 is deterministic, i.e., known, ˆθt,1(q) = 0.8. For all q ∈ [0, 1], the estimated posterior ˆP(θt,2(q) ∈ *|Ht) places at least 0.5q mass on 1. Therefore, an aforementioned non- stationary variant of TS selects action 2 with at least 0.5q probability at each timestep. In contrast, if q = 1, TS selects action 2 with probability 0 at each timestep. Thus, an aforementioned non-stationary variant of TS is inconsistent with TS, i.e., does not satisfy Definition 8. This inconsistency also implies that the non-stationary variants excessively explore by selecting action 2 with a large probability in nearly-stationary bandits (q close to 1). We also consider Example 4 as a second example where variants of TS are inconsistent with TS and over- explore in certain non-stationary bandits. If γ = 0, TS selects action 2 with probability 0 at each timestep. However, for all γ ∈ [0, 1], the estimated posterior at initial timestep is ˆP(θ1,2(γ) ∈ *) = P(θ1,2(γ) ∈ *) ∼ N (0.5, 1), and a variant of TS selects action 2 with probability ≈ 0.38. This inconsistency suggests that these non-stationary variants of TS over-explore in certain cases. 5 A Formal Definition of Non-Stationary Bandits In this section, we provide a formal definition of non-stationarity that can unambiguously classify bandits. We discuss the rationale behind our definition: if two bandits offer an agent indistinguishable experiences, then they should be consistently classified as either both stationary or both non-stationary. Our definition applies seamlessly to bandits in the frequentist formulation as well, enabling unified understanding of non- stationarity. 5.1 Our Definition We first introduce stationary bandits, followed by non-stationary bandits. Definition 9 (Stationary Bandit). A bandit {Rt}t∈N is stationary if, for all horizon T ∈ N, all sequences of actions {ak}k∈[T ], and all sequences of distinct timesteps {tk}k∈[T ] and {t′ k}k∈[T ], the sequences of rewards {Rtk,ak }k∈[T ] and {Rt′ k,ak }k∈[T ] are equal in distribution. 9 Definition 10 (Non-Stationary Bandit). A bandit is non-stationary if it is not stationary. In other words, in a stationary bandit, the distribution of a sequence of rewards associated with distinct timesteps and a particular action sequence depends on only the action sequence but not the timesteps; in a non-stationary bandit, the distribution can depend on the timesteps. Notably, our definitions do not depend on a notion of reward distribution, and thus they resolve the ambiguity that arises in classifying bandits. For example, observe that in Example 1, the distribution of the sequence of rewards {Rtk,ak }k∈[T ] is the joint distribution of independent Bernoulli random variables, each with mean 0.8 if ak = 1 and 0.5 if ak = 2. In Example 2 the sequence of rewards {Rtk,ak }k∈[T ] is the joint distribution of independent Gaussian random variables, each with mean 0.8 if ak = 1 and 0.5 if ak = 2, and variance 1. These distributions do not depend on the timesteps {tk}k∈[T ]. Thus, by Definition 10, Examples 1 and 2 are unambiguously identified as stationary. 5.2 Consistent Classification under Indistinguishable Experiences An alternative approach to defining non-stationary bandits is to consider those for which there does not exist a sequence of "reward distributions" that does not change over time. This is equivalent to defining non-stationary bandits as those for which the reward sequence is not exchangeable, by deFinetti's theorem. This alternative definition also addresses the ambiguity in classifying bandits; for example, Examples 1 and 2 are both stationary under this definition. However, we demonstrate that this alternative definition cannot consistently classify two bandits that offer an agent indistinguishable experiences as both stationary or both non-stationary, whereas our defini- tion achieves this. Before formally defining indistinguishable experiences, we illustrate this using examples. Consider two Bernoulli bandits, both determined by the same sequences {Ut,a}t∈N of i.i.d. uniform random variables over [0, 1], for a ∈ A. . Example 7 (A Bernoulli Bandit with Independent Noises). Consider a Bernoulli bandit {Rind for which Rind t,a = 1{Ut,a < 0.5} for all t ∈ N and a ∈ A. t }t∈N Example 8 (A Bernoulli Bandit with Dependent Noises). Fix some a ∈ A. Consider a Bernoulli bandit {Rdep t,a = 1{Ut,a < 0.5} for all even t ∈ N and a ∈ A. t,a = 1{Ut,a < 0.5} for all odd t ∈ N and a ∈ A, and Rdep t }t∈N, where Rdep If we interpret each reward Rt,a as a noisy realization of 0.5, then Example 7 describes a bandit where the noises are always independent across actions, and Example 8 describes a bandit where the noises are independent across actions at odd timesteps and dependent at even timesteps. Note that an agent only observes the reward associated with the action it takes at each timestep, not those of the other actions. Therefore, the dependence structure of the noises across actions is irrelevant to an agent's experience, and Examples 7 and 8 offer indistinguishable experiences to an agent. We believe that two bandits providing indistinguishable experiences should be classified as both stationary or both non-stationary. We would unequivocally all agree that Example 7 should be classified as stationary, and both our definition and the alternative definition would correctly classify it. As for Example 8, our definition desirably classifies it as stationary, because the reward sequence {Rtk,ak }k∈[T ] is a sequence of i.i.d. Bernoulli(0.5) random variables. In contrast, the alternative definition classifies the bandit as non-stationary because the sequence of rewards is not exchangeable. Our definition consistently classifies Examples 7 and 8 while the alternative one does not. 5.3 A Formal Definition of Indistinguishable Experiences As previously discussed, we believe that two bandits providing an agent with indistinguishable experiences should be classified as either both stationary or both non-stationary. To demonstrate how our definition meets this criterion beyond Examples 7 and 8, we introduce a binary relation on the set of all banadits that formalizes the concept of indistinguishable experience. 10 We introduce some useful notations followed by the binary relation. We use Aπ→R to denote the action selected by an agent at timestep t ∈ N when executing π in a bandit environment {Rt}t∈N, and use H π→R to denote the corresponding history generated at timestep t ∈ N. t t Definition 11 (Equivalence Relation ∼). Let {Rt}t∈N and {R′ {R′ t}t∈N if, for all policies π and T ∈ N, H π→R and H π→R′ T T equal in distribution. t}t∈N be two bandits. We say {Rt}t∈N ∼ This relation ∼ is an equivalence relation, since it is reflexive, symmetric, and transitive. When two bandit environments {Rt}t∈N ∼ {R′ t}t∈N, we say that they are equivalent. By Definition 1, two bandits are equivalent if interacting with each of them provides an agent the same distribution over histories. This is what we refer to as indistinguishable experience. We next present Theorem 2, which establishes that our definition of non-stationarity, i.e., Definition 10, would classify two equivalent bandits as both stationary or both non-stationary. Theorem 2. (Equivalent Bandits Have the Same Non-Stationarity). {R′ t}t∈N, then bandit {Rt}t∈N is non-stationary if and only if bandit {R′ t}t∈N is non-stationary. If two bandits {Rt}t∈N ∼ The proof of Theorem 2, and the proofs of other technical results can be found in the Appendix. 5.4 Relation to Exchangeability of the Reward Sequence Exploring the relationship between our definition of non-stationary bandits and the alternative definition involving the exchangeability of the reward sequence can provide interesting insights. In this regard, we present Theorem 3, which establishes that a bandit is stationary if and only if the experience it provides to an agent is indistinguishable from that provided by a bandit where the sequence of rewards is exchangeable. Theorem 3. (Necessary and Sufficient Condition for Stationarity). A bandit {Rt}t∈N is stationary t}t∈N such that {Rt}t∈N ∼ {R′ if and only if there exists a bandit {R′ t}t∈N and that the sequence of rewards {R′ t}t∈N is exchangeable. 5.5 Equivalence Classes and Strongly Stationary Bandits Equivalence relation ∼ partitions the set of all bandits into distinct equivalence classes: two bandits belong to the same class if and only if they are equivalent. By Theorem 2, the bandits in each class are either all stationary or all non-stationary. Although any bandit can represent its own class, it is an intriguing theoretical pursuit to identify more natural representatives for the classes comprising stationary bandits. For this purpose, we introduce strongly stationary bandits. Definition 12 (Strongly Stationary Bandit). A stationary bandit is strongly stationary if for all T ∈ N, {Rt}t∈[T ] and {(Rn|A|+1,1, Rn|A|+2,1, ..., Rn|A|+|A|,|A|)}n∈[T ] equal in distribution. Note that, in a strongly stationary bandit {Rt}t∈N, the sequence of rewards is exchangeable. Because {Rt}t∈N is stationary, the sequence of |A|-tuples {(Rn|A|+1,1, Rn|A|+2,2, ..., Rn|A|+|A|,|A|)}n∈N0 is exchange- able. In addition, {Rt}t∈N is strongly stationary, so by Definition 12, the sequence {Rt}t∈N is exchangeable. Theorem 4 characterizes the equivalence classes of stationary bandits and their relation to strongly It establishes that each equivalence class of stationary bandits contains at least one stationary bandits. strongly stationary bandit. Furthermore, if two strongly stationary bandits, {Rt}t∈N and {R′ t}t∈N, belong to the same class, their sequences of rewards have the same distribution. This result makes strongly stationary bandits natural representatives of the equivalence classes of stationary bandits. Theorem 4. (Landscape of Bandit Environments). A bandit {Rt}t∈N is stationary if and only if it is equivalent to a strongly stationary bandit; two strongly stationary bandits are equivalent if and only if for all T ∈ N, {Rt}t∈[T ] and {R′ t}t∈[T ] equal in distribution. 11 5.6 Application to Frequentist Setting This subsection explores the application of our definition of non-stationarity to a bandit under a frequentist formulation. To begin, we introduce a formal definition of a bandit under a frequentist formulation. The definition is adapted from the definition of a bandit with oblivious adversary [20] and the definition of a stationary bandit [52]. Definition 13 (Bandit, Frequentist). A bandit with a finite action set A is a set Q of infinite sequences of distributions, each over R|A|. For all q = (q1, q2, ...) ∈ Q, the corresponding sequence of rewards R1:+∞ is independent, and each Rt is distributed according to distribution qt. By putting a prior distribution over the set Q, we can construct a bandit {Rt}t∈N under the Bayesian formulation. Applying our definition of non-stationarity, a bandit Q under the frequentist formulation is stationary if and only if for any prior distribution ν over the set Q, the bandit {Rt}t∈N under a Bayesian formulation that is constructed by putting ν over Q is stationary. To gain insights into this, we introduce two bandits under the frequentist formulation. Example 9 (A Bandit, Frequentist). Let Q be a bandit, where for all q ∈ Q, i, j ∈ N, qi = qj. Example 9 is stationary, because for any bandit {Rt}t∈N under a Bayesian formulation that is constructed by putting a prior over Q, the sequence of rewards is exchageable. Example 10 (A Bernoulli Bandit with Dependent Noises, Frequentist). Consider a bandit Q = {q}, where q = (q1, q2, * * * ) and qt is the distribution of Rt in Example 8. Example 10 is stationary. Although q1 6= q2, this bandit and a different bandit Q′ = {q′} where q′ 1 = q′ 2 = * * * = q1 offer indistinguishable experience to an agent. In summary, we can apply our definition of non-stationarity to classify bandits under a frequentist formulation. Example 9 is classified as stationary. Some other bandits, e.g. Example 10, are also considered stationary. 6 Examples of Notion of Regret, Agent Design, and More Our formal definition of non-stationarity significantly improves our understanding of non-stationary bandit learning. It not only resolves the ambiguity that arise in classifying bandits but can also facilitate the development of regret notions and agent designs that align with conventional notions and stationary bandit learning algorithms, respectively. This section provides examples that highlight these developments. Since conventional notions and algorithms are designed only for bandits where reward sequence is exchangeable, we restrict our attention to such bandits when discussing consistency. Notion of Regret We first introduce a notion of regret, with respect to any stochastic process χ. Definition 14 (Regret). For all bandits {Rt}t∈N, stochastic processes χ = {χt}t∈N, policies π and T ∈ N, the regret of π with respect to χ is defined as Regretχ({Rt}t∈N; T ; π) = Benchmarkχ({Rt}t∈N; T ) − T −1 E Rt+1,Aπ t , t=0 X (cid:2) (cid:3) where Benchmarkχ({Rt}t∈N; T ) = T −1 t=0 E[maxa∈A E[Rt+1,a|χt]]. Our notion of regret is flexible and encompasses various existing definitions. For instance, it is equivalent to dynamic regret [44, 45, 26, 28, 15, 3, 5, 16, 2] if we set χt to be the reward distribution at timestep t + 1. Furthermore, our notion is equivalent to a regret introduced by [19] if we set χt = R1:t. P 12 This notion also already encompasses definitions that are consistent with the conventional notion of regret, and provides room for further exploration and refinement. We highlight one such definition: for any bandit {Rt}t∈N, let χt = R−∞:t. The negative-indexed rewards are constructed by extending the bandit if the reward sequence is reversible, and are constructed arbitrarily otherwise. This is intuitively consistent with the conventional notion: in a stationary bandit with exchangeable rewards, E[Rt+1|R−∞:t] = E[Rt+1|P ], where P is the invariant reward distribution, i.e., the rewards are i.i.d. according to P , conditioned on P . Agent Design Predictive sampling (PS), an algorithm introduced by [19], samples at each timestep t the sequence of future rewards Rt+2:+∞, assuming that the sample is the true future rewards, and acts optimally. PS is proven to be equivalent to TS in stationary bandits with exchangeable rewards. Regret Analysis To demonstrate the effectiveness of the introduced notion of regret in evaluating agent performance, we conduct an information-theoretic regret analysis [53, 54, 55, 56, 57, 11, 58, 59, 60]. This analysis builds upon and directly extends the work of [19]; it applies to any agent and any bandit-stationary or non-stationary. We provide details in the Appendix. 7 Conclusion This paper introduces a formal definition of non-stationary bandits that umambiguously classify bandits. This definition applies seamlessly to bandits under both Bayesian and frequentist formulations. In addition, we identify inconsistencies and ineffectiveness in some widely-used notions of regret, such as the dynamic regret and weak regret, as well as popular non-stationary bandit learning algorithms, including several variants of TS. These notions of regret and algorithms, similarly to the existing definitions of non-stationary bandits, also exhibit dependence on a latent sequence, and are thus ineffective. Our definition of non- stationary bandits enhances our understanding of non-stationary bandits and serves as a foundation for future development of more effective notions of regret and algorithms that align with their stationary counterparts. Acknowledgement This work is partially supported by Army Research Office (ARO) grant W911NF2010055, the MS&E Fel- lowship Fund of Stanford University, and Statistics for Improving Insights, Models, and Decisions Grant of Meta. References [1] Peter Whittle. Restless bandits: Activity allocation in a changing world. Journal of applied probability, 25(A):287–298, 1988. [2] Aleksandrs Slivkins and Eli Upfal. Adapting to a changing environment: the Brownian restless bandits. In Conference on Learning Theory, pages 343–354, 2008. [3] Joseph Mellor and Jonathan Shapiro. Thompson sampling in switching environments with bayesian online change detection. In Artificial Intelligence and Statistics, pages 442–450. PMLR, 2013. [4] Ilija Bogunovic, Jonathan Scarlett, and Volkan Cevher. Time-varying Gaussian process bandit optimization. In Artificial Intelligence and Statistics, pages 314–323. PMLR, 2016. [5] Seungki Min and Daniel Russo. An information-theoretic analysis of nonstationary bandit learning. In Interna- tional Conference on Machine Learning, pages 38768–38800. PMLR, 2023. [6] Venkatachalam Anantharam, Pravin Varaiya, and Jean Walrand. Asymptotically efficient allocation rules for the multiarmed bandit problem with multiple plays-part ii: Markovian rewards. IEEE Transactions on Automatic Control, 32(11):977–982, 1987. 13 [7] Haoyang Liu, Keqin Liu, and Qing Zhao. Logarithmic weak regret of non-bayesian restless multi-armed bandit. In 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 1968–1971. IEEE, 2011. [8] Haoyang Liu, Keqin Liu, and Qing Zhao. Learning in a changing world: Restless multiarmed bandit with unknown dynamics. IEEE Transactions on Information Theory, 59(3):1902–1916, 2012. [9] Cem Tekin and Mingyan Liu. Online learning of rested and restless bandits. IEEE Transactions on Information Theory, 58(8):5588–5611, 2012. [10] TL Lai and Herbert Robbins. Asymptotically efficient adaptive allocation rules. Advances in Applied Mathe- matics, 6(1):4–22, 1985. [11] Gergely Neu, Iuliia Olkhovskaia, Matteo Papini, and Ludovic Schwartz. Lifting the information ratio: An information-theoretic analysis of thompson sampling for contextual bandits. Advances in Neural Information Processing Systems, 35:9486–9498, 2022. [12] William R. Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3/4):285–294, 1933. [13] Gourab Ghatak. A change-detection-based Thompson sampling framework for non-stationary bandits. IEEE Transactions on Computers, 70(10):1670–1676, 2021. [14] Gourab Ghatak, Hardhik Mohanty, and Aniq Ur Rahman. Kolmogorov–Smirnov test-based actively-adaptive thompson sampling for non-stationary bandits. IEEE Transactions on Artificial Intelligence, 3(1):11–19, 2021. [15] Neha Gupta, Ole-Christoffer Granmo, and Ashok Agrawala. Thompson sampling for dynamic multi-armed bandits. In 2011 10th International Conference on Machine Learning and Applications and Workshops, volume 1, pages 484–489. IEEE, 2011. [16] Vishnu Raj and Sheetal Kalyani. Taming non-stationary bandits: A Bayesian approach. arXiv preprint arXiv:1707.09727, 2017. [17] Francesco Trovo, Stefano Paladino, Marcello Restelli, and Nicola Gatti. Sliding-window Thompson sampling for non-stationary settings. Journal of Artificial Intelligence Research, 68:311–364, 2020. [18] Paolo Viappiani. Thompson sampling for bayesian bandits with resets. In International Conference on Algo- rithmic Decision Theory, pages 399–410. Springer, 2013. [19] Yueyang Liu, Xu Kuang, and Benjamin Van Roy. Nonstationary bandit learning via predictive sampling. In International Conference on Artificial Intelligence and Statistics, pages 6215–6244. PMLR, 2023. [20] Aleksandrs Slivkins. 12(1-2):1–286, 2019. Introduction to multi-armed bandits. Foundations and Trends® in Machine Learning, [21] Yasin Abbasi-Yadkori, Andras Gyorgy, and Nevena Lazic. A new look at dynamic regret for non-stationary stochastic bandits. arXiv preprint arXiv:2201.06532, 2022. [22] Peter Auer, Pratik Gajane, and Ronald Ortner. Adaptively tracking the best arm with an unknown number of distribution changes. In European Workshop on Reinforcement Learning, volume 14, page 375, 2018. [23] Giuseppe Burtini, Jason L. Loeppky, and Ramon Lawrence. Improving online marketing experiments with drifting multi-armed bandits. In ICEIS (1), pages 630–636, 2015. [24] Yang Cao, Zheng Wen, Branislav Kveton, and Yao Xie. Nearly optimal adaptive procedure with change detection for piecewise-stationary bandit. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 418–427. PMLR, 2019. [25] Yifang Chen, Chung-Wei Lee, Haipeng Luo, and Chen-Yu Wei. A new algorithm for non-stationary contextual bandits: Efficient, optimal and parameter-free. In Conference on Learning Theory, pages 696–726. PMLR, 2019. 14 [26] Wang Chi Cheung, David Simchi-Levi, and Ruihao Zhu. Learning to optimize under non-stationarity. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 1079–1087. PMLR, 2019. [27] Giuseppe Di Benedetto, Vito Bellini, and Giovanni Zappella. A linear bandit for seasonal environments. arXiv preprint arXiv:2004.13576, 2020. [28] Aur ́elien Garivier and Eric Moulines. On upper-confidence bound policies for non-stationary bandit problems. arXiv preprint arXiv:0805.3415, 2008. [29] Sudipto Guha, Kamesh Munagala, and Peng Shi. Approximation algorithms for restless bandit problems. Journal of the ACM (JACM), 58(1):1–50, 2010. [30] C ́edric Hartland, Nicolas Baskiotis, Sylvain Gelly, Michele Sebag, and Olivier Teytaud. Change point detection and meta-bandits for online learning in dynamic environments. In CAp 2007: 9`e Conf ́erence francophone sur l'apprentissage automatique, pages 237–250, 2007. [31] Su Jia, Qian Xie, Nathan Kallus, and Peter I. Frazier. Smooth non-stationary bandits. arXiv preprint arXiv:2301.12366, 2023. [32] Young Hun Jung and Ambuj Tewari. Regret bounds for Thompson sampling in episodic restless bandit problems. Advances in Neural Information Processing Systems, 32, 2019. [33] Fang Liu, Joohyun Lee, and Ness Shroff. A change-detection based framework for piecewise-stationary multi- armed bandit problem. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. [34] Haipeng Luo, Chen-Yu Wei, Alekh Agarwal, and John Langford. Efficient contextual bandits in non-stationary worlds. In Conference On Learning Theory, pages 1739–1776. PMLR, 2018. [35] Lai Wei and Vaibhav Srivatsva. On abruptly-changing and slowly-varying multiarmed bandit problems. In 2018 Annual American Control Conference (ACC), pages 6291–6296. IEEE, 2018. [36] Qingyun Wu, Naveen Iyer, and Hongning Wang. Learning contextual bandits in a non-stationary environment. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pages 495–504, 2018. [37] Jia Yuan Yu and Shie Mannor. Piecewise-stationary bandit problems with side observations. In International Conference on Machine Learning, pages 1177–1184. PMLR, 2009. [38] Yunbei Xu and Assaf Zeevi. Bayesian design principles for frequentist sequential learning. In International Conference on Machine Learning, pages 38768–38800. PMLR, 2023. [39] Peng Zhao, Lijun Zhang, Yuan Jiang, and Zhi-Hua Zhou. A simple approach for non-stationary linear bandits. In International Conference on Artificial Intelligence and Statistics, pages 746–755. PMLR, 2020. [40] Xiang Zhou, Yi Xiong, Ningyuan Chen, and Xuefeng Gao. Regime switching bandits. Advances in Neural Information Processing Systems, 34:4542–4554, 2021. [41] Ernest G Kimme. On the convergence of sequences of stochastic processes. Transactions of the American Mathematical Society, 84(1):208–229, 1957. [42] Julia Kuhn, Michel Mandjes, and Yoni Nazarathy. Exploration vs exploitation with partially observable Gaussian autoregressive arms. EAI Endorsed Transactions on Self-Adaptive Systems, 1(4), 2 2015. [43] Julia Kuhn and Yoni Nazarathy. Wireless channel selection with reward-observing restless multi-armed bandits. Chapter to appear in "Markov Decision Processes in Practice", Editors: R. Boucherie and N. van Dijk, 2015. [44] Omar Besbes, Yonatan Gur, and Assaf Zeevi. Optimal exploration-exploitation in a multi-armed-bandit problem with non-stationary rewards. Stochastic Systems, 9(4):319–337, 2019. [45] Lilian Besson and Emilie Kaufmann. The generalized likelihood ratio test meets KLUCB: an improved algorithm for piece-wise non-stationary bandits. Proceedings of Machine Learning Research vol XX, 1:35, 2019. 15 [46] Levente Kocsis and Csaba Szepesv ́ari. Discounted UCB. In 2nd PASCAL Challenges Workshop, volume 2, pages 51–134, 2006. [47] Yoan Russac, Claire Vernade, and Olivier Capp ́e. Weighted linear bandits for non-stationary environments. Advances in Neural Information Processing Systems, 32, 2019. [48] Chen-Yu Wei and Haipeng Luo. Non-stationary reinforcement learning without prior knowledge: An optimal black-box approach. In Conference on Learning Theory, pages 4300–4354. PMLR, 2021. [49] Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2):235–256, 2002. [50] Peter Auer, Nicolo Cesa-Bianchi, Yoav Freund, and Robert E Schapire. The nonstochastic multiarmed bandit problem. SIAM journal on computing, 32(1):48–77, 2002. [51] Nicolo Cesa-Bianchi and G ́abor Lugosi. Prediction, learning, and games. Cambridge university press, 2006. [52] Tor Lattimore and Csaba Szepesv ́ari. Bandit algorithms. Cambridge University Press, 2020. [53] S ́ebastien Bubeck, Ofer Dekel, Tomer Koren, and Yuval Peres. Bandit convex optimization:√T regret in one dimension. In Conference on Learning Theory, pages 266–278. PMLR, 2015. [54] Shi Dong and Benjamin Van Roy. An information-theoretic analysis for Thompson sampling with many actions. Advances in Neural Information Processing Systems, 31, 2018. [55] Botao Hao, Tor Lattimore, and Chao Qin. Contextual information-directed sampling. In International Confer- ence on Machine Learning, pages 8446–8464. PMLR, 2022. [56] Tor Lattimore and Csaba Szepesv ́ari. An information-theoretic approach to minimax regret in partial monitoring. In Conference on Learning Theory, pages 2111–2139. PMLR, 2019. [57] Xiuyuan Lu, Benjamin Van Roy, Vikranth Dwaracherla, Morteza Ibrahimi, Ian Osband, Zheng Wen, et al. Reinforcement learning, bit by bit. Foundations and Trends® in Machine Learning, 16(6):733–865, 2023. [58] Daniel Russo and Benjamin Van Roy. Learning to optimize via posterior sampling. Mathematics of Operations Research, 39(4), 2014. [59] Daniel Russo and Benjamin Van Roy. An information-theoretic analysis of thompson sampling. The Journal of Machine Learning Research, 17(1):2442–2471, 2016. [60] Daniel Russo and Benjamin Van Roy. Learning to optimize via information-directed sampling. Operations Research, 66(1):230–252, 2018. A Organization of the Appendix We organize the appendix as follows: • The proof of Theorem 1 is given in Section B. • The proof of Theorem 2 is given in Section C. • The proof of Theorem 3 is given in Section D. • The proof of Theorem 4 is given in Section E. • A regret analysis is provided in Section F. 16 B Proof of Theorem 1 Theorem 1. (Inconsistencies of Dynamic Regret and Weak Regret with the Conventional Notion of ) across Regret). Suppose bandits for all a t∈N and determined by q(k) is a set of modulated Bernoulli bandits (resp. AR(1) bandits) with the same P(θ1,a . Then, for all sequences of bandits in , where the k-th bandit is denoted by ∈ * R(k) t } { B ∈ A B a 1. if limk→+∞ q(k) (resp. γ(k) a ), we have a = 1 (resp. limk→+∞ γ(k) that the sequence of bandits converges to regret satisfies a = 0) for all a ∈ A , then there exists a stationary bandit t∈N such } N, the performance benchmark of dynamic Rt { Rt { t∈N, and for all T } ∈ R0 t (cid:17) t∈N ; T (cid:16)(cid:8) (cid:9) a > 0 (resp. γ′ R1 t } { R1 t t∈N ; T t∈N: (cid:16)(cid:8) (cid:9) (cid:17) lim k→+∞ BenchmarkD R(k) t (cid:18)n ; T (cid:19) − ot∈N BenchmarkC( Rt { t∈N; T ) = T } E (cid:18) max a∈A (cid:20) θ1,a (cid:21) − max a∈A E[θ1,a] (cid:19) ; 2. if limk→+∞ q(k) a = 0 (resp. limk→+∞ γ(k) that the sequence of bandits converges to satisifies a = 1) for all a Rt { t∈N, and for all T } ∈ ∈ A , then there exists a stationary bandit t∈N such } N, the performance benchmark of weak regret Rt { lim k→+∞ BenchmarkW R(k) t (cid:18)n ; T (cid:19) − ot∈N BenchmarkC( Rt { t∈N; T ) = } T − E (cid:18) max a∈A (cid:20) θ1,a (cid:21) − max a∈A E[θ1,a] (cid:19) . Proof. In the set (resp. γa = 1) for all a Then for all bandits B conventional regret in , and ∈ A R′ t∈N t} { R0 t∈N: t } { , the bandits only differ by qa's (resp. γa's). We use t∈N to denote the bandit where qa = 0 t∈N to denote the bandit where qa = 1 (resp. γa = 0) for all a R1 t } { , the performance benchmark of the dynamic regret is equivalent to that of the ∈ B . ∈ A R0 t } { BenchmarkD R′ t t∈N ; T (cid:9) (cid:17) (cid:16)(cid:8) = BenchmarkC For all bandits the weak regret is equivalent to that of the conventional regret in , determined by q′ a (resp. γ′ R′ t} { a), if q′ ∈ B t∈N = T E max a∈A (cid:20) θ1,a . (cid:21) (1) a < 1), the performance benchmark of BenchmarkW R′ t (cid:9) (cid:16)(cid:8) t∈N ; T (cid:17) = BenchmarkC = T max a∈A E[θ1,a]. (2) 1 (resp. γ(k) Therefore, if q(k) a sequence of bandits converges to → a 0) for all a t∈N, and for all T ∈ A , then there exists a stationary bandit t∈N such that the N, the performance benchmark of dynamic regret R1 t } { → R1 t } { ∈ lim k→+∞ BenchmarkD = BenchmarkC R0 t R(k) t (cid:18)n t∈N ; T = T E (cid:18) max a∈A (cid:20) (cid:16)(cid:8) θ1,a (cid:21) − (cid:17) − E[θ1,a] (cid:9) max a∈A , (cid:19) ; T (cid:19) − ot∈N BenchmarkC R1 t t∈N ; T (cid:9) (cid:17) BenchmarkC R1 t (cid:9) (cid:16)(cid:8) (cid:16)(cid:8) t∈N ; T (cid:17) where the first equality follows from (1). In addition, if q(k) a the sequence of bandits converges to → 0 (resp. γ(k) a → R0 t } { 1) for all a ∈ A t∈N, and for all T , then there exists a stationary bandit t∈N such that N, the performance benchmark of weak regret R0 t } { ∈ ; T lim k→+∞ BenchmarkW = BenchmarkC R(k) t (cid:18)n t∈N ; T ot∈N (cid:19) − BenchmarkC BenchmarkC R0 t (cid:16)(cid:8) t∈N ; T (cid:17) R0 t (cid:9) (cid:16)(cid:8) t∈N ; T (cid:9) (cid:17) R1 t (cid:9) (cid:16)(cid:8) θ1,a (cid:17) − E[θ1,a] , (cid:19) = T E (cid:18) − max a∈A (cid:20) max a∈A (cid:21) − where the first equality follows from (2). 17 C Proof of Theorem 2 Rt { Proof. Let T timesteps. Theorem 2. (Equivalent Bandits Have the Same Non-Stationarity). If two bandits then bandit t∈N is non-stationary. t∈N is non-stationary if and only if bandit } R′ t} { Rt { t∈N } R′ t} t∈N, ∼ { N, and ∈ ak { }k∈[T ] be a sequence of actions, and Now consider a policy π that executes a deterministic action ak at timestep tk for k R′ t} that executes a deterministic action ak at timestep t′ H π→R′ have the same distribution; so do H π′→R [T ]. Since Rt { . Therefore, k for k ∈ and H π′→R′ }k∈[T ] and ∼ { tk { t∈N } T T T t′ k}k∈[T ] be sequences of distinct { [T ], and another policy π′ and ∈ t∈N, the histories H π→R T P and P (cid:16){ Rtk,ak }k∈[T ] ∈ *(cid:17) Rt′ k,ak R′ tk,ak = P (cid:16)(cid:8) , k∈[T ] ∈ *(cid:17) (cid:9) = P R′ t′ k,ak . (cid:18)n ok∈[T ] ∈ *(cid:19) ok∈[T ] ∈ *(cid:19) Rt′ Rtk ,ak }k∈[T ] and t∈N, the reward sequences { { } R′ R′ tk ,ak }k∈[T ] and k ,ak }k∈[T ] are equal in distribution. t′ { { (cid:18)n k,ak }k∈[T ] are equal in distri- (3) In addition, by the stationarity of bution. Combining with (3), we have that Rt { D Proof of Theorem 3 We first establish Lemma 1, which provides a necessary and sufficient condition for two bandits to be equivalent; it is also key to the proof of Theorem 3. We present the lemma followed by its proof. Lemma 1 (Necessary and Sufficient Condition for Equivalence). Let with the same finite set of actions. The bandits at of actions { R′ Rt t∈N and t∈N be two bandits t} } { { N and all sequences R′ t∈N if and only if for all T t} R′ Rt,at }t∈[T ] and t,at }t∈[T ] equal in distribution. { { to denote H π→R′ , and A′π , H ′π , At to denote Aπ→R to t t t denote the set of histories of length t, i.e., the set of sequences of t action-reward Rt ∼ { { , the sequences of rewards A }t∈[T ] where each at t to denote H π→R . In addition, let Proof. Throughout this proof, we use H π denote Aπ→R′ pairs. ∈ A t∈N H ∈ } t t t t We prove each of the two directions below. 1. " ": Suppose that Rt { t∈N R′ t} ⇒ a deterministic policy π{at}t∈[T ] that executes action at at timestep t for all t and H ′π t have the same distribution. Hence, {at}t∈[T ] ∼ { ∈ } t∈N. For all T N, and all sequences of actions at { N0, t }t∈[T ], we can construct ≤ T . Then H π t {at}t∈[T ] ∈ P Rt,at }t∈[T ] ∈ * { (cid:0) (cid:1) = P R′ { (cid:0) t,at }t∈[T ] ∈ * (cid:1) . 2. " ": Suppose that for all T , the sequence of R′ Rt,at }t∈[T ] and t,at }t∈[T ] have the same distribution. Let π be any policy. We prove the hypothesis { { }t∈[T ], where each at N and all sequences of actions ∈ A ∈ at { N0 by induction. T have the same distribution for all T T and H ′π ⇐ rewards that H π ∈ (a) For T = 0, H π (b) Now suppose that the hypothesis holds for T = t, i.e., H π 0 and H ′π 0 are both empty history, so they have the same distribution. t and H ′π t have the same distribution. We prove for t + 1. First, observe that for all ht t, Next, for all ht t, at ∈ H ∈ H t = ht) = π ( H π ht) = P *| A′π (cid:0) t ∈ *| H ′π t = ht . (cid:1) (cid:1) t = at t = ht, Aπ H π H π t = ht) R1,a0 = r1,a0 , R2,a1 = r2,a1 , ..., Rt,at−1 = rt,at−1 2,a1 = r2,a1 , ..., R′ R′ t,at−1 = rt,at−1 H ′π 1,a0 = r1,a0 , R′ t = ht P (Aπ t ∈ *| , we have (cid:0) P ∈ A Rt+1,Aπ t ∈ *| = P (Rt+1,at ∈ *| = P Rt+1,at ∈ *| R′ = P t+1,at ∈ *| R′ = P t+1,at ∈ *| R′ t+1,A′π = P (cid:0) (cid:0) (cid:0) (cid:16) t ∈ *| (cid:1) t = ht, A′π H ′π t = at , (cid:17) 18 (4) (5) (cid:1) (cid:1) Aπ where the first equality follows from Rt+1 t | ⊥ N0 and all sequence of actions for all T at }t∈[T ], where each at ∈ { R′ t,at }t∈[T ] have the same distribution, and the last equality follows from R′ and { Recall that H π t , A′π t+1 = (H ′π t ) and H ′π t, at ht ht+1 A′π t | t , R′ ∈ H R be defined such that ht+1 = (ht, at, rt+1,at ). Therefore, for all t t , the third equality holds because of the assumption that Rt,at }t∈[T ] { H ′π t . t+1 = (H π t , Aπ , and rt+1,at ∈ t+1, we let N0 and , the sequence of rewards ). For all ht+1 t , Rt+1,Aπ t+1 ⊥ t+1,A′π t ∈ H ∈ A ∈ A t+1, H π ∈ ∈ H P(H π = P(H π t+1 = ht+1) t = ht)P(Aπ H ′π (cid:0) H ′π (cid:0) A′π (cid:0) t+1 = ht+1 t = ht P (cid:1) (cid:1) , = P = P t = at H π | t = at t = ht)P(Rt+1,Aπ H ′π | t = ht R′ P (cid:16) (cid:1) t = rt+1,at| t+1,A′π t = rt+1,at | H π t = ht, Aπ H ′π t = at) t = ht, A′π t = at (cid:17) where the second equality follows from our hypothesis for T = t, (4) and (5). Hence, we've proved by induction that H π T and H ′π T have the same distribution for all policies π and all T N0. ∈ We are now ready to prove Theorem 3. Theorem 3. (Necessary and Sufficient Condition for Stationarity). A bandit only if there exists a bandit exchangeable. t∈N such that R′ t} { R′ t} Rt { ∼ { t∈N } t∈N and that the sequence of rewards Rt { t∈N is stationary if and } t∈N is R′ t} { Proof. We prove the two directions, respectively. 1. " ": Suppose there exists a bandit environment ⇐ R′ that t} any sequences of distinct timesteps t∈N. Then for all T Rt { ∼ { t∈N } t∈N where the sequence of rewards is exchangeable such }k∈[T ] in the shared action set, and ak { ∈ R′ t} { N, any sequence of actions t′ tk }k∈[T ] and k}k∈[T ], { { = P Rtk ,ak }k∈[T ] ∈ * { (cid:1) (cid:0) R′ t′ k,ak (cid:16)(cid:8) = P tk ,ak k,ak Rt′ R′ ok∈[T ] ∈ *(cid:19) (cid:18)n (cid:18)n P = P k∈[T ] ∈ *(cid:17) (cid:9) , ok∈[T ] ∈ *(cid:19) where the first and last equalities follow from the equivalence of the two bandit environments, and the second equality follows from the fact that the sequence of rewards in t∈N is exchangeable. Thus, we have shown that R′ t} { Rt { t∈N is stationary. } 2. " ⇒ ": Now suppose that Rt { the sequence of rewards is exchangeable and show that We first look at the sequence of is stationary, the sequence of distribution P over R|A| such that conditioned on P , t∈N is stationary. As an outline of the proof, we construct a bandit } R′ t∈N. t∈N t} , Rn|A|+|A|,|A|) t∈N |A|− -tuples is exchangeable. By de Finetti's theorem, there exists a random n∈N0 . Since the bandit } Rt { (Rn|A|+1,1, { R′ t} { t∈N where } * * * Rt { tuples ∼ { |A| } Rn|A|+1,1, , Rn|A|+|A|,|A| * * * (cid:8)(cid:0) n∈N0 i.i.d. ∼ P, (cid:1)(cid:9) A |A| R′ t} { t∈N with a set t∈N is independent of the reward sequence in t∈N is exchangeable. -tuples are independently and identically distributed according to P . In other words, conditioned on P , the We next construct a bandit of actions, where the rewards are independently and identically distributed according to P , conditioned on P . We also require that conditioned on P , the reward sequence in R′ t∈N. Observe that the sequence of rewards in the bandit t} { } R′ t} { Below we show that the two bandit environments we need to show that for all T R′ and t,at }t∈[T ] have the same distribution. With out loss of generality, let { [T ] : at = k Sk = t for all k ∈ { at }t∈[T ]. It suffices to show that sequence { RS1,1, RS2,2, R′ t∈N are equivalent. According to Lemma 1, t} { Rt,at }t∈[T ] at }t∈[T ], the sequences of rewards { { . We define = |A|} A . Then Sk represents the set of timesteps that action k appears in the t∈N and } N and all sequences of actions 1, 2, ..., { Rt { Rt { = P ∈ A , R′ (6) R′ S1,1, R′ , RS|A|,|A| S2,2, S|A|,|A| ∈ P } . * * * (cid:17) ∈ *(cid:17) (cid:16)(cid:16) * * * (cid:17) ∈ *(cid:17) (cid:16)(cid:16) 19 . Then Ck represents the number of timesteps that actions 1 through k appear k Let Ck = Si i=1 | | at in the sequence { P P = P = P for all k ∈ A }t∈[T ]. Then we have RS1,1, RS2,2, * * * C1 n=1, (cid:16)(cid:16) Rn|A|+1,1} (cid:16)(cid:16){ 1:C1,1, R′ R′ (cid:16)(cid:16) C1+1:C2,2, (cid:17) ∈ *(cid:17) C2 n=C1+1, , RS|A| ,|A| Rn|A|+2,2} { , R′ * * * , R′ S|A| ,|A| C|A|−1+1:C|A|,|A| (cid:17) ∈ *(cid:17) , * * * Rn|A|+|A|,|A|} { C|A| n=C|A|−1+1 (cid:17) ∈ *(cid:17) = P R′ S1,1, R′ S2,2, (cid:16)(cid:16) (cid:17) ∈ *(cid:17) where the first equality follows from the stationarity of tion of Hence, we've shown that (6) holds. R′ t} { * * * , t∈N, and the last equality from that the sequence of rewards associated with Rt { t∈N, the second equality follows from the construc- } t∈N is exchangeable. R′ t} { E Proof of Theorem 4 Theorem 4. (Landscape of Bandit Environments). A bandit to a strongly stationary bandit; two strongly stationary bandits are equivalent if and only if for all T and t∈N is stationary if and only if it is equivalent } }t∈[T ] Rt { N, Rt { ∈ R′ t}t∈[T ] equal in distribution. { Proof. We prove each of the two statements below. • We prove the two directions, respectively. 1. " ": First observe that in a strongly stationary bandit, the sequence of rewards is exchangeable. Then ⇐ by Theorem 3, we prove this direction. 2. " ": Suppose that t∈N ⇒ R′ Rt t} { Now we show that the bandit t∈N. Specifically, we construct R′ t} { R′ t} { t∈N is strongly stationary. For all T ∼ { } Rt { t∈N is stationary. We construct a strongly stationary bandit } t∈N such that t∈N in the same way as in the proof of Theorem 3. R′ t} { N, P R′ { (cid:0) t}t∈[T ] ∈ * (cid:1) = P = P ∈ (Rn|A|+1,1, ..., Rn|A|+|A|,|A|) { (cid:0) (R′ n|A|+|A|,|A|) { (cid:0) n|A|+1,1, ..., R′ }n∈[T ] ∈ * (cid:1) }n∈[T ] ∈ * (cid:1) R′ t}t∈[T ], and the second equality follows from { , where the first equality follows from the construction of the equivalence of the two bandit environments. • By Lemma 1, the direction " " is straightforward. Now we prove the other direction " ⇐ t∈N are equivalent. Then for all T Rt t∈N and strongly stationary bandits { } Rt { (cid:0) }t∈[T ] ∈ * (cid:1) N0, ∈ P (cid:0) ⇒ n|A|+1,1, ..., R′ (Rn|A|+1,1, ..., Rn|A|+|A|,|A|) { (R′ n|A|+|A|,|A|) { R′ { , }n∈[T ] ∈ * (cid:1) }n∈[T ] ∈ * (cid:1) R′ t} { = P = P = P (cid:0) t}t∈[T ] ∈ * (cid:1) where the first and the third equalities follow from the fact that the two bandits are strongly stationary, and the second inequality follows from equivalence. (cid:0) ". Suppose two F Regret Analysis Recall that by taking χt = R1:t or χt = Rt+2:+∞, we retrieve the two definitions of regret introduced by [19], and that PS is proven to be consistent with its stationary counterpart, TS. The regret analysis proposed by [19] suggests that we can utilize notions of regret that are consistent with the conventional notion to derive regret analysis to evaluate the performance of agents, including one that is consistent with its stationary counterpart. Here we present a direct generalization of that regret analysis. 20 Theorem 5 (General Regret Bound). For all deterministic function sequences χ = N, if αt = ft(Rt), then we have χt { t∈N, policies π, and T } ∈ ft { t∈N, stochastic processes } Regretχ(T ; π) T −1 ≤ v u u t Xt=0 Γπ t (χ; α) VT (α), where Γπ t (χ; α) = E[maxa∈A E[Rt+1,a|χt]−Rt+1,Aπ t ]2 (cid:16)αt+2:∞;Aπ I t ,Rt+1,Aπ t |H π t (cid:17) and VT (α) = T −1 t=0 I(αt+2:∞; Rt+1 P R1:t). | Proof. Let α = π and T N, ∈ αt { t∈N be a stochastic process satisfying the criterion. Then for all stochastic processes χ, policies } Regretχ(T ; π) = Regretχ ins(t; π) T −1 Xt=0 T −1 t (χ; α) I Γπ ≤ Xt=0 q αt+2:∞; Aπ (cid:0) t , Rt+1,Aπ t | H π t T −1 ≤ v u u t I Xt=0 (cid:0) αt+2:∞; Aπ t , Rt+1,Aπ t | H π t T −1 Xt=0 v u u (cid:1) t (cid:1) Γπ t (χ; α), (7) where the first inequality follows from the definition of the information ratio, and the last inequality follows from the R1:t+1. Hence, for all stochastic processes χ, policies π Cauchy-Schwartz inequality. Observe that αt+2:∞ t+1| and t H π N, ⊥ ∈ I αt+2:∞; Aπ (cid:0) t , Rt+1,Aπ t | H π t = I (αt+2:∞; R1:t+1 H π t ) | − I (αt+2:∞; R1:t+1 t+1) . H π | Therefore, for all stochastic processes χ, policies π and T (cid:1) N, ∈ I T −1 Xt=0 T −1 αt+2:∞; Aπ (cid:0) t , Rt+1,Aπ t | H π t (cid:1) [I (αt+2:∞; R1:t+1 H π t ) | − I (αt+2:∞; R1:t+1 H π | t+1)] Xt=0 = ≤ I(α2:∞; R1) + = I(α2:∞; R1) + I(α2:∞; R1) + ≤ [I (αt+2:∞; R1:t+1 H π t ) | − I (αt+1:∞; R1:t t )] H π | [I (αt+2:∞; R1:t t ) + I (αt+2:∞; Rt+1 H π | R1:t, H π t ) | − I (αt+1:∞; R1:t t )] H π | I (αt+2:∞; Rt+1 R1:t, H π t ) | T −1 Xt=1 T −1 Xt=1 T −1 Xt=1 T −1 = I(α2:∞; R1) + I (αt+2:∞; Rt+1 Xt=1 = VT (α), R1:t) | (8) where the second equality follows from the chain rule of mutual information, and the second-to-last equality follows from (αt+2:∞, Rt+1) R1:t. Incorporating (7) and (8), we complete the proof. H π t | ⊥ In Theorem 5, VT is the predictive information [19], representing information that is useful in predicting future is the information ratio [53, 54, 55, 56, 57, 11, 58, 59, 60], representing how (in)effcient an agent π is at αt's; Γπ t trading-off information acquisition and reward maximization. Below we provide a general upper bound on predictive information. 21 Proposition 1 (General Upper Bound on Predictive Information). Let that, for all t information is defined as VT (α) = St { St+2, R1:t. For all T | ⊥ I(αt+2:∞; Rt+1 St and αt+2:∞ | T −1 t=0 Rt+1 R1:t), and satisfies | N0, St+1:∞ R1:t ⊥ ∈ t∈N be a Markov process such } N, the cumulative predictive ∈ P VT (α) ≤ T −1 I(S2; S1) + I(St+2; St+1 Xt=1 St). | Proof. Observe that for all t ∈ N0, the amount of incremental predictive information satisfies ∆t(α) = I(αt+2:∞; Rt+1 R1:t) | I(St+2; Rt+1 R1:t) | H(St+2 R1:t) | R1:t, St+1) + I(St+2; St+1 R1:t) | | St+1) + I(St+2; St+1 R1:t) | | ≤ = H(St+2 = H(St+2 = H(St+2 = I(St+2; St+1 I(St+2; St+1 R1:t+1) | − − R1:t) | − − H(St+2 H(St+2 R1:t+1, St+1) | St+1) | − I(St+2; St+1 − I(St+2; St+1 R1:t+1) | R1:t+1) | R1:t+1), | St+2, R1:t and data-processing inequality, and the second-to-last | where the first inequality follows from αt+2:∞ equality follows from St+2 R1:t+1 Rt+1 ⊥ ⊥ St+1. | Then for all T ∈ N, the amount of cumulative predictive information can be upper-bounded: T −1 VT (α) = ∆t(α) = Xt=0 T −1 Xt=0 [I(St+2; St+1 R1:t) | − I(St+2; St+1 R1:t+1)] | = I(S2; S1) + I(S2; S1) + ≤ = I(S2; S1) + (a) = I(S2; S1) + T −1 Xt=1 T −1 Xt=1 T −1 Xt=1 T −1 Xt=1 [I(St+2; St+1 R1:t) | − I(St+1; St R1:t)] | [I(St+2, St; St+1 R1:t) | − I(St+1; St R1:t)] | [I(St+2; St+1 R1:t, St)] | [I(St+2; St+1 St)] , | where the last equality follows from (St+1, St+2) R1:t St. | ⊥ The random variable St can be thought of as the hidden state of the bandit at timestep t. By suitably constructing St t∈N, we can apply this lemma to bound the amount of predictive information in any bandit. In particular, this } { can be achieved by letting St = R1:t for all t t∈N with which } we can derive sharper bounds or more interpretable bounds when applying the lemma. For example, in a modulated Bernoulli bandit or an AR(1) bandit, we can conveniently let St = θt, if αt = ft(Rt) and t∈N is a sequence of } deterministic functions. N. For some bandits, there is a better choice of St { ft { ∈ t (χ; α) To relate our regret bound to existing regret bounds established in the literature of stationary bandits, we compare our bound to a bound established by [11]. Observe that in a stationary bandit, if the information ratio satisfies (χ; α)T H(θ), Γπ by letting St be an invariant latent parameter θ that determines the reward distribution. If we in addition let each χt be the reward distribution and αt = Rt, then our regret bound is equivalent to an information-theoretic regret bound established by [11]. (χ; α), then our result establishes that Regretχ(T ; π) N for some Γ (χ; α) for all t ≤ q ≤ ∈ Γ Γ π π π 22
http://arxiv.org/abs/2302.12196v2
2023-06-01T06:41:51
2023-02-23T17:42:11
Adversarial Calibrated Regression for Online Decision Making
Accurately estimating uncertainty is an essential component of decision-making and forecasting in machine learning. However, existing uncertainty estimation methods may fail when data no longer follows the distribution seen during training. Here, we introduce online uncertainty estimation algorithms that are guaranteed to be reliable on arbitrary streams of data points, including data chosen by an adversary. Specifically, our algorithms perform post-hoc recalibration of a black-box regression model and produce outputs that are provably calibrated -- i.e., an 80% confidence interval will contain the true outcome 80% of the time -- and that have low regret relative to the learning objective of the base model. We apply our algorithms in the context of Bayesian optimization, an online model-based decision-making task in which the data distribution shifts over time, and observe accelerated convergence to improved optima. Our results suggest that robust uncertainty quantification has the potential to improve online decision-making.
[ "Volodymyr Kuleshov", "Shachi Deshpande" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12196v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12196v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
3 2 0 2 n u J 1 ] G L . s c [ 2 v 6 9 1 2 1 . 2 0 3 2 : v i X r a Adversarial Calibrated Regression for Online Decision Making Volodymyr Kuleshov Cornell University and Cornell Tech New York, NY [email protected] Shachi Deshpande Cornell University and Cornell Tech New York, NY [email protected] Abstract Accurately estimating uncertainty is an essential component of decision-making and forecasting in machine learning. However, existing uncertainty estimation methods may fail when data no longer follows the distribution seen during training. Here, we introduce online uncertainty estimation algorithms that are guaranteed to be reliable on arbitrary streams of datapoints, including data chosen by an adversary. Specifically, our algorithms perform post-hoc recalibration of a black- box regression model and produce outputs that are provably calibrated-i.e., an 80% confidence interval will contain the true outcome 80% of the time-and that have low regret relative to the learning objective of the base model. We apply our algorithms in the context of Bayesian optimization, an online model-based decision-making task in which the data distribution shifts over time, and observe accelerated convergence to improved optima. Our results suggest that robust uncertainty quantification has the potential to improve online decision-making. 1 Introduction Uncertainty estimation is an essential component of decision-making and forecasting in machine learning [32; 22; 14; 3]. However, existing uncertainty estimation methods developed for independent and identically distributed (IID) data may fail when the data no longer follows the distribution seen during training [21; 14]. This work explores uncertainty estimation without IID assumptions. Specifically, this paper introduces online uncertainty estimation algorithms that are guaranteed to be reliable on arbitrary streams of datapoints, including data chosen by an adversary. Our algorithms perform post-hoc recalibration of a black-box regression model and produce outputs that are calibrated-i.e., an 80% confidence interval will contain the true outcome 80% of the time-and that have low regret relative to the learning objective of the base model. Unlike existing work on recalibration [28; 22] ours admits provable guarantees without IID assumptions; unlike classical online learning [7] we provide guarantees on predictive uncertainty, not only regret. Our work builds upon online calibrated classification by Kuleshov and Ermon [21], extending it to regression. We complement our algorithms with formal guarantees on calibration and low regret that leverage techniques previously developed in game theory and randomized forecasting [12; 13; 7]. We apply our algorithms to several regression tasks, as well in the context of Bayesian optimization, an online model-based decision-making task in which the data distribution shifts over time. We find that improved uncertainties in the Bayesian optimization model yield faster convergence to optimal solutions which are also often of higher quality. Contributions. We formulate a new problem called online calibrated regression, which requires producing calibrated probabilities on potentially adversarial input while retaining the predictive power of a given baseline uncalibrated forecaster. We propose an algorithm for this task that generalizes Preprint. Under review. batch calibrated regression to non-IID data and online calibrated classification to regression settings. We show that the algorithm can improve the performance of Bayesian optimization, suggesting that robust uncertainty estimation has the potential to improve online decision-making. 2 Background 2.1 Online Learning Notation We use IE denote the indicator function of E, [N ] and [N ]0 to (respectively) denote the sets {1, 2, ..., N } and {0, 1, 2, ..., N }, and ∆d to denote a d-dimensional simplex. We place our work in the framework of online learning [29]. At each time step t = 1, 2, ..., we are given features xt ∈ X . We use a forecaster H : X → P to produce a prediction pt = H(xt), pt ∈ P in the set of distributions P over a target y ∈ Y. Nature then reveals the true target yt ∈ Y and we incur a loss of l(yt, pt), where l : Y × P → R+ is a loss function. The forecaster H updates itself based on xt, yt, and we proceed to time t + 1. Unlike in classical machine learning, we do not assume that the xt, yt are i.i.d.: they can be random, deterministic or even chosen by an adversary. Online learning algorithms feature strong performance guarantees in this regime, where performance is usually measured in terms of regret RT (q) relative to a constant prediction q, RT (q) = (cid:80)T t=1 l(yt, pt) − l(yt, q). The worst-case regret at time T equals RT = maxq∈P RT (q). Learning with Expert Advice A special case of this framework arises when each xt represents advice from N experts, and H outputs pt ∈ ∆N −1, a distribution over experts. Nature reveals an outcome yt, resulting in an expected loss of (cid:80)N i=1 ptil(yt, ati), where l(yt, ati) is the loss under expert i's advice ati. Performance in this setting is measured using two notions of regret. Definition 1. The external regret Rext Rext T = T (cid:88) t=1 ̄l(yt, pt) − min i∈[N ] T (cid:88) t=1 T and the internal regret Rint T are defined as T (cid:88) l(yt, ait) Rint T = max i,j∈[N ] t=1 pti (l(yt, ait) − l(yt, ajt)) , where ̄l(y, p) = (cid:80)N i=1 pil(y, ait) is the expected loss. External regret measures loss with respect to the best fixed expert, while internal regret is a stronger notion that measures the gain from retrospectively switching all the plays of action i to j. 2.2 Online Probabilistic Forecasting Our work extends the online learning setting to probabilistic predictions: at each step t, the forecaster outputs a probability distribution pt over the outcome yt. We focus on regression, where yt ∈ R and the prediction pt can be represented by a cumulative distribution function (CDF), denoted Ft : R → [0, 1]; we write Ft(z) or pt(y ≤ z) to denote the predicted probability that y is less than z. The quality of probabilistic forecasts is evaluated using proper losses l. Formally, a loss l(y, p) is proper if p ∈ arg minq∈P Ey∼(p)l(y, q) ∀p ∈ P. An important proper loss for CDF predictions F is the continuous ranked probability score, defined as lCRPS(y, F ) = (cid:82) ∞ −∞(F (z) − Iy≤z)2dz. Calibrated Forecasting Proper losses decompose into a calibration and a sharpness component: these quantities precisely define an ideal forecast. Intuitively, calibration means that a 60% prediction should be valid 60% of the time; sharpness means that confidence intervals or predictions should be as tight or as certain as possible. Online Calibration In the online setting, there exist algorithms guaranteed to produce calibrated forecasts of binary outcomes yt ∈ {0, 1} even when the yt is adversarial [13; 7]. These algorithms reduce calibrated forecasting to internal regret minimization and are necessarily randomized; hence their guarantees hold almost surely (a.s.). More formally, for any p ∈ [0, 1], we define ρT (p) = (cid:80)T to be the empirical frequency of yt when we predict p. Online calibration methods 2 t=1 ytIFt(yt)=p (cid:80)T IFt(yt)=p t=1 minimize the calibration error CT = (cid:80)N i=0 the observed and the predicted frequencies of yt. The model is calibrated if ρT (p) ≈ p. (cid:12) (cid:12)ρT (i/N ) − i N I {pt= i (cid:80)T N } t=1 (cid:12) (cid:12) (cid:16) 1 T (cid:17) . This compares However, these calibration methods do not account for covariates xt, hence are not directly applicable on standard supervised machine learning tasks. Recently, Kuleshov and Ermon [21] introduced algorithms for online recalibration, an task in which we are given probabilistic predictions from an algorithm and seek to transform them into calibrated ones while maintaining low regret in terms of a proper loss. This approach yields forecasters that leverage covariates xt and possess calibration guarantees on non-i.i.d. data. However, this method only works for classification; our work extends it to regression. 3 Online Calibrated Regression Our strategy is to first extend to regression the simple covariate-free online binary calibration setting proposed by Foster and Vohra [13]. We will later use these results to develop recalibration algorithms for online regression analogous to those of Kuleshov and Ermon [21]. Online Calibrated Regression We first define an online regression task that is analogous to the task of online binary calibration [13]-there are no covariates and our task is to produce calibrated forecasts on a sequence of yt that is potentially chosen by an adversary. Formally, we define online calibrated regression as a task in which at every step t = 1, 2, ... we have: 1: The agent outputs a forecast Ft where Ft(y) ∈ [0, 1] estimates the probability that yt ≤ y. 2: Nature reveals label yt 3: The agent updates its internal state based on yt. Unlike Kuleshov and Ermon [21], we focus on the setting of regression. We formalize this as follows. Assumption 1. The labels yt ∈ Y ⊆ R are continuous and bounded |yt| < B/2, where B > 0. Our task is to produce calibrated forecasts. Intuitively, we say that a forecast Ft is calibrated if for every y′ ∈ Y, the probability Ft(y′) on average matches the frequency of the event {y ≤ y′}-in other words the Ft behave like calibrated CDFs. We formalize this intuition as follows. Definition 1. A sequence of forecasts Ft achieves online calibration for all y ∈ Y and all p ∈ P, ρT (y, p) → p, a.s. as T → ∞, where ρT (y, p) = (cid:80)T t=1 (cid:80)T Iyt≤y,Ft(y)=p IFt(y)=p t=1 In other words, out of the times when the predicted probability Ft(y′) for {yt ≤ y′} to be p, the event {yt ≤ y′} holds a fraction p of the time. 3.1 Algorithms for Online Calibrated Forecasting 2 , −B 2 + B M ), ..., [ B Next, we define an algorithm for online calibrated forecasting. Our algorithm leverages classical online binary calibration [13] as a subroutine. Formally, Algorithm 1 partitions [− B 2 ] into M intervals I = {[ −B 2 ]}; each interval is associated with an instance of an online binary recalibration subroutine Scal [13; 7]. In order to compute Gt(y ≤ z), we invoke the subroutine Scal observes whether yt falls in its interval and updates its state. Theorem 1. Let YI be the set of upper bounds of the intervals I and let PS be the output space of Scal. Algorithm 1 achieves online calibration and for all y ∈ YI, p ∈ PS we have ρT (y, p) → p a.s. as T → ∞. associated with interval Ij containing z. After observing yt, each Scal 2 − B M , B 2 , B j j The above theorem follows directly from the construction of Algorithm 1: for each y ∈ Y, we run an online binary calibration algorithm to target the event yt ≤ y. See Appendix A for a proof. Are Deterministic Algorithms Possible? Algorithms Scal for online binary calibration are ran- domized; thus our procedure is randomized as well. This is a key property of our task. 3 Algorithm 1 Online Calibration Require: Online binary calibration subroutine Scal and number of intervals M 1: Initialize I = {[ −B 2: Initialize S = {Scal j 3: for t = 1, 2, ...: do 4: Define Ft(y ≤ z) as the output of Scal M ), ..., [ B 2 + B 2 , −B 2 − B M , B | j = 0, ..., M − 1}, a set of M instances of Scal, one per Ij ∈ I. 2 ]}, a set of M intervals that partition [ −B 2 , B 2 ]. j(z), where j(z) is the index of the subroutine associated with the interval containing z. 5: 6: 7: Output Ft. Observe yt and update forecaster: for j = 1, 2, ..., M : do Let otj = 1 if yt ∈ Ik for some k ≤ j else 0. Pass otj to Scal . j Theorem 2. There does not exist a deterministic online calibrated regression algorithm that achieves online calibration. This claim follows because we can encode a standard online binary calibration problem as calibrated regression. If the adversary chooses a binary yt ∈ {0, 1} ⊆ [0, 1] that defines one of two classes, the ratio ρT (0, p) yields the definition of calibration in binary classification, for which no deterministic algorithms exist [7]. See Appendix A for a proof. Note, however, that alternative definitions of online calibration in regression may admit deterministic algorithms [14]. 4 Online Recalibration Next, we look at the more interesting setting in which predictions for yt also involve covariates xt. We extend online calibrated regression (which is analogous to the setting of Foster and Vohra [13]) to a setting that generalizes online recalibration by Kuleshov and Ermon [21] to regression. Online Recalibration We introduce an approach that is based on the framework of recalibration. We start with a forecaster H trained using online learning that outputs uncalibrated forecasts Ft at each step; these forecasts are fed into a recalibrator G such that the resulting forecasts G ◦ Ft are calibrated and have low regret relative to the baseline forecasts Ft. Formally, we introduce the setup of online recalibration, in which at every step t = 1, 2, ... we have: 1: Nature reveals features xt ∈ Rd. 2: Forecaster H predicts Ft = H(xt; wt) 3: A recalibration algorithm produces a calibrated forecast Gt based on Ft. 4: Nature reveals label yt; H incurs loss of l(yt, pt) 5: Based on xt, yt, we choose new Gt+1 and optionally update H. The goal of the recalibration procedure is to produce forecasts that are calibrated and have high predictive values [15]. We measure calibration using our calibration error CT . We enforce high predictive values by requiring that the Gt ◦ Ft have low regret relative to the baseline Ft in terms of the CRPS proper loss. Since the CRPS is a sum of calibration and sharpness term, by maintaining a good CRPS while being calibrated, we effectively implement Gneitig's principle of maximizing sharpness subject to calibration [16]. Formally, this yields the following definition. Definition 2. We say that A is an ε-accurate online recalibration algorithm if (a) the forecasts Ft = A(F H t ) are calibrated and (b) the regret of Ft with respect to F H t is a.s. small w.r.t. lCRPS: lim sup T →∞ 1 T T (cid:88) t=1 (cid:0)lCRPS(yt, Ft) − lCRPS(yt, F H t )(cid:1) ≤ ε. (1) 5 Algorithms for Online Recalibration Next, we propose an algorithm for performing online recalibration (Algorithm 2). This algorithm sequentially observes uncalibrated CDF forecasts Ft and returns forecasts Gt such that Gt(z) is a calibrated estimate for the outcome yt ≤ z. This algorithm again relies on a classical calibration subroutine [13], which it uses in a black-box manner to construct Gt. 4 Algorithm 2 Online Recalibration Require: Online binary calibration subroutine Scal and number of intervals M M ), ..., [ M −1 1: Initialize I = {[0, 1 2: Initialize S = {Scal j 3: for t = 1, 2, ...: do 4: 5: M ), [ 1 | j = 0, ..., M − 1}, a set of M instances of Scal, one per Ij ∈ I. M , 1]}, a set of intervals that partition [0, 1]. Observe uncalibrated forecast Ft. Define Gt(y ≤ z) as the output of Scal associated with the interval containing Ft(z). M , 2 ⌊Ft(z)⌋, where ⌊Ft(z)⌋ is the index of the subroutine 6: 7: 8: Output Gt. Observe yt and update recalibrator: for j = 1, 2, ..., M : do Let otj = 1 if F (yt) ≤ j M else 0. Pass otj to Scal j . An uncalibrated forecast Ft(z) assigns a probability to yt ≤ z for each z; however, these may not correspond to correct empirical frequencies. Algorithm 2 can be seen as producing a [0, 1] → [0, 1] mapping that remaps the probability of each z into its correct value. More formally, Algorithm 2 partitions [0, 1] into M intervals I = {[0, 1 M , 1]}; each interval is associated with an instance of Scal. In order to compute Gt(y ≤ z), we compute ptz = Ft(y ≤ z) and invoke the subroutine Scal observes the binary outcome otj = I associated with interval Ij containing ptz. After observing yt, each Scal and updates its state. M ), ..., [ M −1 M ), [ 1 M , 2 j j Ft(yt)≤ j M The resulting procedure produces valid calibrated estimates Gt(y ≤ z) for each z when M is sufficiently large because each Scal is a calibrated subroutine. More importantly the Gt do not decrease the predictive performance of the Ft, as measured by lCRPS. Intuitively, this is true because the lCRPS is the sum of calibration and sharpness, the former of which improves in Gt. In the remainder of this section, we establish these facts formally. j 5.1 Online Recalibration Achieves Vanishing Regret Notation. We are going to be working with online calibration subroutines Scal [13; 7]. These meth- ods are typically discretized: they output a set of discretized probabilities i/N for i ∈ {0, 1, ..., N }. We refer to N as their resolution. We define the calibration error of Scal T,i = (cid:12) (cid:12)ρ(j) where It,i = I{pt = i/N }. Terms marked with a (j) denote T (i/N ) − i (cid:12) N the restriction of the usual definition to the input of subroutine Scal (see the appendix for details). We may write the calibration loss of Scal at i/N as C (j) as C (j) (cid:16) 1 Tj I(j) t,i (cid:80)T t=1 T = (cid:80)N i=0 C (j) T,i. (cid:12) (cid:12) (cid:12) (cid:17) j j j j We also seek to quantify the calibration of Algorithm 2, specifically compare ρ(y, p) with p. We define for this the quantity CT,i(y) = (cid:12) (cid:12) (cid:12) (cid:12) ρT (y, i/N ) − (cid:32) i N (cid:12) (cid:12) (cid:12) (cid:12) 1 T T (cid:88) t=1 (cid:33) It,i , and we define the calibration loss of Algorithm 2 at y as CT (y) = (cid:80)N i=0 CT,i(y). Assumptions. We will assume that the subroutine Scal used in Algorithm 2 is ε-calibrated in that C (j) ≤ RTj + ε uniformly (RTj = o(1) as Tj → ∞; Tj is the number of calls to instance Scal Tj We also assume that for each t, the target yt lies in a bounded interval of R of length at most B. Finally, we assume that the input CDF forecasts Ft are discretized like the other elements of our setup and are step functions over a set of values of y denoted by Y. ). j Establishing our results will rely on the following key technical lemma [21]. Lemma 1. An ε-calibrated Scal a.s. has a small internal regret w.r.t. any lp norm and satisfies uniformly over time T the bound max ij T (cid:88) t=1 Ipt=i/N (lp(yt, i/N ) − lp(yt, j/N )) ≤ 2(RT + ε). 5 An important consequence of Lemma 1 is that a calibrated algorithm has vanishing regret relative to any fixed prediction (since minimizing internal regret also minimizes external regret). Using this fact, it becomes possible to establish that Algorithm 2 is at least as accurate as the baseline forecaster. Lemma 2 (Recalibration with low regret accuracy). Consider Algorithm 2 with parameters M ≥ N > 1/ε and let l be the CRPS proper loss. Then the recalibrated Gt a.s. have vanishing l-loss regret relative to F H t and we have a.s.: 1 T T (cid:88) t=1 l(yt, Gt) − 1 T T (cid:88) t=1 l(yt, F H t ) < N B M (cid:88) j=1 Tj T RTj + 3Bε. Proof (sketch). When pt = F (y) is the output of a given binary calibration subroutine Scal at some y, we know what ⌊F (y)⌋ = j/M (by construction). Additionally, we know from Lemma 1 that Scal minimizes external regret. Because Scal j minimizes external regret, it has vanishing regret in terms of l2 loss relative to the fixed prediction j/M : (yt − pt)2 ≤ l(yt, j/M ) + o(T ). But the prediction j/M is simply F (y) during the times t when Scal j was invoked. Aggregating this over multiple t and over the space of all y yields our result. j j 5.2 Online Recalibration Produces Calibrated Forecasts Next, we also establish that combining the predictions of each Scal j preserves their calibration. Lemma 3 (Preserving calibration). If each Scal and the bound j is ε-calibrated, then Algorithm 2 is also ε-calibrated holds uniformly a.s. over T for all y ∈ Y. j=1 CT (y) ≤ M (cid:88) Tj T RTj + ε These two lemmas lead to our main claim: that Algorithm 2 solves the online recalibration problem. Theorem 3. Let Scal be an (ε/3B)-calibrated online subroutine with resolution N ≥ 3B/ε. and let l be a proper loss satisfying the assumptions of Lemma 2. Then Algorithm 2 with parameters Scal and M = N is an ε-accurate online recalibration algorithm for the CRPS loss l. Proof. By Lemma 3, Algorithm 2 is (l1, ε/3B)-calibrated and by Lemma 2, its regret w.r.t. the raw F H t tends to < 3B/N < ε. Hence, Theorem 3 follows. Throughout our analysis, we have used the CRPS loss to measure the regret of our algorithm. This raises the question: is the CRPS loss necessary? We answer this question at least partially in the affirmative-if the loss l used to measure regret is not a proper loss, then recalibration is not possible. Theorem 4. If l is not proper, then no algorithm achieves recalibration w.r.t. l for all ε > 0. 5.3 Convergence Rates Next, we are interested in the rate of convergence RT of the calibration error CT of Algorithm 2. For most online calibration subroutines Scal, RT ≤ f (ε)/ T for some f (ε). In such cases, we can further bound the calibration error in Lemma 3 as √ M (cid:88) j=1 Tj T RTj ≤ M (cid:88) j=1 (cid:112)Tjf (ε) T ≤ f (ε) √ εT . In the second inequality, we set the Tj to be equal. Thus, our recalibration procedure introduces an overhead of 1√ calibration error CT and of the regret in Lemma 2. In addition, Algorithm 2 requires 1 memory (we run 1/ε instances of Scal Scal ε in the convergence rate of the ε times more ), but has the same per-iteration runtime (we activate one j per step). When using an internal regret minimization subroutine [24], the calibration error of j 6 Algorithm 2 is bounded as O(1/ε numbers improve to O(log(1/ε)) time complexity for a O(1/ε the method of Abernethy et al. [1] based on Blackwell approachability. εT ) with O(1/ε) time and O(1/ε2) space complexity. These T ) calibration bound when using √ √ 6 Experiments 6.1 UCI Datasets We experiment with four multivariate UCI datasets [11] to evaluate our online calibration algorithm. Setup. Our dataset consists of input and output pairs {Xt, yt}T t=1 where T is the size of the dataset. We simulate a stream of data by sending batches of data-points {Xt, yt}n(t′+1) t=nt′+1 to our model, where t′ is the time-step and n is the batch-size. This simulation is run for ⌈T /n⌉ time-steps such that our models see the entire dataset by the end of the simulation. For each incoming batch, a base model is fit to the data and the recalibrator is trained. We compare our randomized online calibration with two baselines: non-randomized online calibration and calibrated regression for the IID setting [22] (equivalent to estimating the same mapping as Algorithm 2 using kernel density estimation with a tophat kernel). The base model for these experiments is Bayesian ridge regression. A batch-size of 10 is used in the experiments unless otherwise specified. We set N = 20 in the recalibrator. Table 1: Evaluation of Online Calibration on UCI Datasets. We compare the performance of online calibration against non-randomized online calibration, kernel density estimation, and uncalibrated (i.e., raw) baselines. Our method produces the lowest calibration errors in the last time step. Dataset Uncalibrated Kernel Density Online Calibration Online Calibration Aq. Toxicity (Daphnia Magna) Aq. Toxicity (Fathead Minnow) Energy Efficiency Facebook Comment Volume (Raw) 0.0087 0.0108 0.3336 0.2510 Estimation (Non-randomized) 0.0037 0.0137 0.0708 0.1060 0.0040 0.0124 0.0822 0.0628 0.0017 0.0072 0.0528 0.0524 Analysis of Calibration. We assess the calibration of the base model and the recalibrated model with calibration scores defined using the probability integral transform [15]. We define the calibration score as cal(P1, y1, .., Pn, yn) = (cid:80)m j=1((pj − pj−1) − ˆpj)2, where p0 = 0 < p1 < p2 < .. < (a) Aquatic Toxicity (Daphnia Magna) (b) Aquatic Toxicity (Fathead Minnow) Figure 1: Performance of Online Calibration on the Aquatic Toxicity Datasets. Aquatic toxicity towards two different types of fish (Daphnia Magna 1(a) and Fathead Minnow 1(b)) is predicted by the base model. In both datasets, online calibration outperforms the baseline methods. pm = 1 are m confidence levels using which we compute the calibration score. ˆpj is estimated as ˆpj = |{yt|pj−1 ≤ Pt ≤ pj, t = 1, .., N }|/N. The calibration scores are computed on each batch of data {Pt, yt}n(t′+1) t=nt′+1, before being observed , where n is the batch size and t′ is the time-step. 7 Aquatic Toxicity Datasets We evaluate our algorithm on the QSAR (Quantitative Structure- Activity Relationship) Aquatic Toxicity Dataset 1(a) and Fish Toxicity Dataset 1(b), where aquatic toxicity towards two different types of fish is predicted using 8 and 6 molecular descriptors as features respectively. In Figure 1, we can see that the randomized online calibration algorithm performs better than the non-randomized baseline by producing lower calibration errors. We also compare the performance of our algorithm against uniform kernel density estimation by maintaining a running average of probabilities in each incoming batch of data-points. For the Fish Toxicity Dataset, we can see that only online calibration improves calibration errors relative to the baseline model. We report the calibration error at the last time-step for all the methods separately in Table 1. Energy Efficiency Dataset In the Energy Ef- ficiency Dataset contains the heating load and cooling load of the building and is predicted us- ing 8 building parameters as features. We set the outcome to the heating load of the building and utilize the 8 features as input to our model. In Figure 2, we see that the calibration errors produced by the online calibration algorithm drop sharply within the initial 10 time-steps. The baselines also produce a drop in calibration scores, but it happens more gradually. Facebook Comment Volume Dataset In Fig- ure 3, the Facebook Comment Volume Dataset is used where the number of comments is to be predicted using 53 attributes associated with a post. We use the initial 10000 data-points from the dataset for this experiment. Here, the non-randomized and randomized online calibration algorithms produce a similar drop in calibration errors, but the randomized online calibration algorithm still dominates both the baselines as shown in Table 1. Figure 2: Online recalibration yields low calibra- tion faster than baselines on the Energy dataset. 6.2 Bayesian Optimization We also apply online recalibration in the con- text of Bayesian optimization, an online model- based decision-making task in which the data distribution shifts over time. We find that im- proved uncertainties yield faster convergence to higher quality optima. Setup Bayesian optimization attempts to find the global minimum x⋆ = arg minx∈X f (x) of an unknown function f : X → R over an in- put space X ⊆ RD. We are given an initial labeled dataset xt, yt ∈ X × R for n = 3. At every time-step t, we use normal and re- calibrated uncertainties from the probabilistic model M : X → (R → [0, 1]) of f (here, a Gaussian Process) to select the next data-point xnext and iteratively update the model M. We use some popular benchmark functions to evaluate the performance of Bayesian optimization. We use the Lower Confidence Bound (LCB) acquisition function to select the data-point xt and evaluate a potentially expensive function f as xt to obtain yt. See Appendix C for details. Figure 3: Online recalibration yields the best calibration on Facebook Comments Volume Data Table 2: Recalibrated Bayesian Optimization Recalibrated Uncalibrated Benchmark Ackley (2D) SixHump (2D) Ackley (2D) Alpine (10D) 9.925 (3.502) -0.378 (0.146) 14.638 (0.591) 13.911 (1.846) 8.313 (3.403) -1.029 (0.002) 10.867 (2.343) 12.163 (1.555) Table 2 shows that the online recalibration of uncertainties in a Bayesian optimization model achieves lower minima than an uncalibrated model. Figure 4 shows that online recalibrated Bayesian optimization can also reach optima in fewer steps. We also show improvements over calibration without randomization. 8 (a) SixHumpCamel (b) Beale (c) Mccormick Figure 4: Online Calibration Improves Bayesian optimization 7 Previous Work Calibrated probabilities are widely used as confidence measures in the context of binary classification. Such probabilities are obtained via recalibration methods, of which Platt scaling [28] and isotonic regression [27] are by far the most popular. Recalibration methods also possess multiclass exten- sions, which typically involve training multiple one-vs-all predictors [33], as well as extensions to ranking losses [25], combinations of estimators [34], and structured prediction [19]. Recalibration algorithms have applied to improve reinforcement learning [23], Bayesian optimization [9; 30] and deep learning [20]. In the online setting, the calibration problem was formalized by [8]; online calibration techniques were first proposed by [13]. Existing algorithms are based on internal regret minimization [7] or on Blackwell approachability [12]; recently, these approaches were shown to be closely related [1; 24]. Recent work has shown that online calibration is PPAD-hard [17]. The concepts of calibration and sharpness were first formalized in the statistics literature [26; 16]. These metrics are captured by a class of proper losses and can be used both for evaluating [6; 5] and constructing [19] calibrated forecasts. 8 Discussion and Conclusion Batch vs Online Calibration Algorithm 2 can be seen as a direct counterpart to the histogram technique, a simple method for density estimation. With the histogram approach, the F H is split into t N bins, and the average y value is estimated for each bin. Because of the i.i.d. assumption, the output probabilities are calibrated, and the bin width determines the sharpness. Note that by Hoeffding's inequality, the average for a specific bin converges at a faster rate of O(1/(cid:112)Tj)[10], as opposed to the O(1/(cid:112)εTj) rate given by Abernethy et al. [1]; hence online calibration is harder than batch. Conformal Prediction Conformal prediction [32] is a technique for constructing calibrated predic- tive sets. It has been extended to handle distribution shifts [18; 31; 4], as well as to online adversarial data [14]. Calibrated prediction [28; 22] is closely related to conformal prediction, but focuses on predicting distributions rather than sets. Our work resembles adaptive conformal inference [14], but provides a distribution-like object instead of one confidence interval and studies a different notion of calibration. As a result, while their algorithm is deterministic, ours is randomized. Unlike their algorithm, ours provides more general vanishing regret guarantees relative to a baseline model. Deterministic Forecasting Simultaneously calibrated and accurate online learning methods were developed by [32] in terms of weak calibration [2]. Since we use strong calibration, weak calibration is implied, but it requires different (e.g. randomized) algorithms. Vovk et al. ensure a small difference between average predicted pt and true yt at times t when pt ≈ p∗ and xt ≈ x∗, for any p∗, x∗, by using a different notion of precision. The relation ≈ is can be specified by the user via a kernel. Conclusion We presented a novel approach to uncertainty estimation that leverages online learning. Our approach extends existing online learning methods to handle predictive uncertainty while ensuring high accuracy, providing formal guarantees on calibration and regret even on adversarial input. We introduced a new problem called online calibrated forecasting, and proposed algorithms that generalize calibrated regression to non-IID settings. Our methods are effective on several predictive tasks and hold potential to improve performance in decision-making settings. 9 References [1] Jacob Abernethy, Peter L. Bartlett, and Elad Hazan. Blackwell approachability and no-regret learning are equivalent. In COLT 2011 - The 24th Annual Conference on Learning Theory, pages 27–46, 2011. [2] Jacob D. Abernethy and Shie Mannor. Does an efficient calibrated forecasting strategy exist? In COLT 2011 - The 24th Annual Conference on Learning Theory, June 9-11, 2011, Budapest, Hungary, pages 809–812, 2011. URL http://www.jmlr.org/proceedings/papers/v19/ abernethy11a/abernethy11a.pdf. [3] Anastasios N. Angelopoulos and Stephen Bates. A gentle introduction to conformal prediction and distribution-free uncertainty quantification, 2021. URL https://arxiv.org/abs/2107. 07511. [4] Rina Barber, Emmanuel Candes, Aaditya Ramdas, and Ryan Tibshirani. Conformal prediction beyond exchangeability, 02 2022. [5] J. Brocker. Reliability, sufficiency, and the decomposition of proper scores. Quarterly Journal of the Royal Meteorological Society, 135(643):1512–1519, 2009. [6] Andreas Buja, Werner Stuetzle, and Yi Shen. Loss functions for binary class probability estimation and classification: Structure and applications, 2005. [7] Nicolo Cesa-Bianchi and Gabor Lugosi. Prediction, Learning, and Games. Cambridge University Press, New York, NY, USA, 2006. ISBN 0521841089. [8] A. Philip Dawid. The well-calibrated bayesian. Journal of the American Statistical Association, 77(379):605–610, 1982. [9] Shachi Deshpande and Volodymyr Kuleshov. Calibrated uncertainty estimation improves bayesian optimization, 2021. URL https://arxiv.org/abs/2112.04620. [10] Luc Devroye, László Györfi, and Gábor Lugosi. A probabilistic theory of pattern recognition. Applications of mathematics. Springer, New York, Berlin, Heidelberg, 1996. ISBN 978-0-387- 94618-4. [11] Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive. ics.uci.edu/ml. [12] Dean P. Foster. A Proof of Calibration Via Blackwell's Approachability Theorem. Discussion Papers 1182, Northwestern University, February 1997. [13] Dean P. Foster and Rakesh V. Vohra. Asymptotic calibration, 1998. [14] Isaac Gibbs and Emmanuel Candès. Adaptive conformal inference under distribution shift, 2021. Accepted. [15] Tilmann Gneiting, Fadoua Balabdaoui, and Adrian Raftery. Probabilistic forecasts, calibration and sharpness. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 69: 243 – 268, 04 2007. doi: 10.1111/j.1467-9868.2007.00587.x. [16] Tilmann Gneiting, Fadoua Balabdaoui, and Adrian E. Raftery. Probabilistic forecasts, calibration and sharpness. Journal of the Royal Statistical Society: Series B, 69(2):243–268, 2007. [17] Elad Hazan and Sham M. Kakade. (weak) calibration is computationally hard. In COLT 2012 - The 25th Annual Conference on Learning Theory, June 25-27, 2012, Edinburgh, Scotland, pages 3.1–3.10, 2012. [18] Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise, 2018. URL https://arxiv.org/ abs/1802.05300. [19] V. Kuleshov and P. Liang. Calibrated structured prediction. In Advances in Neural Information Processing Systems (NIPS), 2015. 10 [20] Volodymyr Kuleshov and Shachi Deshpande. Calibrated and sharp uncertainties in deep learning via density estimation, 2021. URL https://arxiv.org/abs/2112.07184. [21] Volodymyr Kuleshov and Stefano Ermon. Estimating uncertainty online against an adversary. In AAAI, pages 2110–2116, 2017. [22] Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression, 2018. [23] Ali Malik, Volodymyr Kuleshov, Jiaming Song, Danny Nemer, Harlan Seymour, and Stefano Ermon. Calibrated model-based deep reinforcement learning. 2019. doi: 10.48550/ARXIV. 1906.08312. URL https://arxiv.org/abs/1906.08312. [24] Shie Mannor and Gilles Stoltz. A geometric proof of calibration. Math. Oper. Res., 35(4): 721–727, 2010. [25] Aditya Krishna Menon, Xiaoqian Jiang, Shankar Vembu, Charles Elkan, and Lucila Ohno- Machado. Predicting accurate probabilities with a ranking loss. In 29th International Conference on Machine Learning,, 2012. [26] A. H. Murphy. A new vector partition of the probability score. Journal of Applied Meteorology, 12(4):595–600, 1973. [27] Alexandru Niculescu-Mizil and Rich Caruana. Predicting good probabilities with supervised learning. In Proceedings of the 22Nd International Conference on Machine Learning, ICML '05, 2005. [28] John C. Platt. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. In ADVANCES IN LARGE MARGIN CLASSIFIERS, pages 61–74. MIT Press, 1999. [29] Shai Shalev-Shwartz. Online Learning: Theory, Algorithms, and Applications. Phd thesis, Hebrew University, 2007. [30] Samuel Stanton, Wesley Maddox, and Andrew Gordon Wilson. Bayesian optimization with conformal prediction sets, 2023. [31] Ryan J. Tibshirani, Rina Foygel Barber, Emmanuel J. Candes, and Aaditya Ramdas. Conformal prediction under covariate shift, 2019. URL https://arxiv.org/abs/1904.06019. [32] Vladimir Vovk, Akimichi Takemura, and Glenn Shafer. Defensive forecasting. In Proceedings of the Tenth International Workshop on Artificial Intelligence and Statistics, AISTATS 2005, Bridgetown, Barbados, January 6-8, 2005, 2005. URL http://www.gatsby.ucl.ac.uk/ aistats/fullpapers/224.pdf. [33] Bianca Zadrozny and Charles Elkan. Transforming classifier scores into accurate multiclass probability estimates. In Eighth ACM Conference on Knowledge Discovery and Data Mining, pages 694–699, 2002. [34] Leon Wenliang Zhong and James T. Kwok. Accurate probability calibration for multiple classifiers. IJCAI '13, pages 1939–1945. AAAI Press, 2013. ISBN 978-1-57735-633-2. 11 A Correctness of the recalibration procedure In the appendix, we provide the proofs of the theorems from the main part of the paper. Notation We use IE denote the indicator function of E, [N ] and [N ]0 to (respectively) denote the sets {1, 2, ..., N } and {0, 1, 2, ..., N }, and ∆d to denote a d-dimensional simplex. Setup We place our work in the framework of online learning [29]. At each time step t = 1, 2, ..., we are given features xt ∈ X . We use a forecaster H : X → P to produce a prediction pt = H(xt), pt ∈ P in the set of distributions P over a target y ∈ Y. Nature then reveals the true target yt ∈ Y and we incur a loss of l(yt, pt), where l : Y × P → R+ is a loss function. The forecaster H updates itself based on xt, yt, and we proceed to time t + 1. Unlike in classical machine learning, we do not assume that the xt, yt are i.i.d.: they can be random, deterministic or even chosen by an adversary. Online learning algorithms feature strong performance guarantees in this regime, where performance is usually measured in terms of regret RT (q) relative to a constant prediction q, RT (q) = (cid:80)T t=1 l(yt, pt) − l(yt, q). The worst-case regret at time T equals RT = maxq∈P RT (q). In this paper, the predictions pt are probability distributions over the outcome yt. We focus on regression, where yt ∈ R and the prediction pt can be represented by a cumulative distribution function (CDF), denoted Ft : R → [0, 1] and defined as Ft(z) = pt(y ≤ z). Learning with Expert Advice A special case of this framework arises when each xt represents advice from N experts, and H outputs pt ∈ ∆N −1, a distribution over experts. Nature reveals an outcome yt, resulting in an expected loss of (cid:80)N i=1 ptil(yt, ati), where l(yt, ati) is the loss under expert i's advice ati. Performance in this setting is measured using two notions of regret. Definition 3. The external regret Rext Rext T = T (cid:88) t=1 ̄l(yt, pt) − min i∈[N ] T (cid:88) t=1 T and the internal regret Rint T are defined as T (cid:88) l(yt, ait) Rint T = max i,j∈[N ] t=1 pti (l(yt, ait) − l(yt, ajt)) , where ̄l(y, p) = (cid:80)N i=1 pil(y, ait) is the expected loss. Calibration for Online Binary Calibration For now, we focus on the l1 norm, and we define the calibration error of a forecaster Scal as CT = N (cid:88) i=0 (cid:12) (cid:12) (cid:12) (cid:12) ρT (i/N ) − (cid:32) i N (cid:12) (cid:12) (cid:12) (cid:12) 1 T T (cid:88) I t=1 (cid:33) , {pt= i N } (2) (cid:80)T t=1 ytIpt=p where ρT (p) = (cid:80)T Ipt=p when we predicted p. We further define the calibration error when Scal t=1 predicts i/N as j denotes the frequency at which event y = 1 occurred over the times C (j) T,i = (cid:12) (cid:12) (cid:12) (cid:12) ρ(j) T (i/N ) − (cid:32) i N (cid:12) (cid:12) (cid:12) (cid:12) 1 Tj T (cid:88) t=1 (cid:33) I(j) t,i N ∩ F H t,i = I{pt = i where I(j) t and predicts i/N . Similarly, It,i = I{pt = i/N } = (cid:80)M time t, and Tj = (cid:80)T is triggered at time I(j) t,i indicates that i/N was predicted at I(j) t,i is the number of calls to Scal M )} is an indicator for the event that Scal t ∈ [ j−1 M , j . Also, (cid:80)N j=1 j j t=1 i=0 ρ(j) T (i/N ) = (cid:80)T I(j) t,i yt I(j) t,i t=1 (cid:80)T t=1 is the empirical success rate for Scal j . Note that with these definitions, we may write the calibration losses of Scal j 12 as C (j) T = (cid:80)N i=0 C (j) T,i. Calibration for Regression A sequence of forecasts Ft achieves online quantile calibration for all y ∈ Y and all p ∈ P, ρT (y, p) → p, a.s. as T → ∞, where ρT (y, p) = (cid:80)T t=1 (cid:80)T Iyt≤y,Ft(y)=p IFt(y)=p t=1 In other words, out of the times when the predicted probability Ft(y′) for {yt ≤ y′} to be p, the event {yt ≤ y′} holds a fraction p of the time. We also seek to quantify more precisely the calibration of Algorithm 2, specifically compare ρ(y, p) with p. We define for this the quantity CT,i(y) = (cid:12) (cid:12) (cid:12) (cid:12) ρT (y, i/N ) − (cid:32) i N (cid:12) (cid:12) (cid:12) (cid:12) 1 T T (cid:88) t=1 (cid:33) It,i , and we define the calibration loss of Algorithm 2 at y as CT (y) = (cid:80)N i=0 CT,i(y). Proper Losses The quality of probabilistic forecasts is evaluated using proper losses l. Formally, a loss l(y, p) is proper if p ∈ arg minq∈P Ey∼(p)l(y, q) ∀p ∈ P. An important proper loss for CDF predictions F is the continuous ranked probability score, defined as lCRPS(y, F ) = (cid:90) ∞ −∞ (F (z) − Iy≤z)2dz. A.1 Assumptions We assume that each subroutine Scal is an instance of a binary calibrated forecasting algorithm (e.g., the methods introduced in Chapter 4 in [7]) that produce predictions in [0, 1] that are (ε, l2)-calibrated and that C 2 T ≤ RT + ε uniformly (RT = o(1) as T → ∞; T is the number of calls to instance Scal ). We also assume that for each t, the target yt lies in some bounded interval Y of R of length at most B. j A.2 Online Calibrated Regression 2 , B 2 , −B 2 ] into M intervals I = {[ −B First, we look at algorithms for online calibrated regression (without covariates). Our algorithms leverage classical online binary calibration [13] as a subroutine. Formally, Algorithm 1 partitions [− B M ), ..., [ B 2 ]}; each interval is associated with an instance of an online binary recalibration subroutine Scal [13; 7]. In order to compute Gt(y ≤ z), we invoke the subroutine Scal associated with interval Ij containing z. After observing yt, each Scal observes whether yt falls in its interval and updates its state. Theorem 5. Let YI be the set of upper bounds of the intervals I and let PS be the output space of Scal. Algorithm 1 achieves online calibration and for all y ∈ YI, p ∈ PS we have ρT (y, p) → p a.s. as T → ∞. 2 + B 2 − B M , B j j Proof. The above theorem follows directly from the construction of Algorithm 1: for each y ∈ Y, we run an online binary calibration algorithm to target the event yt ≤ y. Specifically, note that for each y ∈ YI, the empirical frequency ρ(y, p) reduces to the definition of the empirical frequency of a classical binary calibration algorithm targeting probability p and the binary outcome that yt ≤ y. The output of the algorithm for Ft(y) is also a prediction for the binary outcome yt ≤ y produced by a classical onlne binary calibration algorithm. Thus, by construction, we have the desired result. Algorithms Scal for online binary calibration are randomized. Our procedure needs to be randomized as well and this is a fundamental property of our task. Theorem 6. There does not exist a deterministic online calibrated regression algorithm that achieves online calibration. 13 Proof. This claim follows because we can encode a standard online binary calibration problem as calibrated regression. Specifically, given a non-randomized online calibrated regression algorithm, we could solve an online binary classification problem. Suppose the adversary chooses a binary yt ∈ {0, 1} ⊆ [0, 1] that defines one of two classes. Then we can define an instance of calibrated regression with two buckets [0, 0.5) and [0.5, 1). We use the forecast Ft(0.5) as our prediction for yt = 0 and one minus that as the prediction for 1. Then, the error on the ratio ρT (0.5, p) yields the definition of calibration in binary classification. If our deterministic online calibration regression algorithm works, then we have ρT (0.5, p) → p, which means that the empirical ratio for the binary algorithm goes to the predicted frequency p as well. But that would yield a deterministic algorithm for online binary calibration, which we know can't exist. A.3 Proving the Calibration of Algorithm 2 First, we will provide a proof of Lemma 3; this proof holds for any norm lp. Lemma 4 (Preserving calibration). If each Scal (ε, lp)-calibrated and the following bound holds uniformly over T : j is (ε, lp)-calibrated, then Algorithm 2 is also CT ≤ M (cid:88) j=1 Tj T RTj + ε. (3) t,i and note that (cid:80)T I(j) t=1 It,i = (cid:80)M j=1 I(j) i . We may write Proof. Let I(j) i = (cid:80)T t=1 CT,i(y) = It,i (cid:80)T t=1 T (cid:12) (cid:12) (cid:12) (cid:12) ρT (y, i/N ) − i N p (cid:12) (cid:12) (cid:12) (cid:12) = (cid:80)M j=1 T I(j) i (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) M (cid:88) j=1 (cid:80)T I(j) t,i otj I(j) i t=1 (cid:80)M j=1 − i N p (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) I(j) i (cid:80)M j=1 T = (cid:12) (cid:12) M (cid:88) (cid:12) (cid:12) (cid:12) (cid:12) j=1 i ρ(j) I(j) (cid:80)M T (y, i/N ) I(j) i j=1 − i N p (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ M (cid:88) j=1 I(j) i T (cid:12) (cid:12) (cid:12) (cid:12) ρ(j) T (y, i/N ) − i N p (cid:12) (cid:12) (cid:12) (cid:12) = M (cid:88) j=1 Tj T C (j) T,i, where in the last line we used Jensen's inequality. Plugging in this bound in the definition of CT , we find that CT = N (cid:88) i=1 CT,i ≤ M (cid:88) N (cid:88) j=1 i=1 Tj T C (j) T,i ≤ M (cid:88) j=1 Tj T RTj + ε, Since each RTj → 0, Algorithm 2 will be ε-calibrated. A.4 Recalibrated Forecasts Have Low Regret Under the CRPS Loss Lemma 5 (Recalibration preserves accuracy). Consider Algorithm 2 with parameters M ≥ N > 1/ε. Suppose that the Scal are (ε, l2)-calibrated. Then the recalibrated Gt a.s. have vanishing lCRPS-regret relative to Ft: (cid:32) 1 T T (cid:88) t=1 lim T →∞ lCRPS(yt, Gt) − 1 T T (cid:88) t=1 (cid:33) lCRPS(yt, Ft) < 2/N. (4) Proof. Our proof will rely on the following fact about any online calibration subroutine Scal. We start by formally establishing this fact. Fact 1. Let Scal be an binary online calibration subroutine with actions 0, 1/N, ...1 whose l2 calibration error C p T is bounded by RT = o(T ). Then the predictions pt from Scal also minimize external regret relative to any single action i/N : T (cid:88) (pt − yt)2 − ( t=1 i N − yt)2 ≤ N RT for all i 14 We refer the reader to Lemma 4.4 in [7] for a proof. M , 2 M ), [ 1 Let I = Next, we prove our main claim. M , j {[0, 1 M ), ..., [ M −1 M ) be the j-th interval. Also, for each j, we use ij denote the index i ∈ [N ] that is closest to j in the sense of | ij N . By our assumption that M ≥ N , this index exists. M , 1]} be a set of intervals that partition [0, 1] and let Ij = [ j−1 We start with some notation. M | ≤ 1 N − j We begin our proof by from the definition of the CRPS regret: 1 T T (cid:88) t=1 lCRPS(yt, Gt) − 1 T T (cid:88) t=1 lCRPS(yt, Ft) = = 1 T T (cid:88) (cid:90) ∞ t=1 −∞ (Gt(z) − Iyt≤z)2dz − 1 T T (cid:88) (cid:90) ∞ t=1 −∞ (Ft(z) − Iyt≤z)2dz (cid:90) ∞ −∞ (cid:90) = z∈Y (cid:90) = z∈Y 1 T 1 T 1 T T (cid:88) t=1 T (cid:88) t=1 T (cid:88) t=1 (cid:2)(Gt(z) − Iyt≤z)2 − (Ft(z) − Iyt≤z)2(cid:3) dz (cid:2)(Gt(z) − Iyt≤z)2 − (Ft(z) − Iyt≤z)2(cid:3) dz (cid:2)(Gt(z) − IFt(yt)≤Ft(z))2 − (Ft(z) − IFt(yt)≤Ft(z))2(cid:3) dz In the second-to-last line, we have used the fact that the forecasts have finite support, i.e., the yt live within a closed bounded set Y. In the last line, we replaced the event yt ≤ z with Ft(yt) ≤ Ft(z), which is valid because Ft is monotonically increasing. Let's now analyze the above integrand for one fixed value of z: 1 T T (cid:88) t=1 (cid:2)(Gt(z) − IFt(yt)≤Ft(z))2 − (Ft(z) − IFt(yt)≤Ft(z))2(cid:3) . Since Ft outputs a finite number of values in the set {0, 1 j/M taken by Ft at z. Additionally, observe that I variable given to Scal Gt(z) to be the output of Scal for the above integrand for a fixed z: M , ..., 1}, let j/M denote the value Ft(z) = = otj, where otj is the binary target M , we have defined at time t, which we denote as Gtj. This yields the following expression at the end of step t. Finally, recall that when Ft(z) = j Ft(yt)≤ j M j j 1 T T (cid:88) (cid:20) (Gtj − otj)2 − ( t=1 − otj)2 (cid:21) . j M Next, recall that ij is the index i ∈ [N ] that is closest to j in the sense of | ij that M ≥ N . Note that this implies N − j M | ≤ 1 N . Recall also l2( j M , otj) ≥ l2( ij M , otj) + ∂l2 ∂p (p, otj)( j M − ij M ) ≥ 2 N . Using this inequality, we obtain the following expression for our earlier integrand: 1 T T (cid:88) (cid:20) t=1 (Gtj − otj)2 − ( ij N − otj)2 (cid:21) + 2 N . Crucially, this expression is precisely the external regret of recalibration subroutine Scal relative to the fixed action ij N and measured in terms of the L2 loss. By Fact 1, we know that this external regret is bounded by N RT . Since this bound holds pointwise for any value of z, we can plug it into our j 15 original integral to obtain a bound on the CRPS regret: T (cid:88) (cid:2)(Gt(z) − IFt(yt)≤Ft(z))2 − (Ft(z) − IFt(yt)≤Ft(z))2(cid:3) dz 1 T (cid:90) z∈Y (cid:90) ≤ t=1 (cid:20) N RT + (cid:21) 2 N dz z∈Y ≤ N BRT + 2B N In the last line, we used the fact that the integration is over a finite set Y whose measure is bounded by B > 0. This establishes the main claim of this proposition. A.5 Correctness of Algorithm 2 We now prove our main result about the correctness of Algorithm 2. Theorem 1. Let Scal be an (l1, ε/3B)-calibrated online subroutine with resolution N ≥ 3B/ε. and let l be a proper loss satisfying the assumptions of Lemma 2. Then Algorithm 2 with parameters Scal and N is an ε-accurate online recalibration algorithm for the loss l. Proof. It is easy to show that Algorithm 2 is (l1, ε/3B)-calibrated by the same argument as Lemma 1 (see the next section for a formal proof). By Lemma 4, its regret w.r.t. tends to < 3B/N < ε. Hence, the theorem follows. the raw F H t A.6 Calibration implies no internal regret Here, we show that a calibrated forecaster also has small internal regret relative to any bounded proper loss [21]. Lemma 1. If l is a bounded proper loss, then an (ε, l1)-calibrated Scal a.s. has a small internal regret w.r.t. l and satisfies uniformly over time T the bound Rint T = max ij T (cid:88) t=1 Ipt=i/N (l(yt, i/N ) − l(yt, j/N )) ≤ 2B(RT + ε). (5) Proof. Let T be fixed for the rest of this proof. Let Iti = Ipt=i/N be the indicator of Scal outputting prediction i/N at time t, let Ti = (cid:80)T Iti denote the number of time i/N was predicted, and let t=1 Rint T,ij = T (cid:88) t=1 Iti (l(yt, i/N ) − l(yt, j/N )) denote the gain (measured using the proper loss l) from retrospectively switching all the plays of action i to j. This value forms the basis of the definition of internal regret (Section 2). Let T (i, y) = (cid:80)T {0, 1}. Observe that we have ItiI{yt = y} denote the total number of i/N forecasts at times when yt = y ∈ t=1 T (i, y) = T (cid:88) t=1 ItiI{yt = y} = (cid:80)T t=1 ItiI{yt = y} Ti Ti = (cid:80)T t=1 ItiI{yt = y} (cid:80)T Iti t=1 Ti = q(i, y)Ti + Ti (cid:32) (cid:80)T t=1 ItiI{yt = y} (cid:80)T Iti t=1 (cid:33) − q(i, y) = q(i, y)Ti + Ti (ρT (i/N ) − i/N ) , where q(i, y) = i/N if y = 1 and 1 − i/N if y = 0. The last equality follows using some simple algebra after adding and subtracting one inside the parentheses in the second term. 16 We now use this expression to bound Rint T,ij: T (cid:88) Rint T,ij = Iti (l(yt, i/N ) − l(yt, j/N )) = ≤ t=1 (cid:88) y∈{0,1} (cid:88) y∈{0,1} T (i, y) (l(y, i/N ) − l(y, j/N )) q(i, y)Ti (l(y, i/N ) − l(y, j/N )) + (cid:88) y∈{0,1} BTi |ρT (i/N ) − i/N | ≤ 2BTi |ρT (i/N ) − i/N | , where in the first inequality, we used l(y, i/N ) − l(y, j/N ) ≤ l(y, i/N ) ≤ B, and in the second inequality we used the fact that l is a proper loss. Since internal regret equals Rint T,ij, we have T = maxi,j Rint N (cid:88) Rint T,ij ≤ 2B i=0 Rint T ≤ N (cid:88) i=1 max j Ti |ρ(i/N ) − i/N | ≤ 2B(RT + ε). B Impossibility of recalibrating non-proper losses We conclude the appendix by explaining why non-proper losses cannot be calibrated [21]. Theorem 2. If l is not proper, then there is no recalibration algorithm w.r.t. l. Proof. If l is not proper, there exist a p′ and q such that Ey∼Ber(p′)l(y, q) < Ey∼Ber(p′)l(y, p′). Consider a sequence yt for which yt ∼ Ber(p′) for all t. Clearly the prediction of a calibrated forecaster pt much converge to p′ and the average loss will approach l(y, p′). This means that we cannot recalibrate the constant predictor pt = q without making its loss l(y, q) higher. We thus have a forecaster that cannot be recalibrated with respect to l. C Experiments on Bayesian optimization Bayesian optimization attempts to find the global minimum x⋆ = arg minx∈X f (x) of an unknown function f : X → R over an input space X ⊆ RD. We are given an initial labeled dataset xt, yt ∈ X × R for t = 1, 2, ..., N of i.i.d. realizations of random variables X, Y ∼ P . At every time-step t, we use uncertainties from the probabilistic model M : X → (R → [0, 1]) of f to select the next data-point xnext and iteratively update the model M. Algorithm 3 outlines this procedure. Since the black-box function evaluation can be expensive, the objective of Bayesian optimization in this context is to find the minima (or maxima) of this function while using a small number of function evaluations. We use online calibration to improve the uncertainties estimated by the model M. Following Desh- pande and Kuleshov [9], we use Algorithm 5 to recalibrate the model M. Since the dataset size is small, we use the CREATESPLITS function to generate leave-one-out cross-validation splits of our dataset D. We train the base model on train-split and use this to obtain probabilistic forecast for data in the test-split. We collect these predictions on all test-splits to form our recalibration dataset and use Algorithm 2 to perform calibration. Following Deshpande and Kuleshov [9], we perform calibrated Bayesian optimization as detailed in Algorithm 4. Specifically, we recalibrate the base model M after every step in Bayesian optimization. We use some popular benchmark functions to evaluate the performance of Bayesian optimization. We initialize the Bayesian optimization with 3 randomly chosen data-points. We use the Lower Confidence Bound (LCB) acquisition function to select the data-point xt and evaluate a potentially expensive function f as xt to obtain yt. At any given time-step T , we have the dataset DT = {xt, yt}T t=1 collected iteratively. 17 In Figure 5, we see that using online calibration of uncertainties from M allows us to reach a lower minimum or find the same minimum with a smaller number of steps with Bayesian optimization. (a) SixHumpCamel (b) Beale (c) Mccormick Figure 5: Online Calibration Improves Bayesian optimization Algorithm 3 Bayesian Optimization 1: Initialize base model M with data D = {xt, yt}M 2: for n = 1, 2, ..., T : do xnext = arg maxx∈X (Acquisition(x, R ◦ M)). 3: ynext = f (xnext). 4: 5: D = D (cid:83){(xnext, ynext)} 6: Update model M with data D t=0. Algorithm 4 Calibrated Bayesian Optimization [9] 1: Initialize base model M with data D = {xt, yt}M 2: R ← CALIBRATE(M, D). 3: for n = 1, 2, ..., T : do xnext = arg maxx∈X (Acquisition(x, R ◦ M)). 4: ynext = f (xnext). 5: 6: D = D (cid:83){(xnext, ynext)} 7: 8: R ← CALIBRATE(M, D) Update model M with data D t=0. t=0 t=0. Algorithm 5 CALIBRATE [9] Require: Base model M, Dataset D = {xt, yt}N 1: Train a base model M on training dataset {xt, yt}N 2: Initialize recalibration dataset Drecal = φ 3: S = CREATESPLITS(D) 4: for (Dtrain, Dtest) in S: do 5: Dtrain = Train Dataset {xt, yt}M 6: Dtest = Test Dataset {xt, yt}L 7: Dtrain = TRAINSPLIT(s), Dtest = TESTSPLIT(s) 8: 9: 10: Drecal = Drecal 11: Train recalibrator model R on the recalibration dataset Drecal using Algorithm 2 12: Return (R) Train base model M′ on dataset Dtrain Compute CDF dataset {[M ′(xt)](yt)}M t=1 (cid:83){[M′(xt)](yt), yt}M t=1 from dataset Dtest t=0 in split s. t=0 in split s. 18
http://arxiv.org/abs/2302.12192v1
2023-02-23T17:34:53
2023-02-23T17:34:53
Aligning Text-to-Image Models using Human Feedback
Deep generative models have shown impressive results in text-to-image synthesis. However, current text-to-image models often generate images that are inadequately aligned with text prompts. We propose a fine-tuning method for aligning such models using human feedback, comprising three stages. First, we collect human feedback assessing model output alignment from a set of diverse text prompts. We then use the human-labeled image-text dataset to train a reward function that predicts human feedback. Lastly, the text-to-image model is fine-tuned by maximizing reward-weighted likelihood to improve image-text alignment. Our method generates objects with specified colors, counts and backgrounds more accurately than the pre-trained model. We also analyze several design choices and find that careful investigations on such design choices are important in balancing the alignment-fidelity tradeoffs. Our results demonstrate the potential for learning from human feedback to significantly improve text-to-image models.
[ "Kimin Lee", "Hao Liu", "Moonkyung Ryu", "Olivia Watkins", "Yuqing Du", "Craig Boutilier", "Pieter Abbeel", "Mohammad Ghavamzadeh", "Shixiang Shane Gu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12192v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12192v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.CV" ]
Aligning Text-to-Image Models using Human Feedback Kimin Lee 1 Hao Liu 2 Moonkyung Ryu 1 Olivia Watkins 2 Yuqing Du 2 Craig Boutilier 1 Pieter Abbeel 2 Mohammad Ghavamzadeh 1 Shixiang Shane Gu 1 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 2 9 1 2 1 . 2 0 3 2 : v i X r a Abstract Deep generative models have shown impressive results in text-to-image synthesis. However, cur- rent text-to-image models often generate images that are inadequately aligned with text prompts. We propose a fine-tuning method for aligning such models using human feedback, comprising three stages. First, we collect human feedback assessing model output alignment from a set of diverse text prompts. We then use the human- labeled image-text dataset to train a reward func- tion that predicts human feedback. Lastly, the text-to-image model is fine-tuned by maximizing reward-weighted likelihood to improve image- text alignment. Our method generates objects with specified colors, counts and backgrounds more accurately than the pre-trained model. We also analyze several design choices and find that careful investigations on such design choices are important in balancing the alignment-fidelity tradeoffs. Our results demonstrate the potential for learning from human feedback to significantly improve text-to-image models. 1. Introduction Deep generative models have recently shown remark- able success in generating high-quality images from text prompts (Ramesh et al., 2021; 2022; Saharia et al., 2022; Yu et al., 2022b; Rombach et al., 2022). This success has been driven in part by the scaling of deep generative models to large-scale datasets from the web such as LAION (Schuh- mann et al., 2021; 2022). However, major challenges remain in domains where large-scale text-to-image mod- els fail to generate images that are well-aligned with text prompts (Feng et al., 2022; Liu et al., 2022a;b). For in- stance, current text-to-image models often fail to produce reliable visual text (Liu et al., 2022b) and struggle with compositional image generation (Feng et al., 2022). 1Google Research 2University of California, Berkeley. Corre- spondence to: Kimin Lee <[email protected]>. In language modeling, learning from human feedback has emerged as a powerful solution for aligning model behavior with human intent (Ziegler et al., 2019; Stiennon et al., 2020; Wu et al., 2021; Nakano et al., 2021; Ouyang et al., 2022; Bai et al., 2022a). Such methods first learn a reward function intended to reflect what humans care about in the task, using human feedback on model outputs. The language model is then optimized using the learned reward function by a reinforcement learning (RL) algorithm, such as proximal policy optimization (PPO; Schulman et al. 2017). This RL with human feedback (RLHF) framework has successfully aligned large-scale language models (e.g., GPT-3; Brown et al. 2020) with complex human quality assessments. Motivated by the success of RLHF in language domains, we propose a fine-tuning method for aligning text-to-image models using human feedback. Our method consists of the following steps illustrated in Figure 1: (1) We first generate diverse images from a set of text prompts designed to test output alignment of a text-to-image model. Specifically, we examine prompts where pre-trained models are more prone to errors – generating objects with specific colors, counts, and backgrounds. We then collect binary human feedback assessing model outputs. (2) Using this human- labeled dataset, we train a reward function to predict human feedback given the image and text prompt. We propose an auxiliary task-identifying the original text prompt within a set of perturbed text prompts-to more effectively ex- ploit human feedback for reward learning. This technique improves the generalization of reward function to unseen images and text prompts. (3) We update the text-to-image model via reward-weighted likelihood maximization to bet- ter align it with human feedback. Unlike the prior work (Sti- ennon et al., 2020; Ouyang et al., 2022) that uses RL for optimization, we update the model using semi-supervised learning to measure model-output quality w.r.t. the learned reward function. We fine-tune the stable diffusion model (Rombach et al., 2022) using 27K image-text pairs with human feedback. Our fine-tuned model shows improvement in generating ob- jects with specified colors, counts, and backgrounds. More- over, it improves compositional generation (i.e., can bet- Aligning Text-to-Image Models using Human Feedback Figure 1. The steps in our fine-tuning method. (1) Multiple images sampled from the text-to-image model using the same text prompt, followed by collection of (binary) human feedback. (2) A reward function is learned from human assessments to predict image-text alignment. We also utilize an auxiliary objective called prompt classification, which identifies the original text prompt within a set of perturbed text prompts. (3) We update the text-to-image model via reward-weighted likelihood maximization. ter generate unseen objects1 given unseen combinations of color, count, and background prompts). We also observe that the learned reward function is better aligned with human assessments of alignment than CLIP score (Radford et al., 2021) on tested text prompts. We analyze several design choices, such as using an auxiliary loss for reward learning and the effect of using "diverse" datasets for fine-tuning. We can summarize our main contributions as follows: • We propose a simple yet efficient fine-tuning method for aligning a text-to-image model using human feedback. • We show that fine-tuning with human feedback signif- icantly improves the image-text alignment of a text-to- image model. On human evaluation, our model achieves up to 47% improvement in image-text alignment at the expense of mildly degraded image fidelity. • We show that the learned reward function predicts human assessments of the quality more accurately than the CLIP score (Radford et al., 2021). In addition, we show that rejection sampling based on our learned reward function can also significantly improve the image-text alignment. • Naive fine-tuning with human feedback can significantly reduce the image fidelity, despite better alignment. We find that careful investigations on several design choices are important in balancing alignment-fidelity tradeoffs. 1We use the term "unseen objects" w.r.t. our human dataset, i.e., they are not included in the human dataset but pre-training dataset would contain them. Even though our results do not address all the failure modes of the existing text-to-image models, we hope that this work highlights the potential of learning from human feedback for aligning these models. 2. Related Work Text-to-image models. Various deep generative models, such as variational auto-encoders (Kingma & Welling, 2013), generative adversarial networks (Goodfellow et al., 2020), auto-regressive models (Van Den Oord et al., 2016), and diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020) have been proposed for image distributions. Com- bined with the large-scale language encoders (Radford et al., 2021; Raffel et al., 2020), these models have shown impres- sive results in text-to-image generation (Ramesh et al., 2022; Saharia et al., 2022; Yu et al., 2022b; Rombach et al., 2022). However, text-to-image models frequently struggle to gen- erate images that are well-aligned with text prompts (Feng et al., 2022; Liu et al., 2022a;b). Liu et al. (2022b) show that current models fail to produce reliable visual text and often perform poorly w.r.t. compositional generation (Feng et al., 2022; Liu et al., 2022a). Several techniques, such as character-aware text encoders (Xue et al., 2022; Liu et al., 2022b) and structured representations of language inputs (Feng et al., 2022) have been investigated to ad- dress these issues. We study learning from human feedback, which aligns text-to-image models directly using human feedback on model outputs. Step 1. Collecting human dataStep 2. Learning reward functionStep 3. Updating text-to-image modelText-to-Image ModelGreen dogRed dogTwo dogsOne dog(a) Predicting human feedback(b) Auxiliary objective: prompt classificationGreen dogReward model1Reward model0A Green dogReward modelB Red dogCBlue dogD Purple dogA<BCDGreen dogReward modelGreen dogGreen dogGreen dogGreen dog0.90.00.90.7Reward-weighted likelihood maximization Aligning Text-to-Image Models using Human Feedback Fine-tuning with few images (Ruiz et al., 2022; Kumari et al., 2022; Gal et al., 2022) for personalization of text- to-image diffusion models is also related with our work. DreamBooth (Ruiz et al., 2022) showed that text-to-image models can generate diverse images in a personalized way by fine-tuning with few images, and Kumari et al. (2022) proposed a more memory and computationally efficient method. In this work, we demonstrate that it is possi- ble to fine-tune text-to-image models using simple binary (good/bad) human feedback. Learning with human feedback. Human feedback has been used to improve various AI systems, from transla- tion (Bahdanau et al., 2016; Kreutzer et al., 2018), to web question-answering (Nakano et al., 2021), to story gener- ation (Zhou & Xu, 2020), to training RL agents without the need for hand-designed rewards (MacGlashan et al., 2017; Christiano et al., 2017; Warnell et al., 2018; Ibarz et al., 2018; Lee et al., 2021, inter alia), and to more truthful and harmless instruction following and dialogue (Ouyang et al., 2022; Bai et al., 2022a; Ziegler et al., 2019; Wu et al., 2021; Stiennon et al., 2020; Liu et al., 2023; Scheurer et al., 2022; Bai et al., 2022b, inter alia). In relation to prior works that focus on improving language models and game agents with human feedback, our work explores using human feed- back to align multi-modal text-to-image models with human preference. Many prior works on learning with human feed- back consist of learning a reward function and maximizing reward weighted likelihood (often dubbed as supervised fine-tuning) (see e.g. Ouyang et al., 2022; Ziegler et al., 2019; Stiennon et al., 2020) Inspired by their successes, we propose a fine-tuning method with human feedback for improving text-to-image models. Evaluating image-text alignment. To measure the image-text alignment, various evaluation protocols have been proposed (Madhyastha et al., 2019; Hessel et al., 2021; Saharia et al., 2022; Yu et al., 2022b). Most prior works (Ramesh et al., 2022; Saharia et al., 2022; Yu et al., 2022b) use the alignment score of image and text embed- dings determined by pre-trained multi-modal models, such as CLIP (Radford et al., 2021) and CoCa (Yu et al., 2022a). However, since scores from pre-trained models are not cali- brated with human intent, human evaluation has also been introduced (Saharia et al., 2022; Yu et al., 2022b). In this work, we train a reward function that is better aligned with human evaluations by exploiting pre-trained representations and (a small amount) of human feedback data. 3. Main Method To improve the alignment of generated images with their text prompts, we fine-tune a pre-trained text-to-image model (Ramesh et al., 2022; Saharia et al., 2022; Rom- bach et al., 2022) by repeating the following steps shown in Figure 1. We first generate a set of diverse images from a col- lection of text prompts designed to test various capabilities of the text-to-image model. Human raters provide binary feedback on these images (Section 3.1). Next we train a re- ward model to predict human feedback given a text prompt and an image as inputs (Section 3.2). Finally, we fine-tune the text-to-image model using reward-weighted log likeli- hood to improve text-image alignment (Section 3.3). 3.1. Human Data Collection Image-text dataset. To test specific capabilities of a given text-to-image model, we consider three categories of text prompts that generate objects with a specified count, color, or background.2 For each category, we generate prompts by combining a word or phrase from that category with some object; e.g., combining green (or in a city) with dog. We also consider combinations of the three cat- egories (e.g., two green dogs in a city). From each prompt, we generate up to 60 images using a pre- trained text-to-image model-in this work, we use Stable Diffusion v1.5 (Rombach et al., 2022). Human feedback. We collect simple binary feedback from multiple human labelers on the image-text dataset. Labelers are presented with three images generated from the same prompt and are asked to assess whether each image is well-aligned with the prompt ("good") or not ("bad").3 We use binary feedback given the simplicity of our prompts- the evaluation criterion are fairly clear. More informative human feedback, such as ranking (Stiennon et al., 2020; Ouyang et al., 2022), should prove useful when more com- plex or subjective text prompts are used (e.g., artistic or open-ended generation). 3.2. Reward Learning To measure image-text alignment, we learn a reward func- tion rφ(x, z) (parameterized by φ) that maps the CLIP em- beddings4 (Radford et al., 2021) of an image x and a text prompt z to a scalar value. It is trained to predict human feedback y ∈ {0, 1} (1 = good, 0 = bad). Formally, given the human feedback dataset Dhuman = {(x, z, y)}, the reward function rφ is trained by minimizing the mean-squared-error (MSE): LMSE(φ) = E (x,z,y)∼Dhuman (cid:2) (y − rφ(x, z))2 (cid:3). 2For simplicity, we consider a limited class of text categories in this work, deferring the study of broader and more complex categories to future work. 3Labelers are instructed to skip a query if it is hard to answer. Skipped queries are not used in training. 4To improve generalization ability, we use CLIP embeddings pre-trained on various image-text samples. Aligning Text-to-Image Models using Human Feedback Prompt classification. Data augmentation can signifi- cantly improve the data-efficiency and performance of learn- ing (Krizhevsky et al., 2017; Cubuk et al., 2019). To ef- fectively exploit the feedback dataset, we design a simple data augmentation scheme and auxiliary loss for reward learning. For each image-text pair that has been labeled good, we generate N − 1 text prompts with different seman- tics than the original text prompt. For example, we might generate {Blue dog , . . . , Green dog} given the orig- inal prompt Red dog.5 This process generates a dataset Dtxt = {(x, {zj}N j=1, including the original, for each image x, and the index i(cid:48) of the original prompt. j=1, i(cid:48))} with N text prompts {zj}N We use the augmented prompts in an auxiliary task, namely, classifying the original prompt for reward learning. Our prompt classifier uses the reward function rφ as follows: Pφ(i|x, {zj}N j=1) = exp(rφ(x, zi)/T ) j exp(rφ(x, zj)/T ) (cid:80) , ∀i ∈ [N ], where T > 0 is the temperature. Our auxiliary loss is Category Count Color Background Combination Examples One dog; Two dogs; Three dogs; Four dogs; Five dogs; A green colored dog; A red colored dog; A dog in the forest; A dog on the moon; Two blue dogs in the forest; Five white dogs in the city; Table 1. Examples of text categories. Category Count Color Background Combination Total Total # of images Human feedback (%) Good Bad Skip 6480 3480 2400 15168 27528 34.4 70.4 66.9 35.8 46.5 61.0 20.8 33.1 59.9 48.5 4.6 8.8 0.0 4.3 5.0 Lpc(φ) = E (x,{zj }N j=1,i(cid:48))∼Dtxt (cid:2)LCE(cid:0)Pφ(i|x, {zj}N j=1), i(cid:48)(cid:1)(cid:3), (1) where LCE is the standard cross-entropy loss. This encour- ages rφ to produce low values for prompts with different semantics than the original. Our experiments show this aux- iliary loss improves the generalization to unseen images and text prompts. Finally, we define the combined loss as Lreward(φ) = LMSE(φ) + λLpc(φ), where λ is the penalty parameter. The pseudo code of reward learning is in Appendix E. 3.3. Updating the Text-to-Image Model We use our learned rφ to update the text-to-image model p with parameters θ by minimizing the loss L(θ) = E (x,z)∼Dmodel (cid:2) − rφ(x, z) log pθ(x|z)(cid:3) (cid:2) − log pθ(x|z)(cid:3), + β E (x,z)∼Dpre (2) where Dmodel is the model-generated dataset (i.e., images generated by the text-to-image model on the tested text prompts), Dpre is the pre-training dataset, and β is a penalty parameter. The first term in (2) minimizes the reward- weighted negative log-likelihood (NLL) on Dmodel.6 By 5We use a rule-based strategy to generate different text prompts (see Appendix E for more details). 6To increase diversity, we collect an unlabeled dataset Dunlabel by generating more images from the text-to-image model, and use both the human-labeled dataset Dhuman and the unlabeled dataset Dunlabel for training, i.e., Dmodel = Dhuman ∪ Dunlabel. Table 2. Details of image-text datasets and human feedback. evaluating the quality of the outputs using a reward func- tion aligned with the text prompts, this term improves the image-text alignment of the model. Typically, the diversity of the model-generated dataset is limited, which can result in overfitting. To mitigate this, similar to Ouyang et al. (2022), we also minimize the pre- training loss, the second term in (2). This reduces NLL on the pre-training dataset Dpre. In our experiments, we ob- served regularization in the loss function L(θ) in (2) enables the model to generate more natural images. Different objective functions and algorithms (e.g., PPO; Schulman et al. 2017) could be considered for up- dating the text-to-image model similar to RLHF fine- tuning (Ouyang et al., 2022). We believe RLHF fine-tuning may lead to better models because it uses online sample generation during updates and KL-regularization over the prior model. However, RL usually requires extensive hy- perparameter tuning and engineering, thus, we defer the extension to RLHF fine-tuning to future work. 4. Experiments We describe a set of experiments designed to test the efficacy of our fine-tuning approach with human feedback. 4.1. Experimental Setup Models. For our baseline generative model, we use sta- ble diffusion v1.5 (Rombach et al., 2022), which has been Aligning Text-to-Image Models using Human Feedback (a) Seen text prompt: Two green dogs on the table. (b) Unseen text prompt (unseen object): Four tigers in the field. (c) Unseen text prompt (artistic generation): Oil painting of sunflowers. Figure 2. Samples from the original Stable Diffusion model (left) and our fine-tuned model (right). (a) Our model generates high-quality seen object (dog) with specified color, count and background. on seen text prompts. (b) Our model generates an unseen object (tiger) with specified color, count, and background. (c) Our model still generates reasonable images from unseen text categories (artistic generation). pre-trained on large image-text datasets (Schuhmann et al., 2021; 2022).7 For fine-tuning, we freeze the CLIP language encoder (Radford et al., 2021) and fine-tune only the dif- fusion module. For the reward model, we use ViT-L/14 CLIP model (Radford et al., 2021) to extract image and text embeddings and train a MLP using these embeddings as input. More experimental details (e.g., model architectures and the final hyperparameters) are reported in Appendix D. Datasets. From a set of 2700 English prompts (see Table 1 for examples), we generate 27K images using the stable diffusion model (see Appendix B for further details). Table 2 shows the feedback distribution provided by multiple human labelers, which has been class-balanced. We note that the stable diffusion model struggles to generate the number of objects specified by the prompt, but reliably generates 7Our fine-tuning method can be used readily with other text- to-image models, such as Imagen (Saharia et al., 2022), Parti (Yu et al., 2022b) and Dalle-2 (Ramesh et al., 2022). specified colors and backgrounds. We use 23K samples for training, with the remaining sam- ples used for validation. We also use 16K unlabeled samples for the reward-weighted loss and a 625K subset8 of LAION- 5B (Schuhmann et al., 2022) filtered by an aesthetic score predictor 9 for the pre-training loss. 4.2. Text-Image Alignment Results Human evaluation. We measure human ratings of image alignment with 120 text prompts (60 seen text prompts and 60 unseen10 text prompts), testing the ability of the models to render different colors, number of objects, and 8https://huggingface.co/datasets/ ChristophSchuhmann/improved_aesthetics_6. 5plus 9https://github.com/christophschuhmann/ improved-aesthetic-predictor 10Here, "unseen" text prompts consist of "unseen" objects, which are not in our human dataset. Aligning Text-to-Image Models using Human Feedback (a) Comparison with CLIP score (Radford et al., 2021) (b) Performance of reward function versus data size Figure 3. (a) Accuracy of CLIP score (Radford et al., 2021) and our reward functions on predicting the preferences of human labelers. For our method, we consider a variant of our reward function, which is not trained with prompt classification (PC) loss in (1). (b) Performance of reward functions with varying the size of the training dataset. As shown in Figure 4, our method significantly improves image-text alignment against the original model. Specif- ically, 50% of samples from our model receive at least two-thirds vote (7 or more positive votes) for image-text alignment. However, fine-tuning somewhat degrades image fidelity (15% compared to 10%). We expect that this is be- cause (i) we asked the labelers to provide feedback mainly on alignment, (ii) the diversity of our human data is limited, and (iii) we used a small subset of pre-training dataset for fine-tuning.12 This issue can presumably be mitigated with larger rater and pre-training datasets. Qualitative comparison. Figure 2 shows image samples from the original model and our fine-tuned counterpart (see Appendix A for more image examples). While the original often generates images with missing details (e.g., color, background or count) (Figure 2(a)), our model generates objects that adhere to the prompt-specified colors, counts and backgrounds. Of special note, our model generates high-quality images on unseen text prompts that specify unseen objects (Figure 2(b)). Our model also generates reasonable images given unseen text categories, such as artistic generation (Figure 2(c)). However, we also observe several issues of our fine-tuned models. First, for some specific text prompts, our fine- tuned model generates oversaturated and non-photorealistic images. Our model occasionally duplicates entities within the generated images or produces lower-diversity images for the same prompt. We expect that it would be possible to address these issues with larger (and diverse) human datasets and better optimization (e.g., RL). 12Similar issue, which is akin to the alignment tax, has been observed in language domains (Askell et al., 2021; Ouyang et al., 2022). Figure 4. Human evaluation results on 120 text prompts (60 seen text prompts and 60 unseen text prompts). We generate two sets of images (one from our fine-tuned model and one from the original model) with same text prompt. Then, human raters indicate which one is better, or tie (i.e., two sets are similar) in terms of image- text alignment and image fidelity. Each query is evaluated by 9 independent human raters and we report the percentage of queries based on the number of positive votes. We also highlight the percentage of queries with two-thirds vote (7 or more positive votes) in the black box. backgrounds (see Appendix B for the full set of prompts). Given two (anonymized) sets of images, one from our fine- tuned model and one from the stable diffusion model, we ask human raters to assess which is better w.r.t. image-text alignment and fidelity (i.e., image quality).11 Each query is evaluated by 9 independent human raters. We show the percentage of queries based on the number of positive votes. 11We ask raters to declare a tie if they have similar quality. Seen text promptsUnseen text prompts6065707580859095100Preference accuracy (%)CLIP scoreReward function without PCReward functionSeen text promptsUnseen text prompts6065707580859095100Preference accuracy (%)Training data=11KTraining data=23KFine-tuned modelOriginal modelTie20%40%60%80%100%50%3%10%Image-Text AlignmentFine-tuned modelOriginal modelTie20%40%60%80%100%10%15%0%Fidelity (image quality)Number of votes9/98/97/96/95/94/93/92/91/90/9 Aligning Text-to-Image Models using Human Feedback (a) Fine-tuned model only with human-labeled dataset. (b) Fine-tuned model with human-labeled and unlabeled datasets. (c) Fine-tuned model with human-labeled, unlabeled and pre-training datasets. Figure 5. Samples from fine-tuned models trained with different datasets on unseen text prompts. (a) Fine-tuned model only with human dataset generates low-quality images due to overfitting. (b) Unlabeled samples improve the quality of generated images. (c) Fine-tuned model can generate high-fidelity images by utilizing pre-training dataset. 4.3. Results on Reward Learning Predicting human preferences. We investigate the qual- ity of our learned reward function by evaluating its predic- tion of with human ratings. Given two images from the same text prompt (x1, x2, z), we check whether our reward rφ generates a higher score for the human-preferred image, i.e., rφ(x1, z) > rφ(x2, z) when rater prefers x1. As a baseline, we compare it with the CLIP score (Hessel et al., 2021), which measures image-text similarity in the CLIP embedding space (Radford et al., 2021). Figure 3(a) compares the accuracy of rφ and the CLIP score on unseen images from both seen and unseen text prompts. Our reward (green) more accurately predicts human eval- uation than the CLIP score (red), hence is better aligned with typical human intent. To show the benefit of our aux- iliary loss (prompt classification) in (1), we also assess a variant of our reward function which ignores the auxiliary loss (blue). The auxiliary classification task improves re- ward performance on both seen and unseen text prompts. The gain from the auxiliary loss clearly shows the impor- tance of text diversity and our auxiliary loss in improving data efficiency. Although our reward function is more ac- curate than the CLIP score, its performance on unseen text prompts (∼ 80%) suggests that it may be necessary to use more diverse and large human datasets. Rejection sampling. Similar to Parti (Yu et al., 2022b) and DALL-E (Ramesh et al., 2021), we evaluate a rejection sampling technique, which selects the best output w.r.t. the learned reward function.13 Specifically, we generate 16 im- ages per text prompt from the original stable diffusion model and select the 4 with the highest reward scores. We compare these to 4 randomly sampled images in Figure 6(a). Rejec- tion sampling significantly improves image-text alignment (46% with two-thirds preference vote by raters) without sac- rificing image fidelity. This result illustrates the significant value of the reward function in improving text-to-image models without any fine-tuning. 13Parti and DALL-E use similarity scores of image and text embeddings from CoCa (Yu et al., 2022a) and CLIP (Radford et al., 2021), respectively. Aligning Text-to-Image Models using Human Feedback (a) Original model versus Rejection sampling (b) Fine-tuned model versus Rejection sampling Figure 6. Human evaluation on 120 tested text prompts (60 seen text prompts and 60 unseen text prompts). We generate two sets of images with same text prompt. Then, human raters indicate which one is better, or tie (i.e., two sets are similar) in terms for image-text alignment and image fidelity. Each query is evaluated by 9 independent human raters and we report the percentage of queries based on the number of positive votes. We also highlight the percentage of queries with two-thirds vote (7 or more positive votes) in the black box. (a) For rejection sampling, we generate 16 images per text prompt and select best 4 images based on reward score, i.e., more inference-time compute. (b) Comparison between fine-tuned model and original model with rejection sampling. We also compare our fine-tuned model to the original with rejection sampling in Figure 6(b).14 Our fine-tuned model achieves a 10% gain in image-text alignment (20%-10% two-thirds vote) but sacrifices 17% in image fidelity (3%- 20% two-thirds vote). However, as discussed in Section 4.2, we expect degradation in fidelity to be mitigated with larger human datasets and better hyper-parameters. Note also that rejection sampling has several drawbacks, including increased inference-time computation and the inability to improve the model (since it is output post-processing). 4.4. Ablation Studies Effects of human dataset size. To investigate how hu- man data quality affects reward learning, we conduct an ab- lation study, reducing the number of images per text prompt by half before training the reward function. Figure 3(b) shows that model accuracy decreases on both seen and un- seen prompts as data size decreases, clearly demonstrating the importance of diversity and the amount of rater data. Effects of using diverse datasets. To verify the impor- tance of data diversity, we incrementally include unlabeled and pre-training datasets during fine-tuning. We measure the reward score (image-text alignment) on 120 tested text prompts and FID score (Heusel et al., 2017)-the similarity between generated images and real images-on MS-CoCo validation data (Lin et al., 2014). Table 3 shows that FID score is significantly reduced when the model is fine-tuned using only human data, despite better image-text alignment. 14We remark that rejection sampling can also be applied on top of our fine-tuned model. FID on MS-CoCo (↓) Average rewards on tested prompts (↑) Original model Fine-tuned model w.o unlabeled & pre-train Fine-tuned model w.o pre-train Fine-tuned model 13.97 26.59 21.02 16.76 0.43 0.69 0.79 0.79 Table 3. Comparison with the original Stable Diffusion. For evalu- ating image fidelity, we measure FID scores on the MS-CoCo. For evaluating the image-text alignment, we measure reward scores and CLIP scores on 120 tested text prompts. ↑ (↓) indicates that the higher (lower) number is the better. However, by adding the unlabeled and pre-training datasets, FID score is improved without impacting image-text align- ment. We provide image samples from unseen text prompts in Figure 5. We see that fine-tuned models indeed generate more natural images when exploiting more diverse datasets. 5. Discussion In this work, we have demonstrated that fine-tuning with human feedback can effectively improve the image-text alignment in three domains: generating objects with a speci- fied count, color, or backgrounds. We analyze several design choices (such as using an auxiliary loss and collecting di- verse training data) and find that it is challenging to balance the alignment-fidelity tradeoffs without careful investiga- tions on such design choices. Even though our results do not Original model + rejectionOriginal modelTie20%40%60%80%100%46%3%10%Image-Text AlignmentOriginal model + rejectionOriginal modelTie20%40%60%80%100%12%9%1%Fidelity (image quality)Number of votes9/98/97/96/95/94/93/92/91/90/9Fine-tuned modelOriginal model + rejectionTie20%40%60%80%100%20%10%9%Image-Text AlignmentFine-tuned modelOriginal model + rejectionTie20%40%60%80%100%3%20%0%Fidelity (image quality)Number of votes9/98/97/96/95/94/93/92/91/90/9 Aligning Text-to-Image Models using Human Feedback address all the failure modes of the existing text-to-image models, we hope that our method can serve as a starting point to study learning from human feedback for improving text-to-image models. Limitations and future directions. There are several limi- tations and interesting future directions in our work: • More nuanced human feedback. Some of the poor generations we observed, such as highly saturated image colors, are likely due to similar images being highly ranked in our training set. We believe that instructing raters to look for a more diverse set of failure modes (oversaturated colors, unrealistic ani- mal anatomy, physics violations, etc.) will improve performance along these axes. • Diverse and large human dataset. For simplicity, we consider a limited class of text categories (count, color, background) and thus consider a simple form of hu- man feedback (good or bad). Due to this, the diversity of our human data is bit limited. Extension to more subjective text categories (like artistic generation) and informative human feedback such as ranking would be an important direction for future research. • Different objectives and algorithms. For updating the text-to-image model, we use a reward-weighted likeli- hood maximization. However, similar to prior work in language domains (Ouyang et al., 2022), it would be an interesting direction to use RL algorithms (Schul- man et al., 2017). We believe RLHF fine-tuning may lead to better models because (a) it uses online sample generation during updates and (b) KL-regularization over the prior model can mitigate overfitting to the reward function. Acknowledgements We thank Peter Anderson, Douglas Eck, Junsu Kim, Changyeon Kim, Jongjin Park, Sjoerd van Steenkiste, Younggyo Seo, and Guy Tennenholtz for providing help- ful comments and suggestions. Finally, we would like to thank Sehee Yang for providing valuable feedback on user interface and constructing the initial version of human data, without which this project would not have been possible. References Askell, A., Bai, Y., Chen, A., Drain, D., Ganguli, D., Henighan, T., Jones, A., Joseph, N., Mann, B., DasSarma, N., et al. A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861, 2021. Bahdanau, D., Brakel, P., Xu, K., Goyal, A., Lowe, R., Pineau, J., Courville, A., and Bengio, Y. An actor- critic algorithm for sequence prediction. arXiv preprint arXiv:1607.07086, 2016. Bai, Y., Jones, A., Ndousse, K., Askell, A., Chen, A., Das- Sarma, N., Drain, D., Fort, S., Ganguli, D., Henighan, T., et al. Training a helpful and harmless assistant with rein- forcement learning from human feedback. arXiv preprint arXiv:2204.05862, 2022a. Bai, Y., Kadavath, S., Kundu, S., Askell, A., Kernion, J., Jones, A., Chen, A., Goldie, A., Mirhoseini, A., McKin- non, C., et al. Constitutional ai: Harmlessness from ai feedback. arXiv preprint arXiv:2212.08073, 2022b. Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. Christiano, P. F., Leike, J., Brown, T., Martic, M., Legg, S., and Amodei, D. Deep reinforcement learning from human preferences. In Advances in Neural Information Processing Systems, 2017. Cubuk, E. D., Zoph, B., Mane, D., Vasudevan, V., and Le, Q. V. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2019. Feng, W., He, X., Fu, T.-J., Jampani, V., Akula, A., Narayana, P., Basu, S., Wang, X. E., and Wang, W. Y. Training-free structured diffusion guidance for compositional text-to-image synthesis. arXiv preprint arXiv:2212.05032, 2022. Gal, R., Alaluf, Y., Atzmon, Y., Patashnik, O., Bermano, A. H., Chechik, G., and Cohen-Or, D. An image is worth one word: Personalizing text-to-image generation using textual inversion. arXiv preprint arXiv:2208.01618, 2022. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. Generative adversarial networks. Communications of the ACM, 63(11):139–144, 2020. Hessel, J., Holtzman, A., Forbes, M., Bras, R. L., and Choi, Y. Clipscore: A reference-free evaluation metric for im- age captioning. arXiv preprint arXiv:2104.08718, 2021. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in neural information processing systems, 2017. Ho, J., Jain, A., and Abbeel, P. Denoising diffusion prob- In Advances in Neural Information abilistic models. Processing Systems, 2020. Aligning Text-to-Image Models using Human Feedback Ibarz, B., Leike, J., Pohlen, T., Irving, G., Legg, S., and Amodei, D. Reward learning from human preferences and demonstrations in atari. In Advances in Neural Infor- mation Processing Systems, 2018. Kingma, D. P. and Welling, M. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. Kreutzer, J., Khadivi, S., Matusov, E., and Riezler, S. Can neural machine translation be improved with user feed- back? arXiv preprint arXiv:1804.05958, 2018. Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84–90, 2017. Kumari, N., Zhang, B., Zhang, R., Shechtman, E., and Zhu, J.-Y. Multi-concept customization of text-to-image diffusion. arXiv preprint arXiv:2212.04488, 2022. Lee, K., Smith, L., and Abbeel, P. Pebble: Feedback- efficient interactive reinforcement learning via relabeling In Interna- experience and unsupervised pre-training. tional Conference on Machine Learning, 2021. Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ra- manan, D., Doll ́ar, P., and Zitnick, C. L. Microsoft coco: Common objects in context. In European conference on computer vision, 2014. Liu, H., Sferrazza, C., and Abbeel, P. Chain of hindsight aligns language models with feedback. arXiv preprint arXiv: Arxiv-2302.02676, 2023. Liu, N., Li, S., Du, Y., Torralba, A., and Tenenbaum, J. B. Compositional visual generation with composable diffu- sion models. arXiv preprint arXiv:2206.01714, 2022a. Liu, R., Garrette, D., Saharia, C., Chan, W., Roberts, A., Narang, S., Blok, I., Mical, R., Norouzi, M., and Constant, N. Character-aware models improve visual text rendering. arXiv preprint arXiv:2212.10562, 2022b. Loshchilov, I. and Hutter, F. Decoupled weight decay regu- larization. arXiv preprint arXiv:1711.05101, 2017. MacGlashan, J., Ho, M. K., Loftin, R., Peng, B., Roberts, D., Taylor, M. E., and Littman, M. L. Interactive learning from policy-dependent human feedback. In International Conference on Machine Learning, 2017. Madhyastha, P., Wang, J., and Specia, L. Vifidel: Evaluating the visual fidelity of image descriptions. arXiv preprint arXiv:1907.09340, 2019. Nakano, R., Hilton, J., Balaji, S., Wu, J., Ouyang, L., Kim, C., Hesse, C., Jain, S., Kosaraju, V., Saunders, W., et al. Webgpt: Browser-assisted question-answering with hu- man feedback. arXiv preprint arXiv:2112.09332, 2021. Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C. L., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., et al. Training language models to fol- low instructions with human feedback. arXiv preprint arXiv:2203.02155, 2022. Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, 2021. Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., Liu, P. J., et al. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1–67, 2020. Ramesh, A., Pavlov, M., Goh, G., Gray, S., Voss, C., Rad- ford, A., Chen, M., and Sutskever, I. Zero-shot text- In International Conference on to-image generation. Machine Learning, 2021. Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., and Chen, M. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022. Rombach, R., Blattmann, A., Lorenz, D., Esser, P., and Ommer, B. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Con- ference on Computer Vision and Pattern Recognition, 2022. Ruiz, N., Li, Y., Jampani, V., Pritch, Y., Rubinstein, M., and Aberman, K. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. arXiv preprint arXiv:2208.12242, 2022. Saharia, C., Chan, W., Saxena, S., Li, L., Whang, J., Denton, E., Ghasemipour, S. K. S., Ayan, B. K., Mahdavi, S. S., Lopes, R. G., et al. Photorealistic text-to-image diffusion models with deep language understanding. In Advances in Neural Information Processing Systems, 2022. Scheurer, J., Campos, J. A., Chan, J. S., Chen, A., Cho, K., and Perez, E. Training language models with language feedback. arXiv preprint arXiv: Arxiv-2204.14146, 2022. Schuhmann, C., Vencu, R., Beaumont, R., Kaczmarczyk, R., Mullis, C., Katta, A., Coombes, T., Jitsev, J., and Komatsuzaki, A. Laion-400m: Open dataset of clip- filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021. Schuhmann, C., Beaumont, R., Vencu, R., Gordon, C., Wightman, R., Cherti, M., Coombes, T., Katta, A., Mullis, C., Wortsman, M., et al. Laion-5b: An open large-scale dataset for training next generation image-text models. arXiv preprint arXiv:2210.08402, 2022. Aligning Text-to-Image Models using Human Feedback Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequi- librium thermodynamics. In International Conference on Machine Learning, 2015. Stiennon, N., Ouyang, L., Wu, J., Ziegler, D. M., Lowe, R., Voss, C., Radford, A., Amodei, D., and Christiano, P. Learning to summarize from human feedback. arXiv preprint arXiv:2009.01325, 2020. Van Den Oord, A., Kalchbrenner, N., and Kavukcuoglu, In International K. Pixel recurrent neural networks. conference on machine learning, pp. 1747–1756, 2016. Warnell, G., Waytowich, N., Lawhern, V., and Stone, Interactive agent shaping in high- In Conference on Artificial P. Deep tamer: dimensional state spaces. Intelligence, 2018. Wu, J., Ouyang, L., Ziegler, D. M., Stiennon, N., Lowe, R., Leike, J., and Christiano, P. Recursively summa- arXiv preprint rizing books with human feedback. arXiv:2109.10862, 2021. Xue, L., Barua, A., Constant, N., Al-Rfou, R., Narang, S., Kale, M., Roberts, A., and Raffel, C. Byt5: Towards a token-free future with pre-trained byte-to-byte mod- els. Transactions of the Association for Computational Linguistics, 10:291–306, 2022. Yu, J., Wang, Z., Vasudevan, V., Yeung, L., Seyedhosseini, M., and Wu, Y. Coca: Contrastive captioners are image- text foundation models. arXiv preprint arXiv:2205.01917, 2022a. Yu, J., Xu, Y., Koh, J. Y., Luong, T., Baid, G., Wang, Z., Vasudevan, V., Ku, A., Yang, Y., Ayan, B. K., et al. Scal- ing autoregressive models for content-rich text-to-image generation. arXiv preprint arXiv:2206.10789, 2022b. Zhou, W. and Xu, K. Learning to compare for better training and evaluation of open domain natural language gener- ation models. In Conference on Artificial Intelligence, 2020. Ziegler, D. M., Stiennon, N., Wu, J., Brown, T. B., Radford, A., Amodei, D., Christiano, P., and Irving, G. Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593, 2019. A. Qualitative Comparison Aligning Text-to-Image Models using Human Feedback (a) Text prompt: A red colored tiger. (b) Text prompt: A green colored tiger. (c) Text prompt: A pink colored tiger. Figure 7. Samples from the original Stable Diffusion model (left) and our fine-tuned model (right). The fine-tuned model can generate an unseen object (tiger) with specified colors. Aligning Text-to-Image Models using Human Feedback (a) Text prompt: Three wolves in the forest. (b) Text prompt: Four wolves in the forest. (c) Text prompt: Five wolves in the forest. Figure 8. Samples from the original Stable Diffusion model (left) and our fine-tuned model (right). The fine-tuned model can generate an unseen object (wolf) with specified counts. However, the counts are not always perfect, showing a room for improvement. Aligning Text-to-Image Models using Human Feedback (a) Text prompt: A cake in the city. (b) Text prompt: A cake in the sea. (c) Text prompt: A cake on the moon. Figure 9. Samples from the original Stable Diffusion model (left) and our fine-tuned model (right). The fine-tuned model can generate cake with specified backgrounds. Aligning Text-to-Image Models using Human Feedback (a) Text prompt: An oil painting of rabbit. (b) Text prompt: A black and white sketch of rabbit. (c) Text prompt: A 3D render of rabbit. Figure 10. Samples from the original Stable Diffusion model (left) and our fine-tuned model (right). The fine-tuned model still generate rabbit in specified styles. Aligning Text-to-Image Models using Human Feedback (a) Text prompt: A zombie in the style of Picasso. (b) Text prompt: A watercolor painting of a chair that looks like an octopus. (c) Text prompt: A painting of a squirrel eating a burger. Figure 11. Samples from the original Stable Diffusion model (left) and our fine-tuned model (right). The fine-tuned model still maintains performance across a wide distribution of text prompts. B. Image-text Dataset Aligning Text-to-Image Models using Human Feedback In this section, we describe our image-text dataset. We generate 2774 text prompts by combining a word or phrase from that category with some object. Specifically, we consider 9 colors (red, yellow, green, blue, black, pink, purple, white, brown), 6 numbers (1-6), 8 backgrounds (forest, city, moon, field, (dog, cat, lion, orange, vase, cup, sea, table, desert, San Franciso) and 25 objects apple, chair, bird, cake, bicycle, tree, donut, box, plate, clock, backpack, car, airplane, bear, horse, tiger, rabbit, rose, wolf).15 For each text prompt, we generate 60 or 6 images according to the text category. In total, our image-text dataset consists of 27528 image-text pairs. Labeling for training is done by two human labelers. For evaluation, we use 120 text prompts listed in Table 4. Given two (anonymized) sets of 4 images, we ask human raters to assess which is better w.r.t. image-text alignment and fidelity (i.e., image quality). Each query is rated by 9 independent human raters in Figure 4 and Figure 6. Category Seen Unseen Examples A red colored dog.; A red colored donut.; A red colored cake.; A red colored vase.; A green colored dog.; A green colored donut.; A green colored cake.; A green colored vase.; A pink colored dog.; A pink colored donut.; A pink colored cake.; A pink colored vase.; A blue colored dog.; A blue colored donut.; A blue colored cake.; A blue colored vase.; A black colored apple.; A green colored apple.; A pink colored apple.; A blue colored apple.; A dog on the moon.; A donut on the moon.; A cake on the moon.; A vase on the moon.; An apple on the moon.; A dog in the sea.; A donut in the sea.; A cake in the sea.; A vase in the sea.; An apple in the sea.; A dog in the city.; A donut in the city.; A cake in the city.; A vase in the city.; An apple in the city.; A dog in the forest.; A donut in the forest.; A cake in the forest.; A vase in the forest.; An apple in the forest.; Two dogs.; Two donuts.; Two cakes.; Two vases.; Two apples.; Three dogs.; Three donuts.; Three cakes.; Three vases.; Three apples.; Four dogs.; Four donuts.; Four cakes.; Four vases.; Four apples.; Five dogs.; A red colored bear.; A red colored wolf.; A red colored tiger.; A red colored rabbit.; A green colored bear.; A green colored wolf.; A green colored tiger.; A green colored rabbit.; A pink colored bear.; A pink colored wolf.; A pink colored tiger.; A pink colored rabbit.; A blue colored bear.; A blue colored wolf.; A blue colored tiger.; A blue colored rabbit.; A black colored rose.; A green colored rose.; A pink colored rose.; A blue colored rose.; A bear on the moon.; A wolf on the moon.; A tiger on the moon.; A rabbit on the moon.; A rose on the moon.; A bear in the sea.; A wolf in the sea.; A tiger in the sea.; A rabbit in the sea.; A rose in the sea.; A bear in the city.; A wolf in the city.; A tiger in the city.; A rabbit in the city.; A rose in the city.; A bear in the forest.; A wolf in the forest.; A tiger in the forest.; A rabbit in the forest.; A rose in the forest.; Two brown bears.; Two wolves.; Two tigers.; Two rabbits.; Two red roses.; Three brown bears.; Three wolves.; Three tigers.; Three rabbits.; Three red roses.; Four brown bears.; Four wolves.; Four tigers.; Four rabbits.; Table 4. Examples of text prompts for evaluation. C. Additional Results Seen prompts Color Count Background Unseen prompts Image-text alignment Fidelity Win Lose Tie Win Lose Tie 58.9 ± 19.5 69.4 ± 6.8 53.3 ± 13.3 10.0 ± 7.1 11.7 ± 5.3 14.4 ± 6.4 Image-text alignment 31.1 ± 26.2 18.9 ± 10.7 32.2 ± 18.0 53.9 ± 39.4 42.2 ± 36.4 43.9 ± 31.0 28.3 ± 24.0 37.2 ± 23.6 39.4 ± 17.1 Fidelity 17.8 ± 23.1 20.6 ± 22.9 16.7 ± 20.1 Win Lose Tie Win Lose Tie Color Count Background 57.2 ± 8.5 69.4 ± 16.1 55.6 ± 9.6 14.4 ± 9.6 8.3 ± 2.4 11.1 ± 9.9 28.3 ± 16.3 22.2 ± 18.0 33.3 ± 18.9 39.4 ± 24.7 42.8 ± 31.8 46.1 ± 28.5 38.9 ± 9.7 36.7 ± 9.1 35.6 ± 13.6 21.7 ± 25.1 20.6 ± 23.3 18.3 ± 20.7 Table 5. Percentage of generated images from our fine-tuned model that are better than (win), tied with, or worse than (lose) the compared to original stable diffusion model in terms of image-text alignment and fidelity. 15We use the following 5 objects only for evaluation: bear, tiger, rabbit, rose, wolf. Aligning Text-to-Image Models using Human Feedback Image-text alignment Fidelity Win Lose Tie Win Lose Tie 51.7 ± 18.6 67.8 ± 14.2 47.8 ± 15.3 20.6 ± 13.2 12.8 ± 7.1 10.0 ± 6.7 Image-text alignment 27.8 ± 31.1 19.4 ± 20.6 42.2 ± 20.3 37.8 ± 16.0 31.7 ± 18.4 41.1 ± 21.3 30.6 ± 15.2 31.7 ± 21.2 27.8 ± 14.9 Fidelity 31.7 ± 29.7 36.7 ± 38.1 31.1 ± 34.8 Win Lose Tie Win Lose Tie Seen prompts Color Count Background Unseen prompts Color Count Background 47.8 ± 7.5 62.2 ± 23.8 62.8 ± 11.3 20.0 ± 14.3 8.3 ± 6.2 7.2 ± 5.8 32.2 ± 20.8 29.4 ± 29.4 30.0 ± 16.8 31.7 ± 21.9 40.0 ± 27.9 51.1 ± 17.6 39.4 ± 13.2 25.6 ± 12.6 23.9 ± 12.0 28.9 ± 32.1 34.4 ± 38.4 25.0 ± 27.8 Table 6. Percentage of generated images from original stable diffusion model with rejection sampling that are better than (win), tied with, or worse than (lose) the compared to original stable diffusion model in terms of image-text alignment and fidelity. Seen prompts Color Count Background Unseen prompts Image-text alignment Fidelity Win Lose Tie Win Lose Tie 34.4 ± 19.2 32.8 ± 11.1 31.7 ± 12.2 27.2 ± 18.9 35.0 ± 15.8 24.4 ± 16.1 Image-text alignment 38.3 ± 37.6 32.2 ± 25.3 43.9 ± 27.0 41.1 ± 33.7 32.8 ± 28.4 36.1 ± 24.0 27.8 ± 8.2 41.7 ± 7.8 36.1 ± 15.2 Fidelity 31.1 ± 33.1 25.6 ± 29.9 27.8 ± 35.5 Win Lose Tie Win Lose Tie Color Count Background 40.0 ± 19.7 53.3 ± 15.5 33.9 ± 23.1 23.3 ± 12.7 27.2 ± 9.2 21.7 ± 9.7 36.7 ± 32.0 19.4 ± 23.5 44.4 ± 32.2 39.4 ± 20.3 26.1 ± 19.5 33.3 ± 25.6 32.8 ± 14.6 52.2 ± 7.5 37.8 ± 10.6 27.8 ± 32.7 21.7 ± 25.4 28.9 ± 33.7 Table 7. Percentage of generated images from our fine-tuned model that are better than (win), tied with, or worse than (lose) the compared to original stable diffusion model with rejection sampling in terms of image-text alignment and fidelity. D. Experimental Details Model architecture. For our baseline generative model, we use stable diffusion v1.5 (Rombach et al., 2022), which has been pre-trained on large image-text datasets (Schuhmann et al., 2021; 2022). For the reward model, we use ViT-L/14 CLIP model (Radford et al., 2021) to extract image and text embeddings and train a MLP using these embeddings as input. Specifically, we use two-layer MLPs with 1024 hidden dimensions each. We use ReLUs for the activation function between layers, and we use the Sigmoid activation function for the output. For auxiliary task, we use temperature T = 2 and penalty parameter λ = 0.5. Training. Our fine-tuning pipeline is based on publicly released repository (https://github.com/huggingface/ diffusers/tree/main/examples/text_to_image). We update the model using AdamW (Loshchilov & Hutter, 2017) with β1 = 0.9, β2 = 0.999, (cid:15) = 1e − 8 and weight decay 1e − 2. The model is trained in half-precision on 4 40GB NVIDIA A100 GPUs, with a per-GPU batch size of 8, resulting in a toal batch size of 512 (256 for pre-training data and 256 for model-generated data).16 It is trained for a total of 10,000 updates. FID measurement using MS-CoCo dataset. We measure FID scores to evaluate the fidelity of different models using MS-CoCo validation dataset (i.e., val2014). There are a few caption annotations for each MS-CoCo image. We randomly choose one caption for each image, which results in 40,504 caption and image pairs. MS-CoCo images have different resolutions and they are resized to 256 × 256 before computing FID scores. We use pytorch-fid Python implementation for the FID measurement (https://github.com/mseitzer/pytorch-fid). 16In prior work (Ouyang et al., 2022), model is optimized with bigger batch for pre-training data. However, in our experiments, using a bigger batch does not make a big difference. We expect this is because small pre-training dataset is used in our work. Aligning Text-to-Image Models using Human Feedback E. Pseudocode Algorithm 1 Reward Learning Pseudocode # x, z, y: image, text prompt, human label # clip: pre-trained CLIP model # preprocess: Image transform # pred_r: two-layers MLPs # Get_perturbated_prompts: function to generate perturbated text prompts # lambda: penalty parameter # T: temperature # N: # of perturbated text prompts # main model def RewardFunction(x, z): # compute embeddings for tokens img_embedding = clip.encode_image(prepocess(x)) txt_embedding = clip.encode_text(clip.tokenize(z)) input_embeds = concatenate(img_embedding, txt_embedding) # predict score return pred_r(input_embeds) # training loop for (x, z, y) in dataloader: # dims: (batch_size, dim) # MSE loss r_preds = RewardFunction(x, z) loss = MSELoss(r_preds, y) # Prompt classification scores = [r_preds] for z_neg in Get_perturbated_prompts(z, N): scores.append(RewardFunction(x, z_neg)) scores = scores / T labels = [0] * batch_size # origin text is always class 0 loss += lambda * CrossEntropyLoss(scores, labels) # update reward function optimizer.zero_grad(); loss.backward(); optimizer.step() Aligning Text-to-Image Models using Human Feedback Algorithm 2 Perturbated Text Prompts Generation Pseudocode # z: image, text prompt, human label # N: # of perturbated text prompts def Get_perturbated_prompts(z, N): color_list = [''red'', ''yellow'', ...] obj_list = [''dog'', ''cat'', ...] count_list = [''One'', ''Two'', ...] loc_list = [''in the sea.'', ''in the sky.'', ...] output = [] count = 0 while (count < N): idx = random.randint(0, len(count_list)-1) count = count_list[idx] idx = random.randint(0, len(color_list)-1) color = color_list[idx] idx = random.randint(0, len(loc_list)-1) loc = loc_list[idx] idx = random.randint(0, len(obj_list)-1) obj = obj_list[idx] if count == ''One'': text = ''{} {} {} {}.''.format(count, color, obj, loc) else: text = ''{} {} {}s {}.''.format(count, color, obj, loc) if z != text: count += 1 output.append(text) return output
http://arxiv.org/abs/2304.12825v1
2023-02-23T17:32:49
2023-02-23T17:32:49
GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow
Designing molecules that bind to specific target proteins is a fundamental task in drug discovery. Recent models leverage geometric constraints to generate ligand molecules that bind cohesively with specific protein pockets. However, these models cannot effectively generate 3D molecules with 2D skeletal curtailments and property constraints, which are pivotal to drug potency and development. To tackle this challenge, we propose GraphVF, a variational flow-based framework that combines 2D topology and 3D geometry, for controllable generation of binding 3D molecules. Empirically, our method achieves state-of-the-art binding affinity and realistic sub-structural layouts for protein-specific generation. In particular, GraphVF represents the first controllable geometry-aware, protein-specific molecule generation method, which can generate binding 3D molecules with tailored sub-structures and physio-chemical properties. Our code is available at https://github.com/Franco-Solis/GraphVF-code.
[ "Fang Sun", "Zhihao Zhan", "Hongyu Guo", "Ming Zhang", "Jian Tang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2304.12825v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2304.12825v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "q-bio.BM", "@scheme": "http://arxiv.org/schemas/atom" }
[ "q-bio.BM", "cs.AI", "cs.LG" ]
GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow Zhihao Zhan [email protected] Peking University Beijing, China Fang Sun [email protected] Peking University Beijing, China Hongyu Guo [email protected] National Research Council Canada University of Ottawa Ottawa, Canada 3 2 0 2 b e F 3 2 ] M B . o i b - q [ 1 v 5 2 8 2 1 . 4 0 3 2 : v i X r a Ming Zhang [email protected] Peking University Beijing, China Jian Tang [email protected] Mila - Québec AI Institute HEC Montréal CIFAR AI Research Chair Montréal, Canada ABSTRACT Designing molecules that bind to specific target proteins is a funda- mental task in drug discovery. Recent models leverage geometric constraints to generate ligand molecules that bind cohesively with specific protein pockets. However, these models cannot effectively generate 3D molecules with 2D skeletal curtailments and property constraints, which are pivotal to drug potency and development. To tackle this challenge, we propose GraphVF, a variational flow-based framework that combines 2D topology and 3D geometry, for control- lable generation of binding 3D molecules. Empirically, our method achieves state-of-the-art binding affinity and realistic sub-structural layouts for protein-specific generation. In particular, GraphVF rep- resents the first controllable geometry-aware, protein-specific mole- cule generation method, which can generate binding 3D molecules with tailored sub-structures and physio-chemical properties. Our code is available at https://github.com/Franco-Solis/GraphVF-code. CCS CONCEPTS • Applied computing → Molecular structural biology. KEYWORDS controllable generation, pocket-based drug design, variational flow ACM Reference Format: Fang Sun, Zhihao Zhan, Hongyu Guo, Ming Zhang, and Jian Tang. 2023. GraphVF: Controllable Protein-Specific 3D Molecule Generation with Vari- ational Flow. In Proceedings of Make sure to enter the correct conference title from your rights confirmation email (Conference acronym 'XX). ACM, New York, NY, USA, 15 pages. https://doi.org/XXXXXXX.XXXXXXX Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. Conference acronym 'XX, June 03–05, 2023, Woodstock, NY © 2023 Association for Computing Machinery. ACM ISBN 978-1-4503-XXXX-X/23/06. . . $15.00 https://doi.org/XXXXXXX.XXXXXXX 1 INTRODUCTION The de novo design of synthetically feasible drug-like molecules that bind to specific protein pockets is a crucial yet very challenging task in drug discovery. To cope with such challenges, there has been a recent surge of interest in leveraging deep generative models to effectively search the chemical space for molecules with desired properties. These machine-learning models typically encode the chemical structures of molecules into a low-dimensional space, which then can be optimized and sampled to generate potential 2D or 3D molecule candidates [12, 13, 34, 42]. Along this research line, a more promising direction has also been explored recently: generating 3D molecules that bind to given protein pockets. Such protein-specific 3D molecule generation is fundamentally important because it touches down to the micro-scale principle of drug functionalities: how the drug ligand and the receptor protein interact with each other in the 3D space. Current state-of-the-art generative models [20, 22, 28] leverage equivariant 3D graph neural networks to generate drug molecules (i.e., ligands) directly based on the 3D geometry of the binding pocket. They explicitly capture the fine-grained 3D atomic interactions and produce ligand poses that directly fit into the given binding pocket. Nevertheless, two critical issues remain unsolved for these existing geometric approaches: 1) Enforcing 2D Pharmacophoric Pattern in 3D generation. 2D molecular scaffolds embody rich pharmacophoric patterns, deter- mining ligands' bio-chemical activities and binding affinity to a large extent [40]. Consider, for example, the molecules of serotonin (a benign neurotransmitter) and N,N-Dimethyltryptamine (DMT, a famous hallucinogen). As shown in Figure 7a of Appendix D, serotonin and DMT share a large common bulk of their structures, which both possess an indole and an ethylamine group, but dif- fer enormously in their neural activities. In fact, the extra Methyl groups in DMT's NHMe2 are pharmacophoric, inducing an attrac- tive charge interaction with Asp-231 [11]. This pharmacophoric feature gives rise to DMT's binding affinity with the 5-HT2A bind- ing site and produces hallucination (Figure 7b). Such observations suggest that effectively enforcing 2D pharmacophoric patterns in 3D ligands is critical for binding. Nevertheless, existing 3D molecu- lar generation methods do not take into account these useful 2D patterns. Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Sun, et al. 2) Controllable generation. When it comes to drug manufactur- ing, physio-chemical properties like solubility, polarizability, and toxicity are equally important to drug quality. We have to effec- tively control these qualities to make sure that the synthesized drug molecules have good exposure, e.g. absorption, distribution, me- tabolism, excretion (ADME) in vivo, and thus sufficient efficacy in clinical trials [7]. It is worth noting that, although recent models like EDM [12] and RetMol [37] have been popular for their capability to perform controlled generation on these properties, performing controllable generation in the 3D pocket-specific scenario remains unexplored by previous works. To address the aforementioned two issues, we propose GraphVF (Graph Variational Flow), a protein-specific molecule generation framework. In a nutshell, GraphVF leverages a flow-based gener- ative model to integrate both 3D geometric and 2D topological constraints, aiming to gain control over the structure and property of the generated 3D ligands. In the generative process, the flow model here transforms a simple prior distribution into the complex distribution of the 3D binding molecules. As illustrated in Figure 1, to obtain desirable topological information in the generated 3D molecules, the GraphVF method encodes the 2D molecular topol- ogy patterns into such prior distribution. Consequently, sampling from such prior enables the flow model to facilitate the generation of 3D molecules with specific sub-structures and physio-chemical properties encoded in the prior distribution. We show empirically that GraphVF can generate novel 3D drug molecules with high binding affinity to the receptor proteins, out- performing state-of-the-art methods by a large margin. Also, the generated molecules have more realistic sub-structure distribution, demonstrating the effectiveness of combining 3D geometry and 2D topology in protein-specific generation tasks. More importantly, GraphVF exposes a clean-cut VAE-style interface for imposing customized constraints, which is extremely useful in practice for controlling the sub-structure and physio-chemical properties of the generated drug ligands. Our main contributions are summarized as follows. • We introduce the first method that enables generating 3D molecules with specified chemical sub-structures or physio- chemical properties. • We devise a novel variational flow-based framework to effec- tively integrate 3D geometric and 2D topological constraints for protein-specific 3D molecule generation. • We empirically demonstrate our method's superior perfor- mance to state-of-the-art approaches in generating 3D bind- ing molecules. 2 RELATED WORK With the development of geometric deep learning and probabilistic generative models in the past few years, de novo molecule genera- tion techniques have evolved drastically, empowering us to sample diverse high-quality molecules with desired properties under vari- ous complex scenarios. To this end, there are three major tasks: 2D molecule generation, 3D unbounded molecule generation, and 3D protein-specific molecule generation. 2D molecule generation. This task [13, 21, 24, 34, 35, 41] aims at mining high-quality topological representations and generating Figure 1: Overview of the GraphVF variational flow work- flow. GraphVF autoregressively samples from the varia- tional distribution (bottom right) to generate the atoms and bonds of the drug ligand at the binding site using flow trans- formation (left column). The flow function is parameterized by the 3D binding site geometry. The variational distribu- tion is encoded from the 2D topology of the reference ligand during training (right column). During controllable gener- ation, the reference ligand is not provided. The latent en- coding φ R is calculated by mean aggregation of molecules with specified qualities from the training set or selected us- ing Bayesian Optimization, which achieves controllability. valid 2D molecular graphs from scratch. For example, GraphAF [34] uses a flow-based model to generate atoms and bonds in an autore- gressive manner. JT-VAE [13] generates molecular graphs with the guidance of a tree-structured scaffold over chemical substruc- tures. To optimize molecules toward desired properties, models like GCPN [41] and GraphAF [34] adopt reinforcement learning to tune the model. For variational auto-encoder (VAE) based models like SD- VAE [5] and JT-VAE [13], each latent encoding of the variational distribution corresponds to a specific group of molecules in the chemical space. Therefore, these VAE-based models can perform zero-shot optimization without retraining the model, as long as they can acquire the optimal latent embedding via linear regression, bayesian optimization, etc. 3D Non-Protein Specific Molecule Generation. This task [12, 16, 23] aims to learn the geometric representations of molecules in the 3D space and generate valid molecules with reasonable 3D confor- mation. For instance, G-SphereNet [23] uses symmetry invariant CCCCNONCCproteinligandφCCCCNONCCCdθ!"#$%&'(&#)*)+,-./.0&1&/23&(.045&671$/&8/&992:&5;8&"&/.1&'(&#)*)<,=2"%2"8921&>&?&/&"#&528."% GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow Conference acronym 'XX, June 03–05, 2023, Woodstock, NY representations in a spherical coordinate system (SCS) to gener- ate atoms in the 3D space and preserve equivariance. L-Net [16] encodes hierarchical molecular structure with Graph U-Net and di- rectly outputs the topology and geometry of the molecule through a valency rule-based backtracking algorithm. EDM [12] is an equi- variant diffusion model that generates 3D molecule geometry via an iterative denoising process. EDM can be configured to perform controllable generation over certain property c by re-training the diffusion model with c's feature vector concatenated to its E(n) equivariant dynamics function. RetMol [37] is a retrieval-based framework for controllable molecule generation that requires no task-specific fine-tuning. 3D Molecule Generation for Target Protein Binding. With the wide availability of large-scale datasets [8, 17] for target protein bind- ing, recent works [19, 20, 28, 32] have been able to generate drug ligands directly based on the 3D geometry of the binding pockets. For example, Pocket2Mol [28] leverages a spatial-autoregressive model; it directly models the p.d.f. for atom occurrence in the 3D space as a Gaussian mixture (GMM), and then iteratively places the atoms from the learned distribution until there is no room for new atoms. GraphBP [20], an autoregressive model, retains good model capacity via normalizing flow; variables are randomly sampled from a compact latent space, before they are projected into the chemical space by an arbitrarily complex flow transformation. DiffBP [19] considers the global interaction between the protein pocket and the ligand molecule, and uses a diffusion model to generate ligand molecules non-autoregressively. Despite the promising potential along this line of purely geometric approach, these methods cannot explicitly perceive the topological pharmacophoric patterns within the ligand structure. Nor can they conduct explicit control over specific chemical sub-structures and physio-chemical properties. We provide a roadmap (Figure 2) to compare GraphVF against previous molecule generation models. The horizontal axis indicates the three different types of tasks, whereas the vertical axis measures the overall controllability of each model in a qualitative manner. In particular, the dashed baseline represents the degree of controllabil- ity incurred by the task per se, and the vertical distance above the dashed baseline represents the model's controllability over other specific customized properties. Figure 2: Overall controllability of different models across three different molecule generation tasks. 3.2 Geometry Graph Encoding 3D-GNNs like SchNet [33] and EGNN [31] preserve SE(3) (i.e. roto- translational) equivariance in the 3D space, and have been canonical in encoding 3D molecule geometry. In particular, SchNet solely re- lies on the relative distance between nodes during message-passing and has been efficient in modeling large bio-molecular systems like protein-ligand interaction. Specifically, geometries P and R3D are organized into a radius graph, based on the Euclidean distances between atoms in the 3D space. However, this purely distance- based approach has been inadequate for modeling covalent bonds in molecular structures. Bond lengths are known to be character- istic, e.g., C≡N 1.16 Å, C=C 1.34 Å [18]. Therefore, we explicitly incorporate bond types during massage-passing to better delineate the molecular structure and atomic interactions. We devise EchNet, an adapted version of SchNet, to achieve this end: = Emb(ai ) h(0) i mi j = concat (cid:8)Erbf (||ri − r j ||), Emb(bi j )(cid:9) h(l) i = h(l−1) ⊙ Φ(l) (mki ), h(l−1) k ∑︁ + i k ∈N (i)\j (1) (2) (3) l = 1, ..., L 3 PRELIMINARIES 3.1 Problem Setup Our goal is to generate a ligand molecule that binds effectively to a given protein receptor. In this paper, proteins and ligands are represented as graphs. Node features in these graphs include atom type a and position r , while edge feature involves bond type b. For training, we are given pairs of protein P and ligand R in their binding poses. In this paper, we denote the ligand R's 3D geometry graph and 2D topology graph as R3D and R2D , respectively. For generation, we are given protein targets P to generate drug ligands, i.e., R3D , that bind tightly to P. We here consider a protein-ligand pair with M and N atoms respectively. Our model is trained with a set of such binding protein-ligand pairs (P, R). where Erbf (*) is a radial basis function [20], Emb(*) is the embed- ding layer, concat(*) is the concatenation of two vectors, and Φ is the feed-forward neural network. L is the number of convolution layers, bi j is the bond type between atoms i and j (bond type '0' for non-existent bonds), h(l) is the encoding of atom i at the l th i convolution layer, and mi j is the message propagated from atom i to j. The major difference between EchNet and SchNet resides in Equation 2, where an extra bond-type embedding is concatenated along the distance encoding. 3.3 Generative Flow Model Flow-based deep generative models (i.e., normalizing flows) trans- form a simple prior distribution into a complex data distribution by applying a sequence of invertible transformation functions. Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Sun, et al. Figure 3: Ligand molecule R2D (e.g. DMT) is first parsed into a compilation of canonical sub-structures, then pooled into a junction tree structure, and finally encoded into φ R2D = (μ R2D , ΣR2D ) . Through sampling from the prior, new data points (i.e., new R3D graphs) are then generated. To be specific, given a prior distribution pZ , a flow model [6, 30, 39] is defined as an invertible parameterized function fθ : z ∈ RD → x ∈ RD , where θ represents the parameters of f , and D is the dimension for z and x. This maps the latent variable z ∼ pZ to the data variable x, and the log-likelihood of x is calculated as log pX (x) = log pZ (cid:16) (cid:17) f −1 θ (x) + log (cid:12) (cid:12) det (cid:12) (cid:12) (cid:12) (x) ∂f −1 θ ∂x (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) . (4) To effectively solve the above equation, autoregressive flow model [26] formulates a flow function with an autoregressive computation to enable easy Jacobian determinant computation. Specifically, let xi be the i-th component of x and xi conditions on x1...i−1. The inverse function f −1 is then defined as follows: θ xi = σi (x1...i−1) ⊙ zi + μi (x1...i−1), i = 1...D, (5) where ⊙ denotes element-wise multiplication, σi (*) ∈ R and μi (*) ∈ R are non-linear functions of x1...i−1. By doing so, we can effectively calculate the following to compute the log-likelihood in Equation 4: zi = xi − μi σi , det (x) ∂f −1 θ ∂x = D (cid:214) i=1 1 σi . (6) 4 THE PROPOSED METHOD Our GraphVF approach aims to generate 3D binding molecules, namely generating R3D that binds to P, through sampling from a prior distribution with a variational flow model. The flow model here aims at transforming a simple prior distribution into the com- plex distribution of the 3D binding molecules by applying a se- quence of invertible transformation functions as discussed in Sec- tion 3.3. As illustrated in Figure 1, to obtain desirable topological information in the generated 3D molecules (R3D ), as the aim of this paper, the GraphVF method encodes the topology patterns in 2D molecules (R2D ) into the prior distribution. By doing so, we can purposefully control the prior parameterization for different generation tasks, and sampling from such prior thus facilitates the generation of 3D molecules with specific sub-structures and physio-chemical properties encoded in the prior distribution. Next, we will introduce our 2D topology prior encoding and the 3D binding ligand generation components in Sections 4.1 and 4.2, respectively. 4.1 2D Topology Prior Encoding To encode the 2D topology in R2D into a prior distribution, we adopt the junction tree encoder architecture from JT-VAE [13]. The whole procedure is illustrated in Figure 3 and detailed next. Ligand Scaffold Extraction and Encoding. Following [13], we 4.1.1 extract the coarse-grained structural patterns of the ligand scaffold in a fragment-driven approach. First, the ligand molecule R2D (left in Figure 3) is parsed into a compilation of occluded canonical sub-structures, according to a set of pre-defined vocabulary rules (detailed in Appendix A.1). Each of such sub-structure in R2D is then pooled into a node, resulting in a junction tree (the two middle subfigures). Next, the information of this junction tree is aggregated through a Gated Recurrent Unit (GRU) [4] adapted for tree message passing (Section 4.1.2). This results in a root node embedding hroot representing the whole junction tree and thus the R2D . Finally, this embedding is then passed through a MLP to define the mean and variance of the topology distribution (right in Figure 3): (μ R2D and ΣR2D , ΣR2D ) = φ R2D = MLP(hroot). (7) Since μ R2D are equally-sized dense vectors, the covariate , ΣR2D ) is diagonal. This matrix of the resultant Gaussian N (μ R2D allows us to independently sample from the different components of the Gaussian distribution (elaborated in Appendix A.2). We go on to describe how GraphVF conducts tree message passing through GRU in the junction tree to obtain the above hroot. Junction Tree Message Passing. The tree message passing 4.1.2 scheme arbitrarily selects a leaf node as the root (denoted as hroot), and passes messages from child nodes to parent nodes iteratively in a bottom-up approach. We denote the message from node i to j as mi j , which is updated via a GRU adapted for tree propagation: mi j = GRU(xi, {mki }k ∈N (i)\j ). To be more specific, the GRU architecture is formulated as follows: (8) si j zi j rki (cid:101)mi j mi j ∑︁ = k ∈N (i)\j mki, z xi + U r xi + U z = σ (W r = σ (W = tanh(Wxi + U z), si j + b r ), mki + b ∑︁ rki ⊙ mki ), k ∈N (i)\j = (1 − zi j ) ⊙ si j + zi j ⊙ (cid:101)mi j , (9) (10) (11) (12) (13) !"#$%&'()*+,)*-++),&*&.,/0123,+2,3*143**.23,+2,3*!"#$%&'!(()%&'*&+(,%&'56/*&&"%# GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Figure 4: Generation procedure of GraphVF. Atoms are added autoregressively, whose types, bonds and positions are sampled from prior distribution N (μ R, ΣR ) and predicted via normalizing flow. where xi is a one-hot vector, indicating the type of canonical sub- structure of node i. The latent representation of each node hi can be derived by aggregating all the inwards messages from its child nodes as follows: o hi = W xi + ∑︁ o U mki . k ∈N (i) (14) 4.1.3 Topology Prior. During training, the 2D scaffold encoding , ΣR2D ) is regularized by a KL divergence to form a φ R2D = (μ R2D compact family of diagonal Gaussians around the standard gaussian N (0, I). Therefore, during generation, we can easily navigate along this family of Gaussians to generate 3D molecules with spe- cific sub-structures and physio-chemical properties encoded in the prior distribution. Next, we will discuss how the flow model lever- ages this prior to generate binding 3D ligands. 4.2 3D Ligand Generation via Variational Flow In this section, we will discuss how the GraphVF model generates a 3D ligand R (to simplify the equations in this section, we omit the subscript), including its atoms, bonds, and geometric structure. 4.2.1 Autoregressive Generation via Flow. We formulate the pro- cedure of generating a new ligand R in GraphVF as a Markovian sampling process, where atoms and bonds are autoregressively added according to the intermediary state at the binding site. The generation process at step i = 4 is illustrated in Figure 4 and eluci- dated next. Firstly, we construct radius graph Gi based on protein graph P and ligand sub-graph R1:i−1: Gi = τ (P ∪ R1:i−1), where the radius operator τ (*) adds edges (of bond order 0) to neighboring atoms within radius τ. In particular, at generation step 1, when no ligand atoms have yet been generated, Gi is simply τ (P). The Echnet encoder, as discussed in Section 3.2, outputs the encoding of each atom in both protein and ligand: (15) ̃e1:M, e1:i−1 = Echnet(Gi ). Secondly, we randomly sample a focal atom fi from all possible candidates. For each atom, its eligibility as a focal atom is deter- mined by a binary focal classifier. Except in the first step, only atoms from the ligand molecule are considered. Based on fi and two of (16) i its nearest neighbors, we construct a spherical coordinate system (SCS), transforming Cartesian coordinates into polar coordinates (d, θ, φ). Autoregressive generation under the SCS preserves the equivariance quality of our model. Refer to Appendices E.1 and E.2 for implementation details of focal atom classification and SCS construction. Proof for equivariance can be found in Appendix E.3. Finally, we add a new atom to the drug ligand via sequential generation of its atom type ai , bindings with existing atoms b1:i−1,i and SCS coordinates x(pos) = (di, θi, φi ), in order to better capture the underlying dependencies [20]. This is achieved by sampling the prior random variables z(node) from the variational distribution N (μ R, ΣR ): (cid:105) (pos) (node) (bond) z 1:i−1,i ; z i i Recall from Equation 7 that N (μ R, ΣR ) is parameterized as a di- agonal Gaussian, so each component of the random variable can be sampled independently from each other. In particular, z(bond) is repeatedly sampled for (i − 1) times because we need to determine the bond type between the new atom i and each of the previous (i − 1) ligand atoms. The priors are then consecutively projected to the 3D geometric space via flow transformation Fi : x(node) 1:i−1,i , z(pos) , z(bond) i 1:i−1,i and z(pos) 1:i−1,i , x(pos) ∼ N (μ R, ΣR ) . , z(bond) , x(bond) z(node) i ; e1:i−1 = Fi (17) ; z (cid:16) (cid:17) (cid:104) i i i i . (18) 4.2.2 Parameterization of the Flow Transformation. Following the paradigm described in Equatioin 5, the above flow transformation Fi is parameterized with the subsequent steps: , σ (node) μ (node) i ⊙ z(node) i = Node-MLP(efi ), = σ (node) i i x(node) + μ (node) i i 1:i−1,i = Bond-MLP(e1:i−1, x(node) 1:i−1,i , σ (bond) μ (bond) 1:i−1,i ⊙ z(bond) 1:i−1,i = σ (bond) x(bond) , σ (pos) = Position-MLP(efi i = σ (pos) x(pos) i i ), 1:i−1,i + μ (bond) 1:i−1,i , , x(node) i + μ (pos) i ⊙ z(pos) i μ (pos) i , , i , x(bond) 1:i−1,i ), (19) (20) (21) (22) (23) (24) is the encoding of the focal atom fi , and Node-MLP, Bond- where efi MLP, and Position-MLP are layers of flow MLPs, detailed in Appen- , x(bond) dix B. ⊙ denotes element-wise multiplication, and x(node) 1:i−1,i , i CCCCNONCCCprotein atomligand atomCfocal atomCnewly generated atomCgraph edgepending chemicalbondConstruct radius graphforEchnetencoding1Select focal atom forSphericalCoordinateSystem(SCS)2φCCCCNONCCCdθSampleposition(d, θ, φ)ofnewatomw.r.t.focalatom4CCCCNONCCproteinligandAddanewatom,sampleitsatomtypeaandbondbwithexistingatoms3aCCCCNONCCCbchemical bonda,b,d,θ,φsampledfeatures Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Sun, et al. x(pos) are the vectorized representation of atom type, bond type, i and SCS-based position, and σ, μ are parameters for flow trans- formation. The sequential dependencies between a, b, d, θ, φ are embodied in Equations 21 and 23, where new atom/bond types that have just been generated are immediately used to parameterize σ and μ of the next flow transformation. Thus, we have rendered all the sampled features ai, b1:i−1,i, di, θi , φi from step i, and successfully generate the new atom and its asso- ciated bonds. We go on with this iteration, until the focal classifier reports that no atom is eligible for fi , and the generation procedure is called to an end. Algorithm 2 from Appendix C explains the generation algorithm in more detail. 4.2.3 The Objective Function. As discussed in Section 3.3, the gen- erative flow model explicitly learns the data distribution p (x) and thus has the simple loss function as the negative log-likelihood (denoted as Lflow). We here add a regularization term (denoted as LKL) to align the topology prior as discussed in Section 4.1 with a standard Gaussian. This results in the following loss for GraphVF: Ltotal = Lflow + βLKL, where β is a hyper-parameter that trades off between the two loss terms. (25) To gain more intuition into the construction of this loss func- tion, we formulate the goal of variational training into a bi-level optimization task: pXi (xi ) , maximize subject to DKL (Xi || ^Xi ) < ξ, where ξ is the tolerance threshold for distribution shift between the generated ligands and the reference ligands. Since Fi is an invertible function (i = 1...N ), the LHS of Inequality 27 can be transformed into: (27) (26) Lb KL = DKL (Xi || ^Xi ) = DKL (Fi (Z )||Fi ( ^Z )) = DKL (Z || ^Z ) = DKL (N (μ R, ΣR )||N (0, I )), where b stands for a particular protein-ligand pair. (28) (29) (30) (31) As for Equation 26, it corresponds to the flow loss term described in Equation 4. In the flow-based model, the training process is the exact inverse of the generation process: z(node) i 1:i−1,i , z(pos) , z(bond) i = F −1 i (cid:16) x(node) i , x(bond) 1:i−1,i , x(pos) i (cid:17) . ; e1:i−1 (32) To be specific, zi is derived as follows in the training phase: z(node) i = z(bond) 1:i−1,i = z(pos) i = (cid:16) (cid:16) (cid:16) x(node) i − μ (node) i (cid:17) ⊙ 1:i−1,i − μ (bond) x(bond) 1:i−1,i (cid:17) ⊙ 1 σ (node) i 1 σ (bond) 1:i−1,i x(pos) i − μ (pos) i (cid:17) ⊙ 1 σ (pos) i , (33) (34) (35) where σi and μi are derived in the same way as Equations 19, 21 and 23. For step i in a given drug-ligand pair b, we substitute equations 33∼35 into Equations 4 and 6 to get flow loss term: L (node) i = − log(Prod(N (z(node) i |μ R, ΣR ))) − log(Prod( 1:i−1,i = − log(Prod(N (z(bond) L (bond) 1:i−1,i |μ R, ΣR ))) − log(Prod( )) 1 σ (node) i (36) )) 1 σ (bond) 1:i−1,i (37) L (pos) i = − log(Prod(N (z(pos) i |μ R, ΣR ))) − log(Prod( )) 1 σ (pos) i (38) i,b L 1:i−1,i + L (pos) flow = L (node) We further take the binary focal classifier into consideration. For + L (bond) (39) . i i step i of pair b, the flow loss term is formulated as: L i,b focal = (cid:40) 1 M 1 i−1 (cid:205)M j=1 BCELoss( ̃y j , ^ ̃y j ), (cid:205)i−1 j=1 BCELoss(y j , ^y j ), if i = 1; if i > 1, (40) where BCELoss(*) is the binary cross entropy, y j is the predicted focal score of atom j, and ^y j is its ground-truth label. ̃y j stands for the j-th atom from the protein receptor. The ground truth label for focal atom classification during training is curated from a ring-first expert trajectory [16], which preserves ring locality and boosts model performance (Appendix F). Therefore, the β-regularized loss form can be finalized as Lb total = 1 N N ∑︁ i=1 (L i,b flow + L i,b focal ) + βLb KL . (41) Algorithm 1 from Appendix C explains the training algorithm in more detail. 4.3 Controllable generation During generation, the variational prior in GraphVF provides a flexible interface for controlling certain properties of the generated 3D molecules in a zero-shot manner, without the need to re-train the model. For a certain desired ligand attribute ρ, there are two ways to acquire its corresponding prior: 1) Mean aggregation. This is suitable for qualitative attributes, such as the existence of a certain pharmacophore or sub-structure. We collect a set of such molecules with attribute ρ (denoted as {Ra }a ∈I , where I is the index set), and carry out mean aggregation over their structural encodings: (μρ, Σρ ) = 1 |I | ∑︁ a ∈I (μ Ra , ΣRa ). (42) 2) Bayesian Optimization. This approach is ideal for numerical attributes like free energy and enthalpy. We use a sparse gaussian process (SGP) to fit the relationship f between latent encoding and the desired property value f : (μ Ra , ΣRa ) ↦→ ||ρ ||. (43) GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow Conference acronym 'XX, June 03–05, 2023, Woodstock, NY upon this relation f , we perform bayesian optimization to find the latent encoding that corresponds to the maximum value of ||ρ ||: (μρ, Σρ ) = argmax μ,Σ f (μ, Σ). (44) 5 EXPERIMENTS We conduct three sets of experiments to verify the effectiveness of our GraphVF model: • Basic protein-specific generation. Prior set to N (0, I). • Protein-specific generation with controlled sub-structure. Prior selected using mean aggregation. • Protein-specific generation with controlled properties. Prior selected using Bayesian Optimization. 5.1 3D Molecular Generation Conditioned on Protein Pocket Dataset. We use the benchmarking CrossDocked dataset [8], which contains 22.5 million protein-ligand pairs, to evaluate the gener- ation performance of GraphVF. For fair comparison, we follow Pocket2Mol [28] to prepare and split the data. Setup. Following GraphBP [20] and Pocket2Mol, we randomly sample 100 molecules for every protein pocket in the generation stage. The quality of generated molecules is evaluated by 8 widely adopted metrics: (1) High Affinity (HA), which estimates the percentage of generated molecules that have higher CNNAfinity calculated by the Gnina program [25]. Gnina score has been demon- strated to be consistently more accurate and un-biased than Vina score in previous works [20, 27]. For this reason, we do not report Vina-based HA; (2) Synthetic Accessibility (SA), which represents the easi- ness of drug synthesis; (3) Lipinski estimates the mean number of Lipinski rules fol- lowed by the generated molecules; (4) Quantitative Estimation of Drug-likeness (QED), a mea- sure of drug-likeness based on desirability [2]; (5) LopP denotes the octanol-water partition coefficient. Good drug candidates have LogP between -0.4 and 5.6 [9]; (6) Novelty is calculated as 1 − the average of maximum Tani- moto similarities to training set molecules among the gener- ated molecules; (7) Diversity is calculated as 1 − the average Tanimoto sim- ilarities of generated molecules for every protein pockets, following Pocket2Mol; (8) Time estimates the time(s) spent on generating 100 molecules for a pocket. We choose GraphBP and Pocket2Mol as our baselines, which repre- sent the state-of-art models for binding molecule generation. For GraphBP and GraphVF, we trained them on the dataset for 40 epochs with the same hyperparameters. For Pocket2Mol [28], we obtain the pre-trained model from their authors and then compute the scores using Gnina. Results. The comparison results are presented in Table 1. We can see that our GraphVF outperforms the two strong baselines in terms of HA, Lipinski, LogP, Novelty, and Diversity. As is shown by the generation time, GraphVF is much more efficient than Pocket2Mol in 2 orders of magnitude. We have also attained reasonably good performance on drug properties like QED, LogP and SA, even with- out explicit guidance from the variational prior. This shows that our model learns good molecular representations by combining 2D topology with 3D geometry, and is able to generate robustly good molecules under a different prior. The great novelty and diversity of our molecules can be attributed to our variational training strategy. As is exemplified in Figure 5, the distribution shift between training and generation allows GraphVF to explore larger and more complex molecules in the chemical space, and can hopefully generate novel drug-like molecules that have never been discovered before. Ablation study. A critical question about the variational flow architecture is: Will the KL loss term (equation 27) collapse the vari- ational distribution to a standard gaussian, and degrade GraphVF to a purely flow-based model? This is not happening, because our model can learn potentially better molecular representations from . To empirically prove this claim and mimic the degradation φ R2D scenario, we perform an ablation study by masking the 2D encoder and substituting the prior as the standard gaussian N (0, I) φ R2D during training. From the 3rd row of Table 1, we can see that the ablated 'GraphVF (w/o 2D encoder)' version performs much worse. In particular, the HA value for the ablated variant drops drastically from 31.1% to 26.3%. This shows that the variational-flow frame- work is very effective in balancing the 2D/3D dual data sources and preventing model degradation. 5.2 Sub-structure Analysis Setup. As it is pointed out in Pocket2Mol [28] that conventional metrics could not reflect the geometry of sampled molecules, we conduct additional sub-structure analysis. Following Pocket2Mol, We compare GraphVF with previous works by the KL divergence between the distributions of generated bond length, bond angles, dihedral angles and the corresponding distributions of the test set. Results. The results are presented in Table 2. In comparison to GraphBP and Pocket2Mol, GraphVF yields the best results on dihedral angles, which indicates that it is more capable of modeling complex dependencies. At the same time, it achieves comparable results to GraphBP and Pocket2Mol on bond length and bond angles. Ablation study shows 2D encoder helps GraphVF better capture the geometry of sub-structures. We visualize the distribution of CC bond length and CCCC di- hedral angle in Figure 6. In both cases, GraphVF grasps geometry features the best so that it produces a distribution that is the closest to the test set. This shows that our emphasis on the delineation of molecular structures really pays off. The realistic sub-structural distribution is the basis for generating high-quality drug molecules and good controllability. 5.3 Controllable Generation for Specified Chemical Sub-structures Our pretrained framework could be used to encourage desired sub-structures during generation. We carry out case studies on generation of molecules containing the following motifs: alkenyl, imine, 5-member ring containing element S, and 6-member ring containing element O. For each motif, we use mean aggregation to Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Sun, et al. Method GraphBP Pocket2Mol GraphVF (w/o 2D encoder) GraphVF (ours) HA↑ 0.134 0.272 0.263 0.311 SA↑ 0.585 0.765 0.542 0.585 Lipinski↑ QED↑ LogP Novelty↑ Diversity↑ Time (s)↓ 4.909 4.920 4.080 4.968 0.515 0.563 0.310 0.448 2.610 1.586 3.567 0.699 0.569 0.624 0.605 0.737 0.835 0.688 0.807 0.930 20 2504 68 32 Table 1: Performance of different methods on 3D molecular generation based on protein pockets. Best results are in bold. Figure 5: Examples of generated molecules with higher binding affinity (Gnina score ↑) than the reference molecules. Protein names and residue/ligand IDs are listed on top. We use ChimeraX [10] for visualization. Sub-Structure GraphBP Pocket2Mol GraphVF (w/o 2D encoder) GraphVF CC C=O CN CCC CCO NCC CCCC CCCO CC=CC 0.27 0.83 0.70 1.31 0.61 1.00 2.15 2.37 2.20 2.18 3.78 1.78 1.02 1.38 1.05 2.10 2.27 2.85 1.05 0.73 1.27 1.07 0.52 0.62 2.03 2.17 2.70 0.22 0.67 0.77 1.25 0.51 0.83 2.00 2.17 2.04 Table 2: The KL divergence of the distance (upper part), bond angles (middle part) and dihedral angles (lower part) with the test set. The best results are in bold. calculate latent distribution N (μρ, Σρ ) from 500 randomly sampled reference ligand molecules in the training set that contain the motif as a sub-structure. Finally, we calculate the rate of the generated molecules that contain the specified sub-structures on the test set, which is compared with the results of directly sampling from prior distribution N (0, I ). The experimental results are summarized in Table 3. With the prior distributions collected from molecules that contain speci- fied sub-structures, our model is more likely to generate ligand molecules with those sub-structures. When directly sampled from prior distribution N (0, I ), our model generates specified sub-structures at a rate which is the closest to the appearing rate of these structures in the test set, in comparison with GraphBP and Pocket2Mol. !!"#$%&'()$*+$,*-$.-012$'34567$-89:;<-$=%">&$-?$4@-$.17,A$'3-B94$CDEFGHF-$=;G'I$-+?$@1*$.1AJ9$'31AJ9$68KFGHF-$=;G'I$-+?$@1*$.1ELM$'31AJ9$68K""N'$=;G'I$-$-*@$.1A60$'3,ABB$O04,P114P++,P,?,P@@4P4@@[email protected]*4P*-@P+*!"#"$"%&"'()*"&+*",-"%"$./"0()*"&+*", GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Rate of specified sub-structure(%) Test Set GraphBP Pocket2Mol GraphVF w/ latent ρ GraphVF w/o latent ρ alkenyl imine 5-member ring containing element S 6-member ring containing element O 76 47 10 13 41.8 5.5 2.1 4.7 90.7 51.7 2.7 14.3 93.0 83.5 45.0 86.5 66.2 49.7 5.4 17.1 Table 3: Controllable generation for specified sub-structures. The highest rates are in bold; rates closest to test set are under- lined. Average property value Test Set GraphBP Pocket2Mol GraphVF w/ latent ρ GraphVF w/o latent ρ -6.78 -141.00 -141.55 -142.63 -128.75 εHOMO/eV U0/eV U /eV H /eV G/eV -6.64 -174.35 -175.43 -176.83 -160.83 -6.68 -202.17 -202.31 -208.27 -183.01 -7.03 -148.29 -149.03 -150.28 -137.24 -6.60 -108.76 -127.07 -123.40 -106.63 Table 4: Controllable generation for specified molecular properties. The highest values are in bold. expensive, we use the DimeNet [14] model for property prediction, which has been pretrained on the QM-9 [29] dataset. We select 5 important physio-chemical properties for prediction: • Highest occupied molecular orbital energy: εHOMO/eV; • Internal energy at 0K: U0/eV; • Internal energy at 298.15 K: U /eV; • Enthalpy at 298.15K: U /eV; • Free energy at 298.15K: U /eV. We retrieve these properties of our CrossDocked training-set molecules from DimeNet, and their latent encodings from the tree encoder. As described in Section 4.3, we use SGP to fit the property- encoding relationship, and then find the optimal latent encoding N (μρ, Σρ ) with the highest energy through bayesian optimization, which is further used for controllable property generation. Experiment results are presented in Table 4. Our model achieves consistently higher energy than all the baselines, which clearly shows that the latent φρ is effective in curating desired properties of the generated molecules. 6 CONCLUDING REMARKS We propose GraphVF, a novel variational flow-based framework for controllable binding 3D molecule generation. We empirically demonstrate that, through effectively integrating 2D structure se- mantics and 3D pocket geometry, GraphVF can obtain superior performance to the state-of-the-art strategies for pocket-based 3D molecule generation. We also experimentally show that, GraphVF can effectively generate binding molecules with desired ligand sub- structures and bio-chemical properties. Our work here demonstrates that domain constraints can be effectively leveraged by deep generative models to improve the qualities of molecule design and fulfill the need for controllable molecule generation. Our studies here shed light on the potential of generating binding ligands with sophisticated domain knowledge and finer-grained control over a variety of bio-chemical properties. Figure 6: Examples of sub-structural distributions of the test set and those generated from models. 'KLd' in parentheses stands for the KL divergence between the test set distribu- tion and the distribution of the generated data. (a) Distribu- tion of CC bond length; (b) Distribution of CCCC dihedral angle. 5.4 Controllable Molecular Generation for Specified Molecular Properties Our framework can also be explicitly controlled to generate drug- like molecules with desired properties. To support this claim, we perform case studies to optimize the quantum-mechanical (QM) properties of the generated drug ligands right at the binding site. Since ab-initio QM property calculations are very computationally Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Sun, et al. [27] Xingang Peng, Jiaqi Guan, Jian Peng, and Jianzhu Ma. 2023. Pocket-specific 3D Molecule Generation by Fragment-based Autoregressive Diffusion Models. https://openreview.net/forum?id=HGsoe1wmRW5 [28] Xingang Peng, Shitong Luo, Jiaqi Guan, Qi Xie, Jian Peng, and Jianzhu Ma. 2022. Pocket2Mol: Efficient Molecular Sampling Based on 3D Protein Pockets. arXiv preprint arXiv:2205.07249 (2022). [29] Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. 2014. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data 1, 1 (2014), 1–7. [30] Danilo Rezende and Shakir Mohamed. 2015. Variational Inference with Normal- izing Flows. In International Conference on Machine Learning. 1530–1538. [31] Victor Garcia Satorras, Emiel Hoogeboom, and Max Welling. 2021. E (n) equi- variant graph neural networks. In International conference on machine learning. PMLR, 9323–9332. [32] Arne Schneuing, Yuanqi Du, Charles Harris, Arian Jamasb, Ilia Igashov, Weitao Du, Tom Blundell, Pietro Lió, Carla Gomes, Max Welling, et al. 2022. Structure-based Drug Design with Equivariant Diffusion Models. arXiv preprint arXiv:2210.13695 (2022). [33] K. T. Schutt, P.-J. Kindermans, H. E. Sauceda, S. Chmiela, A. Tkatchenko, and K.-R. Muller. 2017. Schnet: A continuous-filter convolutional neural network for modeling quantum interactions. arXiv preprint arXiv:1706.08566 (2017). [34] Chence Shi, Minkai Xu, Zhaocheng Zhu, Weinan Zhang, Ming Zhang, and Jian Tang. 2020. Graphaf: a flow-based autoregressive model for molecular graph generation. arXiv preprint arXiv:2001.09382 (2020). [35] Martin Simonovsky and Nikos Komodakis. 2018. Graphvae: Towards generation of small graphs using variational autoencoders. In International conference on artificial neural networks. Springer, 412–422. [36] Robert Tarjan. 1972. Depth-first search and linear graph algorithms. SIAM journal on computing 1, 2 (1972), 146–160. [37] Zichao Wang, Weili Nie, Zhuoran Qiao, Chaowei Xiao, Richard Baraniuk, and Anima Anandkumar. 2022. Retrieval-based Controllable Molecule Generation. arXiv preprint arXiv:2208.11126 (2022). [38] Eric W Weisstein. 2008. Floyd-warshall algorithm. https://mathworld. wolfram. com/ (2008). io/lil-log (2018). [39] Lilian Weng. 2018. Flow-based deep generative models. lilianweng. github. [40] C. G. Wermuth, C. R. Ganellin, P. Lindberg, and L. A. Mitscher. 1998. Glossary of terms used in medicinal chemistry (IUPAC Recommendations 1998). Pure and Applied Chemistry 70, 5 (1998), 1129–1143. https://doi.org/doi:10.1351/ pac199870051129 [41] Jiaxuan You, Bowen Liu, Zhitao Ying, Vijay Pande, and Jure Leskovec. 2018. Graph convolutional policy network for goal-directed molecular graph genera- tion. Advances in neural information processing systems 31 (2018). [42] Jinhua Zhu, Yingce Xia, Chang Liu, Lijun Wu, Shufang Xie, Tong Wang, Yusong Wang, Wengang Zhou, Tao Qin, Houqiang Li, et al. 2022. Direct molecular conformation generation. arXiv preprint arXiv:2202.01356 (2022). REFERENCES [1] Maximilian Balandat, Brian Karrer, Daniel Jiang, Samuel Daulton, Ben Letham, Andrew G Wilson, and Eytan Bakshy. 2020. BoTorch: A framework for efficient Monte-Carlo Bayesian optimization. Advances in neural information processing systems 33 (2020), 21524–21538. [2] G. R. Bickerton, G. V. Paolini, J. Besnard, S. Muresan, and A. L. Hopkins. 2012. Quantifying the chemical beauty of drugs. Nature chemistry 4, 2 (2012), 90–92. [3] CEOI. 1999. Sightseeing trip. http://poj.org/problem?id=1734 (1999). [4] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. 2014. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555 (2014). [5] Hanjun Dai, Yingtao Tian, Bo Dai, Steven Skiena, and Le Song. 2018. Syntax-directed variational autoencoder for structured data. arXiv preprint arXiv:1802.08786 (2018). [6] Laurent Dinh, David Krueger, and Yoshua Bengio. 2014. Nice: Non-linear inde- pendent components estimation. arXiv preprint arXiv:1410.8516 (2014). [7] William J Egan. 2010. Predicting ADME properties in drug discovery. Drug Design: Structure-and Ligand-Based Approaches (2010), 165–177. [8] Paul G Francoeur, Tomohide Masuda, Jocelyn Sunseri, Andrew Jia, Richard B Iovanisci, Ian Snyder, and David R Koes. 2020. Three-dimensional convolutional neural networks and a cross-docked data set for structure-based drug design. Journal of chemical information and modeling 60, 9 (2020), 4200–4215. [9] A. K. Ghose, V. N. Viswanadhan, and J. J. Wendoloski. 1998. A Knowledge-Based Approach in Designing Combinatorial or Medicinal Chemistry Libraries for Drug Discovery. 1. A Qualitative and Quantitative Characterization of Known Drug Databases. Journal of Combinatorial Chemistry (1998). [10] Thomas D Goddard, Conrad C Huang, Elaine C Meng, Eric F Pettersen, Gregory S Couch, John H Morris, and Thomas E Ferrin. 2018. UCSF ChimeraX: Meeting modern challenges in visualization and analysis. Protein Science 27, 1 (2018), 14–25. [11] Juan S Gomez-Jeria and Andres Robles-Navarro. 2015. A Note on the Docking of some Hallucinogens to the 5-HT2A Receptor. Journal of Computational Methods in Molecular Design 5, 1 (2015), 45–57. [12] Emiel Hoogeboom, Victor Garcia Satorras, Clement Vignac, and Max Welling. 2022. Equivariant diffusion for molecule generation in 3d. In International Con- ference on Machine Learning. PMLR, 8867–8887. [13] Wengong Jin, Regina Barzilay, and Tommi Jaakkola. 2018. Junction tree varia- tional autoencoder for molecular graph generation. In International conference on machine learning. PMLR, 2323–2332. [14] Johannes Klicpera, Shankari Giri, Johannes T Margraf, and Stephan Günne- mann. 2020. Fast and uncertainty-aware directional message passing for non- equilibrium molecules. arXiv preprint arXiv:2011.14115 (2020). [15] Siu Kwan Lam, Antoine Pitrou, and Stanley Seibert. 2015. Numba: A llvm-based python jit compiler. In Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC. 1–6. [16] Yibo Li, Jianfeng Pei, and Luhua Lai. 2021. Learning to design drug-like molecules in three-dimensional space using deep generative models. arXiv preprint arXiv:2104.08474 (2021). [17] Yibo Li, Jianfeng Pei, and Luhua Lai. 2021. Structure-based de novo drug design using 3D deep generative models. Chemical science 12, 41 (2021), 13664–13675. [18] David R Lide. 2012. Characteristic bond lengths in free molecules. CRC Handbook of Chemistry and Physics. CRC Press/Taylor and Francis, (2012). [19] Haitao Lin, Yufei Huang, Meng Liu, Xuanjing Li, Shuiwang Ji, and Stan Z Li. 2022. DiffBP: Generative Diffusion of 3D Molecules for Target Protein Binding. arXiv preprint arXiv:2211.11214 (2022). [20] Meng Liu, Youzhi Luo, Kanji Uchino, Koji Maruhashi, and Shuiwang Ji. 2022. Gen- erating 3D Molecules for Target Protein Binding. arXiv preprint arXiv:2204.09410 (2022). [21] Qi Liu, Miltiadis Allamanis, Marc Brockschmidt, and Alexander Gaunt. 2018. Constrained graph variational autoencoders for molecule design. Advances in neural information processing systems 31 (2018). [22] Shitong Luo, Jiaqi Guan, Jianzhu Ma, and Jian Peng. 2021. A 3D generative model for structure-based drug design. Advances in Neural Information Processing Systems 34 (2021), 6229–6239. [23] Youzhi Luo and Shuiwang Ji. 2022. An autoregressive flow model for 3d molecu- lar geometry generation from scratch. In International Conference on Learning Representations (ICLR). [24] Kaushalya Madhawa, Katushiko Ishiguro, Kosuke Nakago, and Motoki Abe. 2019. Graphnvp: An invertible flow model for generating molecular graphs. arXiv preprint arXiv:1905.11600 (2019). [25] A. T. McNutt, P. Francoeur, R. Aggarwal, T. Masuda, R. Meli, M. Ragoza, J. Sunseri, and D. R. Koes. 2021. Gnina 1.0: Molecular Docking with Deep Learning. Journal of cheminformatics (2021). [26] George Papamakarios, Theo Pavlakou, and Iain Murray. 2017. Masked autoregres- sive flow for density estimation. In Proceedings of the 31st International Conference on Neural Information Processing Systems. 2335–2344. GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Appendices A LIGAND SCAFFOLDS ENCODING A.1 Parsing and pooling There are 3 types of canonical sub-structures, as exemplified by the DMT molecule in Figure 3: (1) Rings, e.g. the blue, green nodes; (2) Non-ring covalent atom pairs, e.g. the red, yellow and purple nodes; (3) Pivot atoms that are connected to 3 or more items, e.g. the gray node. The rules for identifying sub-structures are self-contained, yielding a relatively sparse and stable set of vocabulary. A total of 427 canonical sub-structures are identified from the 100,000 reference ligands in the CrossDocked dataset. Once the ligand molecule is parsed into a compilation of sub-structures, the molecular graph can be pooled into a junction tree in a straightforward manner, where each sub-structure corresponds to a tree node, and any two intersecting sub-structures yield an edge between their corresponding nodes. A.2 Latent encoding Finally, the structural encoding of the whole molecule is obtained by feeding hroot through a MLP: (45) (μ R, ΣR ) = φ R = MLP(hroot). Two equally-shaped (34 × 1) dense vectors μ R and ΣR comprise the latent encoding and parameterize the mean and variance of an amortized diagonal Gaussian distribution N (μ R, ΣR ). Their different channels serve different purposes during sampling. A de-quantized one-hot vector for atom type (27 possible choices) is sampled from the first 27 channels. A de-quantized one-hot vector for bond type (single, double, triple, or none) is sampled from the next 4 channels. The latent values for (d, θ, φ) are directly sampled from the last three channels because they are continuous by nature. The gaussian distribution N (μ R, ΣR ) is parameterized to have a diagonal co-variate matrix, so each channel of this gaussian is independent from each other. All parameters in this section are trainable. Our earlier attempts with a pre-trained version of GRU would result in serious degradation of the quality of generated molecules. Thus, end-2-end training of these parameters is ideal for achieving better model performance. B IMPLEMENTATION DETAILS Network Architecture. We stack 6 layers of the Echnet and 20 layers of the tree GRU. We use 6 variational flow layers for generation. Training Details. We train GraphVF for 40 epochs on the full training set with batch size 4. We use Adam optimizer while setting learning rate as 1e-4 and weight decay as 1e-6. For the β-annealing which is applied to the whole training process, we pick the minimum β as 1e-4 and maximum β as 0.015. Generation Details. We sample 100 molecules for each pocket in the test set. Molecules that have less than 15 atoms are excluded and re-sampled, while molecules that have more than 50 atoms are truncated at the 50-th atom. Additionally, to help GraphVF generate ligand molecules with good geometric properties, we propose to limit the sample space by five validity constraints during generation: (1) A bond always exists between the newly generated atom and the focal atom; (2) At most one other atom could be connected to the newly generated atom with a bond; (3) The newly generated atom could only have bonds with atoms that are predicted positive by the focal classifier; (4) The element of generated atom always lies in C, N, O, P, S, Cl; (5) The length of all generated bonds should be less than 10 Å; (6) When all the generated molecules have a diameter > 10 Å, all unfinished molecules should be dropped for a new round of generation. These constraints can be flexibly applied, without the need to re-train the model from scratch. Therefore, they can be duly employed to our generation process to achieve uniformly good results on different benchmarks. Sub-structure Analysis. To approximate the distribution for visualization and calculation of KL divergence, we set 0.01 Å per bin for distance and 1 degree per bin for bond angles and dihedral angles. In total, we have 2,000 bins for distances ranging from 0 to 20 Å, 180 bins for bond angles and 360 bins for dihedral angles. To avoid 0 during calculating KL divergence, we replace every 0-count with 1 / number-of-bins. For fair comparison, we use every model to sample 100 ligand molecules for each protein in the test set. Controllable Generation for Specified Sub-structures. When we sample from the training set, molecules with more than 16 atoms are dropped because they are likely to be less representative owing to having multiple sub-structures. Controllable Generation for Specified Properties. We use DimeNet++ pretrained on QM-9 dataset (preset as part of the DGL library) for generation. We implement Bayesian optimization using BoTorch [1], a framework for efficient Monte-Carlo Bayesian Optimization. Since SGP has O (n3) time complexity and O (n2) space complexity, we can only afford to perform BO on a 1/10 training dataset with 10000 reference ligand molecules. We use an upper confidence bound (UCB) with β = 0.1. In the acquisition function, we use 512 raw samples for initializations and set 10 re-starts to get the top 1 encoding with the highest property score. During the inference stage, we notice that DimeNet can produce unrealistic property scores close to infinity, so we regularize the prediction result using the 3σ principle, where the mean and variance statistics is gleaned from the QM-9 dataset labels. This regularization effectively covers about 90% of all the outputs. Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Sun, et al. C ALGORITHMS FOR TRAINING AND GENERATION The pseudo codes of training and generation algorithms are in Algorithms 1 and 2. Algorithm 1 Training algorithm of GraphVF Input: η learning rate, B batch size, T maximum epoch number, Variational annealing hyperparameters βmin, βmax, use Prod(*) as the product of elements across dimensions of a tensor Initial: Parameters θ of GraphVF (Echnet, junction tree encoder, focal classifier, and Node/Edge/Position-MLP) (cid:1) ⊲ β-annealing acc. to epoch number 1: for t = 1, ..,T do 2: β = βmin + (βmax − βmin) sin2 (cid:0)π t T for b = 1, ..., B do Sample a receptor-ligand pair from dataset, with receptor size M and ligand size N Protein receptor P = ( ̃V , ̃E), where ̃V = {( ̃ai, ̃ri )}M i=1 Drug ligand R = (V , E), where V = {(ai, ri )}N , and E = {bi j }N i=1 Re-order R with ring-first graph traversal (μ R, ΣR ) = JT-Encoder(R), where prior Z ∼ N (μ R, ΣR ) for i = 1, ..., N do , and ̃E = { ̃bi j }M i,j=1 i,j=1 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: Construct sub-graph Gi := τ (P ∪ R1:i−1) if i=1 then fi := Nearest receptor atom ^y = one-hotM (fi ) Predict focal score y for all receptor atoms 1 : M else fi := i − 1 ^y = one-hoti−1 (fi ) Predict focal score y for all known ligand atoms 1 : i − 1 i i (cid:17) (cid:17) = ⊙ ⊙ x(node) i 1 σ (node) i end if ̃e1:M, e1:i−1 = Echnet(Gi ) x(node) = ai + u, u ∼ U [0, 1)d (node) i μ (node) , σ (node) = Node-MLP(efi ) i (cid:16) z(node) − μ (node) i i x(bond) 1:i−1,i = b1:i−1,i + u, u ∼ U [0, 1) (i−1)×d (bond) μ (bond) 1:i−1,i , σ (bond) 1:i−1,i = Bond-MLP(e1:i−1, x(node) ) (cid:16) 1:i−1,i − μ (bond) x(bond) z(bond) 1:i−1,i = 1:i−1,i x(pos) = Spherize(ri ; fi, ci, ei ) i μ (pos) , σ (pos) = Position-MLP(efi i i (cid:16) z(pos) − μ (pos) 1 i i σ (pos) i L (node) = − log(Prod(N (z(node) 1:i−1,i = − log(Prod(N (z(bond) L (bond) = − log(Prod(N (z(pos) L (pos) i flow = L (node) i,b focal = BCELoss(y, ^y) i + L (bond) 1:i−1,i + L (pos) 1 σ (bond) 1:i−1,i , x(node) i x(pos) i L i,b ⊙ = (cid:17) i i i i , x(bond) 1:i−1,i ) |μ R, ΣR ))) − log(Prod( 1:i−1,i |μ R, ΣR ))) − log(Prod( 1 |μ R, ΣR ))) − log(Prod( σ (pos) i )) 1 σ (node) i 1 σ (bond) 1:i−1,i )) L end for Lb KL = DKL (N (μ R, ΣR )||N (0, I )) (cid:17) (cid:16) Lb total = 1 L N end for θ ← ADAM((cid:205)B i,b focal i,b flow , θ, η) Lb + L (cid:205)N i=1 b=1 total + βLb KL 39: 40: end for ⊲ 2D Global ⊲ 3D Autoregressive ⊲ Encode 3D conformation ⊲ Atom type dequantization ⊲ Bond type dequantization ⊲ Spherize atom position to fi )) ⊲ Step-wise loss term for normalizing flow ⊲ Step-wise loss term for focal classifier ⊲ Global loss term for variational distribution Z ⊲ Parameter update GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Algorithm 2 Generation algorithm of GraphVF Input: T number of protein receptors, B number of drug ligands to generate for each receptor, N maximum number of atoms in the generated ligand. Optional parameters (μρ, Σρ ) as the cue to certain desired property ρ, (0, I ) by default. Initial: Trained GraphVF model (Echnet, junction tree encoder, focal classifier, and Node/Edge/Position-MLP) 1: for t = 1, ..,T do 2: Sample a protein receptor from dataset, with receptor size M Protein receptor P = ( ̃V , ̃E), where ̃V = {( ̃ai, ̃ri )}M i=1 LigGent ← [ ] for b = 1, ..., B do , and ̃E = { ̃bi j }M i,j=1 Drug ligand representation R := (V , E), initialized as empty for i = 1, ..., N do Construct sub-graph Gi := τ (P ∪ R1:i−1) Predict focal score, sample focal atom fi from eligible atoms if none eligible for fi then break inner loop (cid:105) ⊙ z(node) i ∼ N (μ R, ΣR ) end if ̃e1:M, e1:i−1 = Echnet(Gi ) Sample (cid:104) (pos) (node) (bond) ; z 1:i−1,i ; z z i i , σ (node) μ (node) = Node-MLP(efi ) i i = σ (node) x(node) i i μ (bond) 1:i−1,i , σ (bond) 1:i−1,i = Bond-MLP(e1:i−1, x(node) 1:i−1,i = σ (bond) x(bond) 1:i−1,i ⊙ z(bond) , σ (pos) μ (pos) = Position-MLP(efi i i x(pos) = σ (pos) + μ (pos) i i i Derive (ai, ri ) from (x(node) , x(pos) i i V .append({(ai, ri )}); E.append({b1:i−1,i }) 1:i−1,i + μ (bond) 1:i−1,i , x(node) i + μ (node) i ⊙ z(pos) i i ) , x(bond) 1:i−1,i ) ); b1:i−1,i from x(bond) 1:i−1,i end for LigGent .append(R) 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: ⊲ Signal for generation complete ⊲ Encode 3D conformation ⊲ Sample from latent space ⊲ Atom type generation ⊲ Bond type generation ⊲ Atom position generation ⊲ Autoregressive ligand generation end for 25: 26: end for 27: return [LigGen1, LigGen2, ..., LigGenT ] D CHEMICAL STRUCTURE ILLUSTRATION Figure 7: (a) Comparison between Serotonin and DMT structure; (b) Binding pose of DMT with 5-HT2A, pay special attention to the interaction between NHMe2 and Asp-231. (a)(b) Conference acronym 'XX, June 03–05, 2023, Woodstock, NY Sun, et al. E FOCAL ATOM AND THE SPHERICAL COORDINATE SYSTEM E.1 Focal atom selection During the training/generation process, focal scores are evaluated at each step. In the first step, there are no known ligand atoms, so the focal score is evaluated among the receptor molecules. In the following steps, focal atoms are only evaluated among the known ligand atoms. For the generation process, atoms become eligible candidates of the focal atom, as long as their focal scores exceed a given threshold (set to 0.5 in our implementation). The focal atom of that step is then randomly sampled from these eligible candidates. In the case when no atoms are eligible for the focal atom, the generation process is called to an end. For the training process, we use a teacher-forcing strategy. That is to say, we rely on an expert trajectory (curated from the ring-first traversal algorithm, described in Appendix F) to select our focal atom. In the first step, the focal atom is set to be the receptor atom that is nearest to the drug ligand. In the i-th step (i > 1), the focal atom is set to be the (i − 1)-th atom in the expert trajectory. The ground truth label for focal score is set to either 1 (focal) or 0 (non-focal), and we use a mean-reduced BCELoss to evaluate the discrepancy between the predicted focal score and the ground-truth label. E.2 Construction of the spherical coordinate system (SCS) We construct a spherical coordinate system (SCS) around the focal atom f and its nearest 2 neighboring atoms c and e. Formally, given the Cartesian coordinates of reference atoms (r f , rc, re ), we want to express the position of an arbitrary atom i in spherical coordinates (di, θi, φi ). Suppose ri is the Cartesian coordinates of atom i, n1 is the normal vector of plane (r f , rc, ri ), and n2 is the normal vector of plane (r f , rc, re ), then Conversely, we can also render the Cartesian coordinates of i from its spherical coordinates: , (cid:13) (cid:13)2 di = (cid:13) (cid:13)ri − r f  θi = (cid:10)ri − r f , rc − r f  φi = ⟨n1, n2⟩ ,  (cid:11) , di ≥ 0 θi ∈ [0, π] φi ∈ [−π, π] (46) di (re,φi − re,c f ) sin θi (cid:13) (cid:13)re,φi − re,c f is the coordinate of e after rotating the plane (r f , rc, re ) where re,c f is the coordinate of the projection of e on the line (r f , rc ), and re,φi along the line (r f , rc ) by the torsion angle φi . We define this operation as h : (di, θi, φi ) ↦→ (xi, yi, zi ). Note that this transformation between the Cartesian and spherical coordinates is SE(3)-equivariant. Namely, for any orthogonal matrix Q ∈ R3×3 and translation vector b ∈ R3: (xi, yi, zi ) = ri = r f + di (rc − r f ) cos θi (cid:13) (cid:13)rc − r f (cid:13) 2 (cid:13) 2 (cid:13) 2 (cid:13) 2 (47) + , h (cid:17) (cid:16) di, θi, φi ; Qr f + b, Qrc + b, Qre + b (cid:16) Qrc − Qr f (cid:13) 2 (cid:13) 2 di cos θi + (cid:17) (cid:13) (cid:13)Qrc − Qr f (cid:16) (cid:17) di cos θi rc − r f =Qr f + b + =Qr f + b + Q + Q di sin θi (cid:16) Qre,φi − Qre,c f (cid:17) (cid:13) (cid:13)Qre,φi − Qre,c f (cid:16) di sin θi re,φi − re,c f (cid:13) 2 (cid:13) 2 (cid:17) (cid:13) (cid:13)rc − r f (cid:16) (cid:13) 2 (cid:13) 2 (cid:17) rc − r f di cos θi di sin θi (cid:13) (cid:13)re,φi − re,c f (cid:17) (cid:16) re,φi − re,c f =Q        =Qh r f + (cid:13) (cid:13)rc − r f (cid:13) (cid:13) (cid:16) di, θi, φi ; r f , rc, re 2 2 (cid:17) + + b. (cid:13) (cid:13)re,φi − re,c f (cid:13) 2 (cid:13) 2 (cid:13) 2 (cid:13) 2        + b (48) (49) (50) (51) (52) E.3 Equivariance of the generation process The intuition behind preserving equivariance during the generation process is: when the rest part of a molecule moves in space, the newly generated part of that molecule should move accordingly. Formally, we have the following theorem: Theorem 1 (SE(3)-equivariant generation). At the i-th (i = 1, ..., N ) generation step, the generation probability is equivariant to any orthogonal matrix Q ∈ R3×3 and translation vector b ∈ R3: (cid:16) Qri + b | Ai, Bi, RiQT + 1b T (cid:17) p = p (ri | Ai, Bi, Ri ) , (53) where Ai is the types of all known atoms, Bi is the types of all known bonds, and Ri is the Cartesian coordinates of all known atoms. 1◦ To prove the above theorem, we first show that the spherical coordinates (di, θi, φi ) are SE(3)-invariant to flow transformation. By combining Equations 16 and 18, we can derive the following clean-cut equation: i , zφ b a i , z (di, θi, φi ) = g(z i , zθ 1:i−1,i, zd i ; Ai, Bi, Ri ), (54) GraphVF: Controllable Protein-Specific 3D Molecule Generation with Variational Flow Conference acronym 'XX, June 03–05, 2023, Woodstock, NY where g is an invertible flow transformation, parameterized by Ai, Bi, Ri through EchNet. Since EchNet perceives 3D geometry only through relative distances, g is thus SE(3)-invariant: 1:i−1,i, zd i ; Ai, Bi, RiQT + 1b b a T ) = g(z i , z i ; Ai, Bi, Ri ). 1:i−1,i, zd b a i , z g(z i , zφ i , zφ i , zθ i , zθ (55) 2◦ We further show that Cartesian coordinates are SE(3)-equivariant to flow transformation under the same set of reference atoms. For Equation 55, we substitute its LHS into Equation 48, and its RHS into Equation 52: h (cid:16) i , zφ i , zθ 1:i−1,i, zd b a i ; Ai, Bi, RiQT + 1b i , z g(z (cid:16) i , zφ i , zθ 1:i−1,i, zd b a i , z g(z (cid:17) T ); Qr f + b, Qrc + b, Qre + b (cid:17) (56) =Qh i ; Ai, Bi, Ri ); r f , rc, re We define a short-hand composite function gr := h ◦ g, and the resultant equation unequivocally shows that Cartesian coordinates are SE(3)-equivariant to gr under the same f , c, e: i , zφ b a gr (z i , z i , zθ 3◦ Finally, since both sides of Equation 58 share the same underlying distribution [za i ; Ai, Bi, Ri ) + b = Qri + b. i ; zφ 1:i−1,i ; zd i ] ∼ N (μ R, ΣR ), we eventually i ; Ai, Bi, RiQT + 1b b a T ) = Qgr (z i , z i , zφ i ; zb 1:i−1,i, zd 1:i−1,i, zd i ; zθ i , zθ + b. (58) (57) come to the SE(3)-equivariance of our generation process, formulated as Equation 53. Theorem 1 is thus proved. F RING-FIRST TRAVERSAL ALGORITHM Figure 8: Overview of the ring-first traversal algorithm, from step (a) to (e). The desirable ring-first labeling is demonstrated in the down-left, and the undesirable DFS labeling is in the up-left. Consecutive labels are marked with the same color. For our auto-regressive model, we curate an expert trajectory for training (Appendix E.1), using the ring-first traversal algorithm. Chemical structures are typically composed of rings and functional groups, and the ring-first traversal algorithm tries to label atoms from the same ring/functional group consecutively to preserve the local semantics of the chemical structure during training. For example, in the left side of Figure 8, the ring-first labeling is a desirable delineation of the different rings/functional groups existing in the molecule (benzene, thiophene, and carbonyl), but the DFS labeling mixes them up. We propose a minimal-ring Floyd algorithm to implement the ring-first strategy. As shown in Figure 8, it consists of 5 steps: (a) Find the minimal ring via Floyd's algorthm [3, 38], and substitute it into a single point; (b) Repeat step (a), until there is no ring in the graph, i.e. the graph has become a tree; (c) Apply depth-first search (DFS) [36] to label the tree nodes; (d) If a tree node has once been rings, expand it back into a ring. Label the nodes in the same ring consecutively. Offset the labeling of successive nodes accordingly; (e) Repeat step (d), until the original molecular graph structure is restored. The resultant labeling is the desirable ring-first labeling. This ring-first traversal algorithm has a time complexity of O (n5), where n is the number of nodes in the molecular graph (excluding hydrogen atoms). To accelerate the algorithm, we refactor our code with Numba [15] to allow just-in-time compilation and achieve a marked ∼ 50× acceleration. We have thus been able to improve our training procedure using ring-first traversal, without losing efficiency. The detailed implementation of the ring-first traversal algorithm can be found in our code repository.
http://arxiv.org/abs/2302.12261v1
2023-02-23T17:26:51
2023-02-23T17:26:51
Testing Stationarity Concepts for ReLU Networks: Hardness, Regularity, and Robust Algorithms
We study the computational problem of the stationarity test for the empirical loss of neural networks with ReLU activation functions. Our contributions are: Hardness: We show that checking a certain first-order approximate stationarity concept for a piecewise linear function is co-NP-hard. This implies that testing a certain stationarity concept for a modern nonsmooth neural network is in general computationally intractable. As a corollary, we prove that testing so-called first-order minimality for functions in abs-normal form is co-NP-complete, which was conjectured by Griewank and Walther (2019, SIAM J. Optim., vol. 29, p284). Regularity: We establish a necessary and sufficient condition for the validity of an equality-type subdifferential chain rule in terms of Clarke, Fr\'echet, and limiting subdifferentials of the empirical loss of two-layer ReLU networks. This new condition is simple and efficiently checkable. Robust algorithms: We introduce an algorithmic scheme to test near-approximate stationarity in terms of both Clarke and Fr\'echet subdifferentials. Our scheme makes no false positive or false negative error when the tested point is sufficiently close to a stationary one and a certain qualification is satisfied. This is the first practical and robust stationarity test approach for two-layer ReLU networks.
[ "Lai Tian", "Anthony Man-Cho So" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12261v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12261v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.OC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.OC", "cs.LG" ]
Testing Stationarity Concepts for ReLU Networks: Hardness, Regularity, and Robust Algorithms Lai Tian ∗ Anthony Man-Cho So † February 27, 2023 Abstract We study the computational problem of the stationarity test for the empirical loss of neural networks with ReLU activation functions. Our contributions are: 1. Hardness: We show that checking a certain first-order approximate stationarity concept for a piecewise linear function is co-NP-hard. This implies that testing a certain stationarity concept for a modern nonsmooth neural network is in general computationally intractable. As a corollary, we prove that testing so-called first- order minimality for functions in abs-normal form is co-NP-complete, which was conjectured by Griewank and Walther (2019, SIAM J. Optim., vol. 29, p284). 2. Regularity: We establish a necessary and sufficient condition for the validity of an equality-type subdifferential chain rule in terms of Clarke, Fr ́echet, and limiting subdifferentials of the empirical loss of two-layer ReLU networks. This new condition is simple and efficiently checkable. 3. Robust algorithms: We introduce an algorithmic scheme to test near-approximate stationarity in terms of both Clarke and Fr ́echet subdifferentials. Our scheme makes no false positive or false negative error when the tested point is sufficiently close to a stationary one and a certain qualification is satisfied. This is the first practical and robust stationarity test approach for two-layer ReLU networks. 3 2 0 2 b e F 3 2 ] C O . h t a m [ 1 v 1 6 2 2 1 . 2 0 3 2 : v i X r a ∗Department of Systems Engineering and Engineering Management, The Chinese University of Hong Kong, Sha Tin, N.T., Hong Kong SAR. E-mail: [email protected]. †Department of Systems Engineering and Engineering Management, The Chinese University of Hong Kong, Sha Tin, N.T., Hong Kong SAR. E-mail: [email protected]. 1 1 Introduction For a continuously differentiable function f : Rd The theoretical analysis of ReLU neural network training is challenging from the optimiza- tion perspective, though the empirical performance of various "gradient"-based algorithms is surprisingly good. A key difficulty comes from the entanglement of nonconvexity and nonsmoothness in the objective function of the empirical loss, which causes not only the notion of gradient from classical analysis meaningless, but also the subdifferential set from convex analysis vacuous. Consequently, the study of such a nonconvex nondifferentiable function requires the use of tools from variational analysis (Rockafellar and Wets, 2009). Rd is called f (x) = 0. However, the situation is much more compli- stationary (or critical) if cated when f is nondifferentiable at x. Indeed, there are many different stationar- ity concepts (see Definition 6) for nonsmooth functions (Li et al., 2020; Cui and Pang, 2021). For general Lipschitz functions, recently, under the oracle complexity frame- work of Nemirovskij and Yudin (1983), substantial progress has been made on the de- sign of provable algorithms for finding approximately stationary (in the sense of per- turbed) points (Zhang et al., 2020; Tian et al., 2022; Davis et al., 2022; Lin et al., 2022; Metel and Takeda, 2022; Kong and Lewis, 2022) and also on establishing the hardness of computing such approximate stationary points (Kornowski and Shamir, 2022a; Tian and So, 2022; Kornowski and Shamir, 2022b; Jordan et al., 2022). R, a point x → ∇ ∈ As a complement to these developments, in this paper, we consider the complexity of and robust algorithms for checking whether a given neural network is an (approximately) stationary one with respect to the empirical loss. This is a task already considered by Yun et al. (2018). We emphasize that "checking" and "finding" are two very different computational problems. While the co-NP-hardness of checking the local optimality of a given point in smooth nonconvex programming was shown by Murty and Kabadi (1987) in 1987, the complexity of "finding" a local minimizer was an open question proposed by Pardalos and Vavasis (1992) since 1992, and is recently settled by Ahmadi and Zhang (2022). Given a neural network with smooth elemental components, testing the (approximate) stationarity of a point is simply an application of the classic gradient chain rule. In a modern computational environment, this is usually done by using Algorithmic Differen- tiation (AD) (Griewank and Walther, 2008) software, e.g., PyTorch and TensorFlow. A natural question that arises is whether testing the stationarity for a piecewise smooth function (e.g., empirical loss of a ReLU network) is as easy as testing for a smooth one. Surprisingly, we show (in Theorem 10) that such testing is, in general, computationally intractable. The difficulty here is due to the failure of an exact (equality-type) subdifferential chain rule. For a general locally Lipschitz function, the calculus rules are only known to hold in the form of set inclusions rather than equalities, except in several special cases (see Fact 8). This prevents one from computing the subdifferential set of the empirical loss with that of elemental components. Thus, to facilitate the tractability of stationarity testing, it is of interest to find out a condition, under which an equality-type chain rule holds, and the subdifferential set of the empirical loss can be characterized. By con- trast, given a first-order oracle providing the whole generalized subdifferential set at the queried point in the oracle framework (Kornowski and Shamir, 2022a; Tian and So, 2022; Kornowski and Shamir, 2022b; Jordan et al., 2022), the stationarity testing task reduces to a simple linear program, which can be solved by interior-point methods in polynomial 2 time. However, in practice, even computing an element in the generalized subdifferential for a nonsmooth function can be highly non-trivial (Burke et al., 2002; Nesterov, 2005; Huang and Ma, 2010; Khan and Barton, 2013). Therefore, a condition for the validity of the exact chain rule could be useful for subgradient computation and stationarity testing and analysis. The most closely related work to ours is the one by Yun et al. (2018). They consid- ered a two-layer ReLU network and introduced a theoretical algorithm to sequentially check Clarke stationarity (see Definition 6), Fr ́echet stationarity, and a certain second- order optimality condition. For Fr ́echet stationarity testing, they proposed to verify the nonnegativity of a directional derivative in every possible direction, for which a trivial test in the worst case requires checking exponentially many inequalities. By exploiting polyhedral geometry, they showed that it suffices to check only extreme rays, which can be done in polynomial time. A limitation of the work (Yun et al., 2018) (see also the discussion in (Yun et al., 2018, Section 5)) is that the algorithm therein can only perform exact stationarity testing (see Section 5.1). That is to say if the objective function is , then the algorithm in (Yun et al., 2018) will certify stationarity if and only if x | x = 0. However, as pointed out by Yun et al. (2018, Section 5), in practice, such an exact nondifferentiable point is almost impossible to reach. Therefore, it is desirable to have a robust stationarity testing algorithm that works for points sufficiently close to a stationary one. In other words, we are interested in testing so-called near-approximate stationarity (see Definition 25). We mention that, without exploiting structures in the nonsmooth objective function, such robust testing is impossible in general (Tian and So, 2022, Theorem 2.7). 7→ | x 1.1 Our Results and Techniques Hardness. Our first main result shows that checking certain first-order approximate stationarity concept for an unconstrained piecewise differentiable function is co-NP-hard (see Theorem 10). This implies that testing a certain stationarity concept for a shallow modern convolutional neural network is co-NP-hard (see Corollary 12). Our reduction is from the 3-satisfiability (3SAT) to a stationarity testing problem. As a corollary, we prove that testing so-called first-order minimality (FOM) for functions in abs-normal form is co-NP-complete (see Corollary 11) and give an affirmative answer to a conjecture of Griewank and Walther (2019, SIAM J. Optim., vol. 29, p284). Our other results concern the empirical loss of a two-layer ReLU network, which was R with the Rd also studied by Yun et al. (2018). Given the training data x = ( ̃x, 1) parametrization, we first make the following blanket assumptions. N (xi, yi) i=1 ⊆ } { × Assumption 1 (Blanket assumptions). The loss function l : R R is smooth and → has locally Lipschitz gradient. For simplicity of notation, we write li( , yi). For ) for l( * * any i = 0, which is superfluous for the x = ( ̃x, 1) parametrization. × R [N ], we assume xi 6 ∈ The empirical loss of a two-layer ReLU neural network with H hidden nodes can be written as L(u1, w1, . . . , uH , wH) := li N H Xi=1 Xk=1 uk * max w⊤k xi, 0 n o . ! 3 Regularity. By na ̈ıvely abusing the convex subdifferential chain rule for L, we consider the following "generalized subdifferential" of the empirical loss L as N H ̃G := Xi=1 ρi * Yk=1 n k=1 uk * H max w⊤k xi, 0 n oo uk * × ( n xi * uk * 1w⊤ k xi>0 xi * [0, 1] o if w⊤k xi 6 = 0, if w⊤k xi = 0, , max (cid:16)P w⊤k xi, 0 with ρi := l′i [N ]. This "generalized subdifferential" is i popular in practical computation and theoretical analysis. For example, see (Wang et al., 2019, Equation (9)), (Arora et al., 2019, Section 3.1), and (Safran et al., 2022, Equations (5) and (6)). However, as L is nonconvex and nonsmooth, we can only assert a fuzzy chain rule (see (Clarke, 1990, Section 2.3)) for the Clarke subdifferential ∂C L of L, which is a set inclusion ∂CL(u1, w1, . . . , uH , wH) ̃G rather than an equation. (cid:9)(cid:17) ∈ (cid:8) ∀ Our second main result is a necessary and sufficient condition for the validity of a series of equality-type subdifferential chain rules for the empirical loss of this shallow ReLU network. We show that, under this regularity condition, exact chain rules hold for three commonly used generalized subdifferentials, i.e., Clarke (see Definition 2 and Theorem 14), limiting (see Definition 4 and Theorem 16), and Fr ́echet (see Definition 3 It is notable that while sufficient conditions for the equality-type and Theorem 17). calculus rules are rather rich in the literature (see (Rockafellar and Wets, 2009, Chapter 10)), a necessary condition is rarely seen, let alone an efficiently computable, necessary and sufficient condition in our Theorem 14. ⊆ Robust algorithms. Our third main result is an algorithmic scheme to test the so-called near-approximate stationarity (see Definition 25) in terms of both Clarke and Fr ́echet subdifferentials. We show that, for an approximate stationary point x∗, any point that is sufficiently close to x∗ can be certified (with Algorithm 4) as near-approximate station- ary. Our technique is a new rounding scheme (see Algorithm 3) motivated by the notion of active manifold identification (Lewis, 2002; Lemar ́echal et al., 2000) in the literature. This new rounding scheme is capable of identifying the activation pattern of the target stationary point and finding a nearby point with the same pattern. One notable applica- tion of such a near-approximate stationarity test is to obtain a termination criterion for algorithms that only have asymptotic convergence results. For example, every limiting point of the sequence generated by the stochastic subgradient method has been shown to be Clarke stationary (see Definition 6) by Davis et al. (2020, Corollary 5.11), but it is still unclear when to terminate the algorithm, and how to certify the obtained point is at least close to some Clarke stationary point, as the norm of any vector in the subdifferential is almost surely lower bounded away from zero during the entire trajectory (consider running the subgradient method on x x ). | 7→ | x Notation. Scalars, vectors and matrices are denoted by lowercase letters, boldface lower case letters, and boldface uppercase letters, respectively. The notation used in this paper ε(x) to emphasize the is mostly standard: Bε(x) := dimension); dist(x, S) := inf v if ; Conv(S) denotes the convex hull of the set S; the vector ei denotes the the set S = ∅ R : x > 0 i-th column of identity matrix I; R+ := ; πi denotes the project to the x } { n n := Si for sets i=1; the extended-real R is Si} j=1 Sj i-th argument operator; i.e., πi { defined as R ; the addition of two sets is always understood in the sense of ∞} Minkowski; Z := Z , ∪ {−∞ k for a closed set S, which is defined as + (cid:17) 1, . . . , m { for any integer m > 1. v : v { k v S k ∈ (we may write Bd (cid:16)Q ; [m] := 6 ε } ∪ {−∞ ∞} − x , + ∞ − ∈ k } 4 Organization. We introduce the background on generalized differentiation theory and formal definitions of stationarity concepts in Section 2. Then, in Section 3, we present our main hardness results. The necessary and sufficient condition of the validity of chain rule in terms of various subdifferential constructions is presented in Section 4. We discuss the robust algorithms to test near-approximate stationarity concepts in Section 5. All proofs are deferred to the Appendices. 2 Preliminaries The following construction of subdifferential by Clarke (1990, Theorem 2.5.1) is classic. Definition 2 (Clarke subdifferential). Given a point x, the Clarke subdifferential of a locally Lipschitz function f at x is defined by ∂Cf (x) := Conv s : x′ ∃ → x, ∇ f (x′) exists, f (x′) s . → ∇ For a locally Lipschitz function, the Clarke subdifferential is always nonempty, convex, and compact (Clarke, 1990, Proposition 2.1.2(a)). The following set generated by a di- rectional derivative f ′ is known as the Fr ́echet subdifferential of f (Rockafellar and Wets, 2009, Exercise 8.4). (cid:9) (cid:8) Definition 3 (Fr ́echet subdifferential). Given a point x, the Fr ́echet subdifferential of a locally Lipschitz and directional differentiable function f at x is defined by ∂f (x) := s : s⊤d 6 f ′(x; d) for all d . (cid:8) (cid:9) b The set-valued mapping ∂f of Fr ́echet subdifferential of f is not outer semicontinuous (see (Rockafellar and Wets, 2009, Definition 5.4)), which means that given xν → g x, gν → ∂f (x). The following limiting subdifferential (or with gν ∈ ∈ the Mordukhovich subdifferential) (Rockafellar and Wets, 2009, Definition 8.3(b)) is more robust for analysis. ∂f (xν), we cannot assert g b b b Definition 4 (Limiting subdifferential). Given a point x, the limiting subdifferential of a locally Lipschitz and directional differentiable function f at x is defined by ∂f (x) := lim sup x x′ → ∂f (x′), where the outer limit is taken in the sense of Kuratowski (see, e.g., (Rockafellar and Wets, 2009, p152, Equation 5(1))). b In the following result, we record a generalized Fermat's rule for optimality conditions and the relationship among the aforementioned three subdifferentials. Fact 5 (Rockafellar and Wets (2009, Theorem 8.6, 8.49, 10.1)). Given a locally Lipschitz function f : Rd ∂Cf (x). If the point x is a local minimizer of the function f , then it holds that 0 Rd, then we have R and a point x ⊆ ∂f (x). ∂f (x) ∂f (x) → ⊆ ∈ We are now ready to state the definitions of various stationarity concepts. b ∈ b Definition 6 (Stationarity concepts). Given a locally Lipschitz function f : Rd say that the point x Rd is an ∈ R, we → 5 • ε-Clarke stationary point if dist 0, ∂C f (x) 6 ε; (cid:0) • ε-Fr ́echet stationary point if dist 0, ∂f (x) (cid:1) 6 ε; • ε-limiting stationary point if dist (cid:0) 0, ∂f (x) (cid:1) b 6 ε. The following Clarke regularity for locally Lipschitz and directional differentiable func- tions is a classic notion related to the validity of various subdifferential calculus rules; see (Clarke, 1990, Definition 2.3.4) and (Rockafellar and Wets, 2009, Corollary 8.11). (cid:0) (cid:1) Definition 7 (Clarke regularity). For a locally Lipschitz directional differentiable function f : Rd R and a point x, one has f is Clarke regular at x if ∂C f (x) = ∂f (x). → We record some basic equality-type calculus rules for Clarke subdifferential as follows; see (Clarke, 1990, Proposition 2.3.3, Theorem 2.3.10), and (Rockafellar, 1985, Proposition 2.5). We refer the reader to (Rockafellar and Wets, 2009, Chapter 10) for similar calculus rules for Fr ́echet and limiting subdifferentials. b Fact 8 (Calculus rules). Let f : Rd R, g : Rd R be two locally Lipschitz functions. → → • If f is strictly differentiable at x, then ∂C (f + g)(x) = f (x) + ∂C g(x); ∇ • If h(x, y) = f (x) + g(y), then ∂Ch(x, y) = ∂Cf (x) ∂C g(y); • Given a strictly differentiable mapping G : Rn function f (or regular at y and ∂C [f mapping G. The equality also holds when JG is surjective. f ) is Clarke regular at G(y), then f Rn, if the ∈ G) is Clarke G](y) = (JG(y))⊤∂Cf (G(y)), where JG is the Jacobian of → − − ◦ ◦ ◦ f × Rd and a point y G (or | * | ∂C[ ](0)) = [ Remark 9. The sum rule is a special case of the chain rule, which does not hold for ](0) + Lipschitz functions trivially. For example, consider ∂C [ 2, 2]. The empirical loss of a ReLU network is in general not Clarke ( − − . It is easy to verify neither f nor y, 0 regular. To see this, let f (x, y) = max } { f is Clarke regular. Another remark here is on the notion of partial subdifferentiation; − see (Rockafellar and Wets, 2009, Corollary 10.11) and (Clarke, 1990, p48). In general, we cannot say much about the relationship between ∂f (x, y) and ∂xf (x, y) ∂yf (x, y) (see (Clarke, 1990, Example 2.5.2)), except the following inclusion (Clarke, 1990, Proposition 2.3.16): ∂xf (x, y) ∂yf (x, y) π2∂f (x, y). π1∂f (x, y) | * | − | * | x, 0 { ( ∂C [ ](0) = 0 } { max } − | * | × × ⊆ × 3 Hardness of Stationarity Testing For smooth nonconvex programming, co-NP-hardness has been shown for local optimality testing (Murty and Kabadi, 1987, Theorem 2) and second-order sufficient condition testing (Murty and Kabadi, 1987, Theorem 4). However, in the nonsmooth case, we show that checking a first-order necessary condition approximately in terms of certain subdifferential is already co-NP-hard. Theorem 10 (Testing of piecewise linear functions). Given a 3√d-Lipschitz piecewise R in the form of max–min representation1 with integer data. For linear function f : Rd 6 1/√η (d, + any η is co-NP-hard, and checking whether 0 Zd satisfying dist ∂f (0) is strongly co-NP-hard. Z, checking whether the point 0 ∂f (0) → ∞ 0, ∩ ∈ ∈ ] 1Any piecewise linear function f : Rd → R can be written using a max-min representation as f (x) = j x + bj , where Mi ⊆ [m] is a finite index set; see (Scholtes, 2012, Proposition 2.2.2). b max16i6l minj∈Mi a⊤ The input data are d ∈ N, m ∈ N, l ∈ N, {(aj, bj)}m j=1, and {Mi}l i=1. (cid:0) b (cid:1) ∈ 6 ∈ ∈ → We compare Theorem 10 with the classic hardness result of Murty and Kabadi (1987). In (Murty and Kabadi, 1987), checking the local optimality of a simply constrained indefi- nite quadratic problem (Murty and Kabadi, 1987, Problem 1) and of an unconstraint quar- tic polynomial objective (Murty and Kabadi, 1987, Problem 11) are both co-NP-complete. However, these hardness results are inapplicable for checking first-order necessary condi- tions. In fact, for any hard construction f : Rn R in (Murty and Kabadi, 1987) and a Qn, testing 0 ∂f (x) can be done in polynomial time with respect to given point x the input size. In Theorem 10, we show that for a class of simple unconstrained piecewise differentiable functions, even an approximate test of the first-order necessary condition 0 ∂f (x) for a certain point x is already computationally intractable. Nonsmooth functions in real-world applications usually contain structures that can be b exploited in theoretical analysis and algorithmic design. A subclass of piecewise differen- tiable functions, termed C d abs or functions representable in abs-normal form, and defined as the composition of smooth functions and the absolute value function, is introduced by Griewank (2013); see Appendix A for a brief introduction and (Griewank and Walther, 2019, Definition 2.1) for details. An important corollary of our hard construction concerns the complexity of checking an optimality condition for functions in C d abs. The following result gives an affirmative answer to a conjecture of Griewank and Walther (2019, p284): ∈ b Corollary 11 (Testing of abs-normal form). Testing first order minimality (FOM) for a piecewise differentiable function given in the abs-normal form is co-NP-complete. Now, we report another notable corollary about the complexity of testing a certain stationarity concept for the empirical loss of a modern convolutional neural network. ] ∈ ∩ ∞ → (m, + Corollary 12 (Testing of loss of nonsmooth networks). Let f : Rd R be the empirical loss function of a shallow neural network with ReLU activation function, max-pooling operator, and convolution operator. Suppose the width of the first layer is m. Then, for 6 1/√η for a any η ∈ certain θ Z, testing the 1/√η-Fr ́echet stationarity dist Qd is co-NP-hard, and testing 0 ∈ Corollary 12 shows a computational tractability separation for the stationarity test between smooth and nonsmooth networks. In the smooth setting, given the gradient of every component function, we can compute the gradient norm of the loss function by iteratively applying chain rule. But in the nonsmooth case, while the subdifferential of every elemental function can be computed easily, the validity of the subdifferential chain rule like those in Fact 8 is not justified, which turns out to cause a serious computational hurdle in stationarity test (strong co-NP-hardness). ∂f (θ) for θ is strongly co-NP-hard. (cid:0) ∂f (θ) 0, b b (cid:1) 4 Regularity Conditions In this section, we study the regularity conditions for the validity of the equality-type chain rule in terms of Clarke, Fr ́echet, and limiting subdifferentials of the empirical loss of two-layer ReLU networks. 4.1 Setup For simplicity of reference, we introduce the following notation, which will be used in various subdifferential constructions of the empirical loss L. 7 Definition 13. Let the parameters hands: H (uk, wk) k=1 be given. We define the following short- } { (a) We write constants ρi := l′i (b) For any k [H] and wk ∈ ∈ H k=1 uk * max w⊤k xi, 0 for any i [N ]. ∈ (cid:16)P Rd, we define the following two indices sets: (cid:9)(cid:17) (cid:8) + k (wk) := −k (wk) := I I i : w⊤k xi = 0, uk * n i : w⊤k xi = 0, uk * n ρi > 0, i ρi < 0, i ∈ ∈ [N ] o [N ] , . o We may write + k and I I −k when the reference point wk is clear from the context. (c) For any k [H], we define the following nonempty convex compact set GC Rd related to the Clarke subdifferential: ∈ k ⊆ GC k := ( [N ] Xi I \ ∈ + k ∪I − k ) ukρi * 1w⊤ k xi>0 * xi + ukρj * xj * [0, 1]. + Xj k ∪I ∈I − k (d) For any k [H], we define the following nonempty compact set GL Rd related to k ⊆ the limiting subdifferential: ∈ GL k := ( [N ] Xi I \ ∈ + k ∪I − k ) ukρi * 1w⊤ k xi>0 * xi + + k Xj ∈I ukρixj * [0, 1] +   − k Xj ∈I ukρi * 1d⊤xj >0 * xj : d ∃ ∈ (e) For any k [H], we define the following convex compact set GF  ∈ Fr ́echet subdifferential: − Rd, min t k (cid:12) ∈I (cid:12) (cid:12) x⊤t d (cid:12) (cid:12) (cid:12) . > 0   Rd related to the k ⊆ GF k := ( [N ] Xi I \ ∈ + k ∪I − k ) ukρi * 1w⊤ k xi>0 * xi + ukρjxj * [0, 1] + if ∅ 0 if (cid:26) + k Xj ∈I > 0, = 0. −k −k I I (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (f) If an equation holds for all the three subdifferentials, i.e., Clarke/limiting/Fr ́echet ∂f ), we will write the equation simply with ∂⊳f and also k holds , then we k ). For example, if the equation ∂⊳fk(wk) = G⊳ b k , ∂fk(wk) = GL ∂fk(wk) = GF k . subdifferentials (∂C f /∂f / k /GF k /GL G⊳ get ∂C fk(wk) = GC k (for GC k , and 4.2 Main Results b Theorem 14 (Clarke chain rule). Under Assumption 1, we claim that the exact Clarke subdifferential chain rule holds for L at a given point (u1, w1, . . . , uH, wH), that is H N ∂C L(u1, w1, . . . , uH, wH) = max w⊤k xi, 0 ρi * GC k , ) × Yk=1 ( Xi=1 n N i=1 satisfy the following Span Qualification (SQ): o if and only if the data points xi} { 8 span xi}i { (cid:16) + k ∈I ∩ (cid:17) span xj}j − k ∈I { (cid:16) (cid:17) = 0 . } { [16k6H (SQ) + Remark 15. Note that for any k k can be computed in O(N d). Then, checking SQ is no harder than checking the Linear Independence Constraint Qualification (LICQ) in nonlinear programming and can be done with, e.g., Zassenhaus algorithm. [H], the indices sets −k and ∈ I I Theorem 16 (Limiting chain rule). Under Assumption 1, we claim that the exact limiting subdifferential chain rule holds for L at a given point (u1, w1, . . . , uH, wH), that is H N ∂L(u1, w1, . . . , uH , wH) = ρi * max w⊤k xi, 0 n o GL k , ) × Yk=1 ( Xi=1 N i=1 satisfy SQ. xi} { if and only if the data points verse set inclusion For Fr ́echet subdifferential, the situation is different as the default chain rule is the re- k ; see i=1 ρi * (cid:9)o ∂L(u1, w1, . . . , uH, wH ) = (Rockafellar and Wets, 2009, Corollary 10.9, Theorem 10.49). If (cid:8) Q , we have the exact chain rule trivially, as GF k can only be the empty set. Therefore, the ∅ b interesting case is when the Fr ́echet subdifferential is nonempty. ∂L(u1, w1, . . . , uH , wH) w⊤k xi, 0 nP H k=1 max GF × ⊇ b N Theorem 17 (Fr ́echet chain rule). Under Assumption 1, for any given point such that , we have the following exact chain rule for = the subdifferential ∅ the empirical loss L b ∂L(u1, w1, . . . , uH , wH) H N ∂L(u1, w1, . . . , uH, wH ) = ρi * max w⊤k xi, 0 n o GF k , ) × Yk=1 ( Xi=1 N i=1 satisfy SQ. b if and only if the data points 4.3 Discussion xi} { There are several existing regularity conditions related to the validity of exact chain rule of the empirical loss. We briefly introduce them here and defer the details to the Definition 54 in Appendix C.5. Definition 18 (Regularities). We consider the following regularity conditions: • General position data: (Montufar et al., 2014, Section 2.2), (Yun et al., 2018, As- sumption 2), and (Bubeck et al., 2020); • Linear Independence Kink Qualification (LIKQ): (Griewank and Walther, 2019, Def- inition 2.6) and (Griewank and Walther, 2016, Definition 2); • Linearly Independent Activated Data (LIAD): Let the index set [H], the data points . For any fixed k 0 } ∈ xi}i { ∈Jk are linearly independent. Jk := j : w⊤k xj = { 9 6 → +max The general position assumption is from the study of hyperplane arrangement. If the data points are generated from an absolutely continuous probability measure (with respect to the Lebesgue measure), then they are in general position almost surely. The LIKQ is introduced by Griewank and Walther (2016, Definition 2) to ensure an efficient Fr ́echet stationarity test for piecewise differentiable function represented in abs-normal form. See Appendix A for a brief introduction. The LIAD condition is natural and equivalent to the subjectivity condition in Fact 8. Let us present the following result, in which we establish the relationship among SQ and the three other regularity conditions in Definition 18. Proposition 19 (Regularity comparison). For the empirical loss of a shallow ReLU net- work under Assumption 1, we have the following relationship: general position = ⇒ LIKQ ⇐⇒ LIAD = ⇒ SQ. We exhibit two examples to show the one-side arrows in Proposition 19 are strict. Example 20 (SQ ; LIAD). Let the function f : R4 R be given as +max f (x, y, z, b) := max 2y+b, 0 } { . z+b, 0 } Consider x = y = z = b = 0. It is easy to verify that SQ is satisfied but not LIAD. Besides, f is nonconvex, nonsmooth, and non-separable. Neither f nor f is Clarke regular. But by Theorem 14, the equality-type subdifferential sum rule still holds. 2x+2z+b, 0 } { x+y+z+b, 0 { x max { }− − − Example 21 (LIAD ; general position). Let the function f : R3 R be given as → f (x, y, b) := max {− 2y + b, 0 } Consider x = y = 1 and b = {− + max + max x + b, 0 { 1. LIAD is satisfied, but the data is not in general position. . y + b, 0 } { y + b, 0 } − Rd, if the features of data include a discrete-valued component, N i=1 are rarely in general position, as at least half max } − In practice, for data x ∈ , then the points 1, +1 } e.g., x1 ∈ {− of them must lie in the same affine hyperplane xi} { y : e⊤1 y = 1 } { k for general position data). Besides, if the data points are in general y : e⊤1 y = { . 1 } or − Remark 22 (GL position, we have the following compact representation for GL k GL k = ukρi * 1w⊤ k xi>0 * xi + ukρjxj * [0, 1] + ukρj′xj′ . 0, 1 } * { ( [N ] Xi I \ ∈ Xj ∈I The following corollary concerning the Clarke regularity of all local minimizers could + k ∪I − k ) Xj′ ∈I − k + k be of independent interest. Corollary 23. If at a point, SQ is satisfied and the empirical loss function L has nonempty Fr ́echet subdifferential here, then the function L is Clarke regular at that point. Conse- quently, with data in general position, L is Clarke regular at every local minimizer. 5 Testing of Stationarity Concepts To perform the stationarity test, we need the following quantitative regularities to char- acterize the curvature of the pieces in the empirical loss. Assumption 24. In this section, we further assume that for any i [N ], the norm of data xik2 6 R and the function li is Ll-Lipschitz continuous with an Ll′-Lipschitz continuous k gradient l′i ∈ 10 5.1 Exact Stationarity Test As an immediate illustration of the results in Section 4, we record the following exact test- ing schemes for Clarke and Fr ́echet stationary points. Compared with the developments in (Yun et al., 2018) which check the Fr ́echet stationarity from the primal perspective and use polyhedral geometry to avoid redundant computation, by using Theorem 17, our treatment for Fr ́echet stationarity is transparent and its correctness is self-evident. Algorithm 1 Exact Stationarity Test (Clarke) 1: procedure ETest-C(u1, w1, . . . , uH , wH, x1, . . . , xN ) 2: 3: + −k (wk) for any k k (wk), and compute if Span Qualification (SQ) is not satisfied then N i=1, I ∈ { ρi} { return not-SQ; I 1, . . . , H ; } end if for k ∈ { 1, . . . , H } compute ε1,k ← compute ε2,k ← do (cid:12) dist P (cid:12) (cid:12) end for return 10: 11: end procedure qP H (cid:1) k=1 (ε1,k)2 + (ε2,k)2; (cid:0) max N i=1 ρi * 0, GC k ; (cid:8) w⊤k xi, 0 ; (cid:9)(cid:12) (cid:12) (cid:12) ⊲ convex QP Clarke stationarity. Suppose that SQ is satisfied at the point (u1, w1, . . . , uH , wH). By Theorem 14, it is a Clarke stationarity point of L if and only if, for any k [H], ∈ (a) 0 = N i=1 ρi * max w⊤k xi, 0 ; (b) 0 P i ∈ [N ] ∈ ( I \ + k ∪I (cid:8) k ) ukρi * − (cid:9) 1w⊤ k xi>0 * xi + j ∈I + k ∪I − k ukρjxj * [0, 1]. P Condition (a) is a simple equality test and condition (b) can be checked by solving a linear programming problem. Algorithm 1 is for testing ε-Clarke stationary points. P Algorithm 2 Exact Stationarity Test (Fr ́echet) 1: procedure ETest-F(u1, w1, . . . , uH , wH, x1, . . . , xN ) 2: −k (wk), and compute if Span Qualification in (SQ) is not satisfied then + k (wk) for any k N i=1, I ∈ { ρi} { return not-SQ; I 1, . . . , H end if for k if 1, . . . , H do } ∈ { then −k (wk) = ∅ I return + ; ∞ end if compute ε1,k = (cid:12) compute ε2,k = dist P (cid:12) (cid:12) max N i=1 ρi * 0, GF k ; (cid:8) 12: end for return 13: 14: end procedure qP H (cid:0) (cid:1) k=1 (ε1,k)2 + (ε2,k)2; w⊤k xi, 0 ; (cid:9)(cid:12) (cid:12) (cid:12) 11 ; } ⊲ convex QP 4: 5: 6: 7: 8: 9: 3: 4: 5: 6: 7: 8: 9: 10: 11: 6 Fr ́echet stationarity. Suppose that SQ is satisfied at the point (u1, w1, . . . , uH , wH). By Theorem 17, it is a Fr ́echet stationarity point of L if and only if, for any k [H], ∈ (a) 0 = N i=1 ρi * P ; −k = ∅ (b) I (c) 0 max w⊤k xi, 0 ; (cid:8) (cid:9) i [N ] ∈ ( I \ + k ∪I − k ) ukρi * 1w⊤ k xi>0 * xi + + k j ∈I ukρjxj * [0, 1]. ∈ Similarly, all above conditions can be checked in polynomial time with Algorithm 2. P P 5.2 Robust Stationarity Test In this subsection, we introduce our main algorithmic results. First, we formally define the notion of stationarities that we are aiming to check; see (Davis and Drusvyatskiy, 2019; Kornowski and Shamir, 2022a; Tian et al., 2022) for results on finding near-approximately stationary points for Lipschitz functions. Definition 25 (Near-Approximate Stationarity, NAS). Given a locally Lipschitz function f : Rd R, we say that the point x Rd is an → • (ε, δ)-Clarke NAS point, if dist 0, (cid:16) • (ε, δ)-Fr ́echet NAS point, if dist 0, ∈ (cid:16) ∪y Bδ (x)∂Cf (y) ∈ (cid:17) ∪y Bδ (x) ∈ ∂f (y) 6 ε; 6 ε. (cid:17) b ∈ ∈ We consider a constructive approach, that is, we certify the (ε, δ)-Clarke NAS of a Bδ(x) satisfying dist(0, ∂C f (y)) 6 ε. point x for the function f only if we find a point y Bδ(x) passes the exact stationarity test, say, with Note that, in any time, if a point y Algorithm 1, then x must be an (ε, δ)-Clarke NAS point. In other words, there is no false positive in the test. The question is that, if x is sufficiently closed to a Clarke stationary point, can we always find a point y near x such that y is ε-Clarke stationary? That is to say, we need to control the false negative of our robust test. Without exploiting structures in the objective function, finding such a point is impossible in general (Tian and So, 2022, Theorem 2.7). Our technique is a new rounding scheme (see Algorithm 3), which is motivated by the notion of active manifold identification (Lewis, 2002; Lemar ́echal et al., 2000) in the literature. This new rounding scheme is capable to identify the activation pattern of the target stationary point that x is sufficiently close to. Now, suppose that f is L-smooth and a point x∗ satisfies f (x∗) k knowing the concrete structure of f , what we can say for any point y ∈ 6 ε. Without Bδ(x∗) is that δ, which is the best result we can hope for our test, as we do not assume k∇ any concrete structure in the loss li except their smoothness. Such an estimation cannot hold trivially for a nonsmooth function. Consider f (x) = and x∗ = 0. For any δ > 0 and 0 f (y) k Bδ(x∗), we have 6 ε + L = 1. = y x | k∇ * | ∈ f ′(y) | | 5.2.1 Testing Clarke NAS We define two constants that will be used in the analysis. Definition 26 (Clarke). Given a point (u∗1, w∗1, . . . , u∗H , w∗H) with a Euclidean norm B [0, + around this point: ∈ ), we define the following constants about the separation and curvature of pieces ∞ 12 6 Algorithm 3 Neural Rounding (Clarke) 1: procedure Rnd-C(u1, w1, . . . , uH , wH, δ, x1, . . . , xN ) 2: compute R = max16i6N k for k 1, . . . , H do xik ; ∈ { compute } wk by solving the following convex QP 3: 4: wk = argmin b z b 2 wkk z Rd k − ∈ s.t. z⊤xi > 2R z⊤xi 6 * 2R − z⊤xi = 0, δ, δ, * i i i ∀ ∀ ∀ ∈ ∈ ∈ 5: end for return (u1, 6: 7: end procedure b w1, . . . , uH, wH ); b [N ] : x⊤i wk > R [N ] : x⊤i wk < * R δ, − 6 R δ, δ. * * [N ] : x⊤i wk (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Algorithm 4 Robust Stationarity Test (General) 1: procedure RTest(ETest, Rnd, u1, w1, . . . , uH, wH , δ, x1, . . . , xN ) 2: wH) = Rnd(u1, w1, . . . , uH , wH, δ, x1, . . . , xN ); uH , > δ then w1, . . . , ( u1, if u1, ( wH) k 3: 4: 5: w1, . . . , uH , (u1, w1, . . . , uH , wH) k return + b b b ∞ end if return ETest( b u1, ; w1, . . . , − 6: 7: end procedure b uH, b b wH, x1, . . . , xN ); b b b b b • Separation: C Clarke τ := 1 4R * min x⊤i w∗k : i [N ], k [H], x⊤i w∗k 6 ∈ = 0 ; ∈ • Curvature: C Clarke μ (cid:8)(cid:12) := poly(B, R, Ll, Ll′, N, H).2 (cid:12) (cid:12) (cid:12) (cid:9) [N ] and k Remark 27. If for any i aration constant C Clarke inf when running the testing algorithm, the curvature constant C Clarke when the candidate network and the radius δ are given. [H], it holds x⊤i w∗k = 0, then we define the sep- , as in the optimization of extended-real-valued functions, is usually unknown can be easily estimated . It is notable that, while the separation constant C Clarke ∈ := + = + ∞ ∞ ∈ ∅ μ τ τ Theorem 28 (Robust Clarke test). Let an ε-Clarke stationary point (u∗1, w∗1, . . . , u∗H, w∗H ) satisfying SQ be given. For any 0 < δ 6 C Clarke and any τ (u1, w1, . . . , uH, wH ) ∈ Bδ (u∗1, w∗1, . . . , u∗H, w∗H ) , if the output point ( u1, w1, . . . , uH , wH) of Algorithm 3 satisfies SQ, then we have (cid:0) dist b 0, ∂C L( u1, b b (cid:16) w1, . . . , b uH, wH) 6 ε + C Clarke μ (cid:17) In Theorem 28, we show that for a point that is sufficiently closed to an ε-Clarke b stationary one, and a properly chosen parameter δ > 0, one can correctly certify the near-approximate stationarity of this point in the style as if the function L is smooth by b b b (cid:1) δ. * 2See Appendix D.1 for the exact value. 13 calling Algorithm 4 with RTest(ETest-C, Rnd-C, to choose a proper parameter δ, as the separation constant C Clarke turns out that a simple line search will work for that. * * * τ ). A natural question here is how is usually unknown. It Remark 29 (Line search). Set the initial value of radius δ to, say, δ0 = 1. Then, in the t-th iteration, run Algorithm 4 with parameter δt and set δt+1 = δt/2. Note that for a sufficiently small δ, the rounding scheme in Algorithm 3 becomes superfluous, as for δ for a small δ. any i Therefore, we can stop the line search within at most [H] such that x⊤i wk 6 = 0, we have x⊤i wk| | [N ] and k > 2R ∈ ∈ * log2 2R min x⊤i wk : i [N ], k ∈ l (cid:16) . iterations. It is immediate that, if (u1, w1, . . . , uH , wH) then there exists a radius δt ∈ 0, ∂C L( n(cid:12) (cid:12) (cid:12) [C Clarke τ /2, C Clarke τ w1, . . . , wH) uH , dist u1, (cid:12) (cid:12) (cid:12) = 0 ∈ [H], x⊤i wk 6 BCClarke o(cid:17)m /2 ] in the iteration sequence such that (cid:0) ∈ τ (u∗1, w∗1, . . . , u∗H, w∗H ) , (cid:1) This search scheme also works for the Fr ́echet NAS test and we will not repeat that. b b b b (cid:16) 6 ε + C Clarke μ δt. * (cid:17) 5.2.2 Testing Fr ́echet NAS Algorithm 5 Neural Rounding (Fr ́echet) 1: procedure Rnd-F(w1, . . . , wH, δ, x1, . . . , xN ) 2: compute R = max16i6N k for k 1, . . . , H xik wk by solving the following QP ∈ { compute do } and Cu = Ll′(4HRB2 + 1); wk = argmin b z b 2 wkk z Rd k − ∈ s.t. z⊤xi > 2R z⊤xi 6 * 2R − z⊤xi = 0, δ, δ, * i i i ∀ ∀ ∀ ∈ ∈ ∈ uk = uk; set if mini:w⊤ set b end if uk = 0; k xi=0 uk * ρi 6 2Cu * δ then [N ] : x⊤i wk > R [N ] : x⊤i wk < * R δ, − 6 R δ, δ. * * [N ] : x⊤i wk (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 3: 4: 5: 6: 7: 8: 9: end for return ( b u1, 10: 11: end procedure b b w1, . . . , uH, wH ); b b Unlike the Clarke case, we need the following extra nondegeneracy condition on li to identify the pattern of u∗k}k and avoid the Fr ́echet subdifferential being empty. { Assumption 30. Given a point (u∗1, w∗1, . . . , u∗H, w∗H), we assume that for any i such that mink = 0, we have l′i (w∗k)⊤xi, 0 max = 0. H [N ] ∈ [H] | ∈ x⊤i w∗k| k=1 u∗k * (cid:8) The following two constants will be used in the analysis. (cid:9)(cid:17) (cid:16)P 14 6 (cid:1) δ. * Definition 31 (Fr ́echet). Given a point (u∗1, w∗1, . . . , u∗H , w∗H) with a Euclidean norm B [0, + ∞ this point: ∈ ), we define two constants concerning the separation and curvature of pieces around • Separation: C Fr ́echet τ := min mini ( [N ],k [H], ∈ ∈ i w∗ x⊤ =0 k6 x⊤ i w∗ k| 4R , min i | ∈ i w∗ x⊤ [N ],k ∈ k=0,u∗ k* [H], ρ∗ i >0 u∗ k* Ll′ (4HRB2+1) ρ∗ i ; ) • Curvature: C Fr ́echet μ := poly(B, R, Ll, Ll′, N, H).3 Then, for Fr ́echet NAS test, we have the following result similar to Theorem 28. Theorem 32 (Robust Fr ́echet test). Let an ε-Fr ́echet stationary point (u∗1, w∗1, . . . , u∗H, w∗H ) satisfying SQ be given. For any 0 < δ 6 C Fr ́echet and any τ (u1, w1, . . . , uH, wH ) ∈ Bδ (u∗1, w∗1, . . . , u∗H, w∗H ) , if the output point ( u1, w1, . . . , uH , wH) of Algorithm 5 satisfies SQ, then we have (cid:0) dist b 0, b (cid:16) ∂L( u1, b w1, . . . , b uH , wH) 6 ε + C Fr ́echet μ (cid:17) A Abs-Normal Form of Piecewise Differentiable Functions b b b b b We briefly review the abs-normal representation of a subclass of piecewise differentiable functions. See (Griewank, 2013; Griewank and Walther, 2016) for details. A.1 The General Framework The abs-normal representation (Griewank, 2013) is a piecewise linearization scheme con- cerning a certain subclass of piecewise differentiable functions in the sense of Scholtes (2012). In this subclass, functions are defined as compositions of smooth functions and = a the absolute value function. By identifies max | (a + b)/2 /2, composition with these nonsmooth = x/2 + x, 0 | } { elemental functions can also be represented in the abs-normal form. /2, and max | = (a + b)/2 + /2, min | a, b { x | a, b { − | − − a } } b b Let φ : Rd value functions in the evaluation order as "switching variables" zi for i y = φ(x) can be written in the following abs-normal form: function x R be a function in such subclass. By numbering all input to the absolute , the } 1, . . . , s ∈ { → 7→ z = F (x, p), y = f (x, p), Rd, p where x f : Rd zj only if j < i. In sum, we have ∈ Rs → R. As the numbering of × ∈ Rs +, the smooth mapping F : Rd Rs, and the smooth function zi}i is in the evaluation order, zi is a function of { + → Rs × y = φ(x) = f (x, z(x) ), | | where z(x) a successive evaluation of z(x) is well-defined, note that z1 = F1(x) and for any 1 < i 6 s, zi} { s i=1 with given x. To see such an evaluation of 3See Appendix D.2 for the exact value. zi = Fi(x, , z1| | * * * , zi | − ). 1| 15 We remark that, similar to the Difference of Convex (DC) decomposition in DC program- ming, the function φ may have many different abs-normal decomposition. The following vectors and matrices are useful when study the function in abs-normal form: a := b := ∂ ∂x ∂ ∂p f (x, p) f (x, p) Rd, Rs, ∈ ∈ Z := L := ∂ ∂x ∂ ∂p F (x, p) F (x, p) Rs d, × Rs s. × ∈ ∈ For any σ also (Griewank and Walther, 2016, Equation (11))) s, we will denote by Σ := Diag(σ) 1, 1 } ∈ {− s 1, 0, 1 } × ∈ {− s. Let us define (see which will play a key role in the definition of LIKQ (see Definition 54). zσ := (I LΣ)− 1Z Rs d, × ∈ − ∇ A.2 Abs-Normal Form of Shallow ReLU Networks We rewrite the empirical loss of the shallow ReLU network with absolute value functions as L(u1, w1, * * * , uH , wH) = li N H Xi=1 Xk=1 uk 2 * w⊤k xi + (cid:16) . ! (cid:17) w⊤k xi (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) Then, as there are N variable z * RN H and the smooth mapping F as H absolute value evaluations in total, we define the switching ∈ zN (k 1)+i = FN (k 1)+i(u1, w1, , uH, wH ) = w⊤k xi, ∀ The smooth function f in the abs-normal form can be written as * * * − − [H], i k ∈ ∈ [N ]. y = f (u1, w1, * * * N H , uH, wH , p) = li Xk=1 + . Consequently, the matrix L = 0, which implies the function L is where p "simply switched" in the sense of Griewank and Walther (2016). For the matrix Z and any k H(d+1) can be written as 1) + i)-th row of Z [N ], the (N (k RN H RN H [H], i Xi=1 ∈ (cid:17) × w⊤k xi + pN (k (cid:16) 1)+i − , ! uk 2 * ∈ ∈ ∈ − H 0 1k′=k * x⊤i ∈ × R1 × H(d+1). Yk′=1 B Proofs for Section 3 B.1 The Problems Problem 33 (3SAT). Given a collection of clauses ∈ m such that clause Ci(x) is limited to a disjunction of at most three literals for any 0, 1 { } 1 6 i 6 n. Let the following formula of C(x) in conjunctive normal form be given n i=1 on Boolean variables x Ci(x) } { n C(x) := Ci(x). ^i=1 Is there an x m satisfying C(x) = 1? 0, 1 } ∈ { 16 (PLT) (PLT) Problem 34 (Piecewise Linear Test, PLT). Suppose ε Zm be given. Let us define a function fPLT : Rm yi} { 3n i=1 ⊆ ∈ → √m ) and the input data [0, 1 R as fPLT(d) := max 16i6n − Is there a vector g ∈ Rm satisfying g k k fPLT(d) > Its complement is given by 3 max d⊤y3(i n Xj=1 6 ε and − 1)+j, 0 . o g, d , i h d ∀ ∈ Rm? ∈ Problem 35 (Neural Network Test, NNT). Suppose ε Y = g, d . i h [0, 1 3n be given. Let us define fNNT : R3n Rm : fPLT(d) < Bε(0), Zm ∈ ∈ d ∃ ∀ g y3n y1 × * * * ⊆ √m ]. Let the input data Rm × → R as (cid:2) (cid:3) fNNT(u, w) := max 16i6n 3 Xj=1 u3(i 1)+j * − max w⊤y3(i n − 1)+j , 0 . o Is ( − 13n, 0m) an ε-Fr ́echet stationary point of fNNT, i.e., dist 0, ∂fNNT( − 13n, 0m) 6 ε? Problem 36 (Abs-Normal Form Test, ANFT). Suppose a piecewise linear function is given in the abs-linear form with vectors and matrices a Rs respect to μσ ∈ ∈ s such that the following system with 1, 1 } s. Is there a definite signature vector σ Rs is incompatible Rs, Z ∈ {− Rs (cid:0) b Rn, b (cid:1) n, L ∈ ∈ ∈ × × a⊤ + (b − μσ)⊤ Diag(σ) − L 1Z = 0, − 0 6 μσ ∈ Rs? B.2 Hardness of Piecewise Linear Test (cid:0) (cid:1) Lemma 37. Problem 34 (PLT) is co-NP-hard. Proof. We have to show that PLT is an element of the complexity class NP-hard. 3SAT in Problem 33 is known to be strongly NP-complete (Garey and Johnson, 1979). We give a polynomial-time reduction from 3SAT to PLT. Given any instance of 3SAT, we get n m. We will refer literals in Ct(x) by their positions. For Ci(x) i=1 for x clauses 0, 1 } { } ∈ { xk, we say the literal xi occurs in Ct(x) at position 1, example, given Ct(x) = xi ∨ (¬xj) the literal ¬xj occurs in Ct(x) at position 2, and the literal xk occurs in Ct(x) at position 3. We construct the data Zm as follows ∨ 3n i=1 ⊆ yi} { if Boolean xk occurs in C (i ⌊ if Boolean ¬xk occurs in C ek ek yi = (cid:26) − − Note the following positive 1-homogeneous function in the construction of PLT − − +1(x) at position i 1)/3 − ⌋ +1(x) at position i 1)/3 ⌋ − (i ⌊ (i 3 − ⌊ (i 3 ⌊ 1)/3 ⌋ 1)/3 ⌋ . 3 fPLT(d) = max 16i6n − max d⊤y3(i Xj=1 n − 1)+j , 0 . o 17 Suppose that for any 0 6 We will exhibit an x exists d g, d . i h m such that the given 3SAT is satisfied. Let g = 0 and there 0, 1 } Rm such that fPLT(d) < 0. For any i Rm such that fPLT(d) < 6 ε, there exists d [m], let g k ∈ { ∈ k ∈ ∈ 1 if di > 0 0 if di 6 0 . xi = (cid:26) We show C(x) = 1. By fPLT(d) < 0, we get for any i [n] ∈ 3 max d⊤y3(i 1)+j , 0 > 0, − Xj=1 o n 1, 2, 3 which implies that there exists a j′ ∈ { 1)+j′ > 0. Let the index of } the Boolean literal occurs in Ci(x) at position j′ be k. Now we consider two cases. If xk occurs in Ci(x) at position j′, then y3(i 1)+j′ = d⊤ek = dk > 0. So, by definition, xk = 1 which implies Ci(x) = 1. Otherwise, if ¬xk occurs in Ci(x) at position j′, then y3(i d⊤ek = dk > 0. So ¬xk = 1 − n by definition, which implies Ci(x) = 1. This shows that C(x) = i=1 Ci(x) = 1 and the given 3SAT is satisfied. 1)+j′ = ek. We get d⊤y3(i ek. We get d⊤y3(i such that d⊤y3(i 1)+j′ = 1)+j′ = − − − − − − − Conversely, we show that if there exists a vector g such that 0 6 6 ε and infd fPLT(d) > g, d , then 3SAT cannot be satisfied. Suppose to the contrary that there h i m such that C(x) = 1. For any i exists x [m], let 0, 1 } g k ∈ { ∈ k V di = (cid:26) 1 if xi = 1 1 if xi = 0 − . n i=1 Ci(x) = 1, for any i [n], there exists a literal of clause Ci(x) that is satisfied. As Let the index of this literal be k′ and the position of it in Ci(x) be j′. We consider two 1)+j′ = ek′. As Ci(x) = 1 due cases. If literal xk′ occurs in Ci(x) at position j′, then y3(i to literal xk′, we get xk′ = 1 and dk′ = 1 by definition. Then, for such i [n], we get V ∈ − ∈ 3 max d⊤y3(i − 1)+j , 0 > max d⊤y3(i 1)+j′, 0 = max − dk′, 0 } { = 1. Xj=1 n o Otherwise, if literal ¬xk′ occurs in Ci(x) at position j′, then y3(i Ci(x) = 1 due to literal ¬xk′, we get xk′ = 0 and dk′ = i [n], we get − n o ek′. As 1)+j′ = 1 by definition. Then, for any − − ∈ 3 max d⊤y3(i Xj=1 n − 1)+j, 0 > max d⊤y3(i o n − 1)+j′, 0 = max o dk′, 0 } {− = 1. This gives 6 fPLT(d) 6 1 < ε √m 6 g − a contradiction. Hence Problem 34 is in the class co-NP-hard. k * k −k − * −|h g, d i h 6 d k g, d 6 g, d , i h i| While it is not clear whether the Problem 34 with a positive ε is an element of the complexity class co-NP, we show that, when ε = 0, Problem 34 is in co-NP. Lemma 38. If ε = 0, then Problem 34 is in the complexity class of co-NP. 18 ∀ d ∈ 1 and d⊤y3(i Rm. Given any d Rm checking Proof. For ε = 0, we only need to test fPLT(d) > 0, whether fPLT(d) < 0 can be done in O(mn log n) time. If the answer to Problem 34 is n such that yes, by homogeneity in fPLT, there exist a direction d and a vector s 1, 2, 3 } ∈ { [n]. There are only 3n elements in the > 1 for any i fPLT(d) 6 1)+si − n and all resulting ys1 y3n set 1, 2, 3 are integer matrix of polynomial } { length relative to the input size of Problem 34. So the certificate d can be obtained by Rm such that solving a linear program in polynomial time. Therefore, if there exists d ∈ Qm n and d′ ∈ fPLT(d) < 0, then a nondeterministic algorithm can find s 1, 2, 3 } satisfying fPLT(d′) 6 1 < 0 in polynomial time. Thus, Problem 34 with ε = 0 is an element of the complexity class co-NP. ∈ { 3+sn * * * − ∈ ∈ − − (cid:3) (cid:2) Proof of Theorem 10. We first note that Problem 34 can be written in the standard max- min form in polynomial time by the following elementary identify: 3 − Xi=1 max ti, 0 } { = min 3 ( Xi=1 si * ti : sk ∈ {− , 1, 0 } ∀ k ∈ { 1, 2, 3 . }) Besides, it holds fPLT(d) = fPLT(0) + f ′PLT(0; d) = f ′PLT(0; d). By Definition 3, we know 6 ε and 0, dist Rm, which is the definition of Problem 34. Note that if ε = 0, in fPLT(d) > (cid:0) the reduction from 3SAT in the proof of Lemma 37, all numerical parameters are bounded by a polynomial of the input size. The proof completes by Lemma 37. 6 ε if and only if there exists a vector g d ∂fPLT(0) g, d , (cid:1) i h Rm satisfying 0 6 g k ∈ ∈ ∀ b k B.3 Hardness of Abs-Normal Form Test Proof of Corollary 11. We first show that PLT in Problem 34 can be written in the abs- normal form in polynomial time. For ease of notation, let qi(d) := for any i [n]. Then, we can rewrite every qi in the abs-linear form as 3 j=1 max d⊤y3(i − − 1)+j, 0 ∈ zi(d) = y⊤i d, qi(d, p) = 1 2 − 3 Xj=1 d⊤y3(i 1)+j − − 1 2 3 Xj=1 Note that the function fPLT can be expressed as (cid:8) P i ∀ [n]. ∈ (cid:9) p3(i − 1)+j, [n]. i ∀ ∈ y := fPLT(d) = max 16i6n qi(d, z | ) = max | . . . , max { q1(d, { z | ), q2(d, | z | , . . . , qn(d, ) } | z | , ) } | which can be written in abs-normal form as zi = Fi(q, z | ) = | 1 2i − 2 * q1 + qt + p3n+t − qi, 1 − ∀ 3n + 1 6 i 6 4n 1, − 1 i − t=2 X n Xt=2 (cid:0) (cid:0) qt + p3n+t (cid:1) . 1 (cid:1) − y = f (q, p) = 1 2n − 1 * q1 + In sum, we have zi =   1 3n 2i − 1 * − q1 +  3n i − − 1 Xt=2 1 3n − 2i t * − y⊤i w for 1 6 i 6 3n for 3n + 1 6 i 6 4n . 1 − qt + p3n+t − (cid:0) 19 1 (cid:1) Then, we know fPLT(d) = f (d, z(d) ) = | | 1 2n − 1 * n q1 + qt + Xt=2 (cid:0) z3n+t | − . 1(d) | (cid:1) Then, the matrices L, Z, a, b can be computed in polynomial time. We note that inf d fPLT(d) > 0 if and only if the function fPLT is first-order minimal in abs-normal form and this is shown in the discussion below (Griewank and Walther, 2019, Equation (2)) (see also (Griewank and Walther, 2016, p3)). Then, the answer of ANFT in Problem 36 for the abs-normal form of fPLT is No if and only if 0 is a Fr ́echet stationary point of fPLT. Then, by Lemma 37, ANFT in Problem 36 is NP-hard. To see ANFT is in 1Z NP, for any given σ 1Z can be done in polynomial time. Then, ANFT for a and the matrix given σ reduces to check the infeasibility of a linear system, which is in P. In sum, we have shown ANFT in Problem 36 is NP-complete, which implies a general test of FOM without kink qualification in (Griewank and Walther, 2019, Theorem 4.1) is co-NP-complete. s, the computation of the vector a⊤ + b⊤ 1, 1 } L ∈ {− Diag(σ) Diag(σ) − − L (cid:0) (cid:1) (cid:0) (cid:1) − − B.4 Hardness of Neural Network Test Lemma 39. Problem 35 (NNT) is co-NP-hard. If ε = 0, Problem 35 is co-NP-complete. Proof. We first prove that ( if there exists gw yi} { see (Cui and Pang, 2021, Definition 4.1.1), we get dist only if there exists (gu, gw) (03n+m) such that 13n, 0m) is an ε-Fr ́echet stationary point of fNNT if and only gw, d Rm fPLT(d) > with the same input data i h ∈ Zm. By (Rockafellar and Wets, 2009, Exercise 8.4) and fNNT is B-differentiable; 6 ε if and ε (0) such that inf d 3n i=1 ⊆ 13n, 0m) ∂fNNT( Bm 0, − − ∈ B3n+m ε ∈ f ′NNT( − 13n, 0m; du, dw) > du, gu h i + dw, gw h , i (cid:0) b ∀ du ∈ R3n, dw (cid:1) Rm. ∈ (♯) Using the chain rule of directional derivative for B-differentiable function (Cui and Pang, 2021, Proposition 4.1.2(a)), we have f ′NNT( 13n, 0m; du, dw) = max 16i6n − − 3 max y⊤3(i 1)+jdw, 0 o − = fPLT(dw). Xj=1 For any gu, gw, consider dw = 0 and du = gu. We get that Equation (♯) holds if and only gw, dw if gu = 03m and infdw , which completes the proof by the co-NP- i h hardness of Problem 34 in Lemma 37 and co-NP-completeness if ε = 0 in Lemma 38. Rm fPLT(dw) > ∈ n Proof of Corollary 12. Note that Problem 35 can be represented by the empirical loss of a convolutional neural network with N = 1 and architecture l1 max-pooling convu ◦ ReLU ◦ ◦ convw(Y ) , (cid:17) (cid:16) 3n. If ε = 0, in the reduction from 3SAT where l1(t) = t and Y = ⊆ to PLT, then to NNT, all numerical parameters are bounded by a polynomial of the input size. The proof completes by Lemma 39. y3n Zm * * * y1 × (cid:3) (cid:2) 20 C Proofs for Section 4 C.1 Proof Roadmap Recall the loss function L of shallow ReLU neural network: L(u1, w1, . . . , uH , wH) := li N H Xi=1 Xk=1 uk * max w⊤k xi, 0 . ! o n ∈ Set constants ρi := l′i (cid:16)P partially linearized loss function L defined by k=1 uk * w⊤k xi, 0 max (cid:8) (cid:9)(cid:17) H for any i [N ]. Let us first consider a L(u1, w1, . . . , uH , wH) := N H ρi * Xk=1 uk * Xi=1 H max w⊤k xi, 0 n N o ! By exploiting the smoothness of rem 46, we will show that = Lk(uk, wk) := uk * ρi * Xi=1 max w⊤k xi, 0 n o . ! N i=1 and a Lagrange scalarization technique in Theo- Xk=1 li} { ∂⊳L(u1, w1, . . . , uH, wH ) = ∂⊳L(u1, w1, . . . , uH, wH ). (uk, wk) Then, we focus on the linearized L. By separation of { Lagrange scalarization technique in form of Corollary 48, we have }k and using again the ∂⊳L(u1, w1, . . . , uH, wH ) (a) = (b) = H ∂⊳Lk(uk, wk) Yk=1 H N Yk=1 ( Xi=1 ρi * max w⊤k xi, 0 n o ) × ∂⊳ Lk(uk, h (wk), ) * i where (a) is due to (Rockafellar, 1985, Proposition 2.5) and (Rockafellar and Wets, 2009, Proposition 10.5); (b) is by Corollary 48. Therefore, it holds ∂⊳L(u1, w1, . . . , uH , wH) = H N Yk=1 ( Xi=1 ρi * max w⊤k xi, 0 n o ) × ∂⊳ Lk(uk, h (wk), ) * i which implies that the validity of exact chain rule of L rely on a careful study of Lk(uk, In particular, if we have the exact chain rule for any k [H] as follows ). * (1) then we get the validity of exact chain rule for L. That is ∂⊳L(u1, w1, . . . , uH, wH ) = ∈ (wk) = G⊳ k, ∂⊳ Lk(uk, h ) * i H N Yk=1 ( Xi=1 ρi * max w⊤k xi, 0 n o G⊳ k. ) × 21 To prove Equation (1), we need a fine-grained analysis of Lk(uk, nonsmooth part out by rewritting ). First, we isolate the * Lk(uk, ) * i h (wk) = ( [N ] Xi I \ ∈ + k ∪I − k ) ukρi * max w⊤k xi, 0 + fk(wk), n o where we define fk(wk) := ukρi * + k Xi ∈I max w⊤k xi, 0 n o ukρj) ( − * max w⊤k xj, 0 . n o − − k Xj ∈I What remaining is to study the subdifferential of this non-separable piecewise linear func- tion fk for any k [H] and figure out conditions, under which ∈ ∂⊳fk(wk) = G⊳ k := G⊳ k − This will be done in Appendix C.4. e C.2 Technical Lemmas ukρi * 1w⊤ k xi>0 * xi. ( [N ] Xi I \ ∈ + k ∪I − k ) Lemma 40 (Gordan, cf. (Bertsimas and Tsitsiklis, 1997, Exercise 4.26)). Let A be given. Then, exactly one of the following statements is true: ∈ Rn × m • There exists an x Rm such that Ax < 0. ∈ Rn such that A⊤y = 0 with y > 0, y = 0. • There exists a y ∈ Lemma 41. Let A, B, C be sets in Rn. Suppose further that A is convex and closed, and C is nonempty and bounded. If the strict inclusion A ( B holds, then we can assert A + C ( B + C. Proof. Let xb ∈ x′ak xb − k B . Choose x′a ∈ ∅ . As A is closed, the following xa is well-defined A. The claim is trivial when A = \ A and set δ := xa := argmin a a A k ∈ xbk − = argmin A a Bδ(xb) k ∩ ∈ a xbk . − xa. As xb / ∈ Let d := xb − condition and convexity of A, we know d, xai , h a h A. As C is bounded, we know d A and A is closed, we know k k a A, which implies ∈ c d < + k xa, d − i 6 c, d i h > 0. By the optimality 6 d, a h C. Let xc be ∀ k * k ∞ ∈ ∈ a ∀ ∀ i , xc ∈ ε–argmax C c ∈ 2. We claim xb + xc / d ∈ k k where 0 < ε < A, yc ∈ ya ∈ C such that ya + yc = xb + xc. However, we compute A + C. Suppose not. Therefore, there exist 6 0, c k c, d , i h d, xb + xci h = > > d, d + xai d, xci + h h 2 + d d, yci − d, yai + k k h h d, ya + yci , h ε which gives the contradiction. 22 6 Remark 42. Though the claim seems straightforward, Lemma 41 is indeed non-trivial. We record the following counterexamples when different conditions are removed. • C is empty: A + C = B + C = . ∅ • C is unbounded: if C = Rn and A, B are nonempty, then A + C = B + C = Rn. • A is nonconvex: if A = B B1/4, B = B, C = B, then A + C = B + C = B2. \ • A is not closed: if A = B◦, B = B, C = B◦, then A + C = B + C = B◦2. n i=1 be linearly independent. Define a convex set C = n i=1 pi * [0, 1]. Lemma 43. Let pi} { n, the point p = For any s 0, 1 } Proof. Suppose not and p = 1 and p pi ∈ i=1 βi * definition. Thus, it holds = x2 = ∈ { n n i=1 si * 2 x1 + 1 2 x2 = P C. We know αi ∈ P n P pi is an extreme point of C. i=1 si * pi with p [0, 1] and βi ∈ = x1 = P n pi ∈ C i=1 αi * [n] by [0, 1] for any i ∈ P n Xi=1 pi = si * n Xi=1 (cid:18) αi + βi 2 pi. * (cid:19) n i=1 are linearly independent, we know that, for any i ∈ If si = 0, we have αi = βi = 0. Meanwhile, we know αi = βi = 1 if si = 1. pi} As { . 0, 1 { } Therefore, it holds x1 = x2 = p, a contradiction. [n], it holds si = ∈ (cid:17) (cid:16) αi+βi 2 Lemma 44. Let a function g : Rd [m] such that w⊤yj = 0 and yj 6 j ∈ R be w → 7→ − = 0, then we have m j=1 max ∂g(w) = P y⊤j w, 0 . If there exists } { . ∅ Proof. Suppose not and let u ∂g(w). We write ∈ g(w) = b w⊤yj, 0 } { max + g0(w), b − Xj:w⊤yj k:w⊤yk=0 max =0 w⊤yk, 0 . Then, by (Rockafellar and Wets, } { where we define g0(w) := 2009, Exercise 8.8(c)), we have P ∂g(w) = − b Let u′ = u+ 2009, Exercise 8.4), for any d P =0 1w⊤yj >0* ∈ j:w⊤yj 1w⊤yj >0 * yj + ∂g0(w). − =0 Xj:w⊤yj yj and we know u′ ∈ Rd, it holds b ∂g0(w). By (Rockafellar and Wets, u′⊤d 6 g′0(w; d) = − Xk:w⊤yk=0 b 1d⊤yk>0 * d⊤yk 6 0. 2 6 g′0(w; u′) 6 0. Thus, u′ = 0. Let d be any yj such that Let d = u′ and we know w⊤yj = 0 and yj 6 u′k k = 0. Then, we have a contradiction. 0 = u′⊤yj 6 g′0(w; yj) 6 yjk −k 2 < 0, Definition 45 (Bouligand subdifferential, c.f. (Cui and Pang, 2021, Definition 4.3.1)). Given a point x, the Bouligand subdifferential of a locally Lipschitz function f at x is defined by ∂Bf (x) := g : xν} → ∃{ x and {∇ f (xν) } → g s.t. ∇ f (xν) exists for any ν . (cid:8) 23 (cid:9) 6 6 6 6 6 C.3 Partial Linearization via Lagrange Scalarization The following theorem is a powerful and general principle. Theorem 46 (Partial linearization). Let a point x be given in form of composition f (x) = h locally Lipschitz near G(x) and G : Rd G are directionally differentiable. Then, we have → Rd and a locally Lipschitz f : Rd R → R is ◦ Rn is locally Lipschitz near x. Suppose h and G(x), where the gradient of h : Rn → ∈ (cid:1) Proof. Let the partially linearized f at x be ̄f : Rd (cid:0) ∂⊳f (x) = ∂⊳ h G(x) ∇ h (cid:10) (x). ) , G( * (cid:11) i R defined as → , G(y) . ̄f (y) := h G(x) ∇ (cid:1) (cid:10) (cid:11) (cid:0) For the limiting subdifferential version, the claim directly follows from a margin func- tion chain rule (Mordukhovich and Shao, 1996, Theorem 6.5). The Clarke subdifferen- tial version directly follows from the relation between Clarke and limiting subdifferential (Rockafellar and Wets, 2009, Theorem 8.49) and (Mordukhovich and Shao, 1996, Theo- rem 6.5). However, as the proof of (Mordukhovich and Shao, 1996, Theorem 6.5) uses a perturbation argument to approximate ∂f with ε-Fr ́echet subdifferential, the machinery is somehow complicated. Here we give an elementary proof for the Clarke version from the primal perspective using tools from convex analysis. We show f ◦(x; v) = ̄f ◦(x; v) for Rd. Note that the Clarke generalized subderivative can be written as any v ∈ ∆tf (x′)(v) f ◦(x; v) = lim sup x′ x → 0 t ց = lim 0 ε ց x′ k sup x − 6ε k sup 0<t<ε ∆tf (x′)(v), where the difference quotient function ∆tf (x′) : Rd defined by → R of f at x′ and direction v is ∆tf (x′)(v) := f (x′ + tv) t − f (x′) . We assume h is Lh-smooth near g(x) and G is LG-Lipschitz near x. We will use the following estimation (see (Nesterov, 2003, Lemma 1.2.3)) if h is Lh-smooth at z Rn: ∈ Lh 2 k 2 6 h(z′) k To prove f ◦(x; v) > ̄f ◦(x; v), we compute as follows h(z) z′ ∇ − − − − z (cid:10) h(z), z′ z 6 − Lh 2 k z′ z 2. k − (cid:11) ∆tf (x′)(v) = h (cid:0) h G(x′) G(x′ + tv) t (cid:1) (cid:1) (cid:0) , G(x′ + tv) G(x′) − h ∇ G(x′) − − (cid:0) h G(x) (cid:1) , G(x′ + tv) (cid:10) ∇ G(x′) − (cid:11) − > > 1 t 1 t Lh 2t LhL2 (cid:13) g (cid:13) 2 G(x′ + tv) G(x′) 2 − v 2 k k * t LhL2 v gk − (cid:13) (cid:13) k * k x x′ k − (cid:10) (cid:0) = ∆t ̄f (x′)(v) (cid:1) − LhL2 g 2 v k 2 k * t − (cid:11) LhL2 v gk x k * k x′ k − 24 Therefore, for any v Rd, we know f ◦(x; v) = lim 0 ց ε ∈ sup x − 6ε k x′ k sup 0<t<ε sup 0<t<ε sup 0<t<ε ∆tf (x′)(v), ∆t ̄f (x′)(v) ∆t ̄f (x′)(v) LhL2 g 2 v 2 k k − lim 0 ε ց ε ! − * lim 0 ε ց (cid:18) LhL2 v gk k * ε (cid:19) x′ k sup x (i) > lim 0 ε 6ε ց − k = lim sup 0 ε x′ x ց k − = ̄f ◦(x; v), 6ε k sup g. For the converse direction f ◦(x; v) 6 ̄f ◦(x; v), g > sup f where in (i) we use sup f we just compute similarly. We have proved f ◦(x; v) = ̄f ◦(x; v), Rd. The claim follows v from the correspondence between sublinear f ◦ and convex ∂Cf (Clarke, 1990, Proposition 2.1.5). − − ∈ ∀ Now we show the relation holds for Fr ́echet subdifferential. As h and G are locally Lips- chitz and directional differentiable, they are Bouligand-differentiable (B-differentiable) ac- cording to (Cui and Pang, 2021, Definition 4.1.1). Then, by (Cui and Pang, 2021, Propo- sition 4.1.2(a)), we know that f ′(x; d) = h′ G(x); G′(x; d) where the directional derivative G′(x; d) is defined element-wise as (G′i(x; v))n i=1 according to (Cui and Pang, 2021, Definition 1.1.4). Thus, combined with ̄f ′(x; d) = G(x) h ∇ we have shown ̄f ′(x; d) = f ′(x; d) for any d, which implies (cid:10) , G′(x; d) G(x) ∇ = h (cid:10) (cid:11) (cid:0) (cid:1) (cid:1) (cid:0) (cid:1) (cid:0) , , G′(x; d) , (cid:11) ∂f (x) = ∂ h G(x) ∇ (x) ) , G( * (cid:11) i (cid:0) by (Rockafellar and Wets, 2009, Exercise 8.4) (note that for B-differentiable f , the sub- derivative df (x)(d) in (Rockafellar and Wets, 2009, Exercise 8.4) is equal to the directional derivative f ′(x; d) by (Rockafellar and Wets, 2009, Exercise 9.15)). b (cid:1) h (cid:10) b Remark 47. Theorem 46 is fundamentally different from the classic exact chain rule as b the exact chain rule does not hold even for very simple function. Consider h(a, b) = a 2, 2]. In contrast, and G(x) = ( , x | | by Theorem 46, we have ∂C [h . One should compare 0 } { Theorem 46 with (Clarke, 1990, Theorem 2.3.9, Theorem 2.3.10). Besides, Theorem 46 implies (Clarke, 1990, Theorem 2.3.9(ii)). 0 G](0) = { − } G](0) = ∂C [ | * | − | * | ). We have ∂C [h | 1, 1]+[ − ](0) = 1, 1] = [ x | ( [ − − ◦ ◦ Rd Corollary 48. Let f : R function. Then, we have ∂⊳f (u, x) = Proof. Let h : R R C(u, x) = (u, g(x)), ̄u = u and ̄x = x. As f (u, x) = h R be f (u, x) = u * ∂⊳[u R be h(a, b) = a g(x) { } × → → × × * * g(x), where g : Rd g](x). R is a Lipschitz → b. It is easy to see h is smooth at any (a, b). Let C(u, x), by Theorem 46, we know ◦ (u, x) = g(x) { } × ∂⊳[u * g](x), as required. ∂⊳f (u, x) = ∂⊳ g( ̄x) u + ̄u g(x) * * (cid:2) (cid:3) C.4 Exact Chain Rule of a Non-Separable Piecewise Linear Function In this section, we consider the validity of the exact subdifferential chain rule of a simple piecewise-linear function, which is defined by n fPL(w) := max x⊤i w, 0 Xi=1 n o m − Xj=1 max y⊤j w, 0 . n o 25 C.4.1 Chain Rule for Clarke Subdifferential Theorem 49 (Clarke). Suppose x⊤i w = y⊤j w = 0 for any i exact Clarke subdifferential chain rule ∈ [n], j ∈ [m]. We have the ∂CfPL(w) = GC PL := n xi * Xi=1 m yj} j=1 { yj) ( − * [0, 1] m Xj=1 [0, 1] + = 0 . } { if and only if span n i=1 xi} { span ∩ Proof. We have divided the proof into Lemma 50 and Lemma 51. (cid:1) (cid:0) (cid:1) (cid:0) Lemma 50 (Necessary). If there exists v Rd such that then ∂CfPL(w) ( GC PL. 0 = v span ∈ (cid:0) ∈ n xi} i=1 { span m j=1 yj} { (cid:0) , (cid:1) ∩ (cid:1) Proof. We first prove that assuming certain regularity on loss of generality. Let the indices set xi}i { Jx ⊆ x are linearly independent and satisfy ∈J n xi} i=1 and { [n] be a selection from yj} { xi} { m j=1 is without n i=1 such that Similarly, we define Jy ⊆ span (cid:16) [m] for { xi}i yj} { x ∈J = span xi} { m j=1. Then, we write (cid:16) (cid:17) n i=1 . (cid:17) fPL(w) = fPL1(w) + fPL2(w), where fPL1(w) := max x⊤i w, 0 fPL2(w) := x [n] Xi \J ∈ max n x⊤i w, 0 Xi ∈J x n o o − − max y⊤j w, 0 , y [m] Xj \J ∈ max n y⊤j w, 0 . o Xj ∈J y n o By the fuzzy sum rule (Clarke, 1990, Proposition 2.3.3), we know ∂C fPL(w) ∂CfPL1(w) + ∂CfPL2(w) ∂CfPL1(w) + GC PL2 ⊆ GC PL, ⊆ PL2 := ⊆ y ( i x ∈J xi * [0, 1] + [0, 1]. Thus, to prove ∂CfPL(w) ( j ∈J PL, by Lemma 41 and (Clarke, 1990, Proposition 2.1.2(a)), we only need to show where we define GC GC n ∂CfPL2(w) ( GC i=1 m are linearly independent. Similarly, we assume j=1 are linearly independent. In the following, we may use Lemma 41 and above argument implicitly to assume regularity for simplicity. As v yj} { PL2. So, by abuse of notation and focus on fPL2, we assume , we write yj} { xi} { xi} { m j=1 span span n i=1 yj) P P − ∩ ∈ * (cid:0) (cid:1) = v = 0 n (cid:1) m xi = (cid:0) ai * bi * Xi=1 i yj. (2) Xj=1 [m]. Fix ym. We can further assume It is safe to assume ai 6 yj} xi} { yj} { n i=1 ∪ { 1 m j=1 are not linearly independent, we get 0 = − = 0, bj 6 [n], j = 0, ∈ ∈ ∀ − 1 m j=1 are linearly independent. To see this, suppose to the contrary n i=1 pi * xi + 1 m − j=1 qj * n xi} i=1 ∪ { yj. We know P P 26 6 6 that there exist j′ ∈ m xi} i=1, for any i { ∈ independent. As qj′ − 1] such that qj′ [m [n], it holds that pi = 0, hence that = 0, we have = 0, as otherwise by linear independence of m j=1 are linearly − 1 n i=1 ∪ { xi} { yj} yj′ = n − Xi=1 (pi/qj′) xi − * 1] [m Xj − ∈ \{ j′ (qj/qj′) yj. * } Plug in to Equation (2) and yj′ m yj} notation, we have j=1 are linearly independent. After that, we exam and by Lemma 41. It is possible that all span is removed. Repeat this procedure and by abuse of 1 ai}i { bj}j. We remove xi if ai = 0 and remove yj if bj = 0, which is without of generality { j=1 are removed and we get m = 1 and ym ∈ = 0, we always have n > 1. Then, we can write n i=1 ∪ { yj} { xi} { m − − 1 xi} { n i=1 . But as ym 6 (cid:0) (cid:1) n ym = αixi + = 0 for any i with αi 6 we have the exact chain rule = 0, βj 6 ∈ [n], j Xi=1 [m ∈ − βjyj, 1 m − Xj=1 (3) 1]. Note that, for such xi} { n i=1 and yj} { m 1 j=1 , − max n Xi=1 , 0 x⊤i * n o 1 m − Xj=1 − max n , 0 y⊤j * o ∂C   (w) =   n Xi=1 [0, 1] + xi * 1 m − Xj=1 yj) ( − * [0, 1] by using (Clarke, 1990, Theorem 2.3.10) and linear independence. We proceed to show that ∂CfPL(w) ( GC and we define PL by exhibiting an element in GC PL ∂C fPL(w). Let θ \ Rn+m + ∈ αi| | βi n| | − 1 for for 1 6 i 6 n for n + 1 6 i 6 n + m i = m + n θi =    Note that 1, − A =             * sgn(α1) ... sgn(αn) sgn(β1) ... 1) * − y⊤m − * * sgn(βm x⊤1 x⊤n y⊤1 y⊤m − 1             R(n+m) × d. ∈ n A⊤θ = αixi + Xi=1 1 m − Xj=1 βjyj − ym = 0. By Gordan's Theorem in Lemma 40, we have certified the nonexistence of direction d such that sgn(αi) sgn(βj) d⊤xi < 0 for * d⊤yj < 0 for * d⊤ym > 0   [n] [m i j ∈ ∈ 1] . − By − A⊤θ = 0, similarly, we certify the nonexistence of direction d  Rd such that ∈ sgn(αi) sgn(βj) d⊤xi > 0 for * d⊤yj > 0 for * d⊤ym < 0 [n] [m i j ∈ ∈ − 1] . 27    Rd ∈ (4) (5) 6 6 Let the Bouligand subdifferential of fPL at w be ∂BfPL(w); see (Cui and Pang, 2021, Definition 4.3.1). Define ∇1 := ∇2 := m Xi=1 m Xi=1 1αi>0 * xi − 1αi<0 * xi − 1 m − Xj=1 1 m − Xj=1 1βj>0 * yj, 1βj<0 * yj − ym. (compare (4)) (compare (5)) By (Cui and Pang, 2021, Proposition 4.4.8(c)) and the nonexistences of d for (4) and (5), we have proved that ∇1, ∇2 / ∈ n ∂BfPL(w). Let us define a set m C PL := G xi * { 0, 1 } + yj) ( − Xj=1 Xi=1 0, 1 * { } ⊆ Rd. Besides, using (Cui and Pang, 2021, Proposition 4.4.8(c)), we have ∂BfPL(w) Then, with (Rockafellar and Wets, 2009, Theorem 9.61), it follows that ⊆ C PL G ∇1, ∇2} . \{ Therefore, to prove ∂C fPL(w) ( GC ∂CfPL(w) = Conv(∂BfPL(w)) Conv(G C PL ∇1, ∇2} ). \{ ⊆ PL, we only need to show To this end, we define two sets satisfying G ∇1 ∈ GC PL Conv \ C PL G \{ (cid:16) C PL = P1 ∪ . ∇1, ∇2} (cid:17) P2 as yj) , 0, 1 } * { yj) 0, 1 * { } − ym. m − 1 ( − Xj=1 1 m − ( − Xj=1 ∇1} ) xi * { 0, 1 } + n Xi=1 n P1 := P2 := xi * { 0, 1 } + C PL Xi=1 ∇1, ∇2} ⊆ (P1\{ , we have \{ ∇1, ∇2} (cid:17) λ)gP2, with gP1 Thus, we can write G If ∇1 ∈ Conv C PL G \{ (cid:16) ∇1 = λgP1 + (1 − (P2\{ ∇2} ). It is evident that ∇1 ∈ ∪ GPL. Conv (P1\{ ∈ ∇1} ) , gP2 Conv (P2\{ ∇2} ) . ∈ We now show that it must be λ = 1 by considering three cases: Case 1. any gP2 ∈ i ∃ ∈ Conv (P2\{ ∇2} [n] : αi > 0. Without loss of generality, we assume α1 > 0. Note that for ), using the representation of ym in Equation (3), we have (γi − αi) * xi + m − 1 (γn+j + βj) Xj=1 yj), ( − * n gP2 = Xi=1 [n + m where γk ∈ [0, 1], k ∀ ∈ 1]. Similarly, we write gP1 ∈ Conv (P1\{ ∇1} ) as − gP1 = n Xi=1 xi + μi * 1 m − Xj=1 μn+j * ( − yj), 28 [n + m [0, 1], where μk ∈ ∇1 = λgP1 + (1 n − k ∀ ∈ λ)gP2 1]. Therefore, we know − = = Xi=1 m μi + (1 λ * λ) (γi − * − αi) * xi + (cid:0) 1αi>0 * (cid:1) 1βj>0 * yj. xi − 1 m − Xj=1 Xi=1 n i=1 ∪ { yj} As xi} { 1 m j=1 are linearly independent, it holds − 1 m − Xj=1 (cid:0) λ * μn+j + (1 λ) * − (γn+j + βj) yj) ( − * (cid:1) (by the definition of ∇1) μ1 + (1 λ * λ) (γ1 − * − α1) = 1α1>0 = 1. If 0 6 λ < 1, we have 1 = λ * μ1 + (1 λ) (γ1 − * − α1) 6 1 (1 λ) * − − α1 < 1, which gives the contradiction. Case 2. i ∀ ∈ [n] : αi < 0 but j ∃ ∈ [m − 1] : βj > 0. Suppose β1 > 0. Then, we write n y1 = αi/β1) ( − * m − x1 + 1 ( − βj/β1) yj − * (1/β1) ym. * xi} { Note that ym and y1, we still write ym = and the situation reduces to the Case 1. n i=1 ∪ { Xj=2 Xi=1 m yj} j=1 are linearly independent. By abuse of notation and swapping [n] : αi > 0 m j=1 βjyj. Then, we have n i=1 αixi + − i 1 ∀ ∈ P P Case 3. [m similar manipulation as these in Case 1, we have [n], j − ∈ ∈ ∀ i 1] : αi < 0, βj < 0. In that case, we have ∇1 = 0. By a n ∇1 = Xi=1 = 0. (cid:0) μi + (1 λ * λ) (γi − * − αi) * xi + (cid:1) 1 m − Xj=1 (cid:0) λ * μn+j + (1 λ) * − (γn+j + βj) yj) ( − * (cid:1) As xi} { n i=1 ∪ { yj} 1 m j=1 are linearly independent, it holds − μ1 + (1 λ * λ) (γ1 − * − α1) = 1α1>0 = 0. If 0 6 λ < 1, we have 0 = λ * μ1 + (1 λ) (γ1 − * − α1) > (1 − − λ) * α1 > 0, which gives the contradiction. Therefore, we have shown λ = 1 which implies ∇1 ∈ xi} { ) . However, j=1 are linearly independent, ∇1 is an extreme point of Conv(P1) by m − Conv (P1\{ n i=1 ∪ { ∇1} 1 yj} as Lemma 43. Thus, we know ∇1 / ∈ ) by definition, a contradiction. Conv (P1\{ ∇1} 29 Lemma 51 (Sufficient). If the following condition holds then ∂CfPL(w) = GC PL. span n i=1 xi} { (cid:0) ∩ (cid:1) span yj} { m j=1 = 0 , } { (cid:0) (cid:1) * * * x1 xn n and Y = Proof. We first do a general preparation that will be reused in other developments. Let m be given. The thin-SVD Rd X = * * * rx, Vx ∈ of X can be written as X = UxΣxV ⊤x with Ux ∈ St(n, rx), St(d, ry), Σy ∈ and rx = rank(X). Similarly, for Y , we have Y = UyΣyV ⊤y with Uy ∈ Rry 0 St(m, ry), and ry = rank(Y ). As span yj} , we = { } { know U ⊤x Uy = 0. Therefore, we can write Rd ym ∈ St(d, rx), Σx ∈ (cid:2) ry , Vy ∈ (cid:3) xi} m j=1 span n i=1 Rrx y1 ∈ ∩ { × × × × (cid:2) (cid:3) (cid:0) (cid:1) (cid:0) (cid:1) Rn+m X ⊤ Y ⊤ (cid:21) where z = U ⊤w and U := ∋ (cid:20) Ux Uy Let an auxiliary function hPL : Rrx w = * (cid:20) VxΣx * (cid:18) VyΣy (cid:21) St(d, rx + ry). ∈ Rry (cid:3) × R be → (cid:2) n z := z1 z2 (cid:21) ∈ (cid:20) Rrx+ry , (cid:19) hPL(z1, z2) := max e⊤i VxΣxz1, 0 Xi=1 n hPL1(z1) o m − Xj=1 max e⊤j VyΣyz2, 0 . n hPL2(z2) o As hPL is separable with respect to z1 and z2, by (Rockafellar, 1985, Proposition 2.5) and (Rockafellar and Wets, 2009, Proposition 10.5), we know } | {z } | {z × Note that fPL(w) = hPL(U ⊤x w, U ⊤y w). We compute ∂⊳hPL(z1, z2) = ∂⊳hPL1(z1) ∂⊳[ − hPL2](z2). ∂⊳fPL(w) = ∂⊳ (w) hPL(U ⊤x * , hPL( * h (a) = U ∂⊳ (b) (cid:2) = Ux∂⊳ hPL1 i , U ⊤y * ) ) * (cid:3) (cid:16) U ⊤x w U ⊤x w, U ⊤y w (cid:17) + Uy∂⊳[ − hPL2] U ⊤y w (c) = ∂⊳ (cid:2) hPL1 h (cid:17) (w) + ∂⊳ (cid:3) (cid:16) U ⊤x * (cid:16) (cid:17)i hPL2 − h (cid:16) U ⊤y * (cid:16) (cid:17)i (cid:17) (w), ) ( ♦ where (a) is using (Clarke, 1990, Theorem 2.3.10), (Rockafellar and Wets, 2009, Exercise 10.7), and U is full column rank; (b) is from ∂⊳hPL(z1, z2) = ∂⊳hPL1(z1) hPL2](z2); (c) is using the reasoning in (a) for h1, h2 separately. ∂⊳[ − × In particular for Clarke subdifferential, we know ∂C[ ∂C[hPL2] using (Clarke, 1990, Proposition 2.3.1). As hPL2 is convex, ∂C[hPL2] is equal to the convex subdifferential of hPL2 by (Clarke, 1990, Proposition 2.2.7). Then, by (Hiriart-Urruty and Lemar ́echal, 2004, §D, Corollary 4.3.2), a direct computation gives hPL2] = − − ∂CfPL(w) = ∂C hPL1 as required. h (w) + U ⊤x * (cid:16) (cid:17)i − (cid:16) ∂C hPL2 h U ⊤y * (cid:16) (cid:17)i (w) = GC PL, (cid:17) 30 Proof of Theorem 14. According to the argument in Appendix C.1, we only need to con- sider the Clarke subdifferential ∂Cfk(wk) for every k [H]. It is showed in Theorem 49 that we have ∈ ∂Cfk(wk) = GC k , if and only if the following span qualification is satisfied: span xi}i + k ∈I span ∩ (cid:17) (cid:16) { (cid:16) = 0 . } { − k ∈I (cid:17) [H] cases together, and Theorem 14 is proved. e xj}j { Then, put all k ∈ C.4.2 Chain Rule for Limiting Subdifferential Theorem 52 (Limiting). Suppose x⊤i w = y⊤j w = 0 and yj 6 We have the exact limiting subdifferential chain rule = 0 for any i [n], j [m]. ∈ ∈ n m ∂fPL(w) = GL PL := [0, 1] + xi * if and only if span { span ∩ Xi=1 n xi} i=1 −   yj}  { Xj=1 m j=1 yj * 1d⊤yj>0 : d Rd, min 16t6m ∈ = 0 . } { d⊤yt (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) > 0    Proof. (Sufficient) We begin with the general argument in the proof of Lemma 51 until Equation ( ). After that, we will focus on the proof of (cid:1) (cid:1) (cid:0) (cid:0) ♦ m ∂ hPL2 − U ⊤y * (cid:16) (w) = −   Xj=1 yj * 1d⊤yj >0 : d Rd, min 16t6m ∈ d⊤yt > 0 =: GL PL2.   h (cid:17)i (cid:12) (cid:12) (cid:12) m y⊤j w, 0 For the ease of notation, we denote q(w) :=  j=1 max . Note { } that by the definition of limiting subdifferential (see Definition 4), we have U ⊤y w hPL2  = − − (cid:12) (cid:12) (cid:12) (cid:0) (cid:1) gν} → { P g s.t. gν ∈ ∂q(wν), ν . ∀ ∂q(w) = lim sup w w′ ∂q(w′) = g : wν} → ∃{ w and → n b ∂q(w). Then, there exist wν }ν and ∈ { g. We can assume for any ν and any j Let g gν → ∂q(wk) = Lemma 44, differentiable at wν, which implies o b ∂q(wν), and w, gν ∈ gν}ν such that wν → { [m], we have w⊤ν yj 6 = 0, as otherwise, by ∈ b and gk is undefined. Then, for any ν, the function q is strictly ∅ b gν} { = ∂q(wν) = b m −   Xj=1 yj * 1(wν − w)⊤yj >0  ⊆ GL PL2. As GL ∂q(w) PL2 is a finite set, it is trivially closed with the usual Euclidean metric. We have   GL PL2. For the reverse direction, let g′ ∈ ⊆ GL PL2. Then, there exists d such that g′ = m − Xj=1 yj * 1d⊤yj >0 = 0 for any j with d⊤yj 6 j ∈ Thus, for any ν, we get gν = g′. Consequently, we get g′ ∈ 1d⊤yj 6 gν} [m]. Then, we know the function q is strictly differentiable at wν and { ∂q(w) and GL PL2 ⊆ [m]. Let wν = w + d/ν. We get w⊤ν yj = ν− ∈ = 0 for any ∂q(wν). = ∂q(w). b 31 b (Necessary) Suppose 0 = v span ∈ ∂fPL(w) = ∂ hPL1 (cid:0) U ⊤x * (cid:16) (cid:17)i h { n i=1 xi} (cid:1) (w) + ∂ span ∩ (cid:0) hPL2 − h yj} { U ⊤y * (cid:16) m j=1 (cid:17)i and (cid:1) (w) = GL PL. Then, by taking a convex hull on both size and using (Rockafellar and Wets, 2009, Theo- rem 8.49), we get ∂CfPL(w) = ∂C hPL1 (w) + ∂C U ⊤x * h which is a contradiction to Lemma 50. (cid:17)i (cid:16) hPL2 U ⊤y * (cid:16) (cid:17)i − h (w) = Conv(GL PL) = GC PL, Proof of Theorem 16. According to the argument in Appendix C.1, we only need to con- sider the limiting subdifferential ∂fk(wk) for every k [H]. It is showed in Theorem 52 that we have ∈ ∂fk(wk) = GL k , if and only if the following span qualification is satisfied: span xi}i + k ∩ [H] cases together, and Theorem 16 is proved. { (cid:16) ∈I ∈I (cid:17) (cid:16) (cid:17) − k = 0 . } { span e xj}j { Then, put all k ∈ C.4.3 Chain Rule for Fr ́echet Subdifferential Theorem 53 (Fr ́echet). Suppose x⊤i w = y⊤j w = 0 and yj 6 ∂fPL(w) For any given w such that = = 0 for any i [n], j ∈ [m]. ∈ , we have the following exact chain rule ∅ n ∂fPL(w) = GF b PL := xi * [0, 1] + ∅ 0 } { (cid:26) if m > 0, if m = 0. Xi=1 yj} { b if and only if span m j=1 Proof. (Sufficient) We begin with the general argument in the proof of Lemma 51 until Equation ( (cid:1) ). We will focus on the proof of 0 . } { xi} span n i=1 = ∩ { (cid:0) (cid:0) (cid:1) ♦ ∂ hPL2 − U ⊤y * (cid:16) (w) = GF PL2 := if m > 0, if m = 0. ∅ 0 (cid:26) } { U ⊤y w h For the ease of notation, we denote q(w) := − by Lemma 44, we know that if there exists j we have ∂q(w) = (cid:17)i b m j=1 max − = hPL2 . If m = 0, then q(w) = 0 and GF ∅ span m j=1 (cid:1) PL2 = xi} span ∈ { . Then, we get m > 0 and GF yj} span (cid:0) } ⊇ { ∂fPL(w) , we know = (cid:1) (cid:0) ∅ y⊤j w, 0 . Then, } { = 0, then [m] such that w⊤yj = 0 and yj 6 (cid:0) P 0 . The claim follows trivially. } { = 0 . There exists yj 6 yj} { . Thus, from (cid:1) ∅ PL = by definition. (cid:0) ∂fPL(w) ) GF PL = m j=1 n i=1 = v ∈ ∩ 0 ∅ (cid:1) (Necessary) Suppose 0 b as otherwise v / the assumption that ∈ { Proof of Theorem 17. According to the argument in Appendix C.1, we only need to con- b sider the Fr ́echet subdifferential [H]. It is showed in Theorem 53 that we have ∂fk(wk) for every k ∈ b if and only if the following span qualification is satisfied: b b ∂fk(wk) = GF k , span ∩ [H] cases together, and Theorem 17 is proved. { (cid:16) ∈I ∈I (cid:17) (cid:17) (cid:16) span xj}j { − k = 0 . } { xi}i + k Then, put all k ∈ 32 6 6 6 6 C.5 Proofs for Section 4.3 Definition 54 (Regularities). We consider the following regularity conditions: • General position data (Yun et al., 2018, Assumption 2): No d data points ̃xi}i ⊆ { 1 lie on the same affine hyperplane, which is equivalent to the nonexistence of Rd and index set . > d such that w⊤xj = 0 for any j [N ] with Rd w − ∈ J ⊆ |J | ∈ J • Linear Independence Kink Qualification (LIKQ) (Griewank and Walther, 2016, Def- inition 2), (Griewank and Walther, 2019, Definition 2.6): Let the j-th row of the matrix zσ in Appendix A be v⊤j . We define the following index set ∇ LIKQ is satisfied if the vectors α := N (k 1) + i : w⊤k xi = 0 = . j : zj = 0 } { − n o α are linearly independent. ∈ vi}i { • Linearly Independent Activated Data (LIAD): Let the index set [H], the data points . For any fixed k 0 } ∈ xi}i { ∈Jk are linearly independent. Jk := j : w⊤k xj = { Proof of Proposition 19. For the relation general position = LIAD, it directly follows from (Yun et al., 2018, Lemma 1). By the analysis in Appendix A.2, we know LIKQ is satisfied for the empirical loss of two-layer ReLU network if and only if ⇒ H ( Yk′=1 0 1k′=k * xi × )(N (k − 1)+i) α ∈ are linearly independent. It is easy to see that LIKQ holds if and only if, for any given are linearly independent. Thus, we have the k [H], the data points ∈ relation LIAD linearly independent, then it is evident that ⇐⇒ I xi}i { LIKQ. Note that j:w⊤ ∈{ k xj =0 } + k ∪ I −k = j : w⊤k xj = 0 . If } { xj}j { + k ∪I − k ∈I are which implies LIAD = ⇒ span { (cid:16) SQ. xi}i + k ∈I ∩ (cid:17) span (cid:16) xj}j { − k ∈I (cid:17) = 0 , } { ∈ Proof of Corollary 23. Under SQ, if the Fr ́echet subdifferential is nonempty, we get ∅ for any k [H]. By Theorem 14 and Theorem 17, we have ∂C L and ∂L are equal at that point. Then, Clarke regularity follows from Definition 7. By Proposition 19, if the data points are in general position, then they satisfy SQ. Using (Rockafellar and Wets, 2009, Theorem 10.1), the Fr ́echet subdifferential is nonempty at every local minimizer, which completes the proof. −k = b I D Proofs for Section 5 D.1 Testing Clarke NAS Proof of Theorem 28. We consider an ε-Clarke stationary point (u∗1, w∗1, . . . , u∗H , w∗H) with (u∗1, w∗1, . . . , u∗H , w∗H) k k 6 B. 33 (cid:16) ∞ ρ∗i := l′i ρi := l′i H Xk=1 H Xk=1 u∗k * uk * ∂C L(u∗1, w∗1, . . . , u∗H, w∗H ) such that By Theorem 14, we know there exists g∗ ∈ = dist g∗ =: (g∗1, g∗1, . . . , g∗H , g∗H) k k ui = ui for any i Note that rithm 3. In this subsection, we will write ui rather than radius δ ], we aim to show that, for any ∈ (0, C Clarke b τ 0, ∂C L(u∗1, w∗1, . . . , u∗H , w∗H) (cid:16) (cid:17) wH) of Algo- uH , [H] in the returned vector ( ui for simplicity. Given a positive b w1, . . . , u1, b b b 6 ε. ∈ (u1, w1, . . . , uH , wH) Bδ ∈ b (u∗1, w∗1, . . . , u∗H, w∗H ) (cid:17) (cid:16) , we can certify that the rounded point returned by Algorithm 3 satisfies dist 0, ∂C L(u1, w1, . . . , uH, wH) 6 ε + C Clarke μ δ, * where C Clarke μ < + is a constant depending on the curvature that we will discuss later. b We define the following shorthands for convenience (cid:17) b Recall the definition of the rounded b wk = argmin 2 − wkk z Rd k ∈ s.t. z⊤xi > 2R z b δ, * 2R δ, * z⊤xi 6 − z⊤xi = 0, b i i i ∀ ∀ ∀ ∈ J ∈ J ∈ J max (w∗k)⊤xi, 0 n o , ! [N ], i ∀ ∈ max w⊤k xi, 0 n o , ! [N ]. i ∀ ∈ b wk}k and we define indices sets { < k , J J = k , J > k as > k := < k := = k := j j j n n n ∈ ∈ ∈ [N ] : x⊤j wk > R δ * R − 6 R , , o . o o δ * δ * [N ] : x⊤j wk < [N ] : x⊤j wk (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) [H]: (cid:12) ∈ We consider the following quantity related to the point w∗k for any k τk := min ( min i w∗ i:x⊤ k>0 x⊤i w∗k, − max i w∗ i:x⊤ k<0 x⊤i w∗k . ) Note that 0 < δ 6 C Clarke τ [N ] such that x⊤i w∗k > 0, we have 6 τk 4R . For any i ∈ x⊤i wk = x⊤i w∗k − > x⊤i w∗k − k > τk − R * wk) x⊤i (w∗k − w∗k − xik * k δ > 3R δ > R * wkk δ. * Thus, we know have i : x⊤i w∗k > 0 ⊆ J > k . Similarly, for any i ∈ [N ] such that x⊤i w∗k < 0, we (cid:8) (cid:9) x⊤i wk = x⊤i w∗k + x⊤i (wk − 6 x⊤i w∗k + 6 τk + R xik * k k δ 6 − w∗k) w∗k − 3R * − wkk δ < − * R δ, * 34 (cid:9) x⊤i wk (cid:12) (cid:12) (cid:12) (cid:9) < k , J which implies holds (cid:8) i : x⊤i w∗k < 0 ⊆ J < k . We have, for any i ∈ [N ] such that x⊤i w∗k = 0, it (cid:12) (cid:12) (cid:12) 6 6 x⊤i w∗k (cid:12) x⊤i w∗k (cid:12) (cid:12) (cid:12) 6 R (cid:12) * (cid:12) = k . As (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) < k , δ. J + + x⊤i (wk − (cid:12) xik * k (cid:12) (cid:12) k w∗k − w∗k) (cid:12) wkk (cid:12) (cid:12) = k , J J > k are disjoint and [N ] = < k ⊔J = k ⊔J > k , J So, we know we know (cid:8) i : x⊤i w∗k = 0 ⊆ J i : x⊤i w∗k < 0 = i : x⊤i w∗k = 0 i : x⊤i w∗k > 0 = = k , J o n = > k . J o n Meanwhile, as o n wk is feasible to the quadratic program in Algorithm 3, we get i : x⊤i wk < 0 b = J < k , i : x⊤i wk = 0 = n which implies 1x⊤ bwk>0 for any k i o + k (w∗k) b I n = −k (w∗k) = k = b [H]. It is evident that ∪ I J o + wk) k ( I = k , J ∪ I i : x⊤i wk > 0 = > k , n wk) and 1x⊤ b −k ( J o k>0 = 1i i w∗ = > k ∈J ∈ wH) w1, . . . , ( k (w1, . . . , wH) k (w∗1, . . . , w∗H) k [H], w∗k is feasible to the quadratic program for computing (w1, . . . , wH ) k − − 6 6 δ, b b as, for any k b ∈ rithm 3. Therefore, we know b wk in Algo- b , (u1, w1, . . . , uH , wH) ∈ Bδ (u1, w1, . . . , uH , wH) . (cid:16) (cid:17) By triangle inequality, it holds that b b (u1, w1, . . . , uH , wH) Using Theorem 14, we get b b dist 0, ∂C L(u1, w1, . . . , uH , wH) B2δ ∈ (u∗1, w∗1, . . . , u∗H , w∗H) (cid:17) (cid:16) . k 6 (cid:16) g∗ k 6 ε + + dist H (cid:16) g∗k − Xk=1 (cid:12) (cid:12) (cid:12) (cid:12) wk) = (cid:12) where we define Lk( g∗, ∂C L(u1, b N (cid:17) w1, . . . , uH, b wH) (cid:17) H ρi * Xi=1 b N i=1 uk max b w⊤k xi, 0 b + dist g∗k, ∂C Lk( wk) n b max x⊤i { ρi * (cid:12) Xk=1 (cid:12) o (cid:12) (cid:12) wk, 0 . We first compute (cid:12) } (cid:16) (cid:17) b N ρi − Xi=1 (cid:12) (cid:12) (cid:12)b ρ∗i (cid:12) (cid:12) (cid:12) N = b l′i Xi=1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 6 Ll′ * N P H Xk=1 H uk * n b max uk * b max b w⊤k xi, 0 N 6 Ll′ Xi=1 (cid:13) Xk=1 (cid:16) (cid:13) (cid:13) H (cid:13) (cid:13) Xi=1 Xk=1 6 3Ll′N HBR * b wk − xik * k δ. b uk| * k | δ =: C1 * (cid:0) * l′i ! − H Xk=1 u∗k * max (w∗k)⊤xi, 0 n o o !(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) w⊤k xi, 0 n o u∗k * − max (w∗k)⊤xi, 0 n o(cid:17) w∗kk + w∗kk * k k xik * | uk − (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) u∗k| (cid:1) 35 We now upper bound the second term H k=1 P N Xi=1 ρi * b g∗k − (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) max w⊤k xi, 0 n b o = 6 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) N (cid:12) Xi=1 (cid:12) (cid:12) N (cid:12) (cid:12) (cid:12) Xi=1 (cid:12) (cid:12) (cid:12) (cid:12) | + N i=1 ρi * g∗k − (cid:12) (cid:12) (cid:12) P b (w∗k)⊤xi, 0 n o max (w∗k)⊤xi, 0 max w⊤k xi, 0 . Note that (cid:9)(cid:12) (cid:12) (cid:12) w⊤k xi, 0 o (cid:12) (cid:12) (cid:12) b (cid:12) (cid:12) (w∗k)⊤xi, 0 max max n n N − Xi=1 N − o =:T k 1 Xi=1 (cid:8) b ρi * b ρi * b N {z (w∗k)⊤xi, 0 − o =:T k 2 Xi=1 ρi * b n b max w⊤k xi, 0 . max ρ∗i * ρ∗i * N Xi=1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) | n max ρi * n b o (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) } o (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) } Now we estimate these two terms. For T k 1 , we compute {z T k 1 6 N Xi=1 w∗kk * k k xik * | ρi − ρ∗i | 6 BR b N * Xi=1 ρi − | ρ∗i | 6 BR C1 * δ =: C2 * * δ. b For T k 2 , we see that T k 2 6 N Xi=1 Summarizing, we have H N ρi| * k | xik * k wk − w∗kk 6 2Ll′N R δ =: C3 * * δ. b g∗k − ρi * max w⊤k xi, 0 n o Xi=1 Xk=1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) b We proceed to upper bound b H g∗k, ∂CLk( k=1 dist (cid:16) By Theorem 14, we know that there exist ξj ∈ wk) (cid:17) [0, 1], P ∀ b ∂CLk(w∗k) can be written as the Clarke subgradient g∗k ∈ . H 6 Xk=1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 1 + T k T k 2 6 H(C2 + C3) δ =: C4 * * δ. j ∈ I + k (w∗k) ∪ I −k (w∗k) such that g∗k := i [N ] ∈ u∗kρ∗i * − k (w∗ k) + k (w∗ X k) ∪I 1x⊤ i w∗ k>0 * xi + + k (w∗ k) Xj ∪I ∈I − k (w∗ k) u∗kρ∗j * xj * ξj. Now, we are well prepared to upper bound dist g∗k, ∂C Lk( wk) . Let (cid:1) gk := b i [N ] ∈ + k ( bwk) X ∪I b uk ρi * 1x⊤ i (cid:0) bwk>0 * xi + − k ( bwk) (cid:1) b + k ( bwk) Xj ∪I ∈I − k ( bwk) uk ρj * xj * ξj, b (cid:1) which, by Theorem 14, belongs to the Clarke subdifferential ∂C Lk( wk). We upper bound I \ (cid:0) I \ (cid:0) dist g∗k, ∂C Lk( wk) 6 gk − k g∗kk b (cid:0) (cid:1) b b 36 with gk − k g∗kk [N ] b = (cid:13) (cid:13) (cid:13) i (cid:13) (cid:13) (cid:13) (cid:13) X16i6N 6 ∈ + I k ( bwk) X \ (cid:0) xik * k ∪I uk − k ( bwk) ρi − (cid:1) u∗kρ∗i b * 6 R (cid:12) (cid:12) b (cid:12) uk| * | X16i6N (cid:16) C1 * * Then, we have 6 BR (cid:12) (cid:12) (cid:12)b δ + N RLl′ ρi − (cid:12) (cid:12) (cid:12) + ρ∗i (cid:12) (cid:12) (cid:12) δ. * uk − u∗k ρ∗i | * | (cid:12) (cid:12) (cid:12) (cid:12) (cid:17) (cid:12) (cid:12) ρi − u∗kρ∗i uk (cid:16) (cid:17) 1x⊤ i * bwk>0 * xi + uk + k ( bwk) Xj ∪I ∈I − k ( bwk) (cid:16) ρj − u∗kρ∗j xj * * (cid:17) b ξj(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) H dist g∗k, ∂C Lk( wk) 6 Xk=1 (cid:0) (cid:1) In sum, we have proved that b H Xk=1 gk − k g∗kk 6 H(BR * C1 + N RLl′) δ =: C5 * * δ. b dist 0, ∂C L(u1, w1, . . . , uH, wH) where C Clarke μ (cid:17) := C4 + C5 = poly(B, R, Ll, Ll′, N, H). (cid:16) b b 6 ε + C Clarke μ δ, * D.2 Testing Fr ́echet NAS Proof of Theorem 32. Some steps in the computation are similar to these in the proof of Theorem 28 in Appendix D.1, and we may skip them for simplicity. We consider 6 B. By an ε-Fr ́echet stationary point (u∗1, w∗1, . . . , u∗H, w∗H ) with Theorem 17, there exists a regular subgradient g∗ ∈ g∗ =: (g∗1, g∗1, . . . , g∗H , g∗H) k k (u∗1, w∗1, . . . , u∗H, w∗H ) k k ∂L(u∗1, w∗1, . . . , u∗H , w∗H) such that = dist 6 ε. 0, b ∂L(u∗1, w∗1, . . . , u∗H , w∗H) (cid:17) (cid:16) Given a positive radius δ (0, C Fr ́echet τ ∈ ], we aim to show that, for any b (u∗1, w∗1, . . . , u∗H, w∗H ) (cid:17) (cid:16) we can certify the rounded point returned by Algorithm 5 satisfying (u1, w1, . . . , uH , wH) Bδ ∈ , dist 0, ∂L( u1, w1, . . . , uH , wH) (cid:16) 6 ε + C Fr ́echet μ δ, * (cid:17) where C Fr ́echet b Similar to Appendix D.1, we define the following shorthands for convenience is a constant depending on the curvature that we will discuss later. < + ∞ b b b μ b ρ∗i := l′i ρi := l′i b H Xk=1 H Xk=1 u∗k * uk * b max (w∗k)⊤xi, 0 n o , ! [N ], i ∀ ∈ max w⊤k xi, 0 n o , ! [N ]. i ∀ ∈ b 37 We consider the following quantity related to the point w∗k for any k [H]: ∈ τk := min ( min i w∗ i:x⊤ k>0 x⊤i w∗k, − max i w∗ i:x⊤ k<0 x⊤i w∗k . ) > k for computing the rounded We use the same indices sets Appendix D.1. Note that 0 < δ 6 C Fr ́echet that wk}k as those in { 4R . The argument in Appendix D.1 shows = k , τ 6 τk < k , J J J b i : x⊤i w∗k < 0 i : x⊤i w∗k = 0 i : x⊤i w∗k > 0 = < k , J o n = = k , J o n = > k . J o wk is feasible to the quadratic program in Algorithm 5, we get n Meanwhile, as n i : x⊤i wk < 0 b = < k , i : x⊤i wk = 0 = J o + k (w∗k) b I n = −k (w∗k) = k = b [H]. It is evident that ∪ I J o + wk) k ( I which implies 1x⊤ bwk>0 for any k i ∈ = k , J ∪ I i : x⊤i wk > 0 = > k , J n wk) and 1x⊤ b o k>0 = 1i i w∗ −k ( = > k ∈J wH) b (w1, . . . , wH ) k [H], w∗k is feasible to the quadratic program for computing (w∗1, . . . , w∗H) , k wk in Algo- (w1, . . . , wH) k − − 6 b w1, . . . , ( k as, for any k rithm 5. b ∈ b −k ( I ∂Lk( g∗k, However, the identification of w∗k is not sufficient to bound dist (cid:16) wk) b wk) may not be an empty set, which, by Theorem 17, implies GF (cid:17) k = and ∅ b H wk) dist k=1. We u∗k} { b define a constant Cu := Ll′(4HRB2 + 1) and consider the following quantity related to the point u∗k for any k . We are thus looking for the identification of index set g∗k, (cid:16) , as the ∂Lk( = + [H]: ∞ (cid:17) b b b ∈ τ ′k := min u∗k * n 6 τ ′ k 4Cu ρ∗i : i = k , u∗k * ∈ J ρ∗i > 0 . o Note that 0 < δ 6 C Fr ́echet = 0, by Theorem 17 and Assumption 30, we know u∗k * . Fix any k ∈ τ [H] and we consider two cases. If = k . Then, ρ∗i > 0 for any i ∈ J u∗k 6 for any i = k , we have ∈ J uk * ρi = u∗k * > τ ′k − | > τ ′k − ρ∗i + (uk * ρi − uk| * | δ > 3Cu * Cu * uk in Algorithm 5 implies if u∗k 6 which by the rounding step of ρi| ρi − | b ρi − u∗k * ρ∗i | − | δ, ρ∗i ) > u∗k * uk − ρ∗k| * | ρ∗i − | u∗k| ρi > uk * > 3Cu * uk| * | ρi − uk * − δ uk * ρi − u∗k * ρ∗i | = 0, then uk = uk and Cu * δ > 0. b If u∗k = 0, we can see that b b = ρi| b ρi − uk * uk * | | uk in Algorithm 5. Thus, we have proved that for uk = 0 by rounding step of = , and finally k , we get ∅ uH, −k ( [H] and i ∈ J + k (w∗k). By Theorem 17, we conclude that wk) = b b −k (w∗k) = w1, . . . , ρi > 0, hence that 6 Cuδ, u∗k * uk * I u1, ρ∗k| uH ) . ∅ = b b I I which implies any k that ∈ + k ( I b 38 b b b wk) = ∂L( b b b 6 Summarizing, we have u1, ( w1, . . . , uH, wH) w1, . . . , ( b wH) b b (w1, . . . , wH) b b − − (u1, w1, . . . , uH, wH ) 2 − (u1, w1, . . . , uH , wH) (cid:13) (cid:13) uk − (cid:13) | + 2 (w1, . . . , wH) (cid:13) (cid:13) (cid:13) (w∗1, . . . , w∗H) (cid:13) (cid:13) (cid:13) 2 + Xk:u∗ k=0 Xk:u∗ k=0 − (u∗1, w∗1, . . . , u∗H, w∗H) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) = b (cid:13) (cid:13) (cid:13) (cid:13) 6 (cid:13) (cid:13) (cid:13) 6 (cid:13) (cid:13) (cid:13) This shows by triangle inequality that 2 uk| (uk = uk if u∗k 6 = 0) b u∗k − | 2, uk| b (by u∗k = uk = 0) 2 6 δ2. b B2δ (u∗1, w∗1, . . . , u∗H , w∗H) (cid:17) (cid:16) Using Theorem 17, we get u1, ( w1, . . . , uH , wH) ∋ ∈ Bδ (u1, w1, . . . , uH , wH) . (cid:16) (cid:17) b b b b dist 0, ∂L( u1, w1, . . . , uH , wH) 6 + dist g∗, ∂L( u1, w1, . . . , uH , wH) g∗ k k (cid:16) 6 ε + N H b b b g∗k − Xk=1 (cid:12) Xi=1 (cid:12) (cid:12) (cid:12) wk) = (cid:12) b b max ρi * b N i=1 uk n b ρi * where we define Lk( (cid:17) w⊤k xi, 0 H (cid:16) dist b g∗k, b b wk) ∂Lk( b , b (cid:17) + (cid:12) (cid:12) o (cid:12) (cid:12) x⊤i (cid:12) { (cid:16) Xk=1 b wk, 0 . We first compute } (cid:17) b max H l′i + Xk=1 w∗kk * k k w∗kk u∗k * max (w∗k)⊤xi, 0 n o !(cid:12) (cid:12) (cid:12) (cid:12) (cid:12) xik * | uk − u∗k| (cid:1) b max w⊤k xi, 0 . A computa- (cid:8) b δ =: C4 * * (cid:9)(cid:12) (cid:12) (cid:12) δ. . By Theorem 17, we know that wk) ∂Lk(w∗k) can be written as (cid:17) b b max uk * b w⊤k xi, 0 n o ! − N ρi − Xi=1 (cid:12) (cid:12) (cid:12)b ρ∗i (cid:12) (cid:12) (cid:12) P H Xk=1 H b N = b l′i Xi=1 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) 6 Ll′ * N b xik * k δ. wk − Xi=1 Xk=1 6 4Ll′N HBR uk| * k | δ =: C1 * b We now upper bound the second term g∗k − tion similar to that in Appendix D.1 shows that (cid:12) (cid:12) (cid:12) H k=1 (cid:0) * P b H N N i=1 ρi * P b g∗k − ρi * max w⊤k xi, 0 6 H(C2 + C3) Xk=1 (cid:12) (cid:12) (cid:12) b (cid:12) C1 and C3 := 2Ll′N R. (cid:12) * We proceed to upper bound Xi=1 where C2 := BR n b o (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ∂Lk( there exist ξj ∈ g∗k := [0, 1], j ∀ ∈ I + H g∗k, k=1 dist (cid:16) k (w∗k) such that g∗k ∈ b u∗kρ∗i * 1x⊤ i w∗ P b xi + b k>0 * i [N ] ∈ + k (w∗ X k) ∪I − k (w∗ k) I \ (cid:0) (cid:1) Now, we are well prepared to upper bound dist g∗k, ∂Lk( wk) . Let gk := b i [N ] ∈ I \ (cid:0) + k ( bwk) X ∪I (cid:1) (cid:0) xi + b bwk>0 * b Xj ∈I + k ( bwk) uk ρi * 1x⊤ i − k ( bwk) b b (cid:1) 39 + k (w∗ k) Xj ∈I u∗kρ∗j * xj * ξj. uk ρj * xj * ξj, b b which, by Theorem 17, belongs to the Fr ́echet subdifferential upper bound dist with 6 ∂Lk( wk) g∗k, gk − k g∗kk ∂Lk( wk). We proceed to b b (cid:1) b ρi − u∗kρ∗i (cid:17) 1x⊤ i * bwk>0 * xi + b uk (cid:16) gk − k g∗kk (cid:0) b b = (cid:13) (cid:13) (cid:13) i (cid:13) (cid:13) (cid:13) 6 R (cid:13) ∪I + * I ∈ [N ] k ( bwk) X \ (cid:0) uk| * | X16i6N (cid:16) C1 * * Then, we have 6 BR b − k ( bwk) ρi − b b + (cid:1) ρ∗i ρ∗i | * | (cid:12) (cid:12) δ + 2N RLl′ (cid:12)b (cid:12) (cid:12) δ. (cid:12) * u∗k uk − (cid:12) (cid:12) (cid:12)b (cid:12) (cid:17) (cid:12) (cid:12) + k ( bwk) (cid:16) Xj ∈I uk ρj − u∗kρ∗j xj * * (cid:17) b b ξj(cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) (cid:13) H dist g∗k, ∂Lk( wk) 6 Xk=1 (cid:0) (cid:1) In sum, we have proved that b b H Xk=1 gk − k g∗kk 6 H(BR * C1 + 2N RLl′) δ =: C5 * * δ. b dist 0, ∂L( u1, w1, . . . , uH , wH) 6 ε + C Fr ́echet μ δ, * (cid:17) where C Fr ́echet μ := C4 + C5 = poly(B, R, Ll, Ll′, N, H). b b b b b (cid:16) References A. A. Ahmadi and J. Zhang. On the complexity of finding a local minimizer of a quadratic function over a polytope. Mathematical Programming, 195(1-2):783–792, 2022. S. Arora, S. Du, W. Hu, Z. Li, and R. Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In International Conference on Machine Learning, pages 322–332. PMLR, 2019. D. Bertsimas and J. N. Tsitsiklis. Introduction to Linear Optimization, volume 6. Athena Scientific Belmont, MA, 1997. S. Bubeck, R. Eldan, Y. T. Lee, and D. Mikulincer. Network size and size of the weights in memorization with two-layers neural networks. In Advances in Neural Information Processing Systems, volume 33, pages 4977–4986, 2020. J. V. Burke, A. S. Lewis, and M. L. Overton. Approximating subdifferentials by random sampling of gradients. Mathematics of Operations Research, 27(3):567–584, 2002. F. H. Clarke. Optimization and Nonsmooth Analysis. SIAM, 1990. Y. Cui and J.-S. Pang. Modern Nonconvex Nondifferentiable Optimization. SIAM, 2021. D. Davis and D. Drusvyatskiy. Stochastic model-based minimization of weakly convex functions. SIAM Journal on Optimization, 29(1):207–239, 2019. D. Davis, D. Drusvyatskiy, S. Kakade, and J. D. Lee. Stochastic subgradient method converges on tame functions. Foundations of Computational Mathematics, 20(1):119– 154, 2020. 40 D. Davis, D. Drusvyatskiy, Y. T. Lee, S. Padmanabhan, and G. Ye. A gradient sampling method with complexity guarantees for Lipschitz functions in high and low dimensions. In Advances in Neural Information Processing Systems, 2022. M. R. Garey and D. S. Johnson. Computers and Intractability, volume 174. 1979. A. Griewank. On stable piecewise linearization and generalized algorithmic differentiation. Optimization Methods and Software, 28(6):1139–1178, 2013. A. Griewank and A. Walther. Evaluating Derivatives: Principles and Techniques of Algo- rithmic Differentiation. SIAM, 2008. A. Griewank and A. Walther. First-and second-order optimality conditions for piecewise smooth objective functions. Optimization Methods and Software, 31(5):904–930, 2016. A. Griewank and A. Walther. Relaxing kink qualifications and proving convergence rates in piecewise smooth optimization. SIAM Journal on Optimization, 29(1):262–289, 2019. J.-B. Hiriart-Urruty and C. Lemar ́echal. Fundamentals of Convex Analysis. Springer Science & Business Media, 2004. Z.-D. Huang and G.-C. Ma. On the computation of an element of Clarke generalized Jacobian for a vector-valued max function. Nonlinear Analysis: Theory, Methods & Applications, 72(2):998–1009, 2010. M. I. Jordan, T. Lin, and M. Zampetakis. On the complexity of deterministic nonsmooth and nonconvex optimization. arXiv preprint arXiv:2209.12463, 2022. K. A. Khan and P. I. Barton. Evaluating an element of the Clarke generalized Jacobian of a composite piecewise differentiable function. ACM Transactions on Mathematical Software, 39(4):1–28, 2013. S. Kong and A. S. Lewis. The cost of nonconvexity in deterministic nonsmooth optimiza- tion. arXiv preprint arXiv:2210.00652, 2022. G. Kornowski and O. Shamir. Oracle complexity in nonsmooth nonconvex optimization. Journal of Machine Learning Research, 23(314):1–44, 2022a. G. Kornowski and O. Shamir. On the complexity of finding small subgradients in nons- mooth optimization. arXiv preprint arXiv:2209.10346, 2022b. C. Lemar ́echal, F. Oustry, and C. Sagastiz ́abal. The -Lagrangian of a convex function. Transactions of the American Mathematical Society, 352(2):711–729, 2000. U A. S. Lewis. Active sets, nonsmoothness, and sensitivity. SIAM Journal on Optimization, 13(3):702–725, 2002. J. Li, A. M.-C. So, and W.-K. Ma. Understanding notions of stationarity in nonsmooth optimization: A guided tour of various constructions of subdifferential for nonsmooth functions. IEEE Signal Processing Magazine, 37(5):18–31, 2020. T. Lin, Z. Zheng, and M. I. Jordan. Gradient-free methods for deterministic and stochastic In Advances in Neural Information Processing nonsmooth nonconvex optimization. Systems, 2022. 41 M. R. Metel and A. Takeda. Perturbed iterate SGD for Lipschitz continuous loss functions. Journal of Optimization Theory and Applications, pages 1–44, 2022. G. F. Montufar, R. Pascanu, K. Cho, and Y. Bengio. On the number of linear regions of deep neural networks. In Advances in Neural Information Processing Systems, vol- ume 27, pages 2924–2932, 2014. B. Mordukhovich and Y. Shao. Nonsmooth sequential analysis in Asplund spaces. Trans- actions of the American Mathematical Society, 348(4):1235–1280, 1996. K. G. Murty and S. N. Kabadi. Some NP-complete problems in quadratic and nonlinear programming. Mathematical Programming, 39(2):117–129, 1987. A. S. Nemirovskij and D. B. Yudin. Problem Complexity and Method Efficiency in Opti- mization. Wiley-Interscience, 1983. Y. Nesterov. Introductory Lectures on Convex Optimization: A Basic Course, volume 87. Springer Science & Business Media, 2003. Y. Nesterov. Lexicographic differentiation of nonsmooth functions. Mathematical Pro- gramming, 104:669–700, 2005. P. M. Pardalos and S. A. Vavasis. Open questions in complexity theory for numerical optimization. Mathematical Programming, 57(1-3):337–339, 1992. R. T. Rockafellar. Extensions of subgradient calculus with applications to optimization. Nonlinear Analysis: Theory, Methods & Applications, 9(7):665–698, 1985. R. T. Rockafellar and R. J.-B. Wets. Variational Analysis, volume 317. Springer Science & Business Media, 2009. I. Safran, G. Vardi, and J. D. Lee. On the effective number of linear regions in shallow univariate ReLU networks: Convergence guarantees and implicit bias. In Advances in Neural Information Processing Systems, 2022. S. Scholtes. Introduction to Piecewise Differentiable Equations. Springer Science & Busi- ness Media, 2012. L. Tian and A. M.-C. So. No dimension-free deterministic algorithm computes approximate stationarities of Lipschitzians. arXiv preprint arXiv:2210.06907, 2022. L. Tian, K. Zhou, and A. M.-C. So. On the finite-time complexity and practical com- putation of approximate stationarity concepts of Lipschitz functions. In International Conference on Machine Learning, pages 21360–21379. PMLR, 2022. G. Wang, G. B. Giannakis, and J. Chen. Learning ReLU networks on linearly separable data: Algorithm, optimality, and generalization. IEEE Transactions on Signal Process- ing, 67(9):2357–2370, 2019. C. Yun, S. Sra, and A. Jadbabaie. Efficiently testing local optimality and escaping saddles for ReLU networks. In International Conference on Learning Representations, 2018. J. Zhang, H. Lin, S. Jegelka, A. Jadbabaie, and S. Sra. Complexity of finding stationary In International Conference on Machine points of nonsmooth nonconvex functions. Learning, pages 11173–11182, 2020. 42
http://arxiv.org/abs/2302.12177v1
2023-02-23T17:18:26
2023-02-23T17:18:26
EquiPocket: an E(3)-Equivariant Geometric Graph Neural Network for Ligand Binding Site Prediction
Predicting the binding sites of the target proteins plays a fundamental role in drug discovery. Most existing deep-learning methods consider a protein as a 3D image by spatially clustering its atoms into voxels and then feed the voxelized protein into a 3D CNN for prediction. However, the CNN-based methods encounter several critical issues: 1) defective in representing irregular protein structures; 2) sensitive to rotations; 3) insufficient to characterize the protein surface; 4) unaware of data distribution shift. To address the above issues, this work proposes EquiPocket, an E(3)-equivariant Graph Neural Network (GNN) for binding site prediction. In particular, EquiPocket consists of three modules: the first one to extract local geometric information for each surface atom, the second one to model both the chemical and spatial structure of the protein, and the last one to capture the geometry of the surface via equivariant message passing over the surface atoms. We further propose a dense attention output layer to better alleviate the data distribution shift effect incurred by the variable protein size. Extensive experiments on several representative benchmarks demonstrate the superiority of our framework to the state-of-the-art methods.
[ "Yang Zhang", "Wenbing Huang", "Zhewei Wei", "Ye Yuan", "Zhaohan Ding" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12177v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12177v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "q-bio.BM", "@scheme": "http://arxiv.org/schemas/atom" }
[ "q-bio.BM", "cs.LG" ]
EquiPocket: an E(3)-Equivariant Geometric Graph Neural Network for Ligand Binding Site Prediction Yang Zhanga,c, Wenbing Huanga∗, Zhewei Weia∗, Ye Yuanb, Zhaohan Dingc aRenmin University of China, bBeijing Institute of Technology, c DP Technology China [email protected],[email protected],[email protected],[email protected],[email protected] 3 2 0 2 b e F 3 2 ] M B . o i b - q [ 1 v 7 7 1 2 1 . 2 0 3 2 : v i X r a ABSTRACT Predicting the binding sites of the target proteins plays a funda- mental role in drug discovery. Most existing deep-learning methods consider a protein as a 3D image by spatially clustering its atoms into voxels and then feed the voxelized protein into a 3D CNN for prediction. However, the CNN-based methods encounter several critical issues: 1) defective in representing irregular protein struc- tures; 2) sensitive to rotations; 3) insufficient to characterize the protein surface; 4) unaware of data distribution shift. To address the above issues, this work proposes EquiPocket, an E(3)-equivariant Graph Neural Network (GNN) for binding site prediction. In partic- ular, EquiPocket consists of three modules: the first one to extract local geometric information for each surface atom, the second one to model both the chemical and spatial structure of the protein, and the last one to capture the geometry of the surface via equivariant message passing over the surface atoms. We further propose a dense attention output layer to better alleviate the data distribution shift effect incurred by the variable protein size. Extensive experiments on several representative benchmarks demonstrate the superiority of our framework to the state-of-the-art methods. CCS CONCEPTS • Applied computing → Bioinformatics; • Computing method- ologies → Artificial intelligence. KEYWORDS Binding Site Prediction, Graph Neural Network, Drug Discovery ACM Reference Format: Yang Zhanga,c , Wenbing Huanga∗, Zhewei Weia∗, Ye Yuanb , Zhaohan Dingc . 2018. EquiPocket: an E(3)-Equivariant Geometric Graph Neural Network for Ligand Binding Site Prediction . In Proceedings of (Confer- ence acronym 'XX). ACM, New York, NY, USA, 12 pages. https://doi.org/ XXXXXXX.XXXXXXX 1 INTRODUCTION Nearly all biological and pharmacological processes in living sys- tems involve interactions between receptors (i.e. target proteins) Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. Conference acronym 'XX, June 03–05, 2018, Woodstock, NY © 2018 Association for Computing Machinery. ACM ISBN 978-x-xxxx-xxxx-x/YY/MM. . . $15.00 https://doi.org/XXXXXXX.XXXXXXX (a) Previous CNN-based methods by vox- elization (b) Our EquiPocket directly on protein graph Figure 1: Illustrative comparison between previous CNN- based methods and our EquiPocket. and ligands (i.e. small molecules or other proteins) [34]. The places where such interactions occur are known as the binding sites/pockets of the ligands on the target protein structures, which are essential to determine whether or not the ligands are druggable and func- tionally relevant. Moreover, the knowledge of the binding site is able to facilitate many downstream tasks, such as docking [50], the design of drug molecules [47], etc. Therefore, predicting the binding sites of the target proteins via in-silico algorithms forms an indispensable and even the first step in drug discovery. Through the past years, plenty of computational methods have been proposed to detect binding sites, which can be roughly clas- sified into three categories [30]: the geometry-based [4, 9, 13, 27, 28, 48], the probe-energy-based [10, 25, 26, 32] and the template- based [3, 44]. The computational methods exploit hand-crafted algorithmic procedures guided by domain knowledge or external templates, leading to insufficient expressivity in representing com- plicated proteins. Recently, with the accumulation of labeled data and the development of machine learning techniques, the learning- based approaches have been developed [24], which manage to ana- lyze and extract the underlying patterns of the input data that even- tually align with the assign labels through the iterative process of learning. Although the learning-based methods have exhibited clear superiority over the classical computational counterparts, their per- formance and flexibility are still limited by the hand-crafted input features and the insufficiently-expressive models they used [24]. More recently, motivated by the breakthrough of deep learning in a variety of fields, Convolutional Neural Networks (CNNs) have been applied successfully for the prediction of binding sites [18]. Typical works include DeepSite [17], DeepPocket [1], DeepSurf [31], etc. The CNN-based methods consider a protein as a 3D image by spatially clustering its atoms into the nearest voxels, and then model Local GeometryChemical InfoProtein AtomSurface PointBinding Site Conference acronym 'XX, June 03–05, 2018, Woodstock, NY Yang Zhanga,c , Wenbing Huanga∗, Zhewei Weia∗, Ye Yuanb , Zhaohan Dingc the binding site prediction as a object detection problem or a se- mantic segmentation task on 3D grids. Thanks to the multi-layer and end-to-end learning paradigm, the CNN-based methods are observed to outperform traditional learning-based approaches and generally achieve the best performance on several public bench- marks [31]. In spite of the impressive progress, existing CNN-based models still encounter several issues as below: Issue 1. Defective in leveraging regular voxels to model the proteins of irregular shape. First, a considerable number of voxels probably contain no atom since the protein atoms are unevenly distributed in space, which yields unnecessary redundancy in computation and memory. Moreover, the voxelization is usually constrained within a fixed-size space (e.g. 70Å × 70Å × 70Å ) [17, 41]. The atoms beyond this size will be directly discarded, resulting in incomplete and in- accurate modeling particularly for large proteins. Besides, although the voxelization process is able to encode certain spatial structure of the protein, it overlooks the irregular chemical interactions (i.e. the chemical bonds) between atoms and the topological structure upon that is also useful for binding site detection. Issue 2. Sensitive to rotations. To discretize the protein into 3D grids, the CNN methods fix the three bases of the coordinates be- forehand. When rotating the protein, the voxelization results could be distinct, and the predicted binding sites will change, which, however, conflicts with the fact that any rotation of the protein keeps the binding sites invariant. While it can be alleviated by the local grid [31] or augmenting training data with random rota- tions [33, 41], which yet is data-dependent and unable to guarantee rotation invariance in theory. Issue 3. Insufficient to characterize the geometry of the protein surface. The surface atoms comprise the major part of the binding pocket, which should be elaborately modeled. In the CNN-based methods, the surface atoms are located in the voxels that are sur- rounded by empty voxels, which somehow encodes the surface geometry. Nevertheless, such information is coarse to depict how the surface atoms interact and what their local geometry is. Indeed, the description of the surface atoms is purely driven by the geo- metric shape of the solvent-accessible surface of the protein [35] (Figure 1(b)), which, unfortunately, is less explored in current works. Issue 4. Unaware of data distribution shift. In practical scenarios, the size of the proteins varies greatly across different datasets. It requires the deep learning model we apply to be well generalizable and adaptive, so that it is able to overcome the distribution shift incurred by the variable protein size. However, this point is not seriously discussed previously. In this paper, to address the above issues, we propose to apply Graph Neural Networks (GNNs) [5, 19, 39] instead of CNNs to represent proteins. By considering atoms as nodes, interactions as edges, GNNs are able to encode the irregular protein structures by multi-layer message passing. More importantly, a recent line of researches [12, 14, 39] has enhanced GNNs by encapsulating E(3) equivariance/invariance with respect to translations/rotations; in this way, equivariant GNNs yield outputs that are independent of the choice of the coordinate systems, leading to improved general- ization ability. That being said, trivially applying equivariant GNNs for the binding site prediction task is still incapable of providing desirable performance, and even achieves worse accuracy than the CNN-based counterparts. By looking into the design of the archi- tecture, equivariant GNNs naturally cope with the first two issues as mentioned above, yet leave the other two unsolved. To this end, we make the contributions as follows: • To the best of our knowledge, we are the first to apply an E(3)- equivariant GNN for ligand binding site prediction, which is dubbed EquiPocket. In contrast to conventional CNN-based methods, EquiPocket is free of the voxelization process, able to model irregular protein structures by nature, and insen- sitive to any Euclidean transformation, thereby addressing Issue 1 and 2. • EquiPocket consists of three modules: the first one to extract local geometric information for each surface atom with the help of solvent-accessible surface [35], the second one to model both the chemical and spatial structure of the protein, and the last one to capture the comprehensive geometry of the surface via equivariant message passing over the surface atoms. The first and last module are proposed to tackle Issue 3, while the second module attempts to involve both the chemical and spatial interactions, as presented in Issue 1. • To resolve Issue 4, namely, alleviating the effect by data dis- tribution shift, we further propose a novel output layer called dense attention output layer in Equipocket, which enables us to adaptively balance the scope of the receptive field for each atom in accordance to the density distribution of the neighbor atoms. • Extensive experiments on serveral representative bench- marks demonstrate the superiority of our framework to the state-of-the-art methods in prediction accuracy. The design of our model is sufficiently ablated as well. 2 RELATED WORK 2.1 Binding Site Prediction Computational Methods. The computational methods for bind- ing site prediction include geometry-based [4, 9, 13, 27, 28, 48], probe- and energy-based [25, 26, 32] and template-based [3, 44] methods: 1) Since most ligand binding sites occur on the 3D struc- ture, geometry-based methods (POCKET [28], CriticalFinder [9], LigSite [13], Fpocket [27], etc. ) are designed to identify these hol- low spaces and then rank them using the expert design geometric features. 2) Probe-based methods (SURFNET [25], Q-SiteFinder [26], etc. [10]), also known as energy-based methods, calculate the en- ergy resulting from the interaction between protein atoms and a small-molecule probe, whose value dictates the existence of bind- ing sites. 3)Template-based methods (FINDSITE [3], LIBRA [44], etc.) are mainly to compare the required query protein with the published protein structure database to identify the binding sites. Traditional Learning-based Methods. PRANK [23] is a learning- based method that employs the traditional machine learning algo- rithm random forest(RF) [2]. Based on the pocket points and chem- ical properties from Fpocket [27] and Concavity [4], this method measures the "ligandibility" as the binding ability of a candidate pocket using the RF model. However, those methods require the manual extraction of numerous features with limit upgrading. CNN-based Methods. Over the last few years, deep learning has surpassed far more traditional ML methods in many domains. EquiPocket: an E(3)-Equivariant Geometric Graph Neural Network for Ligand Binding Site Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY Figure 2: An illustration of the scheme of our EquiPocket framework. For binding site prediction task, many researchers [1, 17, 18, 31, 41] regard a protein as a 3D image, and model this task as a computer vi- sion problem. DeepSite [17] is the first attempt to employ the CNN architecture for binding site prediction, which like P2Rank [24] treats this task as a binary classification problem and converts a protein to 3D voxelized grids. The methods FRSite [16] and Kalas- anty [41] adhere to the principle of deepsite, but the former regards this task as an object detection problem, and the latter regards this task as a semantic segmentation task. Deeppocket [1] is a method similar to p2rank, but implements a CNN-based segmenta- tion model as the scoring function in order to more precisely locate the the binding sites. The recent CNN-based method DeepSurf [31] constructs a local 3D grid and updates the 3D-CNN architecture to mitigate the detrimental effects of protein rotation. 2.2 Graph Neural Networks for Molecule Modeling There are multi-level information in molecules including atom info, chemical bonds, spatial structure, physical constraints, etc. Numerous researchers view molecules as topological structures and apply topological-based GNN models (like graph2vec [11], GAT [45], GCN [19], GCN2 [5], GIN [49] and etc. [42]) to extract the chemical info, which achieve positive outcomes. With the accu- mulation of structure data for molecules, spatial-based graph mod- els (DimeNet [22] , DimeNet++ [21], SphereNet [29], SchNet [40], Egnn [39], [14], [12] and etc.) are proposed for molecule task which aggregates spatial and topological information. However, these models may not be adequate for macro-molecules due to their high calculation and resource requirements. 3 NOTATIONS AND DEFINITIONS Protein Graph. A protein such as the example in Figure 1(b) is denoted as a graph GP = (VP , EC, ED ), where VP = {v0, ..., vN } forms the set of N atoms, EC represents the chemical-bond edges, and ED collects the spatial edges between any two atoms if their spatial distance is less than a cutoff θ > 0. In particular, each node (i.e. atom) is associated with a feature (xi, ci ), where xi ∈ R3 denotes the 3D coordinates and ci ∈ R5 is the chemical feature. Surface Point Set. The surface geometry of a protein is of crucial interest for binding site detection. Here we define the set of surface points, by S = {s0, ..., sM }, M ≫ N . Each surface point si is NOT necessarily an atom of the protein, and it corresponds to (xi, pi ), where xi ∈ R3 represents the 3D coordinates of si and pi ∈ VP indicates the index of the nearest protein atom in VP to si . We employ the open source MSMS [37] to derive surface points. Protein Surface Graph. By referring to the surface points defined above, we collect all the nearest protein atoms pi of the surface points, giving rise to the surface graph GS = (VS, ES ), and clearly GS ⊆ GP . We call the atoms in the surface graph as surface atoms, which are distinguished from surface points defined in the last para- graph. Notably, the edges of the surface graph, i.e. , ES is only composed of spatial edges from ED , since those chemical edges are mostly broken among the extracted atoms. Equivariance and Invariance. In 3D space, the symmetry of the physical laws requires the detection model to be equivariant with re- spect to arbitrary coordinate systems [12]. In form, suppose X to be 3D geometric vectors (positions, velocities, etc) that are steerable by E(3) group (rotations/translations/reflections), and h non-steerable Get Surface Point Geometric Aggregate->Surface AtomSpatial Graph ModelTopological Graph Model(b) Global Structure Modeling(a)Local Geometric ModelingProtein AtomSurface PointCluster Surface Point to Atomconcat( ) ......Embedding Dense Attention OutputFilter Atom in SurfacePredict Binding SitesPredict Relative Direction Surface AtomTaskSurface-Egnn LayerSurface-Egnn LayerPosition (c)Surface Message PassingProtein Graph Surface Points Ligand AtomsRelative Direction of Nearest Ligand Atom Conference acronym 'XX, June 03–05, 2018, Woodstock, NY Yang Zhanga,c , Wenbing Huanga∗, Zhewei Weia∗, Ye Yuanb , Zhaohan Dingc features. The function f is E(3)-equivariant, if for any transfor- mation g ∈ E(3), f (g * X, h) = g * f (X, h), ∀X ∈ R3×m, h ∈ Rd . Similarly, f is invariant if f (g * X, h) = f (X, h). The group ac- tion * is instantiated as g * X := X + b for translation b ∈ R3 and g * X (t) := OX for rotation/reflection O ∈ R3×3. Problem Statement. Given a protein GP and its surface points S, as well as the constructed surface graph GS , our goal is to learn an E(3)-invariant model f (GP , S, GS ) to predict the atoms of the binding site: VB ⊆ VP . 4 THE PROPOSED METHODOLOGY Figure 2 illustrates the overall framework of our EquiPocket, which consists of three modules: the local geometric modeling module § 4.1 that focuses on extracting the geometric information of each surface atom, the global structure modeling module § 4.2 to characterize both the chemical and spatial structures of the protein, and the surface message passing module § 4.3 which concentrates on capturing the entire surface geometry based on the extracted information by the two former modules. The training losses are also presented. We defer the pseudo codes of EquiPocket to Appendix 1. 4.1 Local Geometric Modeling Module This subsection presents how to extract the local geometric infor- mation of the protein surface GS , with the help of surface points S. The local geometry of each protein atom closely determines if the region nearby is appropriate or not to become part of binding sites. We adopt the surrounding surface points of each protein surface atom to describe the local geometry. Figure 3: An illustration of local geometric features. To be specific, for every surface atom i ∈ VS , its surrounding surface points are returned by a subset of S, namely, Si = {s j = (x j , p j ) ∈ S | p j = i}, where p j , as defined before, indicates the nearest protein atom. We now construct the geometric information based on Si . We denote the center/mean of all 3D coordinates in Si as ̄xi . For each surrounding surface point s j ∈ Si , we first search its two nearest surface points from S as s j1 , and then calculate the following relative position vectors: and s j2 , , x j j1 = x j − x j1 x j j2 = x j − x j2 x j,center = x j − ̄xi, x j,protein = x j − xi, xcenter,protein = ̄xi − xi .    (1) We further derive the following scalars upon Eq. 1: g(s j ) (cid:66) [∥x j j1 ∥2, ∥x j j2 ∥2, ∠1, ∥x j,center ∥2, ∥x j,protein ∥2, ∥xprotein,center ∥2, ∠2], (2) x j j1 *x j j2 ∥x j j1 ∥2 ∥x j j2 ∥2 where the angels are computed by ∠1 = and ∠2 = x j,center *xcenter,protein ; here the operator * defines the inner-product ∥x j,center ∥2 ∥xcenter,protein ∥2 between two vectors. Basically, as displayed in Figure 3, the first three quantities in g(s j ) depict how the nearby surface points are arranged around s j , and the last four ones describe where s j is located within the global region of Si . We aggregate the geometric information g(s j ) over all surface points in Si and obtain a readout descriptor for surface atom i as gi =[Pooling({MLP(g(s j ))}s j ∈Si ), (3) MLP(Pooling{(g(s j ))}s j ∈Si )] Here, MLP denotes multi-layer perceptron, and the function Pooling is implemented as a concatenation of mean pooling and max pooling throughout our experiments. The front part in Eq. 3 is used to gather local geometric features, while the latter part attempts to compute the global size of surrounding surface points. Notably, the geometric descriptor gi is E(3)-invariant. 4.2 Global Structure Modeling Module This module aims at processing the information of the whole pro- tein GP , including atom type, chemical bonds, relevant spatial po- sitions, etc. Although the binding pocket is majorly comprised of surface atoms, the global structure of the protein in general in- fluences how the ligand is interacted with and how the pocket is formulated, which should be modeled. We fulfil this purpose via two concatenated processes: chemical-graph modeling and spatial- graph modeling. The chemical-graph modeling process copes with the chemical features {ci }i ∈VP and the chemical interactions EC of the protein graph. For each atom in the protein, its chemical type, the numbers of electrons around, and the chemical bonds connected to other atoms are important clues to identify the interaction between the protein and the ligand [50]. We employ typical GNNs [20, 36, 45] to distill this type of information. Formally, we proceed: {c ′ i }i ∈VP = GNN({ci }i ∈VP , EC ), (4) where c ′ i is the updated chemical feature for atom vi . While various GNNs can be used in Eq. 4, here we implement GAT [45] given its desirable performance observed in our experiments. The spatial-graph modeling process further involves the 3D to better depict the spatial interactions ED coordinates {xi }i ∈VP within the protein. Different from chemical features c ′ i , the 3D coordinates provide the spatial position of each atom and reflect the pair-wise distances in 3D space, which is helpful for physical interaction modeling. We leverage EGNN [39] as it conforms to E(3) equivariance/invariance and achieves promising performance on modeling spatial graphs. Specifically, we process EGNN as follows: {c ′′ i }i ∈VP = EGNN({xi, c ′ Here, we only reserve the invariant output (i.e. , c ′′ i ) and have discarded the equivariant output (e.g. updated 3D coordinates) of EGNN, since the goal of this module is to provide invariant features. i }i ∈VP , ED ). (5) Surface AtomSurface PointSurface Center EquiPocket: an E(3)-Equivariant Geometric Graph Neural Network for Ligand Binding Site Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY We select the updated features of the surface atoms VS , which will be fed into the module in § 4.3. 4.3 Surface Message Passing Module. from § 4.1, and the Given the local geometric features {gi }i ∈VS globally-encoded features of the surface atoms {c ′′ from § 4.2, the module in this subsection carries out equivariant message pass- ing on the surface graph GS to renew the entire features of the protein surface. We mainly focus on the surface atoms here, be- cause firstly the surface atoms are more relevant to the binding sites than the interior atoms, and secondly the features {c ′′ that are considered as the input have somehow encoded the information of the interior structure via the processes in 4.2. i }i ∈VS i }i ∈VS Surface-EGNN. During the l-th layer message passing, each ∈ Rml and an ∈ R3×2. We first concate- node is associated with an invariant feature h equivariant double-channel matrix X nate c ′′ (l) i (l) i i with gi as the initial invariant feature: (0) i i , gi ]. = [c ′′ h The equivariant matrix X is initialized by the 3D coordinates of the atom and the center of its surrounding surface points, that is, (0) i (7) (8) (9) (0) i X = [xi, ̄xi ]. (l) i (l) i ∈ Rdl and X ∈ R3×2 synchronously to un- We update h veil both the topological and geometrical patterns. Inspired from EGNN [39] and its multi-channel version GMN [14], we formulate the l-th layer for each surface atom i ∈ VS as: (cid:17) (cid:16) , fx (X (l) i (l) j ), ei j , (l) i h (l) , h j , ∑︁ mi j = φm (l+1) i h = φh (cid:16) (l) i h (l+1) i X = X (l) i + j ∈N(i) ∑︁ 1 |N(i)| , X (cid:17) , mi j (l) i − x (l) j (x )φx (mi j ), (10) j ∈N (i) where the functions φm, φh, φx are all MLPs, N(i) denotes the neigh- bors of node i in terms of the spatial edges Ed , | * | counts the size of the input set, and the invariant message mi j from node j to i is employed to update the invariant feature h via φh and the equi- (l+1) variant matrix X via the aggregation of the relative position i (l) (l) j multiplied with φx . i − x x As a core operator in the message passing above, the function (l+1) i fx (Xi, X j ) is defined as follows: fx (Xi, X j ) (cid:66) [∥xi j ∥2, ∥xci ∥2, ∥xc j ∥2, ∠ci,i j , ∠c j,i j , ∠ci,c j ], (11) where, the relative positions are given by xi j = xi −x j , xci = ̄xi −xi and xc j = ̄x j − x j ; the angles ∠ci,i j , ∠c j,i j , ∠ci,c j are defined as the inner-products of the corresponding vectors denoted in the sub- scripts, e.g. , ∠ci,i j = . Through the design in Eq. 11, fx (Xi, X j ) elaborates the critical information (including relative distances and angles) around the four points: xi, ̄xi, x j , ̄x j , which largely characterizes the geometrical interaction between the two input matrices. Nicely, fx (Xi, X j ) is invariant, ensuring the equiv- ariance of the proposed Surface-EGNN. xci *xi j ∥xci ∥2 ∥xi j ∥2 Dense Attention Output Layer. Conventionally, we can apply (L) ) to estimate the binding i the output of the final layer, i.e. , (h (L) i , X Figure 4: An illustration of Dense Attention in a Protein. (6) site. Nevertheless, such flat output overlooks the discrepancy of size and shape between different proteins. As showed in Figure 5(b), for small or densely-connected proteins, the receptive field of each node will easily cover most nodes after a small number of message- passing layers, and excessive message passing will lead to over- smoothing [15] that will incurs performance detriment. For large or sparsely-connected proteins, on the contrary, insufficient message passing can hardly attain the receptive field with a desirable scope, which will also decrease the performance. It thus requires us to develop an adaptive mechanism to balance the message passing scope between different proteins. We propose the dense attention output layer to achieve this goal. Intuitively, for each target atom, the spatial distribution of the neighbors is able to reflect the density of the spatial connections around. This motivates us to calculate the proportion of the atoms with different distance ranges. As θ is the cutoff to create the spatial graph, we use it as the distance unit. We compute by: |{ j ∈ VP | 0 ≤ ∥xi − x j ∥2 < lθ }| NP n (l) i = (12) , where, the proportion is evaluated within the distance range [0, lθ ], NP = |VP |, and the neighbor hop l ∈ Z+. We collect the pro- portions of all hops from 0 to L, yielding the proportion vector ni = [n (0) , NP ] ∈ RL+2 with NP plus to emphasize the total number of the protein atoms. Clearly, ni contains rich information of the spatial density, and we apply it to determine the importance of different layers, by producing the attention as: , * * * , n (L) , n (1) i i i (13) ai = Sigmoid(φa (ni )). Here, φa is an MLP with the number of output channels as L + 1, the Sigmoid function1 is applied for each channel, implying that ai ∈ (0, 1)L+1. We then multiply the hidden feature of the corresponding layer with each channel of the attention vector, and concatenate them into a vector: out i = Concat(ai0h , ..., aiLh (14) ), h (L) i (0) i 1Note that the sum of all channels of ai is unnecessarily equal to 1, since the Sigmoid function instead of the previously-used SoftMax function is applied here. .........Surface PointsProtein AtomMLPConcatSigmoidAttention Conference acronym 'XX, June 03–05, 2018, Woodstock, NY Yang Zhanga,c , Wenbing Huanga∗, Zhewei Weia∗, Ye Yuanb , Zhaohan Dingc where ail is the l-th channel of ai . By making use of Eq. 14, the learnable attentions enable the model to adaptively balance the importance of different layers for different input proteins. We will illustrate the benefit of the proposed strategy in our experiments. As for the coordinates, we simply compute the mean of all layers to retain translation equivariance: DataSet scPDB COACH420 HOLO4k PDBbind Table 1: Summary of Dataset Average Atom Num Atom in Surface Surface Points Target Atoms 4205 2123 3845 3104 2317 1217 2052 1677 24010 12325 20023 17357 47 58 106 37 out i X = 1 L + 1 L ∑︁ l=0 (l) i . X (15) 4.4 Optimization Objective We set yi = 1 if a surface atom i is within 4Å to any ligand atom [31] . We predict the probability ^yi of being a part of binding site according its dense embedding hi . ^yi = Sigmoid(MLP(h out i )). Following [17, 18], Dice loss is used: Lb = 1 − 2 * (cid:205)(^yi * yi ) (cid:205)(^yi ) + (cid:205)(yi ) + ε , where ε > 0 is a small value to maintain numeric stability. (16) (17) Predict the relative direction of nearest ligand atom. Be- yond the CNN-based methods, our EquiPocket is an E(3)-equivariant but also the model, which can not only output the embedding h coordinate matrix X (with initial position vector xi ). We further leverage the position vector to predict the relative direction di of its nearest ligand atom (with position vector mi ), in order to enhance our framework to gather local geometric features. out i out i di = mi − xi ∥mi − xi ∥2 , ^di = out i − xi x out i − xi ∥2 ∥x . The cosine loss function is used for the direction loss Ld : ∑︁ Ld = (1 − cos( ^di, di )). (18) (19) The eventual loss is L = Lb + Ld . We train the parameters of all the three modules end to end. 5 EXPERIMENTS In this section, we will conduct experiments on multiple datasets to evaluate the performance of our framework in comparison to baseline methods and investigate the following tasks: • Task 1. Can our framework's performance match or surpass that of existing methods? • Task 2. Can different modules of our framework bring significant improvement for binding site prediction? • Task 3. Can our framework mitigate the detrimental effects of the data distribution shift? • Task 4. How do the hyperparameters (the cutoff θ and depth of surface-egnn) affect the performance and computational cost? 5.1 Experimental Settings 5.1.1 Dataset. We conduct experiments based on the following datasets: • scPDB [8] is the famous dataset for binding site prediction, which contains the protein structure, ligand structure, and 3D cavity structure generated by VolSite [7]. The 2017 release of scPDB is used for training and cross-validation of our (a) (b) Figure 5: The protein distribution of datasets and spatial dis- tribution of atom neighbors framework, which contains 17,594 structures, 16,034 entries, 4,782 proteins, and 6,326 ligands. • PDBbind [46] is a well-known and commonly used dataset for the research of protein-ligand complex. It contains the 3D structures of proteins, ligands, binding sites, and accurate binding affinity results determined in the laboratory. We use the release of v2020, which consists of two parts: general set (14, 127 complexes) and refined set (5,316 complexes). The general set contains all protein-ligand complexes. The refined set contains better-quality compounds selected from the general set, which is used for the test in our experiments. • COACH 420 and HOLO4K are two test datasets for the binding site prediction, which are first introduced by [24]. Consistent with [1, 24, 31], we use the mlig subsets of each dataset for evaluation, which contain the relevant ligands for binding site prediction. Data Distribution Shift. As depicted in the Figure 5(a) and Table 1 that after data processing, there is a significant gap in protein size and protein distribution between the training dataset (scPDB) and the test dataset (COACH420, HOLO4k, PDBbind). The number of atoms within a protein ranges from hundreds to tens of thousands. As for protein distribution in datasets, scPDB has the longest average structure, followed by HOLO4k and PDBbind, with COACH420 having the shortest average protein structure. This fact will hurt model learning and generalization, as discussed in § 5.2.3. 5.1.2 Target of Binding Sites. The CNN-based methods [1, 17, 41] label the subgrid as positive if its geometric center is closer than 4Å to the binding sites geometric center. In our experiment, consistent with [31], we set the protein atoms within 4Å of any ligand atom as positive and negative otherwise. After obtaining the probability that an atom is a candidate binding site, we use the mean-shift algorithm [6] to predict the binding site center, which can determine the number of clusters on its own (details in Appendix A.2.4). 5.1.3 Data Preparation. We perform the following four processing steps: i) Cluster the structures in scPDB by their Uniprot IDs, and EquiPocket: an E(3)-Equivariant Geometric Graph Neural Network for Ligand Binding Site Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY Table 2: Experimental and ablation results of baseline models and our framework.a Methods Type Fpocketb DeepSiteb Kalasantyb DeepSurfb GAT GCN GAT + GCN GCN2 SchNet Egnn Geometric-based 3D-CNN Topological Graph Spatial Graph Param Failure COACH420 HOLO4K PDBbind2020 (M) \ 1.00 70.64 33.06 0.03 0.06 0.08 0.11 0.49 0.41 Rate ↓ 0.000 \ 0.120 0.054 0.11 0.163 0.31 0.466 0.14 0.270 DCC↑ 0.228 \ 0.335 0.386 DCA↑ 0.444 0.564 0.636 0.658 DCC↑ 0.192 \ 0.244 0.289 DCA↑ 0.457 0.456 0.515 0.635 DCC↑ 0.253 \ 0.416 0.510 DCA↑ 0.371 \ 0.625 0.708 0.039(0.005) 0.049(0.001) 0.036(0.009) 0.042(0.098) 0.130(0.009) 0.139(0.010) 0.131(0.021) 0.131(0.017) 0.036(0.003) 0.044(0.003) 0.042(0.003) 0.051(0.004) 0.110(0.010) 0.174(0.003) 0.152(0.020) 0.163(0.008) 0.032(0.001) 0.018(0.001) 0.022(0.008) 0.023(0.007) 0.088(0.011) 0.070(0.002) 0.074(0.007) 0.089(0.013) 0.168(0.019) 0.156(0.017) 0.444(0.020) 0.361(0.020) 0.192(0.005) 0.127(0.005) 0.501(0.004) 0.406(0.004) 0.263(0.003) 0.143(0.007) 0.457(0.004) 0.302(0.006) EquiPocket-L EquiPocket-G EquiPocket-LG EquiPocket 0.070(0.009) 0.159(0.016) 0.212(0.016) 0.423(0.014) a The standard deviation of each index is indicated in brackets. The result of 5-fold for EquiPocket is shown in Appendix A.2.5. b We use their published pre-train models or published result, details in Appendix A.2.3. 0.138(0.006) 0.411(0.005) 0.502(0.008) 0.662(0.007) 0.044(0.004) 0.129(0.005) 0.183(0.004) 0.337(0.006) 0.171(0.008) 0.373(0.021) 0.443(0.011) 0.656(0.007) 0.552 0.292 0.220 0.051 0.051(0.003) 0.145(0.007) 0.274(0.004) 0.545(0.010) 0.15 0.42 0.50 1.70 Ours 0.132(0.009) 0.311(0.007) 0.462(0.005) 0.721(0.004) select the longest sequenced protein structures from every cluster as the train data [18]. Finally, 5,372 structures are selected out. ii) Split proteins and ligands for the structures in COACH420 and HOLO4k, according to the research [24] . iii) Clean protein by removing the solvent, hydrogens atoms. Using MSMS [37] to generate the solvent-accessible surface of a protein. iv) Read the protein file by RDKIT [43], and extract the atom and chemical bond features. Remove the error structures. 5.1.4 Evaluation Metrics. DCC is the distance between the pre- dicted binding site center and the true binding site center. DCA is the shortest distance between the predicted binding site center and any atom of the ligand. The samples with DCC(DCA) less than the threshold are considered successful. The samples without any bind- ing site center are considered failures. Consistent with [1, 17, 31, 41], threshold is set to 4 Å. We use Success Rate and Failure Rate to evaluate experimental performance. Success Rate(DCC) = Success Rate(DCA) = 1({Predicted sites|DCC < threshold}) 1({True sites}) 1({Predicted sites|DCA < threshold}) 1({True sites}) Failure Rate = 1({Protein|1(predicted binding center) = 0}) 1({Protein}) (20) where 1(*) represents the cardinality of a set. After ranking the predicted binding sites, we take the same number with the true binding sites to calculate the success rate. , , , 5.1.5 EquiPocket Framework. We implement our EquiPocket frame- work based on (GAT [45]+EGNN [39]) as our global structure mod- eling module. The cutoff θ and depth in our surface-egnn model are set to 6 and 4 . To indicate the EquiPocket Framework with different modules, we adopt the following symbol as follows: i) EquiPocket-L: Only contain the local geometric modeling module. ii) EquiPocket-G: Only contain the global structure modeling module. iii) EquiPocket- LG: Only contain both the local geometric and global structure modeling modules. iii) EquiPocket: Contain all the modules. 5.1.6 Baseline Models. We compare our framework with the fol- lowing models: 1) geometric-based method(Fpocket [27]), 2) CNN- based methods (DeepSite [17], Kalasanty [41] and DeepSurf [31]), 3) topological graph-based models (GAT [45], GCN [19] and GCN2 [5]), 4) spatial graph-based models (SchNet [40], EGNN [38]). 5.1.7 Environment and Parameter. We implement our EquiPocket framework in PyTorch Geometric, all the experiments are con- ducted on a machine with an NVIDIA A100 GPU (80GB memory). We take 5-fold cross validation on training data scPDB and use valid loss to save checkpoint. The batch size is set to 8. For baseline mod- els and models in global structure modeling module of EquiPocket, we use them suggested settings to get optimal performance. More details and related resources for our experiments can be found in Appendix A.2.2. 5.2 Result analysis 5.2.1 Model Comparison. In Table 2, we compared our EquiPocket framework with baseline methods mentioned above. As can be ob- served, the performance of the computational method Fpocket is inferior, with no failure rate, since it simply employs the geometric feature of a protein. The performance of CNN-based methods is much superior to that of the conventional method, with DCC and DCA metrics improving by more than 50 percent but requiring enor- mous parameter values and computing resources. However, these two early methods DeepSite and Kalasanty are hampered by data distribution shift (Issue 4) and their inability to process big proteins, which may fail prediction. The recently proposed method Deep- surf employs the local-grid concept to handle any size of proteins, although CNN architecture also still results in inevitable failures. For graph models, the poor performance of topological-graph models (GCN, GAT, GCN2) is primarily due to the fact that they only Conference acronym 'XX, June 03–05, 2018, Woodstock, NY Yang Zhanga,c , Wenbing Huanga∗, Zhewei Weia∗, Ye Yuanb , Zhaohan Dingc consider atom attributes and chemical bond information, ignoring the spatial structure in a protein. The performance of spatial-graph models is generally better than that of topological-graph models. EGNN model utilizes not only the properties of atoms but also their relative and absolute spatial positions, resulting in a better effect. SchNet merely updates the information of atoms based on the rela- tive distance of atoms. We attempt to execute the Dimenet++ [21], which uses the angle info between atoms and atoms, but it requires too many computing resources, resulting in an OOM (Out Of Mem- ory) error. However, the performance of the spatial-graph model is worse than that of the CNN-based and geometric-based methods because the former cannot obtain enough geometric features (Issue 3) and cannot address the data distribution shift (Issue 4). As the above results indicate, geometric info of protein surface and multi-level structure info in a protein is essential for binding site prediction. In addition, it reflects the limitations of the current GNN models, where it is difficult to collect sufficient geometric information from the protein surface or the calculation resources are too large to apply to macromolecular systems like proteins. Consequently, our EquiPocket framework is not only able to up- date chemical and spatial information from an atomic perspective but also able to effectively collect geometric information without excessive computing expense, resulting in a 10-20% increase in ef- fect over previous results. Case study based on different methods is showed in Appendix 5.2.5. 5.2.2 Ablation Study. As shown in Table 2, we conduct ablation experiments on our EquiPocket framework with different modules. Local Geometric Modeling Module. This module is used to extract the geometric features of protein atoms from their nearest surface points. EquiPocket-G consists solely of this module, and the performance is negligible. There are two primary causes for this result. First, geometric information can only determine part of the binding sites. Second, it can only reflect the geometric features over a relatively small distance and cannot cover an expansive area. Global Structure Modeling Module. The primary purpose of this module is to extract information about the whole protein, such as atom type, chemical bonds, relevant spatial positions, etc. We implement EquiPocket-G based on (GAT + EGNN) models, which is E(3) equivariance/invariance and has a better effect than its predecessor, EquiPocket-L. In comparison, the value of DCC increased by about 10%, and DCA increased by about 20%. This demonstrates that structure information of the whole protein is necessary for binding site prediction. In addition, when the two modules are combined as the EquiPocket-LG, the prediction effect is significantly improved, proving the complementarity of surface geometric information and global structure information. Surface Message Passing Module. In the previous model, EquiPocket- LG, information was extracted solely from atoms and their closest surface points. Nonetheless, the binding site is determined not only by the information of a single atom but also by the atoms surround- ing it. Therefore, the surface message passing module is proposed to collect and update the atom's features from its neighbors. After adding this module, the performance of EquiPocket has been signif- icantly enhanced, DCC and DCA have increased by approximately 20% on average, and the failure rate has been significantly reduced. Through the addition of multiple modules, we address the Issue 3 Figure 6: The performance of EquiPocket and baseline meth- ods for proteins of various sizes. and the performance of our framework eventually surpasses that of the existing SOTA method, demonstrating the efficacy of our framework design. 5.2.3 Data Distribution Shift. As shown in Figure 6, we calcu- late the average DCC with the distribution of various sizes proteins. The geometric-based method Fpocket only utilizes the geometric features of a protein surface. Therefore, its performance is superior to that of most other methods for proteins with fewer than 1,000 atoms, but its prediction effect decreases significantly as the size of the protein increases. Kalasanty is a CNN-based and learn-based method. As the number of atoms in the protein varies, the pre- diction effect exhibits an increasing and then a decreasing trend, which is not only influenced by the size of the protein but also has a significant correlation with the dataset's distribution. According to the train data (scPDB), the majority of proteins contain fewer than 2,000 protein atoms (as depicted in Figure 5(a)). Consequently, the model's parameters will be biased toward this protein size. In addition, for proteins with more than 8000 atoms, the prediction effect is not even as good as the geometric-based method. This is due to the fact that CNN methods typically restrict the protein space to 70Å * 70Å * 70Å, and for proteins larger than this size, the prediction frequently fails. For our EquiPocket framework, we do not need to cut the protein into grids, and we utilize both geometric information from the surface points and global structure informa- tion from the whole protein, so the performance for proteins of varying sizes is significantly superior to that of other methods. Dense Attention. The Dense Attention is introduced in § 4.3 to reduce the negative impact caused by the data distribution shift (Is- sue 4). As shown in 6, when the number of atoms contained in a protein is less than 3000, the result of the EquiPocket (w/o Dense Attention) is weaker than that of the original EquiPocket, whereas when the protein is larger, there is no significant distinction be- tween the two models. It simply reflects the role of Dense Attention, which, by weighting the surface-egnn layer at different depths, mit- igates the detrimental effect of the data distribution shift. Direction Loss. Direction loss is a novel task designed to im- prove the extraction of local geometric features. The result of the EquiPocket (w/o Direction Loss) in Figure 6 demonstrates conclu- sively that the prediction performance of small proteins with fewer than 3,000 atoms is diminished in the absence of this task, which reveals the importance of the task. EquiPocket: an E(3)-Equivariant Geometric Graph Neural Network for Ligand Binding Site Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY (a) (b) Figure 7: The influence of cutoff θ and depth for experiment 5.2.4 Hyperparameters Analysis. In our EquiPocket framework, the cutoff θ and depth of surface-egnn are two crucial parameters that can impact performance and computational efficiency. Cutoff θ . We set the depth of surface-egnn to 4 and implement various cutoff values (2, 4, 6, 8, 10). Figure 7(a) indicates that when the cutoff is set to 2, the average DCC of our framework is poor, and GPU memory consumption is relatively low (22GB). This is due to the fact that when the cutoff is small, the surface-egnn can only observe a tiny receptive field. As the cutoff increases, the per- formance and GPU memory continue to rise until the DCC reaches a bottleneck when the cutoff is 10, and the GPU memory reaches 62GB. Therefore, when selecting parameters for our framework, we must strike a balance between performance and efficiency. Depth. The depth of surface-egnn has an immediate influences on the performance and computation cost. We set the cutoff to 6 and implement various depth (1, 2, 3, 4, 5, 6). Figure 7(b) demonstrates that as depth increases, performance steadily improves and becomes stable as GPU memory continues to expand. Because the prediction of binding sites is highly influenced by their surrounding atoms, therefore, an excessively large receptive field may not offer any benefits but will necessitate additional computing resources. 5.2.5 Case Study. We also display two examples of our EquiPocket and other methods in Figure 8. We take two proteins, 1f8e (with 12,268 atoms) and 5ei3 (with 1,572 atoms), from the test dataset PDBbind. As can be seen from Figure 8: The binding sites predicted by the geometry-based method Fpocket are extremely distant from the actual binding sites. This is due to the fact that this method pri- oritizes local geometric information and disregards the multi-level structure information of proteins, resulting in limited scope and weak performance. The CNN-based method Kalasanty did not pro- vide any predicted binding site for protein 1f8e. We conjecture that this method restricts the protein within a specific space size which is highly susceptible to failure with large proteins. The recently- proposed CNN-based method DeepSurf takes local grids on the protein surface, which can address the issue of fixed space size. However, the prediction of binding sites in protein 5ei3 by Deep- Surf is far from the ground truth because the CNN-based methods are defective in obtaining geometric and chemical features. Our EquiPocket framework is unaffected by the shortcomings of the aforementioned methods, allowing it to achieve superior outcomes for both large and small proteins. Figure 8: Case Study. 6 CONCLUSION In this paper, concentrating on the ligand binding site prediction, we propose a novel E(3)-Equivariant geometric graph framework called EquiPocket, which contains the local geometric modeling module, global structure modeling module, and surface passing module to gather the surface geometric and multi-level structure features in a protein. Experiments demonstrate that our framework is highly generalizable and beneficial, and achieves superior pre- diction accuracy and computational efficiency compared with the existing methods. 6.1 Future Work 6.1.1 Protein Surface. As demonstrated by our experiments, the geometric information derived from the protein surface plays a significant role in the prediction of binding sites. In this work, we use MSMS [37] to generate the protein surface , which may have an uncertain impact on the prediction results. Therefore, in the future, we will be able to establish a more efficient surface generation method or gather the geometric information of a protein without a fixed protein surface. 6.1.2 Global Structure Model. In this work, we take the exist- ing graph-based models (GAT + EGNN) to gather the multi-level structure information in a protein. However, their capabilities are limited because these models are not entirely tailored to complex structures such as proteins. In the future, we will be able to develop more effective models to gather information from proteins in order to improve the prediction performance of binding sites. 6.1.3 Computing Resources. As the experimental results show, both our EquiPocket and CNN-based methods require a significant amount of computing resources to analyze protein data, which will have a negative impact on their actual deployment. Conse- quently, when applying our method to real-world problems, it is crucial to consider how to compress algorithm parameters, increase computational efficiency, and decrease resource consumption. REFERENCES [1] Rishal Aggarwal, Akash Gupta, Vineeth Chelur, CV Jawahar, and U Deva Priyaku- mar. 2021. Deeppocket: ligand binding site detection and segmentation using 3d Conference acronym 'XX, June 03–05, 2018, Woodstock, NY Yang Zhanga,c , Wenbing Huanga∗, Zhewei Weia∗, Ye Yuanb , Zhaohan Dingc convolutional neural networks. Journal of Chemical Information and Modeling (2021). [2] Mariana Belgiu and Lucian Drăguţ. 2016. Random forest in remote sensing: A review of applications and future directions. ISPRS journal of photogrammetry and remote sensing 114 (2016), 24–31. [3] Michal Brylinski and Jeffrey Skolnick. 2008. A threading-based method (FIND- SITE) for ligand-binding site prediction and functional annotation. Proceedings of the National Academy of sciences 105, 1 (2008), 129–134. [4] Ke Chen, Marcin J Mizianty, Jianzhao Gao, and Lukasz Kurgan. 2011. A critical comparative assessment of predictions of protein-binding sites for biologically relevant organic compounds. Structure 19, 5 (2011), 613–621. [5] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. 2020. Simple and Deep Graph Convolutional Networks. arXiv:2007.02133 [cs.LG] [6] Dorin Comaniciu and Peter Meer. 2002. Mean shift: A robust approach toward fea- ture space analysis. IEEE Transactions on pattern analysis and machine intelligence 24, 5 (2002), 603–619. [7] Franck Da Silva, Jeremy Desaphy, and Didier Rognan. 2018. IChem: a versatile toolkit for detecting, comparing, and predicting protein–ligand interactions. ChemMedChem 13, 6 (2018), 507–510. [8] Jérémy Desaphy, Guillaume Bret, Didier Rognan, and Esther Kellenberger. 2015. sc-PDB: a 3D-database of ligandable binding sites-10 years on. Nucleic acids research 43, D1 (2015), D399–D404. [9] Sérgio ED Dias, Quoc T Nguyen, Joaquim A Jorge, and Abel JP Gomes. 2017. Multi- GPU-based detection of protein cavities using critical points. Future Generation Computer Systems 67 (2017), 430–440. [10] Christina E Faller, E Prabhu Raman, Alexander D MacKerell, and Olgun Guvench. 2015. Site Identification by Ligand Competitive Saturation (SILCS) simulations for fragment-based drug design. In Fragment-Based Methods in Drug Discovery. Springer, 75–87. [11] A. Gonczarek, J. M. Tomczak, S Zaręba, J. Kaczmar, P Dąbrowski, and M. J. Wal- czak. 2016. Learning Deep Architectures for Interaction Prediction in Structure- based Virtual Screening. (2016). [12] J. Han, Y. Rong, T. Xu, and W. Huang. 2022. Geometrically Equivariant Graph Neural Networks: A Survey. (2022). [13] Manfred Hendlich, Friedrich Rippmann, and Gerhard Barnickel. 1997. LIGSITE: automatic and efficient detection of potential small molecule-binding sites in proteins. Journal of Molecular Graphics and Modelling 15, 6 (1997), 359–363. [14] W. Huang, J. Han, Y. Rong, T. Xu, F. Sun, and J. Huang. 2022. Equivariant Graph Mechanics Networks with Constraints. arXiv e-prints (2022). [15] W. Huang, Y. Rong, T. Xu, F. Sun, and J. Huang. 2020. Tackling Over-Smoothing for General Graph Convolutional Networks. (2020). [16] Mingjian Jiang, Zhiqiang Wei, Shugang Zhang, Shuang Wang, Xiaofeng Wang, and Zhen Li. 2019. Frsite: protein drug binding site prediction based on faster R–CNN. Journal of Molecular Graphics and Modelling 93 (2019), 107454. [17] José Jiménez, Stefan Doerr, Gerard Martínez-Rosell, Alexander S Rose, and Gianni De Fabritiis. 2017. DeepSite: protein-binding site predictor using 3D- convolutional neural networks. Bioinformatics 33, 19 (2017), 3036–3042. [18] Jeevan Kandel, Hilal Tayara, and Kil To Chong. 2021. PUResNet: prediction of protein-ligand binding sites using deep residual neural network. Journal of cheminformatics 13, 1 (2021), 1–14. [19] T. N. Kip and M. Welling. 2016. Semi-Supervised Classification with Graph Convolutional Networks. (2016). [20] Thomas N Kipf and Max Welling. 2016. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907 (2016). [21] J. Klicpera, S. Giri, J. T. Margraf, and S Günnemann. 2020. Fast and Uncertainty- Aware Directional Message Passing for Non-Equilibrium Molecules. (2020). [22] J. Klicpera, J. Gro, and S Günnemann. 2020. Directional Message Passing for [30] Gabriele Macari, Daniele Toti, and Fabio Polticelli. 2019. Computational methods and tools for binding site recognition between proteins and small molecules: from classical geometrical approaches to modern machine learning strategies. Journal of computer-aided molecular design 33, 10 (2019), 887–903. [31] Stelios K Mylonas, Apostolos Axenopoulos, and Petros Daras. 2021. DeepSurf: a surface-based deep learning approach for the prediction of ligand binding sites on proteins. Bioinformatics 37, 12 (2021), 1681–1690. [32] Chi-Ho Ngan, David R Hall, Brandon Zerbe, Laurie E Grove, Dima Kozakov, and Sandor Vajda. 2012. FTSite: high accuracy detection of ligand binding sites on unbound protein structures. Bioinformatics 28, 2 (2012), 286–287. [33] Matthew Ragoza, Joshua Hochuli, Elisa Idrobo, Jocelyn Sunseri, and David Ryan Koes. 2017. Protein–ligand scoring with convolutional neural networks. Journal of chemical information and modeling 57, 4 (2017), 942–957. [34] HP Rang. 2006. The receptor concept: pharmacology's big idea. British journal of pharmacology 147, S1 (2006), S9–S16. [35] Timothy J Richmond. 1984. Solvent accessible surface area and excluded volume in proteins: Analytical equations for overlapping spheres and implications for the hydrophobic effect. Journal of molecular biology 178, 1 (1984), 63–89. [36] Sabrina, Jaeger, Simone, Fulle, Samo, and Turk. 2018. Mol2vec: Unsupervised Machine Learning Approach with Chemical Intuition. Journal of Chemical Information & Modeling (2018). [37] M. F. Sanner, A. J. Olson, and J. C. Spehner. 1996. Reduced SURFACE: An efficient way to compute molecular surfaces. Peptide Science 38, 3 (1996), 305–320. [38] Vıctor Garcia Satorras, Emiel Hoogeboom, and Max Welling. 2021. E (n) equi- variant graph neural networks. In International conference on machine learning. PMLR, 9323–9332. [39] V. G. Satorras, E. Hoogeboom, and M. Welling. 2021. E(n) Equivariant Graph Neural Networks. (2021). [40] Kristof T. Schütt, Pieter Jan Kindermans, Huziel E. Sauceda, Stefan Chmiela, Alexandre Tkatchenko, and Klaus-Robert Müller. 2017. SchNet: A continuous- filter convolutional neural network for modeling quantum interactions. In Ad- vances in Neural Information Processing Systems. [41] Marta M Stepniewska-Dziubinska, Piotr Zielenkiewicz, and Pawel Siedlecki. 2020. Improving detection of protein-ligand binding sites with 3D segmentation. Scientific reports 10, 1 (2020), 1–9. [42] M. Sun, S. Zhao, G. Coryandar, E. Olivier, J. Zhou, and F. Wang. 2019. Graph convolutional networks for computational drug development and discovery. Briefings in Bioinformatics (2019). [43] Paolo Tosco, Nikolaus Stiefl, and Gregory Landrum. 2014. Bringing the MMFF force field to the RDKit: implementation and validation. Journal of Cheminformatics,6,1(2014-07-12) 6, 1 (2014), 37. [44] Daniele Toti, Le Viet Hung, Valentina Tortosa, Valentina Brandi, and Fabio Polti- celli. 2018. LIBRA-WA: a web application for ligand binding site detection and protein function recognition. Bioinformatics 34, 5 (2018), 878–880. [45] Petar Velikovi, G. Cucurull, A. Casanova, A. Romero, P Lió, and Y. Bengio. 2017. Graph Attention Networks. (2017). [46] Renxiao Wang, Xueliang Fang, Yipin Lu, and Shaomeng Wang. 2004. The PDBbind database: collection of binding affinities for protein-ligand complexes with known three-dimensional structures. Journal of Medicinal Chemistry 47, 12 (2004), 2977– 80. [47] Renxiao Wang, Ying Gao, and Luhua Lai. 2000. LigBuilder: a multi-purpose program for structure-based drug design. Molecular modeling annual 6 (2000), 498–516. [48] Martin Weisel, Ewgenij Proschak, and Gisbert Schneider. 2007. PocketPicker: analysis of ligand binding-sites with shape descriptors. Chemistry Central Journal 1, 1 (2007), 1–17. [49] K. Xu, W. Hu, J. Leskovec, and S. Jegelka. 2018. How Powerful are Graph Neural Molecular Graphs. (2020). Networks? (2018). [50] Yang Zhang, Gengmo Zhou, Zhewei Wei, and Hongteng Xu. 2022. Predicting Protein-Ligand Binding Affinity via Joint Global-Local Interaction Modeling. arXiv preprint arXiv:2209.13014 (2022). [23] Radoslav Krivák and David Hoksza. 2015. Improving protein-ligand binding site prediction accuracy by classification of inner pocket points using local features. Journal of cheminformatics 7, 1 (2015), 1–13. [24] Radoslav Krivák and David Hoksza. 2018. P2Rank: machine learning based tool for rapid and accurate prediction of ligand binding sites from protein structure. Journal of cheminformatics 10, 1 (2018), 1–12. [25] Roman A Laskowski. 1995. SURFNET: a program for visualizing molecular surfaces, cavities, and intermolecular interactions. Journal of molecular graphics 13, 5 (1995), 323–330. [26] Alasdair TR Laurie and Richard M Jackson. 2005. Q-SiteFinder: an energy-based method for the prediction of protein–ligand binding sites. Bioinformatics 21, 9 (2005), 1908–1916. [27] Vincent Le Guilloux, Peter Schmidtke, and Pierre Tuffery. 2009. Fpocket: an open source platform for ligand pocket detection. BMC bioinformatics 10, 1 (2009), 1–11. [28] David G Levitt and Leonard J Banaszak. 1992. POCKET: a computer graphies method for identifying and displaying protein cavities and their surrounding amino acids. Journal of molecular graphics 10, 4 (1992), 229–234. [29] Yi Liu, Limei Wang, Meng Liu, Xuan Zhang, Bora Oztekin, and Shuiwang Ji. 2021. Spherical Message Passing for 3D Graph Networks. arXiv:2102.05013 [cs.LG] EquiPocket: an E(3)-Equivariant Geometric Graph Neural Network for Ligand Binding Site Prediction Conference acronym 'XX, June 03–05, 2018, Woodstock, NY A APPENDIX A.1 The pseudo-code of our EquiPocket framework Algorithm 1: EquiPocket Input: Protein structure GP Output: Candidate Binding sites and their ligandability score 1: Clean Structure by removing solvent, hydrogens atoms 2: Create the solvent accessible surface of the protein S use MSMS Get its closed protein atom pi 3: for every si in S do 4: 5: end for 6: Get the surface atom VS according to the surface points's closed protein atom ′′ 7: for every surface atom i ∈ VS do 8: Get their surrounding surface points set Si Get the geometric embedding gi i of the protein 9: 10: end for 11: Get the global structure embedding c 12: for every surface atom i ∈ VS do (0) Get its invariant feature h 13: i position matrix X = [xi, ̄xi ] (l) Get the updated embedding h i X Get the dense embedding hi and position Xi according to its dense attention ai predict the probability ^yi as ligandability score and the nearest ligand atom direction di based on our surface-egnn model i , gi ].] and equivariant and updated coordinates = [c ′′ (0) i (l) i 15: 14: 16: 17: end for 18: Discard protein atoms with probability less than T (T=0.5 in our experiments); 19: Cluster the remaining protein atoms; 20: Form binding sites and get the average ligandability score for each cluster; 21: Rank the predicted binding sites by their ligandability score; 22: return The candidate binding sites and ligandability score; A.2 Experiment Details A.2.1 Cross-validation. We shuffled the training data and divided the data into 5 parts, taking one of them at a time as the validation set. We use 5-fold cross-validation and report the mean and standard deviation. A.2.2 Parameter Settings. For geometric-based method Fpocket, we use its published tool. For CNN-based methods kalasanty and DeepSurf, we use their published pre-train models. For GNN-based models, the number of layers is set to 3 except GAT. For GAT, we set the number to 1. For GIN, we set the initial ε to 0 and make it trainable. For GCN2, we set the strength of the initial residual connection α to 0.5 and the strength of the identity mapping β to 1. For SchNet, EGNN, DimeNet++, SphereNet as baseline models, we set the cutoff distance to 5. For our EquiPocket, we use Adam Table 3: Sources of baseline codes and pre-train models. Methods fpocker kalasanty DeepSurf GAT GCN GCN2 SchNet DimeNet++ EGNN URL https://github.com/Discngine/fpocket https://gitlab.com/cheminfIBB/kalasanty https://github.com/stemylonas/DeepSurf https://github.com/pyg-team/pytorch_geometric https://github.com/pyg-team/pytorch_geometric https://github.com/chennnM/GCNII https://github.com/pyg-team/pytorch_geometric https://github.com/pyg-team/pytorch_geometric https://github.com/vgsatorras/egnn/ optimizer for model training with a learning rate of 0.0001 and set the batch size as 8. The basic dimensions of node and edge embeddings are both set to 128. The dropout rate is set to 0.1. The probe radius in MSMS to generate solvent-accessible surface of a protein is set to 1.5. A.2.3 Baseline Codes. The result of DeepSite comes from [31], because they did not provide a pre-train model. Table 3 describes sources of baseline codes. A.2.4 Binding sites center. The CNN-based methods [1, 17, 41] consider a protein as a 3D image, convert it to a voxel representation by discretizing it into grids and calculate the geometric center of binding site centercnn according to the grid of the cavity or ligand. They label the grid as positive if its geometric center is closer than 4Å to the binding sites geometric center. Therefore, the prediction objects of these models actually contain the grid of ligand atoms. The predicted binding site center centercnn of ^ CNN-based methods is calculated according to the positive grid. For our EquiPocket, we label the protein atoms within 4Å of any ligand atom as positive and negative otherwise. Therefore, there is a natural gap in the prediction object between our framework and CNN-based methods, which also lead to the natural gap for the center of predicted binding site. In order to reduce the metric difference caused by the different prediction objects, we get the predicted binding site center ^centerequipocket as follow: Ww use posi ∈ R3 to represent the position of protein atom vi , centeri ∈ R3 to represent the nearest surface point center, ^posL i ∈ R3 to represent the predicted position of nearest ligand atom from the protein atom vi . The ^posL is used to calculate the geometric center of binding i site. posL (cid:99) i = posi + threshold * (centeri − posi ) |centeri − posi | , (21) Where threshold4 is set to 4, because we label the protein atoms within 4Å of any ligand atom as positive and negative otherwise. A.2.5 The 5-fold results for EquiPocket. Conference acronym 'XX, June 03–05, 2018, Woodstock, NY Yang Zhanga,c , Wenbing Huanga∗, Zhewei Weia∗, Ye Yuanb , Zhaohan Dingc Table 4: The 5-fold results for EquiPocket. Methods Fold Param failure COACH420 HOLO4K PDBbind2020 EquiPocket-L EquiPocket-L EquiPocket-L EquiPocket-L EquiPocket-L EquiPocket-G EquiPocket-G EquiPocket-G EquiPocket-G EquiPocket-G EquiPocket-LG EquiPocket-LG EquiPocket-LG EquiPocket-LG EquiPocket-LG EquiPocket EquiPocket EquiPocket EquiPocket EquiPocket 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 (M) 0.15 0.15 0.15 0.15 0.15 0.42 0.42 0.42 0.42 0.42 0.50 0.50 0.50 0.50 0.50 1.70 1.70 1.70 1.70 1.70 Rate ↓ DCC↑ DCA↑ DCC↑ DCA↑ DCC↑ DCA↑ 0.598 0.557 0.571 0.462 0.472 0.305 0.291 0.295 0.278 0.292 0.235 0.207 0.203 0.224 0.231 0.054 0.053 0.041 0.051 0.053 0.083 0.064 0.074 0.059 0.072 0.135 0.175 0.145 0.169 0.152 0.225 0.220 0.184 0.215 0.213 0.423 0.431 0.443 0.411 0.407 0.160 0.165 0.177 0.173 0.180 0.330 0.385 0.357 0.367 0.367 0.442 0.460 0.440 0.448 0.431 0.656 0.660 0.664 0.646 0.654 0.038 0.046 0.045 0.042 0.048 0.122 0.128 0.121 0.127 0.133 0.183 0.189 0.180 0.186 0.179 0.341 0.329 0.336 0.338 0.345 0.128 0.138 0.139 0.138 0.146 0.400 0.405 0.407 0.406 0.411 0.498 0.509 0.510 0.500 0.492 0.665 0.668 0.660 0.668 0.652 0.049 0.055 0.052 0.052 0.049 0.142 0.145 0.145 0.133 0.151 0.273 0.280 0.269 0.275 0.272 0.558 0.538 0.550 0.532 0.546 0.124 0.142 0.122 0.129 0.143 0.302 0.302 0.305 0.292 0.308 0.463 0.468 0.459 0.465 0.456 0.715 0.725 0.724 0.723 0.719
http://arxiv.org/abs/2302.12172v4
2023-04-11T14:07:04
2023-02-23T17:13:25
UniXGen: A Unified Vision-Language Model for Multi-View Chest X-ray Generation and Report Generation
Generated synthetic data in medical research can substitute privacy and security-sensitive data with a large-scale curated dataset, reducing data collection and annotation costs. As part of this effort, we propose UniXGen, a unified chest X-ray and report generation model, with the following contributions. First, we design a unified model for bidirectional chest X-ray and report generation by adopting a vector quantization method to discretize chest X-rays into discrete visual tokens and formulating both tasks as sequence generation tasks. Second, we introduce several special tokens to generate chest X-rays with specific views that can be useful when the desired views are unavailable. Furthermore, UniXGen can flexibly take various inputs from single to multiple views to take advantage of the additional findings available in other X-ray views. We adopt an efficient transformer for computational and memory efficiency to handle the long-range input sequence of multi-view chest X-rays with high resolution and long paragraph reports. In extensive experiments, we show that our unified model has a synergistic effect on both generation tasks, as opposed to training only the task-specific models. We also find that view-specific special tokens can distinguish between different views and properly generate specific views even if they do not exist in the dataset, and utilizing multi-view chest X-rays can faithfully capture the abnormal findings in the additional X-rays. The source code is publicly available at: https://github.com/ttumyche/UniXGen.
[ "Hyungyung Lee", "Da Young Lee", "Wonjae Kim", "Jin-Hwa Kim", "Tackeun Kim", "Jihang Kim", "Leonard Sunwoo", "Edward Choi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12172v4", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12172v4", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.IV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.IV", "cs.CV", "cs.LG" ]
3 2 0 2 r p A 1 1 ] V I . s s e e [ 4 v 2 7 1 2 1 . 2 0 3 2 : v i X r a UniXGen: A Unified Vision-Language Model for Multi-View Chest X-ray Generation and Report Generation Hyungyung Lee1, Da Young Lee2∗, Wonjae Kim3, Jin-Hwa Kim3,4 Tackeun Kim5, Jihang Kim5, Leonard Sunwoo5, Edward Choi1 1 KAIST, 2 Deep-in-Sight Co., 3 Naver AI Lab, 4 SNU AIIS, 5 Seoul National University Bundang Hospital [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] Abstract Generated synthetic data in medical research can substitute privacy and security- sensitive data with a large-scale curated dataset, reducing data collection and annotation costs. As part of this effort, we propose UniXGen, a unified chest X-ray and report generation model, with the following contributions. First, we design a unified model for bidirectional chest X-ray and report generation by adopting a vector quantization method to discretize chest X-rays into discrete visual tokens and formulating both tasks as sequence generation tasks. Second, we introduce several special tokens to generate chest X-rays with specific views that can be useful when the desired views are unavailable. Furthermore, UniXGen can flexibly take various inputs from single to multiple views to take advantage of the additional findings available in other X-ray views. We adopt an efficient transformer for computational and memory efficiency to handle the long-range input sequence of multi-view chest X-rays with high resolution and long paragraph reports. In extensive experiments, we show that our unified model has a synergistic effect on both generation tasks, as opposed to training only the task-specific models. We also find that view-specific special tokens can distinguish between different views and properly generate specific views even if they do not exist in the dataset, and utilizing multi-view chest X-rays can faithfully capture the abnormal findings in the additional X-rays. The source code is publicly available at: https://github.com/ttumyche/UniXGen. 1 Introduction Patient privacy, imbalanced class distribution, the need for trained clinicians, and the lack of large publicly available datasets are chronic problems in medical research. In an effort to alleviate these problems, research on synthetic data generation has been actively explored. Among them, the combination of chest radiographs and radiology reports has made significant progress, as it provides a comprehensive examination of the patient's condition that helps diagnose and detect various diseases. In response, we propose a unified chest X-ray and radiology report generation model with multiple views, namely UniXGen, with the following improvements. First, we design a unified model for bidirectional chest X-ray and report generation. Although these tasks are bidirectional, existing works propose task-specific architectures and develop them separately. We simplify the design effort by utilizing VQ-GAN [7] as an image tokenizer. This approach allows ∗Work done at KAIST Preprint. Figure 1: Overview of UniXGen. We propose a unified chest X-ray and report generation model. UniXGen can generate view-specific X-rays of the user's choice. We also boost the generation ability with multi-view chest X-ray input. us to convert an image into a sequence of discrete tokens; thus both X-ray generation and report generation can be performed as sequence generation tasks with a unified model. Next, UniXGen can generate chest X-rays with specific views of the user's choice, such as posterior- anterior (PA), anterior-posterior (AP), and lateral views. This ability can be useful when the desired view is unavailable. In addition, it allows for generating various views, which can provide additional findings that cannot be seen in a single view and also help radiologists make more accurate diagnoses. Despite these advantages, no prior efforts have been made to control the view position in chest X-ray generation. To achieve this, we introduce a set of special tokens according to the different view positions. Lastly, we utilize multi-view chest X-rays and study their effects on the generation quality. X-rays from multiple views can provide more valuable information during generation, compared to a single view input. There are; however, no previous chest X-ray generation studies considering the relations between them. As a result, they do not take advantage of the additional findings available in other X-ray views of the same study. Meanwhile, in report generation, [40, 39] only use studies with a single frontal and a single lateral view. Therefore, their architectural design is not flexible to various input formats. In this work, we design a model that can flexibly take arbitrary input from single to multi-view images and empirically show that using multi-view images can faithfully capture abnormal findings in both chest X-ray and report generation. Specifically, we adopt Performer [4], an efficient transformer-based architecture. Although the vanilla Transformer [34] is a task-agnostic design that can perform both image and text generation tasks, the computational cost increases quadratically by the input sequence length. We adopt the Performer for computational and memory efficiency as we utilize long paragraph reports and high resolution multi-view chest X-rays, which result in long-range sequences. We evaluate our model on MIMIC-CXR [17]. The experimental results show that UniXGen achieves better performance on both standard metrics such as FID [13] and BLEU [25] and clinical efficacy metrics such as 14-diagnosis Classification and CheXpert scores with CheXpert labeler [16] over several baselines. Furthermore, human evaluation shows that UniXGen can generate realistic chest X-rays comparable to the original image, and the view-specific special tokens capture the refined features of each view, encouraging the model to generate appropriate view-specific X-rays. Our contributions can be summarized as follows: 2 1) We first propose a unified model for chest X-ray and radiology report generation in the medical domain. 2) UniXGen can generate view-specific X-rays with a set of special tokens according to the different view positions, even without the desired views. 3) We utilize multi-view chest X-rays and study their effects on chest X-ray and radiology report generation. Also, we design a flexible model that can take both single and multi-views as input. 2 Related Work Chest X-ray Generation With the growing demand to access high quality medical data and the success of generative models such as VAE [18], GANs [8], and diffusion models [10], chest X-ray generation has gained a lot of attention. [22, 42] use unconditional GANs to augment a dataset for abnormality classification. [2, 24] adopt a latent diffusion model [31] for class-conditional generation. However, these works only focus on specific diseases and do not utilize radiology reports that contain rich medical domain knowledge. Recently, [1] has taken advantage of radiology reports for conditional generation, but they only use the impression section of the reports. Furthermore, they cannot generate view-specific chest X-rays or accept multiple views as input. Radiology Report Generation Automatic report generation can relieve the heavy burden on radiologists. Most existing works adopt the CNN-RNN encoder-decoder framework based on standard image captioning approaches. Specifically, [37] integrates multi-level attention. [40, 21] adopt the hierarchical architecture, and the latter introduces reinforcement learning. [39] incorporates a hierarchical retrieval-based method. However, these task-specific architectures make it difficult to scale and generalize to other tasks. Also, they design a model for a specific input format. [37, 21] and [40, 39] only support single-view and two multi-view inputs, respectively. Recently, [23] proposed a Transformer-based architecture for various tasks, including report generation. They learn joint representations of chest X-rays and reports for report generation but do not extend their work to chest X-ray generation. In addition, they only use a subset of studies with a single frontal view. Bidirectional Image-Text Generation Traditionally, image-to-text and text-to-image generation have been developed separately with task-specific architectures in the general domain. However, with the success of the Transformer-based model in both tasks [43, 28], several works [15, 41, 14] have argued the bidirectional nature of these tasks and propose a unified model for the bidirectional image- text generation. They discretize images into discrete tokens to formulate both tasks as sequence generation tasks. [15] uses K-means clustering and [41, 14] adopt vector quantization methods [33, 7]. Efficient Transformer Transformer [34] has proven to be highly adaptable to both vision and language tasks with its task-agnostic design and generalization capabilities. However, the self- attention mechanism increases the computational and memory cost quadratically by the input sequence length. As we utilize long paragraph reports and high resolution multi-view chest X-rays, we adopt Performer [4], an efficient transformer-based model to reduce the quadratic complexity to linear. They approximate the standard transformer attention using positive orthogonal random features to kernelize the softmax operation. Image Tokenization Many efforts have been made to convert images into discrete tokens like natural language, as this provides a compact and efficient representation compared to using raw pixels. Based on the success of VQ-VAE [33], VQ-VAE-2 [30] improved VQ-VAE by introducing a multi-scale hierarchical encoder. [7] introduced VQ-GAN with a discriminator and a perceptual loss for high-resolution images. [28] proposed DALL-E to better optimize VQ-VAE with Gumbel-softmax relaxation. Recently, diffusion models have achieved promising performance in generating high- quality samples in continuous domains (e.g., image and audio) [27, 32]. However, diffusion models for text generation are still underdeveloped and have not achieved significant success compared to image generation. In addition, the models are not flexible to take arbitrary input from single to multiple images. Thus, we adopt the transformer-based auto-regressive model with VQ-GAN to generate both image and text with a unified model. 3 Figure 2: Overview of UniXGen architecture. (a) UniXGen is a unified model that can generate both reports and view-specific X-rays. (b) Images are tokenized via VQ-GAN, and reports are tokenized via a text tokenizer. (c) A minibatch consists of input sequences consisting of AP/PA/Lateral X-rays and a report in random order. (d) We use a causal attention mask to simultaneously handle multi-view X-rays and a report. 3 Method Figure 2 shows the overall depiction of UniXGen. Notably, 1) We design a unified model for bidirectional chest X-ray and report generation. 2) To generate chest X-rays with specific views, we incorporate various special tokens according to the view type. 3) UniXGen takes a series of chest X-rays of different views and a report from the same study as input for better generation quality. 3.1 Input Embedding Image Tokenization We adopt VQ-GAN [7] as an image tokenizer. This model consists of an encoder, a decoder, and a fixed-size learnable codebook. Given an image x ∈ RH×W ×3, the encoder embeds the input image into a continuous feature space z ∈ Rh×w×dz , which is then quantized into a sequence of discrete tokens {v1, . . . , vh×w} by finding the closest code embedding in the codebook via the nearest neighbor search. The decoder then maps the discrete codes back to the original input. This method allows the model to learn a compact and discrete representation of the images. Chest X-ray Embedding Using the image tokenizer described above, chest X-rays of multiple views from the same study are individually tokenized into a sequence of discrete visual tokens, surrounded by special tokens to differentiate between different views, e.g. {[SOSP A], v1, . . . , vh×w, [EOSP A]} for a PA-view X-ray. Additionally, if the study has fewer images than k2, we add padding tokens to ensure that all input sequences have the same length. For example, the final embeddings of a PA-view X-ray is vP A = {sP A, ̄v1, . . . , ̄vh×w, eP A}, where sP A, eP A ∈ Rd respectively denote the embeddings of the special tokens, ̄vi ∈ Rd is acquired by summing the visual embedding and axial positional embedding [11, 19]: ̄vi = fV E(vi) + fV P (i) where fV E(*) and fV P (*) are the visual embedding and axial positional embedding functions, respectively. Radiology Report Embedding We first split a report into word tokens with a byte-level BPE tokenizer [36] and surround them with special tokens, e.g. {[SOS], w1, . . . , wT , [EOS]}. The final embeddings for the report is w = {sR, ̄w1, ..., ̄wT , eR}, where sR, eR ∈ Rd respectively denote the embeddings of the special tokens, ̄wi ∈ Rd is obtained by summing up the word embedding and sinusoid positional embedding: 2In our work, we use k = 3 to include PA, AP, and Lateral view. ̄wi = fW E(wi) + fW P (i) 4 where fW E(*) and fW P (*) are the word embedding and sinusoidal positional embedding functions, respectively. 3.2 Bidirectional Generative Model We design a unified model for chest X-ray and report generation by formulating both tasks as sequence generation tasks. Incorporating the Transformer architecture [34], our model is trained with a multimodal causal attention mask, which is designed to handle multimodal input while still maintaining the causal constraints of the standard causal mask as shown in Figure 2 (d). This attention mechanism differs from the sequence-to-sequence attention mask [6] as it treats all modalities as targets for generation, allowing the model to simultaneously learn each modality conditioned on the preceding modalities along with the first modality which performs unconditional generation in each iteration. Furthermore, to handle long-range sequences with limited resources, we adopt Performer [4] as an efficient attention mechanism. They propose the FAVOR+ algorithm which uses positive orthogonal random features to approximate the softmax function with linear space and time complexity, allowing the model to compute the attention score more efficiently and reduce memory consumption. For causal attention, they utilize a prefix-sum mechanism to avoid storing an explicit lower-triangular regular attention matrix. Please refer to Appendix B for a visual explanation. During training, we concatenate a series of chest X-rays and report embeddings from the same study in random order to form a single input sequence as shown in Figure 2 (c), which is then fed into the model. UniXGen is trained to minimize the negative log-likelihood of the next token given the previous tokens. Given [w; v1; ...; vk] as the input sequence, for example, the loss function is formulated as follows: L = n (cid:88) i=1 −logP (wi|w0:i−1) + m (cid:88) i=1 −logP (v1 i |w, v1 0:i−1) + ... + m (cid:88) i=1 −logP (vk i |w, v1, ..., vk−1, vk 0:i−1) where n = T + 2 and m = h × w + 2, and w0, wn, v1 At inference, for generating an X-ray of a specific view, the input to the model is [w; v1; ...; vk−1], meaning that the report embeddings are followed by X-ray embeddings of other views (if available for this study.). For radiology report generation, the model input is [v1; ...; vk], assuming there are k views of X-rays available for this study. m are special tokens. m, . . . , vk 0 , vk 0, v1 4 Experiments 4.1 Dataset MIMIC-CXR [17] contains 377,110 chest X-rays from 227,835 radiology studies. Each study has one or multiple chest X-rays and a single report. We select a total of 208,534 studies that contain at most 3 chest X-rays composed of the most common views, namely PA, AP, and LATERAL3. Table 1 shows the statistics of chest X-ray view composition in each study. From the report, we use the two primary sections, namely Findings and Impression. We follow the official split of MIMIC-CXR (train 204,102, valid 1,659 test 2,773). Table 1: Composition of chest X-ray views in each study. S w/1, S w/2, and S w/2 indicate the number of chest X-rays per study. LAT. is short for LATERAL. Group Split AP PA LAT. Group Split (PA, LAT.) (AP, LAT.) (AP, AP) (LAT., LAT.) (PA, PA) (AP, PA) Train 91,736 85 1,596 S w/1 Valid 782 Test 1,428 1 3 12 29 S w/2 Train Valid Test 68,600 13,971 9,853 513 671 95 212 90 162 471 3 10 315 105 2 3 2 1 3A study can have PA, PA, LAT or PA, LAT, or just AP. 5 Group Split (PA, PA, LAT.) (AP, LAT., LAT.) (PA, LAT., LAT.) (AP, AP, LAT.) (AP, AP, AP) Etc. S w/3 Train Valid Test 8,056 66 82 3,968 36 89 3,539 36 52 848 9 11 748 7 14 211 5 6 4.2 Evaluation Metrics We evaluate the generated chest X-rays and reports in various aspects, from sample quality to clinical efficacy. FID and BLEU are the standard evaluation metrics in generative models, but they are not appropriate to capture complex medical concepts. Therefore, we use additional metrics, including 14-diagnosis classification for the chest X-rays and CheXpert scores for the reports. We also perform human evaluations. 4.2.1 Statistical Evaluation FID [9] We compute the distances of feature statistics between the original X-rays from the test set and the generated X-rays with the 1024-dimensional feature of the DenseNet-121 pretrained on chest X-ray datasets [5]. BLEU [25] We report BLEU-4 between the original and the generated reports. 4.2.2 Clinical Efficacy Evaluation 14-diagnosis Classification We train DenseNet-121 with positive labels extracted from the Findings and Impression sections using CheXpert labeler [16]. The model then predicts the classes of the generated chest X-rays. We report micro-averaged F1 and AUROC. CheXpert Scores We extracted diagnosis labels from the original and generated reports with the CheXpert labeler. We then compare these labels and measure micro-averaged Precision, Recall, and F1. 4.2.3 Human Evaluation Using 100 triples of an original chest X-ray generated chest X-rays from our model and a baseline, we ask three board-certified clinicians to evaluate each chest X-ray on three aspects: (1) realism, (2) alignment with the given report, and (3) the view position among PA, AP, and LATERAL views. Both (1) and (2) are rated on a scale from 1 (worst) to 5 (best). The triples consist of 33 triples from PA and AP and 34 triples from LATERAL. The clinicians consist of two radiologists and one neurosurgeon, and the X-rays are presented in random order for each triple. 4.3 Experiment Design Experiments are designed to investigate the followings: The Advantage of the Unified Model We evaluate the advantage of a bidirectional unified model compared to separate models for chest X-ray and radiology report generation. There are four variants: 1) SingleAP , 2) SingleP A, 3) SingleLAT., and 4) Singlereport. Each model is only trained to maximize the log-likelihood of the tokens corresponding to its specific modality. The Effect of Multi-view Chest X-rays To evaluate the effect of using multi-view chest X-rays on the generation quality, we divide the test dataset into three groups based on the number of chest X-rays per study. These groups include studies with one X-ray (S w/1), two X-rays (S w/2), and three X-rays (S w/3). We evaluate our model by incrementally increasing the number of input chest X-rays within each group. For example, in the group of studies with two X-rays (S w/2), we first only use the report as the input condition for chest X-ray generation. Next, we use both the report and the remaining chest X-ray as the input condition. Then we compare the generated chest X-rays under these different conditions. Similarly, for radiology report generation, we first use only one of the X-rays as input and then both X-rays. 6 The Ability to Generate Specific Views We evaluate the impact of the special tokens in generating specific views by asking the three clinicians to identify the view positions of the generated chest X-rays. Furthermore, the correctness of the view position is indirectly evaluated with the FID score as well. The generated chest X-rays are divided based on their original view position, and we calculate the FID scores to measure the similarity to the original view position. Comparison with Fine-tuned Stable Diffusion We compare UniXGen with a fine-tuned Stable Diffusion for chest X-ray generation as proposed in [1]. While various chest X-ray generation models have been proposed, only [1] utilize radiology reports as an input condition. In addition, Stable Diffusion has shown great performance in image generation. 4.4 Implementation Details Image tokenizer We adopt VQ-GAN with dz=256 and a codebook size of 1024. The input image of size 512 × 512 is quantized into 32 × 32 = 1024 discrete visual tokens. The model is trained for 540k steps with a batch size of 8, a learning rate of 4.5e-6 with the Adam optimizer. Text tokenizer We train a byte-level BPE tokenizer [36] with a minimum frequency of 2 on reports converted to lowercase. We then obtain 14,526 unique tokens, including three special tokens [SOS], [EOS], [T XT P AD]. UniXGen We set the length of word tokens n=256 and visual tokens m=1,026, including special tokens. In this work, UniXGen takes up to three chest X-rays as input, as the majority of studies in the MIMIC-CXR dataset have three or fewer images. However, it is able to take more images if they are available. Our model is built on the Transformer architecture with generalized attention [4]. The model has 12 layers, 12 heads, and 768 dimensions. We incorporate seven special tokens (in addition to three text special tokens), namely [SOSAP ], [EOSAP ], [SOSP A], [EOSP A], [SOSLAT ], [EOSLAT ], [IM G P AD]. Thus, the size of visual embedding function (i.e. lookup matrix) is fV E(*) ∈ RN ×d, where N = 1024 + 7, d = 768, and word embedding function is fW E(*) ∈ RM ×d, where M = 14,526, d = 768. We train the model for 337k steps with a batch size of 48. We use the AdamW optimizer with a learning rate of 1.7e-4, β1=0.9, β2=0.999, e = 1e − 8, a weight decay of 1e − 2, and a cosine decay schedule. We generate all samples with Top-p sampling [12] with p=0.9 and temperature=0.7. Finetuned Stable Diffusion Following [1], we replace the CLIP text encoder with SapBERT [20] to handle both Findings and Impression sections (the CLIP tokenizer is limited to 77 tokens) and keep frozen the text encoder and VAE and only train U-Net from scratch. Please refer to Appendix C for more details. 5 Results and Discussion 5.1 The Advantage of the Unified Model We first study the advantage of training a bidirectional unified model for both generation tasks. For chest X-ray generation, we compare our model with SingleAP , SingleP A, and SingleLAT.. Table 2 shows the results. Although UniXGen achieves slightly lower performance than single models (except for SingleP A) in terms of the statistical metric (FID), it outperforms all single models in the clinical efficacy metric (14-diagnosis Classification). This result suggests that combining report generation as a target can learn the abnormal findings from the report to generate chest X-rays that correctly capture the abnormalities described in the report. For radiology report generation, we compare our model with Singlereport. As shown in Table 3, we can observe that UniXGen significantly outperforms Singlereport across all metrics. This indicates that combining chest X-ray generation as a target can effectively capture local regions that encourage the model to generate more precise reports containing abnormal findings. We can conclude that bidirectional training has a synergistic effect on both generation tasks, as opposed to training only the single models. 7 Table 2: Comparison of UniXGen with various single models to evaluate the impact of the unified model in chest X-ray generation. The FID scores for the original image are calculated with the same number of train set as the test set. Each AP, PA and LAT. column shows the performance measured by dividing the generated chest X-rays according to their original view position. FID (↓) 14-diagnosis Classification Models ALL AP PA LAT. Original Image SingleAP SingleP A SingleLAT. UniXGen 0.361 - - - 10.436 0.776 15.458 - - 17.331 0.874 - 7.189 - 5.935 0.487 - - 7.991 9.328 F1 micro AUROC ALL 0.510 - - - 0.416 AP PA LAT. ALL AP PA 0.540 0.382 - - 0.465 0.492 - 0.365 - 0.368 0.460 - - 0.326 0.353 0.810 - - - 0.728 0.808 0.689 - - 0.755 0.812 - 0.697 - 0.704 LAT. 0.793 - - 0.667 0.695 Table 3: Comparison of UniXGen with a single model to evaluate the impact of the unified model in radiology report generation. Models BLEU-4 CheXpert Labeler Precision Recall F1 Singlereport UniXGen 0.038 0.050 0.364 0.431 0.343 0.410 0.353 0.420 5.2 The Effect of Multi-view Chest X-rays We investigate the effect of inputting multi-view chest X-rays on the generation ability. As described in Section 4.3, we divide test dataset into three groups (S w/1, w/2 and w/3) and evaluate within each group. For chest X-ray generation, we use the report as the input condition and also incrementally add the rest of the chest X-rays as input. Tables 4 and 5 show FID and 14-diagnosis classification results, respectively. In the ALL view of the S w/2 group (1 of 2 vs 2 of 2), we can observe that 2 of 2 achieves better performance than 1 of 2 in both statistical (FID 16.416 vs 8.757) and clinical efficacy (F1 0.309 vs 0.400, AUROC 0.664 vs 0.713) metrics. Also, 2 of 2 is better than 1 of 2 in the individual views (AP, PA, and LATERAL). Similarly, in the ALL view of S w/3 group (1 of 3 vs 2 of 3 vs 3 of 3), 3 of 3 outperforms 2 of 3 and 1 of 3 across all metrics: FID (19.252 vs 11.450 vs 11.136), F1 (0.313 vs 0.362 vs 0.376), and AUROC (0.668 vs 0.694 vs 0.699). In the individual views, 2 of 3 or 3 of 3 usually perform better than 1 of 3 (except for the F1 score in the AP view). In addition, 3 of 3 performs slightly lower than 2 of 3 in some metrics, which we believe that this is because the studies with three chest X-rays account for only a small percentage of the entire train dataset (8.5%). Therefore, there is less opportunity to learn the 3 of 3 input format during training. We can conclude that utilizing multiple X-ray views as input helps the model generate more accurate chest X-rays that can capture the abnormal findings in the report and other chest X-rays. Table 6 shows the radiology report generation result. We also increase the input chest X-rays to generate the target report. In the S w/2 group, the 1 of 2 and the 2 of 2 show the same statistical score (BLEU-4 0.056), but the 2 of 2 shows a better clinical efficacy score (F1 0.415 vs 0.422). Also, in the S w/3 group, 3 of 3 outperforms 1 of 3 and 2 of 3 across all metrics. These results also show that using multi-view chest X-rays encourages the model to generate more precise reports. 5.3 The Ability to Generate Specific Views View Position column in Table 8 indicates that UniXGen can generate the view-specific X-rays comparable to the original images. In addition, FID scores in Tables 2 and 4 imply that the generated chest X-rays are similar to their original view positions. These results demonstrate the usefulness of view-specific special tokens that effectively capture the specific properties of each view. 8 Table 4: Evaluations of generated chest X-rays using FID to quantify the effect of using multi-view chest X-rays in chest X-ray generation. src., tar., and LAT. are short for source, target and LATERAL, respectively. Group Input (src. → tar.) S w/1 1 of 1 S w/2 1 of 2 2 of 2 1 of 3 S w/3 2 of 3 3 of 3 (w → v1) (w → v1) (w, v2 → v1) (w, v1 → v2) (w → v1) (w, v2 → v1) (w, v1 → v2) (w, v2, v3 → v1) (w, v1, v3 → v2) (w, v1, v2 → v3) FID (↓) ALL AP PA LAT. 25.441 25.742 76.753 37.380 16.416 24.907 16.779 20.185 8.757 6.583 20.851 9.312 7.547 5.838 8.469 9.511 19.252 33.584 23.753 22.786 11.450 23.302 11.136 10.26 8.83 19.781 33.22 19.865 26.545 19.973 11.853 59.485 12.002 8.793 9.507 15.116 14.941 14.587 13.845 11.444 Table 5: Evaluations of generated chest X-rays using 14-diagnosis Classification to quantify the effect of using multi-view chest X-rays in chest X-ray generation. src., tar., and LAT. are short for source, target, and LATERAL, respectively. Group Input (src. → tar.) S w/1 1 of 1 S w/2 1 of 2 2 of 2 1 of 3 S w/3 2 of 3 3 of 3 (w → v1) (w → v1) (w, v2 → v1) (w, v1 → v2) (w → v1) (w, v2 → v1) (w, v1 → v2) (w, v2, v3 → v1) (w, v1, v3 → v2) (w, v1, v2 → v3) F1 micro AUROC ALL AP PA LAT. ALL AP PA LAT. 0.457 0.460 0.615 0.255 0.747 0.751 0.728 0.563 0.309 0.447 0.280 0.227 0.664 0.741 0.642 0.634 0.400 0.394 0.485 0.487 0.362 0.382 0.370 0.334 0.713 0.726 0.753 0.781 0.692 0.715 0.702 0.696 0.313 0.396 0.333 0.245 0.668 0.714 0.667 0.643 0.362 0.377 0.376 0.373 0.381 0.371 0.464 0.394 0.44 0.505 0.376 0.363 0.373 0.349 0.333 0.350 0.358 0.369 0.365 0.353 0.694 0.703 0.699 0.72 0.705 0.691 0.73 0.722 0.796 0.749 0.716 0.715 0.716 0.707 0.688 0.679 0.69 0.673 0.706 0.704 Table 6: Evaluations of generated reports using BLEU and CheXpert scores to quantify the effect of using multi-view chest X-rays on radiology report generation. src. is short for source, and tar. for target. Group Input (src. → tar.) BLEU-4 S w/1 1 of 1 S w/2 S w/3 1 of 2 2 of 2 1 of 3 2 of 3 3 of 3 (v1 → w) (v1 → w) (v1, v2 → w) (v1 → w) (v1, v2 → w) (v1, v2, v3 → w) 0.042 0.056 0.056 0.054 0.060 0.063 CheXpert Labeler Precision Recall F1 0.419 0.431 0.434 0.461 0.447 0.471 0.405 0.412 0.400 0.410 0.413 0.424 0.431 0.415 0.422 0.435 0.435 0.450 5.4 Comparison with Stable Diffusion Table 7 shows the chest X-ray generation performances of UniXGen and the fine-tuned Stable Diffusion. For a fair comparison, our model generates chest X-rays using only radiology reports as input, without adding any additional chest X-rays. As seen from the table, UniXGen outperforms 9 the fine-tuned Stable Diffusion across all metrics. In addition, our model proves again that using additional chest X-rays can effectively generate more realistic and accurate chest X-rays as shown in Table 2 (FID 18.994 vs 10.436, F1 0.396 vs 0.416, AUROC 0.711 vs 0.728). Table 7: Comparison of UniXGen and the fine-tuned Stable Diffusion for chest X-ray generation. Models FID (↓) Stable Diffusion UniXGen 78.857 18.994 14-diagnosis Classification F1 0.29 0.396 micro AUROC 0.589 0.711 5.5 Human Evaluation Table 8 confirms that UniXGen can generate realistic chest X-rays close to the original, and the view-specific special tokens can capture refined features of each view, encouraging the model to generate view-specific X-rays. In addition, our model scores higher than the baseline for both realism and alignment. Table 8: Human evaluation for chest X-ray generation. View Position (%) Models Realism Alignment Original Image UniXGen Stable Diffusion 4.177 4.193 2.09 3.977 3.583 1.827 AP 84.3 75.5 - PA LATERAL 58.3 66.7 - 100 100 - 5.6 Qualitative Examples Figure 3 shows that UniXGen can generate realistic chest X-ray images even when conditioned only on the report, showing a small consolidation in the lingula as described by the report. When given an additional view, UniXGen generates an image that is more similar to the original image, showing its ability to take advantage of both input modalities. Figure 4, on the other hand, shows an example where UniXGen cannot correctly capture all the facts in the report when the image is generated conditioned on the report only. Although the report says "large right pleural effusion", the generated image depicts a rather small pleural effusion. When given an additional view, however, UniXGen can draw pleural effusion that is of the similar size as that of the original image. Furthermore, both figures show that the view-specific special tokens enables UniXGen to generate the desired views, even when they do not exist in reality. Figures 5, and 6 show that using multiple X-rays encourages the model to generate more precise reports. Please refer to Appendix A for more examples. All examples are confirmed by the clinicians. 6 Limitation & Conclusion In this paper, we propose for the first time a unified view-specific X-ray and report generation model. Our approach has several limitations, each providing opportunities for future work. First, due to the nature of the real-world patient dataset, the report contains many comparison phrases with previous studies (e.g. unchanged, increase, and compared to previous radiographs), so the model simply memorizes these patterns without understanding their meaning and generates historical phrases. In the future, we plan to use CXR-PRO [29], a refined dataset that removes historical phrases, to generate clinically accurate reports. Second, the human evaluation confirms that our model generates chest X-rays that are as realistic as the original images, but lack precise alignment with the report. We plan to improve the alignment between each sentence in the report and the image regions. In addition, the position and shape of the support device are slightly different from the original image, so we can infer that our model sometimes has difficulty capturing fine details. This will also be improved in the future. We hope that our approach suggests a new direction for medical synthetic data generation and can be useful in the medical domain. 10 Figure 3: Generated chest X-rays of UniXGen. Based only on the report, the generated PA in the orange dashed box draws a rather small portion of the consolidation in the lingula, as is written in the report. Based on an additional lateral view, the generated PA in the blue dashed box draws a consolidation that is of more similar size as that of the original PA. Figure 4: Generated chest X-rays of UniXGen. The generated PA conditioned only on the report (orange dashed box) draws relatively small-sized pleural effusion while the report says "large right pleural effusion". However, by adding an additional lateral view (blue dashed box), UniXGen can properly generate the PA view with large pleural effusion. 11 Figure 5: Generated radiology reports of UniXGen. Figure 6: Generated radiology reports of UniXGen. 12 References [1] P. Chambon, C. Bluethgen, J.-B. Delbrouck, R. Van der Sluijs, M. Połacin, J. M. Z. Chaves, T. M. Abraham, S. Purohit, C. P. Langlotz, and A. Chaudhari. Roentgen: Vision-language foundation model for chest x-ray generation. arXiv preprint arXiv:2211.12737, 2022. [2] P. Chambon, C. Bluethgen, C. P. Langlotz, and A. Chaudhari. Adapting pretrained vision- language foundational models to medical imaging domains. arXiv preprint arXiv:2210.04133, 2022. [3] P. Chambon, T. S. Cook, and C. P. Langlotz. Improved fine-tuning of in-domain transformer model for inferring covid-19 presence in multi-institutional radiology reports. Journal of Digital Imaging, pages 1–14, 2022. [4] K. Choromanski, V. Likhosherstov, D. Dohan, X. Song, A. Gane, T. Sarlos, P. Hawkins, J. Davis, A. Mohiuddin, L. Kaiser, et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020. [5] J. P. Cohen, J. D. Viviano, P. Bertin, P. Morrison, P. Torabian, M. Guarrera, M. P. Lungren, A. Chaudhari, R. Brooks, M. Hashir, et al. Torchxrayvision: A library of chest x-ray datasets and models. In International Conference on Medical Imaging with Deep Learning, pages 231–249. PMLR, 2022. [6] L. Dong, N. Yang, W. Wang, F. Wei, X. Liu, Y. Wang, J. Gao, M. Zhou, and H.-W. Hon. Unified language model pre-training for natural language understanding and generation. Advances in Neural Information Processing Systems, 32, 2019. [7] P. Esser, R. Rombach, and B. Ommer. Taming transformers for high-resolution image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 12873–12883, 2021. [8] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. Communications of the ACM, 63(11):139–144, 2020. [9] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017. [10] J. Ho, A. Jain, and P. Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020. [11] J. Ho, N. Kalchbrenner, D. Weissenborn, and T. Salimans. Axial attention in multidimensional transformers, 2019. [12] A. Holtzman, J. Buys, L. Du, M. Forbes, and Y. Choi. The curious case of neural text degeneration. arXiv preprint arXiv:1904.09751, 2019. [13] G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700–4708, 2017. [14] L. Huang, G. Niu, J. Liu, X. Xiao, and H. Wu. Du-vlg: Unifying vision-and-language generation via dual sequence-to-sequence pre-training. arXiv preprint arXiv:2203.09052, 2022. [15] Y. Huang, H. Xue, B. Liu, and Y. Lu. Unifying multimodal transformer for bi-directional image and text generation. In Proceedings of the 29th ACM International Conference on Multimedia, pages 1138–1147, 2021. [16] J. Irvin, P. Rajpurkar, M. Ko, Y. Yu, S. Ciurea-Ilcus, C. Chute, H. Marklund, B. Haghgoo, R. Ball, K. Shpanskaya, et al. Chexpert: A large chest radiograph dataset with uncertainty labels and expert comparison. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 590–597, 2019. 13 [17] A. E. Johnson, T. J. Pollard, S. J. Berkowitz, N. R. Greenbaum, M. P. Lungren, C.-y. Deng, R. G. Mark, and S. Horng. Mimic-cxr, a de-identified publicly available database of chest radiographs with free-text reports. Scientific data, 6(1):1–8, 2019. [18] D. P. Kingma and M. Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. [19] N. Kitaev, L. Kaiser, and A. Levskaya. Reformer: The efficient transformer. In International Conference on Learning Representations, 2020. [20] F. Liu, E. Shareghi, Z. Meng, M. Basaldella, and N. Collier. Self-alignment pretraining for biomedical entity representations. arXiv preprint arXiv:2010.11784, 2020. [21] G. Liu, T.-M. H. Hsu, M. McDermott, W. Boag, W.-H. Weng, P. Szolovits, and M. Ghas- semi. Clinically accurate chest x-ray report generation. In Machine Learning for Healthcare Conference, pages 249–269. PMLR, 2019. [22] A. Madani, M. Moradi, A. Karargyris, and T. Syeda-Mahmood. Chest x-ray generation and data augmentation for cardiovascular abnormality classification. In Medical imaging 2018: Image processing, volume 10574, pages 415–420. SPIE, 2018. [23] J. H. Moon, H. Lee, W. Shin, Y.-H. Kim, and E. Choi. Multi-modal understanding and generation for medical images and text via vision-language pre-training. IEEE Journal of Biomedical and Health Informatics, 26(12):6070–6080, 2022. [24] K. Packh ̈auser, L. Folle, F. Thamm, and A. Maier. Generation of anonymous chest radiographs using latent diffusion models for training thoracic abnormality classification systems. arXiv preprint arXiv:2211.01323, 2022. [25] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu. Bleu: a method for automatic evaluation In Proceedings of the 40th annual meeting of the Association for of machine translation. Computational Linguistics, pages 311–318, 2002. [26] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748–8763. PMLR, 2021. [27] A. Ramesh, P. Dhariwal, A. Nichol, C. Chu, and M. Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022. [28] A. Ramesh, M. Pavlov, G. Goh, S. Gray, C. Voss, A. Radford, M. Chen, and I. Sutskever. Zero-shot text-to-image generation. In International Conference on Machine Learning, pages 8821–8831. PMLR, 2021. [29] V. Ramesh, N. A. Chi, and P. Rajpurkar. Improving radiology report generation systems by removing hallucinated references to non-existent priors. In Machine Learning for Health, pages 456–473. PMLR, 2022. [30] A. Razavi, A. van den Oord, and O. Vinyals. Generating diverse high-fidelity images with vq-vae-2. In Advances in neural information processing systems, pages 14866–14876, 2019. [31] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10684–10695, 2022. [32] C. Saharia, W. Chan, S. Saxena, L. Li, J. Whang, E. Denton, S. K. S. Ghasemipour, B. K. Ayan, S. S. Mahdavi, R. G. Lopes, et al. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022. [33] A. Van Den Oord, O. Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017. [34] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. 14 [35] P. von Platen, S. Patil, A. Lozhkov, P. Cuenca, N. Lambert, K. Rasul, M. Davaadorj, and T. Wolf. Diffusers: State-of-the-art diffusion models, 2022. [36] C. Wang, K. Cho, and J. Gu. Neural machine translation with byte-level subwords. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 9154–9160, 2020. [37] X. Wang, Y. Peng, L. Lu, Z. Lu, and R. M. Summers. Tienet: Text-image embedding network for common thorax disease classification and reporting in chest x-rays. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 9049–9058, 2018. [38] T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, et al. Huggingface's transformers: State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771, 2019. [39] X. Yang, M. Ye, Q. You, and F. Ma. Writing by memorizing: Hierarchical retrieval-based medical report generation. arXiv preprint arXiv:2106.06471, 2021. [40] J. Yuan, H. Liao, R. Luo, and J. Luo. Automatic radiology report generation based on multi-view image fusion and medical concept enrichment. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 721–729. Springer, 2019. [41] H. Zhang, W. Yin, Y. Fang, L. Li, B. Duan, Z. Wu, Y. Sun, H. Tian, H. Wu, and H. Wang. Ernie-vilg: Unified generative pre-training for bidirectional vision-language generation. arXiv preprint arXiv:2112.15283, 2021. [42] T. Zhang, H. Fu, Y. Zhao, J. Cheng, M. Guo, Z. Gu, B. Yang, Y. Xiao, S. Gao, and J. Liu. Skrgan: Sketching-rendering unconditional generative adversarial networks for medical image synthesis. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 777–785. Springer, 2019. [43] L. Zhou, H. Palangi, L. Zhang, H. Hu, J. Corso, and J. Gao. Unified vision-language pre-training for image captioning and vqa. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13041–13049, 2020. 15 A Generated Examples Figures 7, and 8 show additional chest X-ray generation examples. Figures 9, and 10 show additional radiology report generation examples. Figure 7: Generated chest X-rays of UniXGen. The AP view generated only from the report (orange dashed box) already reflects the facts described in the report quite well, capturing the wires and the clips. With an additional lateral view, the AP view in the blue dashed box shows an increased similarity with the original PA in terms of overall structure. Figure 8: Generated chest X-rays of UniXGen. Although the PA view generated based only on the report (orange dashed box) captures most of the facts in the report, it is missing the implanted device. Given an additional lateral view, however, UniXGen can generate a PA view (blue dashed box) that correctly draws the implanted device. 16 Figure 9: Generated radiology reports of UniXGen Figure 10: Generated radiology reports of UniXGen 17 B Causal Attention Mechanism Figure 11 shows a visual explanation of the causal attention mechanism. Figure 11: Visualization of multimodal causal attention mask and its prefix-sum algorithm. Illustra- tions inspired by [4]. This algorithm builds the prefix-sum of the outer-products of random feature maps for keys K(cid:48) and value vectors V on the fly and left-multiplies it with the query random feature vector Q(cid:48) to obtain the new row in the resulting matrix AV. 18 C Details of the Fine-tuned Stable Diffusion Following [1], we fine-tune Stable Diffusion [31] as a baseline model for chest X-ray generation. Since the implementation code has not been released, we re-implement it with the descriptions provided in the original paper. The code is built on the diffusers library [35]. We load the stable diffusion pipeline from the Hugging Face repository [38] (CompVis/stable-diffusion-v1-4). To evaluate reproducibility, we use only PA views, limit the number of "No finding" reports, and select only the Impression section. We train three different models: (a) train both U-Net and CLIP [26], (b) train U-Net from scratch and freeze RadBERT [3], (c) train U-Net from scratch and freeze SapBERT [20]. The models are trained for 1k steps with batch size of 256, learning rate of 5e-5. The FID scores for each model are 23.534, 68.162, and 76.39, respectively. We measure the FID score with chest X-ray pretrained DenseNet-121 [5] and P19 testset. Figure 12 shows our re-implementation results. For a fair comparison with our model, we fine-tune Stable Diffusion with multiple views and both Findings and Impression sections. We replace the CLIP text encoder with SapBERT to handle both Findings and Impression sections (the CLIP tokenizer is only limit to 77 tokens) and keep frozen the text encoder and VAE and only train U-Net from scratch. The model is trained as the same hyper-parameters with our model. We evaluate the generated chest X-rays every 1k steps and select the best performance model. We try to make this model learn specific view information by prompting the view position along with the report, but this model fails to learn the view position. Thus, we train this model without the specific view information. Figure 13 shows the generated chest X-rays. Figure 12: Re-implementation results of the fine-tuned Stable Diffusion as proposed in [1]. Figure 13: The generated chest X-rays of the fine-tuned Stable Diffusion with our dataset. 19
http://arxiv.org/abs/2302.12168v2
2023-09-25T13:57:27
2023-02-23T17:11:04
A comparative assessment of deep learning models for day-ahead load forecasting: Investigating key accuracy drivers
Short-term load forecasting (STLF) is vital for the effective and economic operation of power grids and energy markets. However, the non-linearity and non-stationarity of electricity demand as well as its dependency on various external factors renders STLF a challenging task. To that end, several deep learning models have been proposed in the literature for STLF, reporting promising results. In order to evaluate the accuracy of said models in day-ahead forecasting settings, in this paper we focus on the national net aggregated STLF of Portugal and conduct a comparative study considering a set of indicative, well-established deep autoregressive models, namely multi-layer perceptrons (MLP), long short-term memory networks (LSTM), neural basis expansion coefficient analysis (N-BEATS), temporal convolutional networks (TCN), and temporal fusion transformers (TFT). Moreover, we identify factors that significantly affect the demand and investigate their impact on the accuracy of each model. Our results suggest that N-BEATS consistently outperforms the rest of the examined models. MLP follows, providing further evidence towards the use of feed-forward networks over relatively more sophisticated architectures. Finally, certain calendar and weather features like the hour of the day and the temperature are identified as key accuracy drivers, providing insights regarding the forecasting approach that should be used per case.
[ "Sotiris Pelekis", "Ioannis-Konstantinos Seisopoulos", "Evangelos Spiliotis", "Theodosios Pountridis", "Evangelos Karakolis", "Spiros Mouzakitis", "Dimitris Askounis" ]
10.1016/j.segan.2023.101171
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1016/j.segan.2023.101171", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.12168v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12168v2", "@rel": "related", "@type": "application/pdf" } ]
[ "Sustainable Energy, Grids and Networks, 2023" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
A PREPRINT - SEPTEMBER 26, 2023 A COMPARATIVE ASSESSMENT OF DEEP LEARNING MODELS FOR DAY-AHEAD LOAD FORECASTING: INVESTIGATING KEY ACCURACY DRIVERS 3 2 0 2 p e S 5 2 ] G L . s c [ 2 v 8 6 1 2 1 . 2 0 3 2 : v i X r a Sotiris Pelekis Decision Support Systems Laboratory School of Electrical and Computer Engineering National Technical University of Athens Greece [email protected] Ioannis-Konstantinos Seisopoulos Decision Support Systems Laboratory School of Electrical and Computer Engineering National Technical University of Athens Greece [email protected] Evangelos Spiliotis Forecasting and Strategy Unit School of Electrical and Computer Engineering National Technical University of Athens Greece [email protected] Theodosios Pountridis Decision Support Systems Laboratory School of Electrical and Computer Engineering National Technical University of Athens Greece [email protected] Evangelos Karakolis Decision Support Systems Laboratory School of Electrical and Computer Engineering National Technical University of Athens Greece [email protected] Spiros Mouzakitis Decision Support Systems Laboratory School of Electrical and Computer Engineering National Technical University of Athens Greece [email protected] Dimitris Askounis Decision Support Systems Laboratory School of Electrical and Computer Engineering National Technical University of Athens Greece [email protected] September 26, 2023 2 Nomenclature A PREPRINT - SEPTEMBER 26, 2023 l Deep learning Look-back window CNN Convolutional neural network DL EPES Electrical power and energy system LSTM Long short-term memory MAPE Mean absolute percentage error MLOps Machine learning operations MLP Multi-layer perceptron MLR Multiple linear regression N-BEATS Neural basis expansion analysis time series forecasting NN Neural network RMSE Root mean squared error RNN Recurrent neural network sNaive Seasonal naive STLF Short-term load forecasting TCN Temporal convolutional network TFT TPE Temporal fusion transformer Tree-structured parzen estimator ABSTRACT Short-term load forecasting (STLF) is vital for the effective and economic operation of power grids and energy markets. However, the non-linearity and non-stationarity of electricity demand as well as its dependency on various external factors renders STLF a challenging task. To that end, several deep learning models have been proposed in the literature for STLF, reporting promising results. In order to evaluate the accuracy of said models in day-ahead forecasting settings, in this paper we focus on the national net aggregated STLF of Portugal and conduct a comparative study considering a set of indicative, well-established deep autoregressive models, namely multi-layer perceptrons (MLP), long short-term memory networks (LSTM), neural basis expansion coefficient analysis (N-BEATS), temporal convolutional networks (TCN), and temporal fusion transformers (TFT). Moreover, we identify factors that significantly affect the demand and investigate their impact on the accuracy of each model. Our results suggest that N-BEATS consistently outperforms the rest of the examined models. MLP follows, providing further evidence towards the use of feed-forward networks over relatively more sophisticated architectures. Finally, certain calendar and weather features like the hour of the day and the temperature are identified as key accuracy drivers, providing insights regarding the forecasting approach that should be used per case. Keywords Short-Term Load Forecasting, Deep Learning, Ensemble, N-BEATS, Temporal Convolution, Forecasting Accuracy 1 Introduction 1.1 Background Electricity load forecasting is crucial for the optimal operation and modernization of power systems (e.g. smart grids) and has always been an important task for all countries worldwide irrespective of their economical state. This is because power systems are the backbone of modern life, enabling the technology that organizations and individuals possess to function within society. Load forecasts contribute in preserving the balance between electricity consumption 3 A PREPRINT - SEPTEMBER 26, 2023 and production, the economic power dispatch, storage scheduling, network planning, and expansion of power grids. However, electricity demand depends on numerous external variables [61], such as energy prices, weather conditions and demographics [49], as well as social and political factors like the climate crisis and the recent outbreak of the Russian-Ukrainian war that urge for an immediate energy transition through an even higher penetration of RES [63]. These factors complicate the patterns of load time series and therefore sophisticated models are required to accurately extrapolate them in time. From a technical perspective, load forecasting is typically divided into four categories according to the forecasting horizon considered. Long-term load forecasting involves forecasts up to 20 years ahead and is usually linked to grid development and strategic planning. Medium-term load forecasting involves a week up to a year ahead forecasts and is mainly used for maintenance scheduling and fuel purchases planning, as well as for energy trading and revenue assessment. Short-term load forecasting (STLF) includes one day to one week ahead forecasts. The resolution of said forecasts ranges from 15-minutes to one hour and they usually serve the day-to-day operations of utilities and companies participating in electricity markets. Lastly, very short-term load forecasting addresses forecast horizons of few minutes to few hours, being mostly used for demand response and near real-time control [16]. With respect to STLF, it is considered a challenging task as electricity load time series are characterized by non-linearity, non-stationarity, noise, and multiple seasonal patterns. This can be attributed to the fact that electrical power demand originates from various electrical loads that, in turn, depend on numerous external variables, including weather and calendar factors. Additionally, the increased diversity of the behavior of the users connected to smart devices and electric vehicles has increased the fluctuation of the electricity load [39]. Therefore, given the necessity for higher penetration of RES, more accurate forecasts are required that will effectively adapt to the flexibility and demand response requirements posed within transmission and distribution operation systems [47]. As a result, STLF has been investigated in a variety of research studies and projects [4, 46, 28, 44, 70]. This research has led to an abundance of related literature that promotes continuous innovation and evolution in the field. Nonetheless, it has also created a fuzzy landscape for industrial electrical power and energy system (EPES) stakeholders that seek to identify the most suitable methods for their STLF use cases with a minimal effort. The role of accurate STLF is crucial within power systems. According to Hobbs [22], a decrease of the mean absolute percentage error (MAPE) by 1% can reduce generation costs by approximately 0.1%-0.3% when MAPE is in the range of 3%-5%. In this context, a conservative estimate is that a 1% reduction in forecast error for a 10 GW utility can save up to $ 1.6 million annually. Ortega-Vazquez and Kirschen [42] explored the economical impact of load forecast errors on the daily power system operation considering the probability of generating units outages to estimate the energy not served due to the outages, concluding that an increase of 1% in the error can lead to an economic impact of 590.14$ daily, assuming an one-area IEEE-RTS system of 3105 MW. Meanwhile, Stimmel Carol [64] estimated that a 0.1% improvement in forecasting for a midsize European utility could lead to a reduction of around $3 million in operating costs within imbalance markets. This estimate took however into account the ability to forecast at a granular level, including meters and transformer feeders, thus enabling dynamic tariffs, demand response, and effective management of distributed energy resources that alleviate peak demand. 1.2 Related work Recently, neural networks (NNs) and deep learning (DL) models have dominated the field of time series forecasting, including STLF among other energy forecasting applications. The multi-layer perceptron (MLP) architecture has been widely used for STLF [21, 26, 3], even though not originally designed to model time series data that are chronologically correlated. Other approaches that include genetic algorithms have also been proposed to reduce training time [31, 7] and to select the training parameters of genetic algorithm neural network hybrid models [69, 35]. NNs have also been trained using artificial immune system models, mainly for hyperparameter tuning purposes [18, 11], and implemented in the form of extreme learning machines [75]. Moreover, several ensembling techniques have been introduced to reduce model and parameter uncertainty and, consequently, improve forecast accuracy [69, 10]. An exhaustive review on NN methods for STLF has been conducted by Hernandez et al. [19]. With respect to more recent advances, a massive flow of research studies have shifted towards deeper architectures [12]. Recurrent neural networks (RNN) and particularly long short-term memory (LSTM) neural networks [23] and their variants, such as sequence-to-sequence models and encoder-decoder architectures, cover a significant share of the current research interest on STLF [59, 57, 17]. Other innovative approaches build on convolutional neural networks (CNN) [43] and LSTM hybrids since they can efficiently correlate load data with numerous weather variables [58, 50]. Cutting-edge DL architectures include temporal convolutional networks (TCN) [5], neural basis expansion coefficient analysis (N-BEATS) [40], and transformers [34]. These models have recently drawn considerable attention in the field of STLF as they can result to relatively higher accuracy, lower training times, and more interpretable forecasts 4 A PREPRINT - SEPTEMBER 26, 2023 [33, 40]. Specifically, Tang et al. [66] employed a TCN architecture with channel and temporal attention mechanisms to exploit the non-linear relationships between weather factors and load. Yin and Xie [73] applied a multi-temporal- spatial-scale TCN for forecasting the load of a city in China, while Gu and Jia [14] compared the TCN architecture with three traditional models, suggesting its superiority when used to forecast the load of a certain region in Shanghai. Regarding N-BEATS, it has been evaluated by Oreshkin et al. [41] on medium-term load forecasting tasks, achieving state-of-the-art performance, and by Singh et al. [60], who employed the model for STLF in Ontario. Wen et al. [71] and Grabner et al. [13] have also used variants of N-BEATS for probabilistic STLF and consumer-level STLF at global scale, respectively. In addition, Pelekis et al. [46] compared the accuracy of TCN and N-BEATS in STLF settings for the case of the Portuguese national load at a 15-minute resolution, with N-BEATS resulting to superior forecasts. With respect to transformers, Zhang et al. [74] evaluated a time augmented transformer for STLF on the electrical load data of New South Wales in Australia, Lim et al. [33] validated temporal fusion transformers (TFT) for STLF on the UCI Electricity Load Diagrams Dataset [67], while Huy et al. [24] employed the latter architecture to forecast the load of Hanoi city using weather and calendar features. Another research topic of great interest and implications in time series forecasting is the explainability of forecasting performance. Spiliotis et al. [62] investigated the time series features of popular forecasting competition data sets, concluding that different forecasting methods should be used depending on the particularities of the data. Their analysis built on established feature extraction and visualization techniques [27], as well as a multiple linear regression (MLR) model that correlated time series feature values with forecast accuracy. This type of explanatory analysis was first introduced by Petropoulos et al. [48], proposing the selection and combination of different forecasting models based on their expected forecast accuracy, predicted based on key time series features. In a similar direction, Montero-Manso et al. [37] used a tree-based model to combine the forecasts of various models based on time series features, while Talagala et al. [65] introduced a meta-learning algorithm for time series forecast model performance prediction and selection, also providing useful insights on which forecasting models best work for particular types of time series. In the STLF domain, Moon et al. [38] proposed an explainable tree-based model to forecast the demand in buildings using Shapley values [54], concluding that the temperature-humidity index and the wind chill indexes affect the forecasting accuracy more than temperature, humidity, and wind speed. Similarly, Wu et al. [72] used Shapley values to develop a feature selection strategy for load forecasting models within a regional integrated energy system. 1.3 Contribution It becomes evident that accurate STLF is invaluable for EPES stakeholders, while the options available in terms of modeling abundant. In this context, it is critical to evaluate the relative accuracy of well-established STLF models and, more importantly, to investigate the conditions under which each model is expected to perform best. The contribution of this study builds on such a comparative assessment, considering indicative DL architectures and key external factors (calendar and weather features) to explore the day-ahead forecasting accuracy of state-of-the-art forecasting approaches. Our innovations are summarized as follows: (a) Considering the prevalence of RNNs and specifically LSTM as the golden standard in STLF applications, in this study we attempt to assess its accuracy over alternative DL architectures. In this context, we consider five DL models–some of them well-established, while others more recently introduced–and evaluate their accuracy in day-ahead load forecasting. The models include networks from the MLP (traditional feed-forward), LSTM (recurrent), TFT (hybrid recurrent/ feed-forward), TCN (convolutional), and N-BEATS (deep feed- forward with residual stacking) architectures that have recently drawn significant attention in the field of STLF. Considering univariate forecasting setups, we eventually confirm that feed-forward architectures, such as N-BEATS and MLP, can provide superior results despite the streamlined usage of RNNs. To ensure the representativeness of our results, we carefully tune the hyperparameter values of the models and produce forecasts for a complete calendar year using ensembles. Moreover, we benchmark the performance of the DL models using standard baseline models. (b) Considering the importance of model performance explanation and selection based on key external variables, as well as the particularities of each data set that may affect forecast accuracy and favor certain models, we use MLR to correlate calendar (time of day, season, holidays, and weekends) and weather (temperature) features with the forecast errors of each DL model. Effectively, this post-hoc analysis enables us to decompose the forecasting performance of the examined models and identify the factors that deteriorate their accuracy most. Moreover, it allows us to identify models that are expected to perform best based on the calendar and weather features of the period being forecast. This analysis results in a set of guidelines for EPES stakeholders, such as transmission system operators, that are interested in reinforcing their forecasting toolset with state-of-the-art DL techniques or in generating forecasts in a selective fashion based on the state of external variables. To the 5 A PREPRINT - SEPTEMBER 26, 2023 best of our knowledge, this is the first attempt to apply such a model explanation approach–originating from the domain of operational research [48, 27, 62]– to an STLF context. (c) We expand the analysis conducted by Pelekis et al. [46] in three dimensions. First, we focus on purely autoregressive models, thus assessing the performance of DL time series forecasting models that do not require weather forecasts or any other type of external information as additional input. The reason for conducting this analysis is the ease of developing and deploying said models, alongside the absence of the requirement for high quality external and specifically weather data or forecasts that are typically unavailable for free. Nevertheless, we also compare the performance of purely autoregressive model to that of models that use weather forecasts as additional inputs, concluding that, most often that not, weather forecasts can indeed improve accuracy to some notable extent. Subsequently, we utilize high performance computing infrastructures to properly tune the examined models and evaluate their performance when used individually or within ensembles. By doing that, we investigate the robustness of each neural network architecture to random neural weight initializations and confirm the benefits of combining. Third, our analysis is performed on a newer version of the data set (ranging from 2013 to 2021 instead of 2019) that has a resolution of one hour instead of fifteen minutes. 1.4 Structure of the paper The rest of the paper is organized as follows. Section 2 describes our methodological approach, including the utilized DL architectures and benchmarks, the data used for the empirical evaluation, and the MLR framework employed to explain the forecasting performance of each model. Subsequently, Section 3 presents our results, while Section 4 discusses the impact of including the temperature in Lisbon as predictor within our DL models. Finally, Section 5 presents the key concluding remarks of our study, while Section 6 wraps up with potential future perspectives. 2 Methodology This section presents the methodology used to address the common stages of the machine learning life-cycle referring to our specific STLF case in Portugal. These stages include the following tasks: (i) data collection, wrangling and transformations; (ii) exploratory analysis of the data set; (iii) selection and description of utilized DL architectures; (iv) training and model validation (hyperparameter tuning); (iv) forecast evaluation. Subsequently, the MLR-based framework used for explaining the forecasting performance of the DL models is presented. The experimental process took place using an automated machine learning operations (MLOps) pipeline developed with MLflow [2], building up to the one described by Pelekis et al. [46]. 2.1 Data collection and exploratory analysis The data set used in the present study consists of the time series of the Portuguese national net aggregated electricity demand, reported at an hourly time resolution. The data was provided by R&D Nester [51] in the context of the I-NERGY [28] project. The time series ranges from 2013 to 2021 as this was the most recent version of the data set including complete calendar years at the time the experiments were conducted. The operations applied to the electricity load time series before data scaling and model training took place were the following: (i) removal of duplicate entries (mainly caused by changes between standard and daylight saving time) and (ii) filling of missing data (rare cases handled using linear interpolation). An additional data source used was the historical weather archive in Lisbon that can be found online [55]. Specifically, hourly samples from the weather station "08579" were collected and an additional data set corresponding to the Portela airport from the same provider [56] was used in an auxiliary fashion to fill any missing values. Autoregressive models can be used to predict the future values of a time series by looking back at a predefined number of its past values. However, as already discussed, various exogenous variables can affect electricity demand, thus influencing the performance of forecasting models. To demonstrate this effect, we analyze the daily load profiles of the time series in juxtaposition to these exogenous factors. Figure 1 demonstrates the variation of daily load profiles given certain calendar features. All figures from 1a to 1d illustrate the average daily load of Portugal as a reference point, while they additionally respectively depict: i) the average daily load on holidays versus non-holiday days, ii) the average daily load on weekends versus weekdays, ii) the inter-season daily profiles and ultimately iv) the daily profiles across different average daily temperature levels. Regarding the intra-day fluctuations, derived the average daily profile (black curve), four main intervals of varying time series behavior can be extracted: 6 A PREPRINT - SEPTEMBER 26, 2023 (a) Average daily electricity load across holidays and non- holiday days. (b) Average daily electricity load across weekends and week- days. (c) Average daily electricity load across the four different seasons of the year. Figure 1: Average daily profiles of the Portuguese national electricity load time series grouped by selected calendar features(season of the year, holidays weekends) and weather features (temperature in Lisbon). The average load curve is also included in these graphs as a point of reference (d) Average daily electricity load across different average daily temperature levels. • early morning (23.00-04.00): During these hours an almost linear and decreasing pattern can be observed in the load profile given that most companies do not operate and households gradually reduce their electrical energy consumption. • morning (04.00-09.00): A steadily increasing trend is observed within the load profile curve as every day life gradually recovers to its usual patterns; • midday (09.00-17.00): This is a volatile period of the day corresponding to ordinary working hours. The load curve is noisy, however it maintains a rather constant level within this interval. • night (17.00-23.00): A convex curve can be observed, corresponding to the consumption of peak hours when people get back from work, followed by the late night drop caused by the termination of most daily activities. Considering the external variables, we observe that on holidays: a) the lower load values during the early morning hours are shifted towards later hours of the day as citizens tend to wake up later; b) the load exhibits a lower mean value than on non-holiday days; c) a notable load decrease during working hours; d) a peak shift towards later hours regarding the usual night peak of 8 p.m. Similar conclusions can be drawn for weekends and weekdays with the exception of the late night peak shift. Regarding the per season average load profiles, the deviations among seasons are still visible with the naked eye. During the winter period a significant increase of the average load and peaks is observed due to the presence of heating loads alongside the full operation of industrial/working activities. Autumn profiles exhibit a similar behavior to the average load profile, which is expected due to the presence of both hot and cold days during this season. Summer and spring profiles tend to exhibit lower load levels in general, suggesting that high load values 7 A PREPRINT - SEPTEMBER 26, 2023 Figure 2: Scatter plot of the average daily electricity load across the respective average daily temperature levels. The locally weighted regression [8] line is also included in the graph with red color. are mainly driven by higher heating demand, especially at night hours when temperatures are typically lower. On the contrary, cooling loads seem to mainly affect late midday hours when the temperature is higher and this is exactly the interval when the summer profile is above that of spring. Note that summer is also linked with holidays and therefore the average level of the load profile is expected to be lower compared to other seasons as, except for cooling loads during the day, the rest of the loads are functioning to a smaller extent. Nevertheless, as seasons involve mixed temperature levels and the effect of the latter cannot be directly observed, we additionally include Figure 1d that illustrates the effect of average daily temperatures on the average load curve. Note here that the thresholds for temperature levels have been chosen based on the the Portuguese regulation on the energy performance of residential buildings (REPRS) [52, 53]. These temperatures are 18◦C for heating degree-days (HDD) and 25◦C for cooling degree-days (CDD). Specifically, we observe that the shape of the daily load profile for average daily temperatures lower than 18◦C (cold days) is similar to the winter period, exhibiting however significantly lower magnitudes. This can be attributed to the fact that the average temperature of winter months within our data set is 12.08◦C, therefore implying that lower demand for heating loads is expected for average daily temperatures below 18◦C, which apparently do not correspond to pure winter days. Subsequently, for high temperature profiles we can also observe that the respective load curve exhibits high magnitudes, especially during the midday where usually the demand from cooling loads is increased while a certain decrease is notable during the night, despite the fact that people get back to home, as lower temperatures will be normally be observed there. To validate the assumption that hourly load values and daily load profiles are strongly dependent on the temperature levels, we also include the scatter plot of average daily loads against the respective average daily temperatures. We observe a bimodal joint distribution of said quantities leading to the conclusion that cold days can co-exist with extremely high as well as extremely low loads. The same can be observed for hot days. This behavior can be attributed to holidays and weekends (lower region) which, as observed from Figures 1a and 1b, exhibit on average much lower average loads contrary to working days (upper region). The locally weighted regression [8] line (red color) that is also included in the graph clearly demonstrates the non-linear relationship among the two quantities, highlighting the fact that hot and especially cold days have a high impact on the increase of the load due to the functioning of cooling and heating systems, respectively. The above observed intra-day patterns between the load and the external variables (calendar and temperature) reveal a certain correlation which implies potential performance drifts of different forecasting models across the different state of said variables. Hence, the motivation for explaining model errors based on such external variables becomes indisputable and forms one of the main objectives of our study. 2.2 Selected models and benchmarks To conduct our comparative analysis, an indicative set of models was considered to demonstrate the different aspects of current state-of-the-art DL architectures. When evaluating forecasting models, it is necessary to introduce concrete benchmarks. Therefore, two seasonal naive (sNaive) models of daily and weekly seasonality were first employed. 8 A PREPRINT - SEPTEMBER 26, 2023 Moreover, since our aim is to investigate the performance of the currently popular LSTM–which is selected as the representative of RNNs– with that of alternative DL architectural setups, we also employ feed-forward NNs using MLP as a pure traditional NN and N-BEATS as a feed-forward approach with residual-stacking that is tailored for time series forecasting. Subsequently, we include TFT as a recurrent/feed-forward hybrid, and finally, to further extend the scope of our comparisons, we also employ TCN as a convolutional candidate. The selected DL models and benchmarks are presented below in more detail: sNaive (24) This naive model of daily seasonality uses the observed values of the previous day as day-ahead forecasts. The method is expected to generate poor results as electricity load time series exhibit multiple seasonal cycles, being strong at both daily and weekly level. sNaive (168) This naive model of weekly seasonality uses the observed values of the same day of the previous week as day-ahead forecasts. The method is expected to produce moderate results as it can effectively take into account daily and weekly seasonality. Multi-layer perceptron (MLP) This is the most common DL architecture, consisting of multiple perceptrons (or neurons) arranged in multiple layers. Each individual neuron's output is calculated using the function of Equation 1. n (cid:88) y = f ( i=1 (wixi) + b) (1) The weighted (with weights wi) sum of the outputs (xi) of all the neurons in the previous layer plus a bias term (b) is computed first. Then, the activation function f is applied to this result. The purpose of this function is to enable the model to capture nonlinear relationships among the inputs (lags) and outputs (forecasts). Various activation functions have been used in literature, the most popular being the rectified linear unit (ReLu) of Equation 2. During the training process of a MLP, the back-propagation algorithm is used. The weights and biases of the MLP are iteratively updated according to the following equation f (x) = 1 1 + e−x (2) wk ij(t + 1) = wk ij(t) − α ∂L ∂wk ij , (3) where wk ij(t) is the weight connecting the i-th neuron of a layer with the j-th neuron of the previous layer at iteration t of the algorithm, α is the learning rate, and L is the loss function. The gradient is computed using the chain rule, and the algorithm needs to be run after each forward pass of the training. In this study, the Scikit-Learn [45] machine learning toolkit, and specifically the MLPRegressor class, was used to implement the MLP model. Long short-term memory (LSTM) LSTM is an extension of the classical RNN that came to solve the vanishing gradient problem, mitigating RNNs' inability to learn long range dependencies [23]. LSTM has been extensively used for sequence modeling and time series forecasting. It is capable of learning long-term dependencies by introducing a memory cell and three different gates, namely the input gate, output gate, and forget gate. This allows the network to store information over a large number of time steps, which is crucial for time series forecasting. The LSTM architecture can be represented mathematically as shown below: ft = σ(Wf * [ht−1, xt] + bf ), it = σ(Wi * [ht−1, xt] + bi), ot = σ(Wo * [ht−1, xt] + bo), gt = tanh(Wg * [ht−1, xt] + bg), ct = ft * ct−1 + it * gt, ht = ot * tanh(ct), 9 (4) A PREPRINT - SEPTEMBER 26, 2023 where ft, it, ot are the forget, input, and output gates, gt is the cell state, ct is the memory cell, ht is the hidden state at time step t, and bk the respective bias of gate k. Backpropagation through time is used to train calculate the gradients of LSTM architecture and gradually update their weights. Focusing on encoder-decoder architectures, they can be used for time series forecasting by recurrently encoding the input sequence into a fixed length vector, and then recurrently decoding it back into a sequence of predictions as the encoder and decoder are typically implemented using RNNs and more often LSTMs. The hidden dimension of the encoder and decoder is an important hyperparameter that needs to be the same for the two components in order for the model to function properly. Another important hyperparameter of an encoder-decoder LSTM is the number of recurrent layers in the encoder and decoder. Typically, increasing said number leads to more complex models that are prone to overfitting and generalize poorly on previously unseen data. Hence, the selection of these hyperparameters should be handled with care. The encoder-decoder architecture can be represented as shown below: ht = LSTMencoder(xt) ˆyt = LSTMdecoder(ht) (5) where ht is the hidden state of the encoder at time step t and ˆyt is the forecast at the same step. In this study, the Darts [20] forecasting toolkit was used to implement the LSTM model, exploiting the BlockRNNModel class. Neural basis expansion analysis time series forecasting (N-BEATS) N-BEATS is a deep feed-forward neural network, introduced by Oreshkin et al. [40] in an attempt to demonstrate that a pure autoregressive DL models can outperform traditional forecasting methods. The N-BEATS architecture consists of n stacks, which comprise m fully connected non-linear neural regressor blocks, interconnected with double residual links. Each block has a fully connected stack of k layers using the ReLU activation function. The first block receives an input ˆx1 ≡ ˆx, whereas the other blocks receive an input ˆxm, producing two distinct outputs, namely the backcast ˆbm and the forecast ˆfm. The former (ˆbm) is subtracted from the input of the next block as in Equation 6 and is referred to the part of the input that has been predicted adequately, while the latter ( ˆfm) is a partial forecast to predict the future. ˆxm = ˆxm−1 − ˆbm−1 (6) This strategy is called double residual stacking and contributes to both forecasting and decomposing the target time series. The outputs of the blocks ( ˆfm) are aggregated to produce the forecast ( ˆfn) of each stack, as shown in Equation 7, and it is used to calculate the loss function and train the model. Finally, the outputs ( ˆfn) of the stacks are combined to produce the forecast (ˆy) of the model, as shown in Equation 8. ˆfn = m (cid:88) i=1 ˆfm (7) ˆy = n (cid:88) i=1 ˆfn (8) In this study, the Darts forecasting toolkit was used to implement the N-BEATS model. The generic form of the architecture was used without considering the ensembles originally proposed by Oreshkin et al. [40]. Temporal convolutional network (TCN) TCN, first introduced by Bai et al. [5], is a type of neural network architecture that has been specifically designed for processing sequential data. Specifically, TCN is a CNN that consists of dilated, causal 1-dimensional convolutional layers with the same input and output lengths. Stack dilated convolutional networks are constructed to capture long term temporal dependencies, enabling large receptive fields with the use of a reasonable amount of layers. Equation 9 shows the basic formula characterizing a temporal convolutional layer w[i, j] ∗ x[j], (9) y[i] = b[i] + (cid:88) j 10 A PREPRINT - SEPTEMBER 26, 2023 where x is the input sequence, w is the weight matrix of the layer, b is the bias vector, y is the output sequence, while i and j are the indexes of the time step in the input and output sequence, respectively. The depth of the network is determined by the number of convolutional layers while the width of the network is determined by the number of filters in each convolutional layer. The size of the kernel plays a crucial role, allowing the network to learn more global patterns in the data. The residual block has a doublet of dilated convolutional layers followed by a batch normalization operation and a ReLU activation. Regarding the receptive field (R) of a TCN, it is usually calculated using the number of convolutional layers (l), the dilation base (b), and the kernel size (k), as shown in Equation 10. The purpose of such calculation is to assure that the receptive field is large enough to process the input variables. R = bl * (k − 1) (10) In this study, the Darts forecasting toolkit was used to implement the TCN model. Temporal fusion transformer (TFT) The TFT is a powerful neural architecture for time series forecasting that combines the strengths of transformers [68] and autoregressive models. They were first introduced by Lim et al. [32] and have been specifically designed to handle the challenges of temporal data, making them well-suited for accurate predictions in various forecasting tasks. TFT operate on the concept of encoding both the input features and the temporal context of the time series data. This is achieved through the integration of self-attention mechanisms within the transformer architecture. The self-attention mechanism enables TFT to capture the dependencies between different time steps, effectively modeling the temporal dynamics present in the data. The key component of a TFT is the fusion layer, which combines the encoded input features and the temporal context representations. The fusion layer utilizes gating mechanisms to adaptively weight the importance of each representation. This enables the model to effectively integrate both local and global temporal information, resulting in improved forecast accuracy. Mathematically, the fusion layer can be represented as in Eq. 11. zt = σ(Wz[xt, ct] + bz), gt = softmax(Wg[xt, ct] + bg), c′ t = gt ⊙ ct + (1 − gt) ⊙ zt, (11) where xt represents the input features at time step t, ct is the temporal context representation at time step t, Wz and Wg are weight matrices, bz and bg are bias vectors, σ denotes the activation function, softmax is the softmax function, and ⊙ represents element-wise multiplication. The fusion layer is typically applied iteratively across multiple time steps, allowing the TFT to progressively update the temporal context representation based on the input features. This iterative process enhances the model's ability to capture complex temporal patterns and improve forecast accuracy. In this study, the Darts forecasting toolkit was used to implement the TFT model. 2.3 Model training and validation The objective of the training process has been the development of DL models for day-ahead load forecasting at hourly resolution for the net aggregated electricity demand of the Portuguese transmission system. Regarding the model training pipeline, every DL model was: (i) trained on the train set (years 2013 to 2019: 61,344 data points); (ii) optimized on the validation set (year 2020: 8,784 data points) to identify appropriate hyperparameter values; (iii) and evaluated on the remaining, previously unseen test set (year 2021: 8,760 data points) without retraining the model on the full data set. This split allowed the inclusion of complete calendar years within each data set, thus maintaining the symmetry of seasonal patterns. Regarding the sampling procedure, the training set comprises Ntrain samples as shown in Equation 12. Ntrain = ktrain − l − f + 1 = 61, 321 − l (12) where ktrain is the number of data points in the train set, f the forecast horizon (24 hours), and l the look-back window used by the model. Similarly, the validation set consists of Nval samples, as shown in Equation 13. where kval is the number of validation data points. With respect to the testing process, the test set contains Ntest samples, as shown in Equation 14, given that the model evaluation took place at a daily basis rather than hourly, Nval = kval − f + 1 = 8, 761 (13) 11 A PREPRINT - SEPTEMBER 26, 2023 Table 1: The hyperparameters optimized per DL architecture and the respective search spaces. Architecture Hyperparameters Name Space MLP LSTM N-BEATS TCN TFT l # layers # neurons per layer activation function batch size l # RNN layers hidden dimension size batch size l # stacks # blocks # layers batch size l kernel size # filters dilation base batch size l # LSTM layers # attention heads dropout hidden dimension size batch size {24, 48,..., 480} {1, 2,..., 10} {32, 64, 128, 256, 512} {relu, sigmoid} {256, 512,..., 2048} {24, 48,..., 480} {1, 2,..., 10} {24, 48,..., 240} {256, 512,..., 2048} {24, 48,..., 480} {1, 2,..., 25} {1, 2,..., 20} {1, 2,..., 10} {256, 512,..., 2048} {24, 48,..., 480} {2, 3,..., 6} {2, 3,..., 12} {2, 4, 8, 16, 32} {256, 512,..., 2048} {24, 48,..., 480} {1, 2, 3, 4} {1, 4} {0, 0.1, 0.3, 0.5, 0.7, 0.9} {16, 32, 64, 128, 256} {256, 512,..., 2048} considering daily forecast batches of 24 hours. Ntest = ktest f = 365 (14) Note here that the optimizers of each individual model have been programmed to minimize the L2 loss, namely squared error loss, following a mini-batch gradient computation approach while considering all possible rolling windows i.e 00:00 - 23:00, 01:00 - 00:00 (next day), 02:00 - 01:00 (next day) etc. To prevent overfitting early stopping was applied with a patience of 10 epochs on the loss of the validation set. All models have been trained on the scaled version of the time series using a normalization approach within the [0,1] space. Note also that scaling took place using the range of values observed in the training set. With respect to hyperparameter tuning, the selected DL architectures were trained on multiple sets of hyperparam- eter values using the tree-structured parzen estimator (TPE) hyperparameter optimization method, as described by Bergstra et al. [6] and implemented in Python programming language in Optuna optimization library [1]. A crucial hyperparameter that is common among all models, is the look-back window (l), namely the number of historical time series values (lags) that the model looks back at when being trained to generate forecasts. Note that l directly determines the input layer size of the trained neural network. The specific details of the optimization process for each architecture are presented in Table 1 where only the hyperparameters that were tuned are presented, while the rest of the hyperparameters were set to their default values, as proposed by the respective Python implementation frameworks (Darts, Scikit-Learn), apart from some small exceptions that are listed in section 3.1. A total of 100 trials were executed for selecting the optimal DL architecture based on the minimum MAPE value on the validation set. This time, the calculation of said metric was performed iteratively using a stride of 24 hours, hence selecting the optimal forecasting model for complete calendar days (only forecasts of the 00.00-23:00 intervals). Following the identification of the best model architecture in terms of hyperparameter values, 30 separate networks sharing the same hyperparameters but different pseudo-random initializations of neural weights were trained for each DL architecture. Then, an ensemble of these models was used to produce the final forecasts on the test set. To improve the robustness of the results, the median operator was used to aggregate the forecasts of the individual models [30]. 12 A PREPRINT - SEPTEMBER 26, 2023 Note that the sub-models of each ensemble were trained on the union of the training and validation sets for a predefined number of epochs as established from the hyperparameter optimization stage therefore not requiring early stopping. The training, validation, and ensembling of the models was executed on an Ubuntu 22.04 virtual machine with an NVIDIA Tesla V100 GPU, 32 CPU cores, and 64GB of RAM. 2.4 Evaluation of forecast accuracy With respect to the evaluation of forecast accuracy, various forecasting performance measures are common in the literature, such as the mean absolute error (MAE), the mean squared error (MSE), the mean absolute percentage error (MAPE), the root mean square error (RMSE), the symmetric mean absolute percentage error (sMAPE), and the mean absolute scaled error (MASE) Hyndman and Koehler [25]. Within the present study, the MAPE is considered as the primary evaluation measure, reporting the average magnitude of the absolute percentage errors. It is widely used in practice because it allows for easy interpretation and comparison across different forecasting models. By considering the relative magnitude of the errors in terms of actual values, the MAPE helps in understanding and communicating the overall accuracy of the forecasts. Therefore, the MAPE is a widely accepted choice in STLF applications and leads to explainable evaluations. Specifically, we used the MAPE as the objective function during the hyperparameter optimization process and as the main criterion for evaluating the models and investigating their appropriateness for different calendar and weather conditions. MAPE is defined as shown in Equation 15. M AP E = 1 m m (cid:88) t=1 (cid:12) (cid:12) (cid:12) (cid:12) yt − ˆyt yt (cid:12) (cid:12) (cid:12) (cid:12) * 100(%) (15) where m represents the number of samples, while yt and ˆyt stand for the actual values and the forecasts at time t, respectively. Nevertheless, MAPE has some limitations. It can be sensitive to extreme values and it may produce infinite or undefined values when the actual values are zero. Additionally, the MAPE treats positive and negative errors unequally, putting heavier penalty on negative errors (overcasting). In order to enhance the representativeness of our results and better support our discussion, we also use the RMSE as a secondary evaluation metric. The RMSE provides a symmetric measure of the dispersion or spread of the forecast errors. It is widely used because it gives higher weight to larger errors, thus penalizing larger deviations between predicted and actual values more heavily. By taking the square root of the average squared errors, the RMSE is expressed in the same units as the original data set, allowing for easy interpretation and comparison. The RMSE is calculated by taking the square root of the mean of the squared differences between the predicted values (ˆy) and the actual values (y) in the data set. Mathematically, it can be represented as: RM SE = (cid:118) (cid:117) (cid:117) (cid:116) 1 m n (cid:88) (ˆyt − yt)2 t=1 (16) where m represents the number of observations in the data set. Note here that the evaluation of the models on the validation (hyperparameter tuning) and test sets (final performance) was performed iteratively using a stride of 24 hours as also mentioned in the previous section. 2.5 Multiple linear regression for forecasting error explanation and model selection Although forecasting accuracy measures like MAPE are useful for identifying models that perform best on average, they provide no information about the conditions under which the forecast accuracy of each model is typically improved or deteriorated. In order to provide intuitive insights in this direction, for each architecture, a MLR model was estimated to correlate the MAPE values of the test set (dependent variable) with nine key forecast accuracy drivers (independent variables), as follows: • Three binary (one-hot encoded) features (F1: morning, F2: midday, F3: night), representing the time of day. The "early morning" variable was dropped from the model to avoid undesirable multicollinearity effects. • Three binary features (F4: winter, F5: spring, F6: autumn), representing the season of the year. The "summer" variable was dropped to avoid undesirable multicollinearity effects. • One binary feature (F7: holiday), representing the Portuguese national holidays. The "non-holiday" variable was dropped to avoid undesirable multicollinearity effects. 13 A PREPRINT - SEPTEMBER 26, 2023 • One binary feature (F8: weekend), representing weekends. The "weekday" variable was dropped to avoid undesirable multicollinearity effects. • One numerical feature (F9: temperature) representing the temperature in the city of Lisbon. This variable was introduced as an extra dependent variable in the MLR problem, as it is known to affect electricity load patterns [36, 9, 15]. Hence, each of the MLR models can be formulated as follows: M AP Ek = aF 1k + bF 2k + ... + hF 3k + iF 9k (17) where M AP Ek is the error generated for the kth data point of the selected test set (year 2021) and F ik the value of variable F i at the same point. Before estimating the models, both dependent (MAPE) and independent (external features) variables were 1% trimmed in order to mitigate the effect of extreme values and enhance the representativeness of the results. Note that each MLR model can effectively serve as a framework for decomposing and explaining forecasting perfor- mance, predicting forecast accuracy and, consequently, allowing to conditionally select the most appropriate forecasting model based on the specific needs of the use case posed by an EPES stakeholder. 3 Results In this section, the results of the study are presented and discussed, addressing two main aspects as follows: • The macroscopic comparison and ranking of the selected DL architectures in terms of forecast accuracy in the examined STLF task (Section 3.1). • The detailed results of the MLR models, accompanied by explanatory comments regarding each architecture's performance, as well as model selection insights based on the selected calendar and weather features (Section 3.2). 3.1 Forecasting accuracy Initially, the results of the training and hyperparameter tuning processes are summarized, leading to the final architectures and weights for each of the selected forecasting methods. The computational times for running the 100 TPE trials are also listed along with the times required for training the models of each ensemble as they are indicative of the resources needed in real life for their implementation. The results are as follows. sNaive (24): No optimization took place as there are no hyperparameters to tune. The method required 1 minute to produce forecasts for the complete test set. sNaive (168): No optimization took place as there are no hyperparameters to tune. The method required 1 minute to produce forecasts for the complete test set. MLP: The TPE optimization process of the MLP architecture ran for 199 minutes to converge to the following hyperparameter values: l: 192, # layers: 2, # neurons per layer: [256, 256], activation function: relu, batch size: 1024. Given these values, each model of the ensemble was trained for 2.12 minutes on average, running for a total 109 epochs. Note here that the alpha parameter of the MLPRegressor class was set to 0 to avoid any regularization. The method required 1 minutes to produce forecasts for the complete test set. LSTM: The TPE optimization process of the LSTM architecture took 1,664 minutes to converge to the following hyperparameter values: l: 240, # RNN layers: 3, hidden dimension size: 48, batch size: 1,280. Given these values, each model of the ensemble was trained for 22.6 minutes on average, running for a total 180 epochs. The method required 1 minutes to produce forecasts for the complete test set. N-BEATS: The TPE optimization process of the N-BEATS architecture took 2589 minutes and resulted to the following set of hyperparameter values: l: 192, # stacks: 3, # blocks: 6, # layers: 3, batch size: 1,536. Note here that the layer widths and the dimension of the expansion coefficient have been set to 64 and 5 respectively. Given these values, each model of the ensemble was trained for 13.1 minutes on average, running for a total 108 epochs. The method required 1 minutes to produce forecasts for the complete test set. 14 A PREPRINT - SEPTEMBER 26, 2023 Table 2: Evaluation of the selected DL methods on the test set (2021) in terms of forecasting accuracy (MAPE% and RMSE) and computational cost (minutes). The first sub-column under each measure (MAPE% and RMSE) lists its average value alongside the standard deviation of the 30 models involved in each ensemble. The second subcolumn lists the performances of the respective ensemble models (median of individual forecasts). The last column of the table reports the time required for tuning the hyperparame- ters of each architecture and training the models included in the ensembles. Architecture MAPE % Individual models Ensemble RMSE Cost (minutes) Individual models Ensemble Tuning & training sNaive (24) sNaive (168) MLP LSTM N-BEATS TCN TFT 6.52 4.29 2.44 ± 0.15 2.63 ± 0.14 2.43 ± 0.13 2.52 ± 0.09 3.36 ± 0.17 - - 2.02 2.23 1.90 2.22 2.17 551.54 402.49 211.62 ± 9.91 259.1 ± 16.4 213.7 ± 13.2 226.1 ± 5.8 301.1 ± 14.6 - - 187.02 213.19 181.68 205.25 208.13 1 1 262 2,343 2,983 5,349 6,653 TCN: The TPE optimization process of the TCN architecture took 3,698 minutes to converge to the following set of hyperparameter values: l: 456, kernel size: 4, # filters: 10, dilation base: 8, batch size: 256. Given these values, each model of the ensemble was trained for 55 minutes on average, running for a total 296 epochs. The method required 1 minutes to produce forecasts for the complete test set. TFT: The TPE optimization process of the TFT architecture took 4732 minutes to converge to the following set of hyperparameter values: l: 168, # LSTM layers: 2, # attention heads: 4, dropout: 0, hidden dimension size: 128, batch size: 1280. Given these values, each model of the ensemble was trained for 64 minutes on average, running for a total 46 epochs. The method required 1 minutes to produce forecasts for the complete test set. Taking into consideration the ensemble modeling approach (median of 30 networks) that followed the hyperparameter optimization process, the final performance of each architecture for year 2021 is summarized in Table 2. Regarding the benchmarks, sNaive (128) performs much better than sNaive (24) as it replicates weekly seasonality which is significantly stronger in electricity load time series. Regarding the DL methods, initially we observe that all DL architectures outperform the sNaive benchmarks. This is an expected result as sNaive models simply replicate past values and do not involve any learning process. Subsequently, we note that the feed-forward architectures, namely N-BEATS and MLP, clearly outperform the LSTM, TCN, and TFT models in terms of forecasting accuracy, with N-BEATS reaching the lowest MAPE of 1.90% and RMSE of 181.68. The MLP follows with a significantly low error of 2.02% and an also low RMSE of 187.02 despite the simplicity of its architecture and its limited computational requirements. This is an impressive result for an architecture that has not been originally designed for handling sequential data. However it completely justifies its popularity and extensive usage along the years within time series forecasting and specifically STLF fields. TCN and LSTM perform at a similar level in terms of MAPE (2.22% and 2.23% respectively), while the former scores better in terms of RMSE than both the latter and TFT –which exhibits a comparatively moderate MAPE of 2.17 despite the complexity of its architecture and its high computational requirements. Last but not least, it is notable that although the validation set mainly contained a period that has been highly affected by the COVID-19 pandemic [46], the selected DL architectures manage to perform impressively well on average. Taking into consideration that the evaluation results derived by MAPE are in general alignment with those provided by RMSE, apart from insignificant deviations, from now on our study primarily focuses on MAPE to discuss further lower-level concepts regarding model accuracy. To validate the added value of the ensembling strategy, Table 2 lists both the average forecast error of the individual models involved in each ensemble and the respective standard deviation of said errors. These results are also visualized in Figure 3. As seen, the accuracy of the ensemble is always higher than that of the respective individual models, implying that the examined strategy cannot only ensure robustness by avoiding inaccurate forecasts, but also leads to superior accuracy overall. Note here the spectacular improvement (1.19%) demonstrated by the TFT ensemble (2.17%) compared to the respective individual models whose average error is (3.36%). The latter can be attributed to the large variance among individual TFT forecasts errors that leads to significant neutralization of the median prediction. Note also that said large errors for the individual TFT models imply significant overfitting during the training process which is an obvious consequence of the large complexity of this model. To further investigate the differences reported between the examined DL methods and the benchmarks considered, we conduct the multiple comparisons with the best (MCB) test [29]. The test computes the average ranks of the forecasting 15 A PREPRINT - SEPTEMBER 26, 2023 Figure 3: Boxplots summarizing the accuracy (MAPE) of the 30 individual models (same hyperparameter values but different neural weight initializations) used to form the ensemble of each DL architecture. The MAPE of the ensemble is also depicted. Figure 4: Average ranks and 95% confidence intervals of the four DL forecasting models and the two benchmarks considered in the present study. The multiple comparisons with the best test, as proposed by Koning et al. [29], is applied using MAPE for ranking the methods. methods according to MAPE across the complete test set and concludes whether or not these are statistically different. Figure 4 presents the results of the analysis. If the intervals of two methods do not overlap, this indicates a statistically different performance. Thus, methods that do not overlap with the gray interval of the figure are considered significantly worse than the best, and vice-versa. The results of the MCB test confirm that N-BEATS and MLP are significantly more accurate than the rest of the methods with N-BEATS being the clear winner. The rest of the already discussed results are also confirmed by the MCB test. 16 A PREPRINT - SEPTEMBER 26, 2023 3.2 Explaining the performance of forecasting models Table 3 presents the coefficients estimated by the MLR models, aiming to explain the forecasting performance achieved by the DL methods and the benchmarks using as accuracy drivers the selected calendar and weather features. The goodness-of-fit coefficient R2 is also reported to measure the capability of the MLR models to identify strong correlations. Before interpreting the results of Table 3, the following should be noted: • The calendar variables are binary and therefore their coefficients denote the extent to which the forecast error is increased on average during the time period they represent. On the contrary, temperature is a continuous variable, and the respective coefficients demonstrate the average increase in MAPE that is expected given a rise in the temperature by 1◦C. • The coefficients calculated by fitting the MLR models do not directly reflect the absolute fluctuations of the MAPE values across different models but rather the relative variation around the corresponding average value of a given model. This is a result of building each MLR model independently for each forecasting method. To address this issue, the complementary bar charts of Figure 5 are required to establish a complete comparison among the different models with regard to accuracy. The reader can also refer to appendix A for additional bar charts that measure the forecasting accuracy using the RMSE metric. Note that the results of the RMSE are in general agreement to those produced by MAPE. However, they can provide useful insights on the variance of model performance across different time periods as we will explain later on. • Drawing conclusions for the "early morning" hours and the "summer" periods is not possible due to the exclusion of these features from the MLR models to avoid severe multicollinearity problems. However, the selection of these variables was not random as these periods were usually characterized by lower forecast errors, thus exhibiting less interest for explanatory insights. • The considered features explain more than half of the MAPE variance (R2 values higher than 0.5). Although including more external variables could result to higher R2 values, given the randomness of the series and the challenges present in STLF, we suggest that this value still suggests an adequate amount of explainability. • All the coefficients of the MLR model have proved to be statistically significant with p-values lower than 0.05. This reinforces the validity of the observations and conclusions extracted in the paragraphs to follow. Table 3: The estimated coefficients of the MLR models aiming to relate the MAPE values generated by sNaive (24), sNaive (168), MLP, LSTM, N-BEATS, TCN, and TFT in the test set of the study with the selected calendar and weather features. sNaive (24) sNaive (168) MLP LSTM N-BEATS TCN TFT morning midday 2.96 0.63 0.60 0.93 0.63 0.47 0.85 4.65 1.55 1.56 1.93 1.62 1.10 1.81 night winter 2.26 1.19 1.05 1.56 1.15 0.60 1.48 1.30 4.93 1.08 1.28 1.04 1.56 1.37 spring 0.93 0.72 0.33 0.44 0.29 0.27 0.35 autumn 0.38 1.25 0.38 0.41 0.26 0.31 0.40 holiday weekend 4.92 6.64 4.49 3.80 3.58 5.47 4.18 6.04 0.45 0.34 0.62 0.21 0.22 0.31 temperature R2 0.06 0.07 0.02 0.01 0.02 0.04 0.01 0.58 0.55 0.57 0.57 0.54 0.59 0.57 Benchmarks As seen from Table 3 and Figure 5, the forecast error of the sNaive (24) benchmark is not particularly affected by the season of the year as this factor cannot contribute much to the overall accuracy of the method given the short-term (daily) periodicity it assumes. However, sNaive (24) is significantly less accurate on holidays and weekends, which is expected given that said days have different load patterns than weekdays. Mediocre results are also observed for the "time of day" variables as switching among time periods affects the performance of sNaive (24) when transitioning from weekends to weekdays, and vice-versa. Regarding sNaive (168), the method is less sensitive to the "time of day" features (morning, midday, night) as by using the values of the previous week as forecasts the benchmark manages to capture the weekend to weekday transitions. Similar conclusions are true for the "weekend" variable as well. Nonetheless, on holidays, sNaive (168) still exhibits great errors given that holidays are not subject to weekly seasonality. Additionally, as holidays tend to be concentrated within small periods of time (e.g. Christmas period)–also accompanied by other semi-vacation days due to days off that are given by most companies to their employees– forecasts of weekly seasonality result to low accuracy for long periods of time, both including vacation days and the first week to come after them. With respect to the "season" variables, the forecast error of the sNaive (168) method is negatively affected in winter, which can be attributed to i) the aforementioned irregularity within the Christmas holidays period and ii) the fact that changes in temperature among different weeks can lead to significant load curve alterations during the winter, given Figure 2. Similarly, "autumn" 17 A PREPRINT - SEPTEMBER 26, 2023 exhibits a relatively large coefficient value, potentially caused by the switch from summer to autumn that signals the return from holidays and thus an expected notable variation in the load curve from one week to another. It can be also observed that the increase of the temperature reduces the accuracy of both benchmarks, demonstrating a certain increase in the variability of the time series that cannot be captured effectively by the naive models. (a) Performance of the models across different times of the day. (b) Performance of the models across different seasons. (c) Performance of the models across holidays and non- holidays. (d) Performance of the models across weekends and non- weekends (weekdays). Figure 5: Performance of the models across different calendar features, as measured by MAPE. DL models Before discussing the MLR coefficients of the DL models and their absolute performance across the the different values of external variables based on the bar plots of Figure 5, it should be first noted that all DL architectures 18 A PREPRINT - SEPTEMBER 26, 2023 Figure 6: Performance of the models across average daily temperature levels perform better overall compared to the naive benchmarks, irrespective of the feature in question. This is expected and confirmed by Figure 5. This observation is not to be confused with the magnitude of the MLR coefficients as naive models often involve smaller values than DL models, thus denoting a smaller relative increase to their average forecasting error, caused by a specific external variable. An additional preliminary observation is that, in general, all models mostly demonstrate a certain performance consistency meaning that they do not deviate significantly in terms of ranking across the studied calendar and weather features. In the same context, the feed-forward networks i.e. N-BEATS and MLP demonstrate a consistent superiority against the rest of the architectures with nearly no exceptions at all to that for N-BEATS. Therefore, in the rest of this section we mainly discuss what noticeably deviates from this basis. Starting from the "time of day" variables, according to the MLR model of Table 3, MLP, LSTM, N-BEATS, and TFT seem to be affected in a similar fashion to sNaive (168) by the alteration of seasons, exhibiting relatively low coefficient values that indicate a satisfactory modeling of the daily seasonal pattern. Specifically during midday and night, the high variability and the frequent changes in the monotony of the load and the peak load (see Figure 1), lead to larger forecast errors compared to other calendar features, with TCN being however less affected by said changes compared to the rest of the DL models already implying a somehow underfitted model. In general, N-BEATS and MLP demonstrate the best performances from a "time of day" perspective while the rest of the models exhibit alternating behavior. However, while N-BEATS tends to perform better in general, the MLP produces also notably accurate forecasts during the night which is a period of peak load and significant variability. Note here that midday is the less forecastable time interval for all models due to its volatility across seasons, and especially cold and hot days, both in terms of load magnitude and shape. Also note that higher accuracy in terms of MAPE during hours of peak load, such as night hours, can usually lead to inconsistencies between MAPE and RMSE rankings as the presence of high load values during this interval results to higher absolute errors (RMSE) given a specific relative error (MAPE). In this context, this is the period where TCN: i) highly outperforms its close competitors (TFT, LSTM) and as from A.1a, and ii) its performance is close to that of the best models (N-BEATS and LSTM). Hence, we can confirm that the former deals better with peak load hours. Similarly, a slight alteration can be also observed in the ranking between N-BEATS ans MLP according to the RMSE, implying the more accurate forecasting by MLP of the peak loads observed in this interval. With respect to calendar variables relating to the seasons of the year, the DL models exhibit a certain insensitivity to the respective features (especially spring and autumn). This is confirmed by the relatively small coefficient values of Table 3 alongside Figure 5b where it is found that all DL models produce errors that are relatively close to their average. It can be observed, however, that during winter months the forecastability of the models decreases significantly compared to other seasons, leading to both increased MLR coefficients and average MAPE values. This behavior can be justified by Figure 1c where it was observed that the average daily load profile during the winter period significantly differs from the rest of the seasons both in terms of shape and magnitude due to the consistent electricity demand by heating systems. Note here that among the DL models, N-BEATS and MLP seem to perform better during this period, capturing the winter load patterns more sufficiently. Similarly to the night variable, the TCN demonstrates lower accuracy in terms of MAPE compared to TFT and LSTM but exhibits a significantly higher accuracy in terms of RMSE which again implies its good performance on peak load forecasts that are even higher during the winter. Similar conclusions can be drawn again for the MLP. Therefore, it is confirmed that MLP and TCN tend to focus on peak load hours compared to their close competitors (N-BEATS and TFT, LSTM respectively). This can be attributed to the fact that such networks, given 19 A PREPRINT - SEPTEMBER 26, 2023 their relative implementation simplicity, tend to stick to their training objective (L2 loss) ignoring the reduced load periods that have low impact on it. With regard to holidays, TCN seems to be more sensitive than sNaive (24) as it can be observed from the notably larger MLR coefficients of said models (see Table 3). Regarding the absolute performance, all DL models perform better on average than the benchmarks. In general, holidays seem to be the feature that most deteriorates forecast accuracy. This becomes obvious in Figure 1c where a large increase from the average MAPE is observed for all DL models. In this case, LSTM and particularly N-BEATS exhibit the lowest deficits, reaching a MAPE of 7.22 % and 6.28 %, respectively. The relatively small error of the latter model demonstrates the ability of N-BEATS to capture the substantial alterations of the load curve during national holidays, confirming its robustness and superiority throughout distribution shifts that tend to appear less frequently within an electricity load time series. Again, based on the previous observations on MLP and TCN regarding underfitting and limited focus on low load periods the low accuracy here is expected. With respect to TFT, it seems to preserve its moderate performance profile similar to most of the previous cases. This fact that can be attributed to the large variance of the individual models forming the TFT ensemble, therefore leading to a certain neutralization of any extreme behaviors. Concerning the weekend variable, all models seem to be less sensitive than both naive methods given their MLR coefficients (see Table 3), apart from the LSTM. This can be credited to the vanishing gradient problem of LSTM networks as they always need to propagate the gradient for at least 5 days in the past during training in order to access the required knowledge for weekend forecasts. Nevertheless, since weekends are observed with a certain periodicity and the input vector (l) of all DL models is larger than a week, weekends are relatively forecastable, resulting to low MLR coefficient values. In this case, TCN and N-BEATS have the lowest coefficient, while TFT, and MLP, fall somewhere in the middle. Regarding the absolute performance of models (Figure 5), with the exception of the poor performing LSTM, it can be confirmed that both weekdays and weekends are forecast with near to average errors, however with a relatively reduced performance on weekends instead of weekdays. The latter can be attributed to the fact that weekend days are fewer in number while they are mostly related with low load levels, therefore leading to insufficient optimization of the L2 loss during model training, as already discussed. With respect to the temperature, according to the MLR model, this variable also has a notable effect on forecast accuracy. This is because, although the estimated coefficients are of relatively low values, the temperature variable is the only non-binary one, thus implying the multiplication of said coefficients with values that range from -1 ◦C to 36.4 ◦C and therefore a significant impact on the forecast error. This finding is also evident in Figure 6, where we find that lower temperatures typically result to higher forecast errors. This is expected as, during the winter, slight changes in the temperature can significantly alter the load magnitudes rendering the period harder to predict (see Figure 2) as above mentioned. An exception to that is the TCN, which, during hot days, exhibits impressively large absolute errors, which can be attributed to the distortion of the respective load curve and the missing peak during the night which has been the main interval of excellence for this model. Nonetheless, such conclusions cannot be considered safe taking into consideration the high multicollinearity of the temperature with the season and time of day factors alongside the multimodal nature of the joint load and temperature distribution (see Figure 2). Therefore, the following section focuses on the explicit effect of the temperature on the forecast error by investigating its value as a predictor variable within the examined DL models. 4 Discussion Motivated by the exploratory data analysis of Section 2.1 and the latter insufficiency of the MLR model (see Section 3.2) in clearly explaining the effect of the temperature variable on the forecast errors of the models, in this section we explicitly investigate the contribution of the temperature explanatory variable to the forecast error. In this direction, we include the temperature as an input variable of the already implemented DL models (LSTM, MLP, N-BEATS, TCN, TFT), by extending the univariate setup that has been the focus of this study until now. Our analysis specifically focuses on examining the correlation between load forecasts using historical temperature inputs (referred to as "ex-post forecasts") rather than relying on historical forecast inputs (known as "ex-ante forecasts"). We do that for two main reasons: i) ex-ante forecasts are not publicly available and especially for that far in the past (from 2013 and on which is the beginning of our training data set), ii) much of the literature makes use of ex-post forecasts [15], aiming to investigate the impact of a hypothetically ideal weather forecast on model performance. Note here though, that in the context of real-world STLF use cases, the ex-post setup is not realistic as real temperature values are not a priori known and therefore the acquisition of ex-ante forecasts is required. This implies the need for access to (usually paid) application programming interfaces (APIs) and databases, both for real-time and historical forecasts. Subsequently, such data ingestion into production DL models, requires advanced model development skills, which are not always the case for EPES and STLF stakeholders. 20 A PREPRINT - SEPTEMBER 26, 2023 Table 4: Comparison of the results of the selected DL ensemble models on the test set (2021) in terms of forecasting accuracy (MAPE%). The first column refers to the results of the univariate versions of the models that have been also listed in Table 2. The second column refers to the performance of the multivariate setup that also incorporates the ex-post forecasts of the temperature in Lisbon as a predictor variable. Architecture MAPE % Univariate Multivariate (ex-post) MLP LSTM N-BEATS TCN TFT 2.02 2.23 1.90 2.22 2.17 1.92 2.20 2.00 2.12 2.06 The model training methodology for the multivariate load and temperature setup for the five DL models of interest follows similar steps with the above described univariate problem. In this context, the best setups from the univariate optimization process of Section 3.1 are employed again using the ensembling process described in Section 2.2. However, this time the ensembles are trained in a multivariate setting that also incorporates the ex-post forecasts of the temperature in Lisbon. The results of said multivariate setup are summarized in Table 4. From Table 4 it can be observed that all models except for N-BEATS exhibit slightly better forecasting performance in the multivariate setup. This improvement is expected as, according to the analysis of Sections 2.1 and 3.2, the temperature variable appeared to significantly affect the daily load curves and forecast errors (even though the temperature is reported for a single weather station in the city of Lisbon). Hence, our expectations are generally confirmed, except for the case of N-BEATS. This behavior can be attributed to the fact that N-BEATS has been originally designed for handling univariate forecasting tasks, as well as to its sophisticated architecture that requires the implementation of both forecasting and backcasting processes, rendering the learning process more challenging in multivariate settings. Similar conclusions for the interaction of N-BEATS with external variables have also been drawn by Pelekis et al. [46], therefore validating our findings. Nonetheless, what is notable here is that, despite the improvement of the rest of models, none of them manages to outperform the initial univariate implementation of N-BEATS which still can be considered the "winner" of our comparative study. As a final note, it should be mentioned that since the improvements of the multivariate models are based on ex-post forecasts, which would be difficult to estimate precisely in real-life conditions, the actual differences between the multivariate and univariate variants of the examined DL models could be less significant in practice. 5 Conclusions This study conducted a comparative analysis of state-of-the-art time series forecasting DL models within the STLF field, focusing on producing univariate day-ahead forecasts for the Portuguese national net aggregated electricity load. The MLP, LSTM, N-BEATS, TCN, and TFT architectures were examined, following a proper hyperparameter tuning and ensembling process. Our results suggest that feed-forward architectures are still more than capable of producing state-of-the-art forecasts despite the recent predominance of recurrent neural setups in the domain. In particular, N-BEATS consistently outperforms the rest of the DL models in terms of MAPE, reaching a value of 1.90%, while the MLP comes right after it with a MAPE of 2.02 %. TFT follows with 2.17% despite its high computational requirements and complexity, while TCN and LSTM closely follow with similar performance (2.23% and 2.22% respectively). As a result, the relevance of residual stacked feed-forward NNs is STLF confirmed. Considering the role of accurate STLF within the power grid, the reported improvements in the forecast error can lead to a significant reduction of annual operation costs for system operators and utilities due to more effective handling and management of generation planning (spinning reserves, outage reduction), imbalance markets, and demand side management. Specifically, compared to MLP, N-BEATS leads to an improvement in MAPE of 0.12%. According to Stimmel Carol [64], if such an improvement can be also extended to more granular energy forecasts, at least $3 million can be saved in operating costs of imbalance markets. Our results also highlight that ensembling can effectively mitigate the uncertainty of neural weights initialization, resulting to significantly more accurate forecasts than any individual model. Note that amongst the two top performing models, although N-BEATS performs significantly better, the MLP requires significantly lower computational resources (approximately 11 times), which may be an important factor to consider for stakeholders that possess limited compu- 21 A PREPRINT - SEPTEMBER 26, 2023 tational resources, seek more energy efficient and sustainable machine learning operations and have to re-train their models at a regular basis. In order to investigate the factors that drive the performance of each univariate DL model, a MLR model was built per case, correlating the MAPE values of the model with a selected set of key calendar and weather features. In this context, national holidays, cold/winter days and midday hours, proved to be the least forecastable instances overall. The results of this analysis can serve as guidelines for EPES stakeholders for forecasting model selection based on their daily forecast needs across days, seasons, and temperature patterns, always taking into consideration that such industrial stakeholders often require well-established architectures with publicly available implementations rather than the developing new DL architectures from the ground up. In this direction, they can benefit from being able to select and configure their forecasting models on-demand, hence maximizing the added value that can be offered by each one of them depending on the above mentioned external variables. The most important of these guidelines include: • the option of N-BEATS for national STLF tasks as an all-around solution with good overall performance; • the option for MLP instead of N-BEATS for a well-balanced trade-off between forecast accuracy and computa- tional cost; • the option of MLP instead of N-BEATS in case the stakeholder is exclusively interested in forecasting peak load periods; • the avoidance of sophisticated models such as TFT due to their high complexity and computational require- ments; • the selection of TCN instead of TFT or LSTM in case the stakeholder is exclusively interested in forecasting peak load periods; • the avoidance of LSTM for weekend day forecasts due to the unwanted effects of the vanishing gradient problem on the involved long-term dependencies. As a final experimentation step, we explicitly investigated the impact of the temperature in Lisbon to the national forecast error by incorporating it as a predictor in our forecasting schemes. Our results indicate that ex-post forecasts can contribute to the improvement of load forecasts for all models with the exception of N-BEATS, which univariate implementation is still however more accurate than any multivariate approach. In real-world use cases this is based on the assumption of the availability of highly reliable historical and real-time weather forecasts which come at cost of data purchases and high programming skills. 6 Future work Regarding future perspectives, this comparative assessment could be replicated using data from more European countries, aiming to benchmark the performance of state-of-the-art DL models and investigate the impact of key accuracy drivers at a larger scale. Additionally, the set of the examined DL architectures could be further expanded to include even more models that have been recently proposed in the field. A fully automated MLOps framework is also envisaged, with the objective to enable an automated, off-the-shelf toolkit for model training, validation, evaluation, ensembling and deployment for EPES/ STLF stakeholders, such as transmission system operators, distribution system operators, aggregators, and energy market operators. From a model selection perspective, the creation of a hybrid model could be examined, one that would automatically perform model selection conditioned by the external calendar features and temperatures forecasts, based on the periods of excellence of its contained baseline models. As an additional future perspective of the current study, and similar to Hobbs [22], Ortega-Vazquez and Kirschen [42], Stimmel Carol [64], an attempt for an accurate and up-to-date quantification of the impact of national load forecasting errors on grid planning, operation and utility revenues would be valuable piece of research. Finally, a future additional training procedure of the models with the inclusion of ex-ante forecasts for Lisbon or even additional regions would be crucial to approximate the actual benefit of multivariate STLF. Acknowledgment This work has been funded by the European Union's Horizon 2020 research and innovation programme under the I- NERGY project, grant agreement No. 101016508. Additionally, the HPC resources utilized for training and optimizing the required machine learning models in this study have been provided by the EGI-ACE project, which also receives funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No. 101017567. 22 A PREPRINT - SEPTEMBER 26, 2023 References [1] Akiba, T., Sano, S., Yanase, T., Ohta, T., Koyama, M., 2019. Optuna: A Next-generation Hyperparameter Optimization Framework, in: Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Association for Computing Machinery. pp. 2623–2631. doi:10.1145/3292500. 3330701. [2] Alla, S., Adari, S.K., 2021. Beginning MLOps with MLFlow. Apress. doi:10.1007/978-1-4842-6549-9. [3] Arvanitidis, A.I., Bargiotas, D., Daskalopulu, A., Laitsos, V.M., Tsoukalas, L.H., 2021. Enhanced Short-Term Load Forecasting Using Artificial Neural Networks. Energies 14, 7788. doi:10.3390/en14227788. [4] Bahrami, S., Chen, Y.C., Wong, V.W., 2021. Deep Reinforcement Learning for Demand Response in Distribution Networks. IEEE Transactions on Smart Grid 12, 1496–1506. doi:10.1109/TSG.2020.3037066. [5] Bai, S., Kolter, J.Z., Koltun, V., 2018. An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling. arXiv:1803.01271 . [6] Bergstra, J., Bardenet, R., Bengio, Y., Kégl, B., 2011. Algorithms for Hyper-Parameter Optimization. Advances in Neural Information Processing Systems 24. doi:https://dl.acm.org/doi/10.5555/2986459.2986743. [7] Chen, L.G., Chiang, H.D., Dong, N., Liu, R.P., 2016. Group-based chaos genetic algorithm and non-linear ensemble of neural networks for short-term load forecasting. IET Generation, Transmission and Distribution 10, 1440–1447. doi:10.1049/iet-gtd.2015.1068. [8] Cleveland, W.S., 1979. Robust locally weighted regression and smoothing scatterplots. Journal of the American Statistical Association 74, 829–836. doi:10.1080/01621459.1979.10481038. [9] Cui, H., Peng, X., 2015. Short-Term City Electric Load Forecasting with Considering Temperature Effects: An Improved ARIMAX Model. Mathematical Problems in Engineering 2015. doi:10.1155/2015/589374. [10] De Felice Matteo, Yao Xin, 2011. Short-Term Load Forecasting with Neural Network Ensembles: A Comparative Study [Application Notes]. IEEE Computational Intelligence Magazine 6, 47–56. doi:10.1109/MCI.2011. 941590. [11] Farsi, B., Amayri, M., Bouguila, N., Eicker, U., 2021. On short-term load forecasting using machine learning techniques and a novel parallel deep LSTM-CNN approach. IEEE Access 9, 31191–31212. doi:10.1109/ ACCESS.2021.3060290. [12] Gasparin, A., Lukovic, S., Alippi, C., 2022. Deep learning for time series forecasting: The electric load case. CAAI Transactions on Intelligence Technology 7, 1–25. doi:10.1049/CIT2.12060. [13] Grabner, M., Wang, Y., Wen, Q., Blažiˇc, B., Štruc, V., 2022. A Global Modeling Approach for Load Forecasting in Distribution Networks [Preprint]. arXiv:2204.00493 . [14] Gu, K., Jia, L., 2020. Temporal Convolutional Network Based Short-term Load Forecasting Model, in: 2020 IEEE 9th Data Driven Control and Learning Systems Conference (DDCLS), IEEE. pp. 584–589. doi:10.1109/ DDCLS49620.2020.9275148. [15] Haben, S., Giasemidis, G., Ziel, F., Arora, S., 2019. Short term load forecasting and the effect of temperature at the low voltage level. International Journal of Forecasting 35, 1469–1484. doi:10.1016/J.IJFORECAST.2018. 10.007. [16] Hammad, M.A., Jereb, B., Rosi, B., Dragan, D., 2020. Methods and Models for Electric Load Forecasting: A Comprehensive Review. Logistics & Sustainable Transport 11, 51–76. doi:10.2478/JLST-2020-0004. [17] Henselmeyer, S., Grzegorzek, M., 2021. Short-term load forecasting using an attended sequential encoder-stacked decoder model with online training. Applied Sciences (Switzerland) 11. doi:10.3390/app11114927. [18] Hernandez, L., Baladron, C., Aguiar, J., Carro, B., Sanchez-Esguevillas, A., Lloret, J., Chinarro, D., Gomez-Sanz, J., Cook, D., 2013. A multi-agent system architecture for smart grid management and forecasting of energy demand in virtual power plants. IEEE Communications Magazine 51, 106–113. doi:10.1109/MCOM.2013.6400446. [19] Hernandez, L., Baladron, C., Aguiar, J.M., Carro, B., Sanchez-Esguevillas, A.J., Lloret, J., Massana, J., 2014. A survey on electric power demand forecasting: Future trends in smart grids, microgrids and smart buildings. IEEE Communications Surveys and Tutorials 16, 1460–1495. doi:10.1109/SURV.2014.032014.00094. [20] Herzen, J., Lässig, F., Piazzetta, S.G., Neuer, T., Tafti, L., Raille, G., Van Pottelbergh, T., Pasieka, M., Skrodzki, A., Huguenin, N., Dumonal, M., Ko ́scisz, J., Bader, D., Gusset, F., Benheddi, M., Williamson, C., Kosinski, M., Petrik, M., Grosch, G., 2021. Darts: User-Friendly Modern Machine Learning for Time Series. Journal of Machine Learning Research 23, 1–6. doi:10.48550/arxiv.2110.03224. 23 A PREPRINT - SEPTEMBER 26, 2023 [21] Ho, K., Hsu, Y.Y., Yang, C.C., 1992. Short term load forecasting using a multilayer neural network with an adaptive learning algorithm. IEEE Transactions on Power Systems 7, 141–149. doi:10.1109/59.141697. [22] Hobbs, B.F., 1999. Analysis of the value for unit commitment of improved load forecasts. IEEE Transactions on Power Systems 14, 1342–1348. doi:10.1109/59.801894. [23] Hochreiter, S., Schmidhuber, J., 1997. Long Short-Term Memory. Neural Computation doi:10.1162/neco. 1997.9.8.1735. [24] Huy, P.C., Minh, N.Q., Tien, N.D., Anh, T.T.Q., 2022. Short-Term Electricity Load Forecasting Based on Temporal Fusion Transformer Model. IEEE Access 10, 106296–106304. doi:10.1109/ACCESS.2022.3211941. [25] Hyndman, R.J., Koehler, A.B., 2006. Another look at measures of forecast accuracy. International Journal of Forecasting 22, 679–688. doi:10.1016/j.ijforecast.2006.03.001. [26] Kandil, N., Wamkeue, R., Saad, M., Georges, S., 2006. An efficient approach for short term load forecasting International Journal of Electrical Power & Energy Systems 28, 525–530. using artificial neural networks. doi:10.1016/j.ijepes.2006.02.014. [27] Kang, Y., Hyndman, R.J., Smith-Miles, K., 2017. Visualising forecasting algorithm performance using time series instance spaces. International Journal of Forecasting 33, 345–358. doi:10.1016/J.IJFORECAST.2016.09.004. [28] Karakolis, E., Pelekis, S., Mouzakitis, S., Markaki, O., Papapostolou, K., Korbakis, G., Psarras, J., 2022. Artificial Intelligence for Next Generation Energy Services Across Europe - The I-NERGY Project, in: ES 2021 : 19th International Conference e-Society 2021, Lisbon. pp. 61–68. [29] Koning, A.J., Franses, P.H., Hibon, M., Stekler, H.O., 2005. The M3 competition: Statistical tests of the results. International Journal of Forecasting 21, 397–409. doi:10.1016/J.IJFORECAST.2004.10.003. [30] Kourentzes, N., Barrow, D.K., Crone, S.F., 2014. Neural network ensemble operators for time series forecasting. Expert Systems with Applications 41, 4235–4244. doi:10.1016/J.ESWA.2013.12.011. [31] Liao, G.C., Tsao, T.P., 2006. Application of a fuzzy neural network combined with a chaos genetic algorithm and simulated annealing to short-term load forecasting. IEEE Transactions on Evolutionary Computation 10, 330–340. doi:10.1109/TEVC.2005.857075. [32] Lim, B., Arık, S., Loeff, N., Pfister, T., 2019. Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting. International Journal of Forecasting 37, 1748–1764. URL: https://arxiv.org/abs/1912. 09363v3, doi:10.1016/j.ijforecast.2021.03.012. [33] Lim, B., Arık, S., Loeff, N., Pfister, T., 2021. Temporal Fusion Transformers for interpretable multi-horizon time series forecasting. International Journal of Forecasting 37, 1748–1764. doi:10.1016/J.IJFORECAST.2021.03. 012. [34] Lin, T., Wang, Y., Liu, X., Qiu, X., 2022. A survey of transformers. AI Open 3, 111–132. doi:10.1016/J. AIOPEN.2022.10.001. [35] Mishra, S., Patra, S.K., 2008. Short term load forecasting using neural network trained with genetic algorithm & particle swarm optimization, in: Proceedings - 1st International Conference on Emerging Trends in Engineering and Technology, ICETET 2008, pp. 606–611. doi:10.1109/ICETET.2008.94. [36] Moghaddas-Tafreshi, S.M., Farhadi, M., 2008. A linear regression-based study for temperature sensitivity analysis of iran electrical load, in: Proceedings of the IEEE International Conference on Industrial Technology. doi:10.1109/ICIT.2008.4608590. [37] Montero-Manso, P., Athanasopoulos, G., Hyndman, R.J., Talagala, T.S., 2020. FFORMA: Feature-based forecast model averaging. International Journal of Forecasting 36, 86–92. doi:10.1016/J.IJFORECAST.2019.02.011. [38] Moon, J., Rho, S., Baik, S.W., 2022. Toward explainable electrical load forecasting of buildings: A comparative study of tree-based ensemble methods with Shapley values. Sustainable Energy Technologies and Assessments 54, 102888. doi:10.1016/J.SETA.2022.102888. [39] Nalcaci, G., Özmen, A., Weber, G.W., 2019. Long-term load forecasting: models based on MARS, ANN and LR methods. Central European Journal of Operations Research 27, 1033–1049. doi:10.1007/S10100-018-0531-1/ FIGURES/9. [40] Oreshkin, B.N., Carpov, D., Chapados, N., Bengio, Y., 2019. N-BEATS: Neural basis expansion analysis for interpretable time series forecasting. arXiv doi:https://doi.org/10.48550/arXiv.1905.10437. [41] Oreshkin, B.N., Dudek, G., Pełka, P., Turkina, E., 2021. N-BEATS neural network for mid-term electricity load forecasting. Applied Energy 293, 116918. doi:10.1016/J.APENERGY.2021.116918. 24 A PREPRINT - SEPTEMBER 26, 2023 [42] Ortega-Vazquez, M.A., Kirschen, D.S., 2006. Economic impact assessment of load forecast errors considering the cost of interruptions. 2006 IEEE Power Engineering Society General Meeting, PES doi:10.1109/PES.2006. 1709231. [43] O'Shea, K., Nash, R., 2015. An Introduction to Convolutional Neural Networks. arXiv:1511.08458 . [44] Pau, M., Kapsalis, P., Pan, Z., Korbakis, G., Pellegrino, D., Monti, A., 2022. MATRYCS A Big Data Architecture for Advanced Services in the Building Domain. Energies 15, 2568. doi:10.3390/EN15072568. [45] Pedregosa, F., Michel, V., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Vanderplas, J., Cournapeau, D., Pedregosa, F., Varoquaux, G., Gramfort, A., Thirion, B., Grisel, O., Dubourg, V., Passos, A., Brucher, M., Perrot, M., Duchesnay, E., 2011. Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research 12, 2825–2830. [46] Pelekis, S., Karakolis, E., Silva, F., Schoinas, V., Mouzakitis, S., Kormpakis, G., Amaro, N., Psarras, J., 2022. In Search of Deep Learning Architectures for Load Forecasting: A Comparative Analysis and the Impact of the Covid-19 Pandemic on Model Performance, in: 2022 13th International Conference on Information, Intelligence, Systems and Applications (IISA), IEEE. pp. 1–8. doi:10.1109/IISA56318.2022.9904363. [47] Pelekis, S., Pipergias, A., Karakolis, E., Mouzakitis, S., Santori, F., Ghoreishi, M., Askounis, D., 2023. Targeted demand response for flexible energy communities using clustering techniques. Sustainable Energy, Grids and Networks 36, 101134. URL: https://linkinghub.elsevier.com/retrieve/pii/S235246772300142X, doi:10.1016/J.SEGAN.2023.101134. [48] Petropoulos, F., Makridakis, S., Assimakopoulos, V., Nikolopoulos, K., 2014. 'Horses for Courses' in demand forecasting. European Journal of Operational Research 237, 152–163. doi:10.1016/J.EJOR.2014.02.036. [49] Psiloglou, B.E., Giannakopoulos, C., Majithia, S., Petrakis, M., 2009. Factors affecting electricity demand in Athens, Greece and London, UK: A comparative assessment. Energy 34, 1855–1863. doi:10.1016/J.ENERGY. 2009.07.033. [50] Rafi, S.H., Al-Masood, N., Deeba, S.R., Hossain, E., 2021. A short-term load forecasting method using integrated CNN and LSTM network. IEEE Access 9, 32436–32448. doi:10.1109/ACCESS.2021.3060654. [51] R&D Nester, 2023. R&D Nester | Homepage. URL: https://www.rdnester.pt/en-GB. [52] REPRS, 2013. Regulation for Energy Performance of Residential Buildings. diariodarepublica.pt/dr/detalhe/decreto-lei/118-2013-499237. URL: https:// [53] Ricardo Aguiar Revisão, Maria João Carvalho, Autor Gonçalves Hélder, 2013. Climatologia e Anos Meteorológi- cos de Referência para o Sistema Nacional de Certificação de Edifícios , 55. [54] Rozemberczki, B., Watson, L., Bayer, P., Yang, H.T., Kiss, O., Nilsson, S., Sarkar, R., 2022. The Shapley Value in Machine Learning. IJCAI International Joint Conference on Artificial Intelligence , 5572–5579doi:10.48550/ arxiv.2202.05594. [55] rp5, 2023a. Weather archive in Lisbon. URL: https://rp5.ru/Weather_archive_in_Lisbon. [56] rp5, 2023b. Weather archive in Lisbon / Portela (airport), METAR. URL: https://rp5.ru/Weather_archive_ in_Lisbon,_Portela_(airport),_METAR. [57] Rueda, F.D., Suárez, J.D., Torres, A.D.R., 2021. Short-term load forecasting using encoder-decoder wavenet: Application to the french grid. Energies 14. doi:10.3390/en14092524. [58] Sajjad, M., Khan, Z.A., Ullah, A., Hussain, T., Ullah, W., Lee, M.Y., Baik, S.W., 2020. A Novel CNN- GRU-Based Hybrid Approach for Short-Term Residential Load Forecasting. IEEE Access 8, 143759–143768. doi:10.1109/ACCESS.2020.3009537. [59] Sehovac, L., Grolinger, K., 2020. Deep Learning for Load Forecasting: Sequence to Sequence Recurrent Neural Networks with Attention. IEEE Access 8, 36411–36426. doi:10.1109/ACCESS.2020.2975738. [60] Singh, N.P., Joshi, A.R., Alam, M.N., 2022. Short-Term Forecasting in Smart Electric Grid Using N-BEATS. ICPC2T 2022 - 2nd International Conference on Power, Control and Computing Technologies, Proceedings doi:10.1109/ICPC2T53885.2022.9776757. [61] Spiliotis, E., Doukas, H., Assimakopoulos, V., Petropoulos, F., 2021. Forecasting week-ahead hourly electricity prices in Belgium with statistical and machine learning methods. Mathematical Modelling of Contemporary Electricity Markets , 59–74doi:10.1016/B978-0-12-821838-9.00005-0. [62] Spiliotis, E., Kouloumos, A., Assimakopoulos, V., Makridakis, S., 2020. Are forecasting competitions data representative of the reality? International Journal of Forecasting 36, 37–53. doi:10.1016/J.IJFORECAST. 2018.12.007. 25 A PREPRINT - SEPTEMBER 26, 2023 [63] Steffen, B., Patt, A., 2022. A historical turning point? Early evidence on how the Russia-Ukraine war changes public support for clean energy policies. Energy Research & Social Science 91, 102758. doi:10.1016/J.ERSS. 2022.102758. [64] Stimmel Carol, 2019. Big data analytics strategies for the smart grid. Auerbach Publications. [65] Talagala, T.S., Li, F., Kang, Y., 2022. FFORMPP: Feature-based forecast model performance prediction. Interna- tional Journal of Forecasting 38, 920–943. doi:10.1016/J.IJFORECAST.2021.07.002. [66] Tang, X., Chen, H., Xiang, W., Yang, J., Zou, M., 2022. Short-Term Load Forecasting Using Channel and Temporal Attention Based Temporal Convolutional Network. Electric Power Systems Research 205, 107761. doi:10.1016/J.EPSR.2021.107761. [67] UCI, 2022. UCI Machine Learning Repository | ElectricityLoadDiagrams20112014 Data Set. URL: https: //archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014. [68] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I., 2017. Attention Is All You Need, in: Advances in Neural Information Processing Systems, Neural information processing systems foundation. pp. 5999–6009. [69] Vesa Andreea Valeria, Cioara Tudor, Anghel Ionut, Antal Marcel, Pop Claudia, Salomie Ioan, Dadarlat Vasile Teodor, 2020. Energy flexibility prediction for data center engagement in demand response programs. Sustainabil- ity 12, 1417. doi:https://doi.org/10.3390/su12041417. [70] Wehrmeister, K.A., Bothos, E., Marinakis, V., Magoutas, B., Pastor, A., Carreras, L., Monti, A., 2022. The BD4NRG Reference Architecture for Big Data Driven Energy Applications. 13th International Conference on Information, Intelligence, Systems and Applications, IISA 2022 doi:10.1109/IISA56318.2022.9904424. [71] Wen, H., Gu, J., Ma, J., Yuan, L., Jin, Z., 2021. Probabilistic Load Forecasting via Neural Basis Expansion Model Based Prediction Intervals. IEEE Transactions on Smart Grid 12, 3648–3660. doi:10.1109/TSG.2021.3066567. [72] Wu, K., Gu, J., Meng, L., Wen, H., Ma, J., 2022. An explainable framework for load forecasting of a regional integrated energy system based on coupled features and multi-task learning. Protection and Control of Modern Power Systems 7, 1–14. doi:10.1186/S41601-022-00245-Y/TABLES/7. [73] Yin, L., Xie, J., 2021. Multi-temporal-spatial-scale temporal convolution network for short-term load forecasting of power systems. Applied Energy 283, 116328. doi:10.1016/J.APENERGY.2020.116328. [74] Zhang, G., Wei, C., Jing, C., Wang, Y., 2022. Short-Term Electrical Load Forecasting Based on Time Aug- mented Transformer. International Journal of Computational Intelligence Systems 15, 1–11. doi:10.1007/ S44196-022-00128-Y/FIGURES/6. [75] Zhang, R., Dong, Z.Y., Xu, Y., Meng, K., Wong, K.P., 2013. Short-term load forecasting of Australian national IET Generation, Transmission and electricity market by an ensemble model of extreme learning machine. Distribution 7, 391–397. doi:10.1049/iet-gtd.2012.0541. 26 A Figures A PREPRINT - SEPTEMBER 26, 2023 (a) Performance of the models across the times of day. (b) Performance of the models across seasons. (c) Performance of the models across holidays and non- holidays. (d) Performance of the models across weekends and non- weekends (weekdays). Figure A.1: Performance of the models across external variables measured by the RMSE evaluation metric 27 A PREPRINT - SEPTEMBER 26, 2023 Figure A.2: Performance of the models across average daily temperature levels 28
http://arxiv.org/abs/2302.12156v1
2023-02-23T16:41:07
2023-02-23T16:41:07
Personalized Decentralized Federated Learning with Knowledge Distillation
Personalization in federated learning (FL) functions as a coordinator for clients with high variance in data or behavior. Ensuring the convergence of these clients' models relies on how closely users collaborate with those with similar patterns or preferences. However, it is generally challenging to quantify similarity under limited knowledge about other users' models given to users in a decentralized network. To cope with this issue, we propose a personalized and fully decentralized FL algorithm, leveraging knowledge distillation techniques to empower each device so as to discern statistical distances between local models. Each client device can enhance its performance without sharing local data by estimating the similarity between two intermediate outputs from feeding local samples as in knowledge distillation. Our empirical studies demonstrate that the proposed algorithm improves the test accuracy of clients in fewer iterations under highly non-independent and identically distributed (non-i.i.d.) data distributions and is beneficial to agents with small datasets, even without the need for a central server.
[ "Eunjeong Jeong", "Marios Kountouris" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12156v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12156v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.IT", "eess.SP", "math.IT" ]
Personalized Decentralized Federated Learning with Knowledge Distillation Eunjeong Jeong and Marios Kountouris Communication Systems Department EURECOM Sophia Antipolis 06410, France {eunjeong.jeong, marios.kountouris}@eurecom.fr 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 6 5 1 2 1 . 2 0 3 2 : v i X r a Abstract-Personalization in federated learning (FL) functions as a coordinator for clients with high variance in data or behavior. Ensuring the convergence of these clients' models relies on how closely users collaborate with those with similar patterns or preferences. However, it is generally challenging to quantify similarity under limited knowledge about other users' models given to users in a decentralized network. To cope with this issue, we propose a personalized and fully decentralized FL algorithm, leveraging knowledge distillation techniques to empower each device so as to discern statistical distances between local models. Each client device can enhance its performance without sharing local data by estimating the similarity between two intermediate outputs from feeding local samples as in knowledge distillation. Our empirical studies demonstrate that the proposed algorithm improves the test accuracy of clients in fewer iterations under highly non-independent and identically distributed (non-i.i.d.) data distributions and is beneficial to agents with small datasets, even without the need for a central server. Index Terms-decentralized federated learning, personaliza- tion, knowledge distillation I. INTRODUCTION Since the appearance of federated learning (FL) [1] as a promising and efficient solution for distributed learning with collaborative clients, numerous research studies have inves- tigated this paradigm in distributed networks of users under various hindrance factors, such as limited local storage [2], information leakage [3], biases across user experiences [4], and transmission impairments [5]. The main objective of FL and of many of its decentralized variants is generally to acquire a global model across all devices. Nevertheless, a single com- mon model deduced from all participants may not satisfy the clients whose tasks or data distributions significantly deviate from the rest. On this account, personalized FL [6]–[12] has been considered as a means to provide a customized solution to users with statistical heterogeneity. A widely used procedure for personalized FL first constructs a global model using a central aggregator as a draft, and then customizes it under each agent's control. [10]–[12] On the other hand, personalized FL is particularly commensurate with serverless networks as each agent executes the training process autonomously, thereby enabling asynchronous learning [13]–[19]. Despite its practical relevance, issues and technical challenges associated to personalized federated there are several The work of E. Jeong is supported by the Huawei-EURECOM Chair on Future Wireless Networks. learning, which we briefly discuss below. First, among users with diverse characteristics, each agent has to find sufficiently similar peers since putting more weights on received model parameters with higher similarity during superposition im- proves its performance [19]. Unfortunately, choosing the right distance measurement, which can capture the actual similarity, the system has to encounter a is challenging. Moreover, tradeoff between model complexity and metric complexity. If the exchanged information has a more complex structure, participants have no choice but to use simpler metrics [20]. Second, FL fundamentally requires ensuring privacy within each agent, which commonly implies but is not limited to maintaining data samples private. For instance, the information on possessed class labels for classification tasks should also be kept private [21]. However, because of their omniscient viewpoint, most existing personalized and decentralized learn- ing schemes do not thoroughly preserve inter-device privacy. Occasionally, the agents take a constant for local training, which is derived from public knowledge, e.g., the number of others' training samples [13]. Even though the variables used for training are perfectly separated, a decentralized collaborative learning scheme introduced in [15] assumes the presence of a proxy dataset accessible to anyone. In [6], [14], the selected agents request to exchange hypotheses represented as a weighted sum of base data distributions. These identify the direct information of which class labels one possesses from its neighbors. To address the aforementioned challenges, we propose KD- PDFL, a personalized decentralized FL scheme that provides a completely enclosed service. With KD-PDFL, each client can individually update all parameters from their first-person perspective, including the connectivity graph, the local model, and the local dataset. In this approach, each user receives only model copies from its neighbors and determines their optimal combination. This property differentiates our algorithm from prior works, which either ask users to seek additional external information or rely on isolated personalization methods like local fine-tuning. As a powerful tool that enhances inference capability of clients with simple models, we introduce knowledge distilla- tion into our proposed scheme, where agents evaluate simi- larity with co-distillation based on local validation datasets. Thanks to embracing the characteristic of distillation, agents are also free from the need for model homogeneity since distillation enables cooperation across models with different layer structures as long as the models have a common layer with the same dimension. Our experimental results show that KD-PDFL achieves higher test accuracy within smaller global iterations compared to other personalized decentralized FL schemes, given that the amount of exchanged information is the same. We also provide a guideline for tuning the hyperparameters used in implementing our experiments. II. PRELIMINARIES In this section, prior to introducing our work, we provide a brief overview of the two major ingredients of our pro- posed solution: (i) personalized decentralized learning, which describes the overall protocol of how users exchange informa- tion; (ii) knowledge distillation, which elaborates on how they draw relevance from others. A. Personalized decentralized learning In contrast to distributed networks with a central server, a fully decentralized network implies that no node has authority or accessibility to construct a global consensus model at any instant of learning process. Thus, personalized and decentral- ized FL naturally exclude building a common model before lo- cal customization. We consider a decentralized learning system that assigns different central entities for each global iteration. In this network, a randomly selected node wakes up to serve as a temporary center node, which is also called a "star node". First, this star node collects gradient parameters from its neigh- bors. Subsequently, it calculates inferences from all received gradients, which are used to measure the similarities among the learning objectives thereafter. Users manage the traits of these similarities by selecting and focusing on communicating with neighbors that have the highest similarities. In literature, these semantic traits are modeled using a collaboration graph, which can be a property of communication links between nodes or a target variable to optimize mixing weights. A collaboration graph is a weighted graph whose edge weights represent quantified relevance between learning tasks. (See also Fig. 1) Once the star node finishes the calculation described above, it updates the weights of the collaboration graph according to the similarity variables. Meanwhile, it also updates its model using a weighted sum of all received parameters, where the weights are those obtained from the collaboration graph. B. Knowledge Distillation (KD) and co-distillation (CD) KD [22] is a knowledge transfer method in which multiple clients can compare the outputs from a common dataset to absorb the inferred knowledge of the others. They quantify the similarity between the logits. In CD [23], all clients are in an equal position to learn from the other as everyone works as a student. KD and CD have the advantage of allowing the users to transfer knowledge between models with heterogeneous structures. Yet, the system must have a public/common dataset in order to let the participants compare each logit one by Fig. 1. A general schematic of personalized decentralized federated learning. one with identical batches. This conflicts with the vanilla FL approach that guarantees the data maintenance attribute without transmission of data samples. III. PROBLEM SETTING We consider a joint minimization problem across M users. Each user indicated as i ∈ [M ] = {1, 2, * * * , M } has access to a training set Xi and its goal is to minimize its loss function Li : RnX → R+ where nX is the dimension of the input features. The objective of the whole system is to minimize the total local loss and the jointly calculated dissimilarity. We adapt the idea of a collaboration graph W to represent the connectivity between any two nodes in the network. A col- laboration graph W = [w1, w2, . . . , wM ] is a matrix of stacked connectivity vectors of each client. Each column vector of W , denoted as wi = [wi1, . . . , wiM ]T , is a connectivity vector of client i whose elements are the edge weights. In this work, the term "connectivity" implies relevance across two nodes, thus wij ≥ 0 is proportional to the degree of recognition of node i for how relevant node j's task is to its own task. Objective function: The main target of our system is to learn the personalized models Θ = {θ1, ..., θM } and the collaboration graph W ∈ RM 2 that minimize the following joint optimization problem min Θ,W J(Θ, W ) = M (cid:88) i=1 Li (θi; Xi) + μ1 2 (cid:88) i,j∈[M ] wijd(i, j) + μ2g(w) (1) where Li(*; *) is a local loss function and d(i, j) is the mea- sured distance (dissimilarity) between the model estimations of two clients i and j. The second term allows assessing task Fig. 2. Above: communication protocol during exchange intervals. Below: model and collaboration vector update elaborated. The figure illustrates the process executed only in the star node. relevance by penalizing the links between any two nodes with large statistical distances. The third term g(w) is a regulariza- tion term that strongly encourages the users to participate in collaboration by giving a high penalty when a user tries only local training. μ1 and μ2 are hyperparameters for adjusting the influence of each term above, respectively. IV. PERSONALIZED DECENTRALIZED LEARNING WITH KNOWLEDGE DISTILLATION We consider a fully decentralized network where agents do not implement strict synchronization and cooperate through peer-to-peer communication. Particularly, our definition of decentralization imparts autonomy in determining the col- laboration graph. In other words, each user evaluates the collaborative weights independently and privately instead of accessing a row of a connectivity matrix shared in public. The clients follow a cross-silo setting where each client performs all steps of the learning process, i.e., has datasets locally distributed for training, validation, and test purposes. In this section, we focus on the method to extract relevant information across the nodes in a serverless fashion. In every exchange interval Tex, the agents follow the step-by-step instructions below (see also Fig. 2): 1) A node assigned as a star node, say user i, wakes up to ask for transmission from a group of its neighbors at time t, N (t) . The peers send their local model updates to the star node i. At the end of the transmission, i has |N (t) |-copies of model parameters of its neighbors if no i packet loss has occurred. i 2) From i's local training dataset Xi, i packs training samples in a batch Bi. The batch Bi is fed to model parameters of all j ∈ N (t) in order to get intermediate outputs (e.g., logits), denoted as zij. i i 3) Node i measures the statistical distance dW (i, j) for all j ∈ N (t) , then updates wi of which the gradient function ∇hi(w) is the partial derivative of eq. (1) with respect to the computation entity i. Based on this gradient, node i updates a collaboration weight of j from the viewpoint of i, which is always bounded to a nonnegative value. The following equation illustrates the policy of updating the connectivity vector of i: ∇hi(w(t) η(t) = 1./|∇hi(w(t) w(t+1) ij i ) = μ1dW,i + μ2∇gi(w(t) i ) i )| ij − η(t)∇hi(w(t) = max(0, w(t) i )) (2) where dW,i = [dW (i, 1), * * * , dW (i, M )] indicates the statistical distance vector of node i. 4) i updates its connectivity vector using dW (i, j). To quantify the distance between two logits that are formed as probability distributions, the given user calculates the batched mean of the Wasserstein distance between the two variables. In particular, under classification tasks where the probability distribution is discrete and the number of possible classes is known, a user can compute the arithmetic mean of all Wasserstein distances from each single data sample of the batch. With ni local batch samples and nL possible classification labels, the Wasserstein distance of two logits with (ni × nL) size is computed as follows: dW (i, j) = 1 ni ni(cid:88) nL(cid:88) x=1 l=1 (cid:107)p(x) i,l − p(x) j,l (cid:107)2 2 (3) indicates the logit for class label l where p(x) that i,l goes through user i's model from an input data point with index x. Note that the importance of i from the viewpoint of j may differ from that of j from the viewpoint of i due to differences in model complexity or the number of trainable samples. Thus, W is not symmetric, and agents do not need to share updated connectivity weights. 5) A new model for i is a weighted sum of all footprints it has at that time, where the weights are the elements of the connectivity vector. 6) In the broadcast phase at the next time slot, node i to the peer group of the previous time broadcasts θ(t) slot, N (t−1) i i . 7) Other than the exchanging iterations, each agent per- forms only local learning. One cannot find its own weight wii of the connectivity vector since having statistical distance with itself does not make sense. For that, we adopt a widely used concept named confidence to indicate the weight of local model updates. A confidence of node i at time t, denoted as ci, is defined as a time-varying term dependent on the size of its local training set: (cid:32) c(t) i = min (cid:33) |Xi| cbase , 1 |N (t) i | + 1 (4) where cbase is a constant for a base confidence that is neither induced from shared information across the devices nor to be shared with others. The algorithmic description of KD-PDFL can be found in Appendix A. V. EXPERIMENTS In this section, we evaluate the performance of KD- PDFL in terms of per-client test accuracy. We compare the proposed scheme with three related baseline scenarios for decentralized networks: (i) standalone case where all users perform local training only; (ii) conventional federated aver- aging (FedAvg [24]), which returns the arithmetic mean of received model parameters; and (iii) FedAvg followed by fine- tuning, which switches the algorithm into Reptile [25]. (Fe- dAvg+ [11]) Note that in our evaluations, FedAvg corresponds to a decentralized learning scheme but with non-personalized service, i.e., it aims to build a single global model for all clients. We carry out the experiments with two types of datasets. The first one we consider is a set of smart users practicing classification tasks using web traffic information from IoT devices. The data samples have 296 input features and the output dimension of the dataset is 9.1 Each user contains 15 to 1https://www.kaggle.com/datasets/fanbyprinciple/iot-device-identification Fig. 3. Learning progress of standalone and collaborative users in different collaboration methods over iterations (M = 40). Dataset Methods M=10 M=20 M=40 IoT devices EMNIST Local learning FedAvg FedAvg+ KD-PDFL (ours) Local learning FedAvg FedAvg+ KD-PDFL (ours) 0.759±0.650 0.802±0.028 0.816±0.032 0.764±0.119 0.771±0.104 0.787±0.108 0.210±0.089 0.643±0.107 0.726±0.630 0.739±0.040 0.697±0.209 0.784±0.108 0.806±0.123 0.835±0.116 0.610±0.493 0.697±0.117 0.716±0.101 0.824±0.142 0.841±0.136 0.870±0.082 TABLE I SUMMARY OF PER-CLIENT TEST ACCURACY UNDER IOT DEVICES (Tex = 20) AND EMNIST DATASETS (Tex = 5). 100 training samples with non-i.i.d. distribution and 100 local test samples, which follows the same distribution with the local training set. We split the IoT devices training dataset into data points of which the class labels follow a symmetric Dirichlet distribution with parameter 0.1. This data split is the same as in a benchmark in [26] but is more biased due to the smaller parameter, allocating one to four class labels per each user with uneven number of data samples per label. A neural network model in every user includes one batch normalization layer, one rectified linear unit (ReLU) layer, and two linear layers. Each model has 39, 769 trainable parameters in total. The other set is for classification tasks using the EMNIST dataset, which is composed of 28 × 28 pixel images of handwritten Roman alphabets and letters. In our experiments, a total of 47 class labels are included under balanced split settings. Each user has a convolutional neural network (CNN) made of two convolutional layers, two max pooling layers, and two fully connected linear layers, which in total has 970, 847 trainable parameters. For both datasets, 10 to 40 users participate per experiment. The channel gain between each pair of participants follows Rayleigh fading, resulting in 5 neighbors reachable on average for each exchanging interval. Fig. 3 shows that equal averaging over all participants, as provided in FedAvg, achieves the poorest performance as the environment is significantly non-i.i.d. [27]. Meanwhile, effective collaborative graph is more challenging. Fig. 4 shows the trend in test accuracy with respect to the number of com- municable peers per collaboration. Putting many neighbors into simultaneous consideration ends up walking on the same track with FedAvg, resulting in a prolonged "getting to know" session and slower model convergence. On this account, it is recommended to set an upper limit on the number of neighbors accessing per exchange interval, even though the channel conditions are good enough to cover many neighbors at once. Fig. 5 visualizes the impact of coefficients of penalty and regularization terms on collaboration graphs. μ1 is a multiplier on the personalization term of the joint loss function that controls the sensitivity to the statistic distances of the system. μ1 (cid:39) 0 turns off the effect of statistic distances on the training loss. Meanwhile, μ2 adjusts the regularization to the weight thus, μ2 (cid:39) 0 may let some participants abandon values; cooperation and run only local training. A situation in which μ1 = μ2 = 0 is equivalent to federated learning that aims to construct a global model. VI. CONCLUDING REMARKS We introduced a distillation-based algorithm for person- alized federated learning over fully decentralized networks, leveraging the privacy preservation and the convenience of measuring the statistical distance across clients using logits generated from local storage. Our experimental results showed that the proposed KD-PDFL is a promising decentralized approach compared to other personalized FL methods, with each device having full autonomy in computing, including updating a collaboration graph. In future work, distillation-based personalization can be extended to unsupervised learning tasks since the distance measurement part does not require class labels as long as the local loss function does not include target labels in its metric. An interesting problem that arises by connecting topologies and connectivity graphs regarding physical distances among edge devices [28] is how to choose a subset of neighbors of a personalized and decentralized FL system in a communication- efficient way. A crossover with multi-task learning [29] also remains a potential direction of this work. APPENDIX A. Algorithm of KD-PDFL The function Midgetter in Alg. (1) extracts outputs from the intermediate layers of two neural networks. The intermediate layer can be either the output layer or one of the hidden layers depending on whether the agents transmit the entire models or only the base layers. Feeding the identical batch of client i's training samples, θi and θj returns the logits zi@i and zj@i, respectively. The expression a@b refers to an output of client a's model under control of client b, i.e., the distillation is conducted at user b's device while using b's computation resources without sharing. Fig. 4. Trend on test accuracy improvement with respect to the number of connecting peers for each communication slot. (M = 20, Tex = 5, dataset: EMNIST) Fig. 5. Heatmap of collaboration weight matrix under different values for μ1 and μ2. FedAvg+ compensates for the overfitting loss from FedAvg. The fine-tuning process began to adjust the hyperparameters from the moment the iteration reached t = 2000 in case of experiments with IoT devices dataset and t = 150 in case of EMNIST, which led to temporal deterioration, higher per- client test accuracies and lower training losses at the end. Table I shows that KD-PDFL enables the clients to extend the upper bound of their estimated test accuracy without col- laboration. Notably, users with small local training sets benefit from increased test accuracy from 21.0% to 81.6% on average. These weak users with small training sets also undergo a more challenging similarity decision. Since the lack of training set incurs blurry distance divergence across intermediate outputs that they calculate, estimating connectivity weights becomes more difficult. Figuring out the relative importance becomes more man- ageable when a client can search over a lot of peers at once. Nonetheless, as M increases, settling down on the most Algorithm 1: KD-PDFL: Distillation-based personal- ized decentralized FL Input: θ(0) i = 0 ∈ Rni, wii = 0 ∀i ∈ [M ] = {1, 2, ..., M }, wij = 1/M ∀j ∈ [M ] \ i Output: Θ(T ), W (T ) 1 for t in (0, T ] do 2 if t ≡ 0 (mod Tex) then 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Random user i wakes up & draw a subset N (t) for each neighbor j ∈ N (t) do in parallel i i from each j j Receive ̃θ(t−1) (zi@i, zj@i) = MidGetter(θi, ̃θj, Xi) // find intermediate outputs dW (i, j) = Wasserstein2D(zi@i, zj@i) // find statistic distances end for ConnVectorUpdate(i, j) as in Equation (2) Update θ(t+1) (cid:80) = i + ciw(t+1) ii θ(t) i ̃θ(t−1) j∈[M ]\{i} w(t+1) j else if t ≡ 1 (mod Tex) then ij for each neighbor j ∈ N (t−1) Receive ̃θ(t−1) Update θ(t+1) i j i from i = ̃θ(t) i end for else = θ(t) i − η∇fi(θ(t) i ) θ(t+1) i Update do // Local end if 18 19 end for REFERENCES [1] J. Koneˇcn`y, H. B. McMahan, F. X. Yu, P. Richt ́arik, A. T. Suresh, and D. Bacon, "Federated learning: Strategies for improving communication efficiency," arXiv preprint arXiv:1610.05492, 2016. [2] A. Imteaj, U. Thakker, S. Wang, J. Li, and M. H. Amini, "A survey on federated learning for resource-constrained iot devices," IEEE Internet of Things Journal, vol. 9, no. 1, pp. 1–24, 2021. [3] J. Geiping, H. Bauermeister, H. Dr ̈oge, and M. Moeller, "Inverting gradients - how easy is it to break privacy in federated learning?," Advances in Neural Information Processing Systems, vol. 33, pp. 16937– 16947, 2020. [4] F. Sattler, S. Wiedemann, K.-R. M ̈uller, and W. Samek, "Robust and communication-efficient federated learning from non-iid data," IEEE transactions on neural networks and learning systems, vol. 31, no. 9, pp. 3400–3413, 2019. [5] S. Niknam, H. S. Dhillon, and J. H. Reed, "Federated learning for wireless communications: Motivation, opportunities, and challenges," IEEE Communications Magazine, vol. 58, no. 6, pp. 46–51, 2020. [6] O. Marfoq, G. Neglia, R. Vidal, and L. Kameni, "Personalized federated learning through local memorization," in International Conference on Machine Learning, pp. 15070–15092, PMLR, 2022. [7] Y. Huang, L. Chu, Z. Zhou, L. Wang, J. Liu, J. Pei, and Y. Zhang, "Personalized federated learning: An attentive collaboration approach," CoRR, vol. abs/2007.03797, 2020. [8] A. Fallah, A. Mokhtari, and A. Ozdaglar, "Personalized federated learning: A meta-learning approach," arXiv preprint arXiv:2002.07948, 2020. [9] S. Wu, T. Li, Z. Charles, Y. Xiao, K. Liu, Z. Xu, and V. Smith, "Motley: Benchmarking heterogeneity and personalization in federated learning," in Workshop on Federated Learning: Recent Advances and New Challenges (in Conjunction with NeurIPS 2022), 2022. [10] Y. Mansour, M. Mohri, J. Ro, and A. T. Suresh, "Three approaches for personalization with applications to federated learning," arXiv preprint arXiv:2002.10619, 2020. [11] Y. Jiang, J. Koneˇcn`y, K. Rush, and S. Kannan, "Improving feder- ated learning personalization via model agnostic meta learning," arXiv preprint arXiv:1909.12488, 2019. [12] S. Divi, H. Farrukh, and B. Celik, "Unifying distillation with personal- ization in federated learning," arXiv preprint arXiv:2105.15191, 2021. [13] P. Vanhaesebrouck, A. Bellet, and M. Tommasi, "Decentralized col- laborative learning of personalized models over networks," in Artificial Intelligence and Statistics, pp. 509–517, PMLR, 2017. [14] V. Zantedeschi, A. Bellet, and M. Tommasi, "Fully decentralized joint learning of personalized models and collaboration graphs," in Interna- tional Conference on Artificial Intelligence and Statistics, pp. 864–874, PMLR, 2020. [15] G. Ye, H. Yin, and T. Chen, "A decentralized collaborative learning framework across heterogeneous devices for personalized predictive analytics," arXiv preprint arXiv:2205.13705, 2022. [16] S. Li, T. Zhou, X. Tian, and D. Tao, "Learning to collaborate in decentralized learning of personalized models," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9766–9775, 2022. [17] E. Borodich, A. Beznosikov, A. Sadiev, V. Sushko, N. Savelyev, M. Tak ́aˇc, and A. Gasnik, "Decentralized personalized federated min- max problems," in Workshop on New Frontiers in Federated Learning (in Conjunction with NeurIPS 2021), 2021. [18] A. Sadiev, E. Borodich, A. Beznosikov, D. Dvinskikh, S. Chezhegov, R. Tappenden, M. Tak ́aˇc, and A. Gasnikov, "Decentralized personalized federated learning: Lower bounds and optimal algorithm for all personal- ization modes," EURO Journal on Computational Optimization, vol. 10, p. 100041, 2022. [19] A. Bellet, R. Guerraoui, M. Taziki, and M. Tommasi, "Personalized and private peer-to-peer machine learning," in International Conference on Artificial Intelligence and Statistics, pp. 473–481, PMLR, 2018. [20] O. Marfoq, G. Neglia, A. Bellet, L. Kameni, and R. Vidal, "Federated multi-task learning under a mixture of distributions," Advances in Neural Information Processing Systems, vol. 34, pp. 15434–15447, 2021. [21] E. Jeong, S. Oh, H. Kim, J. Park, M. Bennis, and S.-L. Kim, "Communication-efficient on-device machine learning: Federated dis- tillation and augmentation under non-iid private data," in Workshop on Machine Learning on the Phone and other Consumer Devices (in Conjundtion with NeurIPS 2018), 2018. [22] G. Hinton, O. Vinyals, and J. Dean, "Distilling the knowledge in a neural network," arXiv preprint arXiv:1503.02531, vol. 2, no. 7, 2015. [23] R. Anil, G. Pereyra, A. Passos, R. Ormandi, G. E. Dahl, and G. E. Hinton, "Large scale distributed neural network training through online distillation," in International Conference on Learning Representations, 2018. [24] 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, pp. 1273–1282, PMLR, 2017. [25] A. Nichol, J. Achiam, and J. Schulman, "On first-order meta-learning algorithms," arXiv preprint arXiv:1803.02999, 2018. [26] H. Wang, M. Yurochkin, Y. Sun, D. Papailiopoulos, and Y. Khazaeni, "Federated learning with matched averaging," in International Confer- ence on Learning Representations, 2020. [27] X. Li, K. Huang, W. Yang, S. Wang, and Z. Zhang, "On the convergence of fedavg on non-iid data," in International Conference on Learning Representations, 2020. [28] B. Le Bars, A. Bellet, M. Tommasi, E. Lavoie, and A. Kermarrec, "Re- fined convergence and topology learning for decentralized optimization with heterogeneous data," in Workshop on Federated Learning: Recent Advances and New Challenges (in Conjunction with NeurIPS 2022), 2022. [29] V. Smith, C.-K. Chiang, M. Sanjabi, and A. S. Talwalkar, "Federated multi-task learning," in Advances in Neural Information Processing Systems, vol. 30, Curran Associates, Inc., 2017.
http://arxiv.org/abs/2302.12148v1
2023-02-23T16:32:31
2023-02-23T16:32:31
Streaming probabilistic tensor train decomposition
The Bayesian streaming tensor decomposition method is a novel method to discover the low-rank approximation of streaming data. However, when the streaming data comes from a high-order tensor, tensor structures of existing Bayesian streaming tensor decomposition algorithms may not be suitable in terms of representation and computation power. In this paper, we present a new Bayesian streaming tensor decomposition method based on tensor train (TT) decomposition. Especially, TT decomposition renders an efficient approach to represent high-order tensors. By exploiting the streaming variational inference (SVI) framework and TT decomposition, we can estimate the latent structure of high-order incomplete noisy streaming tensors. The experiments in synthetic and real-world data show the accuracy of our algorithm compared to the state-of-the-art Bayesian streaming tensor decomposition approaches.
[ "Yunyu Huang", "Yani Feng", "Qifeng Liao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12148v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12148v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "math.ST", "stat.ML", "stat.TH" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 8 4 1 2 1 . 2 0 3 2 : v i X r a Streaming probabilistic tensor train decomposition Yunyu Huang, Yani Feng, Qifeng Liao∗ School of Information Science and Technology, ShanghaiTech University, Shanghai 201210, China Abstract The Bayesian streaming tensor decomposition method is a novel method to discover the low-rank approximation of streaming data. However, when the streaming data comes from a high-order tensor, tensor structures of existing Bayesian streaming tensor decomposition algorithms may not be suitable in terms of representation and computation power. In this paper, we present a new Bayesian streaming tensor decomposition method based on tensor train (TT) decomposition. Especially, TT decomposition renders an efficient approach to represent high-order tensors. By exploiting the streaming varia- tional inference (SVI) framework and TT decomposition, we can estimate the latent structure of high-order incomplete noisy streaming tensors. The exper- iments in synthetic and real-world data show the accuracy of our algorithm compared to the state-of-the-art Bayesian streaming tensor decomposition approaches. Keywords: inference tensor train decomposition, streaming data, variational 1. Introduction Multiway data or multidimensional arrays, represented by tensors, are ubiquitous in real-world applications, such as recommendation systems [1, 2], computer version [3], medical imaging [4] and uncertainty quantification [5]. ∗Corresponding author Email addresses: [email protected] (Yunyu Huang), [email protected] (Yani Feng), [email protected] (Qifeng Liao) Preprint submitted to Applied Mathematics and Computation February 24, 2023 How to process, analyze and utilize such high-volume tensor data is a fun- damental problem in machine learning [6, 7], data mining [8] and signal processing [9]. Effective numerical techniques, such as CANDECOMP/PARAFAC (CP) decomposition [10, 11, 12] and Tucker decomposition [13, 14] are the most commonly used tensor decomposition approaches and have been proposed to compress full tensors and to obtain their low-rank representations. CP decomposition approximates a tensor by a sum of rank-one tensors, while Tucker decomposition decomposes a tensor into a core tensor and several factor matrices. Since CP decomposition can be seen as a special case of Tucker decomposition [15], Tucker decomposition is more flexible than CP decomposition. However, due to the existence of a core tensor, Tucker decom- position also brings challenges in both modeling and computation. In this paper, we mainly focus on Tensor Train (TT) decomposition [16], which com- bines the advantages of CP and Tucker decomposition, because it provides a space-saving model called TT format while preserving the representation power. This paper is interested in the decomposition of streaming data. Due to the stress on database capacity and privacy, streaming data is generated continuously by different of data sources and in small sizes, such as log files from web application [17] and information from social networks [18]. Re- cently, several works decompose fast streaming data, e.g. POST [19] and BASS-Tucker [20]. POST and BASS-Tucker are probabilistic streaming ten- sor decomposition algorithm based on Bayesian formulation of CP decompo- sition and Tucker decomposition respectively. Although both of POST and BASS-Tucker are powerful streaming decomposition approach and can adapt to a large amount of applications, the latent factors (CP factors) in POST are lack of representation power and BASS-Tucker is ambitious to execute and comprehensive due to the complex reducing model and high time complexity. To address these challenges, we develop SPTT, a Streaming Probabilistic TT decomposition approach. The main contributions of this work are three- folds: First, we propose a Bayesian tensor decomposition method based on TT decomposition, which can be adopted to analysis high-order incomplete noisy streaming data; Second, motivated by the Bayesian TT representation for batch-mode data in [21], we introduce a probabilistic TT model and ex- ploit the streaming variational inference (SVI) method on it for streaming data analysis; Third, both synthetic and real-world data are used in demon- strating the accuracy of our algorithm. 2 Figure 1: TT decomposition for an element (TT-format) The paper is organized as follows. We review the tensor basics and tensor train decomposition in section 2, and in 3 we present our SPTT algorithm with streaming variational inference. In section 4, we demonstrate the accu- racy of our algorithm in both synthetic and real-worlds dataset. Finally, in section section 5, we make some conclusions. 2. Background 2.1. Tensor basics and notation In this paper, we denote scalar, vector, matrix and tensor variables, re- spectively, by lowercase letters (e.g. x), boldface lowercase letters (e.g. x), boldface capital letters (e.g. X), and boldface Euler script letters (e.g. XXX). For a D-th order tensor XXX ∈ RN1×***×ND, we denote the j := (j1, * * * , jD)-th element of XXX by xj, where jd = 1, . . . , Nd for d = 1, . . . , D. 2.2. Tensor train decomposition Given TT-ranks rk in vector r = (r1, . . . , rD) with r1 = rD = 1, each element of a D-th order tensor XXX is tensorized by TT decomposition xj ≈ aj = D (cid:89) d=1 GGG(d) jd , XXX ≈ AAA = (cid:104)(cid:104)GGG(1), . . . , GGG(D)(cid:105)(cid:105) (1) where GGG(d) ∈ Rrd−1×rd is the jd-th slice of TT-cores GGG(d) ∈ Rrd−1×Nd×rd, for jd jd = 1, . . . , Nd, d = 1, . . . , D, and aj is the j-th element of tensor AAA and approximates xj. In other words, TT decomposition is to decompose a D-th order tensor XXX into a sequence of three-way factor tensors, collected by a TT-format tensor AAA. Figure 1 illustrate the TT decomposition. To find the optimal TT-cores under partial observations, TT decomposition minimizes a mean square loss, L(AAA) = (cid:107)XXXΩ − AAAΩ(cid:107)2 F (2) 3 where XXXΩ and AAAΩ are vectors containing xj and aj, respectively, j ∈ Ω. Here Ω is the index set of observed tensor entries. We can use alternating least squares [22] to update each TT core alternatively, given all the other fixed. In addition, gradient-based approaches [23] can also be used to minimize the loss function. Instead of explicitly storing the original tensor, one can choose to maintain and use the TT-cores because of the convenience and effectiveness of TT- cores. Assuming that rd = R, d = 2, . . . .D − 1, and that Nd = N, d = 1, . . . , D, the storage of the tensor XXX in the standard form is O(N D), while the storage in TT-format AAA is O(N DR2), which is linear to the tensor order. Consider two tensors XXX, YYY ∈ RN1×***×ND, the inner product is defined as (cid:104)XXX, YYY(cid:105) := (cid:88) xjyj. j (3) Similarly, using the TT-format of XXX, YYY, one can implement the inner product with O(DN R3) operations rather than O(N D) (Cf. Algorithm 4 in [16]). Using the inner product, the Frobenius norm (cid:107)XXX(cid:107)F = (cid:112)(cid:104)XXX, XXX(cid:105) and the distance between two tensors (cid:107)XXX −YYY(cid:107)F can be efficiently calculated. Besides, when TT-ranks are small enough, the TT-format is also efficient for other basic linear algebra operations, such as matrix-by-vector products, scalar multiplications, see [16] for details. 3. Bayesian model for streaming tensor train decomposition In this section, we first develop the probabilistic model of TT decompo- sition, where the Gaussian noise is included. After that, streaming data is introduced and a posterior inference for TT-cores is developed by streaming variational inference (SVI) [24]. Finally, we present the streaming probabilis- tic tensor train decomposition (SPTT) algorithm. 3.1. Probabilistic modeling of tensor train decomposition The standard TT decomposition, like [22, 23], use the point estimation to approximate the TT-cores and is not capable of evaluating the uncertainty, which can vary among each slice in a TT core. To overcome this problem, inspired by a Bayesian TT representation for batch-mode data in [21], we introduce a Bayesian TT model for streaming data. 4 We first specify {GGG(d)}D d=1 from a Gaussian prior, p({GGG(d)}D d=1) = D (cid:89) rd−1 (cid:89) rd(cid:89) d=1 k=1 l=1 N (cid:18) GGG(d) k,:,l (cid:12) (cid:12) (cid:12) (cid:12) (cid:19) mGGG(d) k,:,l , vI , (4) which indicates that each fiber GGG(d) mean m(d) GGGk,:,l of the Gaussian prior. k,:,l admits a Gaussian distribution with , and covariance matrix vI. v is a scalar and controls the flatness Given the TT-cores {GGG(d)}D d=1, the likelihood of an observed entry value xj is p(xj|{GGG(d)}D d=1, τ ) = N xj (cid:32) (cid:33) GGG(d) jd , τ −1 , (cid:12) (cid:12) D (cid:89) d=1 (5) where τ is the inverse of the noise variance. Since the Gamma distribution, because of its non-negative and long tail, provides a good model for τ , we assign a Gamma prior over τ p(τ |α0, β0) = Gam(τ |α0, β0). (6) where α0 and β0 are hyperparameters of the Gamma distribution. The den- sity function of a Gamma distribution is p(x|α, β) = xα−1e−βxβα Γ(α) , where Γ(α) is a Gamma function. The joint probability is then given by combining (4) with (5)-(6), p (cid:0)xj∈Ω, {GGG(d)}D d=1, τ (cid:1) = Gam(τ |α0, β0) rd−1 (cid:89) rd(cid:89) D (cid:89) (cid:18) GGG(d) k,:,l (cid:19) mGGG(d) k,:,l , vI (cid:12) (cid:12) (cid:12) (cid:12) (7) * d=1 (cid:89) j∈Ω * k=1 l=1 (cid:32) N (cid:12) (cid:12) xj D (cid:89) d=1 (cid:33) GGG(d) jd , τ −1 . 3.2. Bayesian streaming inference We introduce SPTT, our posterior inference algorithm for streaming data, based on TT decomposition in subsection 3.1 and the streaming variational 5 inference (SVI) [24]. Assume that the observed tensor entries are provided in a series of batches, {B1, B2, . . .}, we aim to conduct the posterior inference for TT-cores {GGG(d)}D d=1 and the inverse of noise variance τ upon receiving each data batch Bt, without revisiting the previous batches ̃B = {B1, . . . , Bt−1}. d=1, τ } is p(θ). Denote Ωt is the index set of t-th data batch Bt. For the first data batch B1 = {xj}j∈Ω1, the posterior p(θ|B1) can be calculated via Bayes' rule: Assume the prior distribution of θ = {{GGG(d)}D p(θ|B1) ∝ p(θ)p(B1|θ), (8) where p(B1|θ) = (cid:81) batch Bt = {xj}j∈Ωt, the incremental posterior is given by p(xj|θ). Similarly, when receiving the newly data j∈Ω1 p(θ| ̃B ∪ Bt) ∝ p(θ| ̃B)p(Bt|θ), (9) The proportional relationship in (9) motivates us to adopt a recursive pro- cess of streaming inference for θ. However, the multilinear product of TT- cores {GGG(d)}D d=1 in (5) results in the posterior update intractable. To over- come the problem, we introduce a factorized variational posterior distribu- tion qt−1(θ) = (cid:81) i qt−1(θi) to approximate p(θ| ̃B). With receiving new data batch Bt, we can obtain a new distribution ̃qt(θ) = qt−1(θ)p(Bt|θ), which is proportional to p(θ, ̃B ∪ Bt). We approximate posterior p(θ| ̃B ∪ Bt) with qt(θ), qt(θ) = qt({GGG(d)}D d=1, τ ) = qt(τ ) D (cid:89) rd−1 (cid:89) rd(cid:89) Nd(cid:89) qt d=1 k=1 l=1 jd (cid:16) GGG(d) k,jd,l (cid:17) . (10) based on the only assumption that each entries in the TT-cores and the inverse of noise variance are independent. To be noticed, qt(θ) is also in a factorized form as qt−1(θ), and can be initialized with q0(θ) = p(θ). From the variational inference framework [25], we minimize the Kullback-Leibler C ̃qt(θ) and qt(θ), i.e. KL( 1 (KL) divergence between 1 C ̃qt(θ||qt(θ)), where C is a normalization constant. This is equivalent to maximize a variational model evidence lower bound (ELBO) [25], L(qt(θ)) = Eqt (cid:20) log (cid:18) qt−1(θ)p(Bt|θ) qt(θ) (cid:19)(cid:21) . (11) Due to the factorized form (10), the particular functional forms of the indi- vidual factors qt(θi) can be explicitly derived in turn. The update rule for the i-th factor based on the maximization of L(qt(θ)) is then given by log qt(θi) = Eqt(θ\θi) [log qt−1(θ)p(Bt|θ)] + const, (12) 6 where Eqt(θ\θi) denotes an expectation w.r.t the qt distributions over all vari- ables except θi. 3.2.1. Posterior distribution of TT-cores Upon the factorized form (10), the inference of an element of TT-cores GGG(d) k,jd,l can be performed by receiving the messages from the t-th data batch Bt and the updated information of the whole TT-cores, where k = 1, . . . , rd−1, l = 1, . . . rd, jd = 1, . . . , Nd. By applying (12), the optimized form of GGG(d) is given as follows, k,jd,l log qt(GGG(d) k,jd,l) = E qt(θ\GGG(d) k,jd,l) [log qt−1 (θ) p(Bt|θ)] + const . (13) Obviously, the approximation posterior keeps the same form as the updated one, i.e., Gaussian distribution, qt(GGG(d) k,jd,l) = N (GGG(d) k,jd,l| ˆmGGG(d) k,jd,l , ˆvGGG(d) k,jd,l ). (14) The variance and mean, derived from derivation (13) w.r.t GGG(d) updated by k,jd,l, can be ˆvGGG(d) k,jd,l =  v−1  GGG(d) k,jd,l E (cid:104) b(<d)T (k−1)rd−1+k (cid:105) E (cid:104) b(>d) (l−1)rd+l + τ (cid:88) jd j∈Ω t −1  (cid:105)   , (15) ˆmGGG(d) k,jd,l = ˆvGGG(d) k,jd,l    mGGG(d) k,jd,l vGGG(d) k,jd,l + τ (cid:88) (cid:16) xjE (cid:104) e(<d)T k (cid:105) E (cid:105) (cid:104) e(>d) l − jd j∈Ω t rd−1 (cid:88) rd(cid:88) k(cid:48)=1,k(cid:48)(cid:54)=k l(cid:48)=1,l(cid:48)(cid:54)=l E (cid:104) b(<d)T (k−1)rd−1+k(cid:48) (cid:105) mGGG(d) k(cid:48),jd,l(cid:48) E (cid:104) b(>d) (l−1)rd+l(cid:48) (cid:105) (cid:33)(cid:33) , with (cid:104) E e(<d)T k (cid:105) = d−1 (cid:89) i=1 E (cid:105) (cid:104) GGG(i) ji , E (cid:105) (cid:104) e(>d) k = E (cid:105) (cid:104) GGG(i) ji , D (cid:89) i=d (16) (17) (cid:104) b(<d)T (cid:105) E = d−1 (cid:89) i=1 E (cid:104) GGG(i) ji ⊗ GGG(i) ji (cid:105) , E (cid:2)b(>d)(cid:3) = D (cid:89) i=d+1 E (cid:104) GGG(i) ji ⊗ GGG(i) ji (cid:105) . (18) 7 k,jd,l k,jd,l k,jd,l and mGGG(d) are the variance and mean of the element GGG(d) k,jd,l are the updated variance where ˆvGGG(d) and ˆmGGG(d) after the t-th data batch, while vGGG(d) and mean after the (t − 1)-th data batch. The subscript Ωjd represents the t indexes of t-th batch data with d-th index fixing as jd. The expression E[*] denotes the expectation with respect to all random variables involved. From (17) and (18), we can see that, for d = 1, . . . , D, e(<d)T and b(<d)T are row vectors, while e(>d) and b(>d) are column vectors. The subscript of them denotes an element in a vector, e.g. e(<d)T is the k-th element in vector (cid:104) GGG(i) e(<d)T . To compute E ji in (18), we introduce the following lemma. ⊗ GGG(i) ji k,jd,l (cid:105) k Lemma 1. The expectation of Kronecker product GGG(i) ji calculated by ⊗ GGG(i) ji in (18) can be E (cid:104) GGG(i) ji ⊗ GGG(i) ji (cid:105) = E (cid:104) GGG(i) ji (cid:105) ⊗E (cid:105) (cid:104) GGG(i) ji +E (cid:104)(cid:16) GGG(i) ji − E (cid:105)(cid:17) (cid:104) GGG(i) ji (cid:16) GGG(i) ji ⊗ − E (cid:104) GGG(i) ji (cid:105)(cid:17)(cid:105) , and its element-wise form is E (cid:104) GGG(i) k,ji,l GGG(i) k(cid:48),ji,l(cid:48) (cid:105) = E (cid:104) GGG(i) k,ji,l (cid:105) E (cid:104) GGG(i) k(cid:48),ji,l(cid:48) (cid:105) + vGGG(i) k,ji,l δ (k − k(cid:48)) δ (l − l(cid:48)) . Proof. From equation (10), we can see any two entries in GGG(i) ji are independent, E (cid:104) GGG(i) k,ji,l GGG(i) k(cid:48),ji,l(cid:48) (cid:105) = E (cid:104) GGG(i) k,ji,l (cid:105) E (cid:104) GGG(i) k(cid:48),ji,l(cid:48) (cid:105) + vGGG(i) k,ji,l δ (k − k(cid:48)) δ (l − l(cid:48)) , where δ(x) = 1 if x = 0 and zero otherwise. Let p = ri−1(k − 1) + l, q = ri(k(cid:48) − 1) + l(cid:48), then E (cid:104) GGG(i) ji ⊗ GGG(i) ji (cid:105) p,q (cid:16) E (cid:105) (cid:104) GGG(i) ji = ⊗ E (cid:105)(cid:17) (cid:104) GGG(i) ji + VVV(i) p,ji,q, p,q where VVV(i) jd := E (cid:104)(cid:16) GGG(i) ji − E (cid:105)(cid:17) (cid:104) GGG(i) ji (cid:16) GGG(i) ji ⊗ − E (cid:104) GGG(i) ji (cid:105)(cid:17)(cid:105) . (19) As a Kronecker-form covariance, VVV(i) i consists of block matrices ji with dimension ri−1 × ri and the (k, l)-th block matrix contains only one at the (k, l)-th position. Thus, nonzero element vGGG(i) k,ji,l (cid:104) GGG(i) ji (cid:104) GGG(i) ji (cid:104) GGG(i) ji + VVV(i) ji ⊗ GGG(i) ji ∈ Rr2 i−1×r2 = E ⊗ E E (cid:105) (cid:105) (cid:105) . 8 3.2.2. Posterior distribution of inverse of noise variance Following equation (12), the update for the inverse of noise variance τ can be derived by rearranging equation as follows, log qt(τ ) = Eqt(θ\τ ) [log qt−1 (θ) p(Bt|θ)] + const, (20) from which, we can see the posterior of inverse of noise variance is again a Gamma distribution, qt(τ ) = Gam(τ |ˆα, ˆβ), and the posterior hyperparameters can be updated by ˆα = α + |Ωt| 2 , ˆβ = β + E 1 2   (cid:88) j∈Ωt (cid:32) xj − D (cid:89) d=1 (cid:33)2  , GGG(d) jd (21) (22) (23) where   E (cid:32) (cid:88) j∈Ωt xj − D (cid:89) d=1 (cid:33)2 GGG(d) jd  = XXXT Ωt (XXXΩt − 2AAAΩt)+ (cid:88) D (cid:89) (cid:16) E (cid:105) (cid:104) GGG(d) jd ⊗ E (cid:105) (cid:104) GGG(d) jd + VVV(d) jd (cid:17) . j∈Ωt d=1 (24) From (22), we can see that the shape parameter updates with number of the newly receiving data batch Bt. The summation term in (23) controls the inverse of noise variance τ through the rate parameter ˆβ. It is seen in (23) that when the model dose not fit the streaming data well, there is an increase in ˆβ and thus a decrease in noise variance since E[τ ] = ˆα/ ˆβ. Computing (24) is challenging, so we present a lemma as follows. Lemma 2. Given a set of independent random matrices {GGG(d) }D d=1, we as- jd sume that ∀d ∈ {1, . . . , D}, ∀k ∈ {1 . . . , rd−1}, ∀l ∈ {1 . . . , rd}, the vectors {GGG(d) k,:,l} are independent, then (cid:32) D (cid:89)   E d=1 (cid:33)2 GGG(d) jd  = D (cid:89) (cid:16) d=1 E (cid:105) (cid:104) GGG(d) jd ⊗ E (cid:105) (cid:104) GGG(d) jd + VVV(d) jd (cid:17) . 9 Proof. For a scalar (cid:81)D d=1 product and conclusion of Lemma 1, we have GGG(d) jd , using the mix product property of Kronecker (cid:32) D (cid:89)   E d=1 (cid:33)2 GGG(d) jd  = E (cid:34)(cid:32) D (cid:89) (cid:33) GGG(d) jd ⊗ d=1 (cid:33)(cid:35) (cid:32) D (cid:89) d=1 GGG(d) jd = = D (cid:89) d=1 D (cid:89) d=1 E (cid:104)(cid:16) GGG(d) jd ⊗ GGG(d) jd (cid:17)(cid:105) (cid:16) E (cid:105) (cid:104) GGG(d) jd ⊗ E (cid:105) (cid:104) GGG(d) jd + VVV(d) jd (cid:17) , where VVV(d) jd is defined in (19). 3.2.3. Algorithm Since variational Bayesian inference is only guaranteed to converge to a local minimum, a good initialization is important. The inverse of noise variance in (6) is initialized as E[τ ] = 1 with q0(τ ) = Gam(τ |α0, β0) and α0 = β0 = 10−3. For the TT-cores {GGG(d)}D k,:,l is initialized as a vector mGGG(d) and its elements are generated from a standard uniform distribution U (0, 1). That is, d=1 in (4), each fiber GGG(d) k,:,l q0(GGG(d) k,:,l) = N (GGG(d) k,:,l|mGGG(d) k,:,l , I). (25) The following relative error of TT-cores between two iterations is defined as stopping criterion for data batch Bt, (cid:15)G = D (cid:88) d=1 (cid:107)GGG(d)(m, t) − GGG(d)(m − 1, t)(cid:107)F (cid:107)GGG(d)(m − 1, t)(cid:107)F , (26) where (cid:107) * (cid:107)F , is the Frobenius norm defined in (3). GGG(d)(m, t) denotes the d-th tensor core after m-th iteration and t-th data batch. For each data batch Bt, we declare our update scheme converged when the relative error (cid:15)G is less than a tolerance tol = 10−3. We stop the SPTT algorithm and output the updated mean and variance of each TT-cores if the final data batch Btmax is used. Our algorithm is summarized in Algorithm 1. The complexity of the proposed algorithm comes from the update the d=1 and τ . For simplicity, we assume that all TT-ranks are posterior of {GGG(d)}D 10 Algorithm 1 Streaming probabilistic tensor train decomposition (SPTT) Require: Data streams {B1, . . . , Btmax}, maximum number M of iterations for each data batch Ensure: The updated posterior of TT-cores, q∗(GGG(d)), d = 1, . . . D. Initialize q(τ ) using (6), and α0 = β0 = 10−3. Initialize q(GGG(d)) using (25) for d = 1, . . . , D. Set t = 1, m = 0 and (cid:15)G = 1. while t < tmax do Load the data batch Bt. while (cid:15)G > 10−3 and iteration number m < M do for d = 1 to D do Calculate expectation of e(<d)T , b(<d)T , e(>d) and b(>d) by (17) and (18). Update q(GGG(d)(m, t)) associated with Bt via (16) and (15). Update q(τ (m, t)) via (22) and (23). Compute the error (cid:15)G in (26). end for m = m + 1. end while t = t + 1. end while 11 initially set as L, the length in each order is N , and the batch size is S. In each streaming batch, for the updating of each TT core GGG(d), it takes O(DL2) to get e(<d)T and e(>d), O(DL4) to get b(<d)T and b(>d), then O(SDL2) to get the mean and O(SDL4) to get the variance of a TT core in (15) and (16) respectively. Furthermore, each τ requires O(SD(L4 + L2)) to compute. Thus, the overall time complexity is O(SDL4). The space complexity is O(N DL2), which is to store the posterior mean and variance of {GGG(d)}D d=1. 4. Experimental results In this section, we evaluated our streaming probabilistic tensor train de- composition (SPTT) approach on both synthetic data and real-world ap- plications. We compare our proposed SPTT approach with the following tensor decomposition approaches: (1) POST [19], as streaming Bayesian CP decomposition algorithm. (2) BASS-Tucker [20], a streaming Bayesian sparse Tucker decomposition algorithm. (3) CP-ALS [26], a CP decomposition with alternating least square and EM. (4) CP-WOPT [27], which is a static CP decomposition using conjugate gradient descent. (5) Tucker-ALS [28], Tucker decomposition with alternating least square updates. All results of this paper are obtained in MATLAB (2022a) on a computer with an Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz 2.11 GHz . 4.1. Synthetic data The synthetic tensor data is generated by the following procedure. Through TT decomposition in (1), we create a true tensor AAA ∈ R20×20×20×20 in TT- format with the TT-ranks (1, 3, 3, 3, 1) by sampling the entries of TT-cores {GGG(d)}4 The synthetic observed tensor UUU is generated as follows, d=1 from standard uniform distribution U (0, 1), and AAA = (cid:104)(cid:104)GGG(1), . . . , GGG(4)(cid:105)(cid:105). UUU = AAA + WWW (27) where WWW is a Gaussian noise tensor with its element wj ∼ N (0, σ2) and σ is noise level, controlled by signal-to-noise-ratio (SNR), SNR = 10 log (cid:19) (cid:18) (cid:107)AAA(cid:107)2 F (cid:107)WWW (cid:107)2 F = 10 log (cid:18) var(AAA) σ2 (cid:19) . (28) To investigate the ability of our streaming decomposition algorithm, we set the ratio of the number of observed tensor entries to the total tensor entries as 12 15%. To be noticed, the index of observed entries are chosen randomly. We divide 10% observed entries into the test set T , remaining 90% of observed entries into the training set B. Then we randomly partition the training set B into a stream of small data bathes {B1, B2, . . . , Btmax}. Denote batch size as S, then tmax = |B|/S, where |B| is the total number of training set. Set the maximum iteration number in Algorithm 1 as M = 100, the initial TT- cores with TT-ranks as (1, R, R, R, 1). For maximum iteration number and initialization of all the completing approaches, we use their default settings. Denote ˆAAA as the TT-format tensor formulated by the updated posterior mean of TT-cores. To evaluate the performance of the above tensor decom- position approaches, we use the following relative error (cid:15) as reconstruction criterion, (cid:15) = (29) (cid:107) ˆAAAT − AAAT (cid:107)F (cid:107)AAAT (cid:107)F Next, we compare the relative reconstruction error under different batch size, different initial TT-ranks, i.e. different R and different SNR. We repeat our algorithm 5 times and calculate the average relative error as 1 i=1 (cid:15)i and 5 standard deviation are showed in Fig. 2. In Fig. 2 (a), we fix the rank R = 3, SNR = 20, and examine the performance with different choices of batch sizes B = {28, 29, 210, 211}. In Fig. 2 (b), we fix the streaming batch size S = 512, SNR = 20, and show how the predictive performance of each method varied with different rank R = {3, 4, 5, 6}. In Fig. 2 (c), we fix S = 512, R = 3, and see the performance with different noise level SNR = {15, 20, 25, 30}. As we can see, SPTT outperforms BASS-Tucker, POST and static decomposition methods in all the cases. (cid:80)5 . In addition, we evaluate the running predictive performance of SPTT. We fix the batch size S = 512, SNR = 20, and gradually feed the training set {B1, B2, . . . , Btmax} to SPTT, BASS-Tucker and POST. Two cases (R = 3, 5) are considered to test the prediction accuracy after each data batch is used. The corresponding running relative error is shown in Fig. 3. As we can see, our SPTT algorithm beats POST and BASS-Tucker since the first data batch, which demonstrates the accuracy and efficiency of our algorithm. 4.2. Real-world applications We evaluate the SPPT algorithm on the following three datasets: (1) Alog [29], a three-mode (user, action, resource) tensor, of size 200 × 100 × 200, including 0.66% observed entries. It represents three-way management 13 Figure 2: Predictive performance of synthetic data under different conditions. Figure 3: The running predictive performance of synthetic data. 14 2829210211Batch Size00.050.10.15Relative Error(a)3456Rank00.10.20.30.40.50.60.70.80.9Relative Error(b)SPTTBASS-TuckerPOSTCP-ALSCP-WOPTTucker-ALS15202530SNR00.020.040.060.080.10.120.14Relative Error(c)01020304050Number of Batches00.050.10.150.20.250.30.350.4Relative Error(a) R=3 SPTTPOSTBASS-Tucker01020304050Number of Batches00.050.10.150.20.250.3Relative Error(b) R = 5 operations. (2) Carphone [30], a three-mode (length, width, frames) of video data size 144×176×180, contains 0.5% nonzeros entries. (3) Flow injection1, a three-mode (samples, wavelengths, times) tensor of size 12 × 100 × 89, is exacted from a flow injection analysis system and includes 21360 nonzero entries. Set M = 100 in Algorithm 1 and the initial TT-cores with TT-ranks as (1, R, R, R, 1). For maximum iteration number and initialization of all the completing approaches, we use their default settings. We compare the relative reconstruction error (cid:15) defined in (29) under different batch size S and different initial rank R. We randomly split the observed entries of Alog into 75% for training and 25% for test and the other two datasets 10% entries for test. For POST, SPTT and BASS-Tucker, we randomly partitioned the training entries into a stream of small batches according to batch size S. For static decomposition algorithm CP-ALS, CP-WOPT and Tucker-ALS, we input the whole data. The average relative error and standard deviation are reported in Fig. 4. In Fig. 4 (a)-(c), we fix the batch size S = 512 and show how the predictive performance of each method varied with different rank R = {3, 4, 5, 6}. The bigger the rank, the more expensive for SPTT to factorize each batch. It can be seen form Fig. 4 (c), as the initial rank R increase from 3 to 5, the relative error of SPTT gradually increase and finally close to the relative error of POST. Hence this setting examined the trade-off between the accuracy and computational complexity. To test the capacity of decomposition algorithm on different batch size, we fix the rank R = 3, and examine the performance with different choices of batch sizes B = {28, 29, 210, 211} in Fig. 4 (d)-(f). As we can see, SPTT outperforms BASS-Tucker, POST and static decomposition methods in three datasets, especially in dataset Carphone. We then evaluate the running predictive performance of SPTT. We fix the batch size S = 512, and continuously feed the training set to SPTT, BASS-Tucker and POST. For the three datasets, we consider two cases, i.e. R = 3 and R = 5 to test the prediction accuracy after each data batch is used. The running relative error is shown in Fig. 3. In all the cases, when the number of batches is small, POST or BASS-Tucker may performs better than SPTT. However, as the data streams, SPTT beats POST and BASS-Tucker gradually. 1Retrieved from www.models.kvl.dk 15 Figure 4: Predictive performance with different rank(top row) and streaming batch size (bottom row). Figure 5: The running predictive performance in real-world applications. 16 33.544.555.56Rank0.20.40.60.81Relative Error(a) ALOG33.544.555.56Rank0.40.60.811.2Relative Error(b) Carphone33.544.555.56Rank00.20.40.60.81Relative Error(c) Flow InjectionSPTTBASS-TuckerPOSTCP-ALSCP-WOPTTucker-ALS2829210211Batch Size0.40.450.50.55Relative Error(d) ALOG2829210211Batch Size0.40.50.60.70.80.91Relative Error(e) Carphone2829210211Batch Size00.10.20.30.40.5Relative Error(f) Flow Injection01020304050Number of Batches0.40.50.60.70.80.9Relative Error(a) ALOG (R=3) SPTTPOSTBASS-Tucker01020304050Number of Batches0.40.50.60.70.80.91Relative Error(b) Carphone (R=3)010203040Number of Batches00.20.40.60.81Relative Error(c) Flow Injection (R=3) 01020304050Number of Batches0.40.60.811.2Relative Error(d) ALOG (R=5) 01020304050Number of Batches0.40.50.60.70.80.91Relative Error(e) Carphone (R=5) 010203040Number of Batches00.20.40.60.81Relative Error(f) Flow Injection (R=5) 5. Conclusions In this paper, we propose a novel and efficient algorithm, namely SPTT, to discover latent factors from streaming data from high-order tensor and pre- dict missing values. We introduce a simple probabilistic TT model for data denosing and decomposition. Under the SVI framework, we develop poste- rior inference for TT-cores and the inverse of noise variance. We demonstrate that our SPTT algorithm can produce accurate predictions on streaming data. For future work, we are interested in develop a sparse strategy based on SPTT to further prevent overfitting and enhance scalability. Acknowledgments This work is supported by the National Natural Science Foundation of China (No. 12071291), the Science and Technology Commission of Shanghai Municipality (No. 20JC1414300) and the Natural Science Foundation of Shanghai (No. 20ZR1436200). References [1] E. Frolov, I. Oseledets, Tensor methods and recommender systems, Wi- ley Interdisciplinary Reviews: Data Mining and Knowledge Discovery 7 (3) (2017) e1201. [2] Y. Zhang, X. Bi, N. Tang, A. Qu, Dynamic tensor recommender systems, The Journal of Machine Learning Research 22 (1) (2021) 3032–3066. [3] Y. Panagakis, J. Kossaifi, G. G. Chrysos, J. Oldfield, M. A. Nicolaou, A. Anandkumar, S. Zafeiriou, Tensor methods in computer vision and deep learning, Proceedings of the IEEE 109 (5) (2021) 863–890. [4] M. Filippi, M. Cercignani, M. Inglese, M. Horsfield, G. Comi, Diffu- sion tensor magnetic resonance imaging in multiple sclerosis, Neurology 56 (3) (2001) 304–311. arXiv:https://n.neurology.org/content/ 56/3/304.full.pdf, doi:10.1212/WNL.56.3.304. URL https://n.neurology.org/content/56/3/304 [5] K. Tang, Q. Liao, Rank adaptive tensor recovery based model reduction for partial differential equations with high-dimensional random inputs, Journal of Computational Physics 409 (2020) 109326. 17 doi:https://doi.org/10.1016/j.jcp.2020.109326. URL S0021999120301005 https://www.sciencedirect.com/science/article/pii/ [6] Y. Ji, Q. Wang, X. Li, J. Liu, A survey on tensor techniques and appli- cations in machine learning, IEEE Access 7 (2019) 162950–162990. [7] Y. Yu, G. Zhou, N. Zheng, Y. Qiu, S. Xie, Q. Zhao, Graph-regularized non-negative tensor-ring decomposition for multiway representation learning, IEEE Transactions on Cybernetics (2022) 1–14doi:10.1109/ TCYB.2022.3157133. [8] M. Mørup, Applications of tensor (multiway array) factorizations and decompositions in data mining, Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery 1 (1) (2011) 24–40. [9] N. D. Sidiropoulos, L. De Lathauwer, X. Fu, K. Huang, E. E. Papalex- akis, C. Faloutsos, Tensor decomposition for signal processing and ma- chine learning, IEEE Transactions on Signal Processing 65 (13) (2017) 3551–3582. [10] R. A. Harshman, et al., Foundations of the parafac procedure: Models and conditions for an" explanatory" multimodal factor analysis (1970). [11] R. Bro, Parafac. tutorial and applications, Chemometrics and intelligent laboratory systems 38 (2) (1997) 149–171. [12] J. Jiang, F. Sanogo, C. Navasca, Low-cp-rank tensor completion via practical regularization, Journal of Scientific Computing 91 (1) (2022) 18. [13] L. R. Tucker, Some mathematical notes on three-mode factor analysis, Psychometrika 31 (3) (1966) 279–311. [14] C. Xiao, C. Yang, M. Li, Efficient alternating least squares algorithms for low multilinear rank approximation of tensors, Journal of Scientific Computing 87 (2021) 1–25. [15] T. G. Kolda, B. W. Bader, Tensor decompositions and applications, SIAM review 51 (3) (2009) 455–500. 18 [16] I. V. Oseledets, Tensor-train decomposition, SIAM Journal on Scientific Computing 33 (5) (2011) 2295–2317. [17] R. Roy, G. A. Rao, Survey on pre-processing web log files in web usage mining, International Journal of Advanced Science and Technology 29 (3 Special Issue) (2020) 682–691. [18] D. Koutra, E. E. Papalexakis, C. Faloutsos, Tensorsplat: Spotting latent anomalies in time, in: 2012 16th Panhellenic Conference on Informatics, IEEE, 2012, pp. 144–149. [19] Y. Du, Y. Zheng, K.-c. Lee, S. Zhe, Probabilistic streaming tensor de- composition, in: 2018 IEEE International Conference on Data Mining (ICDM), IEEE, 2018, pp. 99–108. [20] S. Fang, R. M. Kirby, S. Zhe, Bayesian streaming sparse tucker decom- position, in: C. de Campos, M. H. Maathuis (Eds.), Proceedings of the Thirty-Seventh Conference on Uncertainty in Artificial Intelligence, Vol. 161 of Proceedings of Machine Learning Research, PMLR, 2021, pp. 558–567. URL https://proceedings.mlr.press/v161/fang21b.html [21] L. Xu, L. Cheng, N. Wong, Y.-C. Wu, Probabilistic tensor train decom- position with automatic rank determination from noisy data, in: 2021 IEEE Statistical Signal Processing Workshop (SSP), 2021, pp. 461–465. doi:10.1109/SSP49050.2021.9513808. [22] W. Wang, V. Aggarwal, S. Aeron, Tensor completion by alternat- ing minimization under the tensor train (tt) model, arXiv preprint arXiv:1609.05587 (2016). [23] L. Yuan, Q. Zhao, L. Gui, J. Cao, High-order tensor completion via gradient-based optimization under tensor train format, Signal Process- ing: Image Communication 73 (2019) 53–61, tensor Image Processing. doi:https://doi.org/10.1016/j.image.2018.11.012. URL S0923596518311081 https://www.sciencedirect.com/science/article/pii/ [24] T. Broderick, N. Boyd, A. Wibisono, A. C. Wilson, M. I. Jordan, Streaming variational bayes, Advances in neural information process- ing systems 26 (2013). 19 [25] M. J. Wainwright, M. I. Jordan, et al., Graphical models, exponential families, and variational inference, Foundations and Trends® in Ma- chine Learning 1 (1–2) (2008) 1–305. [26] T. G. K. Brett W. Bader, et al., Tensor toolbox for matlab, version 3.4, www.tensortoolbox.org (Sep. 2022). [27] E. Acar, D. M. Dunlavy, T. G. Kolda, M. Mørup, Scalable tensor factor- izations for incomplete data, Chemometrics and Intelligent Laboratory Systems 106 (1) (2011) 41–56. [28] L. De Lathauwer, B. De Moor, J. Vandewalle, On the best rank-1 and rank-(r 1, r 2,..., rn) approximation of higher-order tensors, SIAM jour- nal on Matrix Analysis and Applications 21 (4) (2000) 1324–1342. [29] S. Zhe, K. Zhang, P. Wang, K.-c. Lee, Z. Xu, Y. Qi, Z. Ghahramani, Distributed flexible nonlinear tensor factorization, Advances in neural information processing systems 29 (2016). [30] G. Song, M. K. Ng, X. Zhang, Robust tensor completion using trans- formed tensor singular value decomposition, Numerical Linear Algebra with Applications 27 (3) (2020) e2299. 20
http://arxiv.org/abs/2302.12139v1
2023-02-23T16:26:11
2023-02-23T16:26:11
Automated Extraction of Fine-Grained Standardized Product Information from Unstructured Multilingual Web Data
Extracting structured information from unstructured data is one of the key challenges in modern information retrieval applications, including e-commerce. Here, we demonstrate how recent advances in machine learning, combined with a recently published multilingual data set with standardized fine-grained product category information, enable robust product attribute extraction in challenging transfer learning settings. Our models can reliably predict product attributes across online shops, languages, or both. Furthermore, we show that our models can be used to match product taxonomies between online retailers.
[ "Alexander Flick", "Sebastian Jäger", "Ivana Trajanovska", "Felix Biessmann" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12139v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12139v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.IR", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.IR", "cs.AI", "cs.LG" ]
3 2 0 2 b e F 3 2 ] R I . s c [ 1 v 9 3 1 2 1 . 2 0 3 2 : v i X r a Automated Extraction of Fine-Grained Standardized Product Information from Unstructured Multilingual Web Data Alexander Flick1[0000−0001−5273−0679], Sebastian J ̈ager1[0000−0001−9420−8571], Ivana Trajanovska1[0000−0003−0374−1210], and Felix Biessmann1,2[0000−0002−3422−1026] 1 Berlin University of Applied Sciences and Technology 2 Einstein Center Digital Future, Berlin, Germany [email protected] Abstract. Extracting structured information from unstructured data is one of the key challenges in modern information retrieval applica- tions, including e-commerce. Here, we demonstrate how recent advances in machine learning, combined with a recently published multilingual data set with standardized fine-grained product category information, enable robust product attribute extraction in challenging transfer learn- ing settings. Our models can reliably predict product attributes across online shops, languages, or both. Furthermore, we show that our models can be used to match product taxonomies between online retailers. Keywords: product information extraction * e-commerce 1 Introduction Recent research achievements in the field of machine learning (ML) [1,13] have the potential to improve automated information extraction in applications such as e-commerce. However, the translation of these ML innovations into real-world application scenarios is impeded by the lack of publicly available data sets. Here we demonstrate that recent advances in ML can be translated into automated information extraction applications when leveraging carefully curated data. To better assess the contribution of this study, we first highlight some relevant data sets and methods that aim at the automated extraction of structured data in the field of e-commerce. Public E-commerce Data Sets We summarize publicly e-commerce data sets used for the automated extraction of product information in Table 1. To leverage the potential of ML, large and diverse data sets that follow a fine-grained product taxonomy are favorable. A common and detailed taxonomy is the Global Product Classification (GPC) standard, which "classifies products by grouping them into categories based on their essential properties as well as their relationships to other products"[4]. For example, multiple Brick s (shirts and shorts) can belong 2 Flick et al. to the same Family (clothing) but are different Classes (upper and lower body wear)3. Table 1. Comparison of e-commerce data sets used for product attribute extraction and classification. Column GPC means whether or not the data set follows the GPC taxonomy. regular updated lingual shop family multi- GPC size Farfetch product meta data [9] Product details on Flipkart [3] Amazon browse node classification [2] Amazon product-question answering [16] Rakuten data challenge [10] MAVE [18] Innerwear from victoria's secret & co [15] WDC-MWPD [19] WDC-25 gold standard [14] GreenDB [7] (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:51) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:51) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:55) (cid:51) (cid:51) (cid:51) (cid:51) (cid:55) (cid:51) (cid:51) (cid:51) (cid:51) (cid:51) (cid:55) (cid:55) (cid:51) (cid:51) (cid:55) 400K (cid:55) 20K (cid:55) 3M (cid:55) 17.3GB (cid:55) 1M (cid:55) 2.2M (cid:55) 600K (cid:51) 16K (cid:51) 24K (cid:51) >576K Multilingual Fine-Grained Product Classification There are few recent studies investigating automated extraction of standardized product information in text corpora. Brinkmann et al. [1] study how hierarchical product classification bene- fits from domain-specific language modeling. They report an improvement of 0.012 weighted F1 score by using schema.org product4 annotations for pre- training. Peeters et al. [12] study cross-language learning for entity matching and demonstrate that multilingual transformers outperform single-language models (German BERT) by 0.143 F1 when trained on a single language (German) and tested on multiple (German and English). Furthermore, using additional train- ing data for the second language (English) improves the performance by another 0.038 weighted F1. These studies highlight the potential of modern ML methods for automated product attribute extraction. In this work, we show that transfer learning helps to extract structured information (product category) from unstructured data (product name and description) and to find reliable taxonomy mappings. 2 Experiments We evaluate three transfer learning scenarios for product classification: 1. Language Transfer: training on data of one language, test on other lan- guage data 3 See the GPC Browser for more examples: https://gpc-browser.gs1.org/ 4 Website: https://schema.org/Product Extracting Product Information from Unstructured Web Data 3 2. Shop Transfer: training on data of one shop, test on other shop data 3. Language and Shop Transfer: training on data of one shop and one language, test on data of different shops and languages Furthermore, we study whether ML methods can be used to find reliable taxonomy mappings. For this, we apply a model trained for a target taxonomy to data that uses a source taxonomy. For each source category, the majority of predicted target categories define the mapping from source to target taxonomy. Data Sets In our experiments, we use two data sets, the GreenDB [6] and the Farfetch data set [9]. The GreenDB5 is a multilingual data set covering 5 European shops with about 576k unique products of the 37 most important product categories following the GPC taxonomy. It covers categories from the GPC segments Clothing, Footwear, Personal Accessories, Home Appliances, Au- dio Visual/Photography, and Computing. A recent publication [8] presents the GreenDB's high quality and usefulness for information extraction tasks. The Farfetch data set has about 400k unique products from a single shop. It does not follow a public taxonomy and covers only fashion products. ML Model The experiment implementation is based on autogluon's [17] TextPre- dictor and uses mDeBERTav3 [5] as the backbone model. For training, we use the GreenDB and apply Cleanlab [11] to find and remove miss-classified products (211 were found). Our models use the product's name and descrip- tion to predict their product category. modelbaseline is trained on the entire GreenDB (all shops), modelZaDE on the German, modelZaF R on the French, and modelZaALL on the German, French, and English Zalando products con- tained in the GreenDB. Online Demo To demonstrate the transfer capabilities, we published an on- line demo available: https://product-classification.demo.calgo-lab.de. As shown in Figure 1, it automatically downloads the HTML of a given URL, extracts the products' name and description, and uses modelbaseline to predict its GPC category. 3 Results The baseline performance (modelbaseline) shows a strong 0.99 weighted F1 score on a GreenDB test set. Transfer Tasks modelZaDE demonstrates language transfer when it is applied to other languages of the same shop. It achieves weighted F1 scores of 0.898 for English and 0.873 for French. Applying modelZaF R and modelZaDE on other shops demonstrates shop transfer with weighted F1 scores from 0.648 to 0.836. If the model is fine-tuned on multi-lingual data (modelZaALL), almost all shops 5 We use GreenDB version 0.2.2 available at https://zenodo.org/record/7225336 4 Flick et al. Fig. 1. Online demo overview. Automated extraction of schema.org information (prod- uct name and description) from HTML, used for product classification. benefit, see Table 2 for details. The language and shop transfer is even more challenging and performs worse for all shops. Transferring across data sets, i.e., applying modelbaseline to Farfetch data, achieves a 0.924 weighted F1 score. Table 2. Weighted F1 scores for shop transfer experiments. Scores from 0.648 to 0.836 demonstrate robust shop transfer. Shop transfer profits from additional data in other languages. Model FR DE Asos H&M Otto Amazon Shop Transfer Shop & Language Transfer - modelZaF R 0.836 0.678 modelZaDE 0.777 - modelZaALL 0.842 0.717 0.762 modelZaF R 0.614 - - modelZaDE 0.795 0.666 - - - 0.648 0.739 0.449 - Taxonomy Matching Using modelbaseline to map products' categories from Far- fetch to GreenDB (GPC taxonomy) results in 41 out of 46 (>89%) correctly mapped categories. 4 Conclusion We demonstrate that combining rich multilingual data sets and modern ML methods enables fine-grained standardized product information extraction from unstructured data. We investigate several transfer learning settings when train- ing and testing on data from different shops and languages, even in zero-shot scenarios when no data from another shop and language was available in the training data. HTTP RequestHTTPResponseHTMLextructDict{'json-ld': [ { '@context': 'https://schema.org/','@type': 'Product','name': 'T-Shirt','description': 'T-Shirt blue','brand': 'Hessnatur',...,}],'microdata': [...],...}Shop<html><head>...</head>...</html>Dict.get(...)name: 'T-Shirt'description: 'T-Shirt blue' Extracting Product Information from Unstructured Web Data 5 Acknowledgements This research was supported by the Federal Ministry for the Environment, Nature Conservation and Nuclear Safety based on a decision of the German Bundestag. References 1. Brinkmann, A., Bizer, C.: Improving Hierarchical Product Classification using Domain-specific Language Modelling. IEEE Data Eng. Bull. 44(2), 14–25 (2021), http://sites.computer.org/debull/A21june/p14.pdf 2. Challenge, A.M.: (2022), https://www.hackerearth.com/en-us/challenges/ competitive/amazon-ml-challenge/, [Online; accessed 23-May-2022] 3. Flipkart: (2022), https://www.kaggle.com/PromptCloudHQ/flipkart-products, [Online; accessed 23-May-2022] 4. GS1: Global Product Classification (GPC) | GS1. https://www.gs1.org/ standards/gpc, [Online; accessed October 20, 2022] 5. He, P., Gao, J., Chen, W.: Debertav3: Improving deberta using electra-style pre- training with gradient-disentangled embedding sharing. CoRR abs/2111.09543 (2021). https://doi.org/10.48550/arxiv.2111.09543 6. J ̈ager, S., Greene, J., Jakob, M., Korenke, R., Santarius, T., Biessmann, F.: GreenDB: Toward a Product-by-Product Sustainability Database. Tech. rep., arXiv (May 2022). https://doi.org/10.48550/arXiv.2205.02908 7. J ̈ager, S., Biessmann, F., Flick, A., Sanchez Garcia, J.A., von den Driesch, K., Brendel, K.: GreenDB: A Product-by-Product Sustainability Database (Feb 2022). https://doi.org/10.5281/zenodo.6576662, Supported by the Federal Ministry for the Environment, Nature Conservation and Nuclear Safety based on a decision of the German Bundestag. F ̈orderkennzeichen: 67KI2022B 8. J ̈ager, S., Flick, A., Garcia, J.A.S., Driesch, K.v.d., Brendel, K., Biessmann, F.: GreenDB - A Dataset and Benchmark for Extraction of Sustainability Information of Consumer Goods (Aug 2022). https://doi.org/10.48550/arXiv.2207.10733 9. Kale, A., Kallumadi, S., King, T.H., Malmasi, S., de Rijke, M., Tagliabue, J.: Ecom'22: The sigir 2022 workshop on ecommerce. In: Proceedings of the 45th In- ternational ACM SIGIR Conference on Research and Development in Information Retrieval. p. 3485–3487. SIGIR '22, Association for Computing Machinery, New York, NY, USA (2022). https://doi.org/10.1145/3477495.3531701 10. Lin, Y., Das, P., Datta, A.: Overview of the SIGIR 2018 ecom rakuten data challenge. In: Degenhardt, J., Fabbrizio, G.D., Kallumadi, S., Kumar, M., Trot- man, A., Lin, Y., Zhao, H. (eds.) The SIGIR 2018 Workshop On eCommerce co-located with the 41st International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR 2018), Ann Arbor, Michigan, USA, July 12, 2018. CEUR Workshop Proceedings, vol. 2319. CEUR-WS.org (2018), http://ceur-ws.org/Vol-2319/ecom18DC_paper_13.pdf 11. Northcutt, C.G., Jiang, L., Chuang, I.L.: Confident learning: Estimating un- certainty in dataset labels. J. Artif. Intell. Res. 70, 1373–1411 (2021). https: //doi.org/10.1613/jair.1.12125 12. Peeters, R., Bizer, C.: Cross-Language Learning for Entity Matching. In: Com- panion Proceedings of the Web Conference 2022. pp. 236–238 (Apr 2022). https: //doi.org/10.1145/3487553.3524234 13. Peeters, R., Bizer, C., Glavas, G.: Intermediate training of BERT for product matching. In: Piai, F., Firmani, D., Crescenzi, V., Angelis, A.D., Dong, X.L., 6 Flick et al. Mazzei, M., Merialdo, P., Srivastava, D. (eds.) Proceedings of the 2nd Interna- tional Workshop on Challenges and Experiences from Data Integration to Knowl- edge Graphs co-located with 46th International Conference on Very Large Data Bases, DI2KG@VLDB 2020, Tokyo, Japan, August 31, 2020. CEUR Workshop Proceedings, vol. 2726. CEUR-WS.org (2020), http://ceur-ws.org/Vol-2726/ paper1.pdf 14. Primpeli, A., Peeters, R., Bizer, C.: The wdc training dataset and gold standard for large-scale product matching. In: Companion Proceedings of The 2019 World Wide Web Conference. pp. 381–386. WWW '19, Association for Computing Machinery, New York, NY, USA (2019). https://doi.org/10.1145/3308560.3316609 15. PromptCloud: Innerwear and Others. https://www.kaggle.com/datasets/PromptCloudHQ/ innerwear-data-from-victorias-secret-and-others (2022), [Online; accessed October 20, 2022] Victoria's Secret Data from 16. Rozen, O., Carmel, D., Mejer, A., Mirkis, V., Ziser, Y.: Answering product- questions by utilizing questions from other contextually similar products. In: Pro- ceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. pp. 242–253. Asso- ciation for Computational Linguistics, Online (Jun 2021). https://doi.org/10. 18653/v1/2021.naacl-main.23 17. Shi, X., Mueller, J., Erickson, N., Li, M., Smola, A.J.: Benchmarking multimodal automl for tabular data with text fields. CoRR abs/2111.02705 (2021). https: //doi.org/10.48550/arxiv.2111.02705 18. Yang, L., Wang, Q., Yu, Z., Kulkarni, A., Sanghai, S., Shu, B., Elsas, J., Kanagal, B.: MAVE: A Product Dataset for Multi-source Attribute Value Extraction. In: Proceedings of the Fifteenth ACM International Conference on Web Search and Data Mining. pp. 1256–1265. WSDM '22, Association for Computing Machinery, New York, NY, USA (Feb 2022). https://doi.org/10.1145/3488560.3498377 19. Zhang, Z., Bizer, C., Peeters, R., Primpeli, A.: MWPD2020: semantic web chal- lenge on mining the web of html-embedded product data. In: Zhang, Z., Bizer, C. (eds.) Proceedings of the Semantic Web Challenge on Mining the Web of HTML- embedded Product Data co-located with the 19th International Semantic Web Conference (ISWC 2020), Athens, Greece, November 5, 2020. CEUR Workshop Proceedings, vol. 2720. CEUR-WS.org (2020), http://ceur-ws.org/Vol-2720/ paper1.pdf
http://arxiv.org/abs/2302.12130v1
2023-02-23T16:12:19
2023-02-23T16:12:19
Bayesian Structure Scores for Probabilistic Circuits
Probabilistic circuits (PCs) are a prominent representation of probability distributions with tractable inference. While parameter learning in PCs is rigorously studied, structure learning is often more based on heuristics than on principled objectives. In this paper, we develop Bayesian structure scores for deterministic PCs, i.e., the structure likelihood with parameters marginalized out, which are well known as rigorous objectives for structure learning in probabilistic graphical models. When used within a greedy cutset algorithm, our scores effectively protect against overfitting and yield a fast and almost hyper-parameter-free structure learner, distinguishing it from previous approaches. In experiments, we achieve good trade-offs between training time and model fit in terms of log-likelihood. Moreover, the principled nature of Bayesian scores unlocks PCs for accommodating frameworks such as structural expectation-maximization.
[ "Yang Yang", "Gennaro Gala", "Robert Peharz" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12130v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12130v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "stat.ML" ]
Bayesian Structure Scores for Probabilistic Circuits 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 0 3 1 2 1 . 2 0 3 2 : v i X r a Yang Yang* Eindhoven University of Technology KU Leuven Gennaro Gala* Eindhoven University of Technology Robert Peharz Graz University of Technology Eindhoven University of Technology Abstract Probabilistic circuits (PCs) are a prominent representation of probability distributions with tractable inference. While parameter learning in PCs is rigorously studied, structure learning is of- ten more based on heuristics than on principled objectives. In this paper, we develop Bayesian structure scores for deterministic PCs, i.e., the structure likelihood with parameters marginal- ized out, which are well known as rigorous objec- tives for structure learning in probabilistic graph- ical models. When used within a greedy cutset algorithm, our scores effectively protect against overfitting and yield a fast and almost hyper- parameter-free structure learner, distinguishing it from previous approaches. In experiments, we achieve good trade-offs between training time and model fit in terms of log-likelihood. More- over, the principled nature of Bayesian scores un- locks PCs for accommodating frameworks such as structural expectation-maximization. 1 INTRODUCTION Probabilistic circuits (PCs) (Vergari et al., 2020) have emerged as a powerful framework for describing tractable probabilistic models, such as Chow-Liu trees (Chow & Liu, 1968), arithmetic circuits (Darwiche, 2003), sum-product networks (Poon & Domingos, 2011), probabilistic senten- tial decision diagrams (Kisa et al., 2014) and cutset net- works (CNets) (Rahman et al., 2014). PCs can be catego- rized into several sub-families specified by structural prop- erties or constraints, which go hand in hand with certain tractable inference routines (Vergari et al., 2020), such as marginalization, conditioning, most-probable explanation, expectations, etc. *These authors contributed equally. Proceedings of the 26th International Conference on Artificial Intelligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). PCs can either be compiled from other models (Darwiche, 2003) or learned directly from data (Lowd & Domin- gos, 2008; Poon & Domingos, 2011). When learning PCs from data, we might-similar as in classical prob- abilistic graphical models (PGMs) (Koller & Friedman, 2009)-distinguish between parameter learning and struc- ture learning. Parameter learning has been rigorously stud- ied in PCs and mirrors state-of-the-art in PGMs. Specifi- cally, techniques for parameter learning in PCs are (closed- form) maximum-likelihood estimation (for the sub-class of deterministic PCs) (Kisa et al., 2014; Peharz et al., 2014), expectation-maximization (Peharz et al., 2016), concave- convex procedures (Zhao, Poupart, & Gordon, 2016), Bayesian approaches (Zhao, Adel, et al., 2016; Rashwan et al., 2016; Vergari et al., 2019; Trapp et al., 2019), discrim- inative methods (Rashwan et al., 2018; Peharz, Vergari, et al., 2020), continuous embeddings (Shao et al., 2022; Cor- reia et al., 2022), and latent variable distillation (Liu et al., 2022). Structure learning in PCs, however, is generally less prin- In the latter, the two main styles cipled than in PGMs. of structure learning are constraint-based, i.e., detect- ing conditional independencies in the data and translat- ing them into a corresponding graph structure (Koller & Friedman, 2009); and score-based, i.e., phrasing struc- ture learning as a discrete optimization problem, aiming to find a graph that maximizes some structure score. Score- based approaches have turned out to be more practical, as constraint-based approaches tend to be sensitive to statisti- cal noise in conditional independence tests (Koller & Fried- In particular, Bayesian structure man, 2009, page 790). scores (Buntine, 1991; Geiger & Heckerman, 1994; Heck- erman et al., 1995) are some of the most prominent scores, due to their principled nature and asymptotic consistency guarantees (Koller & Friedman, 2009). Bayesian scores are the (log-)likelihood of the candidate structures, with pa- rameters marginalized out, and have been the target of both greedy (Cooper & Herskovits, 1992) and exact (De Cam- pos et al., 2009) structure optimizers. In PCs, however, structure learners are often based on heuristics. The most prominent structure learning scheme is probably LearnSPN (Gens & Domingos, 2013), which, Bayesian Structure Scores for Probabilistic Circuits in a nutshell, uses top-down multi-clustering to lay out the PC structure. The same approach is taken in ID-SPN (Rooshenas & Lowd, 2014), which augments LearnSPN by using expressive distribution models as sub-modules. Other structure learners are based on singular-value decom- position (Adel et al., 2015), bottom-up information bottle- neck learning (Peharz et al., 2013) or are motivated by deci- sion tree learning (Rahman et al., 2014). None of these ap- proaches declare an explicit objective for structure learning, although at test time they are usually evaluated in terms of log-likelihood. Moreover, they often rely on a large num- ber of hyper-parameters, which are tedious to set or need to be tuned on a separate validation set. There are also score-based approaches to learn PC struc- tures, e.g. the ones by Lowd and Domingos (2008); Pe- harz et al. (2014), who use a weighted sum of training log- likelihood and circuit size as a structure score. The circuit size directly corresponds to the worst-case inference cost in PCs, thus these scores have the interesting interpretation of trading off "model fit" vs. "inference complexity." How- ever, a deeper theoretical justification of these scores has yet to be shown. Similarly, the Strudel method (Dang et al., 2020) also performs a structure search based on "heuris- tic scores calculated from data." Thus, these score-based methods are-similarly as the previously mentioned struc- ture learners-of heuristic nature, usually equipped with various (often unintuitive) hyper-parameters for regulariz- ing the model, and require a separate validation set. In this paper, we propose a principled avenue to PC struc- ture learning and put a particular emphasis on elegance and simplicity. Specifically, we derive Bayesian struc- ture scores for deterministic PCs,1 by equipping parame- ters with suitable priors and marginalizing them from the Bayesian model. Thus, similarly as in PGMs, a Bayesian score is the marginal likelihood of the PC structure under a particular choice of parameter prior. Intuitively, since the Bayesian score averages over all possible choices of parameters, it effectively protects against overfitting, as overly complex structures will have a significant portion of "bad" parameters that are not well-supported by the data. In the special case of discrete data and Dirichlet priors, one yields the well-known Bayes-Dirichlet (BD) score (Buntine, 1991; Heckerman et al., 1995). We employ the BD score within greedy cutset learning (Rahman et al., 2014), a simple and fast structure learning scheme for PCs. Our method has a single hyper-parameter governing the Dirichlet prior, the equivalent sample size (ESS), which we, however, keep fixed to 0.1 throughout our experiments, rendering our method effectively hyper-parameter-free. Additionally, we consider the Bayesian information crite- rion (BIC), which is frequently used as an alternative to the BD score, as they are asymptotically equivalent (Schwarz, 1978; Koller & Friedman, 2009). The BIC score has in- deed been considered for PCs (Di Mauro et al., 2015), but in a form which undercounts the actual number of parame- ters. Our corrected version of the BIC score improves the results by Di Mauro et al. (2015) and is demonstrated to be a viable and efficient alternative to our full BD score. Both BD and BIC are de facto hyper-parameter-free and designed to reflect generalization. Therefore, they can use the full training data, without the need to dedicate part of it to a validation set. Both scores deliver models com- petitive with state-of-the-art when learned on 20 common benchmark density estimation data sets, even though we are using a simplistic structure learner. We compare our ap- proach with various other PC structure learners, both sim- ple ones-which we run, like our methods, with their de- fault hyper-parameters on the entire training data-and so- phisticated ones-which use extensive tuning but consume orders of magnitude more computational resources. Our structure learners are often located on the Pareto front de- termined by training time and test log-likelihood, i.e. they are among the best fast structure learners. This, together with the fact that we use well-principled structure objec- tives, make our algorithms highly practical. Moreover, since a Bayesian score is just the marginal structure likelihood, we can naturally embed our structure learner within a structural expectation maximization (EM) algorithm (Friedman, 1998) for learning mixtures of PCs. Structural EM, which to the best of our knowledge has not been applied to PCs before, consistently improves over sin- gle PCs learned with BD, and delivers models close to or surpassing state-of-the-art. The source code to replicate the experiments is avail- at https://github.com/yangyang-pro/ able bayesian-scores-pc. 2 PROBABILISTIC CIRCUITS Given a set of random variables X, a probabilistic circuit (PC) over X is a computational (directed acyclic) graph = (V, E) containing three types of computational nodes, G namely distribution nodes, weighted sums and products. As we elaborate below, each node N V computes a (pos- sibly unnormalized) probability distribution over some sub- set of X, denoted as the scope of N. Hence, we associate 2X, assigning to with each PC a scope function σ : V X. Naturally, the scope each node N of any internal node N satisfies σ(N) = (cid:83) N(cid:48)∈in(N) σ(N(cid:48)), where in(N) is the set of all input nodes to N, thus the scope function σ is completely specified by the scopes of the leaves (also called input nodes) of V its scope σ(N) → ⊆ ∈ ∈ . G 1Extensions to general, non-deterministic PCs are left to future work, but possible directions are given in the Discussion. Any leaf L V of the PC is a probability distribution over its scope σ(L), where one typically uses some "sim- ∈ Yang Yang, Gennaro Gala, Robert Peharz ple" parametric distribution like Gaussian, Poisson, cate- gorical, etc., whose parameters are denoted as θL. The internal nodes of the PC are either sums or products. A sum node S, equipped with weights wS = }N∈in(S), computes a convex combination (mixture) of its inputs, i.e., S = (cid:80) N∈in(S) wSN = 1 and 0; a product node P computes the product of its wSN inputs, i.e., P = (cid:81) Θ, w } of the PC are all parameters of the leaf distributions wS S∈V , where Θ = θL { } { the expression L V ) means that we range over all leaves (respectively sum nodes) in V . N∈in(S) wSN N, where (cid:80) N∈in(P) N. The parameters L∈V and all sum weights w = V (respectively S wSN ≥ ∈ ∈ { } { Since all leaves are probability distributions and all sum- weights are non-negative, it follows that each node in V computes some (possibly unnormalized) distribution over its scope. We assume that the PC has a single output node, having full scope X, which represents the model distribu- tion. It can be computed for any input sample x using a feed-forward pass in the PC. Besides evaluating the model density, PCs also allow a wide range of tractable probabilistic inference routines, if they satisfy certain structural properties (or constraints), denoted as decomposability, smoothness, determinism, and structured decomposability. Specifically: • A PC is decomposable, if for each product node P it in(P). holds that σ(N) σ(N(cid:48)) = = N(cid:48) , for all N ∅ ∈ ∩ • A PC is smooth, if for each sum node S it holds that σ(N) = σ(N(cid:48)), for all N, N(cid:48) in(S). ∈ • A PC is deterministic, if for each sum node S and each sample x, at most one of the inputs of S is non-zero. • Furthermore, structured decomposability denotes a stricter form of decomposability, where the decom- positions of all products adhere to a common pattern described by a so-called vtree (Pipatsrisawat & Dar- wiche, 2008; Kisa et al., 2014; Ahmed et al., 2022). Not all properties are needed for each and every inference scenario, and studying the correspondence between struc- tural properties and tractable inference routines is one of the intriguing facets of PCs (Darwiche & Marquis, 2002; Vergari et al., 2020). Typically one assumes at least the properties decomposability and smoothness, which ensure that each probability distribution computed by any node N V is already normalized. More importantly, they enable tractable marginals and conditionals-the two core routines of probabilistic reasoning (Ghahramani, 2015)- in time linear in the circuit size (Peharz et al., 2015). In the remainder of the paper, we assume that any PC is decom- posable and smooth. ∈ Adding determinism yields tractable inference of most- probable explanations (MPE), i.e., finding maximizers of the PC distribution, and exact computation of maximum- likelihood parameters (Kisa et al., 2014; Peharz et al., 2014). In this paper, we will see that determinism also allows to compute Bayesian structure scores exactly and efficiently. Structured decomposability allows taking expectations of one circuit with respect to another (Khosravi et al., 2019), computing divergences between PCs (Vergari et al., 2021), etc. PCs have evolved into a "lingua franca" of tractable mod- els, since many of them can be cast into the PC framework. PCs might be compiled from other models (Darwiche, 2003) or learned directly from data, where we can distin- guish between parameter learning and structure learning. As mentioned in the introduction, structure learning in PCs is usually rather ad-hoc and heuristic. In this paper, we de- velop Bayesian scores as well-principled objectives for PC structure learning. 3 BAYESIAN STRUCTURE SCORES FOR DETERMINISTIC PCS D = N x(n) Assume a training set n=1 of N samples drawn } { i.i.d. from an unknown probability distribution, and a struc- tured, parametric density model p(x ), that is, a distri- bution over X conditional on continuous parameters Θ and . The basic idea of the Bayesian a structure parameter structure score is to (i) equip Θ with some prior distribu- tion p(Θ G by marginalizing the parameters from the Bayesian model: ), and to (ii) derive the marginal likelihood of Θ, | G G G | ( G B ) := p( D | G (cid:90) ) = p(Θ ) | G (cid:89) x∈D p(x Θ, | G ) dΘ. (1) The Bayesian score might be used as a direct target of opti- mization, i.e. a maximum likelihood approach with respect . Alternatively, it might also be wrapped into a larger to probabilistic framework, e.g. a Bayesian approach with re- spect to structure (Friedman & Koller, 2003) or structural expectation maximization (Friedman, 1998). G While eq. (1) is a hard computational problem in general, there are interesting special cases where it can be com- puted exactly and efficiently. In particular, in the context of Bayesian networks over discrete data, the well-known Bayes-Dirichlet (BD) score has been studied by Buntine (1991); Cooper and Herskovits (1992); Heckerman et al. (1995). By using Dirichlet priors on the parameters, to- gether with particular assumptions such as independence among variable families, parameter modularity among dif- ferent structures, etc., the BD score can be computed an- alytically in Bayesian networks. Similarly, for Bayesian networks with Gaussian parameters and normal-Wishart priors, the Bayes-Gauss (BG) score has been developed (Geiger & Heckerman, 1994). (cid:54) Bayesian Structure Scores for Probabilistic Circuits G Θ, w { = (V, E) be a candidate PC structure Let now L∈V and w = , where Θ = with parameters } } S∈V . The parameters of each leaf L are equipped with wS { } a prior p(θL), where we assume that eq. (1), when restricted to L, can be computed exactly and efficiently. That is, we can compute θL { (cid:90) L = B p(θL) (cid:89) x∈D p(x | θL) dθL. (2) In order to keep the notation uncluttered, we write p(x θL), which should be understood as an evaluation of the leaf on the sub-vector of x whose entries correspond to σ(L). Eq. (2) can be computed in closed form for many expo- nential families with conjugate priors, e.g. the Gaussian- Wishart and Binomial-Dirichlet families. | Further, wS = wSN { let S be an arbitrary sum node with weights }N∈in(S), which we equip with a Dirichlet prior (cid:89) wαSN−1 SN , (3) p(wS) = 1 B(αS) N∈in(S) inputs remain unchanged when varying parameters, i.e., for each sample x and sum node S it holds that if S has Θ(cid:48), w(cid:48) a non-zero input under two distinct parameters } and , then the same input must be non-zero for } both parameter choices. We call this property parameter- consistent determinism, which is often assumed by default in literature (Choi et al., 2020). Θ(cid:48)(cid:48), w(cid:48)(cid:48) { { A simple way to enforce structural and parameter- consistent determinism is to associate with each sum S a X, and let S be of corresponding random variable XS the form ∈ S = (cid:88) k pk(XS) pk(σ(S) XS), \ × (6) where pk(XS) are distributions over XS (leaves of the PC) whose supports3 are disjoint and independent of any pa- rameters, and pk(σ(S) XS) are arbitrary PC nodes with scope σ(S) XS. This form of determinism is very com- mon and known under various names such as decision (Darwiche & Marquis, 2002) or regular selectivity (Peharz et al., 2014). \ \ parameterized by αS = }N∈in(S), where αSN > 0, αSN { and B(αS) is the Beta function, i.e. the normalization con- stant of the Dirichlet distribution. Assuming a-priori pa- rameter independence, we get the prior p(Θ, w ) = | G = (cid:89) S∈V (cid:89) S∈V p(wS) (cid:89) L∈V p(θL) 1 B(αS) (cid:89) wαSN−1 SN N∈in(S) (cid:89) L∈V p(θL). (4) The structure completely parametrize the PC distribution p(x G such that the Bayesian structure score for PCs is given as , leaf parameters Θ, and sum-weights w ),2 Θ, w, G | (cid:90) (cid:90) P C( G B ) = p(Θ, w ) | G (cid:89) x∈D Θ, w, p(x | G ) dΘ dw. computing (5) for non- While ) deterministic PCs, due to the high-dimensional integrals which do not simplify further, we can derive an analytic solution for deterministic PCs. intractable P C( is B G Recall that in deterministic PCs, for each possible sample x and each sum node S at most one input to S is non-zero. In general, whether a PC is deterministic or not might de- pend on both the structure in a convoluted manner. In this paper, however, we require determinism holds for each choice of pa- that for given rameters, a property which we call structural determinism. Moreover, we require that the indices of the non-zero sum and the parameters Θ, w { G G } 2For simplicity, we leave the scope function implicit, i.e. we assume that each leaf "knows" its scope. G The key to computing the Bayes score in deterministic PCs is the tree decomposition introduced by Zhao, Adel, et al. (2016). Specifically, they introduced the notion of induced tree, a sub-graph of obtained by (i) removing all inputs except one from each sum node in , and (ii) removing all nodes which are rendered unreachable from the root. Since we can decide for each sum node independently which in- put to remove, the number of induced trees is exponential in the number of sum nodes. They show that the PC distri- bution can be written as a "large flat mixture," the so-called tree decomposition (cf. also Trapp et al. (2019)) G Θ, w, p(x | ) = G (cid:88) (cid:89) τ ∈G SN∈E 1[SN∈τ ] SN w (cid:89) L∈V p(x | θL) 1[L∈τ ], (7) where the sum runs over all induced trees contained in , G the first product runs over all sum-input edges, and the sec- ond product over all leaves. Here, 1[SN τ ] is the indi- cator that the edge between S and N is contained in τ and 1[L τ ] indicates whether L is in τ . Thus, each sum term in (7) is the product of all sum-weights and leaves appear- ing in τ . ∈ ∈ ∈ D It turns out that, for some parameter set of non-zero mea- exactly one sure under prior (4), there is for each x non-zero term in the exponential sum in eq. (7), corre- sponding to a particular induced tree τx. First, we can as- sume without loss of generality that there exists at least one non-zero term-otherwise (5) would evaluate to zero, which would be the correct score for the considered candi- date structure. Further, in decomposable and deterministic PCs, there can be at most one non-zero term, correspond- ing to a particular induced tree τx. This induced tree can 3The support is the set of inputs where the density is non-zero. Yang Yang, Gennaro Gala, Robert Peharz be found by tracing the PC backwards from root to leaves, where at sum nodes the single non-zero input is followed and at product nodes all inputs are followed. If at any sum node a zero-input was selected, it can be shown that the corresponding term in eq. (7) evaluates to zero (Peharz et al., 2014). Consequently, eq. (7) reduces to Θ, w, p(x | ) = G (cid:89) 1[SN∈τx] SN w SN∈E (cid:89) L∈V p(x | θL) 1[L∈τx]. (8) Substituting (4) and (8) into (5) and re-arranging products yields (cid:90) (cid:90) (cid:32) P C( G B ) = (cid:32) 1 B(αS) (cid:89) wαSN−1 SN (cid:89) 1[SN∈τx] SN w N∈in(S) x∈D (cid:33) p(θL) (cid:89) x∈D p(x | (cid:33) 1[L∈τx] θL) dΘ dw. (cid:89) S∈V (cid:89) L∈V (9) Since we assume parameter-consistent determinism, the in- duced tree τx remains fixed when ranging over Θ, w. To- gether with parameter independence, this allows us to pull the integrals into the products, yielding P C( ) = G B  (cid:90)  (cid:32)(cid:90) (cid:89) S∈V (cid:89) L∈V 1 B(αS) (cid:89) N∈in(S)  wαSN+n[SN]−1 SN dwS  p(θL) (cid:89) x∈DL p(x | (cid:33) θL) dθL , (10) x∈D 1[SN where n[SN] := (cid:80) τx] counts how often the edge between S and N appears in an induced tree through- out the dataset, and is the sub- { dataset of samples where L appears in the corresponding induced tree. ∈ D | L := τx D ∈ ∈ x L } The first line of (10) takes essentially the same form as eq. (23) in Heckerman et al. (1995) and yields the widely know Bayes-Dirichlet score   (cid:89) S∈V Γ(αS) Γ(n[S] + αS) (cid:89) N∈in(S) Γ(n[SN] + αSN) Γ(αSN)   , (11) where αS := (cid:80) N∈in(S) αSN and n[S] := (cid:80) N∈in(S) n[SN]. The factors in the second line of (10) are exactly eq. (2), which we assumed to be tractable. For instance, if the leaves are categorical, the solution is again the Bayes- Dirichlet score; if they are Gaussian, we can use the Bayesian-Gaussian score (Geiger & Heckerman, 1994). 4 BAYESIAN INFORMATION CRITERION As an alternative to the Bayesian score, we also adapt the Bayesian information criterion (BIC) as a structure score for PCs. In general, given a graph structure set , the BIC score is defined as D and a training G BIC( G ) = LL( G ; ) D − log |D| 2 , (cid:107)G(cid:107) (12) ; G G D ) is the log-likelihood under the graph struc- when using maximum likelihood parameters (poten- where LL( ture tially with Laplace smoothing), (cid:107)G(cid:107) . The is the number of independent parameters encoded in second term log|D| is essentially a regularization term penalizing complex structures. BIC is often used as an al- ternative to BD and for Bayesian networks its asymptotic consistency has been shown (Koller & Friedman, 2009). is the size of 2 (cid:107)G(cid:107) and |D| D G (cid:107)G(cid:107) The BIC score has been used to learn CNets in Di Mauro et al. (2015). However, the authors defined as the num- ber of conditioning nodes in the CNet, but did not count the parameters of the contained Chow-Liu trees (see next section for details), which actually undercounts the inde- pendent parameters in the corresponding PC and weakens the penalty. In our experiments, we show that the corrected BIC score reflects better generalization performance and outperforms Di Mauro et al. (2015). 5 SCORE-BASED CUTSET LEARNING Ideally, we would like to use our structure scores to find a global optimum among all deterministic PCs, which is presumably NP-hard. Thus, in order to use our scores for structure learning, we need a method to "navigate" through the space of deterministic PCs. Cutset learning (Rahman et al., 2014) is an attractive method to this end, since it per- forms greedy search using large structural changes, making it fast and effective. In this section, we provide the required background and adapt cutset learning to our purposes, i.e., guide the search by our structure scores. We will for sim- plicity consider binary data, although cutset learning can be generalized to continuous data as well. T T Chow-Liu Trees. A Chow-Liu tree (CLT) is a Bayesian network (Koller & Friedman, 2009), denoted as ( , Θ) is a directed tree (meaning each node has where T random variables X and at most one parent) over X∈X is a collection of conditional prob- Θ = θX|π(X)} { ability tables (CPTs), where π(X) denotes the parent of . The Chow-Liu Algorithm (Chow & Liu, 1968) X in by running a maximum span- learns the tree structure ning tree algorithm (Kruskal, 1956) on the fully-connected graph over X, weighted with the mutual information be- tween pairs of variables, which is estimated from data. As shown by Chow & Liu, this spanning tree yields a maxi- mizer of the log-likelihood structure score (Koller & Fried- man, 2009), making the Chow-Liu algorithm an early ex- ample of a principled structure learning algorithm. The edges of maximal spanning tree are then directed and Θ is estimated using maximum likelihood. T Bayesian Structure Scores for Probabilistic Circuits Algorithm 1 CUTSET STRUCTURE LEARNING Require: A training set D = {x(n)}N n=1 over binary RVs X; number of candidate conditioning nodes λ. Ensure: a CNet C∗ representing a deterministic PC. { X1, X2, X3, X4, X5} Figure 1: A CNet over binary random variables X = C4} are decision nodes whose left (resp. right) branches rep- resent conditioning on state 0 (resp. 1). The leaves of the 5 i, Θi) i=1. CNet are CLTs } . Inner nodes {C1, C2, C3, ( T { Cutset Networks. Cutset networks (CNets) (Rahman et al., 2014) improve CLTs by embedding them in a hierar- chical conditioning process. A CNet is a binary decision tree, whose decision nodes correspond to some variable in X and whose leaves are CLTs over the undecided variables, i.e., the variables not appearing in any decision node on the unique path from root to leaf. Further, the outgoing edges of decision nodes are equipped with normalized weights. For any sample x, the probability assigned by the CNet is the product of weights on the path from root to the selected CLT leaf (following decisions according to the values in x), times the probability the CLT assigns to the undecided vari- ables. An example CNet is shown in Figure 1. CNets have been extensively studied in literature since they deliver simple, effective and fast structure learning algo- rithms (Rahman et al., 2014; Di Mauro et al., 2015, 2017; Dang et al., 2020; Di Mauro et al., 2021). CNets can be converted into smooth, deterministic and decomposable PCs (Dang et al., 2020; Di Mauro et al., 2021), making them amenable to our structure scores. Pseudo code for cutset learning with structure scores is shown in Algorithm 1, which recursively selects variables to condition upon. Our strategy is to select a variable, which, when used in a new decision node with two con- ditional CLT leaves, would increase our score most. This selection is done in SELECTBESTCUT, which uses either our Bayesian or BIC score of the corresponding PC.4 As testing every unconditioned variable increases runtime lin- early in the overall number of variables, we restrict the selection to the set of the λ most promising candidates (SELECTBESTCANDIDATES) according to the information gain heuristic in Rahman et al. (2014). This heuristic, akin to beam search, did not impact performance but yielded 4In our implementation we avoided explicit compilation to PCs, but performed the corresponding computations directly within the CNet. T ∗ ← LEARNCLT(X, D) ̃X ← SELECTBESTCANDIDATES(X, D, λ) X ∗, C∗, Dl, Dr ← SELECTBESTCUT( ̃X, D) if S(T ∗) > S(C∗) then 1: function CUT(X, D, λ) 2: 3: 4: 5: 6: 7: 8: return T ∗ else C∗ ← CNET(X ∗, CUT(X\X ∗, Dl, λ), CUT(X\X ∗, Dr, λ)) return C∗ end if for all X ∈ ̃X do 9: 10: 11: end function 12: function SELECTBESTCUT( ̃X, D) 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: end function Dl, Dr ← SPLIT(X, D) Tl ← LEARNCLT(X\X, Dl) Tr ← LEARNCLT(X\X, Dr) C ← CNET(X, Tl, Tr) S(C) ← SCORE(C) end for X ∗ ← best X with the highest S(C) return X ∗, C∗, Dl, Dr substantial runtime improvements. Our structure learner stops as soon as no improvement of the score is achieved. 6 STRUCTURAL EXPECTATION-MAXIMIZATION Since the Bayesian structure score is the (marginal) like- lihood of the structure, it can naturally be incorpo- rated in larger probabilistic frameworks such as structural expectation-maximization (Friedman, 1998). Specifically, we consider mixtures of CNets of the form pmix(x) = K (cid:88) k=1 ak p(x Θ, w, ) G | 0 and (cid:80) ≥ where ak k ak = 1, and K is the number of components. We initialize the model by clustering the data set into K clusters using k-means, and training individ- ual CNets on each portion. The structural E-step consists of computing the responsibilities of each component pro- portional to γk ), where we use the posterior predictive distribution to average over parameters. The re- sponsibilities are then used in the structural M-step as (i) weighted average to update ak and (ii) as fractional sam- ples within our cutset learner. It should be noted that also other (heuristic) structure learners can be employed in such a scheme, as they presumably also optimize the structure likelihood in some indirect way. ak p(x | G ∝ X1X4T4X4X1T5X4X1X2T1X1X5X4T2X5X4X1T3X20.20.8C4X20.50.5C3X50.40.6C2X30.30.7C1 Yang Yang, Gennaro Gala, Robert Peharz 7 EXPERIMENTS We evaluate our approach on both density estimation and image completion tasks, where for simplicity we focus on binary data. We use the full Bayesian score-yielding the BDeu score (Heckerman et al., 1995) in the context of bi- nary data, denoted as CNetBD-and the BIC score, de- noted as CNetBIC. We limit the number λ of candidate conditioning nodes in these two approaches to ten. The following structure learners of PCs from literature are used as competitors: the original cutset network (CNet) (Rahman et al., 2014), XCNet (Di Mauro et al., 2017), dCSN (Di Mauro et al., 2015), Strudel (Dang et al., 2020), LearnSPN (Gens & Domingos, 2013) and ID-SPN (Rooshenas & Lowd, 2014). All cutset learners except for dCSN are developed in Python using the DeeProb-kit library (Loconte & Gala, 2022). For LearnSPN, we re- port results from (Gens & Domingos, 2013). For all other structure learners, we use the open-source implementations from respective authors. 7.1 Standard Density Estimation Benchmarks As a first experiment, we evaluate all structure learning approaches as density estimators on twenty commonly- used benchmark data sets. For CNetBD and CNetBIC, the equivalent sample size (ESS, uniform Dirichlet parameter α) and the Laplace smoothing factor (β) are the only hyper- parameters, respectively. For all data sets, we fix α = 0.1 for CNetBD and β = 0.01 for CNetBIC, rendering our methods are de facto hyper-parameter-free. Moreover, the Bayesian nature of our scores should effec- tively protect against overfitting and directly correspond to generalization. Hence, to demonstrate this benefit, we train on all available data, without the need of a separate valida- tion set. We apply the same procedure (fixed hyperparame- ter, no validation set) to the more simple structure learners CNet, XCNet and dCSN, and provide the more "sophisti- cated" structure learners Strudel, LearnSPN, and ID-SPN with a validation set. Specifically, we re-train CNet on all data sets using the hyper-parameters reported in Rahman et al. (2014). In the case of XCNet and dCSN, we set β = 0.5, δ = 500 (the minimum number of samples to decompose) and ξ = 3 (the minimum number of features to decompose). These hyper-parameter values are expected to perform well on all data sets and are used as default values in their open-source implementations. Due to the randomness of XCNet, we use the average test log-likelihood and report the average time on ten different runs. The other structure learners-Strudel, LearnSPN and ID- SPN-have more complex learning strategies. Their im- plementations or reported results all rely on cross-tuning on a separate validation set. Therefore, we use the original training and validation splits for these methods, rather than the combined data. Ideally, we wish to learn density estimators that are both accurate in terms of the test log-likelihood and efficient in terms of the training time. Therefore, we consider the trade-off between the learning time and the accuracy as a multi-objective optimization problem. Figure 2 shows vi- sualizations of the learning time and test log-likelihoods of all structure learners for each data set. We plot a Pareto frontier as a dashed line for each data set. The Pareto- efficient methods on the line are emphasized with ampli- fied "aura" markers. From Figure 2, we observe that both CNetBD and CNetBIC appear to be Pareto-efficient on most data sets. Compared to other cutset learners with the same greedy learning strategy, CNetBD and CNetBIC In achieved leading performance among fast methods. comparison with more complex learners, CNet and CNet- BIC still outperform or are on par with Strudel and Learn- SPN on many data sets. The detailed results for each method are summarized in Table 1. Here we also include the mixture model based learned with structural EM (EM-CNetBD) to compare with the "complex structure learners." Since the mixture model has the number of mixture components as a hyper- parameter, we used the same split in training and valida- tion sets as used for the complex learners, and considered . We see that mixtures learned with K structural EM consistently improved over single models. Moreover, our mixtures are close to or improve state-of- the-art PCs. Additional results can be found in Appendix C. 2, 3, 5, 8, 10, 20 } ∈ { 7.2 Binary MNIST − − We further evaluate our models on the Binary-MNIST data set (Larochelle & Murray, 2011). We compare against Einsum networks (EiNets) (Peharz, Lang, et al., 2020), which allows large-scale training due to its tensor-based implementation. CNetBD (50K parameters) achieves a test log-likelihood of 118.71, and a mixture model based on CNetBD with 300 components (470K parameters) has a In comparison, an Ein- 103.95. test log-likelihood of Net generally has an rather large number of parameters, e.g. EinNet (1.2M parameters) has a test log-likelihood of 113.55 and a larger EinNet (84M parameters) achieves 99.82. − − Figure 3 shows image generation from CNetBD and EM models with different numbers of components. We can clearly observe that the generated images become more plausible with increasing the number of components. Moreover, Figure 3 shows in inpainting experiments using approximate MPE inference (Poon & Domingos, 2011), where we can see the reconstructions of covered images from mixture models are plausible. Bayesian Structure Scores for Probabilistic Circuits Figure 2: Test log-likelihoods (in nats) vs. learning times of all structure learners on 20 benchmark data sets. The optimal learners on the Pareto curve are highlighted with amplified "aura" markers. Data Set NLTCS MSNBC KDD Plants Audio Jester Netflix Accidents Retail Pumsb-star DNA Kosarek MSWeb Book EachMovie WebKB Reuters-52 20Newsgroup BBC Ad CNet -6.113 -6.057 -2.185 -13.187 -44.571 -61.670 -65.572 -30.860 -11.043 -24.497 -90.143 -11.197 -10.060 -37.293 -58.153 -161.650 -88.386 -162.488 -259.870 -16.436 XCNet -6.059 -6.061 -2.227 -13.381 -43.022 -56.173 -59.492 -31.720 -11.595 -25.575 -88.199 -12.165 -11.830 -43.550 -63.420 -182.453 -106.251 -184.297 -286.869 -60.120 dCSN -6.048 -6.057 -2.371 -13.312 -42.810 -55.506 -58.877 -29.880 -13.282 -23.900 -87.621 -12.462 -10.909 -48.116 -61.946 -171.743 -94.102 -181.165 -273.465 -15.774 CNetBD -6.064 -6.052 -2.240 -13.713 -42.210 -55.454 -58.820 -30.568 -10.940 -24.361 -87.643 -10.999 -10.012 -37.181 -61.400 -161.634 -87.766 -163.671 -320.052 -15.676 CNetBIC -6.043 -6.046 -2.201 -13.466 -41.927 -55.231 -58.649 -30.497 -10.939 -24.513 -87.642 -10.991 -10.039 -37.143 -59.365 -164.611 -89.461 -162.227 -268.861 -16.161 Strudel -6.068 -6.046 -2.173 -13.956 -42.319 -55.255 -58.659 -29.633 -10.908 -27.935 -88.167 -10.993 -10.192 -35.841 -60.503 -159.989 -91.778 -160.786 -260.084 -16.521 LearnSPN -6.110 -6.113 -2.182 -12.977 -40.503 -75.989 -57.328 -30.038 -11.043 -24.781 -82.523 -10.989 -10.252 -35.886 -52.485 -158.204 -85.067 -155.925 -250.687 -19.733 ID-SPN -6.030 -6.065 -2.150 -12.687 -39.950 -52.886 -56.575 -26.876 -10.913 -22.251 -80.550 -10.600 -9.797 -34.200 -52.588 -151.680 -83.954 -152.37 -249.12 -26.85 EM-CNetBD -6.032 -6.041 -2.159 -12.902 -39.943 -52.923 -56.604 -29.919 -10.927 -24.009 -85.437 -10.695 -9.963 -34.854 -53.378 -157.053 -84.993 -155.002 -258.691 -14.923 Table 1: Average test log-likelihoods (in nats) for all structure learners. The cutset learners are in the left group and other structure learners are in the right group. The model with the best performance in each group is highlighted in bold. (a) Sampling results. (b) Inpainting results. Figure 3: Samples (a) and inpainting results (b) for Binary-MNIST for CNetBD (left), EM-CNetBD with 100 components (middle) and 300 components (right). In (b), the original test images are shown in the top row; then in alternating rows the images with missing part and reconstructions are shown. 100102-6.10-6.05NLTCS101103-6.12-6.10-6.08-6.05MSNBC101103-2.40-2.30-2.20KDD101103-14.00-13.50-13.00-12.50Plants100102104-44.00-42.00-40.00Audio100102104-80.00-70.00-60.00-50.00Jester100102104-65.00-60.00-55.00Netflix100102104-32.00-30.00-28.00-26.00Accidents100102-13.00-12.00-11.00Retail101103-28.00-26.00-24.00-22.00Pumsb-star100102-90.00-85.00-80.00DNA101103-12.00-11.00Kosarek101103-12.00-11.00-10.00MSWeb101103-50.00-45.00-40.00-35.00Book101103-65.00-60.00-55.00EachMovie101103-180.00-160.00WebKB101103-110.00-100.00-90.00-80.00Reuters-52102104-180.00-160.0020Newsgroup101103105-325.00-300.00-275.00-250.00BBC101103105-60.00-40.00-20.00AdLearningTime(s)TestLog-likelihoodCNetBDCNetBICCNetXCNetdCSNStrudelLearnSPNID-SPN Yang Yang, Gennaro Gala, Robert Peharz 8 CONCLUSION Structure learning is a challenging task in PCs. While many techniques have been proposed in recent years, most of them are based on heuristics rather than on principled learn- ing objectives. This is in stark contrast to classical PGMs, where constraint-based and score-based approaches have been used. Our main motivation in this paper is to establish such principled approaches also for PC structure learning. In particular, we derived the Bayesian score known from the PGM literature to structure learning of deterministic PCs, and furthermore proposed a correction to the BIC score for PCs. Both scores were used in a simple structure learner and were allowed to "speak for themselves:" no ex- tensive cross-validation and no other defenses against over- fitting, such as early stopping, were required. The results demonstrate that such a simple and principled approach can be effective and efficient. We hope that our results stimu- late further research in this direction. Our approach is appealing both from a theoretical and prac- tical perspective, since our score is derived from probabilis- tic considerations, while being analytically tractable and fast in practice. The main caveat is that our score is re- stricted to deterministic circuits. Future directions, how- ever, might include approximations of these scores to gen- eral (non-deterministic) PC, using e.g. sampling (Vergari et al., 2019; Trapp et al., 2019), variational techniques (Zhao, Adel, et al., 2016), continuous relaxations (Lang et al., 2022), or numeric integration (Correia et al., 2022). Further interesting directions are studying the theoretical properties of Bayesian scores for PCs. For example, for PGMs, consistency of both the Bayesian and BIC score has been shown, meaning that they will identify the correct structure in the infinite data limit, provided that there ex- ists a PGM which is a perfect map for the data-generating distribution (Koller & Friedman, 2009). It is likely that such properties also hold for PCs, which might explain the similar performance of the BD and BIC scores in our ex- periments. However, rigorously establishing these results is left to future work. Acknowledgements We thank the Eindhoven Artificial Intelligence Systems In- stitute (EAISI) for its support. This research was supported by the Graz Center for Machine Learning (GraML). We thank YooJung Choi, Antonio Vergari, and Martin Trapp for helpful discussions. References Adel, T., Balduzzi, D., & Ghodsi, A. (2015). Learning the structure of sum-product networks via an SVD-based algorithm. In UAI (pp. 32–41). Ahmed, K., Teso, S., Chang, K.-W., den Broeck, G. V., & Vergari, A. (2022). Semantic probabilistic layers for neuro-symbolic learning. In A. H. Oh, A. Agarwal, D. Belgrave, & K. Cho (Eds.), Advances in Neural Information Processing Systems. Buntine, W. (1991). Theory refinement on Bayesian net- In Uncertainty Proceedings 1991 (pp. 52– works. 60). Choi, Y., Vergari, A., & Van den Broeck, G. (2020). Prob- abilistic circuits: A unifying framework for tractable probabilistic models. UCLA. URL: http://starai. cs. ucla. edu/papers/ProbCirc20. pdf . Chow, C., & Liu, C. (1968). Approximating discrete prob- ability distributions with dependence trees. Transac- tions on Information Theory, 14(3), 462–467. Cooper, G. F., & Herskovits, E. (1992). A Bayesian method for the induction of probabilistic networks from data. Machine Learning, 9(4), 309–347. Correia, A., Gala, G., Quaeghebeur, E., de Campos, (2022). Continuous mixtures arXiv preprint C., & Peharz, R. of tractable probabilistic models. arXiv:2209.10584. Dang, M., Vergari, A., & Broeck, G. (2020). Strudel: Learning structured-decomposable probabilistic cir- cuits. In International Conference on Probabilistic Graphical Models (pp. 137–148). Darwiche, A. (2003). A differential approach to inference in Bayesian networks. Journal of the ACM (JACM), 50(3), 280–305. Darwiche, A., & Marquis, P. (2002). A knowledge com- pilation map. Journal of Artificial Intelligence Re- search, 17, 229–264. De Campos, C. P., Zeng, Z., & Ji, Q. (2009). Structure learning of Bayesian networks using constraints. In International Conference on Machine Learning (pp. 113–120). Di Mauro, N., Gala, G., Iannotta, M., & Basile, T. M. In Uncer- (2021). Random probabilistic circuits. tainty in Artificial Intelligence (pp. 1682–1691). Di Mauro, N., Vergari, A., Basile, T., & Esposito, F. (2017). Fast and accurate density estimation with extremely randomized cutset networks. In Joint European Con- ference on Machine Learning and Knowledge Dis- covery in Databases (pp. 203–219). Di Mauro, N., Vergari, A., & Esposito, F. (2015). Learn- ing accurate cutset networks by exploiting decom- posability. In Congress of the Italian Association for Artificial Intelligence (pp. 221–232). Friedman, N. (1998). The Bayesian structural EM algo- rithm. In Conference on Uncertainty in Artificial In- telligence (pp. 129–138). Friedman, N., & Koller, D. (2003). Being Bayesian about network structure. A Bayesian approach to structure discovery in Bayesian networks. Machine Learning, 50(1), 95–125. Bayesian Structure Scores for Probabilistic Circuits Geiger, D., & Heckerman, D. (1994). Learning Gaus- sian networks. In Uncertainty Proceedings 1994 (pp. 235–243). Gens, R., & Domingos, P. (2013). Learning the structure of sum-product networks. In International Conference on Machine Learning (pp. 873–880). Ghahramani, Z. (2015). Probabilistic machine learning and artificial intelligence. Nature, 521(7553), 452–459. Heckerman, D., Geiger, D., & Chickering, D. M. (1995). Learning Bayesian networks: The combination of knowledge and statistical data. Machine Learning, 20(3), 197–243. Khosravi, P., Liang, Y., Choi, Y., & Van den Broeck, G. (2019). What to expect of classifiers? Reasoning about logistic regression with missing features. arXiv preprint arXiv:1903.01620. Kisa, D., Van den Broeck, G., Choi, A., & Darwiche, (2014). Probabilistic sentential decision dia- A. grams. In International Conference on the Principles of Knowledge Representation and Reasoning. Koller, D., & Friedman, N. (2009). Probabilistic graphical models: principles and techniques. MIT press. Kruskal, J. B. (1956). On the shortest spanning subtree of a graph and the traveling salesman problem. Proceed- ings of the American Mathematical society, 7(1), 48– 50. Lang, S., Mundt, M., Ventola, F., Peharz, R., & Kerst- ing, K. (2022). Elevating perceptual sample quality in PCs through differentiable sampling. In NeurIPS 2021 workshop on pre-registration in machine learn- ing (Vol. 181, pp. 1–25). Larochelle, H., & Murray, I. (2011). The neural autoregres- sive distribution estimator. In International Confer- ence on Artificial Intelligence and Statistics (pp. 29– 37). Liu, A., Zhang, H., & Broeck, G. V. d. (2022). Scal- ing up probabilistic circuits by latent variable distil- lation. arXiv preprint arXiv:2210.04398. Loconte, L., & Gala, G. library for deep probabilistic modelling. preprint arXiv:2212.04403. (2022). Deeprob-kit: a python arXiv Lowd, D., & Domingos, P. (2008). Learning arithmetic circuits. In Conference on Uncertainty in Artificial Intelligence (p. 383-392). Peharz, R., Geiger, B. C., & Pernkopf, F. (2013). Greedy In part-wise learning of sum-product networks. Joint European Conference on Machine Learning and Knowledge Discovery in Databases (pp. 612– 627). Peharz, R., Gens, R., & Domingos, P. (2014). Learning selective sum-product networks. In ICML Workshop on Learning Tractable Probabilistic Models. Peharz, R., Gens, R., Pernkopf, F., & Domingos, P. (2016). On the latent variable interpretation in sum-product IEEE Transactions on Pattern Analysis networks. and Machine Intelligence, 39(10), 2030–2044. Peharz, R., Lang, S., Vergari, A., Stelzner, K., Molina, A., Trapp, M., . . . Ghahramani, Z. (2020). Einsum net- works: Fast and scalable learning of tractable proba- bilistic circuits. In International Conference on Ma- chine Learning (pp. 7563–7574). Peharz, R., Tschiatschek, S., Pernkopf, F., & Domingos, P. (2015). On theoretical properties of sum-product networks. In International Conference on Artificial Intelligence and Statistics (pp. 744–752). Peharz, R., Vergari, A., Stelzner, K., Molina, A., Shao, X., Trapp, M., . . . Ghahramani, Z. (2020). Random sum-product networks: A simple and effective ap- proach to probabilistic deep learning. In Conference on Uncertainty in Artificial Intelligence (pp. 334– 344). Pipatsrisawat, K., & Darwiche, A. (2008). New compila- tion languages based on structured decomposability. In AAAI Conference on Artificial Intelligence (Vol. 8, pp. 517–522). Poon, H., & Domingos, P. (2011). Sum-product networks: A new deep architecture. In 2011 IEEE International Conference on Computer Vision Workshops (ICCV Workshops) (pp. 689–690). Rahman, T., Kothalkar, P., & Gogate, V. (2014). Cut- set networks: A simple, tractable, and scalable ap- proach for improving the accuracy of chow-liu trees. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases (pp. 630– 645). Rashwan, A., Poupart, P., & Zhitang, C. (2018). Discrimi- native training of sum-product networks by extended Baum-Welch. In International Conference on Prob- abilistic Graphical Models (pp. 356–367). Rashwan, A., Zhao, H., & Poupart, P. (2016). Online and distributed Bayesian moment matching for pa- In In- rameter learning in sum-product networks. ternational Conference on Artificial Intelligence and Statistics (pp. 1469–1477). Rooshenas, A., & Lowd, D. (2014). Learning sum- product networks with direct and indirect variable in- teractions. In International Conference on Machine Learning (pp. 710–718). Schwarz, G. (1978). Estimating the dimension of a model. The Annals of Statistics, 461–464. Shao, X., Molina, A., Vergari, A., Stelzner, K., Peharz, R., Liebig, T., & Kersting, K. (2022). Conditional sum- product networks: Modular probabilistic circuits via gate functions. International Journal of Approximate Reasoning, 140, 298–313. Trapp, M., Peharz, R., Ge, H., Pernkopf, F., & Ghahra- mani, Z. (2019). Bayesian learning of sum-product networks. Advances in Neural Information Process- ing Systems, 32. Vergari, A., Choi, Y., Liu, A., Teso, S., & Van den Broeck, Yang Yang, Gennaro Gala, Robert Peharz G. (2021). A compositional atlas of tractable circuit operations for probabilistic inference. Advances in Neural Information Processing Systems, 34, 13189– 13201. Vergari, A., Choi, Y., Peharz, R., & Van den Broeck, G. (2020). Probabilistic circuits: Representations, in- ference, learning and applications. In Tutorial at the The 34th AAAI Conference on Artificial Intelligence. Vergari, A., Molina, A., Peharz, R., Ghahramani, Z., Ker- sting, K., & Valera, I. (2019). Automatic Bayesian In AAAI Conference on Artificial density analysis. Intelligence (Vol. 33, pp. 5207–5215). Zhao, H., Adel, T., Gordon, G., & Amos, B. (2016). Collapsed variational inference for sum-product net- In International Conference on Machine works. Learning (pp. 1310–1318). Zhao, H., Poupart, P., & Gordon, G. J. (2016). A unified approach for learning the parameters of sum-product networks. Advances in Neural Information Process- ing Systems, 29. Bayesian Structure Scores for Probabilistic Circuits A Learning a Chow-Liu Tree The algorithm LEARNCLT for learning a Chow-Liu tree is shown in Algorithm 2. Overall, for a dataset has time complexity O( ). X | 2 | |D| , the algorithm D Algorithm 2 LEARNCLT Require: A training set D = {x(n)}N Ensure: a parameterized Chow-Liu tree T n=1 over RVs X, equivalent sample size (ESS) α. 1: function LEARNCLT(D, α) 2: MI ← COMPUTEMUTUALINFORMATION(X) T (cid:48) ← COMPUTEMAXIMUMSPANNINGTREE(MI) 3: T ← ASSIGNEDGEDIRECTIONS(T (cid:48)) 4: T ← COMPUTEBAYESIANPOSTERIORPARAMETERS(D, T , α) 5: return T 6: 7: end function B Candidate Selection Heuristic We adapt the information gain heuristic introduced by Rahman et al. (2014) to restrict the conditioning node selection to a fixed number of candidates. Intuitively, the heuristic wishes to select variables with maximum information gain or expected entropy reduction by conditioning on the variables. Concretely, the entropy ˆH( over random variables X is defined as ) of a data set x(n) { N n=1 = D D } where HD(X) is the entropy of RV X given (cid:88) HD(X), ˆH( ) = D 1 X X∈X | , which is given by | D HD(X) = (cid:88) − x∈X p(x) log p(x), (13) (14) is the set of all possible states of X when assuming X is discrete. Based on the entropy of the data, the information where gain Gain(Xi) after conditioning on an RV Xi is defined as X x(n) x(n) where i = xi { gain to form a candidate set ̃X. ∈ D | xi = D Gain(Xi) = ˆH( D ) − (cid:88) xi∈Xi xi| |D |D| ˆH( xi ), D (15) . In SELECTBESTCANDIDATES, we select top λ RVs with the maximum information } C Additional Experimental Results C.1 Data Sets The characteristics of the 20 benchmark density estimation data sets are reported in Table 2. The number of variables ranges from 16 to 1556. C.2 Learning Time To evaluate the efficiency of different structure learners, we report their learning times in Table 3, which are all measured in total seconds during training. Combining with the test log-likelihoods of various structure learners, we can observe both CNetBD and CNetBIC achieve a better trade-off between the performance and the training time. C.3 Circuit Size Table 4 summarizes the circuit size of models learned by different cutset structure learners. Clearly, CNetBD and CNetBIC deliver much smaller circuits than other cutset learners on almost all data sets. In addition, compare to other cutset learners, CNetBD and CNetBIC often achieve leading performance. These further validate our theoretical analysis that both the BDeu and the BIC score can effectively protect against overfitting. Yang Yang, Gennaro Gala, Robert Peharz Dataset NLTCS MSNBC KDD Plants Audio Jester Netflix Accidents Retail Pumsb-star DNA Kosarek MSWeb Book EachMovie WebKB Reuters-52 20Newsgroup BBC Ad #Features 16 17 64 69 100 100 100 111 135 163 180 190 294 500 500 839 889 910 1058 1556 #Train 16181 291326 180092 17412 15000 9000 15000 12758 22041 12262 1600 33375 29441 8700 4525 2803 6532 11293 1670 2461 #Valid. 2157 38843 19907 2321 2000 1000 2000 1700 2938 1635 400 4450 3270 1159 1002 558 1028 3764 225 327 #Test 3236 58265 34955 3482 3000 4116 3000 2551 4408 2452 1186 6675 5000 1739 591 838 1540 3764 330 491 Table 2: Characteristics of the benchmark density estimation data sets Data Set NLTCS MSNBC KDD Plants Audio Jester Netflix Accidents Retail Pumsb-star DNA Kosarek MSWeb Book EachMovie WebKB Reuters-52 20Newsgroup BBC Ad CNet 0.8 6.1 4.4 0.8 2.3 2.8 4.2 0.8 0.4 1.1 0.4 1.3 0.9 2.1 2.6 3.0 3.6 9.7 2.5 3.4 XCNet 0.1 1.3 6.0 0.7 0.4 0.2 0.3 0.4 1.9 0.9 0.1 6.3 16.1 12.0 10.1 9.8 36.0 47.5 6.8 193.7 dCSN 5.6 50.2 563.4 35.9 80.8 62.6 92.0 76.5 530.6 146.4 26.1 1658.7 2474.1 10729.9 1360.6 3800.4 8156.3 24660.7 4718.8 34576.8 CNetBD 0.7 10.3 25.6 6.8 4.4 3.3 4.7 6.5 1.3 14.5 0.8 13.1 14.8 26.2 79.4 71.2 172.6 403.3 1175.7 246.5 CNetBIC 1.1 13.5 35.7 4.4 4.9 3.3 4.1 4.2 1.1 5.5 0.3 8.5 8.3 14.7 21.4 50.0 68.9 122.1 68.1 17.3 Strudel 500 8374 697 5999 1476 1239 966 2284 276 496 382 1381 188 2742 3318 3069 7166 8303 765 361 LearnSPN 623 5843 9943 2318 3977 3946 5062 681 671 684 339 1068 1404 4137 406 2616 4166 44341 20199 969 ID-SPN 48 4604 5126 986 1920 1020 2485 1102 601 1132 279 1485 1279 9355 9014 6943 12653 25637 6348 2080 Table 3: Learning times (in seconds) of all structure learners. Due to the randomness of XCNet, we use the average learning time on 10 different runs. Data Set NLTCS MSNBC KDD Plants Audio Jester Netflix Accidents Retail Pumsb-star DNA Kosarek MSWeb Book EachMovie WebKB Reuters-52 20Newsgroup BBC Ad CNet 4543 20143 8601 18605 54651 72873 100497 13763 3667 16023 5625 10725 5801 13887 16857 10035 10635 30783 6337 6219 XCNet 1089.4 5414.0 47638.4 21263.8 15166.0 7037.6 10412.6 15273.6 52036.2 32990.8 2329.0 175426.0 455462.6 219122.2 185578.2 86246.6 334000.0 402505.8 43752.4 1076052.0 dCSN 1017 7069 47888 8532 12530 6000 8258 9345 85730 12203 1767 166168 158034 166226 18787 16692 35350 63209 12646 77207 CNetBD 205 1695 2823 3399 1549 1359 1741 2355 269 4129 359 1875 2333 2989 8931 5023 10633 23531 58849 9325 CNetBIC 315 1865 1651 3163 3437 2689 2881 2775 269 3187 359 1875 1753 3981 6959 10035 12403 19939 10551 3111 Table 4: Circuit sizes (measured in the number of independent parameters) of all structure learners. Due to the randomness of XCNet, we use the average circuit size on 10 different runs.
http://arxiv.org/abs/2302.12127v1
2023-02-23T16:10:06
2023-02-23T16:10:06
Detecting Signs of Model Change with Continuous Model Selection Based on Descriptive Dimensionality
We address the issue of detecting changes of models that lie behind a data stream. The model refers to an integer-valued structural information such as the number of free parameters in a parametric model. Specifically we are concerned with the problem of how we can detect signs of model changes earlier than they are actualized. To this end, we employ {\em continuous model selection} on the basis of the notion of {\em descriptive dimensionality}~(Ddim). It is a real-valued model dimensionality, which is designed for quantifying the model dimensionality in the model transition period. Continuous model selection is to determine the real-valued model dimensionality in terms of Ddim from a given data. We propose a novel methodology for detecting signs of model changes by tracking the rise-up of Ddim in a data stream. We apply this methodology to detecting signs of changes of the number of clusters in a Gaussian mixture model and those of the order in an auto regression model. With synthetic and real data sets, we empirically demonstrate its effectiveness by showing that it is able to visualize well how rapidly model dimensionality moves in the transition period and to raise early warning signals of model changes earlier than they are detected with existing methods.
[ "Kenji Yamanishi", "So Hirai" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12127v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12127v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 7 2 1 2 1 . 2 0 3 2 : v i X r a Detecting Signs of Model Change with Continuous Model Selection Based on Descriptive Dimensionality Kenji Yamanishi1* and So Hirai1 1*School of Information Science and Technology, The University of Tokyo, 7-3-1 Hongo, Bunkyoku, Tokyo, 113-8656, , Japan. *Corresponding author(s). E-mail(s): [email protected]; Contributing authors: [email protected]; Abstract We address the issue of detecting changes of models that lie behind a data stream. The model refers to an integer-valued structural information such as the number of free parameters in a parametric model. Specifically we are concerned with the problem of how we can detect signs of model changes earlier than they are actual- ized. To this end, we employ continuous model selection on the basis of the notion of descriptive dimensionality (Ddim). It is a real-valued model dimensionality, which is designed for quantifying the model dimensionality in the model tran- sition period. Continuous model selection is to determine the real-valued model dimensionality in terms of Ddim from a given data. We propose a novel method- ology for detecting signs of model changes by tracking the rise-up of Ddim in a data stream. We apply this methodology to detecting signs of changes of the number of clusters in a Gaussian mixture model and those of the order in an auto regression model. With synthetic and real data sets, we empirically demon- strate its effectiveness by showing that it is able to visualize well how rapidly model dimensionality moves in the transition period and to raise early warning signals of model changes earlier than they are detected with existing methods. Keywords: model change detection, change sign detection, minimum description length principle, model selection, continuous model selection, descriptive dimension, clustering 1 2 Detecting Signs of Model Change 1 Introduction 1.1 Motivation This paper is concerned with the issue of detecting changes of a model that lies behind a data stream. The model refers to the discrete structural information such as the number of free parameters in the mechanism for generating the data. We consider the situation where a model changes over time. Under this environment, it is impor- tant to detect the model changes as accurately as possible. This is because the model changes may correspond to important events. For example, it is reported in [14] that when customers' behaviors are modeled using a Gaussian mixture model, the change of the number of mixture components corresponds to the emergence or disappearance of a cluster of customers' behaviors. In this case a model change implies a change of the market trend. For another example, it is reported in [34] that when the syslog behaviors are modeled using a mixture of hidden Markov models, the change of the number of mixture components may correspond to a system failure. The issue of model change detection has extensively been explored. This paper is rather concerned with the issue of detecting signs or early warning signals of model changes. Why is it important to detect such signs? One reason is that if they were detected earlier than the changes themselves, we could predict the changes before they were actualized. The other reason is that if they were detected after the change themselves, we could analyze the cause of the changes in a retrospective way. A model, say, the number of parameters, is an integer-valued index, in general. Therefore, it appears that the model change abruptly occurs. However, it is reasonable to suppose that some intrinsic change, which we call latent change, gradually occurs at the back of the model change. Then we may define a sign of the model change as the starting point of the latent change. Therefore, if we properly defined a real- valued index to quantify the model dimensionality in the transition period, we could understand how rapidly the latent change was going on and we could detect signs of model changes by tracking the rise-up of the index (Fig. 1). Fig. 1 Transition Period of Dimensionality Change Detecting Signs of Model Change 3 The key idea of this paper is to employ the notion of descriptive dimension- ality (Ddim) for the quantification of a model in the transition period. Ddim is a real-valued index, which quantifies the model dimensionality for the case where a number of models are mixed. We thereby establish a methodology of continuous model selection. It is to determine the optimal real-valued model dimensionality from data on the basis of Ddim. In the transition period of model changes, the mixing structure of models may change over time. Hence, by tracking the rise-up of Ddim, we will be able to track the latent changes behind model changes. The purpose of this paper is twofold: One is to establish a novel methodology for detecting signs (or early warning signals) of model changes from a data stream. We realize this by using Ddim for the quantification of model dimensionality in its transition period. The theory of Ddim is developed on the basis of the minimum description length (MDL) principle [24]. The other is to empirically validate the effectiveness of the methodology using synthetic and real data sets. We evaluate how early and how reliably it is able to make alarms of signs of model changes. 1.2 Related Work Model change detection has been studied in the scenario of dynamic model selec- tion (DMS) developed in [33, 34]. Model change detection is different from the classical continuous parameter change detection. Taking an example of finite mixture models, the former is to detect changes in the number of components, while the latter is to detect those in the real-valued parameters of individual components or mixing parameters. In [33, 34], they proposed the DMS algorithm which outputs a model sequence of the shortest description length, on the basis of the MDL principle [24]. They demonstrated its effectiveness from the empirical and information-theoretic aspects. The MDL based model change detection has been further theoretically jus- tified in [32]. The problems similar to model change detection have been discussed in the scenarios of switching distributions [8], tracking best experts [13], on-line clustering [27], cluster evolution [21], Bayesian change detection [29], and structure break detection for autoregression model [3]. In all of these previous studies, how- ever, a model change was considered to be an abrupt change of a discrete structure. The transition period of changes has never been analyzed. In the conventional state- space model, change detection of continuous states is addressed (see e.g.[5]). Then the state itself has not the same meaning as a model which we define in this paper. The number of states is a model which we mean. Changes that do not occur abruptly but incrementally occur were discussed in the context of detecting incremental changes in concept drift [10], gradual changes [35], volatility shift [17], etc. However, it has never been quantitatively analyzed how rapidly a model changes in the transition period. Recently, the indices of structural entropy [16] and graph-based entropy [22] have been developed for measuring the uncertainty associated with model changes. Although they can be thought of as early warning signals of model changes, they cannot explain the intrinsic model dimensionality nor how rapidly a model changes in the transition period. Change sign detection method usng differential MDL change 4 Detecting Signs of Model Change statistics has been proposed in [36]. However, it is applied to change sign detection for parameters only not for models. This paper proposes a methodology for analyzing model transition in terms of real-valued dimensionality. A number of notions of dimensionality have been pro- posed in the areas of physics and statistics. The metric dimension was proposed by Kolmogorov and Tihomirov [18] to measure the complexity of a given set of points in terms of the notion of covering numbers. This was evolved into the notion of the box counting dimension, equivalently, the fractal dimension [20]. It is a real-valued index for quantifying the complexity of a given set. It is also related to the capacity [7]. Vapnik Chervonenkis dimension was proposed to measure the power of represen- tation for a given class of functions [28]. It was also related to the rate of uniform convergence of estimating functions. See [12] for relations between dimensional- ity and learning. The dimensionality as a power of representation is conventionally integer-valued, but when it changes over time, there is no effective non-integer valued quantification of its transition. 1.3 Significance of This Paper The significance of this paper is summarized as follows: (1)Proposal of a novel methodology for detecting signs of model changes with con- tinuous model selection. This paper proposes a novel methodology for detecting signs of model changes. The key idea is to track model transitions with continuous model selection using the notion of descriptive dimensionality (Ddim). It mea- sures the model dimensionality in the case where a number of models with different dimensionalities are mixed. For example, we employ the Gaussian mixture model (GMM) to consider the situation where the number of mixture components changes over time. We suppose that in the transition period of model change, a number of probabilistic models with various mixture sizes are fused. We give a method for calculating Ddim for this case. The transition period of model change can be visualized by drawing a Ddim graph versus time. Once a Ddim graph is obtained, we can understand how rapidly the model changes over time. We eventually detect signs of model changes by tracking the rise-up of Ddim. This methodology is significantly important in data mining since it helps us predict model changes in earlier stages. (2)Empirical demonstration of effectiveness of model change sign detection via Ddim. We empirically validate how early we are able to detect signs of model changes with continuous model selection, for GMMs and auto-regression (AR) mod- els. With synthetic data sets and real data sets, we illustrate that our method is able to effectively visualize the transition period of model change using Ddim. We fur- ther empirically demonstrate that our methodology is able to detect signs of model changes significantly earlier than any existing dynamic model selection algorithms and is comparable to structural entropy in [16]. Through our empirical analysis, we demonstrate that Ddim is an effective index for measuring the model dimensionality in the model transition period. Detecting Signs of Model Change 5 (3)Giving theoretical foundations for Ddim. In this paper, Ddim plays a central role in continuous model selection. We introduce this notion from an information- theoretic view based on the MDL principle [24] (see also [11]). We show that Ddim coincides with the number of free parameters in the case where the model consists of a single parametric class. We also derive Ddim for the case where a number of models with different dimensionalities are mixed. We characterize Ddim by demonstrating that it governs the rate of convergence of the MDL-based learning algorithm. This corresponds to the fact that the metric dimensionality governs the rate of convergence of the empirical risk minimization algorithm in statistical learning theory [12]. A preliminary version of this paper appeared in Arxiv [31], in which only the theoretical foundation of Ddim was given and no contents on continuous model selec- tion with its applications to model change sign detection was included. This paper is a complete version of [31] including not only the theory of Ddim but also its applications. The rest of this paper is organized as follows: Sec. 2 introduces the notion of Ddim. Sec. 3 gives a methodology for model change sign detection via Ddim. Sec. 4 shows experimental results. Sec. 5 characterizes Ddim by relating it to the rate of convergence of the MDL learning algorithm. Sec. 6 gives conclusion. Source codes and data sets are available at a Github repository [37]. 2 Descriptive Dimensionality 2.1 NML and Parametric Complexity This section introduces the theory of Ddim. This theory is based on the MDL prin- ciple (see [24] for the original paper and [25] for the recent advances) from the viewpoint of information theory. We start by introducing a number of fundamental notions of the MDL principle. Let X be the data domain where X is either discrete or continuous. Without loss of generality, we assume that X is discrete. Let x = x1, . . . , xn ∈ X n be a data sequence of length n. We assume that each xi is independently generated. P = {p(x)} be a class of probabilistic models where p(x) is a probability mass function or a probability density function. Under the MDL principle, the information of a datum x is measured in terms of description length, i.e, the codelength required for encoding the datum with a prefix coding method. We may encode x with help of a class P of probability distribu- tions. One of the most important methods for calculating the codelength x using P is the normalized maximum likelihood (NML) coding [25]. This is defined as the codelength associated with the NML distribution as: Definition 1 We define the normalized maximum likelihood (NML) distribution over X n with respect to P by pNML (x; P) def = maxp∈P p(x) y maxp∈P p(y) (cid:80) . (1) 6 Detecting Signs of Model Change The normalized maximum likelihood (NML) codelength of x relative to P, which we denote as LNML (x; P), is given as follows: where LNML (x; P) def = − log pNML (x; P) = − log max p∈P p(x) + log Cn(P), log Cn(P) def = log (cid:88) y max p∈P p(y). (2) (3) The first term in (2) is the negative logarithm of maximum likelihood while the second term (3) is the logarithm of the normalization term. The latter is called the parametric complexity of P [25]. This means the information-theoretic complexity for the model class P relative to the length n of data sequence. The NML codelength can be thought of as an extension of Shannon information − log p(x) into the case where the true model p is unknown but only P is known. In order to understand the meaning of the NML codelength and the parametric complexity, we define the minimax regret as follows: Rn(P) def= min q (cid:26) (cid:27) max x − log q(x) − min p∈P (− log p(x)) , where the minimum is taken over the set of all probability distributions. The minimax regret means the descriptive complexity of the model class, indicating how largely any codelength is deviated from the smallest negative log-likelihood over the model class. Shtarkov [26] proved that the NML distribution (1) is optimal in the sense that it attains the minimum of the minimax regret. In this sense the NML codelength is the optimal codelength for encoding x for given P. Then we can immediately see that the minimax regret coincides with the parametric complexity. That is, Rn(P) = Cn(P). (4) We next consider how to calculate the parametric complexity. According to [25] (pp:43-44), the parametric complexity can be rewritten using a variable transforma- tion technique as follows: Cn(P) = (cid:88) y max p∈P p(y) = (cid:90) g(ˆp, ˆp)dˆp, where g(ˆp, p) is defined as g(ˆp, p) def= (cid:88) p(y). y:max ̄p∈P ̄p(y)= ˆp(y) (5) (6) Detecting Signs of Model Change 7 2.2 Definition of Descriptive Dimensionality Below we give the definition of Ddim from a view of approximation of the paramet- ric complexity, equivalently, the minimax regret (by (4)). The scenario of defining Ddim is as follows: We first count how many points are required to approximate the parametric complexity (5) with quantization. We consider that count as information- theoretic richness of representation for a model class. We then employ that count to define Ddim in a similar manner with the box counting dimension. We consider to approximate (5) with a finite sum of partial integrals of g(ˆp, ˆp). Let P = {p1, p2, . . . } ⊂ P be a finite subset of P. For (cid:15) > 0, for pi ∈ P, let (cid:15) (i) def= {p ∈ P : dn(pi, p) ≤ (cid:15)2} where dn(pi, p) is the Kullback-Leibler (KL) Dn divergence between p and pi: dn(p, pi) = 1 n (cid:88) x pi(x) log pi(x) p(x) . Then we approximate Cn(P) by where Cn(P) def= mn((cid:15):P) (cid:88) i=1 Q(cid:15)(i), (cid:90) Q(cid:15)(i) def= ˆp∈Dn (cid:15) (i) g(ˆp, ˆp)dˆp. (7) (8) That is, (7) gives an approximation to Cn(P) with a finite sum of integrals of g(ˆp, ˆp) over the (cid:15)2−neighborhood of a point pi. We define mn((cid:15) : P) as the smallest number of points | P | with respect to P such that Cn(P) ≤ C n(P). More precisely, mn((cid:15) : P) def= min P | P | subject to Cn(P) ≤ Cn(P). (9) We are now led to the definition of descriptive dimension. Definition 2 [31] Let P be a class of probability distributions. We let m((cid:15) : P) be the one obtained by choosing (cid:15)2n = O(1) in mn((cid:15) : P) as in (9). We define the descriptive dimension (Ddim) of P by Ddim(P) def = lim (cid:15)→0 log m((cid:15) : P) log(1/(cid:15)) , (10) when the limit exists. The definition of Ddim is similar with that of the box counting dimension [7, 9, 20] . The main difference between them is how to count the number of points. Ddim is calculated on the basis of the number of points required for approximating the 8 Detecting Signs of Model Change parametric complexity, while the box counting dimension is calculated on the basis of the number of points required for covering a given object with their (cid:15)-neighborhoods. Consider the case where Pk is a k-dimensional parametric class, i.e., Pk = {p(x; θ) : θ ∈ Θk ⊂ Rk}, where Θk is a k-dimensional real-valued parameter space. Let p(x; θ) = f (x | ˆθ(x))g(ˆθ(x); θ) for the conditional probabilistic mass function f (x | ˆθ(x)). We then write g according to (6) as follows g(ˆθ, θ) = (cid:88) p(x; θ). (11) x:argmax p(x; θ)=ˆθ θ Assume that the central limit theorem holds for the maximum likelihood estimator of a parameter vector θ. Then according to [25], we can take a Gaussian density function as (11) asymptotically. That is, for sufficiently large n, (11) can be approximated as: g(ˆθ, θ) (cid:39) (cid:17) k 2 (cid:16) n 2π | In(θ) | 1 2 e−n(ˆθ−θ)(cid:62)In(θ)(ˆθ−θ)/2, (12) where In(θ) def= (1/n)Eθ[−∂2 log p(x; θ)/∂θ∂θ(cid:62)] is the Fisher information matrix. The following theorem shows the basic property of mn((cid:15) : Pk) for the parametric case. Theorem 1 Suppose that p(x; θ) ∈ Pk is continuously three-times differentiable with respect to θ. Under the assumption of the central limit theorem so that (12) holds, for sufficiently large n, we have log Cn(Pk) = log mn(1/ √ n : Pk) + O(1). (13) The proof is given in Appendix. It is known [25] (p.53) that under some regularity condition that the central limit theorem holds for the maximum likelihood estimator for θ, the parametric complexity for Pk is asymptotically expanded as log Cn(Pk) = k 2 log n 2π (cid:90) (cid:112)| I(θ) |dθ + o(1), + log (14) is def= limn→∞(1/n)× where I(θ) Eθ[−∂2 log p(x; θ)/∂θ∂θ(cid:62)]. Plugging (41) with (14) for (cid:15)2n = O(1) into (10) yields the following theorem. information matrix: I(θ) the Fisher Theorem 2 For a k-dimensional parametric class Pk, under the regularity condition for Pk as in Theorem 1, we have Ddim(Pk) = k. (15) Detecting Signs of Model Change 9 Theorem 2 shows that when the model class is a single parametric one, Ddim coincides with the conventional notion of dimensionality (the number of free parameters), which we call the parametric dimensionality in the rest of this paper. Ddim can also be defined even for the case where the model class is not a single parametric class. Hence Theorem 2 implies that Ddim is a natural extension of the parametric dimensionality. Let us consider model fusion where a number of model classes are probabilisti- cally mixed. Let F = {P1, . . . , Ps} be a family of model classes and assume a model class is probabilistically distributed according to p(P) over F. We denote the model fusion over F as F (cid:12) = P1 (cid:12) * * * (cid:12) Ps. We may interpret the resulting distribution over X as a finite mixture model [19] of a number of model classes with different dimensionalities. Then Ddim of F (cid:12) is calculated as lim (cid:15)→0 log EP [m((cid:15) : P)] log(1/(cid:15)) s (cid:88) i=1 p(Pi) log m((cid:15) : Pi) log(1/(cid:15)) p(Pi)Ddim(Pi), (16) ≥ lim (cid:15)→0 = s (cid:88) i=1 where we have used Jensen's inequality to derive the first inequality. We call the lower bound (16) the pseudo Ddim for model fusion F (cid:12). In the rest of this paper, we adopt it as Ddim value for model fusion. We write it as Ddim(F (cid:12)). Model fusion is a reasonable setting when we consider the transition period of model changes. Then Ddim is no longer integer-valued. 3 Model Change Sign Detection Fig. 2 Continuous Model Selection 3.1 Continuous Model Selection for GMMs This section proposes a methodology for detecting signs of model changes with con- tinuous model selection. We first focus on the case where the model is a Gaussian 10 Detecting Signs of Model Change mixture model (GMM). The problem setting is as follows: At each time we obtain a number of unlabeled multi-dimensional examples. By observing such examples sequentially, we obtain a data stream of the examples. At each time, we may conduct clustering of the examples using GMMs. Assuming that the number of components in GMM may change over time, we aim at detecting their changes and the signs of them. The key idea is to conduct continuous model selection, which is to determine the real-valued model dimensionality on the basis of Ddim. Below we give a scenario of continuous model selection with applications to model change sign detection. Let Pk be a class of GMMs with k components. We consider the situation where the structure of GMM gradually changes over time (Fig. 2), while the model k may abruptly change. The key observation is that during the model transition period, model fusion occurs where a number of GMMs with different ks are probabilistically mixed according to the posterior probability distribution for the given data. Then model dimensionality in the transition period can be calculated as Ddim of model fusion. Thus we can detect signs of model changes by tracking the rise-up of Ddim. Below let us formalize the above scenario. Let X be an m-dimensional real- valued domain and let x ∈ X be an observed datum. Let z ∈ {1, . . . , k} be a latent variable indicating which component x comes from. Let μi ∈ Rm, Σi ∈ Rm×m be the mean vector and variance-covariance matrix for the ith component, respectively. Let (cid:80) i πi = 1, πi ≥ 0 (i = 1, . . . , k). Let θ = (μi, Σi, πi) |i=1,...,k. Then a complete variable model of GMM with k-components is given by p(x, z; θ, k) = p(x | z; μ, Σ)p(z; π), where p(x | z = i; μ, Σ) = 1 (2π) m 2 * | Σi | 1 2 (cid:26) exp − 1 2 (x − μi)(cid:62)Σ−1 i (cid:27) (x − μi) , p(z = i; π) = πi (i = 1, . . . , k). (17) Let x = x1, . . . , xn be a sequence of observed variables of length n. Let zj denote a latent variable which corresponds to xj and z = z1, . . . , zn. Let y = (x, z) be a complete variable. Let ˆμi, ˆΣi be the maximum likelihood estimators of μi, Σi (i = 1, . . . , k) for given y. Let ˆπi = ni/n where ni is the number of occurrences in ˆzn such that z = i (i = 1, . . . , k) and (cid:80)k i=1 ni = n. z may be estimated by sampling from the posterior probability obtained by the EM algorithm. Let ˆθ(y) = (ˆπi, ˆμi, ˆΣi) |i=1,...,k. The NML codelength of y for a complete variable model of a GMM is given by LNML(y; k) = − log pNML (y; k) = − log p(y; ˆθ(y), k) + log Cn(k), (18) Detecting Signs of Model Change 11 where Cn(k) is a parametric complexity for a GMM. According to [15], an upper bound on Cn(k) is given as follows: Cn(k) ≤ (cid:88) n1,*** ,nk × (cid:16) ni 2e n! n1! * * * nk! × (cid:17)ni k (cid:89) i=1 (cid:16) ni n B(m, R, (cid:15)) (cid:17) mni 2 (cid:18) Γm (cid:18) ni − 1 2 (cid:19)(cid:19)−1 , (19) where B(m, R, (cid:15)) def= 2 (cid:15)− m2 2m+1R m (cid:1) , mm+1 * Γ (cid:0) m 2 2 2 ≤ R and (cid:15) is a positive constant where R is a positive constant such that for all i, ˆμi such that (cid:15) is the lower bound on the smallest eigenvalue of Σi for any i. Γm is the multivariate Gamma function defined as Γm(x) = π 2 ) and Γ is the Gamma function. We use the bound (19) as the value of Cn(k). It is known [14] that Cn(k) is computable in time O(n2k). j=1 Γ(x + 1−j 4 (cid:81)m m(m−1) At each time t, we observe a data sequence: xt = x1, . . . , xn ∈ X n of length n. We sequentially observe such a datum as show in Fig. 2. Let xT = x1, . . . , xT (xt ∈ X n, t = 1, . . . , T ) be an observed data sequence. The length n may vary over time. We denote the joint sequence of observed variables and latent variables at time t as yt = (xt, zt). We suppose that a number of GMMs with different ks are fused according to the probability distribution p(k | yt) at each time. We define p(k | yt) as the annealed posterior probability of k for yt: p(k | yt) def= (cid:80) (pNML (yt; k)p(k | kt−1))β k(cid:48)(pNML(yt; k(cid:48))p(k | kt−1))β exp(−βLNML (xt, zt; k) + β log p(k | kt−1)) k(cid:48) exp(−βLNML(xt, zt; k(cid:48)) + β log p(k(cid:48) | kt−1)) = (cid:80) , (20) where kt−1 is the dimensionality estimated at time t − 1, and p(k | kt−1) def=    1 − γ if k = kt−1 and kt−1 (cid:54)= 1, kmax, 1 − γ/2 if k = kt−1 and kt−1 = 1, kmax, γ/2 if k = kt−1 ± 1. (21) γ(0 < γ < 1) is a parameter. We estimate γ using the MAP estimator with the beta distribution Beta(a, b) being the prior as follows: ˆγ = Nt + a − 1 t + a + b − 2 , 12 Detecting Signs of Model Change where Nt shows how many times the number of clusters has changed until time t − 1,and ˆα . In the experiments to follow, we set (a, b) = (2, 10). β(> 0) is the temperature parameter. In our experiments to follow, we set β as β = 1/ √ n. (22) This is due to the PAC-Bayesian argument [1] for Gibbs posteriors. Note that (20) is calculated on the basis of the NML distribution. This is because the probability distribution with unknown parameters should be estimated as the NML distribution since it is the optimal distribution in terms of the minimax regret (see Sec.2.1). By (16), we can calculate Ddim of model fusion of GMMs with various ks at time t as Ddim(F (cid:12))t = (cid:88) k pt(Pk)Ddim(Pk), (23) where pt(Pk) is the probability of Pk at time t and pt(Pk) = p(k | yt) in this case. Note that Ddim for GMM with k components is k(m2/2 + (5m/2)) − 1 ≈ kf (m) where f (m) = m2/2 + (5m/2). However, in order to focus on the mixture size, we divide the true Ddim by f (m) to consider an alternative Ddim of the form of (24). Ddim(F (cid:12))t def= ≈ (cid:88) k (cid:88) k p(k | yt)Ddim(Pk)/f (m) p(k | yt)k. (24) The calculation of real-valued k according to (24) is really continuous model selection. Suppose that there exists a true parametric dimensionality k∗. Then because of the consistency of MDL model estimation ([25], pp:63-69), p(ˆk = k∗ | yt) → 1 for ˆk minimizing the NML codelength as n increases, Hence (24) will coincide with k∗ with probability 1 as n goes to infinity. This implies that (24) is a natural extension of parametric dimensionality. 3.2 Model Change Sign Detection Algorithms Consider the situation where we sequentially observe a complete variable sequence: y1, y2, . . . , yT . We then obtain a Ddim graph: {(t, Ddim(F (cid:12))t) : t = 1, 2, . . . , T }, as in Fig. 1. We can visualize the transition period by drawing the Ddim graph versus time. In this paper we have defined a sign of a model change as the starting point Detecting Signs of Model Change 13 of the latent gradual change associated with it. Thus we can detect signs of model changes by looking at the rise-up of Ddim. More precisely, we propose the following two methods for raising alarms of model change signs. 1) Thresholding method (TH): We raise an alarm if the absolute difference between Ddim and the baseline exceeds a given threshold δ1. The baseline is the parametric dimensionality estimated by the sequential dynamic model selection algo- rithm (SDMS) [14], which is a sequential variant of DMS in [33, 34]. It outputs a model k = ˆk with the shortest codelength, i.e., for λ > 0, ˆk = argmin k {LNML(yt; k) − λ log p(k | kt−1)}, (25) where LNML (yt; k) is calculated as in (18). Letting ˆk be the output of SDMS, we raise an alarm if TH−Score def= | Ddim − ˆk |> δ1. (26) 2) Differential method (Diff): We raise an alarm if the time difference of Ddim exceeds a given threshold δ2. That is, letting Ddimt be Ddim at time t, then we raise an alarm if Diff−Score def= | Ddimt − Ddimt−1 |> δ2. (27) The computational complexity of TH and Diff at each time t is governed by that for computing the NML codelength (18). The first term in (18) is computable in time O(nk). The second term in (18) is computable in time O(n2k) [15], but it does not depend on data, hence can be calculated for various n and k beforehand. It can be referred when necessary. Hence the computational complexity of TH and Diff at each time is O(nK) where K is an upper bound on k. 3.3 Continuous Model Selection for AR model The above methodology can also be applied to general classes of finite mixture models other than GMMs. It can also be applied to general classes of parametric probabilistic model classes. We illustrate the case of AR (auto-regression) model as an example. This model does not include latent variables. Let a data sequence {xt}, xt ∈ R (t = 1, 2, . . . , T ) be given. For the modeling of the data sequence, we consider AR(k) (k-th order auto-regression) model of the form: xt = a1xt−1 + * * * + akxt−k + (cid:15), where ai ∈ R (i = 1, . . . , k) are unknown parameters, and (cid:15) is a random variable following the Gaussian distribution with mean 0 and unknown variance σ2. We set θ = (a1, . . . , ak, σ2). Let xt = xt, . . . , xt−w+1 be the t-th session for a window size w. We calculate the NML codelength LNML (xt; k) for xt associated with AR(k) in the following 14 Detecting Signs of Model Change sequential manner: LNML(xt; k) = t (cid:88) (cid:32) − log j=t−w+1 p(xj; ˆθ(xj, xj−1)) (cid:82) p(yj; ˆθ(y, xj−1))dy (cid:33) . Letting Pk = AR(k), similarly with (20) and (23), we can calculate Ddim at time t and draw a Ddim graph. We thereby possibly detect model change signs by applying TH and Diff to the graph. 4 Experimental Results 4.1 Synthetic Data: GMM 4.1.1 Data set We employ synthetic data sets to evaluate how well we are able to detect signs of model changes using Ddim. We let n = 1000 at each time. We generated DataSet 1 according to GMMs so that the number of components changed from k = 2 to k = 3 as follows:    k = 2, μ = (μ1, μ2) k = 3, μ = (μ1, μ2, fα(t)) k = 3, μ = (μ1, μ2, μ3) if 0 ≤ t ≤ τ1, ifτ1 + 1 ≤ t ≤ τ2, if τ2 + 1 ≤ t ≤ T, where fα(t) def= (τ2 − t)αμ2 + (t − τ1)αμ3 (τ2 − t)α + (t − τ1)α (0 < α ≤ 1). (28) In it, one component collapsed gradually in the transition period from t = τ1 + 1 to t = τ2. fα(t) is the mean value which switches from μ2 to μ3 where the speed of change is specified by a parameter α. Fig. 3 shows the graph of the proportion of μ3 in the mean to μ2 for various α. The change becomes rapid as α approaches to zero. The variance covariance matrix of each component is given by Σ = (rAAT + (I − r)I) × var, (29) where r = 0.2, var = 3 and A is a randomly generated m × m matrix. We set m = 3, τ1 = 9, τ2 = 29, T = 39. It appears that the number of components of a GMM abruptly changed at t = 20 since it takes a discrete value. However, in the early stage of k = 3, the model is very close to k = 2 because the mean values of Gaussian components are very close each other. It may be more natural to recognize the model dimensionality at this stage as a value between k = 2 and k = 3. We evaluate how well Ddim tracked the transition period of model change. The temperature parameter β was chosen so that β = 0.0316 according to (22). Fig. 4 shows how Ddim gradually grows as time goes by for various α values. The gray Detecting Signs of Model Change 15 Fig. 3 Mean change in transition period for various α zone shows the transition period when the model changes from k = 2 to k = 3. The blue line shows the number of components of the GMM estimated by the SDMS algorithm as in (25). The green curve shows the Ddim graph. The red and purple curves show TH-Score and Diff-Score as in (26) and (27), respectively. We show the time points of their alarms using the same colors. Ddim successfully visualized how rapidly the GMM structure changed in the transition period from t = 10 to 29. The true change occurs rapidly for α = 0.2, while it occurs slowly for α = 1.0. Ddim was able to successfully track their transition process depending on α. Ddim detected signs earlier than SDMS made an alarm of model change. We next consider the case where there are multiple change points. We generated DataSet 2 according to GMMs so that the number of components changed from k = 2 to k = 3, then from k = 3 to k = 4. as follows:    k = 2, μ = (μ1, μ2) k = 3, μ = (μ1, μ2, (τ2−t)μ2+(t−τ1)μ3 k = 3, μ = (μ1, μ2, μ3) k = 4, μ = (μ1, μ2, μ3, (τ4−t)μ3+(t−τ4)μ4 k = 4, μ = (μ1, μ2, μ3, μ4) τ2−τ1 τ4−τ3 ) if 1 ≤ t ≤ τ1, ifτ1 + 1 ≤ t ≤ τ2, if τ2 ≤ t ≤ τ3, ifτ3 + 1 ≤ t ≤ τ4, ifτ4 + 1 ≤ t ≤ T. ) One component collapsed gradually over time from t = 10 to t = 29 and the other one collapsed from t = 50 to t = 69. We set T = 79. In the transition periods the parameters varied as with the single change point case. Fig. 5 shows the Ddim graph for α = 0.5. The gray zone shows the transition periods when the model changes from k = 2 to k = 3 and k = 3 to k = 4. The green curve shows the Ddim graph. The blue line shows the number of components of the GMM estimated by SDMS. The red and purple lines show the times when alarms for signs of model changes are raised using TH and Diff, respectively. The Ddim graph helps us understand well how rapidly the GMM structure gradually changes in the transition periods from t = 10 to t = 29 and from t = 50 to t = 69. TH detected the signs of model changes earlier than SDMS. 0.02.55.07.510.012.515.017.520.0t0.00.20.40.60.81.0proportion0.20.51.02.0 16 Detecting Signs of Model Change α = 0.2 α = 0.5 Fig. 4 Ddim graph (transition period: [τ1 = 9, τ2 = 29], T = 39) α = 1.0 4.1.2 Evaluation metrics Next we quantitatively evaluate how early we were able to detect signs of model changes with Ddim. We measure the performance of any algorithm in terms of ben- efit. Let ˆt be the first time when an alarm is made and t∗ be the true sign, which we 0510152025303540Time2.02.22.42.62.83.0SDMS / DdimTrue # of clustersSDMSDdim0.00.20.40.60.81.01.21.4TH / DiffDdim for Gradual Change ( Transition Period: [[10, 29]] ) <Symptom> TH:[10, 26], Diff:[10, 13, 15, 17, 22, 25], SDMS:[14]THDiff0510152025303540Time2.02.22.42.62.83.0SDMS / DdimTrue # of clustersSDMSDdim0.00.20.40.60.81.01.21.4TH / DiffDdim for Gradual Change ( Transition Period: [[10, 29]] ) <Symptom> TH:[14], Diff:[15, 17, 20, 23], SDMS:[19]THDiff0510152025303540Time2.02.22.42.62.83.0SDMS / DdimTrue # of clustersSDMSDdim0.00.20.40.60.81.01.21.4TH / DiffDdim for Gradual Change ( Transition Period: [[10, 29]] ) <Symptom> TH:[17], Diff:[17, 19], SDMS:[19]THDiff Detecting Signs of Model Change 17 Fig. 5 Ddim graph (transition periods: [τ1 = 9, τ2 = 29], [τ3 = 49, τ4 = 59], T = 79) Table 1 AUC comparison results for GMMs Method TH Diff SDMS FS FSW-TH FSW-Diff SE Method TH Diff SDMS FS FSW-TH FSW-Diff SE (a) Single change point α =0.5 0.920 0.907 0.797 0.715 0.813 0.778 0.927 α =0.2 0.995 0.995 0.850 0.755 0.893 0.825 0.995 α =1.0 0.845 0.830 0.775 0.710 0.778 0.750 0.853 (b) Multiple change points α =0.5 α =0.2 0.998 0.925 0.998 0.920 0.831 0.905 0.794 0.856 0.874 0.945 0.855 0.899 0.928 0.997 α =1.0 0.893 0.883 0.804 0.761 0.816 0.834 0.903 α =2.0 0.802 0.797 0.757 0.710 0.758 0.758 0.801 α =2.0 0.870 0.850 0.773 0.739 0.780 0.835 0.867 define as the starting point of model change. Then benefit is defined as (cid:40) benefit = 1 − (ˆt − t∗)/U (t∗ ≤ ˆt < t∗ + U ), 0 otherwise, (30) where U is a given parameter. Benefit takes the maximum value 1 when the alarm coincides with the true sign. It decreases linearly as t goes by and becomes zero as ˆt exceeds t∗ + U . False alarm rate (FAR) is defined as the ratio of the number of alarms outside the transition period over the total number of alarms. We evaluate any method for model change sign detection algorithm in terms of Area Under Curve (AUC) of Benefit-FAR curve that is obtained by varying the threshold parameter δ such as in (26) and (27). We set U = 10 in (30). 01020304050607080Time2.002.252.502.753.003.253.503.754.00SDMS / DdimTrue # of clustersSDMSDdim0.00.20.40.60.81.01.21.4TH / DiffDdim for Gradual Change ( Transition Period: [[10, 29], [50, 69]] ) <Symptom> TH:[14, 53], Diff:[15, 17, 20, 23, 53, 64], SDMS:[19, 53, 65]THDiff 18 Detecting Signs of Model Change 4.1.3 Methods for comparison We consider the following methods for comparison. 1) The sequential DMS algorithm (SDMS) [14]: The SDMS algorithm with λ = 1 outputs the estimated parametric dimensionality as in (25). We raise an alarm when the output of SDMS changes. 2) Fixed share algorithm (FS) [13]: We think of each model k as an expert, and perform Herbster and Warmuth's fixed share algorithm, abbreviated as FS. It was originally designed to make prediction by taking a weighted average over a number of experts, where the weight is calculated as a linear combination of the exponential update weight and the sum of other experts' ones. In it the expert with the largest weight is the best expert, which may change over time. We can think of FS as a model change detection algorithm by tracking the time-varying best expert. Here is a summary of FS. Let k be the index of the expert. L(zt−1) is the loss function for the kth expert for data zt−1, which is the NML codelength in our setting. wu t,k are tentative and final weights for the kth expert at time t. FS conducts the following weight update rule: Letting α > 0 be a sharing parameter and β be a learning ratio, t,k and ws t−1,k * exp{−βLk(zt−1)}, wu t−1,k = ws ws t,k = (1 − α)wu t−1,k + α n − 1 (cid:88) (cid:96)(cid:54)=k wu t−1,(cid:96). t,k is maximum. FS raises an alarm when the best Let ˆk be the best expert in which ws expert changes. The learning rate was set to be the same as our method. 3) Fixed share weighted algorithm (FSW-TH, FSW-Diff): We consider variants of TH and Diff where p(k | yt) as in (20) is replaced with the normalized weight for k calculated in the process of FS. FSW-TH and FSW-Diff calculate scores by plugging ws t,k to p(k | yt) in (24) and make alerts according to (26) and (27), respectively. The learning rate was set to be the same as our method. 4) Structural entropy (SE): It is a measure of uncertainty for model selection, devel- oped in [16]. It is calculated as the entropy with respect to model according to the probability distribution (20). SE make alerts when it exceeds a threshold. The method 1) is the only existing work that performs on-line dynamic model selection. The methods 2) and 3) are the ones that can be adapted to our problem set- ting. The method 1) and 2) are model change detection algorithms while the method 3) is an algorithm for quantifying latent gradual changes in a similar way with TH or DIFF. The method 4) is to detect change signs from the view of model uncertainty, but not to intend continuous model selection. 4.1.4 Results We generated random data 10 times and took an average value of benefit over 10 trials for each method. Table 1 shows results on comparison of all the methods in terms of AUC both for single and multiple change cases. The parameter α specifies the speed of change. As for the multiple change cases, AUC was calculated as an Detecting Signs of Model Change 19 average taken over all change points. Both for the single and multiple change cases, TH and Diff had much higher benefit than the FS-based methods for all the cases. It was statistically significant via t-test with p-values less than 5%. This implies that TH and Diff were able to detect signs of model changes significantly earlier than the FS-based methods. TH worked almost as well as Diff. It is worthwhile noting that TH and Diff performed better than FSW-TH and FSW-Diff. It implies that the posterior based on the NML distribution is more suit- able for tracking gradual model changes than that based on the FS-based heuristics. As α becomes small, the superiority of TH and Diff over the others becomes more remarkable. This implies that Ddim is able to catch up the growth of a cluster much more quickly than the others. Both for the single and multiple change cases, TH worked slightly better than Diff, but they were almost comparable. TH and Diff are comparable to SE in terms of change sign detection. Note that the Ddim based ones realize both model change sign detection and continuous model selection simultaneously, while SE can do only sign detection by measuring the uncertainty in model selection. Therefore, Ddim is effective in the sense that it is the only method that measures the representation power of a model as well as detects change signs. 4.2 Synthetic Data: Auto-regression model 4.2.1 Data sets We next examined continuous model selection for auto-regression (AR) models. We let n = 1000 at each time. We generated DataSet 3 according to AR model in the setting as in Sec.3.3 where the number k of coefficients in AR model changed over time as follows: K =    1 1 with prob. 1 − t−τ1 τ2−τ1 3 with prob. t−τ1 τ2−τ1 3 if 1 ≤ t ≤ τ1, if τ1 ≤ t ≤ τ2, if τ1 ≤ t ≤ τ2, if τ2 ≤ t ≤ T. 4.2.2 Results We generated random data 10 times and took an average value of benefit over 10 trials for each method. Table 2 shows results on comparison of all the methods in terms of AUC for Benefit-FAR curves. Table 2 shows that TH and Diff are comparable to SE and obtained much larger values of AUC than other methods except SE. This implies that TH and Diff could catch up signs of model changes significantly earlier than the others except SE. Note again that TH and Diff conduct not only change sign detection but also continuous model selection to understand the power of representation of a model in the transition period. Meanwhile SE only perform change sign detection. 20 Detecting Signs of Model Change Table 2 AUC comparison results for AR models Method TH Diff SDMS FS FSW-TH FSW-Diff SE AUC 0.897 0.896 0.771 0.500 0.771 0.500 0.896 4.3 Real Data: Market Data 4.3.1 Data sets We apply our method to real market data provided by HAKUHODO,INC. (https://www.hakuhodo-global.com/) (https://www. m- cube.com/). This data set consists of 912 customers' beer purchase transactions from Nov. 1st 2010 to Jan. 31st 2011. Each customer's record is specified by a four-dimensional feature vector, each component of which shows a consumption volume for a certain beer category. Categories are: {Beer(A), Low-malt beer(B), Other brewed-alcohol(C), Liquor (D)}. and M-CUBE,INC. We constructed a sequence of customers' feature vectors as follows: A time unit is a day. At each time t(= τ, ..., T ), we denote the feature vector of the ith customer as xit = (xit,A, ..., xit,D) ∈ R4. Each xit,j is the ith customer's consumption of the jth category from time t − τ + 1 to t. We denote data at time t as xt = (x1t, ..., xnt), where n = 912, the number of customers. The total number of transactions is 13993. We set τ = 14 and T = 53. Since TH and DIFF have turned out to outperform the other methods in the previous section and we like to conduct continuous model selection simultaneously in order to visualize the dimension in the transition period, we focus on evaluating how well they work for the real data sets. Fig. 6 Change sign detection for market data 1520253035Time2.02.53.03.54.04.55.0SDMS / DdimSDMSDdim0.00.20.40.60.81.01.21.4TH / DiffTHDiff Table 3 Market structure change Detecting Signs of Model Change 21 cat. A B C D (cid:93) cat. A B C D (cid:93) c1 0 0 12 1768 211 c1 0 0 11 1919 212 t = 24 c2 1 2146 25 1 126 t = 25 c2 1 2201 21 1 124 t = 26 c3 1993 0 7 7 138 c3 1959 0 8 9 141 c4 0 0 156 0 437 c4 0 0 184 0 435 cat. A B C D (cid:93) c1 0 0 12 1916 213 c2 0 2199 19 1 123 c3 2139 1 8 12 148 c4 0 0 2962 0 283 c5 0 0 0 0 145 4.3.2 Results Fig. 6 shows Ddim (green), estimated number of clusters in GMM (blue) using SDMS, and time points of alarms raised by TH and Diff (red and purple) with δ1 = δ2 = 0.1. Table 3 shows the clustering structures t = 24, 25, 26. Each number in the (i, j)th cell shows the purchase volume of category i (= A, B, C, D) for the customers in the jth cluster cj (j = 1, 2, 3, 4). The last row shows the number of customers. The purchase volume of category C in cluster c4 gradually increased from t = 24 to t = 25, eventually c4 started to collapse at t = 25 and was split into c4 and c5 at t = 26. We confirm from Table 3 that c4 consisted of heavy users in category C, at t = 26, some of them became dormant users that did not purchase anything to form a new cluster. The SDMS algorithm detected this market structure change at t = 26. As shown in Fig. 6, TH and Diff successfully raised an alarm at t = 25 as a sign of that market structure change. The reason why we could detect the early warning signal is that there were gradual changes among clusters as well as within individual clusters before the clustering change occurred. Our result shows that our method was effective in detecting signs of model changes for such a case. 22 Detecting Signs of Model Change 4.4 Real Data: Electric Power Consumption Data 4.4.1 Data sets Next we apply our method to the household electric power consumption dataset pro- vided by [6]. This dataset contains three categories of electric power consumption corresponding to electricity consumed 1) in kitchen and laundry rooms, 2) by elec- tric water heaters and 3) by air-conditioners. The data were obtained every other minute from Dec. 17, 2006 to Dec. 10, 2010. We set xt = (x1, * * * , xn) and xi = (xi1, xi2, xi3) where each xi denotes the value of consumption per an hour for the three categories, respectively and xt is the value of consumption for two weeks (n = 336). 4.4.2 Results Fig.7 shows how Ddim (the green curve) and the number of clusters (the blue line) changed over time. Here each cluster shows a consumption pattern. The red dotted line shows the alert positions for TH and Diff with δ1 = δ2 = 0.1. Let us focus on the duration from t = 18 to t = 22. At t = 18, 19, there were three clusters, one of which collapsed to two clusters at t = 21, eventually, produced the fourth cluster. The Ddim graph in Fig.7 shows that Ddim gradually increased from k = 3 to k = 4 during the period. The alert was made by TH and Diff at t = 20 while there were still three clusters. This alert can be thought of as a sign of the emergence of a new cluster having a unique consumption pattern. Fig. 7 Change sign detection for power consumption data Table 4 shows the contents of clusters on the weeks starting from May 14th, 21st, and 28th in 2007. c means clusters and m1, m2, m3 mean the mean amounts of meter 1,2,3, respectively. The last column shows the total amount of users in a respective cluster. A sign of model change was detected on May 21st. The model change was detected on May 28th. We see from Table 4 that cluster 2 collapsed into clusters 2 and 3. Cluster 2 shows a pattern of homogeneous consumption with a relatively high weight on category 3. Cluster 3 shows a pattern of homogeneous consumption with a relatively high weight on category 1. The sign of this collapse was successfully detected on May 21st by monitoring the Ddim value. The reason why we could detect 181920212223Time3.03.23.43.63.84.0SDMS / DdimSDMSDdim0.00.20.40.60.81.01.21.4TH / DiffTHDiff Table 4 Electric power consumption structure change Detecting Signs of Model Change 23 The week from May 14th m2 2.73 2.80 3.05 m3 0.01 6.16 4.74 m1 0.01 0.00 5.18 (cid:93) 163 92 57 The week from May 21st m2 2.58 2.49 2.64 m3 0.01 6.22 4.34 m1 0.01 0.00 5.65 (cid:93) 168 99 45 The week from May 28th m2 2.70 3.01 2.72 3.11 m1 0.01 0.00 1.73 6.20 m3 0.01 6.38 5.87 4.91 (cid:93) 150 99 8 55 c 0 1 2 c 0 1 2 c 0 1 2 3 the early warning signal is that there was a gradual change in the collapse of cluster 2 before the clustering change occurred. Our result shows that our method was effective in detecting signs of model changes for such a case. 5 Relation of Ddim to MDL Learning This section gives a theoretical foundation of Ddim by relating it to the rate of con- vergence of the MDL learning algorithm [2, 30]. It selects a model with the shortest total codelength required for encoding the data as well as the model itself. We give an NML-based version of the MDL algorithm as follows. Let F = {P1, . . . , Ps} where | F |= s < ∞ and each Pi is a class of probability distributions. For a given training data sequence x = x1, . . . , xn where each xi is independently drawn, the MDL learning algorithm selects ˆP such that ˆP = argmin (− log pNML(x; P)) P∈F (31) (cid:26) (cid:27) = argmin P∈F − log max p∈P p(x) + log Cn(P) , where Cn(P) is the parametric complexity of P as in (5). The MDL learning algo- rithm outputs the NML distribution associated with ˆP as in (31): For a sequence y = y1, . . . , yn ˆp(y) = maxp∈ ˆP p(y) Cn( ˆP) . (32) 24 Detecting Signs of Model Change Note that y is independent of the training sequence x used to obtain ˆP. In previous work [2, 30], the MDL learning algorithm has been designed so that it outputs the two-stage shortest codelength distribution with quantized parameter values, belong- ing to the model classes. Our algorithm differs from them in that it outputs the NML distribution (32), which is not included in the model classes. The NML distribution and the MDL principle are the central notions in deriving Ddim throughout this paper. Thus it is significant to investigate the relation of Ddim to the NML distribution estimated with the MDL learning algorithm. We have the following theorem relating Ddim to the rate of convergence of the MDL learning algorithm. Theorem 3 Suppose that each x is generated according to p∗ ∈ P ∗ ∈ F = {P1, . . . , Ps}. Let ˆp be the output of the MDL learning algorithm as in (32). Let d(n) B (ˆp, p∗) be the Bhat- tacharyya distance between ˆp and p∗: d(n) B (ˆp, p∗) def = − 1 n (cid:88) (p∗(y)ˆp(y)) 1 2 . log y (33) Then for any (cid:15) > 0, we have the following upper bound on the probability that under the condition for P ∗ as in Theorem 1, the Bhattacharyya distance between the output of the MDL learning algorithm and the true distribution exceeds (cid:15): P rob[d(n) nDdim(P ∗)/4e−n(cid:15)(cid:17) B (ˆp, p∗) > (cid:15)] = O (34) (cid:16) . Suppose that P is chosen randomly according to the probability distribution π(P) over F = {P1, . . . , Ps} and that the unknown true distribution p∗ is chosen from P ∗. Then we have the following upper bound on the expected Bhattacharyya distance between the output of the MDL learning algorithm and the true distribution: EP ∗ Ex∼p∗∈P ∗ [d(n) B (ˆp, p∗)] = O where Ddim(F (cid:12)) is Ddim for model fusion as in (16). (cid:18) Ddim(F (cid:12)) log n n (35) (cid:19) , The proof is given in Appendix. This result may be generalized into the agnostic case where the model class misspecifies the true distribution (see also [4] for this case)). We omit this result from this manuscript since our main concern is how the expected generalization performance is related to Ddim. Theorem 3 implies that the NML distribution with model of the shortest NML codelength converges exponentially to the true distribution in probability as n increases and the rate is governed by Ddim for the true model. In conventional studies on PAC (probably approximately correct) learning [12], the performance of the empirical risk minimization algorithm has been analyzed using the technique of uniform convergence, where the rate of convergence is governed by the metric dimen- sion. Meanwhile, the performance of the MDL learning algorithm is analyzed using the non-uniform convergence technique, since the non-uniform model complexity is considered. In this case the rate of convergence of the MDL algorithm is governed by Ddim. Then the expected Bhattacharyya distance between the true distribution and the output of the MDL learning algorithm is characterized by Ddim for model fusion over F. Detecting Signs of Model Change 25 6 Conclusion This paper has proposed a novel methodology for detecting signs of model changes from a data stream. The key idea is to conduct continuous model selection using the notion of descriptive dimensionality (Ddim). Ddim quantifies the real-valued model dimensionality in the model transition period. We are able not only to visualize the model complexity in the transition period of model changes, but also to detect their signs by tracking the rise-up of Ddim. Focusing on the model changes in Gaussian mixture models, we have shown that gradual structure changes of GMMs can be effectively visualized by drawing a Ddim graph. Furthermore, we have empirically demonstrated that our methodology was able to detect signs of changes of the number of mixtures in GMM and those of the order of AR model earlier than they were actu- alized. Experimental results have shown that it was able to detect them significantly earlier than any other existing dynamic model selection methods. This paper has offered the use of continuous model change selection in the sce- nario of model change sign detection only. Exploring other scenarios of continuous model selection has remained for future studies. Acknowledgment This work was partially supported by JST KAKENHI 191400000190 and JST-AIP JPMJCR19U4. References [1] P.Alquier, J.Ridgway, and N.Chopin: "On the properties of variational approx- imations of Gibbs posteriors," Journal of Machine Learning Research, 17, pp:1-41, 2016. [2] A. Barron and T. Cover: "Minimum complexity density estimation," IEEE Trans. Information Theory, IT-37, pp:1034–1054, 1991. [3] R. A. Davis, T. Lee, and G. Rodriguez-Yam: "Structural break estimation for nonstationary time series models," Jr. of the Amer. Stat. Assoc., 101(473), pp:223, E39, 2006. [4] J. Ding, V. Tarokh, and Y. Yang: Model selection techniques: an overview, IEEE Signal Processing Magazine, Vol. 35, Issue: 6, pp:16–34, Nov. 2018. [5] J. Ding, J. Zhou, and V. Tarokh: Asymptotically optimal prediction for time- varying data generating processes, IEEE Transactions on Information Theory, Vol. 65, Issue: 5, pp: 3034– 3067, May 2019. [6] D. Dheeru and E. K. Taniskidou: UCI machine learning repository, 2017. [7] R.M. Dudley: "Universal Donsker classes and metric entropy," Annals of Probability, 15 (4), pp.1306–1326, 1987. 26 Detecting Signs of Model Change [8] T.Erven, P.Grunwald, and S.Rooij: "Catching up by switching sooner: a pre- dictive approach to adaptive estimation with an application to the AIC-BIC dilemma," Jr.Royal Stat.Soc.Ser.B, vol. 74, no. Issue 3, pp. 361–417, 2012. [9] J.D. Farmer: "Information dimension and the probabilistic structure of chaos," Z. Naturforsch, A 31, pp.1304–1325, 1982. [10] J. Gama, I. Zlibait, A. Bifet, M. Pechenizkiy, and A. Bouchachia, "A survey on concept drift adaptation," ACM Computing Survey, 2013. [11] P. D. Grunwald: The minimum description length principle, MIT press, 2007. [12] D. Haussler: "Decision theoretic generalizations of the PAC model for neural net and other learning applications," Information and Computation, 100, 78-150 ( 1992) [13] M.Herbster and M.Warmuth: "Tracking the best experts," Machine Learning, 32, pp:151–178,1998. [14] S. Hirai and K. Yamanishi, "Detecting changes of clustering structures using normalized maximum likelihood coding," in Proc.KDD12, pp. 343–351, 2012. [15] S. Hirai and K. Yamanishi: "Correction to efficient computation of normalized maximum likelihood codes for Gaussian mixture models with its applications to clustering," IEEE Trans. Inf. Theory, 65(10), pp: 6827-6828, 2019. [16] S. Hirai and K. Yamanishi: "Detecting structural uncertainty with structural entropy," in Proc. of IEEE BigData 2018, 2018. [17] D. T. J. Huang, Y. S. Koh, G. Dobbie, and R. Pears: "Detecting volatility shift in data streams," in Proceedings of IEEE International Conference on Data Mining 2014, pp:863–868, 2014. [18] A.N. Kolmogorov, and V.M. Tihomirov: "(cid:15)-entropy and (cid:15)-capacity of sets in functional spaces," Amer. Math. Sot. Trunsl. Ser. 2, 17. pp.277–364, 1961. [19] G. MacLachlan and D. Peel: Finite Mixture Models, Jhon Wiley and Sons, 2000. [20] B. B. Mandelbrot: The Fractal Geometry of Nature, W.H.Freeman, 1982. [21] E. Ntoutsi, M. Spiliopoulou, and Y. "Theodoridis:FINGERPRINT: Summariz- ing cluster evolution in dynamic environments," IJDWM, 8(3), 2012. [22] Y. Ohsawa: "Graph-based entropy for detecting explanatory signs of changes in market," The Review of Social Network Strategies, Vol 12, 2, pp:183-203, 2018. [23] D. Pollard: Convergence Berlin/NewYork, 1984. of Stochastic Processes, Springer-Verlag, Detecting Signs of Model Change 27 [24] J.Rissanen: "Modeling by shortest description length," Automatica, 14(5):465– 471, 1978. [25] J.Rissanen: Optimal Estimation of Parameters, Cambridge, 2012. [26] Y. M. Shtarkov: "Universal sequential coding of single messages," Problem Peredachi Informatsii, 23, 3, 3-17, 1987. [27] M. Song and H. Wang: "Highly efficient incremental estimation of Gaussian mixture models for online data stream clustering," Intelligent Computing, 2005. [28] V.N.Vapnik: Estimation of Dependences Based on Empirical Data, Springer Verlag, New York, 1982. [29] X. Xuan and K. Murphy: "Modeling changing dependency structure in mul- tivariate time series," Proceedings of the 24th International Conference on Machine learning, pp:1055–1062, ACM, 2007. [30] K.Yamanishi: "A learning criterion for stochastic rules," Machine Learning, Volume 9, Issue 2-3, pp 165-203, July 1992. [31] K. Yamanishi: "Descriptive dimensionality with its characterization of MDL- based learning and change detection." arXiv:1910.11540, 2019. [32] K. Yamanishi and S. Fukushima: "Model change detection with the MDL principle," IEEE Transactions on Information Theory, 64(9), pp: 6115-6126, 2018. [33] K. Yamanishi and Y. Maruyama: "Dynamic model selection with its applica- tions to novelty detection,"IEEE Trans. Inf. Theory, vol. 53, pp. 2180–2189, 2007. [34] K. Yamanishi and Y. Maruyama: "Dynamic syslog mining for network fail- ure monitoring," in Proceedings of ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD05), pp.499–508, 2005. [35] K. Yamanishi and K. Miyaguchi: "Detecting gradual changes from data stream using MDL change statistics," in Proceedings of 2016 IEEE International Conference on BigData, pp.156–163, 2016. [36] K. Yamanishi, L. Xu, R. Yuki, S. Fukushima, and C. Lin: Change sign detec- tion with differential MDL change statistics and its applications to COVID-19 pandemic analys, Scientific Reports, 11:19795, 2021. [37] https://github.com/conf-post-01/Ddim.git 28 Detecting Signs of Model Change A Proof of Theorem 1 Let P be a k-dimensional parametric class, which we denote as Pk = {p(x; θ) : θ ∈ Θk} where Θk is a k-dimensional parametric space. In this case, we denote g(ˆθ, θ) instead of g(ˆp, p). Let the finite set of k-dimensional real-valued parameters space be Θk = {θ1, θ2, . . . } and let P k = {p(x; θ) : θ ∈ Θk ⊂ Rk}. Let In(θ) be the Fisher information matrix at θ: In(θ) def= (1/n)Eθ[∂2(− log p(x; θ))/∂θ∂θ(cid:62)] and suppose that limn→∞ In(θ) = I(θ) for each θ. Below we denote p(x; θ) as pθ. Consider (cid:15)2-neighborhood of θi with respect to the KL divergence dn: D(cid:15)(i) def= {θ : dn(pθi, pθ) ≤ (cid:15)2}. Note that dn(pθi, pθ) is written using Taylor's expansion up to the second order as follows: Under the condition that log p is three-times differentiable, maxa,b,c | ∂3 log p(x; θ)/∂θa∂θb∂θc |< ∞, dn(pθi, pθ) = − + = 1 n 1 2n 1 2 Eθi (cid:20) ∂ log p(x; θ) ∂θ (cid:21) |θi (θ − θi) (θ − θi)(cid:62)Eθi (cid:20) − ∂2 log p(x; θ) ∂θ∂θ(cid:62) (cid:21) |θi (θ − θi) + O((cid:107) θ − θi (cid:107)3) (θ − θi)(cid:62)In(θi)(θ − θi) + O((cid:107) θ − θi (cid:107)3), where we have used the fact: Eθi (cid:20) ∂ log p(x; θ) ∂θ (cid:21) |θi = = (cid:88) p(x; θi) ∂ log p(x; θ) ∂θ |θi x ∂ (cid:80) x p(x; θ) ∂θ |θi = 0. Therefore, we may consider ̃D(cid:15)(i) in place of D(cid:15)(i). ̃D(cid:15)(i) = {θ : (θ − θi)(cid:62)In(θi)(θ − θi) ≤ C(cid:15)2}, where C does not depend on n nor (cid:15). Let B(cid:15)(i) be the largest hyper-rectangle within ̃D(cid:15)(i) centered at θi. For some 1 ≤ C (cid:48) < ∞, for any i, we have | B(cid:15)(i) |≤| ̃D(cid:15)(i) |≤ C (cid:48) | B(cid:15)(i) | . (36) Along with [25] (p.74), geometric analysis of B(cid:15)(i) yields the Lebesgue volume of B(cid:15)(i) as follows: | B(cid:15)(i) | = (cid:19) k 2 (cid:18) 4C(cid:15)2 k | In(θi) |− 1 2 = 2k (cid:115) k (cid:89) j=1 C(cid:15)2 kλj , Detecting Signs of Model Change 29 where λj is the j-th largest eigenvalue of In(θi). We choose Θk so that the central limit theorem holds. Then for sufficiently large n, as θ → θi, g(θi, θ) (cid:39) (cid:17) k 2 (cid:16) n 2π | I(θi) | 1 2 e−n(θ−θi)(cid:62)In(θi)(θ−θi). Thus for θ ∈ Di((cid:15)), we obtain Next define Q(cid:15)(i) as g(θ, θ) | B(cid:15)(i) |(cid:39) (cid:18) 2C(cid:15)2n kπ (cid:19) k 2 . Q(cid:15)(i) def= (cid:90) ˆθ∈ ̃D(cid:15)(i) g(ˆθ, ˆθ)dˆθ. and let mn((cid:15)) be the smallest number of elements in Θk: log Cn(k) ≤ log mn((cid:15)) (cid:88) i=1 Q(cid:15)(i). Combining (37) and (36) with (38) yields (37) (38) log Cn(Pk) = log mn((cid:15)) + sup Θk k 2 = log mn((cid:15)) + (cid:26) k 2 log (cid:18) 2C(cid:15)2n kπ (cid:19)(cid:27) + O(1) (39) log((cid:15)2n) + O(1). (40) where C in (39) depends on Θk and the O(1) term in (40) may depend on k, but both of them do not depend on n nor (cid:15). The supremum in (39) is taken with respect to ̄Θk so that (37) holds. Setting (cid:15)2n = O(1) yields log Cn(Pk) = log mn((cid:15) : Pk) + = log mn(1/ √ n : Pk) + O(1). k 2 log((cid:15)2n) + O(1) This completes the proof of Theorem 1. (cid:3) B Proof of Theorem 3 Let p∗ be the true distribution associated with the true model P ∗. Let ˆP be the model selected by the MDL learning algorithm and let pNML(x; ˆP) be the NML distribution associated with ˆP. We write it as ˆp. We employ the proof technique similar to that for two-part code estimators in [2, 30]. 30 Detecting Signs of Model Change By the definition of the MDL learning algorithm, we have (− log pNML (x; P)) ≤ − log pNML(x; P ∗) min P = − log max p∈P ∗ p(x) + log Cn(P ∗) ≤ − log p∗(x) + log Cn(P ∗). (41) Let pNML,P be the NML distribution pNML(x : P) associated with P. For (cid:15) > 0, the following inequalities hold: B (ˆp, p∗) > (cid:15)] P rob[d(n) ≤ P rob[x : (41) holds under d(n) B (ˆp, p∗) > (cid:15)] min P:dn B (pNML,P ,p∗)>(cid:15) (− log pNML (x; P)) ≤ − log p∗(x) + log Cn(P ∗) (cid:35) (cid:34) = P rob x : (cid:34) = P rob x : max pNML (x : P) ≥ P:dn B (pNML,P ,p∗)>(cid:15) (cid:34) P rob x : pNML(x : P) ≥ ≤ (cid:88) P∈F ,d(n) B (pNML ,P ,p∗)>(cid:15) (cid:35) p∗(x) Cn(P ∗) (cid:35) . p∗(x) Cn(P ∗) (42) Let En(P) be the event: pNML (x : P) ≥ p∗(x)/Cn(P ∗). Under En(P), 1 ≤ (cid:18) pNML (x; P) p∗(x) (cid:19) 1 2 (Cn(P ∗)) 1 2 . Then under the condition that d(n) B (pNML,P , p∗) > (cid:15), we have P rob[En(P)] = (cid:88) p∗(x) x***En(P) (cid:88) p∗(x) ≤ ≤ x***En(P) (cid:40) (cid:88) (cid:18) pNML (x; P) p∗(x) (cid:19) 1 2 (Cn(P ∗)) 1 2 (cid:41) (pNML (y; P)p∗(y)) 1 2 (Cn(P ∗)) 1 2 y < exp(−n(cid:15) + (log Cn(P ∗))/2), (43) Detecting Signs of Model Change 31 where we have used the fact that under d(n) B (pNML,P , p∗) > (cid:15), it holds (pNML(y; P)p∗(y)) 1 2 < e−n(cid:15). (cid:88) y Plugging (43) into (42) yields P rob[d(n) B (ˆp, p∗) > (cid:15)] ≤ (cid:88) P rob[En(P)] P∈F ,d(n) B (pNML,P ,p∗)>(cid:15) (cid:88) exp (−n(cid:15) + (1/2) log Cn(P ∗)) P∈F ,d(n) (cid:88) B (pNML,P ,p∗)>(cid:15) exp (−n(cid:15) + (1/2) log Cn(P ∗)) P∈F < ≤ = exp (−n(cid:15) + (1/2) log Cn(P ∗) + log | F |) . (44) Under the condition for P ∗ as in Theorem 3, we have 1 2 log Cn(P ∗) + log | F |= 1 4 Ddim(P ∗) log n + o(log n). (45) Plugging (45) into (44) yields (34). Let rn(P ∗) def= {(1/2) log Cn(P ∗) + log | F |}/n. For fixed P ∗, we have the following upper bound on the expected Bhattacharyya distance: Ex∼p∗∈P ∗ [d(n) B (ˆp, p∗) − rn(P ∗)] = ≤ (cid:90) ∞ 0 (cid:90) ∞ 0 P rob[d(n) B (ˆp, p∗) − rn(P ∗) > (cid:15)]d(cid:15) e−n(cid:15)d(cid:15) = 1 n , (46) where we have used (34) to derive (46). Therefore, we have Ex∼p∗∈P ∗ [d(n) B (ˆp, p∗)] ≤ rn(P ∗) + 1 n . Taking the expectation with respect to P ∗ yields EP ∗ [d(n) B (ˆp, p∗)] ≤ EP ∗ Ex∼p∗∈P ∗ [rn(P ∗)] + 1 n n, P ∗)] √ (cid:19) (cid:18) EP ∗ [log mn(1/ n = O = O (cid:18) Ddim(F (cid:12)) log n n (cid:19) . (47) To derive (47), we have used the fact log Cn(P ∗) = log mn(1/ completes the proof. √ n, P ∗)+O(1). This (cid:3)
http://arxiv.org/abs/2302.12126v3
2023-04-04T20:03:36
2023-02-23T16:09:42
KHAN: Knowledge-Aware Hierarchical Attention Networks for Accurate Political Stance Prediction
The political stance prediction for news articles has been widely studied to mitigate the echo chamber effect -- people fall into their thoughts and reinforce their pre-existing beliefs. The previous works for the political stance problem focus on (1) identifying political factors that could reflect the political stance of a news article and (2) capturing those factors effectively. Despite their empirical successes, they are not sufficiently justified in terms of how effective their identified factors are in the political stance prediction. Motivated by this, in this work, we conduct a user study to investigate important factors in political stance prediction, and observe that the context and tone of a news article (implicit) and external knowledge for real-world entities appearing in the article (explicit) are important in determining its political stance. Based on this observation, we propose a novel knowledge-aware approach to political stance prediction (KHAN), employing (1) hierarchical attention networks (HAN) to learn the relationships among words and sentences in three different levels and (2) knowledge encoding (KE) to incorporate external knowledge for real-world entities into the process of political stance prediction. Also, to take into account the subtle and important difference between opposite political stances, we build two independent political knowledge graphs (KG) (i.e., KG-lib and KG-con) by ourselves and learn to fuse the different political knowledge. Through extensive evaluations on three real-world datasets, we demonstrate the superiority of DASH in terms of (1) accuracy, (2) efficiency, and (3) effectiveness.
[ "Yunyong Ko", "Seongeun Ryu", "Soeun Han", "Youngseung Jeon", "Jaehoon Kim", "Sohyun Park", "Kyungsik Han", "Hanghang Tong", "Sang-Wook Kim" ]
10.1145/3543507.3583300
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1145/3543507.3583300", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.12126v3", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12126v3", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG" ]
KHAN: Knowledge-Aware Hierarchical Attention Networks for Accurate Political Stance Prediction Seongeun Ryu [email protected] Hanyang University Seoul, Republic of Korea Yunyong Ko [email protected] University of Illinois at Urbana-Champaign, IL, USA Soeun Han [email protected] Hanyang University Seoul, Republic of Korea 3 2 0 2 r p A 4 ] L C . s c [ 3 v 6 2 1 2 1 . 2 0 3 2 : v i X r a Youngseung Jeon [email protected] University of California Los Angeles, CA, USA Kyungsik Han [email protected] Hanyang University Seoul, Republic of Korea Jaehoon Kim [email protected] Hanyang University Seoul, Republic of Korea Hanghang Tong [email protected] University of Illinois at Urbana-Champaign, IL, USA Sohyun Park [email protected] Ajou University Suwon, Republic of Korea Sang-Wook Kim∗ [email protected] Hanyang University Seoul, Republic of Korea ABSTRACT The political stance prediction for news articles has been widely studied to mitigate the echo chamber effect – people fall into their thoughts and reinforce their pre-existing beliefs. The previous works for the political stance problem focus on (1) identifying political factors that could reflect the political stance of a news article and (2) capturing those factors effectively. Despite their em- pirical successes, they are not sufficiently justified in terms of how effective their identified factors are in the political stance predic- tion. Motivated by this, in this work, we conduct a user study to investigate important factors in political stance prediction, and observe that the context and tone of a news article (implicit) and external knowledge for real-world entities appearing in the article (explicit) are important in determining its political stance. Based on this observation, we propose a novel knowledge-aware approach to political stance prediction (KHAN), employing (1) hierarchical attention networks (HAN) to learn the relationships among words and sentences in three different levels and (2) knowledge encod- ing (KE) to incorporate external knowledge for real-world entities into the process of political stance prediction. Also, to take into account the subtle and important difference between opposite polit- ical stances, we build two independent political knowledge graphs (KG) (i.e., KG-lib and KG-con) by ourselves and learn to fuse the different political knowledge. Through extensive evaluations on three real-world datasets, we demonstrate the superiority of KHAN in terms of (1) accuracy, (2) efficiency, and (3) effectiveness. ∗Corresponding author Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. WWW '23, April 30-May 4, 2023, Austin, TX, USA © 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-1-4503-9416-1/23/04. . . $15.00 https://doi.org/10.1145/3543507.3583300 CCS CONCEPTS • Information systems → Web mining; • Computing method- ologies → Neural networks; • Human-centered computing; KEYWORDS political stance prediction, echo chamber effect, hierarchical atten- tion networks, knowledge graph embedding ACM Reference Format: Yunyong Ko, Seongeun Ryu, Soeun Han, Youngseung Jeon, Jaehoon Kim, Sohyun Park, Kyungsik Han, Hanghang Tong, and Sang-Wook Kim. 2023. KHAN: Knowledge-Aware Hierarchical Attention Networks for Accurate Political Stance Prediction. In Proceedings of the ACM Web Conference 2023 (WWW '23), April 30-May 4, 2023, Austin, TX, USA. ACM, New York, NY, USA, 12 pages. https://doi.org/10.1145/3543507.3583300 1 INTRODUCTION With the prevalence of web-based news platforms, people are hav- ing more chances to obtain a variety of high-quality information about social and political issues. In general, people tend to prefer news contents which have similar political stances to them [38]. For example, people who have a conservative stance often prefer news articles from conservative news media such as Fox and Breibart, while those with a liberal stance might prefer articles from liberal news media such as CNN, New York Times, and Washington Post. As this tendency becomes intensified, however, people could be trapped in their own opinions and reinforce their pre-existing be- liefs by limiting exposure to other news articles having different opinions. This is called the echo chamber effect [60], a fundamental reason that leads to serious social polarization by hindering positive and active communications among people [7, 9, 14, 15, 22, 68]. In ad- dition, machine learning (ML)-based recommendation systems have been exacerbating this problem since their goal is to recommend news articles that are likely to be preferred by users [2, 16, 28, 57]. Many studies have been proposed to mitigate the echo chamber effect [1, 19, 37, 45, 46, 52, 53]. They mainly focus on exposing diverse opinions (e.g., news articles with different stances) to people in order to prevent them from falling into their existing beliefs too WWW '23, April 30-May 4, 2023, Austin, TX, USA Y. Ko et al. among words/sentences to capture the context and tone of a news arti- cle, which is implicitly reflected in the article, and (2) to understand the interpretation and sentiment to real-world entities (e.g., keyword and person), which explicitly appear in a news article. Towards reflecting both the explicit and implicit factors, in this paper, we propose a novel approach to accurate political stance pre- diction, named Knowledge-aware Hierarchical Attention Networks (KHAN). KHAN consists of two key components: (1) hierarchi- cal attention networks (HAN) to learn the relationships among words/sentences in a news article with 3-level hierarchy (i.e., word- level, sentence-level, and title-level), rather than learning the entire article itself, and (2) knowledge encoding (KE) to incorporate both common and political knowledge for real-world entities, necessary for understanding a news article, into the process of predicting the political stance of a news article. Regarding political knowledge, the interpretation and sentiment to even the same entities can be different depending on its political stance [19, 45, 52]. To address the subtle but important difference, we construct two knowledge graphs (KG) with different political stances, KG-lib and KG-con, and design KE to learn to fuse the information extracted from the politi- cal knowledge graphs. To our best knowledge, this is the first work that leverages both common and political knowledges separately, further reflecting the different political knowledges. The main contributions of this work are as follows. • Datasets: To reflect the different political knowledge of each entity, we build two political knowledge graphs, KG-lib and KG- con. Also, for extensive evaluation, we construct a large-scale political news datatset, AllSides-L, much larger (48×) than the existing largest political news article dataset.2 • Algorithm: We propose a novel approach to accurate political stance prediction (KHAN), employing (1) hierarchical attention networks (HAN) and (2) knowledge encoding (KE) to effectively capture both explicit and implicit factors of a news article. • Evaluation: Via extensive experiments, we demonstrate that (1) (accuracy) KHAN consistently achieves higher accuracies than all competing methods (up to 5.92% higher than the state-of-the- art method), (2) (efficiency) KHAN converges within comparable training time/epochs, and (3) (effectiveness) each of the main components of KHAN is effective in political stance prediction. For reproducibility, we have released the code of KHAN and the datasets at https://github.com/yy-ko/khan-www23. 2 RELATED WORK Language models. The political stance prediction can be seen as a special case of document classification. Thus, general language models [8, 29, 40, 48, 50, 55, 56, 58], which aim at learning to repre- sent words into embedding vectors, could be applied to the political stance prediction problem. Word2Vec [50] is a traditional language model that learns word embeddings based on the similarity be- tween words to preserve local context. However, Word2Vec does not reflect the global context in the entire document [6]. To address the limitation of Word2Vec, GloVe [55] utilizes not only the local relationships among words but also global information of a given document. ELMo [56] aims to learn the meanings of words that can 2The data construction details (KG-lib, KG-con, AllSides-L) are provided in Appen- dix A.2. Figure 1: Accurate provision of diverse political stances to mitigate the echo chamber effect. much. In computer science, for example, many groups of researchers have studied the diversification of news recommendation systems in order to provide news articles not only interesting but also fresh to users [23, 49, 72, 74]. Through this effort, people could view a given issue from various perspectives and understand how rational or biased they are, thereby leading to the mitigation of the echo chamber effect [10]. Based on this understanding, from the technical aspect, it is critical to accurately predict the political stance of a given news article (i.e., political stance prediction), which this paper focuses on. This is because the accurate provision of news articles with different political stances would not only (1) have people experience diverse political stances but also (2) allow researchers to investigate ways to support news consumption in a balanced standpoint from people's experiences and behaviors [45]. Although there has been much effort to predict political stances of news articles by domain experts, it encompasses a manual process of determining political stances that requires a great amount of time and effort and may be also influenced by human biases [26]. For this political stance prediction, existing language models such as GloVe [55], BERT [29], and RoBERTa [48] can be applied. However, it is reported that a single application of language models empirically failed to achieve high accuracy in the political stance prediction because they are not designed specially for predicting the political stance of a news article [13, 44, 69]. Recently, in or- der to overcome the limitation of general language models, deep neural networks (DNN) models for political stance prediction have been proposed [13, 42, 44, 69]. They identify social, linguistic, and political factors reflecting the political stance of a news article and design new model architectures to effectively capture the identified factors. Although these DNN models empirically achieved higher accuracies than existing language models, they are not sufficiently justified in terms of why and how effective their identified factors are in predicting the political stances of news articles. From this motivation, we first conducted a user study in order to investigate what factors real-world users consider and how im- portant the factors are in determining the political stances of news articles. We provided six articles with different political stances and carefully-chosen factors to 136 respondents via Amazon Mechani- cal Turk. We asked them to respond how important each factor is in their decision with a scale [1:(not at all)-5:(very much)]1. Through the user study, we observe that the "context" of a new article is the most important factor in deciding its political stance, followed by keyword, person, tone, and frequently used word. This result gives us an important lesson: it is crucial (1) to learn the relationships 1The details of the user study are described in Appendix A.1. User in Echo ChamberMitigationAI ModelPolitical StancesNews KHAN: Knowledge-Aware Hierarchical Attention Networks for Accurate Political Stance Prediction WWW '23, April 30-May 4, 2023, Austin, TX, USA be varying depending on the context of a given document, using the pre-trained Bi-LSTM model as contextual information. In addition, task-agnostic language models, pre-trained based on large-scale data, can be applied to the political stance prediction problem by fine-tuning them on political news article data. BERT [29], com- posed of multiple transformer encoders [63], learns the context of given text in a bidirectional way with the masked language model (MLM) and the next sentence prediction (NSP). RoBERTa (Robustly optimized BERT) [48], pre-trained on much more training data than BERT, proposes a dynamic masking technique to improve MLM of BERT, achieving higher accuracy than that of BERT. These lan- guage models, however, have a limitation in capturing the political characteristics of news articles since they are not designed specially for predicting the political stance of a news article [13, 44, 69]. Political stance prediction models. To overcome the limitation of language models, many researchers have studied methods that consider both text and additional information (e.g., social, linguistic, and political information), which could be useful in political stance prediction [13, 42–44, 61, 69]. HLSTM (Hierarchical LSTM) [42] encodes a news article into an embedding vector using hierarchical LSTM models and it additionally utilizes social context information (e.g., how the news article is spread across users) [33–35] that could reflect the political stance of a news article. Similarly, MAN [44] learns the relationships among words in news articles using multi- head attention networks and considers social and linguistic infor- mation necessary to understand the political context of a news article. More recently, knowledge graph (KG) based approaches to political stance prediction have been proposed [13, 69]. A KG-based approach constructs a knowledge graph based on political news articles and uses the political knowledge extracted from the KG as additional information. KGAP (Knowledge Graph Augmented Political perspective detection) [13] represents a given news article as a 4-layer graph (word, sentence, paragraph, and article nodes), and then, it injects the knowledge information to each word node and applies graph neural networks (e.g., R-GCN [59]) to the article graph. KCD (Knowledge walks and textual Cues enhanced political perspective Detection) [69], a state-of-the-art political stance pre- diction model, generates political knowledge walks via performing random walks in the political KG (like simulating the process of human reasoning) and combines the political knowledge walks with the text of a news article using multi-head attention layers. 3 THE PROPOSED METHOD: KHAN In this section, we present a novel approach to political stance prediction, Knowledge-aware Hierarchical Attention Networks (KHAN). First, we describe the notations and the problem definition. Then, we present two main components of KHAN: hierarchical attention networks (HAN) and knowledge encoding (KE). 3.1 Problem Definition The notations used in this paper are described in Table 1. KHAN manages two types of embeddings in order to hierarchically learn the relationships among words and the relationships among sen- tences in a news article: word embeddings (W = {w1, w2, ..., wN }) and sentence embeddings (S = {s1, s2, ..., sl }), where wi (si ) repre- sents the d-dimensional word (sentence) embedding of the ith word Table 1: Notations and their descriptions. Notation Description W S T wi, s j d N n l Kcom Klib Kcon α, β A, a X F (*) η a set of word embeddings a set of sentence embeddings the title embedding ith word embedding, jth sentence embedding the embedding dimensionality the total number of words in a dataset the maximum number of words in a sentence the maximum number of sentences in an article a set of common knowledge embeddings a set of liberal knowledge embeddings a set of conservative knowledge embeddings common and political knowledge factors news article dataset and a news article a set of learnable parameters loss function (i.e., cross-entropy loss) user-defined learning rate (sentence). In addition to word and sentence embeddings, KHAN also manages external knowledge embeddings to incorporate com- mon and political knowledge in political stance prediction: common and political knowledge embeddings (Kcom, Klib , and Kcon). Political stance prediction. This work aims to solve the political stance prediction problem: given a news article a, predict its political stance (e.g., [1, 5], where 1 indicates 'left' and 5 indicates 'right'). This problem, a typical supervised learning task, can be defined as follows from the optimization perspective: min w ∈R 1 |A| ∑︁ a ∈A F (X, a) + ||X ||2, (1) where X is the set of learnable parameters, A is a given news article dataset, and F (X, a) is the loss function of the parameters X given a news article a. As the loss function, F (*), we adopt cross-entropy loss with the L2-regularization term. Based on this problem definition, we optimize the learnable parameters X in an end-to-end way. More specifically, to solve the problem represented in Eq 1, we consider SGD as an optimization algorithm. Let Xt be the model parameters at iteration t. Then, Xt is optimized iteratively by the following rule: Xt +1 = Xt −η *∇F (Xt , a), where η is the user-defined learning rate. 3.2 Hierarchical Attention Networks (HAN) As shown in Table 5, the context and tone of a news article are important factors in predicting the political stance of a news arti- cle. These factors, however, do not appear in the article explicitly; instead, they are implicitly reflected in the overall article. Due to their implicit characteristics, it is very challenging to capture the context and tone of a news article. To address this challenge, in this section, we propose a Hierarchical Attention Networks (HAN) that learns (1) the relationships among words, (2) the relationships among sentences, and (3) the relationships between the title and WWW '23, April 30-May 4, 2023, Austin, TX, USA Y. Ko et al. Figure 2: The overview of KHAN: hierarchical attention networks (upper) and knowledge encoding (lower). sentences (i.e., 3-level hierarchy), for effectively capturing the im- plicit factors (i.e., context and tone) from news articles. Through the 3-level hierarchy, HAN is able to sequentially capture (1) the local context in each sentence, (2) the global context in an article, and (3) the key idea included in the title. HAN consists of four layers as illustrated in Figures 2(a)-(d): (a) a pre-processing layer; (b) a word-level attention layer; (c) a sentence- level attention layer; and (d) a title-level attention layer. Now, we describe the four layers and their advantages and challenges. Pre-processing layer. In general, a news article data is not struc- tured and just represented as a sequence of words (or symbols). Thus, to apply our hierarchical attention networks to a news ar- ticle, we need to pre-process an input article to represent as a structured form. We pre-process a given news article as follows: Given a news article a, we transform the input article into a set of sentences based on the user-defined separate symbol (e.g., <sep>), and then, represent each sentence as a set of word embedding vectors, Wj = {w1, w2, ..., wn }, where Wj is the set of word em- bedding vectors in the jth sentence, wi is the d-dimensional em- bedding vector of the ith word, and n is the maximum number of words in a single sentence. Once all news articles in the input dataset are pre-processed, we initialize all word embedding vec- tors, ˆW = {w1, w2, ..., wN }, where N is the total number of words appearing in the entire dataset. Word-level attention layer. In the word-level attention layer, we aim to learn 'the relationships among words' in the same sentence, instead of in the entire article, to capture the local context of each sentence. Specifically, we apply multi-head self-attention blocks to the set of word embedding vectors in each sentence (i.e., sentence- wise self-attention). Thus, the word-level attention layer for the jth sentence is defined as follows: local-context-aware word embedding vectors in the jth sentence – to a feed-forward layer, with the same principle of [63], in order to represent the output from the word-level attention layer to better fit the input for the next sentence-level attention layer. Note that this 'sentence-wise' attention layer of HAN has advan- tages in terms of both efficiency and effectiveness, compared to the existing 'article-wise' attention methods [5, 12] that take into ac- count all words in the article together. HAN (1) requires the amount of computation much less than the existing methods (efficient) and (2) is able to effectively capture the local context without being interfered with the words that are located far away (effectiveness) because HAN only learns the relationships among closely located words. However, it is difficult to capture the global context of a news article with only the word-level attention layer because this layer is designed specially for capturing the local context of each sentence. To address this limitation, we apply the sentence-level attention layer to the output of this word-level attention layer. Sentence-level attention layer. The sentence-level attention layer of HAN learns 'the relationships among sentences' in the entire article, to capture the global context of the news article. First, the word embedding vectors from the previous layer are averaged in a sentence-wise manner to generate the sentence embedding vectors. Thus, the jth sentence embedding vector (s j ) with d-dimensionality is generated by averaging the d-dimensional word embedding vec- tors in the jth sentence (i.e., s j = Avg( ̃Wj )), where each sentence embedding vector (s j ) has the local context information captured from the previous layer. Then, the sentence-level multi-head self- attention blocks are applied to the set of sentence embedding vec- tors in each article (i.e., article-wise self-attention). Formally, the sentence-level attention layer for the kth article is defined as the similar way to the word-level attention: ̃Wj = MultiHead (Q w, K w, V w), (2) ̃Sk = MultiHead (Qs, Ks, V s ), (3) where Q w = K w = V w = Wj and Wj is the set of word embedding vectors in the jth sentence. Then, we pass the output ( ̃Wj ) – the where Qs = Ks = V s = Sk and Sk is the set of the sentence embed- ding vectors in the kth article. We also pass the global-context-aware Hierarchical Attention Networks (HAN)Knowledge Encoding (KE)<w#, w$, w', ... , w)><w#, w$, w', ... , w)><w#, w$, w', ... , w)><w#, w$, w', ... , w)>s#:s$:s,:T :Word-LevelAttentionSentence-LevelAttentions#s's,Word embeddingKcomKlibKconSoftmaxs$Knowledge-aware embedding(a)Feed ForwardFeed Forward(b)(c)Title-LevelAttentionFeed Forward(d)(f)(e)w#w$w'w)s,:...w#w$w)w'(g)s′$s′,s′#TWordNetQ:K:V:KcomKconKlib●●●●●●●●●●●●<w#, w$, w', ... , w)>s':●●●Q=K=V=Q>K>V>●●●●●●●●●●●●Knowledge Fuse●●●●●●●●●Knowledge Embedding KHAN: Knowledge-Aware Hierarchical Attention Networks for Accurate Political Stance Prediction WWW '23, April 30-May 4, 2023, Austin, TX, USA sentence embedding vectors in kth article ( ̃Sk ) to a feed-forward layer to process the output from this sentence-level attention layer to better fit the next layer (i.e., the title-attention layer). For the learnable parameters of the word-level and sentence- level attention layers, we use the different sets of parameters in the word-level and the sentence-level attention layers (i.e., X Q w ≠ X Qs ) because the related patterns among words (the local context) to capture in the word-level layer are highly likely to be different from those among sentences (the global context) to capture in the sentence-level layer. As a result, this sentence-level attention layer is able to effectively capture the global context of a news article, based on the previously learned local context, compared to existing non-hierarchical methods counting on all words at once. Title-level attention layer. The title of a news article, a special sentence having the key idea that the author of the news article hopes to deliver, has been considered as important information in a number of news recommendation systems [17, 31, 65, 67, 70, 73]. Inspired by the importance of the title, we apply the title-level attention layer to the sentence embeddings. The goal of this title- attention layer is (1) to reinforce the key idea included in the title and (2) to filter out relatively unnecessary information in sentences. Let Tk be the title embedding vector of the kth article, then, the title-level attention layer for the kth article is defined as follows: ̃ST k = MultiHead (Qt , Kt , V t ), where Qt = Tk , Kt = V t = ̃Sk , and ̃Sk is the sentence embedding vectors from the previous layer. Thus, by Eq 4, the sentence embed- ding vectors would be re-weighted in terms of the context of the title (i.e., reinforcing the key idea in the title). Applying the title attention layer in the final stage of HAN, however, might cause the global-context-aware sentence embedding vectors to be biased only to the context of the title too much, thereby leading to the degradation of prediction accuracy. To prevent this problem, we add a residual connection [24, 66] to the output of the title attention layer in order to maintain the global context previously learned from the sentence-level attention layer. Thus, the final output of the title-level attention layer is defined as follows: (4) ̃S∗ k = ̃ST k + ̃Sk, (5) where ̃S∗ k is the set of the final sentence embeddings in the kth article. Finally, we aggregate the sentence embeddings, and then pass the aggregated embedding through the output layer. ˆy = Predict (ak ), ak = Avg( ̃S∗ (6) k where Predict (*) is a softmax layer to predict the political stance of a given news article, ˆy. ), As a result, via the 3-level hierarchical process, HAN is able to effectively capture both the local and global context implicitly reflected in a news article. We will verify the effectiveness of HAN in improving the model accuracy of KHAN in Section 4. 3.3 Knowledge Encoding (KE) As shown in Appendix A.1, it is crucial to understand the inter- pretation and sentiment to real-world entities such as keywords and persons in predicting the political stance of a news article. In general, however, it often occurs that the information about Table 2: Statistics of political KGs. KGAP [13] KG-lib KG-con # of source posts # of entities # of relations Political stances - 1,071 10,703 Both 219,915 5,581 29,967 Liberal Conservative 276,156 6,316 33,207 many real-world entities is not clearly provided in news articles. For example, famous politicians (e.g., 'Barack Obama' and 'Don- ald Trump') are not always directly described in a news article. From this motivation, we propose Knowledge Encoding (KE) that pre-trains the external knowledge (both common and political) re- lated to the real-world entities and injects the external knowledge into the corresponding words appearing in a news article for accu- rate political stance prediction. Regarding political knowledge, we take into account two different political knowledge (i.e., liberal and conservative) separately in the knowledge encoding. This approach has advantages in capturing subtle but impor- tant difference in knowledge, related to real-world entities, varying depending on political stances, compared to the existing knowledge- based methods [13, 69] that consider only unified political knowl- edge. However, there is a technical challenge about how to incorpo- rate the three different knowledge (one common and two political knowledge) into the process of the political stance prediction. To this challenge, we propose a simple but effective algorithm for knowledge injection, where KE learns how to fuse the three types of knowledge. Figures 2(e)-(g) illustrate the three stages of KE: (1) knowledge preparation; (2) embedding; and (3) injection. Knowledge preparation. First, we prepare both common and po- litical knowledge for real-world entities appearing in news articles. In terms of common knowledge, there are many well-designed knowledge graphs (KG) such as YAGO [54], Freebase [3], and Word- Net [51] built from large-scale real-world datasets, where a node represents an entity and an edge represents a relation between two entities. Among them, we choose YAGO [54] as the source of common knowledge in this work because YAGO consists of general knowledge about real-world entities (e.g., people, cities, countries, movies, and organizations). On the other hand, political knowledge has been rarely studied except for some works [13, 69] that built a single political KG based on the political entities and their relations from U.S. political websites (e.g., AFL-CIO and Heritage Action) Unfortunately, it is challenging to accurately represent the relations among political entities in a single knowledge graph because the interpretation and sentiment to political entities and their relations can be different depending on the political stance. To address this challenge, we (1) collected 496,071 political-related posts from the U.S. political community websites3, (2) extracted 18 political enti- ties, using an NER (named entity recognition) method [64], and (3) constructed two different political knowledge graphs: KG-lib and KG-con, where each data point is represented as a triplet: <head entity, relation, tail entity>. Table 2 shows the statistics of the po- litical knowledge graphs. The details about the knowledge graph construction are included in Appendix A.2. 3https://www.reddit.com/r/Liberal/, https://www.reddit.com/r/Conservative/ WWW '23, April 30-May 4, 2023, Austin, TX, USA Y. Ko et al. Algorithm 1 Knowledge injection of KE Require: news article a, word embeddings W , three types of knowledge embeddings: Kcom, Klib , Kcon, knowledge control factors α, β 1: Initialize W ∗ ← φ 2: for word i ∈ a do 3: 4: 5: 6: e ← W [i] ecom ← (1 − α) * e ⊕ α * Kcom [i] elib ← (1 − β) * ecom ⊕ β * Klib [i] econ ← (1 − β) * ecom ⊕ β * Kcon [i] W ∗ [i] ← Fuse([elib ∥econ]) ⊕ e 7: 8: end for 9: return W ∗ Knowledge embedding. Next, we apply knowledge embedding methods [4, 11, 41, 62, 71], aiming to learn the relations among entities, to the three KGs independently, in order to represent three types of embedding vectors for each entity: Kcom, Klib , and Kcon (i.e., common, liberal, and conservative). Since this work is agnostic to the knowledge embedding method, any knowledge embedding methods could be applied to KE. As the knowledge embedding method, we consider three recent methods: RotatE [62], ModE [71], and HAKE [71]. In this paper, we omit the details of the knowledge embedding methods because it is beyond the scope of this work, but we include the knowledge graph completion accuracies of the three knowledge embedding methods in Appendix A.3. Knowledge injection. As we mentioned in the beginning of Sec- tion 3.3, there is a technical challenge about how to incorporate the three different knowledge into the process of predicting the politi- cal stance of a news article. Specifically, it is difficult to determine (1) how to fuse the three types of knowledge and (2) how much amount of each knowledge is needed, for accurate political stance prediction. To this challenge, we propose a simple but effective knowledge injection algorithm that fuses the three types of knowl- edge for real-world entities and injects them into the corresponding words appearing in a news article. The process of the knowledge injection of KE is illustrated in Fig- ure 2(g) and described in Algorithm 1. For each word in a given ar- ticle, KE first injects the common knowledge of the word (Kcom [i]) into the corresponding word embedding (lines 3-4 in Algorithm 1), where α is the common knowledge control factor and '⊕' means the element-wise addition. Then, we add the political knowledge em- beddings to the common knowledge injected embedding ecom with the political knowledge control factor β independently (lines 5-6). The two embeddings with different political knowledge, elib and econ, are concatenated and passed through a fully-connected layer, Fuse(*) that fuses the two embeddings into a single knowledge- aware embedding (line 7), which plays a role to learn how to fuse the different political knowledge for accurate prediction. We also add the original word embedding to the knowledge-aware embed- ding (i.e., residual connection). As a result, the knowledge-aware word embeddings can be used across the hierarchical news encod- ing process of HAN. We will verify the effectiveness of KE and the impacts of its hyperparameters α and β in improving the political stance prediction accuracy of KHAN in Section 4. Table 3: Statistics of political news article datasets. Dataset # of articles Class distribution SemEval AllSides-S AllSides-L 645 14.7k 719.2k 407 / 238 6.6k / 4.6k / 3.5k 112.4k / 202.9k / 99.6k / 62.6k / 241.5k 4 EXPERIMENTAL VALIDATION In this section, we comprehensively evaluate KHAN by answering the following evaluation questions: • EQ1. To what extent does KHAN improve existing methods in terms of the model accuracy in the political stance prediction? • EQ2. How fast does KHAN converge in terms of time and epochs? • EQ3. How effective are the main components of KHAN in terms of improving the model accuracy in political stance prediction? • EQ4. How sensitive is the model accuracy of KHAN to the hy- perparameters α and β? 4.1 Experimental Setup Datasets. We evaluate KHAN with three real-world news article datasets, SemEval [30], AllSides-S [42], and AllSides-L. Table 3 shows the statistics of the news article datasets. SemEval consists of 645 articles with 2 classes (hyperpartisan and center) and AllSides-S consists of 14,783 articles with 3 classes (left, center, and right). For training, we use 10-fold and 3-fold cross validations for SemEval and AllSides-S, respectively, as the same in previous works [13, 42, 44, 69]. For extensive evaluation, we construct a large-scale political news dataset, AllSides-L with 719,256 articles with 5 classes (left, lean left, center, lean right, and right)4. We split the AllSides-L dataset into training and validation sets: 647,330 articles in the training set and 71,926 articles in the validation set. Baseline methods. We compare KHAN with seven baseline meth- ods: five text-based methods [29, 48, 50, 55, 56] and two knowledge- based political stance prediction methods [13, 69]. Word2Vec [50], GloVe [55], and ELMo [56] are general language models that aim to capture context from text. We also use pre-trained BERT [29] and RoBERTa [48] by fine-tuning on training datasets. KGAP [13] is a knowledge-aware approach that leverages a political knowledge graph with graph neural networks (e.g., R-GCN [59]). KCD [69], the state-of-the-art model, considers knowledge walks from a political knowledge graph and textual cues in political stance prediction. Implementation details. We use PyTorch 1.10.0 to implement all methods including KHAN on Ubuntu 20.04 OS. We run our experiments on the machine equipped with an Intel i7-9700k CPU with 64 GB memory and a NVIDIA RTX 2080 Ti GPU, installed with CUDA 11.3 and cuDNN 8.2.1. We set the batch size b as 16 for all datasets as the same in the previous works [13, 69]. We use the Adam optimizer [32] with the learning rate η = 1e-3 and the weight decay factor 5e-2 for all datasets. As a learning rate scheduler [21, 27, 36], we use the 'ReduceLROnPlateau' scheduler of PyTorch that reduces the learning rate η by 1/2 when the training loss has stopped improving for a 'patience' number of epochs in a row (we set the patience epoch as 5). 4The data construction details for AllSides-L are provided in Appendix A.2. KHAN: Knowledge-Aware Hierarchical Attention Networks for Accurate Political Stance Prediction WWW '23, April 30-May 4, 2023, Austin, TX, USA Table 4: Comparison of the model accuracy on three real- world datasets (The bold font indicates the best results). Method Word2Vec [50] GloVe [55] ELMo [56] BERT [29] RoBERTa [48] KGAP [13] KCD [69] KHAN-RotatE KHAN-HAKE KHAN-ModE Dataset SemEval AllSides-S AllSides-L 0.7027 0.8071 0.8678 0.8692 0.8708 0.8956 0.9087 0.9426 0.9395 0.9521 0.4858 0.7101 0.8197 0.8246 0.8535 0.8602 0.8738 0.9151 0.9216 0.9256 0.4851 0.6354 0.7483 0.7812 0.8222 N/A N/A 0.8584 0.8563 0.8617 4.2 Experimental Results EQs 1-2. Accuracy and Efficiency. In this experiment, we eval- uate the accuracy and efficiency of the proposed KHAN in the political stance prediction. We train KHAN on the three real-world political news article datasets (50 epochs) with varying knowledge embedding methods (RotatE, HAKE, and ModE). For the SemEval and AllSides-L datasets, we apply k-fold cross validations (10-fold for SemEval and 3-fold for AllSides-S). Due to the page limit, we report the averaged accuracy of k-fold cross validations and include the entire results with the standard deviation in Appendix A.3. For AllSides-L, we train KHAN on the training set (647k articles) and measure the model accuracy using the validation set (71.9k articles), which is not used in the training process. As shown in Table 45, KHAN consistently outperforms all base- line methods in terms of the model accuracy, regardless of knowl- edge embedding methods. Specifically, KHAN improves the state- of-the-art method, KCD [69] by 4.77% and 5.92% in SemEval and AllSides-S datasets, respectively. These improvements over KCD are significant, given that KCD has already achieved quite high ac- curacies in those datasets. We also evaluate KHAN on a large-scale dataset (AllSides-L) which is 48× larger and has more classes (i.e., more difficult to predict) than the previous largest one (AllSides-S). KHAN still significantly outperforms all baseline methods although the accuracy of KHAN decreases to some extent in AllSides-L, com- pared with the other datasets. In addition, we have conducted the t-tests with a 95% confidence level and verified that the improve- ment of KHAN over all baseline methods are statistically significant (i.e., the p-values are below 0.05). As a result, KHAN consistently outperforms state-of-the-art methods in all datasets, including a our own dataset (AllSides-L), with a 95% confidence level, which implies that KHAN has a good generalizability. In addition to gen- eralizability, in terms of applicability, KHAN could be applied to other languages since KHAN does not depend on any linguistic features (e.g., word-order and grammatical features). As an example, we have successfully applied KHAN to a web-based platform for diverse political news consumption in non-English. 5For SemEval and AllSides-S, we use the results for baseline methods reported in [69]. We also obtain the results for baseline methods and include them in Appendix A.3. (a) SemEval (b) AllSides-S (c) SemEval (d) AllSides-S Figure 3: The training time and convergence rate with re- spect to training epochs on SemEval and AllSides-S. We also evaluate KHAN in terms of the training time and conver- gence rate with respect to training epoch. Figures 3(a)-(b) represent the training time for 50 epochs of each method and Figures 3(c)-(d) show the validation accuracy of KHAN with respect to the training epoch. KHAN finishes its training in shorter time than ELMo, BERT, and RoBERTa (even faster than GloVe in AllSides-S), while achiev- ing the highest accuracy at the same time. Considering the low accuracies of Word2Vec and GloVe (at least 15% less than KHAN), these results verify the efficiency of KHAN. In terms of conver- gence rate, KHAN converges to high accuracy within only around 40 epochs (Figure 3(c)-(d)). All in all, these results demonstrate that KHAN is able to effectively and efficiently solve the political stance prediction problem by employing the proposed HAN and KE. EQ3. Ablation Study. In this experiment, we verify the effective- ness of the HAN and KE. We compare the four versions of KHAN: • KHAN-W: a baseline with only the word-level attention layer. • KHAN-WS: the version with the word and sentence layers. • KHAN-WST: the version with HAN (word, sentence, and title). • KHAN-All: the original version with both HAN and KE. We train each version of KHAN with varying the embedding dimen- sionality (d = 128, 256, and 512) on SemEval (10-fold) and AllSides-S (3-fold), and measure the accuracy and training time. As shown in Figure 4, KHAN-WS consistently improves KHAN-W in both the accuracy and training performance. This result demonstrates that our hierarchical approach not only (1) (efficiency) requires much less computation overhead than non-hierarchical existing methods, but also (2) (effectiveness) captures the context implicitly reflected in a news article successfully, as we claimed in Section 3.2. KHAN-WST further improves the model accuracy with only a very small amount of overhead, thereby verifying the importance of the title that has the key idea of the news article in political stance prediction. Finally, KHAN-All always achieves the highest accuracy in all cases, regardless of datasets and embedding dimensionality. This result validates that external knowledge for real-world entities appearing in a news article is indeed important in predicting its political stance, as we claimed in Section 3.3. Word2vecGloVeELMoBERTRoBERTaKHAN010020030057115193244262170Traintime(sec.)01k2k3k4k9161,8872,4363,3573,5691,795Traintime(sec.)10203040500.50.60.70.80.91EpochVal.Acc.10203040500.50.60.70.80.91EpochVal.Acc. WWW '23, April 30-May 4, 2023, Austin, TX, USA Y. Ko et al. (a) SemEval (d = 128) (b) SemEval (d = 256) (c) SemEval (d = 512) (d) AllSides-S (d = 128) (e) AllSides-S (d = 256) (f) AllSides-S (d = 512) Figure 4: Effectiveness of the main components of KHAN in terms of the training time (bar) and model accuracy (line). (a) SemEval (d = 128) (d) AllSides-S (d = 256) Figure 5: The impact of hyperparameters α and β on the model accuracy of KHAN in political stance prediction. (c) AllSides-S (d = 128) (b) SemEval (d = 256) EQ4. Hyperparameter sensitivity. Finally, we evaluate the im- pacts of the hyperparameters α and β on the model accuracy of KHAN. As explained in Section 3.3, the hyperparameter α (β) con- trols the amount of common (political) knowledge is injected to the corresponding words in a given news article. Thus, as α (β) becomes lower, the more amount of the common (political) knowl- edge is injected to the entities appearing in a new article. While, as α (β) becomes larger, the less amount of the common (political) knowledge is injected. For an extreme case, if α (β) is 1, the common (political) knowledge is not used. We measure the model accuracy with varying α and β from 0.2 to 1.0 on SemEval and AllSides-S. As clearly illustrated in Figure 5, KHAN with lower β tends to achieve higher accuracy than KHAN with larger β (i.e., the left-hand side of each heatmap tends to be darker than its right-hand side in each row). On the other hand, KHAN with larger α and β shows relatively poor performance in political stance prediction accuracy (i.e, the bottom right side of each heatmap tends to be brighter than other sides). Specifically, KHAN with α = 1 and β = 1 (i.e., both common and political knowledge not used) shows the worst results in the SemEval dataset. These results verify that external knowledge for real-world entities is indeed useful in predicting the political stance of a news article. Note that KHAN with α and β below 0.6 consistently outperforms all baseline methods. Based on these results, we believe that the model accuracy of KHAN is not sensitive to the hyperparameters α and β, and we recommend to set the hyperparameters α and β as below 0.6. 5 CONCLUSION In this paper, via a carefully-designed user study, we observe that both explicit and implicit factors (i.e., the context/tone and external knowledge for real-world entities) are important in predicting the political stances of news articles. Based on the observations, we propose a novel approach to accurate political stance prediction, KHAN that successfully captures the local and global context of a new article with the two key components: (1) hierarchical attention networks (HAN) to learn the relationships among words, sentences, and the title in a news article with the 3-level hierarchy and (2) knowledge encoding (KE) to incorporate the three types of useful knowledge for real-world entities into the process of the political stance prediction. Via the extensive experiments, we demonstrate that (1) (accuracy) KHAN consistently achieves higher accuracies than all baseline methods, (2) (efficiency) KHAN is able to converge to high accuracies within comparable training time (epochs), and (3) (effectiveness) the key components of KHAN (HAN and KE) are quite effective in improving the model accuracy of KHAN. ACKNOWLEDGMENTS This work was supported by the National Research Foundation of Korea (NRF) (2018R1A5A7059549), and Institute of Information & Communications Technology Planning & Evaluation (IITP) (RS- 2022-00155586, 2022-0-00352, 2020-0-01373). Hanghang Tong was partially supported by NSF (1947135, 2134079, and 1939725). KHAN-WKHAN-WSKHAN-WSTKHAN-All0100200300400255.44113.92114.18167.32Traintime(sec.)0.800.850.900.9501002003004002791371451730.800.850.900.9501002003004003772462522690.800.850.900.95Val.Acc.01k2k3k4k2,3131,4961,5151,770Traintime(sec.)0.700.750.800.850.9001k2k3k4k2,7011,9492,0342,2370.700.750.800.850.9001k2k3k4k3,4942,7693,0923,3830.700.750.800.850.90Val.Acc.0.20.40.60.81.0beta0.20.40.60.81.0alpha0.90840.91170.89450.9130.89910.93630.90830.91150.90380.90520.90540.91010.90070.90390.88830.92080.90860.89150.89290.91010.90530.9130.88680.90220.85870.860.880.900.920.940.960.20.40.60.81.0beta0.20.40.60.81.0alpha0.92560.93020.94880.93950.92890.95040.94420.93960.9410.92880.93640.95210.93650.93330.93190.94260.94730.94890.94410.93810.94570.94120.94880.93330.9180.860.880.900.920.940.960.20.40.60.81.0beta0.20.40.60.81.0alpha0.90530.90670.91410.92220.90130.90670.91820.9060.91140.89050.92560.89990.92490.91210.89860.92490.90870.90870.91820.9060.92020.91140.9080.90670.90670.800.820.840.860.880.900.920.20.40.60.81.0beta0.20.40.60.81.0alpha0.88570.87690.86950.85130.86070.89450.89180.86540.8810.86950.90870.91010.85260.88170.87960.90060.89720.89050.86880.88710.88780.88510.86210.89720.85940.800.820.840.860.880.900.92 KHAN: Knowledge-Aware Hierarchical Attention Networks for Accurate Political Stance Prediction WWW '23, April 30-May 4, 2023, Austin, TX, USA REFERENCES [1] Christopher A Bail, Lisa P Argyle, Taylor W Brown, John P Bumpus, Haohan Chen, MB Fallin Hunzaker, Jaemin Lee, Marcus Mann, Friedolin Merhout, and Alexander Volfovsky. 2018. Exposure to opposing views on social media can increase political polarization. The National Academy of Sciences 115, 37 (2018), 9216–9221. [2] Eytan Bakshy, Solomon Messing, and Lada A Adamic. 2015. Exposure to ideologi- cally diverse news and opinion on Facebook. Science 348, 6239 (2015), 1130–1132. [3] Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. 2008. Freebase: a collaboratively created graph database for structuring human knowl- edge. In Proceedings of the ACM SIGMOD international conference on Management of data (SIGMOD). 1247–1250. [4] Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Ok- sana Yakhnenko. 2013. Translating embeddings for modeling multi-relational data. Advances in neural information processing systems 26 (2013). [5] Junyi Chen, Lan Du, Ming Liu, and Xiabing Zhou. 2022. Mulan: A Multiple Resid- ual Article-Wise Attention Network for Legal Judgment Prediction. Transactions on Asian and Low-Resource Language Information Processing 21, 4 (2022), 1–15. [6] Minmin Chen. 2017. Efficient Vector Representation for Documents through Corruption. In Proceedings of International Conference on Learning Representa- tions(Poster). [7] Matteo Cinelli, Gianmarco De Francisci Morales, Alessandro Galeazzi, Walter Quattrociocchi, and Michele Starnini. 2021. The echo chamber effect on social media. Proceedings of the National Academy of Sciences 118, 9 (2021), e2023301118. [8] Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. 2020. ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators. In Proceedings of International Conference on Learning Representations. [9] Wesley Cota, Silvio C Ferreira, Romualdo Pastor-Satorras, and Michele Starnini. 2019. Quantifying echo chamber effects in information spreading over political communication networks. EPJ Data Science 8, 1 (2019), 1–13. [10] Lincoln Dahlberg. 2001. The Internet and democratic discourse: Exploring the prospects of online deliberative forums extending the public sphere. Information, communication & society 4, 4 (2001), 615–633. [11] Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. 2018. Convolutional 2d knowledge graph embeddings. In Proceedings of the AAAI conference on artificial intelligence, Vol. 32. [12] Jiachen Du, Ruifeng Xu, Yulan He, and Lin Gui. 2017. Stance classification with target-specific neural attention networks. International Joint Conferences on Artificial Intelligence. [13] Shangbin Feng, Zilong Chen, Wenqian Zhang, Qingyao Li, Qinghua Zheng, Xiaojun Chang, and Minnan Luo. 2021. KGAP: Knowledge Graph Augmented Political Perspective Detection in News Media. arXiv preprint arXiv:2108.03861 (2021). [14] Seth Flaxman, Sharad Goel, and Justin M Rao. 2016. Filter bubbles, echo chambers, and online news consumption. Public opinion quarterly 80, S1 (2016), 298–320. [15] Kiran Garimella, Gianmarco De Francisci Morales, Aristides Gionis, and Michael Mathioudakis. 2018. Political discourse on social media: Echo chambers, gate- keepers, and the price of bipartisanship. In Proceedings of the 2018 world wide web conference. 913–922. [16] R Kelly Garrett and Paul Resnick. 2011. Resisting political fragmentation on the Internet. Daedalus 140, 4 (2011), 108–120. [17] Suyu Ge, Chuhan Wu, Fangzhao Wu, Tao Qi, and Yongfeng Huang. 2020. Graph enhanced representation learning for news recommendation. In Proceedings of The Web Conference 2020. 2863–2869. [18] Matthew Gentzkow and Jesse M Shapiro. 2010. What drives media slant? Evidence from US daily newspapers. Econometrica 78, 1 (2010), 35–71. [19] Nabeel Gillani, Ann Yuan, Martin Saveski, Soroush Vosoughi, and Deb Roy. 2018. Me, my echo chamber, and I: introspection on social media polarization. In Proceedings of the 2018 World Wide Web Conference. 823–831. [20] Swapna Gottopati, Minghui Qiu, Yanchuan Sim, Jing Jiang, and Noah Smith. 2013. Learning topics and positions from debatepedia. Association for Computational Linguistics. [21] Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. 2017. Accu- arXiv preprint rate, Large Minibatch SGD: Training Imagenet in 1 Hour. arXiv:1706.02677 (2017). [22] Soeun Han, Yunyong Ko, Yushim Kim, Seong Soo Oh, Heejin Park, and Sang- Wook Kim. 2022. D-FEND: A Diffusion-based Fake News Detection Framework for News Articles Related to COVID-19. In Proceedings of the 37th ACM/SIGAPP Symposium on Applied Computing (ACM SAC). 1771–1778. [23] Taha Hassan. 2019. Trust and trustworthiness in social recommender systems. In Companion Proceedings of The 2019 World Wide Web Conference. 529–532. [24] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition. 770–778. [25] Judith Irvine, Bambi Schieffelin, CM Series, Marjorie Harness Goodwin, Joel Kuipers, Don Kulick, John Lucy, Elinor Ochs, et al. 1992. Rethinking context: Language as an interactive phenomenon. Number 11. Cambridge University Press. [26] Youngseung Jeon, Bogoan Kim, Aiping Xiong, Dongwon Lee, and Kyungsik Han. 2021. ChamberBreaker: Mitigating the Echo Chamber Effect and Supporting Information Hygiene through a Gamified Inoculation System. Proceedings of the ACM on Human-Computer Interaction 5, CSCW2 (2021), 1–26. [27] Tyler Johnson, Pulkit Agrawal, Haijie Gu, and Carlos Guestrin. 2020. AdaScale SGD: A User-Friendly Algorithm for Distributed Training. In Proceedings of the International Conference on Machine Learning (ICML). PMLR, 4911–4920. [28] Mozhgan Karimi, Dietmar Jannach, and Michael Jugovac. 2018. News recom- mender systems–Survey and roads ahead. Information Processing & Management 54, 6 (2018), 1203–1227. [29] Jacob Devlin Ming-Wei Chang Kenton and Lee Kristina Toutanova. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of NAACL-HLT. 4171–4186. [30] Johannes Kiesel, Maria Mestre, Rishabh Shukla, Emmanuel Vincent, Payam Adineh, David Corney, Benno Stein, and Martin Potthast. 2019. Semeval-2019 task 4: Hyperpartisan news detection. In Proceedings of the 13th International Workshop on Semantic Evaluation. 829–839. [31] Taeho Kim, Yungi Kim, Yeon-Chang Lee, Won-Yong Shin, and Sang-Wook Kim. 2022. Is It Enough Just Looking at the Title? Leveraging Body Text To Enrich Title Words Towards Accurate News Recommendation. In Proceedings of the 31st ACM International Conference on Information and Knowledge Management (CIKM). 4138–4142. [32] Diederik P Kingma and Jimmy Ba. 2015. Adam: A Method for Stochastic Op- timization. In Proceedings of International Conference on Learning Representa- tions(Poster). [33] Yunyong Ko, Dong-Kyu Chae, and Sang-Wook Kim. 2016. Accurate path-based methods for influence maximization in social networks. In Proceedings of the ACM Web Conference (WWW). 59–60. [34] Yunyong Ko, Dong-Kyu Chae, and Sang-Wook Kim. 2018. Influence maximisation in social networks: A target-oriented estimation. Journal of Information Science 44, 5 (2018), 671–682. [35] Yunyong Ko, Kyung-Jae Cho, and Sang-Wook Kim. 2018. Efficient and effective Information influence maximization in social networks: a hybrid-approach. Sciences 465 (2018), 144–161. [36] Yunyong Ko, Dongwon Lee, and Sang-Wook Kim. 2022. Not All Layers Are Equal: A Layer-Wise Adaptive Approach Toward Large-Scale DNN Training. In Proceedings of the ACM Web Conference (WWW). 1851–1859. [37] Travis Kriplean, Jonathan Morgan, Deen Freelon, Alan Borning, and Lance Ben- nett. 2012. Supporting reflective public thought with considerit. In Proceedings of the ACM 2012 conference on Computer Supported Cooperative Work. 265–274. [38] Arie W Kruglanski. 1996. Motivated social cognition: Principles of the interface. (1996). [39] Margot Kuttschreuter, Jan Martien Gutteling, and Maureen De Hond. 2011. Fram- ing and tone-of-voice of disaster media coverage: The aftermath of the Enschede fireworks disaster in the Netherlands. Health, risk & society 13, 3 (2011), 201–220. [40] Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. 2019. ALBERT: A Lite BERT for Self-supervised Learning of Language Representations. In Proceedings of International Conference on Learning Representations. [41] Yeon-Chang Lee, JaeHyun Lee, Dongwon Lee, and Sang-Wook Kim. 2022. THOR: Self-Supervised Temporal Knowledge Graph Embedding via Three-Tower Graph Convolutional Networks. In Proceedings of the IEEE International Conference on Data Mining (ICDM). 1035–1040. [42] Chang Li and Dan Goldwasser. 2019. Encoding social information with graph convolutional networks forpolitical perspective detection in news media. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. 2594–2604. [43] Chang Li and Dan Goldwasser. 2021. Mean: Multi-head entity aware attention networkfor political perspective detection in news media. In Proceedings of the Fourth Workshop on NLP for Internet Freedom: Censorship, Disinformation, and Propaganda. Association for Computational Linguistics, 66–75. [44] Chang Li and Dan Goldwasser. 2021. Using social and linguistic information to adapt pretrained representations for political perspective identification. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021. 4569– 4579. [45] Q Vera Liao and Wai-Tat Fu. 2014. Can you hear me now? Mitigating the echo chamber effect by source position indicators. In Proceedings of the 17th ACM conference on Computer supported cooperative work & social computing. 184–196. [46] Q Vera Liao, Wai-Tat Fu, and Sri Shilpa Mamidi. 2015. It is all about perspective: An exploration of mitigating selective exposure with aspect indicators. In Proceedings of the 33rd annual ACM conference on Human factors in computing systems. 1439– 1448. [47] Wei-Hao Lin, Theresa Wilson, Janyce Wiebe, and Alexander G Hauptmann. 2006. Which side are you on? Identifying perspectives at the document and sentence levels. In Proceedings of the Tenth Conference on Computational Natural Language Learning (CoNLL-X). 109–116. [48] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A WWW '23, April 30-May 4, 2023, Austin, TX, USA Y. Ko et al. robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692 (2019). [49] Gabriel Machado Lunardi. 2019. Representing the filter bubble: Towards a model to diversification in news. In Proceedings of the 19th International Conference on Conceptual Modeling. Springer, 239–246. [50] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781 (2013). [51] George A Miller. 1995. WordNet: a lexical database for English. Commun. ACM 38, 11 (1995), 39–41. [52] Sean Munson, Stephanie Lee, and Paul Resnick. 2013. Encouraging reading of diverse political viewpoints with a browser widget. In Proceedings of The International AAAI Conference on Web and Social Media, Vol. 7. 419–428. [53] Matti Nelimarkka, Jean Philippe Rancy, Jennifer Grygiel, and Bryan Semaan. 2019. (Re) Design to Mitigate Political Polarization: Reflecting Habermas' ideal communication space in the United States of America and Finland. Proceedings of the ACM on Human-computer Interaction 3, CSCW (2019), 1–25. [54] Thomas Pellissier Tanon, Gerhard Weikum, and Fabian Suchanek. 2020. Yago 4: A reason-able knowledge base. In Proceedings of the European Semantic Web Conference. Springer, 583–596. [55] Jeffrey Pennington, Richard Socher, and Christopher D Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP). 1532–1543. [56] Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep Contextualized Word Rep- resentations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers). Association for Computational Linguistics, New Orleans, Louisiana, 2227–2237. https://doi.org/10.18653/v1/N18-1202 [57] Walter Quattrociocchi, Antonio Scala, and Cass R Sunstein. 2016. Echo chambers on Facebook. Available at SSRN 2795110 (2016). [58] Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever, et al. 2018. Improving language understanding by generative pre-training. (2018). [59] Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. 2018. Modeling relational data with graph convolutional networks. In European semantic web conference. Springer, 593–607. [60] Kai Shu, Amy Sliva, Suhang Wang, Jiliang Tang, and Huan Liu. 2017. Fake news detection on social media: A data mining perspective. ACM SIGKDD explorations newsletter 19, 1 (2017), 22–36. [61] Qingying Sun, Zhongqing Wang, Qiaoming Zhu, and Guodong Zhou. 2018. Stance detection with hierarchical attention network. In Proceedings of the 27th Interna- tional Conference on Computational Linguistics. 2399–2409. [62] Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. 2018. RotatE: Knowl- edge Graph Embedding by Relational Rotation in Complex Space. In Proceedings of International Conference on Learning Representations. [63] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems 30 (2017). [64] Sergey Vychegzhanin and Evgeny Kotelnikov. 2019. Comparison of named entity recognition tools applied to news articles. In 2019 Ivannikov Ispras Open Conference (ISPRAS). IEEE, 72–77. [65] Hongwei Wang, Fuzheng Zhang, Xing Xie, and Minyi Guo. 2018. DKN: Deep knowledge-aware network for news recommendation. In Proceedings of the 2018 world wide web conference. 1835–1844. [66] Hong Wei, Hao Zhou, Jangan Sankaranarayanan, Sudipta Sengupta, and Hanan Samet. 2018. Residual convolutional lstm for tweet count prediction. In Compan- ion Proceedings of the Web Conference 2018 (TheWebConf). 1309–1316. [67] Chuhan Wu, Fangzhao Wu, Mingxiao An, Jianqiang Huang, Yongfeng Huang, and Xing Xie. 2019. NPA: neural news recommendation with personalized attention. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining. 2576–2584. [68] Savvas Zannettou, Barry Bradlyn, Emiliano De Cristofaro, Haewoon Kwak, Michael Sirivianos, Gianluca Stringini, and Jeremy Blackburn. 2018. What is gab: A bastion of free speech or an alt-right echo chamber. In Companion Proceedings of the The Web Conference 2018. 1007–1014. [69] Wenqian Zhang, Shangbin Feng, Zilong Chen, Zhenyu Lei, Jundong Li, and Minnan Luo. 2022. KCD: Knowledge Walks and Textual Cues Enhanced Political Perspective Detection in News Media. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL): Human Language Technologies. Association for Computational Linguistics, 4129– 4140. [70] Xuanyu Zhang, Qing Yang, and Dongliang Xu. 2021. Combining explicit entity graph with implicit text information for news recommendation. In Companion Proceedings of the Web Conference 2021. 412–416. [71] Zhanqiu Zhang, Jianyu Cai, Yongdong Zhang, and Jie Wang. 2020. Learning hierarchy-aware knowledge graph embeddings for link prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34. 3065–3072. [72] Yu Zheng, Chen Gao, Liang Chen, Depeng Jin, and Yong Li. 2021. DGCN: Diver- sified Recommendation with Graph Convolutional Networks. In Proceedings of the Web Conference 2021. 401–412. [73] Qiannan Zhu, Xiaofei Zhou, Zeliang Song, Jianlong Tan, and Li Guo. 2019. Dan: Deep attention neural network for news recommendation. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 33. 5973–5980. [74] Cai-Nicolas Ziegler, Sean M McNee, Joseph A Konstan, and Georg Lausen. 2005. Improving recommendation lists through topic diversification. In Proceedings of the 14th international conference on World Wide Web (WWW). 22–32. KHAN: Knowledge-Aware Hierarchical Attention Networks for Accurate Political Stance Prediction WWW '23, April 30-May 4, 2023, Austin, TX, USA A APPENDIX In this appendix, we describe the detailed information of our user study (Appendix A.1), data construction (Appendix A.2), and the additional experimental results about the reliability of our experi- ments about political stance prediction (Appendix A.3). A.1 User Study In this section, we describe the details of our user study to investi- gate the important factors that real-world users take into account to determine the political stance of a news articles. Setup. We have recruited 136 respondents in total from Amazon Mechanical Turk6. For a fair and reliable user study, we chose the respondents considering a variety of aspects such as gender (male/female), age (from below 20 to above 50), education (from high school or less, to university graduation and above), ethnicity (e.g., Caucasian, African American, Asian, Hispanic/Latino, and Others) and political stance (very liberal, somewhat liberal, neutral, somewhat conservative, very conservative). We selected six news articles with different political stances and thirteen political-related factors. Regarding the topic of a news article, we considered three different news topics which are highly related to political stances (i.e., Health, Environment, and Tax)7. For political-related factors, we carefully chose thirteen factors in total, which have been studied in [18, 20, 25, 39, 47], such as context/tone, keywords, person names, topic/issue, title, images of a news article, slang words used in an article, and social/religious factors. User study protocol. Then, we (1) provided the six news articles (the title, body, and image) and the thirteen carefully-chosen factors to the respondents, (2) asked them to respond how important each factor is in their decision with a scale [1:(not at all) - 5:(very much)], and (3) assessed each factor for political stance identification by averaging the scores rated by the respondents. Table 5: Result of the user study: the top-5 factors in political stance predictions and their importance scores. Rank Factor name 1 2 3 4 5 Context Keyword Person Tone Freq. used word Importance score (1-5) 4.19 ± 0.94 4.01 ± 0.88 3.94 ± 0.96 3.93 ± 1.13 3.35 ± 1.07 Result and analysis. Table 5 shows the top-5 important factors in political stance prediction and their scores. This result shows that the "context" of a new article is the most important factor in deciding its political stance, followed by keyword, person, tone, and frequently used word. This user study result implies that it is crucial (1) to learn the relationships among words/sentences to capture the context and tone of a news article, which is implicitly reflected in a news article, and (2) to understand the interpretation and sentiment to real-world entities (e.g., keyword and person), which explicitly appear in a news article. A.2 Data Construction In this section, we describe the process of data construction for our datasets: (1) a large-scale political news datasets (AllSides-L) and (2) two political knowledge graphs (KG-lib and KG-con). All the datasets are available at: https://github.com/yy-ko/khan-www23. AllSides-L. As explained in 4.1, we constructed a large-scale polit- ical news dataset, AllSides-L. We collected 719,256 articles with 5 classes (left, lean left, center, lean right, and right) from All- sides.com 8, which is an American website to alleviate side effects by media bias and misinformation. Allsides.com provides political- related news articles with diverse political stances, where it decides the political class (e.g., left or right) of each news article based on its news outlet (e.g., CNN or Fox). For the political label decision, Allsides.com uses the three-step process: Each news outlet is la- beled by (1) domain experts, (2) user studies by average people with diverse political stances, and (3) majority voting by others who do not engage in the user studies. Thanks to its careful labeling, the political stances of news articles by Allsides.com are generally used as the ground truth [13, 69]. For the more reliability of AllSides-L, we consider only the news articles from the outlets receiving high scores (7-out-of-8 or better) on their labels at majority voting. KG-lib and KG-con. We constructed two different political knowl- edge graphs (KGs), KG-lib and KG-con, via a three-step process: (1) data collection, (2) entity/relation extraction, and (3) data cleansing. We first collected 219,915 posts and 276,156 posts from the U.S. liberal and conservative communities, respectively (496,071 posts in total). Since the raw posts could include many political-unrelated entities, we need to extract political entities and their relations from the raw posts. To this end, we extracted 18 political-related entities and their relations, using a state-of-the-art NER (Named Entity Recognition) method [64]. Via this step, each data point is represented as a triplet: <head entity, relation, tail entity>. For more reliability of the political knowledge graphs, we manually re- move noises from the extracted triplets. Finally, we constructed the two political knowledge graphs, KG-lib (5,581 entities and 29,967 relations) and KG-con (6,316 entities and 33,207 relations). Quality of the political knowledge graphs. We also evaluate the quality of our political knowledge graphs. As explained in Sec- tion 3.3, we use three recent knowledge embedding methods to KE: RotatE [62], ModE [71], and HAKE [71]. We apply each knowl- edge embedding method to the two political knowledge graphs (i.e., KG-lib and KG-con) with varying the embedding dimensionality (d = 128, 256, 512), and measure the quality of knowledge graphs by using five knowledge graph completion metrics: MR (mean rank), MMR (mean reciprocal rank), HITS@1, HITS@3, and HITS@10. Tables 6, 7, and 8 show the results. The quality of the political knowledge embedding tends to be improved as the dimensionality of embedding increases. Note that the quality of political knowledge embeddings could be improved in two aspects: (1) extending the scale of political knowledge graphs (KG) and (2) developing a new knowledge embedding method specialized in the political stance prediction. In future work, we plan to extend the scale of political knowledge graphs and study to design a new model architecture, specialized in capturing the relations among political entities. 6https://www.mturk.com/ 7The six news articles are available at https://github.com/yy-ko/khan-www23. 8https://www.allsides.com/ WWW '23, April 30-May 4, 2023, Austin, TX, USA Y. Ko et al. Metric d = 128 d = 256 d = 512 d = 128 d = 256 d = 512 Method SemEval Validation Acc. Reported Acc. Table 6: The knowledge graph (KG) completion accuracy of RotatE [62] on KG-lib and KG-con. RotatE Metric KG-lib KG-con d = 128 d = 256 d = 512 d = 128 d = 256 d = 512 MR MRR HITS@1 HITS@3 HITS@10 632.69 0.1312 0.0842 0.1316 0.2133 573.84 0.1700 0.1089 0.1801 0.2859 567.85 0.1859 0.1209 0.1985 0.3148 728.78 0.1079 0.0692 0.1059 0.1743 654.26 0.1494 0.0974 0.1549 0.2429 640.45 0.1633 0.1093 0.1693 0.2625 Table 7: The knowledge graph (KG) completion accuracy of ModE [71] on KG-lib and KG-con. ModE KG-lib KG-con MR MRR HITS@1 HITS@3 HITS@10 690.14 0.1312 0.0842 0.1316 0.2133 622.40 0.1700 0.1089 0.1801 0.2859 645.23 0.1859 0.1209 0.1985 0.3148 777.11 0.1128 0.0685 0.1127 0.1981 740.88 0.1354 0.0801 0.1404 0.2458 723.90 0.1501 0.0913 0.1567 0.2648 Table 8: The knowledge graph (KG) completion accuracy of HAKE [71] on KG-lib and KG-con. HAKE Metric KG-lib KG-con d = 128 d = 256 d = 512 d = 128 d = 256 d = 512 MR MRR HITS@1 HITS@3 HITS@10 593.76 0.1474 0.0904 0.1541 0.2595 597.58 0.1688 0.1102 0.1761 0.2844 606.03 0.1787 0.1167 0.1895 0.3013 694.30 0.1311 0.0831 0.1348 0.2205 684.55 0.1498 0.0992 0.1550 0.2434 685.92 0.1639 0.1120 0.1704 0.2612 A.3 Reliability of Experiments In this section, we verify the reliability of the experimental results, used in our empirical evaluation (EQ1. Accuracy in Section 4.2). Evaluation protocol. As mentioned in Section 4.2, we compare the model accuracy of KHAN with the experimental results of the seven baseline methods, which have been reported in [69], on the two widely used datasets (i.e., SemEval and AllSides-S). To evalu- ate the reliability of the accuracy of KHAN, we (1) implement the five baseline language models, using their available codes, with a softmax layer for the final political stance prediction, (2) perform the baseline methods on the SemEval and AllSides-S datasets, (3) measure their political stance prediction accuracies, and (4) com- pare the results (i.e., Validation Acc.) with the reported results (i.e., Reported Acc.). For KGAP [13] and KCD [69], however, we cannot obtain the results because some parts of their source codes are not provided. More specifically, the source code to generate the cue em- beddings for KCD and the source code to generate the knowledge embeddings for KGAP are missing, respectively.9. Result and analysis. Tables 9 and 10 show the averaged accuracy and standard deviation of each method and the reported results [69] on SemEval and AllSides-S. The results that we obtain (i.e., Val- idation Acc.) are quite similar as (sometimes higher than) those reported in [69] (i.e., Reported Acc.). Based on these results, we believe that our evaluation protocol and experimental results could be justified and reliable. As a result, considering that KHAN consis- tently outperforms all baseline methods with a very low standard deviation, our experimental results demonstrate the superiority of KHAN over existing political stance prediction methods. Table 9: Comparison of our experimental results with the reported results [69] on SemEval (The bold font indicates the results better than the reported results). Word2Vec GloVe ELMo BERT RoBERTa KGAP KCD 0.7076 ± 0.0104 0.8077 ± 0.0251 0.8666 ± 0.0197 0.8769 ± 0.0156 0.8923 ± 0.0112 N/A N/A KHAN-RotatE KHAN-HAKE KHAN-ModE 0.9426 ± 0.0258 0.9395 ± 0.0290 0.9521 ± 0.0183 0.7027 0.8071 0.8678 0.8692 0.8708 0.8956 0.9087 N/A N/A N/A Table 10: Comparison of our experimental results with the reported results [69] on AllSides-S (The bold font indicates the results better than the reported results). AllSides-S Validation Acc. Reported Acc. Method Word2Vec GloVe ELMo BERT RoBERTa KGAP KCD 0.4977 ± 0.0082 0.6978 ± 0.0204 0.8085 ± 0.0178 0.8201 ± 0.0101 0.8682 ± 0.0081 N/A N/A KHAN-RotatE KHAN-HAKE KHAN-ModE 0.9151 ± 0.0105 0.9216 ± 0.0041 0.9256 ± 0.0098 0.4858 0.7101 0.8197 0.8246 0.8535 0.8602 0.8738 N/A N/A N/A 9KGAP: https://github.com/BunsenFeng/news_stance_detection, KCD: https://github. com/Wenqian-Zhang/KCD
http://arxiv.org/abs/2302.12260v2
2023-04-04T16:00:35
2023-02-23T16:08:39
Solving differential equations using physics informed deep learning: a hand-on tutorial with benchmark tests
We revisit the original approach of using deep learning and neural networks to solve differential equations by incorporating the knowledge of the equation. This is done by adding a dedicated term to the loss function during the optimization procedure in the training process. The so-called physics-informed neural networks (PINNs) are tested on a variety of academic ordinary differential equations in order to highlight the benefits and drawbacks of this approach with respect to standard integration methods. We focus on the possibility to use the least possible amount of data into the training process. The principles of PINNs for solving differential equations by enforcing physical laws via penalizing terms are reviewed. A tutorial on a simple equation model illustrates how to put into practice the method for ordinary differential equations. Benchmark tests show that a very small amount of training data is sufficient to predict the solution when the non linearity of the problem is weak. However, this is not the case in strongly non linear problems where a priori knowledge of training data over some partial or the whole time integration interval is necessary.
[ "Hubert Baty", "Leo Baty" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12260v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12260v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Solving differential equations using physics informed deep learning: a hand-on tutorial with benchmark tests Hubert Baty1a , L ́eo Baty2 1Observatoire Astronomique, Universit ́e de Strasbourg, 67000 Strasbourg, France 2CERMICS, Ecole des Ponts, Marne-la-Vall ́ee, France (Dated: April 5, 2023) Abstract We revisit the original approach of using deep learning and neural networks to solve differential equations by incorporating the knowledge of the equation. This is done by adding a dedicated term to the loss function during the optimization procedure in the training process. The so-called physics-informed neural networks (PINNs) are tested on a variety of academic ordinary differential equations in order to highlight the benefits and drawbacks of this approach with respect to standard integration methods. We focus on the possibility to use the least possible amount of data into the training process. The principles of PINNs for solving differential equations by enforcing physical laws via penalizing terms are reviewed. A tutorial on a simple equation model illustrates how to put into practice the method for ordinary differential equations. Benchmark tests show that a very small amount of training data is sufficient to predict the solution when the non linearity of the problem is weak. However, this is not the case in strongly non linear problems where a priori knowledge of training data over some partial or the whole time integration interval is necessary. 3 2 0 2 r p A 4 ] G L . s c [ 2 v 0 6 2 2 1 . 2 0 3 2 : v i X r a a Corresponding author: [email protected] 1 I. INTRODUCTION Neural networks (NN) are widely used to solve problems in a variety of domains including computer vision, language processing, game theory, etc., as one can see in Le Cun et al. (2015) and references therein. The use of machine learning approaches in the field of scientific computing including differential equations is relatively recent. Indeed, the idea of leveraging prior knowledge of the physics in the learning process of a NN network was introduced by Raissi et al. (2017, 2019). Among other things, NN are a tool that can be used for supervised learning, one of the main machine learning settings. Supervised learning consists in finding a mapping function between given input objects and their associated output values. This is done by using knowledge about a dataset containing several input/output pairs. This dataset is used to parameterize the NN such that it minimizes the error between solutions predicted by the NN and true known solutions in the dataset. The convergence is achieved by minimizing a loss function which expression is based on the mean squared error. Finding "good" parameters is achieved by solving an optimization problem using a gradient algorithm that relies on automatic differentiation to back-propagate gradients through the network (Baydin et al. 2018). In the case of differential equations, we can apply the supervised learning setting. Indeed, solving a given differential equation comes down to finding a mapping function between some physical input variable values (position, time, . . . ) and a corresponding unknown physical quantity which is the solution of the equation. Hence, by training a NN we can obtain a non-linear approximation of the solution, which can be used to instantaneously predict the equation's solution at any given input point. However, a first strong limitation comes from the impossibility to extrapolate the desired solution for input variable values situated outside the range of the training data. In other words, the NN is a bad extrapolation function. Second, a minimum amount of training data is required, otherwise, wrong solutions or even absence of convergence can occur during the training process. In order to tackle these limitations, classical NN can be enhanced by giving it additional information corresponding to the physics. These approaches are generally called physics- informed neural networks (PINNs), in the context of simulating physical and engineering systems modeled by differential equations. The method consists in evaluating the solution at 2 some other set of data points (called collocation points) at which the estimated solution must ensure the equations. A new loss function corresponding to the physics is thus defined and added to the previous one in the learning process. In other words, the training is penalized by this additional constraint. The space of available solutions is thus restricted, being partly driven by the original data and also partly driven by the physics. When solving partial differential equations (PDEs), one is particularly interested in using only a very minimal known data set, as for example the solution on the boundary and at the initial time. Then, in this sense, the PINNs approach can be said to be mostly physically-driven, as opposed to data-driven. In this work, we focus on such motivation, even if PINNs can also be used for many other aims like inverse or physics discovery problems (see the discussion and conclusion in the last section). One can also refer to Cuomo et al. (2022) and Karniadakis et al. (2021) for reviews. The paper is organized as follows. We first review the basics of PINNs for PDEs in Section 2. Section 3 is devoted to a tutorial of the method to solve a simple first order ordinary equation. The results of benchmark tests performed on a series of different academic ordinary differential equations (with increasingly non-linearity) are presented in Section 4. Finally, a discussion and conclusions are drawn in Section 5, with a particular attention on highlighting the advantages and drawbacks of the PINN approach versus standard integration schemes. II. PHYSICS-INFORMED NEURAL NETWORKS A. The basics of PINNs for PDE We consider a partial differential equation (PDE) written in the following residual form F(x, t, ux, ut, ...) = 0, x ∈ Ω, t ∈ [t0, T ] , (1) with the imposed initial condition u(x, t0) = u0(x). A boundary condition must be also specified as, u(x, t) = uΓ(t) for x ∈ ∂Ω (a Dirichlet-like condition is chosen for simplic- ity). Ω and ∂Ω represent the spatial domain and associated contour, respectively. The variables x ∈ Rd (d being a spatial dimension) and t ∈ R denote the spatial coordinate and time, respectively. Note that higher order differential operators can be also included in correspondence with multidimensional system of equations instead of Equation 1. 3 We introduce a neural network approximating the desired solution u(x, t) of the PDE with ˆuθ (cid:39) u, where θ is a set of model parameters. An artificial feed forward neural network is taken (see Figure 1), with neurons organized in different layers in order to perform calculations in a sequential way. A single input layer containing the input variables (x, t) is connected to a few hidden layers (two layers with four neurons in the schematic example of Figure 1), and finally to an output layer for the solution ˆuθ. Neurons are only connected in adjacent layers, and are not linked inside each layer. The neural network of L + 1 layers is a non linear approximation function, N L(z), that can be expressed recursively as follows. The input vector is denoted by z ∈ Rd i , with di = d + 1, as it includes the spatio-temporal coordinates (x, t). Thus, N 0(z) = z. For the hidden layers (1 ≤ l ≤ L − 1), we have N l(z) = σ(W lN l−1(z) + bl), (2) (3) where we denote the weight matrix and bias vector in the l-th layer by W l ∈ Rdl−1×dl and bl ∈ Rdl (dl being the dimension of the input vector for the l-th layer). σ(.) is a non linear activation function, which is applied element-wisely. In this work, me choose the most commonly used hyperbolic tangent tanh function. For the (final) output layer, we get N L(z) = W LN L−1(z) + bL, (4) and finally ˆuθ(x, t) = N L(z). The network can be also written as a sequence of non linear functions ˆuθ(x, t) = (N L ◦ N L−1... N 0)(x, t), (5) where the operator ◦ denotes the composition and θ = {W l, bl}l=1,L represents the trainable parameters (weight matrices and bias vectors) of the network. The goal is to calibrate its parameters θ such that ˆuθ approximates the target solution u(x, t). B. The training of PINNs for PDE The resolution of the PDE is reduced to an optimization problem as follows, and as schematized in Figure 1. We first assume that a set of Ndata data is available for the known data, ui solution at different times, i.e. {ti that are the training data, which data}Ndata data, xi i=1 4 FIG. 1. Schematic representation of the structure for a Physics-Informed Neural Network applied to the resolution of a differential equation. The input layer has two input variables (i.e. two neurons) noted x1 and x2 representing for example a space and a time coordinate respectively. Two hidden layers with four neurons per layer are connected with the input and the output layer, where the latter has a single variable (one neuron) representing the desired solution ˆuθ. include the initial condition. A corresponding loss function Ldata (using the mean square error formulation) can be deduced from the residual as Ldata(θ) = 1 Ndata Ndata(cid:88) i=1 (cid:13) (cid:13) ˆuθ(zi) − ui data (cid:13) 2 . (cid:13) (6) In a similar way, defining a loss function Lb corresponding to the knowledge of the boundary condition, we have Lb(θ) = 1 Nb Nb(cid:88) i=1 (cid:13) (cid:13) ˆuθ(zi) − ui b (cid:13) 2 , (cid:13) (7) where a set of Nb known data is imposed via {ti b, xi b, ui b}Nb i=1. Finally, another loss function for the equation itself can be also obtained as, LF (θ) = 1 Nc Nc(cid:88) i=1 (cid:107) F( ˆuθ(zi))(cid:107)2 , (8) that must be evaluated on a set of Nc data points (generally called collocation points) as explained below. Indeed, one advantage of the neural network approach is given by the possibility to evaluate exactly the differential operators at the collocation points in LF and F by using automatic differentiation. The automated differentiation is also used to compute 5 derivatives with respect to the network weights (i.e. θ), that is necessary to implement the optimization procedure (see below). Note that in this way, the derivatives can be obtained at machine precision, contrary to the use of some standard numerical scheme. Moreover, the latter operations are greatly facilitated by Python open source software libraries like Tensorflow or Pytorch. A composite loss function is generally formed as L(θ) = ωdataLdata(θ) + ωbLb(θ) + ωF LF (θ), (9) where an optimal choice of values for hyper-parameters (ωdata, ωb, ωF ) allow to ameliorate the eventual unbalance between the partial losses during the training process. These weights can be user-specified or automatically tuned. In the present work, for simplicity we fix the ωdata value to be constant and equal to unity, and the other weight parameters are determined with values varying from case to case. A gradient descent algorithm is used until convergence towards the minimum is obtained for a predefined accuracy (or a given maximum iteration number) as θi+1 = θi − η∇θL(θi), (10) for the i-th iteration also called epoch in the literature, leading to θ∗ = argminθ L(θ), where η is known as the learning rate parameter. In this work, we choose the well known Adam optimizer. A standard automatic differentiation technique is necessary to compute derivatives (i.e. ∇θ) with respect to the NN parameters (e.g. weights and biases) of the model (Raissi et el. 2019). C. The ODE case In this study, we focus on ordinary differential equations (ODE). Thus, the spatial de- pendence is ignored in Equation 1, and we are left with a desired solution u(t) and its approximation ˆuθ(t). The input first layer of the neural network is supplied with Ndata val- ues at different times ti ∈ [t0, T ] corresponding to udata(ti) = ui initial condition corresponds to the first point, udata(t0) = u1 data (with i = 1, Ndata). The data. In this work, for simplicity, we assume a uniform distribution of the Ndata points within a subinterval of the full time interval domain. As a consequence of the ODE particular case, we are not concerned with 6 the boundary condition, thus ωb = 0. However, the central part of the PINNs concept concerns the loss function LF (θ), that is evaluated at Nc collocation points which are not necessarily coinciding in time values with Ndata. The distribution of Nc is also taken to be uniform in the full time domain, or on a subinterval of it. Some of the Pytorch Python-based codes and data-sets accompanying this manuscript are available on the GitHub repository at https://github.com/hubertbaty/PINNS-EDO. These have been inspired by the codes provided on https://benmoseley.blog and available on GitHub repository at https://github.com/benmoseley/harmonic-oscillator-pinn. We have chosen to use very simple deep feed-forward networks architectures with hyperbolic tangent activation functions. In this work, the optimal choice of detailed architecture of the network (number of hidden layers, number of neurons per layer) and of hyperparameters (learning rate, loss weights) is done manually. Although more systematic/automatic procedures could be used, this is a more complicated task not considered in this work. Note that we use the notation y for the desired ODE solution in the following instead of u introduced in the previous section for a PDE case. FIG. 2. Tutorial solution ˆyθ(t) (red solid line) predicted by the normal NN for nt = 4000 iterations (in left panel) and nt = 24000 iterations (in right panel) respectively, and compared to the exact solution (blue hatched line). The chosen training data set values are indicated using circles (with Ndata = 101). The physical information is not used, i.e. ωF = 0. 7 FIG. 3. Loss function as a function of the number of epochs (i.e. number of iterations nt), corresponding to the previous figure. FIG. 4. Tutorial solution obtained in two cases using the normal NN, for a low number of data (Ndata = 26) uniformly taken within the whole time domain (left panel), and for Ndata = 61 taken within a left subinterval (right panel). The convergence is stopped at nt = 48000. III. ILLUSTRATION OF THE METHOD ON A SIMPLE TUTORIAL EXAMPLE A. The differential equation: a tutorial example Let us consider the following equation example, called tutorial equation below, to be solved for y(t), dy dt + 0.1t − sin(πt/2) = 0, (11) fo t ∈ [0, 30], using the initial condition y0 = y(0) = 1. As can be seen below, the corre- sponding solution contains two time scales, a first one due to the sinusoidal forcing term, and a second one due to the linear term in t 10 that gives an exponentially decreasing envelope amplitude. 8 B. Solving with a normal neural network We first consider a situation without any constraint coming from the differential equation, i.e. ωF = 0. As we are left with data coming only from the exact solution, we call it the normal neural network. The training procedure is illustrated on Figure 2 for two training steps (i.e. nt), at nt = 4000 and nt = 24000. The solution is not fully converged for nt = 4000, contrary to nt = 24000. This is in agreement with the history of the loss function (see Figure 3), where the convergence is already roughly obtained when nt (cid:39) 15000. A learning rate of η = 3 × 10−3, with ωdata = 1 is chosen. A choice of 3 hidden layers with 32 neurons per layer is also done. The exact solution that is drawn for comparison, is obtained using a classical Runge-Kutta method of order two. Note that the later is also useful to extract the training data corresponding to the Ndata values, yi data. Figure 2 clearly illustrates the ability of the normal NN to approximate the solution for a relatively high number of Ndata values, as Ndata = 101 is employed. However, when the number of training points is not enough, the convergence towards the solution is bad, or it can completely fail. This is illustrated in two cases at the end of the convergence process stopped at nt = 48000. Indeed, the results for the first case obtained for Ndata = 26 values uniformly chosen within the full time interval, show bad convergence properties as illustrated in Figure 4 (left panel). Moreover, when the points are distributed only within a subinterval (with Ndata = 61), Figure 4 (right panel) shows that the method completely fails to obtain an acceptable solution in the other subinterval that is free of training data. In other words, the NN is not able to correctly extrapolate the solution in these two cases. C. Solving with PINNs In this sub-section, we consider now the possibility to add the constraint on the loss function with a non zero contribution coming from the differential equation at some chosen collocation points, i.e. ωF (cid:54)= 0. In other words, we minimize by adding a weighted partial loss function term ωF LF (θ), where F = dy dt + 0.1t − sin(πt/2). Typically, we define a uniform data set of Nc = 50 points within the full time interval. The results of the training process is illustrated for the two cases previously studied using the normal network, for which the 9 FIG. 5. Tutorial solution obtained in the two cases of the previous figure with PINNs, where a set of Nc = 50 collocation points is used to calculate an ODE loss function LF . The cases with Ndata = 26 data points taken within the whole interval, and with Ndata = 61 data values within a left subinterval, are plotted in left/right panel respectively. The time values (for collocation points) at which the physical loss function is evaluated are indicated with the small green circle on t axis. FIG. 6. Tutorial solution obtained with PINNs for Ndata = 61 training data values taken within a left subinterval, and Nc = 30 collocation points taken within a complementary right subinterval. FIG. 7. (Left panel) Tutorial solution obtained with PINNs, with Ndata = 1 (initial condition imposed at t = 0), and Nc = 50 collocation points. (Right panel) Corresponding history of the loss function. 10 convergence is not satisfaying. The results plotted in left/right panels of Figures 5, display a spectacular amelioration after nt = 40000 iteration steps in both cases. Additionally, Figure 6 shows that taking collocation points only within a right subinterval (for the second above case) can also be sufficient. Note that, a minimum value for Nc is required with an exact value that depends on the parameters of the network (i.e. number of layers, neurons, etc.). The distribution of the collocation points can also influence the results, but the philosophy behind the PINNs technique remains. The learning rate together with the loss weight values can also influence the convergence of the gradient descent algorithm. Indeed, a too high value of η leads to strong oscillations in the loss function, whilst a too small value can induce a very small convergence speed. The combination of relative weights (ωdata and ωF ) is also important, in order that the two partial losses converge at a similar rate. For the example studied above, we have taken optimal values ωdata = 1, and ωF = 6 × 10−2 for the weights of the two partial losses. If we reduce the training data amount to the minimum possible, i.e. only one point corresponding to the initial value is taken, the solution obtained is also excellent as one can see in left panel of Figure 7. The corresponding loss function is also plotted in right panel of Figure 7. Note that, in this case, an optimal choice of 4 hidden layers with 32 neurons per layer is done. Now the question is, does the method work so nicely for any (ODE) differential equation for which a very reduced amount of data is known. In order to answer this question, we investigate a rather large number of academic cases in the following section, including the important class of second order differential equations. IV. DIFFERENT EXAMPLES - BENCHMARK TESTS A. Harmonic oscillator In this sub-section, we first consider the following harmonic oscillator equation, d2y dt2 + ω2 0y = 0, (12) where ω0 is the normalized angular frequency, and where the time domain considered is t ∈ [0, 1]. We also take the initial conditions y(t = 0) = y0 = 1 and dy dt (t = 0) = 0. Thus, the exact solution is a simple cosine function, i.e. y(t) = cos(ω0t). Our PINNs algorithm is first 11 used to integrate the oscillator equation for ω0 = 20, i.e. for a time interval slightly larger than 3 periods. Note that, in order to evaluate the corresponding ODE loss function LF , a second order automatic differentiation must be used for this example. The choice of the activation function is important to this respect (i.e. the hyperbolic tangent in this study). The solution predicted when only one point corresponding to the initial value (Ndata = 1) is imposed, is plotted in left panel of Figure 8. It is clearly bad for the parameters taken in this case. The quality of the result can slightly varies with this choice, but taking only one training data value is in general not sufficient to lead to an acceptable solution. This is not surprising, as a classical integration method (either analytical or numerical) requires two initial conditions for such second order differential equation. The quality of the solution is greatly ameliorated by adding a second data value (i.e. Ndata = 2). Another second improvement comes from adding another constraint, that is the dt )2 + 1 conservation of the total energy E = 1 0y2 (up to addition by a constant which value is determined by the initial conditions). Indeed, we can add to the total loss another 2( dy 2ω2 partial loss function defined as LE(θ) = 1 Nc Nc(cid:88) i=1 (cid:107) E( ˆuθ(zi)) − E0(cid:107)2 , (13) with a corresponding weight ωE to be determined and E0 being the initial constant total energy. More explicitly, we have L(θ) = ωdataLdata(θ) + ωELE(θ) + ωF LF (θ). These new results are visible in right panel of Figure 8 for the predicted solution obtained at nt = 54000. Moreover in Figure 9, one can compare the corresponding mean square error (M SE) and loss histories evaluated for 1000 points taken within the full time domain. One can clearly see the improvement with a lower minimum M SE value by more than two orders of magnitude obtained in the improved procedure. This is remarkable, as this is despite the fact that the loss function history (also visible on the same figure) converges in a similar way in the two cases. Note also that, with these two improvements we have obtained that a relatively low minimum value for the number of collocation points with Nc (cid:39) 24 is sufficient. Such very small minimum number of collocation points is a great advantage compared to a standard integration method for which the small time step restriction (because of stability and/or precision) requires a much larger number of points within the time interval. The choice of the other hyperparameters are η = 3 × 10−4, ωdata = 1, and ωF = ωE = 3 × 10−4. Three 12 FIG. 8. (Left panel) Harmonic oscillator predicted solution obtained with PINNs, using Ndata = 1 (initial condition imposed at t = 0), and Nc = 40 collocation points. (Right panel) Predicted solu- tion obtained with PINN, with Ndata = 2 and the additional constraint on the energy conservation (see text). FIG. 9. Histories of the total loss function L(θ) and M SE corresponding to the two panels of the previous figure respectively. The M SE is evaluated using the standard expression, M SE = (cid:13) 2, where the evaluation ˆyθ(ti) is done on Neval = 1000 points uniformly (cid:13) (cid:13) (cid:13) ˆyθ(ti) − yi (cid:80)Neval i=1 1 Neval distributed within the whole time interval, and yi eval eval is the expected exact solution at t = ti. hidden layers with 32 neurons per layer are taken for the neural network architecture. We have also investigated longer time cases with higher ω0 values, typically up to ω0 (cid:39) 130 (not shown). The conservation of energy is fundamental to this respect, otherwise the algorithm doesn't converge towards the expected solution for such long time integration. 13 FIG. 10. PINNs solution obtained for the non linear pendulum with Ndata = 1 and Nc = 40 collocation points, using a NN architecture of 3 hidden layers (left panel) and 4 hidden layers (right panel). B. Non linear pendulum Second, as a natural extension of the harmonic oscillator, we consider the non linear pendulum example below, d2y dt2 + ω2 0 sin(y) = 0, (14) where ω0 is the normalized angular frequency (a value ω0 = 25 is taken below), and where the time domain considered is t ∈ [0, 1]. We also choose the initial conditions y0 = 0.1 and dy dt (t = 0) = 40. As for the harmonic oscillator, we investigate the possibility to use one single point for Ndata corresponding to the initial condition y0, the conservation of the total energy E being imposed via a non zero ωELE(θ) term with E = 1 0 cos(y) (up to addition by a constant which value is determined by the initial conditions). The dt )2 − ω2 2( dy hyperparameters used are η = 1 × 10−3, ωdata = 1, ωF = 3 × 10−6, and ωE = 3 × 10−7. When the NN architecture is composed of 4 hidden layers with 32 neurons per layer, the converged solution obtained for 72000 epochs is correct. However, taking 3 layers (instead of 4) leads to a wrong solution even if the loss function displays convergence. Indeed, in the latter case, the calculated solution is shifted with respect to the exact solution, and the M SE is dramatically high. This is illustrated in Figures 10 and 11. Of course, taking two data points (i.e. Ndata = 2) allows a nice convergence towards the expected exact solution (not shown) for 3 and 4 hidden layers. And, as for the harmonic oscillator equation, the minimum required value for the number of colocation points Nc remains rather low, as it is of order 35 now. We have also investigated the possibility to use an equivalent form of a system of two 14 FIG. 11. History of the total loss function L(θ) and M SE corresponding to the two cases of the previous figure (left and right panel for Ndata = 1 and Ndata = 2 respectively). The M SE (cid:13) 2, where the (cid:13) is evaluated using the standard expression, M SE = 1 (cid:13) (cid:13) ˆyθ(ti) − yi (cid:80)Neval i=1 eval Neval evaluation ˆyθ(ti) is done on Neval = 1000 points uniformly distributed within the whole time interval, and yi eval is the expected exact solution at t = ti. first order differential equations, as done in analytical or classical numerical integrations. Indeed, we can consider the following equivalent system:    dy2 dt dy1 dt − ω0y2 = 0, + ω0 sin(y1) = 0, (15) where y1 represents the desired solution (i.e. the previous y parameter) and y2 is its as- sociated time derivative dy dt divided by ω0. The advantage of the latter normalisation is important, as it facilitates the use of the NN network because in this way y1 and y2 have values of the same order of magnitude. Otherwise, two networks (one per variable) must probably be employed. We have thus used our PINNs algorithm with an input layer con- taining one neuron for t, 4 hidden layers with 32 neurons per layer, and a final output layer containing two neurons for y1 and y2. The partial loss function for the data, Ldata, is calcu- lated using two points at t = 0 now, one value for y1(t = 0) = 0.1 and one for y2(t = 0) = 1.6. The procedure is equivalent to a standard integration scheme using one initial condition for the solution and one for its derivative. The partial loss for the ODE, LF = LF1 + LF2, is now the sum of two terms corresponding to the two equations respectively. The results of the previous example with Nc = 40 are successfully obtained using the following hyper parameters, η = 3 × 10−3, ωdata = 1, ωF = 1 × 10−1, and ωE = 2 × 10−6, as plotted in 15 FIG. 12. PINNs solution obtained for the non linear pendulum using an equivalent formulation with two equations for the two variables y1 and y2 (see text) with Ndata = 2 (one point for y1 and one for y2, i.e. for the two initial conditions at t = 0) and Nc = 40 collocation points. The energy conservation is also applied. Solutions as functions of time and in phase space are plotted in left and right panels, respectively. Figure 12. The corresponding M SE is similar to the M SE previously obtained for the PINN solution of the single second order equation using Ndata = 2, with the constraint on the energy conservation via a LE partial loss function. Note that, the total energy with the (cid:17) 2 − cos(y1) system formulation is, E = ω2 0 (up to a addition by a constant). (cid:16) y2 2 C. Anharmonic oscillators If we consider an anharmonic potentiel of the form y4 4 (instead of y2 2 for the harmonic oscillator), we get the corresponding ODE with a non linear restoring force ∝ y3, The PINNs integration for this problem leads to results and conclusions very similar to d2y dt2 + ω2 0y3 = 0. (16) 1 the non linear pendulum case. Indeed, the use of two training data points with energy conservation constraint considerably ameliorate the convergence. Thus we have E = 1 dt )2+ 4ω2 0y4 (up to addition by a constant which value is determined by the initial conditions). This is illustrated in Figure 13 for a case with y0 = 1.5 and ω0 = 15.5. We have chosen the following hyper parameters, η = 1.5 × 10−3, ωdata = 1, ωF = 1 × 10−5, and ωE = 1 × 10−6. 2( dy The choice of five hidden layers for the neural network seems to be a better optimal choice for this equation. Note also that for the latter example, a minimum number of collocation 16 FIG. 13. PINN solution obtained for the anharmonic oscillator with Ndata = 2 and Nc = 40. points of Nc = 37 seems to be necessary, that is slightly higher than for the non linear pendulum. However, as we have not investigated a large range of different initial parameters, this conclusion is not firm and only gives a rough tendency. It is also instructive to consider a more complex dynamical system corresponding to a double well potential of the form y4 2 , and according to the differential equation, 4 − y2 d2y dt2 + ω2 0(y3 − y) = 0. (17) For this example, two families of solution exist (see below). In order to easier impose the initial conditions, we also take the equivalent system of two equations (as done for the non linear pendulum),    dy2 dt dy1 dt + ω0(y3 − ω0y2 = 0, 1 − y1) = 0. (18) Indeed, taking the initial condition y(0) = y0 = 1.8 , or equivalently y1(0) = 1.8, together with zero derivative y2(0) = 0, a first solution is obtained as plotted in Figure 14. We use ω0 = 12. The predicted solution is nicely reproduced when compared to the exact expected solution (obtained using a Runge-Kutta integration). For this example, two training data E = ω2 points seems to be necessary (i.e. Ndata = 4), with the use of the energy conservation as 2 ). We have also chosen the following hyper parameters, η = 1 × 10−3, ωdata = 1, ωF = 6 × 10−3, and ωE = 6 × 10−5, but they must be adjusted from case to case. 4 − y2 2 + y4 0( y2 2 1 1 A second solution corresponding to y(0) = y0 = 1.38 (with zero initial derivative condition) is also trained and nicely obtained, as one can see in Figure 15. However, taking an initial condition closer to the critical value y0 = √ 2, our PINN algorithm fails to converge to the exact solution. This is not completely surprising, as this 17 FIG. 14. PINNs solution obtained for the double well oscillator system for the initial condition y0 = 1.8. We use Ndata = 4 with 2 points for each variable, and Nc = 40 collocation points. A NN architecture with five hidden layers is taken. The energy conservation is also applied. Solutions are plotted as functions of time (left panel), and in phase space (right panel). FIG. 15. PINNs solution obtained for the double well oscillator system for the initial condition y0 = 1.38. We use Ndata = 4 with 2 points for each variable, and Nc = 40 collocation points. A NN architecture with five hidden layers is taken. The energy conservation is also applied. Solutions are plotted as functions of time (left panel), and in phase space (right panel). corresponds to a threshold separating solutions having orbits in the phase space trapped in the well centered on (y1 = 0, y2 = 0) with solutions having orbits centered on (y1 = 1, y2 = 0). In other words, two types of solutions coexist for y0 = D. Van Der Pol oscillator √ 2. We now consider the Van Der Pol (VDP) oscillator equation given by, d2y dt2 + ω2 0y − (cid:15)ω0(1 − y2) dy dt = 0, 18 (19) FIG. 16. Exact solution of the VDP oscillator equation obtained for (cid:15) = 5 and the initial conditions y(t = 0) = 1, dy dt (t = 0) = 0. The solution y(t) as a function of time is plotted in the left panel, and in phase space in the right panel. FIG. 17. Same as in the previous figure for (cid:15) = 1. where ω0 is a normalized angular velocity, and (cid:15) is a parameter having a value which deter- mines the amplitude of a limit cycle in the phase space (see below). Note that the harmonic oscillator is recovered for (cid:15) = 0. The particularity of the system is the existence of a limit cycle as illustrated in Figure 16, obtained using a classical Runge-Kutta integration (of order 4) for ω0 = 15, and (cid:15) = 5, for t ∈ [0, 3]. When the parameter (cid:15) has a lower value, the system exhibits a limit cycle with less distortion in the phase space, as illustrated in Figure 17. We have thus used our PINNs algorithm to explore its behavior for three cases corre- sponding to three values of (cid:15), i.e. (cid:15) = 1 3, 1, and 5. We have chosen ω0 = 15 for t ∈ [0, 1.5]. We also take the initial condition y0 = 1. The results are plotted in Figure 18, for a neural network having three hidden layers with 32 neurons per layer. The number of training data and collocation points, as well as the weight ωF associated to the equation (ωdata = 1 being 19 fixed) are varying from case to case (see the legend). The results clearly show that increasing the non linearity (via the (cid:15) parameter) require a higher number of points. This is the case of the number of collocation points, but also of the number of training data points. Indeed, for the (cid:15) = 5 case we need a collection of training data points distributed within the whole time domain, while for the smallest (cid:15) case, three points at early times are sufficient to obtain a convergence towards the exact solution. This is clearly a strong limitation of the PINN algorithm when one want to solve highly non linear problems. V. DISCUSSION AND CONCLUSION In this work, we have reviewed the basic concepts of using neural networks in order to integrate differential equations. More specifically, we have focused on the use of the equations knowledge to penalize the convergence of the training process, and generally referred as physics-informed neural networks in the literature. A tutorial example on a simple ODE is presented, with the aim to illustrate how adding a partial loss function associated to the physics information (i.e. via the differential terms ensuring the equation) can considerably ameliorate the results of a normal neural network. Benchmark tests on different second order ODEs are used in order to highlight the ben- efits and drawbacks of this approach when compared to a traditional numerical integration method. When the problem equation displays weak non linearity, the training procedure is successful using known data representing only the initial conditions (as for a classical integration method). The first advantage of PINNs in this case, is the need to use a very low number of collocation data points. Indeed, for the problems illustrated in this work, between 20 and 40 points are sufficient. An integration using a Runge-Kutta method (of order two) for the same equations would require a number of points higher by at least one order of magnitude. The second advantage is that, once trained the solution for a given time (case of an ODE) is instantaneously predicted. This is not the case for a classical integration for which a new integration procedure must be realized. However, when the non linearity is increased (ses VDP oscillator tests with increasing (cid:15) parameter), the knowledge of a higher amount of training data is required with also a higher number of collocation data points. The previously cited benefits of PINNs are consequently reduced. Nevertheless, the second benefit remains. The other drawbacks of the method concern the lack of general automatic 20 FIG. 18. PINN solution of the VDP equation obtained for three values of the parameter (cid:15). In top panel, a value (cid:15) = 1 3 is used, with the hyper parameters η = 7×10−4, ωdata = 1, and ωF = 1×10−4, and Nc = 48. In middle panel, a value (cid:15) = 1 is used, with the hyper parameters η = 7 × 10−4, ωdata = 1, and ωF = 1 × 10−4, and Nc = 60. In bottom panel, a value (cid:15) = 5 is used, with the hyper parameters η = 7 × 10−4, ωdata = 1, and ωF = 1 × 10−5, and Nc = 70 procedure for a fine tuning of the hyperparameters in order to have an optimal convergence during the training. Nevertheless, the most interesting point of the PINNs is its meshfree property, contrary to traditional integration methods. This approach remains relatively recent, and many ameliorations are expected in the next years. In this work, we have focused on the original PINNs method based on the automatic 21 differentiation to evaluate the equation terms at collocation data points. There is already a wealth of variants to do it differently in order to improve the efficiency of the optimization procedure. As a very incomplete list of NN-based ideas to solve PDEs, we have methods based on, learning the solution map, and variational formulation (Ritz and Galerkin). In the context of solving differential equations, PINNs approach can be also used for other different problems. For example, it is useful for inverse problems when data are known at some time different from the initial conditions that are desired (Raissi et al. 2019). Indeed, a neural network does not make difference between the two boundaries of the time interval. Second, PINNs technique can be also used when some terms of the differential equations are not completely known, and which can be added as additional inputs in the input layer. The aim of the latter problems concerns the data-driven discovery of the governing equations (Rudy et al. 2017). ACKNOWLEDGMENTS Hubert Baty thanks Emmanuel Franck, Victor Michel-Dansac, and Vincent Vigon (IRMA, Strasbourg), for associating him to the supervision of the Master2 internship of Vincent Italiano in February-July 2022, which also gave him want to learn the PINNs technique. [1] Le Cun Y., Bengio Y., & Hinton G., Nature 521, 436, 2015, https://doi.org/10.1038/nature14539 [2] Raissi, Perdikaris P., & Karniadakis G.E., https://doi.org/10.48550/arXiv.1711.10561, 2017 [3] Raissi M., Perdikaris P., & Karniadakis G.E., Journal of Computational Physics 378, 686, 2019, https://doi.org/10.1016/j.jcp.2018.10.045 [4] Baydin A. G., Pearlmutter B. A, Radul A. A., & Siskind J. M., https: //arxiv.org/abs/1502.05767 , 2018 [5] Cuomo S., Di Cola V.S., Giampaolo F., Rozza G., Raissi M. & Piccialli F., Journal of Scientific Computing 92, 88, 2022, https://doi.org/10.1007/s10915-022-01939-z [6] Karniadakis G.E., Kevrekidis I.G., Lu L, Perdikaris P., Wang S., & Yang L., Nature reviews 22 422, 440, 2021, https://doi.org/10.1038/s42254-021-00314-5 [7] Rudy S.H, Brunton S.L., Proctor J.L. & Kutz. J.L., Science Advances 3, e1602614, 2017 23
http://arxiv.org/abs/2302.13814v2
2023-02-28T02:06:53
2023-02-23T16:06:16
An Independent Evaluation of ChatGPT on Mathematical Word Problems (MWP)
We study the performance of a commercially available large language model (LLM) known as ChatGPT on math word problems (MWPs) from the dataset DRAW-1K. To our knowledge, this is the first independent evaluation of ChatGPT. We found that ChatGPT's performance changes dramatically based on the requirement to show its work, failing 20% of the time when it provides work compared with 84% when it does not. Further several factors about MWPs relating to the number of unknowns and number of operations that lead to a higher probability of failure when compared with the prior, specifically noting (across all experiments) that the probability of failure increases linearly with the number of addition and subtraction operations. We also have released the dataset of ChatGPT's responses to the MWPs to support further work on the characterization of LLM performance and present baseline machine learning models to predict if ChatGPT can correctly answer an MWP. We have released a dataset comprised of ChatGPT's responses to support further research in this area.
[ "Paulo Shakarian", "Abhinav Koyyalamudi", "Noel Ngu", "Lakshmivihari Mareedu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.13814v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.13814v2", "@rel": "related", "@type": "application/pdf" } ]
[ "AAAI Spring Symposium 2023 (MAKE)" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG" ]
An Independent Evaluation of ChatGPT on Mathematical Word Problems (MWP) Paulo Shakarian*, Abhinav Koyyalamudi, Noel Ngu and Lakshmivihari Mareedu Arizona State University, 699 S Mill Ave, Tempe, AZ, 85281, USA Abstract We study the performance of a commercially available large language model (LLM) known as ChatGPT on math word problems (MWPs) from the dataset DRAW-1K. To our knowledge, this is the first independent evaluation of ChatGPT. We found that ChatGPT's performance changes dramatically based on the requirement to show its work, failing 20% of the time when it provides work compared with 84% when it does not. Further several factors about MWPs relating to the number of unknowns and number of operations that lead to a higher probability of failure when compared with the prior, specifically noting (across all experiments) that the probability of failure increases linearly with the number of addition and subtraction operations. We also have released the dataset of ChatGPT's responses to the MWPs to support further work on the characterization of LLM performance and present baseline machine learning models to predict if ChatGPT can correctly answer an MWP. We have released a dataset comprised of ChatGPT's responses to support further research in this area. Keywords Large Language Models, Math Word Problems, ChatGPT 1. Introduction The emergence of large language models (LLM) has gained much popularity in recent years. At the time of this writing, some consider OpenAI's GPT 3.5 series models as the state-of-the art [1]. In particular, a variant tuned for natural dialogue known as ChatGPT [2], released in November 2022 by OpenAI, has gathered much popular interest, gaining over one million users in a single week [3]. However, in terms of accuracy, LLMs are known to have performance issues, specifically when reasoning tasks are involved [1, 4]. This issue, combined with the ubiquity of such models has led to work on prompt generation and other aspects of the input [5, 6]. Other areas of machine learning, such as meta-learning [7, 8] and introspection [9, 10] attempt to predict when a model will succeed or fail for a given input. An introspective tool, especially for certain tasks, could serve as a front-end to an LLM in a given application. As a step toward such a tool, we investigate aspects of math word problems (MWPs) that can indicate the success or failure of ChatGPT on such problems. We found that ChatGPT's In A. Martin, K. Hinkelmann, H.-G. Fill, A. Gerber, D. Lenat, R. Stolle, F. van Harmelen (Eds.), Proceedings of the AAAI 2023 Spring Symposium on Challenges Requiring the Combination of Machine Learning and Knowledge Engineering (AAAI-MAKE 2023), Hyatt Regency, San Francisco Airport, California, USA, March 27-29, 2023. *Corresponding author. " [email protected] (P. Shakarian); [email protected] (A. Koyyalamudi); [email protected] (N. Ngu); [email protected] (L. Mareedu) ~ https://labs.engineering.asu.edu/labv2/ (P. Shakarian) © 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) 3 2 0 2 b e F 8 2 ] L C . s c [ 2 v 4 1 8 3 1 . 2 0 3 2 : v i X r a CEURWorkshopProceedingsceur-ws.orgISSN 1613-0073 performance changes dramatically based on the requirement to show its work, failing 20% of the time when it provides work compared with 84% when it does not. Further several factors about MWPs can lead to a higher probability of failure when compared with the prior, specifi- cally noting that the probability of failure increases linearly with the number of addition and subtraction operations (across all experiments). We also have released the dataset of ChatGPT's responses to the MWPs to support further work on the characterization of LLM performance. While there has been previous work examining the LLM performance on MWPs [4], such work did not investigate specific aspects that increase MWP difficulty nor did it examine performance on ChatGPT in particular. The remainder of this paper proceeds as follows. In Section 2, we describe our methodology. Then we describe our results in Section 3. Using these intuitions, we present baseline models to predict the performance of ChatGPT in Section 4. This is followed by a discussion of related work (Section 5) and future work (Section 6). 2. Methodology MWP Dataset. In our study, we employed the DRAW-1K dataset [11, 12, 13] which not only includes 1,000 MWPs with associated answers but also template algebraic equations that one would use to solve such a word problem. As a running example, consider the following MWP. One whole number is three times a second. If 20 is added to the smaller number, the result is 6 more than the larger. We show ChatGPT's (incorrect) response to this MWP in Figure 1. The DRAW-1K dataset not only includes the correct answer, which in this case is 12 and 7 but also includes template equations used to solve the problem. For our running example, this consists of the equations m − n = a − b and c × m − n = 0. This information represents a symbolic representation of the problem which can potentially be used to identify aspects that make such problems more difficult. Entering Problems into ChatGPT at Scale. At the time of our study, OpenAI, the maker of ChatGPT had not released an API. However, using the ChatGPT CLI Python Wrapper1 we interfaced with ChatGPT allowing us to enter the MWP's at scale. For the first two experiments, we would add additional phrases to force ChatGPT to show only the final answer. We developed these additions to the prompt based on queries to ChatGPT to generate the most appropriate phrase. However, we found in our third experiment that this addition impacted results. We ran multiple experiments to test ChatGPT's ability with these problems. • January 2023 Experiment (No work). Our first experiment was run in early January 2023 prior to OpenAI's announcement of improved performance on mathematical tasks on January 30, 20232 and in this experiment we included the following statement as part of the prompt. 1We used ChatGPT CLI Python Wrapper by Mahmoud Mabrouk, see https://github.com/mmabrouk/chatgpt-wrapper 2https://help.openai.com/en/articles/6825453-chatgpt-release-notes Figure 1: ChatGPT's response (Jan. 24, 2023) to MWP One whole number is three times a second. If 20 is added to the smaller number, the result is 6 more than the larger. In Step A it correctly identifies the set of equations needed to solve the problem and correctly simplifies it in Step B. However, it fails to correctly perform the algebraic operation in Step C (it should state 2y = 14). This leads ChatGPT to obtain an incorrect result, returning 42 and 14 instead of 21 and 7. Don't provide any work/explanation or any extra text. Just provide the final number of answers for the previous question, with absolutely no other text. if there are two or more answers provide them as a comma separated list of numbers. • February 2023 Experiment (No work). Our second experiment was run in mid- February 2023 after the aforementioned OpenAI announcement and also used a prompt that would cause ChatGPT to show only the answer, however we found that our original prompt led to more erratic behavior, so we modified the prompt for this experiment, and used the following. Don't provide any work/explanation or any extra text. Just provide the final number of answers for the previous question, with absolutely no other text. if there are two or more answers provide them as a comma separated list of numbers like: '10, 3,' etc; or if there is only 1 answer provide it like '10'. Absolutely no other text just numbers alone. Just give me the numbers (one or more) alone. No full stops, no spaces, no words, no slashes, absolutely nothing extra except the 1 or more numbers you might have gotten as answers. • February 2023 Experiment (Showing Work). We also repeated the February experi- ment without the additional prompt, thereby allowing ChatGPT to show all its work. We note that in this experiment we used ChatGPT Plus which allowed for faster response. At the time of this writing, ChatGPT Plus is only thought to be an improvement to accessibility and not a different model.3 3https://openai.com/blog/chatgpt-plus/ 3. Results The key results of this paper are as follows: (1.) the creation of a dataset consisting of ChatGPT responses to the MWPs, (2.) identification of ChatGPT failure rates (84% for January and February experiments with no work and 20% for the February experiment with work), (3.) identification of several factors about MWPs relating to the number of unknowns and number of operations that lead to a higher probability of failure when compared with the prior (Figure 3), (4.) identification that the probability of failure increases linearly with the number of addition and subtraction operations (Figure 5), and (5.) identification of a strong linear relationship between the number of multiplication and division operations and the probability of failure in the case where ChatGPT shows its work. Dataset. We have released ChatGPT's responses to the 1,000 DRAW-1K MWP's for general use at https://github.com/lab-v2/ChatGPT_MWP_eval. We believe that researchers studying this dataset can work to develop models that can combine variables, operate directly on the symbolic template, or even identify aspects of the template from the problem itself in order to predict LLM performance. We note that at the time of this writing, collecting data at scale from ChatGPT is a barrier to such work as API's are not currently directly accessible, so this dataset can facilitate such ongoing research without the overhead of data collection. Overall Performance of ChatGPT on DRAW-1K. As DRAW-1K provides precise can com- plete answers for each problem, we classified ChatGPT responses in several different ways and the percentage of responses in each case is shown in Figure 2. 1. Returns all answers correctly. Here ChatGPT returned all answers to the MWP (though it may round sometimes). 2. Returns some answers correctly, but not all values. Here the MWP called for more than one value, but ChatGPT only returned some of those values. 3. Returns "No Solution." Here ChatGPT claims there was no solution to the problem. This was not true for any of the problems. 4. Returns answers, but none are correct. Here ChatGPT returned no correct answers (e.g., see Figure 1). Throughout this paper, we shall refer to the probability of failure as the probability of cases 3 and 4 above (considered together). In our February experiment, we found that when ChatGPT omitted work, the percentages, as reported in Figure 2 remained the same, though they differed significantly when work was included. We also report actual numbers for all experiments in Table 1. We note that the probability of failure increases significantly when the work is not shown. However, when the work is included, ChatGPT obtains performance in line with state-of-the-art models (i.e. EPT [18, 16]) which has a reported 59% accuracy while ChatGPT (when work is shown) has fully correct (or rounded) answers 51% of the time, but can be viewed as high as 80% if partially correct answers are included. Factors Leading to Incorrect Responses. We studied various factors from the templated solutions provided for the MWP in the DRAW-1K dataset and these included number of equations, number of unknowns, number of division and multiplication operations, number of addition and Figure 2: Overall results on the 1,000 MWPs in DRAW-1K based on ChatGPT's response. Response Type Returns answers, but none are correct Returns "No Solution" Returns all answers correctly Returns some answers correctly, but not all values Jan. 2023 (No work) 831 9 135 25 Feb. 2023 (No work) 830 10 134 26 Feb. 2023 (Showing work) 186 14 513 287 Table 1 Number of responses for each ChatGPT Variant subtraction operations, and other variants derived from the metadata in the DRAW-1K dataset. We identified several factors that, when present, cause ChatGPT to fail with a probability greater than the prior (when considering the lower bound of a 95% confidence interval). These results are shown in Figure 3. One interesting aspect we noticed is that when the system would be required to show its work, the number of unknowns present no longer seems to increase the probability of failure (this was true for all quantities of unknowns in addition to what is shown in Figure 3). Additionally, the number of multiplication and division operations, while increasing the probability of failure greater than the prior in the January experiment was not significant (based on 95% confidence intervals) in the February experiment (when work was not shown) - possibly a result of OpenAI's improvements made at the end of January. However, there was a significant relationship between the number of multiplication and division operations and failure when work was shown. In fact, we found a strong linear relationship (R2 = 0.802) for this relationship in the case where work was shown. Correlation of failure with additions and subtractions. Previous work has remarked on the failure of LLM's in multi-step reasoning [1, 4]. In our study, we identified evidence of this phenomenon. Specifically, we found a strong linear relationship between the number of addition and subtraction operations with the probability of failure (R2 = 0.821 for the January experiment, R2 = 0.870 for the February experiment and R2 = 0.915 when work was shown). Figure 3: Aspects of MWPs that led to ChatGPT failure more often than the prior (95% confidence intervals shown). Figure 4: Additional finding specific to the February, 2023 experiment where ChatGPT displayed its work relating number of multiplications to probability of failure, R2 = 0.802, 95% confidence intervals. We show this result in Figure 5. It is noteworthy that the relationship existed in all of our experiments, and seemed to be strengthened when ChatGPT included work in the result. 4. Performance Prediction Baselines The results of the previous section, in particular, the factors indicating a greater probability of failure (e.g. Figures 3-5), may indicate that the performance of ChatGPT can be predicted. In this section, we use features obtained from the equations associated with the MWPs to predict performance. Note that here we use ground-truth equations to derive the features, so the models presented in this section are essentially using an oracle - we leave extracting such features from equations returned by ChatGPT or another tool (e.g., EPT [18]) to future work. That said, as these features deal with counts of operations, unknowns, and equations, a high degree of accuracy in creating the equations would not be required to faithfully generate such features. Following the ideas of machine learning introspection [9, 10], we created performance prediction models using random forest and XGBoost. We utilized scikit-learn 1.0.2 and XGBoost 1.6.2 respectively. In our experiments, we evaluated each model on each dataset using a five-fold cross-validation and report average precision and recall in Table 2 (along with F1 computed based on those averages). In general, our models were able to provide higher precision than random on predicting incorrect answers for both classifiers. Further, XGBoost was shown to be Figure 5: Increase in probability of an incorrect response as a function of the number of addition operations (prior probability shown with dashed line, 95% confidence intervals, linear regression with R2 = 0.821 for January, R2 = 0.870 for February without showing work and R2 = 0.915 for February with showing work). Version of ChatGPT Jan. (No work) Feb. (No work) Feb. (Showing work) Model Type RF XGBoost RF XGBoost RF XGBoost Incorr. Prec. 0.90 0.95 0.94 0.98 0.78 0.77 Incorr. Recall 0.88 0.22 0.89 0.35 0.69 0.59 Incorr. Corr. Prec. 0.34 0.16 0.47 0.18 0.74 0.69 F1 0.89 0.36 0.91 0.51 0.73 0.67 Corr. Recall 0.41 0.93 0.63 0.95 0.82 0.83 Corr. F1 0.37 0.26 0.54 0.31 0.78 0.75 Table 2 Performance Prediction Baseline Models using Ground Truth Equations able to provide high recall for predicting correct responses. While these results are likely not suitable for practical use, they do demonstrate that the features extracted provide some amount of signal to predict performance and provide a baseline for further study. 5. Related Work The goal of this challenge dataset is to develop methods to introspect a given MWP in order to identify how an LLM (in this case ChatGPT) will perform. Recent research in this area has examined MWPs can be solved by providing a step-by-step derivation [14, 15, 16, 17]. While these approaches provide insight into potential errors that can lead to incorrect results, this has not been studied in this prior work. Further, the methods of the aforementioned research are specific to the algorithmic approach. Work resulting from the use of our challenge dataset could lead to solutions that are agnostic to the underlying MWP solver - as we treat ChatGPT as a black box. We also note that, if such efforts to introspect MWPs are successful, it would likely complement a line of work dealing with "chain of thought reasoning" for LLMs [5, 6] which may inform better ways to generate MWP input into an LLM (e.g., an MWP with fewer additions may be decomposed into smaller problems). While some of this work also studied LLM performance on Math Word Problems (MWPs), it only looked at how various prompting techniques could improve performance rather than underlying characteristics of the MWP that leads to degraded performance of the LLM. 6. Future Work Understanding the performance of commercial black-box LLMs will be an important topic as they will likely become widely used for both commercial and research purposes. Further future directions would also include an examination of ChatGPT performance on datasets other MWPs [13], investigating ChatGPT's nondeterminism, and exploring these studies on upcoming commercial LLM's to be released by companies such as Alphabet and Meta. Acknowledgments Some of the authors have been funded by the ASU Fulton Schools of Engineering. References [1] How does gpt obtain its ability? tracing emergent abilities of language models to their sources, URL: https://yaofu.notion.site. [2] Chatgpt: Optimizing language models for dialogue, URL: https://openai.com/blog/chatgpt/. [3] Chatgpt gained 1 million users in under a week. here's why the AI chatbot is primed to disrupt search as we know it. URL: https://www.yahoo.com/video/ chatgpt-gained-1-million-followers-224523258.html. [4] J. Hoffmann, S. Borgeaud, A. Mensch, E. Buchatskaya, T. Cai, E. Rutherford, D. d. L. Casas, L. A. Hendricks, J. Welbl, A. Clark, T. Hennigan, E. Noland, K. Millican, G. v. d. Driessche, B. Damoc, A. Guy, S. Osindero, K. Simonyan, E. Elsen, J. W. Rae, O. Vinyals, L. Sifre, Training compute-optimal large language models, URL: http://arxiv.org/abs/2203.15556. arXiv:2203.15556 [cs]. [5] J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, E. H. Chi, Q. V. Le, D. Zhou, Chain-of-thought prompting elicits reasoning in large language models . [6] X. Wang, J. Wei, D. Schuurmans, Q. Le, E. Chi, S. Narang, A. Chowdhery, D. Zhou, Self- consistency improves chain of thought reasoning in language models, URL: http://arxiv. org/abs/2203.11171. doi:10.48550/arXiv.2203.11171. arXiv:2203.11171 [cs]. [7] T. Hospedales, A. Antoniou, P. Micaelli, A. Storkey, Meta-learning in neural networks: A survey 44 5149–5169. URL: https://www.computer.org/csdl/journal/tp/2022/09/09428530/ 1twaJR3AcJW. doi:10.1109/TPAMI.2021.3079209, publisher: IEEE Computer Society. [8] K. Zhou, Z. Liu, Y. Qiao, T. Xiang, C. C. Loy, Domain generalization: A survey 1–20. doi:10.1109/TPAMI.2022.3195549, conference Name: IEEE Transactions on Pattern Analysis and Machine Intelligence. [9] S. Daftry, S. Zeng, J. A. Bagnell, M. Hebert, Introspective perception: Learning to predict failures in vision systems, URL: http://arxiv.org/abs/1607.08665. doi:10.48550/arXiv. 1607.08665. arXiv:1607.08665 [cs]. [10] M. S. Ramanagopal, C. Anderson, R. Vasudevan, M. Johnson-Roberson, Fail- ing to learn: Autonomously identifying perception failures for self-driving cars 3 3860–3867. URL: http://arxiv.org/abs/1707.00051. doi:10.1109/LRA.2018.2857402. arXiv:1707.00051 [cs]. [11] S. Upadhyay, M.-W. Chang, K.-W. Chang, W.-t. Yih, Learning from explicit and implicit supervision jointly for algebra word problems, in: Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Association for Computational Linguistics, pp. 297–306. URL: https://aclanthology.org/D16-1029. doi:10.18653/v1/ D16-1029. [12] S. Upadhyay, M.-W. Chang, Annotating derivations: A new evaluation strategy and dataset for algebra word problems, URL: http://arxiv.org/abs/1609.07197. doi:10.48550/arXiv. 1609.07197. [13] Y. Lan, L. Wang, Q. Zhang, Y. Lan, B. T. Dai, Y. Wang, D. Zhang, E.-P. Lim, MWPToolkit: An open-source framework for deep learning-based math word problem solvers 36 13188– 13190. URL: https://ojs.aaai.org/index.php/AAAI/article/view/21723. doi:10.1609/aaai. v36i11.21723, number: 11. [14] Z. Gong, K. Zhou, X. Zhao, J. Sha, S. Wang, J.-R. Wen, Continual pre-training of language models for math problem understanding with syntax-aware memory network, in: Pro- ceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Association for Computational Linguistics, pp. 5923–5933. URL: https://aclanthology.org/2022.acl-long.408. doi:10.18653/v1/2022.acl-long.408. [15] K. S. Ki, D. Lee, B. Kim, G. Gweon, Generating equation by utilizing operators : GEO model, in: Proceedings of the 28th International Conference on Computational Linguis- tics, International Committee on Computational Linguistics, pp. 426–436. URL: https: //aclanthology.org/2020.coling-main.38. doi:10.18653/v1/2020.coling-main.38. [16] B. Kim, K. S. Ki, S. Rhim, G. Gweon, EPT-x: An expression-pointer transformer model that generates eXplanations for numbers, in: Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Association for Computational Linguistics, pp. 4442–4458. URL: https://aclanthology.org/2022.acl-long.305. doi:10.18653/v1/2022.acl-long.305. [17] Y. Xia, F. Li, Q. Liu, L. Jin, Z. Zhang, X. Sun, L. Shao, ReasonFuse: Reason path driven and global–local fusion network for numerical table-text question answering 516 169–181. URL: https://www.sciencedirect.com/science/article/pii/S0925231222011444. doi:10.1016/j. neucom.2022.09.046. [18] B. Kim, K. S. Ki, D. Lee, G. Gweon, Point to the expression: Solving algebraic word problems using the expression-pointer transformer model, in: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Association for Compu- tational Linguistics, pp. 3768–3779. URL: https://aclanthology.org/2020.emnlp-main.308. doi:10.18653/v1/2020.emnlp-main.308.
http://arxiv.org/abs/2302.12120v2
2023-05-25T10:41:42
2023-02-23T15:59:30
Sequential Counterfactual Risk Minimization
Counterfactual Risk Minimization (CRM) is a framework for dealing with the logged bandit feedback problem, where the goal is to improve a logging policy using offline data. In this paper, we explore the case where it is possible to deploy learned policies multiple times and acquire new data. We extend the CRM principle and its theory to this scenario, which we call "Sequential Counterfactual Risk Minimization (SCRM)." We introduce a novel counterfactual estimator and identify conditions that can improve the performance of CRM in terms of excess risk and regret rates, by using an analysis similar to restart strategies in accelerated optimization methods. We also provide an empirical evaluation of our method in both discrete and continuous action settings, and demonstrate the benefits of multiple deployments of CRM.
[ "Houssam Zenati", "Eustache Diemert", "Matthieu Martin", "Julien Mairal", "Pierre Gaillard" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12120v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12120v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Sequential Counterfactual Risk Minimization Houssam Zenati 1 2 Eustache Diemert 1 Matthieu Martin 1 Julien Mairal 2 Pierre Gaillard 2 3 2 0 2 y a M 5 2 ] G L . s c [ 2 v 0 2 1 2 1 . 2 0 3 2 : v i X r a Abstract Counterfactual Risk Minimization (CRM) is a framework for dealing with the logged bandit feedback problem, where the goal is to improve a logging policy using offline data. In this paper, we explore the case where it is possible to deploy learned policies multiple times and acquire new data. We extend the CRM principle and its the- ory to this scenario, which we call "Sequential Counterfactual Risk Minimization (SCRM)." We introduce a novel counterfactual estimator and identify conditions that can improve the perfor- mance of CRM in terms of excess risk and regret rates, by using an analysis similar to restart strate- gies in accelerated optimization methods. We also provide an empirical evaluation of our method in both discrete and continuous action settings, and demonstrate the benefits of multiple deployments of CRM. 1. Introduction Counterfactual reasoning in the logged bandit problem has become a common task for practitioners in a wide range of applications such as recommender systems (Swaminathan & Joachims, 2015a), ad placements (Bottou et al., 2013) or precision medicine (Kallus & Zhou, 2018). Such a task typ- ically consists in learning an optimal decision policy from logged contextual features and partial feedbacks induced by predictions from a logging policy. To do so, the logged data is originally obtained from a randomized data collec- tion experiment. However, the success of counterfactual risk minimization is highly dependent on the quality of the logging policy and its ability to sample meaningful actions. Counterfactual reasoning can be challenging due to large variance issues associated with counterfactual estimators (Swaminathan & Joachims, 2015b). Additionally, as pointed 1Criteo AI Lab 2Univ. Grenoble Alpes, Inria, CNRS, Grenoble INP, LJK, 38000 Grenoble, France. Correspondence to: Houssam Zenati <[email protected]>. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 out by Bottou et al. (2013), confidence intervals obtained from counterfactual estimates may not be sufficiently ac- curate to select a final policy from offline data (Dai et al., 2020). This can occur when the logging policy does not sufficiently explore the action space. To address this, one option is to simply collect additional data from the same logging system to increase the sample size. However, it may be more efficient to use already collected data to design a better data collection experiment through a sequential de- sign approach (Bottou et al., 2013, see Section 6.4). It is thus appealing to consider successive policy deployments when possible. We tackle this sequential design problem and are interested in multiple deployments of the CRM setup of Swaminathan & Joachims (2015a), which we call sequential counterfac- tual risk minimization (SCRM). SCRM performs a sequence of data collection experiments by determining at each round a policy using data samples collected during previous ex- periments. The obtained policy is then deployed for the next round to collect additional samples. Such a sequential decision making system thus entails designing an adaptive learning strategy that minimizes the excess risk and expected regret of the learner. In contrast to the conservative learn- ing strategy in CRM, the exploration induced by sequential deployments of enhanced logging policies should allow for improved excess risk and regret guarantees. Yet, obtaining such guarantees is nontrivial and we address it in this work. In order to accomplish this, we first propose a new coun- terfactual estimator that controls the variance and analyze its convergence guarantees. Specifically, we obtain an im- proved dependence on the variance of importance weights between the optimal and logging policy. Second, leveraging this estimator and a weak assumption on the concentration of this variance term, we show how the error bound sequen- tially concentrates through CRM rollouts. This allows us to improve the excess risk bounds convergence rate as well as the regret rate. Our analysis employs methods similar to restart strategies in acceleration methods (Nesterov, 2012) and optimization for strongly convex functions (Boyd & Vandenberghe, 2004). We also conduct numerical experi- ments to demonstrate the effectiveness of our method in both discrete and continuous action settings, and how it improves upon CRM and other existing methods in the literature. Sequential Counterfactual Risk Minimization 2. Related Work Counterfactual learning from logged feedback (Bottou et al., 2013) uses only past interactions to learn a policy with- out interacting with the environment. Counterfactual risk minimization methods (Swaminathan & Joachims, 2015a;b) propose learning formulations using a variance penalization as in (Maurer & Pontil, 2009) to find policies with minimal variance. Even so, counterfactual methods remain prone to large variance issues (Dud ́ık et al., 2014). These problems may arise when the logging policy under-explores the ac- tion space, making it difficult to use importance sampling tehcniques (Owen, 2013) that are key to counterfactual rea- soning. While one could collect additional data to counter this problem, our method focuses on sequential deployments (Bottou et al., 2013, see Section 6.4) to collect data obtained from adaptive policies to explore the action space. Note also that the original motivation is related but different from the support deficiency problem (Sachdeva et al., 2020) where the support of the logging policy does not cover the support of the optimal policy. Another related literature to our framework is batch bandit methods. Originally introduced by Perchet et al. (2015) and then extended by Gao et al. (2019) in the multi-arm setting, batch bandit agent take decisions and only observe feedback in batches. This therefore differs from the classic bandit set- ting (Auer et al., 2002; Audibert et al., 2007) where rewards are observed after each action taken by an agent. Exten- sions to the contextual case have been proposed by Han et al. and could easily be kernelized (Valko et al., 2013). The sequential counterfactual risk minimization problem is thus closely related to this setting. However, major dif- ferences can be noted. First, SCRM does not leverage any problem structure as in stochastic contextual bandits (Li et al., 2010) by assuming a linear reward function (Chu et al., 2011; Goldenshluger & Zeevi, 2013; Han et al.) nor uses regression oracles as (Foster & Rakhlin, 2020; Simchi- Levi & Xu, 2020). Second, deterministic decision rules taken by bandit agents (Lattimore & Szepesvari, 2019) do not allow for counterfactual reasoning or causal inference (Peters et al., 2017), unlike our framework which performs sequential randomized data collection. Third, unlike gra- dient based methods used in counterfactual methods with parametric policies, batch bandit methods use zero-order methods to learn from data and necessitate approximations to be scalable (Calandriello et al., 2020; Zenati et al., 2022). The sequential designs that we use are adaptive data collec- tion experiments, which have been studied by Bakshy et al. (2018); Kasy & Sautmann (2021). Closely related to our method is policy learning from adaptive data that has been studied by Zhan et al. (2021) and Bibaut et al. (2021) in the online setting. In contrast, we consider a batch setting and our analysis achieve fast rates in more general conditions. Zhan et al. (2021) use a doubly robust estimator and provide regret guarantees but assume a deterministic lower bound on the propensity score to control the variance. Instead, our novel counterfactual estimator does not require such an assumption. Bibaut et al. (2021) propose a novel maximal inequality and derive thereof fast rate regret guarantees un- der an additional margin condition that can only hold for finite action sets. Our work instead uses a different assump- tion on the expected risk, which is similar to H ̈olderian error bounds in acceleration methods (d'Aspremont et al., 2021) that are known to be satisfied for a broad class of subanalytic functions (Bolte et al., 2007). In the reinforcement learning literature (Sutton & Barto, 1998), off-policy methods (Harutyunyan et al., 2016; Munos et al., 2016) evaluate and learn a policy using actions sam- pled from a behavior (logging) policy, which is therefore closely related to our setting. Among methods that have shown to be empirically successful are the PPO (Schulman et al., 2017) and TRPO (Schulman et al., 2015) algorithms which learn policies using a Kullback-Leibler distributional constraint to ensure robust learning, which can be compared to our learning strategy that improves the logging policy at each round. However reinforcement learning models transi- tions in the states (contexts) induced by the agent's actions while bandit problems like ours assume that actions do not influence the context distribution. This enables to design al- gorithms that exploit the problem structure, have theoretical guarantees and can achieve better performance in practice. Finally, our method is related to acceleration methods (d'Aspremont et al., 2021) where current iterates are used as new initial points in the optimization of strongly convex functions (Boyd & Vandenberghe, 2004). While different schemes use fixed (Powell, 1977) or adaptive (Nocedal & Wright, 2006; Becker et al., 2011; Nesterov, 2012; Bolte et al., 2007; Gaillard & Wintenberger, 2018) strategies, our method differs in that it does not consider the same original setting, does not require the same assumptions nor provides the same guarantees. Eventually, while current models are also used as new starting points, additional data is effec- tively collected in our setting unlike those previous works that do not assume partial feedbacks as in our case. 3. Sequential Counterfactual Risk Minimization In this section, we introduce the (CRM) framework and motivate the use of sequential designs for (SCRM). Notations For random variables x ∼ PX , a ∼ πθ(*|x) and y ∼ PY (*|x, a), we write the expectation Ex,θ,y[*] = Ex∼PX ,a∼πθ(*|x),y∼PY (*|x,a)[*] and do the same for the variance Varx,θ,y. Moreover, ≲ denotes ap- proximate inequalities up to universal multiplicative terms. 2 Sequential Counterfactual Risk Minimization 3.1. Background In the counterfactual risk minimization (CRM) problem, we are given n logged observations (xi, ai, yi)i=1,...,n where contexts xi ∈ X are sampled from a stochastic environment distribution xi ∼ PX , actions ai ∼ πθ0(*|xi) are drawn from a logging policy πθ0 with a model θ0 in a parameter space Θ. The losses are drawn from a conditional distri- bution yi ∼ PY (*|xi, ai). We note π0,i = πθ0 (ai|xi) the associated propensities and assume them to be known. We will assume that the policies in πθ, θ ∈ Θ admit densities so that the propensities will denote the density function of the logging policy on the actions given the contexts. The expected risk of a model θ is defined as: L(θ) = Ex,θ,y [y] . (1) Counterfactual reasoning uses the logged data sampled from the logging policy associated to θ0 to estimate the risk of any model θ ∈ Θ with importance sampling: L(θ) = Ex,θ0,y (cid:20) y πθ(a|x) πθ0 (a|x) (cid:21) , (2) under the common support assumption (the support of πθ support is included in the support of πθ0 ). The goal in CRM is to find a model θ ∈ Θ with minimal risk by minimizing ˆθ ∈ arg min θ∈Θ L0(θ), (3) n (cid:113) ˆV0(θ) where L0(θ) = ˆL0(θ) + λ uses the sample variance penalization principle (Maurer & Pontil, 2009) on samples from θ0 with counterfactual estimates of the expected risk ˆL0, an empirical variance ˆV0 and λ > 0. Specifically, in the (CRM) framework, multiple estimators are derived from the IPS method (Horvitz & Thompson, 1952) that uses the following clipped importance sampling estimator of the risk of a model θ by Bottou et al. (2013); Swaminathan & Joachims (2015a): ˆLIS 0 (θ) = 1 n n (cid:88) i=1 yi min (cid:18) πθ(ai|xi) πi (cid:19) , α , (4) a where α is χi(θ) = yi min( πθ(ai|xi) the empirical variance estimator becomes: parameter. , α) and ̄χ(θ) = 1 n clipping π0,i Writing i=1 χi(θ) (cid:80)n ˆV IS 0 (θ) = 1 n − 1 n (cid:88) (χi(θ) − ̄χ(θ))2. i=1 (5) Other estimators aim at controlling the variance of the es- timator with self-normalized estimators (Swaminathan & Joachims, 2015b) or with direct methods (Dudik et al., 2011; Dud ́ık et al., 2014) in doubly robust estimators. Even so, the performance of counterfactual learning is harmed when 3 the logging policy under-explores the action space (Owen, 2013). Likewise, counterfactual estimates obtained from a first round of randomized data collection may not suffice (Bottou et al., 2013) to select a model ˆθ. In those cases, it could be natural to consider collecting additional samples. While it is possible to use the same logging model θ0 to do so, we will present a framework for designing an improved sequential data collection strategy, following the intuition of sequential designs of Bottou et al. (2013). 3.2. Sequential Designs In this section we present a design of data collections that sequentially learn a policy from logged data in or- der to deploy it and learn from the newly collected data. Specifically, we assume that at a round m ∈ {1, . . . M }, a model θm ∈ Θ is deployed and a set sm of nm observa- tions sm = (xm,i, am,i, ym,i, πm,i)i=1,...,nm is collected thereof, with propensities πm,i = πθm(am,i|xm,i) to learn a new model θm+1 and reiterate. In this work, we assume that the loss y is bounded in [−1, 0] as in (Swaminathan & Joachims, 2015a) (note however that this assumption could be relaxed to bounded losses) and follows a fixed distribu- tion PY . Next, we will introduce useful definitions. Definition 3.1 (Excess Risk and Expected Regret). Given an optimal model θ∗ ∈ arg minθ∈Θ L(θ), we write for each rollout m the excess risk: ∆m = L(θm) − L(θ∗), and define the expected regret as: Rn = M (cid:88) m=0 ∆mnm+1. (6) (7) The objective is now to find a sequence of models {θm}m=1...M that have an excess risk and an expected regret Rn that improve upon CRM guarantees. To do so, we define a sequence of minimization problems for m ∈ {1, . . . M }: ˆθm+1 ∈ arg min θ∈Θ Lm(θ), (8) where Lm is an objective function that we define in Sec- tion 4.2. Note that in the setting we consider, samples are i.i.d inside a rollout m but dependencies exist between differ- ent sets of observations. From a causal inference perspective (Peters et al., 2017), this does not incur an additional bias because of the successive conditioning on past observations. We provide detailed explanations in Appendix A.1 on this matter. Note also that the main intuition and motivation of our work is to shed light on how learning intermediate mod- els θm to adaptively collect data can improve upon sampling from the same logging system by using the same total sam- ple size n = (cid:80)m i=0 nm. To illustrate the learning benefits of SCRM we now provide a simple example. Sequential Counterfactual Risk Minimization Algorithm 1 Sequential Counterfactual Risk Minimization Input: Logged observations (x0,i, a0,i, y0,i, π0,i)i=1,...,n0, parameter λ > 0 for m = 1 to M do Build Lm from observations sm using Eq. (11) Learn θm+1 using Eq. (8) Deploy the model θm+1 and collect observations sm+1 = (xm+1,i, am+1,i, ym+1,i, πm+1,i)i=1,...,nm+1 end Example 3.1 (Gaussian policies with quadratic loss). Let us consider Gaussian parametrized policies πθ = N (θ, σ2) and a loss lt(a) = (a − yt)2 − 1 where yt ∼ N (θ∗, σ2). We illustrate in Figure 1 the evolution of the losses of learned models θm through 15 rollouts with either i) Batch CRM learning on aggregation of data, being generated by the unique initial logging policy θ0 or ii) Sequential CRM learn- ing with models θ0, . . . , θm−1 deployed adaptively, with data being generated by the last learned model θm−1 for the batch m. We see that the models learned with SCRM take larger optimization steps than the ones with CRM. We summarize our (SCRM) framework in Algorithm 1 with the different blocks exposed previously. We provide an ad- ditional graphical illustration of SCRM compared to CRM in Appendix A.1. In the next section we will define counter- factual estimators from the observations sm at each round and define a learning strategy Lm. 4. Variance-Dependent Convergence Guarantees In this part we aim at providing convergence guarantees of counterfactual learning. We show how we can obtain a dependency of the excess risk on the variance of importance weights between the logging model and the optimal model. 4.1. Implicit exploration and controlled variance We first introduce a new counterfactual estimator. For this, we will require a common support assumption as in impor- tance sampling methods (Owen, 2013). We will assume that the policies πθ for θ ∈ Θ have all the same support. We then consider the following estimator of the risk of a model θ: ˆLIPS-IX m (θ) = 1 nm nm(cid:88) i=1 πθ,i πm,i + απθ,i ym,i, (9) where πθ,i = πθ(am,i|xm,i) and α is like a clipping parameter which ensures that the modified propensi- ties πm,i + απθ(am,i|xm,i) are lower bounded. Noting ζi(θ) = (cid:0) i=1 ζi(θ) − 1(cid:1)ym,i, ̄ζ(θ) = 1 nm πθ,i πm,i+απθ,i (cid:80)nm we can write the empirical variance estimator as: ˆV IPS-IX m (θ) = 1 nm − 1 nm(cid:88) (ζi(θ) − ̄ζ(θ))2. (10) i=1 πθ,i πm,i+απθ,i the empirical variance uses a control variate Here, since it uses the expression of ζi(θ) above instead of ym,i . This allows to improve the dependency on the variance in the excess risk provided in Proposition 4.2. Note also that our estimator resembles the implicit exploration estimator in the EXP3-IX algorithm (Lattimore & Szepesvari, 2019), as our motivation is to improve the control of the variance. 4.2. Learning strategy Next, we aim in this part to provide a learning objective strategy Lm, as referred to in Eq. (8). Our approach, like the (CRM) framework, uses the sample variance penalization principle (Maurer & Pontil, 2009) to learn models that have low expected risk with high probability. To do so, we first provide an assumption to be used in our generalization error bound. Assumption 4.1 (Bounded importance weights). For any models θ, θ′ ∈ Θ and any (x, a) ∈ X × A, we assume πθ(a|x)/πθ′(a|x) ≤ W , for some W > 0. This assumption has been made in previous works (Kallus & Zhou, 2018; Zenati et al., 2020) and is reasonable when we consider a bounded parameter space Θ. Next, we state an error bound for our estimator. Proposition 4.1 (Generalization Error Bound). Let ˆLIPS-IX and ˆV IPS-IX be the empirical estimators defined respectively m in Eq. (9) and Eq. (10). Let θ ∈ Θ, δ ∈ (0, 1), and nm ≥ 2. Then, under Ass. 4.1, for λm = (cid:112)18(Cm(Θ) + log(2/δ)), with probability at least 1 − δ: m L(θ) ≤ ˆLIPS-IX m (θ) + λm (cid:115) ˆV IPS-IX m nm (θ) + 2λ2 mW nm + δm, where Cm(Θ) is a metric entropy complexity measure de- fined in App. B.1 and δm = (cid:112)log(2/δ)/(2nm). This Proposition is proved in Appendix B.2 and essentially uses empirical bounds (Maurer & Pontil, 2009). By mini- mizing the latter high-probability upper bound, we can find models θ with guarantees of minimizing the expected risk. Therefore, at each round, we minimize the following loss: Lm(θ) = ˆLIPS-IX m (θ) + λm (cid:115) ˆV IPS-IX m nm (θ) , (11) where λm > 0 is a positive parameter. Unlike deterministic decision rules used for example in UCB-based algorithms (Lattimore & Szepesvari, 2019), the exploration is naturally guaranteed by the stochasticity of the policies we use. 4 Sequential Counterfactual Risk Minimization Figure 1: Comparison of CRM and SCRM on a simple setting described in Example 3.1. The models learned through CRM using re-deployments of θ0 (left) reach θ∗ slower than SCRM (center) that uses intermediate deployments θ1, . . . , θM indicated with 'x' markers and rollout numbers. The comparison of the evolution of averaged losses (right) over 10 random runs also shows SCRM converges faster. Here θ∗ = 1, σ = 0.3 and we take M = 15 total rollouts with batches m of size nm = 100 × 2m. The parameter λ is set to its theoretical value. 4.3. Excess risk upper bound 5. SCRM Analysis Eventually, we establish an upper bound on the excess risk of the IPS-IX estimator for counterfactual risk minimization using the learning strategy that we just defined. For this, we require an assumption on the complexity measure. Assumption 4.2. We assume that the set Θ is compact and that there exists d > 0 such that Cm(Θ) ≤ d log(nm). This assumption states that the complexity grows logarithmi- cally with the sample size. It holds for parametric policies so long as the propensities are lower bounded, which is verified using our estimator. We now state our variance-dependent excess risk bound. Proposition 4.2 (Excess Risk Bound). Let nm ≥ 1 and θm ∈ Θ. Let sm be a set of nm samples collected with pol- icy πθm . Then, under Assumptions 4.1 and 4.2, a minimizer θm+1 of Eq. (11) on the samples sm satisfies the excess risk upper-bound: w.p. 1 − δ ∆m+1 = L(θm+1) − L(θ∗) (cid:114) ≲ ν2 m d log nm −log δ nm + W 2 + W (d log nm −log δ) nm , where ν2 m = Varx,θm (cid:18) πθ∗ (a|x) πθm(a|x) (cid:19) . The proof is postponed to Appendix B.2. The modified propensities in IPS-IX as well as the control variate used in the variance estimator allow us to improve the dependency in ν2 m+1 obtained in previous work (Zenati et al., 2020). This turns out to be a crucial point to use these error bounds sequentially as in acceleration methods since νm → 0 if θm → θ∗, as explained in the next section. m, compared to ν2 In this section we provide the main theoretical result of this work on the excess risk and regret analysis of SCRM. We start by stating an assumption that is common in acceleration methods (d'Aspremont et al., 2021) with restart strategies (Becker et al., 2011; Nesterov, 2012) that we will require to achieve the benefits of sequential designs. Assumption 5.1 (H ̈olderian Error Bound). We assume that there exist γ > 0 and β > 0 such that for any θ ∈ Θ, there exists θ∗ ∈ arg minθ∈Θ L(θ) such that γVarx,θ (cid:19) (cid:18) πθ∗ (x|a) πθ(x|a) ≤ (L(θ) − L(θ∗))β . Typically, in acceleration methods, H ̈olderian error bounds (Bolte et al., 2007) are of the form: γd(θ, S∗ Θ) ≤ (L(θ) − L(θ∗))β for some γ, β > 0 and where d(θ, S∗ Θ) is some distance to the optimal set (S∗ Θ = arg minθ∈Θ L(θ)). This bound is akin to a local version of strong convexity (β = 1) or a bounded parameter space (β = 0) if d is the Euclidean distance. When β ∈ [0, 1], this has also been referred to as the Łojasiewicz assumption introduced in (Łojasiewicz, 1963; 1993). Notably, it has been used in online learning (Gaillard & Wintenberger, 2018) to obtain fast rates with restart strategies. This assumption holds for instance for Example 3.1 with β = 1 (see App C.1). We also discuss this assumption for distributions in the exponential family in Appendix C.2 notably for distributions that have been used practice (Swaminathan & Joachims, 2015b; Kallus & Zhou, 2018; Zenati et al., 2020). Next we state our main result that is the acceleration of the excess risk convergence rate and the regret upper bound of SCRM. 5 *0M1.21.00.80.60.40.20.00.21611CRMloss functionestimated loss0M*confidence setintermediate m*0M1.21.00.80.60.40.20.00.21611Sequential CRMloss functionestimated loss0M*confidence setintermediate m2468101214Rollouts m0.90.80.70.60.50.4LossLoss EvolutionCRMSCRM Sequential Counterfactual Risk Minimization Proposition 5.1. Let n0, n ≥ 2 and θ∗ ∈ arg minθ L(θ). )(cid:5). Let nm = n02m for m = 0, . . . , M = (cid:4) log2(1 + n Then, under Assumptions 4.1, 4.2 and 5.1 with β > 0, the SCRM procedure (Alg. 1) satisfies the excess risk upper- bound n0 ∆M = L(θM ) − L(θ∗) ≤ O (cid:16) n− 1 2−β log n (cid:17) . Moreover, the expected regret is bounded as follows: Rn = M (cid:88) m=0 ∆mnm+1 ≤ O (cid:16) 1−β 2−β log(n)2(cid:17) . n The proof of our result is detailed in Appendix B.3. n √ Discussion This result illustrates that an excess risk of (cid:1) may be obtained when β = 1 (which is order O(cid:0) log(n) implied by a local version of strong convexity assumption in acceleration methods). When β = 0, which merely ac- counts that the variance of importance weights are bounded, we simply recover the original rate of CRM of order O(log(n)/ n). The SCRM procedures thus improves the excess risk rate whenever β > 0. It is worth to emphasize that the knowledge of β is not needed by Alg. 1. We also note that our assumption seems related to the Bernstein condition (Bartlett & Mendelson, 2006, see Def 2.6), and (van Erven et al., 2015, see Def 5.1) that bounds a variance term by an excess risk term to the power. In empirical risk minimization, this implies the same excess risk rate and regret rate (van Erven & Koolen, 2016), which are exactly the same rates as ours (up to logs). 6. Empirical Evaluation In this section we perform numerical experiments to validate our method in practical settings. We present the experimen- tal setup as well as experiments comparing SCRM to related approaches and internal details of the method. 6.1. Experimental setup As our method is able to handle both discrete and continu- ous actions we experiment in both settings. We now provide a brief description of the setups, with extensive details avail- able in Appendix D.2. 1 Continuous actions We perform evaluation on synthetic problems pertaining to personalized pricing problems from (Demirer et al., 2019) (Pricing) and advertising from (Zenati et al., 2020) (Advertising). We consider Gaussian 1All the code to reproduce the empirical is available at: https://github.com/criteo-research/ sequential-conterfactual-risk-minimization results policies πθ(*|x) = N (μθ(x), σ2) with linear contextual parametrization μθ(x) = θ⊤x and fixed variance σ2 that corresponds to the exploration budget allowed in the original randomized experiment. The features are up to 10 dimen- sions and the actions are one-dimensional. We keep the original logging baselines from the settings and compare results to a skyline supervised model trained on the whole training data with full information. Discrete actions We adapt the setup of (Swaminathan & Joachims, 2015a) that transforms a multilabel classification task into a contextual bandit problem with discrete, combina- torial action space. We keep the original modeling (akin to CRF) with categorical policies πθ(a|x) ∝ exp(θ⊤(x (cid:78) a)). The baseline (resp. skyline) is a supervised, full information model with identical parameter space than CRM methods trained on 5% (resp. 100%) of the training data. We consider the class of probabilistic policies that satisfy Assumption 5.1 by predicting actions in an Epsilon Greedy fashion (Sut- ton & Barto, 1998)): πε θ(a, x) = (1 − ε)πθ(a, x) + ε/|A| where ε = .1. Real-world datasets include Scene, Yeast and TMC2007 with feature space up to 30,438 dimensions and action space up to 222. To account for this combinatorial action space we allow a model θm to be learned using data from all past rollouts {sl}l<m for better sample efficiency and therefore adjust variance estimation in Appendix A.2 to take into account sequential dependencies. 6.2. SCRM compared to CRM and related methods We first compare SCRM to CRM and existing methods in the literature. Comparison between SCRM and CRM First, we pro- vide insights on the performance that SCRM can achieve compared to classical CRM with increasing sample sizes. The key difference between CRM/SCRM is that for each sample size nm CRM learns from samples generated by the logging model sCRM m ← θ0 (see Alg. 2) whilst SCRM learns from samples generated by a series of optimized mod- els sSCRM ← θm (see Alg. 1). For each sample size we m select a posteriori the best λ for both methods based on test set loss value. We report in Figure 2 over M = 10 rollouts the mean test loss depending on sample size up to 210, with standard deviation estimated over 10 random runs. We observe that SCRM converges very fast, often within the first rollouts. Conversely, CRM needs more samples and the variance is higher. We conclude that there is a striking benefit to use a sequential design in order to achieve near optimal loss with much fewer samples and better confidence compared to CRM. Complementary results on other datasets are available in Appendix E.1. Moreover, to further illustrate this benefit of efficient learn- ing we also report in Table 1 the sample size needed to 6 Sequential Counterfactual Risk Minimization Figure 2: Test loss as a function of sample size on Scene, Yeast, TMC2007, Advertising, (from left to right). SCRM (in orange) converges faster and with less variance than CRM (in blue). Percentage p CRM SCRM (ours) 0.7 100 × 210 100 × 28 0.9 0.8 100 × 216 > 100 × 222 100 × 29 100 × 211 Table 1: Needed sample size to achieve test loss L(θ) ≤ p∗ L(θ∗) on the setting in Example 3.1 over the average of 10 random runs. SCRM needs way less data to converge to near optimal solution. λ is set to its theoretical value. Pricing Advertising λ′ −5.353 ± .178 −.716 ± .020 ˆλ −5.575 ± .036 −.726 ± .001 Yeast .294 ± .026 .299 ± .039 TMC2007 .146 ± .012 .164 ± .021 Table 2: Test loss after 10 rollouts when choosing λ by a posteriori selection (λ′) or with proposed heuristic (ˆλ). Our heuristic is competitive with the a posteriori selection of a fixed λ′. attain near optimal performance when θ∗ is known as in Example 3.1, where we also observe that SCRM reaches optimal performances faster than CRM. This corroborates the benefits of improved excess risk rates for SCRM. Hyper-parameter selection for SCRM In our experi- ments, hyperparameter selection consists in choosing a value for λ. We describe a simple heuristic and evaluate its performance on different datasets. We propose to select ˆλm by estimating the non-penalized CRM loss (eq. 3) using of- fline cross-validation on past data st<m. We report in Table 2 the test loss obtained when choosing a fixed λ a posteriori (λ′) or with this heuristic (ˆλ). We observe that loss confi- dence intervals for both methods intersect for all discrete datasets, except on TMC2007 where the degradation shows only at the 3rd digit. On continuous datasets, the heuristic actually improves upon the fixed a posteriori selection. We conclude that this heuristic is usable in practice. Comparison with other methods In this paragraph we compare our SCRM to related methods to explore practical implications of existing methods in our setting. We first consider batch bandits methods and implement the stochas- tic sequential batch pure exploitation (SBPE) algorithm in (Han et al.) and a batch version of kernel UCB (Valko et al., 7 2013) algorithm (BKUCB) with an optimized library (see implementations details in Appendix D.3). We also exper- iment with off-policy RL methods PPO (Schulman et al., 2017) and TRPO (Schulman et al., 2015) from the Stable- Baselines library (Raffin et al., 2021) (see Appendix D.3). Indeed, such methods model more general state transitions based on past actions, but they could be used in our set- ting. To fairly compare all methods (in particular those for which no heuristic existing for hyper-parameter selection) we report the mean and standard deviation over 10 random runs of the best test loss a posteriori over hyperparameter grids of the same size. First, we observe that SCRM beats CRM on all datasets, illustrating the benefit of the sequential design. Second, on discrete tasks (where we the combinato- rial action space is large) we observe that SCRM achieves nearly the best test loss in all tasks, while RL methods have difficulties maintaining good performances. Third, batch bandits algorithms can achieve good performances in prac- tice because of their deterministic decision rules. However, they involve an O(n3) matrix inversion and therefore did not finish (DNF) in 24h (per single run) on a 46 CPU / 500G RAM machine in most of our settings with large sample size n, which make them unpractical for large scale experiments. We conclude that SCRM is an effective learning paradigm and that it scales successfully on a variety of settings. 6.3. Details on SCRM Next, we provide additional empirical evaluations of details of our method. Evaluation of IPS-IX To understand the bias-variance trade-off that IPS-IX can achieve in practice compared to other counterfactual estimators we consider a policy eval- uation experiment. The task we consider uses sinusoidal losses y(a) = cos(a) and evaluated policies are shifted Gaussians {πi = N (i ∗ π/4, 1)}i=0,4, with π0 being the logging policy. Evaluated policies with large shifts with π0 therefore simulate the setting where the logging policy under-explores the action space. The estimators we consider include IPS, SNIPS (Swaminathan & Joachims, 2015b), clipped IPS (eq. 4) with heuristic from (Bottou et al., 2013) and IPS-IX (eq. 9) with α = 1/n. All methods therefore use 246810Rollouts m0.750.700.650.600.550.500.45LossAdvertisingCRMSCRM Sequential Counterfactual Risk Minimization n/|A|/dim(X )| Baseline SBPE BKUCB TRPO PPO CRM SCRM (ours) Skyline Pricing 105/∞/10 Advertising 105/∞/2 −3.414 ± .162 −.431 ± .120 DNF DNF DNF DNF -5.750 ± .020 −.670 ± .030 −5.274 ± .200 −.637 ± .015 −5.325 ± .068 −.594 ± .100 -.726 ± .020 −5.575 ± .036 −5.830 ± .020 −.739 ± .002 Scene 2.103/26/295 .353 ± .009 .179 ± .001 .236 ± .014 .376 ± .001 .206 ± .001 .233 ± .031 .219 ± .009 .179 ± .002 Yeast 2.103/214/104 .478 ± .014 .302 ± .003 .303 ± .004 .434 ± .001 .463 ± .001 .362 ± .044 .294 ± .026 .312 ± .003 TMC2007 3.104/222/3.104 .511 ± .003 DNF DNF .396 ± .001 .263 ± .001 .158 ± .034 .146 ± .012 .142 ± .001 Table 3: Test loss ± stddev of different methods after 10 rollouts. SCRM achieves optimal or near optimal performance in all datasets. Batch bandit methods did not finish (DNF) on large scale settings, and RL methods perform overall poorly on discrete settings with large action space. their respective heuristics to set hyperparameters. We report in Figure 3 the bias and variance of estimators for each shift μ0 − μ = i ∗ π/4 for i = 0, . . . , 4. We observe that IPS- IX shows an empirical bias comparable to IPS, lower than SNIPS and clipped IPS while maintaining a lower variance. Moreover its variance is only slightly higher than clipped IPS which introduced a large bias. We conclude that besides being a key component of our analysis IPS-IX also controls the variance with a better trade-off in practice. More details are available in Appendix E.2. Figure 3: Comparison of counterfactual estimators on policy evaluation. Bias (left), Variance (right). IPS-IX shows a low bias and compares favorably to IPS and SNIPS in terms of variance. When is SCRM useful is a natural question of interest when choosing the method to be used on a given logged bandit feedback problem. Intuitively one can imagine that SCRM will be most useful when the logging policy under- explores the action space, for example when the distance (in parameter space) between the logging and optimal parame- ters is large. To study this question we proceed to the follow- ing experiment on the setup of Example 3.1 with Gaussian distributions N (θ, σ) and fixed loss variance σ∗ = Vary(y). We vary the distance δ0 = ∥θ∗ − θ0∥ between the optimal 8 Figure 4: Best final loss when varying δ0 = ∥θ∗ − θ0∥. SCRM achieves better losses especially for larger δ0. model θ∗ and the logging model θ0. Since the ideal explo- ration level may be task dependent we choose a posteriori the best σ on a grid, for both CRM and SCRM. We report in Figure 4 the best final loss for both CRM and SCRM for a range of values of δ0. We observe in particular that SCRM achieves better final losses for larger distances δ0 than CRM. With the same number of rollouts M , SCRM can extend the exploration to further areas while CRM fails for any exploration level in those cases, which advocates for using sequential deployments. 7. Discussions In this work, we have proposed a method to extend the CRM perspective for designing sequential data collection experi- ments. We have introduced a novel counterfactual estimator to improve variance control in excess risk bounds. Under a weak error bound assumption, we have sequentially applied these excess risk guarantees to achieve faster rates similarly to acceleration methods. Our method also improves upon CRM in practice and is particularly well-suited for this set- ting compared to existing methods in the literature. It is worth noting that, in order to avoid introducing dependen- cies in the excess risk bounds we analyzed, the theoretical 0123Shift 00.000.010.020.030.040.05Bias2ipsips_clippedsnipsips_ix0123Shift 00.00000.00250.00500.00750.01000.01250.0150Varianceipsips_clippedsnipsips_ix101100101102|*0|100101102103LossSCRMCRM Sequential Counterfactual Risk Minimization algorithm we have studied uses geometric sample sizes to discard previous samples. However, using all past samples has been found to be also effective in practice and develop- ing guarantees for this case would be an interesting area for future research. Additionally, similar to online settings that involve an exploration-exploitation tradeoff, investigating the use of optimism in the face of uncertainty (OFUL) prin- ciple in SCRM would also be a promising avenue for future work. Acknowledgements The authors thank Alberto Bietti for the insightful early discussions on this project. The authors also thank the reviewers for their feedback on this paper. This work was supported by ANR 3IA MIAI@Grenoble-Alpes (ANR-19- P3IA0003). References Audibert, J.-Y., Munos, R., and Szepesvari, C. Tuning bandit algorithms in stochastic environments. In Interna- tional Conference on Algorithmic Learning Theory, 2007. 2 Auer, P., Cesa-Bianchi, N., and Fischer, P. Finite-time analysis of the multiarmed bandit problem. Machine Learning, 47:235–256, 05 2002. 2 Bakshy, E., Dworkin, L., Karrer, B., Kashin, K., Letham, B., Murthy, A., and Singh, S. Ae: A domain-agnostic platform for adaptive experimentation. 2018. 2 Bartlett, P. L. and Mendelson, S. Empirical minimization. Probability Theory and Related Fields, 2006. 6 Becker, S. R., Cand`es, E. J., and Grant, M. C. Templates for convex cone problems with applications to sparse signal recovery. Mathematical Programming Computation, 3 (3):165–218, jul 2011. 2, 5 Bibaut, A., Kallus, N., Dimakopoulou, M., Chambaz, A., and van der Laan, M. Risk minimization from adap- tively collected data: Guarantees for supervised and pol- icy learning. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 19261–19273. Curran Associates, Inc., 2021. 2 Bolte, J., Daniilidis, A., and Lewis, A. The Łojasiewicz in- equality for nonsmooth subanalytic functions with appli- cations to subgradient dynamical systems. SIAM Journal on Optimization, 17(4):1205–1223, 2007. 2, 5 Bottou, L., Peters, J., Qui ̃nonero Candela, J., Charles, D. X., Chickering, D. M., Portugaly, E., Ray, D., Simard, P., and Snelson, E. Counterfactual reasoning and learning systems: The example of computational advertising. Jour- nal of Machine Learning Research (JMLR), 14(1):3207– 3260, 2013. 1, 2, 3, 7, 24 Boyd, S. and Vandenberghe, L. Convex Optimization. Cam- bridge University Press, 2004. 1, 2 Calandriello, D., Carratino, L., Lazaric, A., Valko, M., and Rosasco, L. Near-linear time Gaussian process optimiza- tion with adaptive batching and resparsification. In Inter- national Conference on Machine Learning (ICML), 2020. 2 Chu, W., Li, L., Reyzin, L., and Schapire, R. Contextual ban- dits with linear payoff functions. In Gordon, G., Dunson, D., and Dud ́ık, M. (eds.), Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learn- ing Research, pp. 208–214, Fort Lauderdale, FL, USA, 11–13 Apr 2011. PMLR. 2 Dai, B., Nachum, O., Chow, Y., Li, L., Szepesv ́ari, C., and Schuurmans, D. Coindice: Off-policy confidence interval In Proceedings of the 34th International estimation. Conference on Neural Information Processing Systems, NIPS'20, Red Hook, NY, USA, 2020. Curran Associates Inc. 1 Demirer, M., Syrgkanis, V., Lewis, G., and Chernozhukov, V. Semi-parametric efficient policy learning with continuous actions. In Advances in Neural Information Processing Systems (NeurIPS), 2019. 6, 23 Dudik, M., Langford, J., and Li, L. Doubly robust policy evaluation and learning. In International Conference on Machine Learning (ICML), 2011. 3 Dud ́ık, M., Erhan, D., Langford, J., and Li, L. Doubly robust policy evaluation and optimization. Statist. Sci., 29(4):485–511, 11 2014. doi: 10.1214/14-STS500. 2, 3 d'Aspremont, A., Scieur, D., and Taylor, A. Acceleration methods. Foundations and Trends® in Optimization, 5 (1-2):1–245, 2021. ISSN 2167-3888. 2, 5, 22 Faury, L., Tanielian, U., Dohmatob, E., Smirnova, E., and Vasile, F. Distributionally Robust Counterfactual Risk Minimization. Proceedings of the AAAI Conference on Artificial Intelligence, 34(04):3850–3857, Apr. 2020. 22 Foster, D. and Rakhlin, A. Beyond UCB: Optimal and efficient contextual bandits with regression oracles. In III, H. D. and Singh, A. (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 3199–3210. PMLR, 13–18 Jul 2020. 2 9 Sequential Counterfactual Risk Minimization Gaillard, P. and Wintenberger, O. Efficient online algorithms for fast-rate regret bounds under sparsity. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. 2, 5 Gao, Z., Han, Y., Ren, Z., and Zhou, Z. Batched multi-armed bandits problem. Proceedings of the 33rd International Conference on Neural Information Processing Systems, 2019. 2 Goldenshluger, A. and Zeevi, A. A linear response bandit problem. Stochastic Systems, 3(1):230 – 261, 2013. 2 Nesterov, Y. Gradient methods for minimizing composite functions. Mathematical Programming, 140:125 – 161, 2012. 1, 2, 5 Nocedal, J. and Wright, S. J. Numerical Optimization. Springer, New York, NY, USA, 2e edition, 2006. 2 Owen, A. B. Monte Carlo theory, methods and examples. 2013. 2, 3, 4, 13, 14 Perchet, V., Rigollet, P., Chassang, S., and Snowberg, E. Batched bandit problems. The Annals of Statistics, 44, 05 2015. 2 Han, Y., Zhou, Z., Zhou, Z., Blanchet, J. H., Glynn, P. W., and Ye, Y. Sequential batch learning in finite-action linear contextual bandits. doi: 10.48550/ARXIV.2004.06321. 2, 7, 25 Peters, J., Janzing, D., and Sch ̈olkopf, B. Elements of Causal Inference: Foundations and Learning Algorithms. Adaptive Computation and Machine Learning. MIT Press, Cambridge, MA, 2017. 2, 3, 12 Harutyunyan, A., Bellemare, M. G., Stepleton, T., and Munos, R. Q(λ) with off-policy corrections. In Ort- ner, R., Simon, H. U., and Zilles, S. (eds.), Algorithmic Learning Theory, pp. 305–320, Cham, 2016. Springer International Publishing. 2 Horvitz, D. G. and Thompson, D. J. A generalization of sam- pling without replacement from a finite universe. Journal of the American Statistical Association, 47(260):663–685, 1952. 3 Kallus, N. and Zhou, A. Policy evaluation and optimization with continuous treatments. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2018. 1, 4, 5, 22, 23 Kasy, M. and Sautmann, A. Adaptive treatment assignment in experiments for policy choice. Econometrica, 89(1): 113–132, 2021. 2 Lattimore, T. and Szepesvari, C. Bandit Algorithms. 2019. 2, 4, 25 Li, L., Chu, W., Langford, J., and Schapire, R. E. A contextual-bandit approach to personalized news article In Proceedings of the 19th Interna- recommendation. tional Conference on World Wide Web, WWW '10, New York, NY, USA, 2010. ACM. 2 Maurer, A. and Pontil, M. Empirical bernstein bounds and sample variance penalization. In Conference on Learning Theory (COLT), 2009. 2, 3, 4, 15, 16 Munos, R., Stepleton, T., Harutyunyan, A., and Bellemare, M. G. Safe and efficient off-policy reinforcement learn- ing. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS'16, pp. 1054–1062, Red Hook, NY, USA, 2016. Curran Asso- ciates Inc. 2 Powell, M. J. Restart procedures for the conjugate gradient method. Math. Program., 12(1):241–254, dec 1977. 2 Raffin, A., Hill, A., Gleave, A., Kanervisto, A., Ernestus, M., and Dormann, N. Stable-baselines3: Reliable rein- forcement learning implementations. Journal of Machine Learning Research, 22(268):1–8, 2021. 7, 25 Sachdeva, N., Su, Y., and Joachims, T. Off-policy bandits with deficient support. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discov- ery and Data Mining, KDD '20, pp. 965–975, New York, NY, USA, 2020. Association for Computing Machinery. 2 Schulman, J., Levine, S., Moritz, P., Jordan, M. I., and Abbeel, P. Trust region policy optimization. 2015. doi: 10.48550/ARXIV.1502.05477. 2, 7, 25 Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. Proximal policy optimization algorithms. 2017. doi: 10.48550/ARXIV.1707.06347. 2, 7, 25 Simchi-Levi, D. and Xu, Y. Bypassing the monster: A faster and simpler optimal algorithm for contextual bandits un- der realizability. SSRN Electronic Journal, 2020. ISSN 1556-5068. doi: 10.2139/ssrn.3562765. 2 Sutton, R. S. and Barto, A. G. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. ISBN 0262193981. 2, 6, 24 Swaminathan, A. and Joachims, T. Counterfactual risk minimization: Learning from logged bandit feedback. In International Conference on Machine Learning (ICML), 2015a. 1, 2, 3, 6, 12, 21, 22, 24 Swaminathan, A. and Joachims, T. The self-normalized In Advances in estimator for counterfactual learning. Neural Information Processing Systems (NIPS). 2015b. 1, 2, 3, 5, 7 10 Sequential Counterfactual Risk Minimization Valko, M., Korda, N., Munos, R., Flaounas, I., and Cristian- ini, N. Finite-Time Analysis of Kernelised Contextual Bandits. In Uncertainty in Artificial Intelligence, Belle- vue, United States, July 2013. 2, 7, 25 van Erven, T. and Koolen, W. M. Metagrad: Multiple learning rates in online learning. In Advances in Neural Information Processing Systems, 2016. 6 van Erven, T., Gr ̈unwald, P. D., Mehta, N. A., Reid, M. D., and Williamson, R. C. Fast rates in statistical and online learning. Journal of Machine Learning Research, 2015. 6 Zenati, H., Bietti, A., Martin, M., Diemert, E., Gaillard, P., and Mairal, J. Counterfactual learning of stochastic policies with continuous actions: from models to offline evaluation. 2020. doi: 10.48550/ARXIV.2004.11722. 4, 5, 6, 22, 23, 24 Zenati, H., Bietti, A., Diemert, E., Mairal, J., Martin, M., and Gaillard, P. Efficient kernelized ucb for contextual bandits. In Camps-Valls, G., Ruiz, F. J. R., and Valera, I. (eds.), Proceedings of The 25th International Conference on Artificial Intelligence and Statistics, volume 151 of Proceedings of Machine Learning Research, pp. 5689– 5720. PMLR, 28–30 Mar 2022. 2 Zhan, R., Ren, Z., Athey, S., and Zhou, Z. Policy learning with adaptively collected data. 2021. doi: 10.48550/ ARXIV.2105.02344. 2 Łojasiewicz, S. Une propri ́et ́e topologique des sous en- sembles analytiques r ́eels. Les ́equations aux d ́eriv ́ees partielles, 1963. 5 Łojasiewicz, S. Sur la g ́eom ́etrie semi et sous analytique. Annales de l'institut Fourier, 43(5):1575–1595, 1993. ISSN 2167-3888. 5 11 Sequential Counterfactual Risk Minimization This appendix is organized as follows: in Appendix A, we provide additional explanations on counterfactual methods related to our approach. In Appendix B, we detail our analysis of our counterfactual estimator as well as the general SCRM procedure, as given in Alg. 1. Next, in Appendix D we present all the details of the empirical evaluation and eventually in Appendix E we provide all additional empirical results that were omitted from the main paper due to space limitation. A. Additional details on counterfactual estimators A.1. Unconfoundedness in sequential designs In these explanations, we recall that the distributions of contexts as well as the distribution of losses are fixed. In other words, the latter do not vary from one batch to another. In the counterfactual risk minimization framework (CRM) (Swaminathan & Joachims, 2015a), the causal graph (using the conventions in (Peters et al., 2017)) can be represented as shown in Figure 5. X θ A Y context model treatment outcome Figure 5: Causal Graph in a randomized data collection experiment. A denotes action (or treatment), X context, Y is the loss (or outcome). The causal influence of the contexts on actions is done through the model θ. In the sequential counterfactual risk minimization (SCRM) framework, if we unfold the causal graph, the following representation can be given in Figure 6. Xt θt At Yt Xt+1 θt+1 At+1 Yt+1 context model treatment outcome Figure 6: Causal Graph in a sequential randomized data collection experiment. A denotes action (or treatment), X context, Y is the loss (or outcome). The contextual treatments are taken through the models θt. Therefore, it is clear that in general, θt ̸⊥⊥ θt+1. However, from d-separation and faithfullness (Peters et al., 2017), we have for t′ < t: θt ⊥⊥ θt′|θt−1. Therefore, given that all the dependencies are observed and that we can condition on the direct parents of a given model θt, sequential randomized data collection are possible. We eventually provide in Figure 7 an illustration of SCRM and CRM. Figure 7: Graphical illustration of SCRM setup (left) and CRM (right), learned with same amount of data after each batch m. The training data are displayed with color block and the policy used to sample actions in these block are either adaptive (SCRM) or using the loggind model θ0 (CRM). 12 θ1θ2θ3Learn modelRollout m=1m=2θ2m=0θ1θ0Data sampled fromθ1θ2θ3Learn modelRollout m=1m=2m=0 A.2. Multiple Importance Sampling Estimators Sequential Counterfactual Risk Minimization Note that in order to avoid introducing dependencies in the excess risk bounds we analyzed, the theoretical algorithm we have studied uses geometric sample sizes to discard previous samples. However, using all past samples is effective in practice and developing guarantees for this case would be an interesting area for future research. We present in this section a estimators using aggregation of all previous information. In particular, we can use Multiple Importance Sampling (MIS) (Owen, 2013) over all previous samples. Consider in particular a partition of unity with m > 1 weight functions ωt(a) > 0 which satisfies (cid:80)m t=0 ωt,m(a) = 1 for all a and m ∈ {0, . . . M }. The MIS estimator writes: ˆLMIS m (θ) = m (cid:88) t=0 1 nt nt(cid:88) i=1 ωt,m(at,i)yt,iwθ t,i, wθ t,i = πθ(at,i|xt,i) πt,i . (12) In multiple importance sampling we usually assume that the behavior distributions are independent. In our case, when we optimize θt based on the models θt−1, . . . , θ0, we break this assumption. However, as we will see, we can still have the unbiasedness property and derive an estimator for the variance of the estimator. Proposition A.1 (Unbiasedness). The MIS estimator (12) is unbiased when the loss y is fixed (its distribution PY (*|x, a) does not depend on time rollout m). Proof. Let m ∈ {1, . . . M }. We recall that at all rounds t < m, models θt ∈ Θ were deployed and sets st of nt observations st = (xt,i, at,i, lt,i, πt,i)i=1,...,nt were collected thereof, with propensities πt,i = πθt(at,i|xt,i) to learn the next model θt+1. To prove the unbiasedness we use the tower rule on the expectation and condition on previous observations s1, . . . st−1: E[ ˆLMIS m (θ)] = = = = = m (cid:88) t=0 m (cid:88) t=0 m (cid:88) t=0 m (cid:88) t=0 m (cid:88) t=0 1 nt nt(cid:88) i=1 Ex,θm,y (cid:2)ωt(a)ywθ t (cid:3) Ex,θm,y (cid:2)ωt(a)ywθ t (cid:3) Es1...st−1 (cid:2)Ex,θm,y (cid:2)ωt(a)ywθ t | s1 . . . st−1 (cid:3)(cid:3) Es1...st−1 [Ex,θ,y [ωt(a)y | s1 . . . st−1]] Ex,θ,y [ωt(a)y] = Ex,θ,y (cid:33) (cid:35) ωt(a) y (cid:34)(cid:32) m (cid:88) t=0 = Ex,θ,y [y] = L(θ), where the second last line is true only when the distribution of y does not change over time roll-outs m. Among the proposals for functions ωt(a), the most 'naive' and natural heuristic is to choose which gives the naive concatenation of all IPS estimators ωt(a) = nt (cid:80)m l=1 nl , where n = (cid:80)m t=0 nt. ˆLn-MIS m (θ) = 1 n m (cid:88) nt(cid:88) t=0 i=1 yt,i πθ(at,i|xt,i) πθt(at,i|xt,i) , 13 (13) (14) Sequential Counterfactual Risk Minimization With the previous definition of the empirical mean estimator, we can now derive an empirical variance estimator, starting with the naive multi importance sampling estimator. We write the random variable rm = (πθ/πθm )y. We note that for inside a batch m each realization of rm j are independent. But the realizations of the random variables rm and rm′ i = (πθ(am,i|xm,i)/πm,i)ym,i and rm are dependent. Writing n = (cid:80)m t=0 nt Var (cid:34) 1 n m (cid:88) nm(cid:88) t=0 i=1 (cid:35) rm i = m (cid:88) t=0 (cid:34) 1 n Var nm(cid:88) (cid:35) rm i + 2 i=1 (cid:34) nm(cid:88) (cid:35) rm + 2 (cid:88) Cov 1≤p<q≤m   1 n np (cid:88) i=1 rp i , 1 n nq (cid:88) j=1  rq j  1 n2 (cid:88) np (cid:88) nq (cid:88) Cov [rp, rq] 1≤p<q≤m i=1 j=1 (cid:35) rm + 2 (cid:88)  npnqCov [rp, rq]  , = = 1 n2 1 n2 m (cid:88) Var t=0  m (cid:88)  i=1 (cid:34) nm(cid:88) Var t=0 i=1 1≤p<q≤m where the second last equality is obtained with the bilinearity of the covariance. Given the latter expression of the variance, we propose the following estimator and with a linear sampling where all np = nq for p, q ∈ {1, . . . , M }: ˆV n-MIPS m (θ) = 1 n2   m (cid:88) ˆV (rt) + 2 (cid:88) npnq t=0 1≤p<q≤m (cid:32) 1 np np (cid:88) k=1 (cid:0)rp k − ̄rp (cid:1)(cid:0)rq k − ̄rq (cid:1) (cid:33)  , where ˆV (rm) = 1 nm(nm−1) (cid:80)nm i=1 (cid:0)rm i − ̄rm(cid:1)2 and ̄rm = 1 nm (cid:80)nm j=1 rm j . Note also that for other functions ωt(a), the most studied one is the balance heuristic with ωt ∝ ntπθt(a), that is: ωBH t (a) = ntπθt(a) l=1 nlπθl (a) (cid:80)m . (15) (16) The latter heuristic has been studied for its low variance (Owen, 2013) but these properties have been studied under an i.i.d assumption that is broken in our adaptive data collection strategy. Eventually, note that controlling the variance of this estimator with an implicit exploration estimator as we do in the i.i.d case would make a an interesting research direction. B. Analysis details In this section, we provide the details of our analysis by starting with essential definitions, then our proofs of variance dependent excess risk bounds and finally our regret analysis. B.1. Definitions Cm(Θ) is a complexity measure that will be upper-bounded by the metric entropy in sup-norm at level ε = 1/nm of the following function set, (cid:26) Fm,Θ := fθ : (x, a, y) ∈ X × A × Y (cid:55)→ (cid:18) 1 W + 1 W y πθ(a|x) πθm (a|x) + απθ(a|x) (cid:19) (cid:27) − 1 for θ ∈ Θ . (17) The latter corresponds to clipped prediction errors of policies πθ normalized into [0, 1]. More precisely, to define rigorously Cm(Θ), we denote for any nm ≥ 1 and ε > 0, the complexity of a class F by H∞(ε, F, n) = sup (xi,ai,yi)∈(X ×A×Y)n H(ε, F(cid:0){xi, ai, yi}(cid:1), ∥ * ∥∞) , (18) where F(cid:0){xi, ai, yi}(cid:1) = (cid:8)(cid:0)f (x1, a1, y1), . . . , f (xn, an, yn)(cid:1), f ∈ F(cid:9) ⊆ Rn and the number H(ε, A, ∥*∥∞) is the smallest cardinality |A0| of a set A0 ⊆ A such that A is contained in the finite union of ε-balls centered at points in A0 in the metric induced by ∥ * ∥∞). Then, Cm(Θ) is defined by Cm(Θ) = log H∞(1/nm, Fm,Θ, 2nm) . (19) 14 B.2. Variance-dependent excess risk bounds Sequential Counterfactual Risk Minimization We will denote by Em[*] = E[*|s0, . . . sm] the conditional expectation given the set of observation samples sm = (xm,i, am,i, ym,i, πm,i)i=1,...,nm up to the rollout m. Here, we recall that xm,i ∼ PX , am,i ∼ πθm (*|xm,i), ym,i ∼ (cid:2)*]) PY (*|xm,i, am,i), and πm,i = πθm (am,i|xm,i). Furthermore, throughout the document, Ex,θm,y denotes the expectation (resp. variance) in (x, a, y) where x ∼ PX , a ∼ πθm (*|x), and y ∼ PY (*|x, a). Proposition 4.1 (Generalization Error Bound). Let ˆLIPS-IX be the empirical estimators defined respectively in Eq. (9) and Eq. (10). Let δ ∈ (0, 1), θ ∈ Θ, and nm ≥ 2 the number of samples associated to the logged dataset at round m. Then, with probability at least 1 − δ, (cid:2) * (cid:3) (resp. Varx,θm,y and ˆV IPS-IX m m (cid:115) L(θ) ≤ ˆLIPS-IX m (θ) + λ ˆV IPS-IX m nm (θ) + 2λ2W nm + (cid:115) log(2/δ) 2nm , (20) where λ = (cid:112)18(Cm(Θ) + log(2/δ)). Proof. Let δ ∈ (0, 1) and θ ∈ Θ. Since all functions in Fm,Θ defined in Eq. (17) take values in [0, 1], we can apply the concentration bound of Maurer & Pontil (2009, Theorem 6) to the set Fm,Θ. This yields, with probability at least 1 − δ/2, Ex,θm,y[fθ(x, a, y)] − (cid:115) fθ(xm,i, am,i, ym,i) ≤ 1 nm nm(cid:88) i=1 18 ˆVnm (fθ)(Cm(Θ) + log(2/δ)) nm + 15(Cm(Θ) + log(1/δ)) (nm − 1) , (21) where ˆVnm (fθ) = 1 nm − 1 nm(cid:88) (cid:16) i=1 fθ(xm,i, am,i, ym,i) − 1 nm nm(cid:88) j=1 fθ(xm,j, am,j, ym,j) (cid:17)2 is an estimation of the sample variance. Let α > 0 and define the following biased estimator of the excess risk: Lα m(θ) = Ex,θm,y (cid:18) (cid:20) y πθ(a|x) πθm (a|x) + απθ(a|x) (cid:19)(cid:21) − 1 ∀θ ∈ Θ. (22) We recall that Ex,θm,y construction of fθ (see Eq. (17)), (cid:2) * (cid:3) denotes the expectation in (x, a, y) where x ∼ PX , a ∼ πθm(*|x), and y ∼ PY (*|x, a). By Ex,θm,y[fθ(x, a, y)] = fθ(xm,i, am,i, ym,i) = 1 W 1 W + + 1 W 1 W 1 nm nm(cid:88) i=1 Lα m(θ) ˆLIPS-IX m (θ) − 1 W nm nm(cid:88) i=1 ym,i ˆVnm (fθ) = 1 W 2 ˆV IPS-IX m (θ) , where ˆLIPS-IX above terms, and using λ = (cid:112)18(Cm(Θ) + log(2/δ)), yields and ˆV IPS-IX m m are defined respectively in Eq. (9) and Eq. (10). Thus, multiplying (21) by W , substituting the m(θ) − ˆLIPS-IX Lα m (θ) + (cid:115) ym,i ≤ λ 1 nm nm(cid:88) i=1 ˆV IPS-IX m nm (θ) + 15λ2W 18(nm − 1) , (23) with probability 1 − δ/2. Now, let us decompose Lα m(θ) = Ex,θm,y (cid:18) (cid:20) y πθ(a|x) πθm(a|x) + απθ(a|x) (cid:19)(cid:21) − 1 = Ex,θm,y (cid:20) y πθ(a|x) πθm(a|x) + απθ(a|x) (cid:21) − L(θm). But, since the losses y are bounded in [−1, 0] almost surely, (cid:20) y Ex,θm,y πθ(a|x) πθm (a|x) + απθ(a|x) (cid:21) (cid:20) ≥ Ex,θm,y y (cid:21) πθ(a|x) πθm(a|x) = L(θ), 15 Sequential Counterfactual Risk Minimization which, substituted into the previous equation, entails, Lower-bounding the left-hand side of (26), we thus get w.p 1 − δ/2, Lα m(θ) ≥ L(θ) − L(θm). L(θ) − ˆLIPS-IX m (θ) ≤ λ (cid:115) ˆV IPS-IX m nm (θ) + 15λ2W 18(nm − 1) + L(θm) − 1 nm nm(cid:88) i=1 ym,i. Using Em−1[ym,i] = L(θm) and applying Hoeffding's inequality, this further yields w.p. 1 − δ L(θ) ≤ ˆLIPS-IX m (θ) + λ (cid:115) ˆV IPS-IX m nm (θ) + 15λ2W 18(nm − 1) + (cid:115) log(2/δ) 2nm . Eventually, note that (nm − 1)−1 ≤ (2/nm) since nm ≥ 2. Thus, L(θ) ≤ ˆLIPS-IX m (θ) + λ (cid:115) ˆV IPS-IX m nm (θ) + 2λ2W nm + (cid:115) log(2/δ) 2nm , which concludes the proof. (24) (25) (26) Proposition 4.2 (Conservative Excess Risk). Let m ≥ 0 and θm ∈ Θ. Let sm = (xm,i, am,i, ym,i, πm,i)1≤i≤nm be a set of samples collected with am,i ∼ πθm (*|xm,i). Then, under Assumptions 4.1 and 4.2, the solution θm+1 of Problem (8) with the IPS-IX estimator in Eq. (11) on the samples sm satisfies the excess risk upper-bound ∆m+1 = L(θm+1) − L(θ∗) ≲ (cid:115) d log(nm) + log(1/δ) nm ν2 m + W 2 + W (d log(nm) + log(1/δ)) nm , (27) where ν2 m = Varx,θm (cid:18) πθ∗ (a|x) πθm(a|x) (cid:19) . Proof. We consider the notations of the proof of Proposition 4.1. Fix θ∗ ∈ Θ. Applying, Theorem 15 of (Maurer & Pontil, 2009)2 to the function set Fm,Θ defined in (17), we get with probability 1 − δ Ex,θm,y[fθm+1(x, a, y)] − Ex,θm,y[fθ∗ (x, a, y)] (cid:115) ≤ 32Varx,θm,y (cid:2)fθ∗ (x, a, y)(cid:3)(cid:0)Cm(Θ) + log 30 δ nm (cid:1) + 22(cid:0)Cm(Θ) + log 30 nm − 1 δ (cid:1) . This can be written as: with the following definitions: ∆∗ m ≤ U ∗ m, ∆∗ m = Ex,θm,y[fθm+1(x, a, y)] − Ex,θm,y[fθ∗ (x, a, y)] (cid:1) (cid:2)fθ∗ (x, a, y)(cid:3)(cid:0)Cm(Θ) + log 30 32Varx,θm,y (cid:115) δ U ∗ m = nm (28) (29) + 22(cid:0)Cm(Θ) + log 30 nm − 1 δ (cid:1) . 2Note that (xi, ai, yi) i.i.d.∼ PX × πθm (*|x) × PY (*|a, x), and P (*, μ) is the expectation with respect to one test sample Ex,θm,y[ * ]. in their notation, log Mn(π) equals Cm(Θ) + log(10), X is the dataset {(xi, ai, yi)}1≤i≤n where 16 Sequential Counterfactual Risk Minimization Step: Lower bounding ∆∗ m Using the definition of fθ(x, a, y) in (17) and that of Lα m in Eq. (22), we have Ex,θm,y[fθm+1(x, a, y)] = 1 W + 1 W Lα m(θm+1). Thus, ∆∗ m can be re-written as ∆∗ m = 1 W (Lα m(θm+1) − Lα m(θ∗)) , which we now lower-bound. To do so, we begin by upper-bounding Lα m(θ∗). It can be expressed as Lα m(θ∗) = Ex,θm,y (cid:20) y πθ∗ (a|x) πθm (a|x) + απθ∗ (a|x) (cid:21) − L(θm). (30) To shorten notation, from now on and throughout this proof, we write πθ instead of πθ(a|x), omitting the dependence on a and x. Using the inequality (1 + x)−1 ≥ 1 − x for x ≥ 0, we have Ex,θm,y (cid:20) y πθ∗ πθm + απθ∗ (cid:21) (cid:34) = Ex,θm,y y (cid:35) πθ∗ πθm 1 1 + α πθ∗ πθm ≤ Ex,θm,y (cid:21) (cid:20) y πθ∗ πθm − αEx,θm,y (cid:19)2(cid:35) (cid:34) y (cid:18) πθ∗ πθm = L(θ∗) − αEx,θm,y y (cid:34) (cid:19)2(cid:35) (cid:18) πθ∗ πθm ≤ L(θ∗) + αW 2 , where the last inequality is by Assumption 4.1 and because y ∈ [−1, 0]. Together with (30), we get We recall that L(θm+1) − L(θm) ≤ Lα m(θm+1) by Eq.(24). Therefore, Lα m(θ∗) ≤ L(θ∗) + αW 2 − L(θm). 1 W (L(θm+1) − L(θ∗) − αW 2) ≤ 1 W (Lα m(θm+1) − Lα m(θ∗)) , which finally gives 1 W (L(θm+1) − L(θ∗) − αW 2) ≤ ∆∗ m. Step: Upper bound U ∗ m By definition of fθ(x, a, y) in (17), we have (31) (32) (33) Varx,θm,y (cid:2)fθ∗ (x, a, y)(cid:3) = 1 W 2 Varx,θm,y (cid:18) (cid:20) y (cid:19)(cid:21) − 1 πθ∗ πθm + απθ∗ (cid:18) (cid:34) ≤ 1 W 2 Ex,θm,y y2 πθ∗ πθm + απθ∗ (cid:19)2(cid:35) − 1 ≤ 1 W 2 Ex,θm (cid:34)(cid:18) πθ∗ πθm + απθ∗ (cid:19)2(cid:35) − 1 . Then, using the inequality (x + y)2 ≤ 2x2 + 2y2, for x, y ∈ R, this may be upper-bounded as Varx,θm,y (cid:2)fθ∗ (x, a, y)(cid:3) 2 W 2 Ex,θm ≤ (cid:34)(cid:18) πθ∗ πθm + απθ∗ − Ex,θm (cid:20) πθ∗ πθm + απθ∗ (cid:21)(cid:19)2(cid:35) + 2 W 2 (cid:18) (cid:20) Ex,θm πθ∗ πθm + απθ∗ (cid:21) (cid:19)2 − 1 . (34) On the one hand, the first term of the right-hand side may be upper-bounded as (cid:34)(cid:18) Ex,θm πθ∗ πθm + απθ∗ − Ex,θm (cid:20) πθ∗ πθm + απθ∗ (cid:21)(cid:19)2(cid:35) = Varx,θm (cid:20) πθ∗ πθm + απθ∗ (cid:21) ≤ ν2 m, 17 where ν2 m = Varx,θm (cid:104) πθ∗ πθm (cid:105) . On the other hand, for the second term, we use the same factorization as in Eq. (31) to get Sequential Counterfactual Risk Minimization −α Ex,θm (cid:19)2(cid:35) (cid:34)(cid:18) πθ∗ πθm ≤ Ex,θm (cid:20) πθ∗ πθm + απθ∗ (cid:21) − 1 ≤ 0 , which yields the upper-bound (cid:18) (cid:20) Ex,θm πθ∗ πθm + απθ∗ (cid:21) (cid:19)2 − 1 ≤ α2 Ex,θm (cid:19)2(cid:35) (cid:34)(cid:18) πθ∗ πθm ≤ α2W 2. Therefore, substituting the last two upper-bounds into (34) entails Varx,θm,y (cid:2)fθ∗ (x, a, y)(cid:3) ≤ 2 W 2 (cid:0)ν2 m + α2W 2(cid:1) . Then, replacing this upper-bound into the definition of U ∗ Cm(Θ) ≤ d log(nm), we obtain the following upper-bound m in (29) and using Assumption 4.2 to upper bound the terms in U ∗ m ≤ ≤ (cid:115) (cid:115) 1 W 1 W 64(ν2 64(ν2 m + α2W )(cid:0)d log(nm) + log 30 nm m + α2W )(cid:0)d log(nm) + log 30 nm δ δ (cid:1) (cid:1) + + δ 22(cid:0)d log(nm) + log 30 nm − 1 44(cid:0)d log(nm) + log 30 nm δ (cid:1) (cid:1) , (35) where the last inequality is because nm ≥ 2. and using the two previous bounds (33) and (35) respectively on ∆∗ m Step: excess risk upper bound Setting α = 1 nm and on U ∗ m into (28), we get (cid:115) L(θm+1) − L(θ∗) ≤ 64(cid:0)d log(nm) + log 30 nm δ (cid:1) (cid:0)ν2 m + 1 n2 m W 2(cid:1) + W 44(cid:0)d log(nm) + log 30 nm δ (cid:1) + 1 nm W 2. (36) Using that √ a + b ≤ √ √ a + b, we have that (cid:115) 64(cid:0)d log(nm) + log 30 nm δ (cid:1) (cid:0)ν2 m + 1 n2 m W 2(cid:1) ≤ (cid:115) 64(cid:0)d log(nm) + log 30 nm δ (cid:1) ν2 m + W nm (cid:115) 64(cid:0)d log(nm) + log 30 nm δ (cid:1) . Then, since nm ≥ 2 and δ < 1, we have d log(nm) + log(30/δ) ≥ log(2) + log(30) ≥ 4, which yields (cid:115) 1 nm 64(cid:0)d log(nm) + log 30 nm δ (cid:1) ≤ (cid:113) 32(cid:0)d log(nm) + log 30 nm δ (cid:1) ≤ √ 8(cid:0)d log(nm) + log 30 nm δ (cid:1) . Substituting the last two inequalities into (36) finally entails L(θm+1) − L(θ∗) ≤ 8 (cid:115) d log(nm) + log 30 δ nm ν2 m + 47W d log(nm) + log 30 δ nm + W 2 nm , (37) which concludes the proof. B.3. Regret analysis Proposition 5.1 (Regret upper-bound). Let n0, n ≥ 2 and θ∗ ∈ arg minθ L(θ). Let nm = n02m for m = 0, . . . , M = )(cid:5). Then, under Assumptions 4.1, 4.2 and 5.1, the SCRM procedure (Alg. 1) satisfies the excess risk upper-bound (cid:4) log2(1+ n n0 L(θM ) − L(θ∗) ≤ O (cid:16) n− 1 2−β log n (cid:17) . 18 Moreover, the expected regret is upper-bounded as follows: Sequential Counterfactual Risk Minimization Rn = E (cid:20) M (cid:88) m=0 nm+1 (cid:0)L(θm) − L(θ∗)(cid:1) (cid:21) (cid:16) 1−β 2−β log(n)2(cid:17) . n ≤ O Proof. First, note that for nm = n02m and M = (cid:4) log2(1 + n m=0 nm = n0(2M − 1) ≤ n. Hence, Alg. 1 n0 has collected at most n samples to design the estimator θM . For m ≥ 0, we recall ∆m = L(θm) − L(θ∗) and use Eq. (37) to write )(cid:5), we have (cid:80)M −1 (cid:115) ∆m+1 ≤ 8 d log(nm) + log 30 δ nm ν2 m + 47W d log(nm) + log 30 δ nm + W 2 nm (cid:115) ≤ 8 d log(n) + log 30 δ nm (cid:115) = C ν2 m nm + B nm , ν2 m + 47W d log(n) + log 30 δ nm + W 2 nm where C = 8 d log(n) + log 30 δ and B = W 2 + 47W (d log(n) + log 30 δ ) are independent of m. (cid:113) Step: Obtaining a recurrence relation for ∆m+1 By Assumption 5.1, there exist γ > 0 and β ∈ [0, 1] such that ν2 m = Varx,θm (cid:19) (cid:18) πθ∗ πθm ≤ 1 γ (cid:0)L(θm) − L(θ∗)(cid:1)β = ∆β m γ . Replacing ν2 m in Eq. (38) thus entails ∆m+1 ≤ C (cid:115) 1 γ ≤ C2− m 2 B nm + ∆β m nm (cid:114) n0 γ ∆β m + B2−mn0 ← nm = n02m = C (cid:114) n0 γ 2− m 2 ∆β/2 m + B2−mn0 . Step: Solving the recurrence relation for ∆m We then insure by induction that ∆m satisfies ∆m ≤ c02 −m 2−β , (38) (39) (40) for some c0 > 0 that will be specified by the analysis. Base step Since losses take values in [−1, 0], ∆0 = L(θ0) − L(θ∗) ≤ 1. Equation (40) is thus satisfied for m = 0 as soon as c0 ≥ 1. Induction step Let m ≥ 0. We assume that ∆m ≤ c02 −m 2−β and prove Equation (40) for ∆m+1. Using Eq. (39), we have ∆m+1 ≤ C ≤ C 2− m 2 ∆β/2 m + B2−mn0 2− m 2 c0 β/22− mβ β(2−β) + B2−mn0 ← by induction (cid:114) n0 γ (cid:114) n0 γ (cid:110) ≤ max 2C (cid:114) n0 γ c0 β 2 2− m 2 − m 2−β , 2B2−mn0 (cid:111) . (41) 19 Sequential Counterfactual Risk Minimization Now, we show that both terms inside the maximum can be upper-bounded by c02−(m+1)/(2−β) as soon as c0 is large enough. On the one hand, if c0 ≥ 4Bn0, we have On the other hand, if c0 ≥ (4C 2n0/γ)1/(2−β), we also have 2B2−mn0 ≤ c02−(m+1) ≤ c02− m+1 2−β . 2C (cid:114) n0 γ c0 β 2 2− m 2 − m 2−β ≤ 2C (cid:114) n0 γ c0 β 2 2− m+1 2−β ≤ c02− m+1 2−β . Combining the above two upper-bounds with (41) concludes the induction step under the condition (cid:26) c0 ≥ max 1, (cid:17) 1 2−β (cid:16) 4C 2n0 γ (cid:27) , 4Bn0 . Step: conclusion Finally, setting the above value for c0 we proved that for all m ≥ 0, we have (cid:26) 1, (cid:16) 4C 2n0 γ (cid:16) 4C 2n0 γ (cid:17) 1 2−β (cid:17) 1 2−β (cid:27) 2− m 2−β , 4Bn0 + 4Bn0 (cid:19) 2− m 2−β ∆m ≤ max (cid:18) ≤ 1 + (cid:18) = 1 + (cid:18) 256(d log n + log 30 δ )n0 (cid:19) 1 2−β γ + W 2n0 + 47W n0 (cid:16) d log n + log (cid:17)(cid:19) 30 δ 2− m 2−β , (42) where the last equality is by substituting the values of B and C from (38). For the final step M = ⌊log2( n n0 yields + 1)⌋, this (cid:18) ∆M ≤ 1 + (cid:18) 256(d log n + log 30 δ )n0 (cid:19) 1 2−β γ + W 2n0 + 47W n0 (cid:16) d log n + log (cid:17)(cid:19) 30 δ 2− M 2−β (cid:18) ≤ 2 1 + (cid:18) 256(d log n + log 30 δ )n0 (cid:19) 1 2−β γ + W 2n0 + 47W n0 (cid:16) d log n + log (cid:17)(cid:19) 30 δ × (cid:16) n0 n (cid:17) 1 2−β (cid:16) = O n− 1 2−β log n (cid:17) . This concludes the first part of the proof. Regret upper-bound To upper bound the cumulative regret, using nm+1 = n02m+1, we write Rn = M (cid:88) m=0 ∆mnm+1 (42) ≤ D M (cid:88) m=0 2− m 2−β nm+1 = 2Dn0 M (cid:88) (cid:0) 1−β 2 2−β (cid:1)m , m=0 where (cid:18) 256(d log n + log 30 δ )n0 (cid:19) 1 2−β D = 1 + γ Then, computing the sum for M = ⌊log2( n n0 + 1)⌋, we have + W 2n0 + 47W n0 (cid:16) d log n + log (cid:17) . 30 δ Rn ≤ 2Dn0 M (cid:88) m=0 (cid:0) 1−β 2 2−β (cid:1)m ≤ 2Dn0(M + 1)2 (cid:0) 1−β 2−β (cid:1)M ≤ 2Dn0 (cid:16) 1 + log2 (cid:17)(cid:17) (cid:16) × 1 + + 1 (cid:16) n n0 (cid:17) 1−β 2−β . n n0 Using that D = O(log n), we finally obtain Rn ≤ O (cid:16) 1−β 2−β log(n)2(cid:17) . n 20 Sequential Counterfactual Risk Minimization C. Additional discussions on the H ̈olderian Bound Assumption 5.1 In this appendix, we discuss Assumption 5.1 on different particular examples. C.1. Verification of the assumption on a toy example with Gaussian families We consider the setting of Example 3.1. In the latter, the policies are Gaussian of the form πθ = N (θ, σ2) and the loss is defined by lt(a) = (a − yt)2 − 1 where yt ∼ N (θ∗, σ2). There is no loss in generality in assuming σ2 = 1. Then, we can compute L(θ) − L(θ∗) = (θ − θ∗)2 and Varθ = exp (cid:0)(θ∗ − θ)2(cid:1) − 1 . (cid:21) (cid:20) πθ∗ (a) πθ(a) We recall that we are interested in verifying the existence of γ > 0 and β > 0 for which Assumption 5.1 holds, that is in this case for any θ ∈ Θ: γVarθ (cid:21) (cid:20) πθ∗ (a) πθ(a) ≤ (cid:0)L(θ) − L(θ∗)(cid:1)β , (43) which may be re-written here as γ(cid:0) exp (cid:0)(θ∗ − θ)2(cid:1) − 1(cid:1) ≤ (θ − θ∗)2β . The latter is satisfied for any β ≤ 1 as soon as Θ is a bounded interval. Note that the constant γ may decrease exponentially fast as the diameter of Θ increases. To illustrate, the existence of such couples (β, γ), we plot in Fig. 8 different values of the following ratio R(θ, β) = (cid:21) (cid:20) πθ∗ (a) Varθ πθ(a) (cid:0)L(θ) − L(θ∗)(cid:1)β = exp (cid:0)(θ∗ − θ)2(cid:1) − 1 (cid:0)∥θ − θ∗∥2(cid:1)β . (44) The value of γ can be found for different values of β in Fig. 8 by taking 1 γ = maxθ R(θ, β). Higher values of β induce Figure 8: Ratio R defined in (44) with different values of β. faster rates and lower values of γ induce worst constant terms in the excess risk and regret bounds. Eventually, note that SCRM does not need those parameters to run and those two parameters γ, β are automatically calibrated by SCRM to find the best trade-off. C.2. Discussion of Assumption 5.1 for Exponential Families In this section, we consider a more realistic example in which policies belong to an exponential family. That is, we assume that the policies are parameterized by a parameter η ∈ Rq and can be written in the form: ∀a ∈ A, πη(a) = eη*t(a)−A(η)h(a), for some known function h : A → R+ and sufficient statistic t : A → Rq. Here, A(η) is a normalization constant, so that eA(η) = (cid:82) a eη*t(a)h(a) da. We provide in Example C.1 a concrete example considered by (Swaminathan & Joachims, 21 0.000.250.500.751.001.251.501.752.000.000.250.500.751.001.251.501.75Ratios=1=1/2=1/3=0 Sequential Counterfactual Risk Minimization 2015a; Faury et al., 2020). To ease the notation, we removed here the dependency on contexts, but the generalization to contextual policies can be made similarly. The importance weight ratio may be written as, πη(a) πηm (a) = e(η−ηm)t(a)−(A(η)−A(ηm)). (45) To verify Assumption 5.1, we need to upper bound their variance, which we shall write as, Vara∼πηm (cid:21) (cid:20) πη(a) πηm(a) = e2(A(ηm)−A(η))Vara∼πηm e(η−ηm)t(a)(cid:105) (cid:104) . Now, computing the moment generating function (MGF) of the statistic t(a) ∈ Rq Mt(s) = E (cid:104) es*t(a)(cid:105) = (cid:90) a es*t(a)eηm*t(a)−A(ηm)h(a) da = e−A(ηm) (cid:90) a e(ηm+s)*t(a)eηm*t(a)h(a) da = eA(ηm+s)−A(ηm), the variance term may be written as e(η−ηm)t(a)(cid:105) Vara∼πηm (cid:104) = Mt(2(η − ηm)) − M 2 t (η − ηm) = eA(2η−ηm)−A(ηm) − e2(A(η)−A(ηm)) . This eventually leads us to Vara∼πηm (cid:21) (cid:20) πη(a) πηm(a) = eA(2η−ηm)+A(ηm)−2A(η) − 1. (46) We now discuss two cases that are used for discrete actions (Swaminathan & Joachims, 2015a) and continuous actions (Kallus & Zhou, 2018; Zenati et al., 2020). Bounded sufficient statistic Supposing that there exists an upper bound A such that ∥t(a)∥ ≤ A, Cauchy-Schwartz inequality states that |(η − ηm) * t(a)| ≤ ∥η − ηm∥A, which entails Vara∼πηm (cid:21) (cid:20) πη(a) πηm (a) = eA(2η−ηm)+A(ηm)−2A(η) − 1 (cid:82) (cid:82) = = a e(2η−ηm)*t(a)h(a) da (cid:82) (cid:0)(cid:82) a eη*t(a)h(a) da(cid:1)2 a e(η−ηm)*t(a)eη*t(a)h(a) da (cid:82) a eηm*t(a)h(a) da − 1 a e(ηm−η)*t(a)eη*t(a)h(a) da − 1 (cid:0)(cid:82) a eη*t(a)h(a) da(cid:1)2 ≤ e∥η−ηm∥A − 1 . Assuming that the parameter space is compact, i.e, maxη,η′ ∥η − η′∥ ≤ D, there exists a constant C that depends on A and D such that, this may be further upper-bounded as Therefore, Assumption 5.1 is implied by Vara∼πηm (cid:21) (cid:20) πη(a) πηm (a) ≤ C∥η − ηm∥ . γC∥η − ηm∥2 ≤ (L(θ) − L(θ∗))2β . The latter is implied by a local version of strong convexity for β = 1/2 (d'Aspremont et al., 2021), and holds with γ = C −1D−2 for β = 0. Example C.1. For discrete actions A = {a1, . . . , aK}, we consider, as in (Swaminathan & Joachims, 2015a) and (Faury et al., 2020), policies where given a context x, probabilities pi(x) of sampling an action ai are given by pi(x) = exp(θ⊤φ(x, ai)) j=1 exp(θ⊤φ(x, aj)) (cid:80)K . 22 (47) Sequential Counterfactual Risk Minimization The function φ is typically a feature map associated to a kernel in a RKHS. In this case, the natural parameter η and the sufficient statistic t(a) may be written as η =      ) log( p1 pK ... log( pK−1 pK 0      ) t(a) =    1{a = a1} ... 1{a = aK}    . (48) Lognormal and Normal distributions For normal N (μ, σ2) and lognormal Lognormal(μ, σ2) distributions with fixed variance σ2 as considered by (Kallus & Zhou, 2018; Zenati et al., 2020), the normalizing constant writes A(η) = η2 2 , and we then obtain that: which gives: A(2η − ηm) + A(ηm) − 2A(η) = (η − ηm)2 , Vara∼πηm (cid:21) (cid:20) πη(a) πηm(a) = e∥η−ηm∥2 − 1 . In that case, it is again possible for a bounded parameter space to linearize e∥η−ηm∥2 verify: for all η, there exists an optimal η∗ such that − 1 ≲ ∥η − ηm∥2, consider losses that γ∥ηm − η∗∥2 ≤ (cid:0)L(ηm) − L(η∗)(cid:1)β . (49) Again, this holds generally for β = 0 and for locally strongly convex losses for β = 1. D. Experiment details D.1. Code All the code to reproduce figures and tables is available in the following repository: https://github.com/ criteo-research/sequential-conterfactual-risk-minimization. D.2. Empirical settings details Pricing The pricing application in (Demirer et al., 2019) considers a "personalized pricing" setting where given contexts x, prices p (which are the actions) need to be predicted to maximize the revenue: r(x, p) = p(a(x) − b(x)p + ε) where ε ∼ N (0, 1) and d = a(x) + b(x)p + ε is akin to an unknown context-specifidemand function. The data generating process uses contexts x ∈ [1, 2]k for k > 1 a positive integer. Only l < k dimensions however affect the demand, that is if we write ̄x = 1 l (z1, . . . , zl). The price p is generated from a Gaussian logging policy p ∼ N ( ̄x, 1) centered in ̄x. We consider in our example the quadratic functionnal a(x) = 2x2 and b(x) = 0.6x as in the original paper. Advertising The advertising simulation in (Zenati et al., 2020) consists in predicting the potential p ∈]0, +∞[ of a user that may be compared to their a priori responsiveness to a treatment. The potential is caused by an unobserved random group variable g in G (groups of "high" or "low" potential users in their responsiveness) that influences context x of users. The goal is then to find a policy π(a|x) that maximizes reward by adapting to an unobserved potential. The potentials are normally distributed conditionally on the group index, p|g ∼ N (μg, σ2 g) where σg = 0.5 and μg = 1 or 3 for two groups. The observed reward −y is then a function of the action a and the context x through the associated potential px of the user x. The reward function mimics reward over the offline continuous bidding dataset in (Zenati et al., 2020) with the form: rl(px, a) = (cid:26) a px 1 2 (px − a) + 1 if a < px else r(px, a) = max(rl(px, a), −0.1) 23 Sequential Counterfactual Risk Minimization In The logging policy is a lognormal distribution as it is common in advertising applications (Bottou et al., 2013). particular, as in (Zenati et al., 2020), πθ0 = Lognormal(μ, σ2) where the mean exp(μ + σ2/2) = 2 and the variance (exp(σ2) − 1) exp(2μ + σ2) = 1. Yeast, Scene, TMC2007 We follow (Swaminathan & Joachims, 2015a). We now recall briefly the setup. The problem is a binary multilabel classification with |A| = 2K potential labels. All models are parametrized by πθ(a|x) ∝ exp(θ⊤(x (cid:78) a)). The baseline (resp. skyline) is a supervised, full information model with identical parameter space than CRM methods trained on 5% (resp. 100%) of the training data. Our main modification it to consider the class of probabilistic policies that satisfy Assumption 5.1 by predicting actions in an Epsilon Greedy fashion (Sutton & Barto, 1998)): πε θ(a, x) = (1 − ε)πθ(a, x) + ε/|A| where ε = .1. The loss is the Hamming loss (number of incorrectly assigned labels - both false positives and false negatives in the action vector): L(θ) = 1 nK n (cid:88) K (cid:88) i=1 j=1 1[yj i =aj i ] (50) where yj evaluate at a loss of .5. i (resp. aj i ) is the j-th component of the label vector (resp. action vector) of line i. A uniform policy will thus D.3. Implementation details Counterfactual methods compare to in this work. In this paragraph we start by detailing the non adaptive counterfactual risk minimization that we Algorithm 2 Counterfactual Risk Minimization Input: Logged observations (x0,i, a0,i, y0,i, π0,i)i=1,...,n0 , parameter λ > 0 for m = 1 to M do Build Lm from observations sm using Eq. (11) Learn θ using Eq. (8) Re-deploy the logging model θ0 and collect observations sm+1 = (xm+1,i, am+1,i, lm+1,i, πm+1,i)i=1,...,nm+1 end We also provide the grid of hyperparameters for the λ evaluated in CRM and SCRM methods λ ∈ [1e − 5, 1e − 4, 1e − 3, 1e − 2, 1e − 1]. Batch Bandits Let k : (X × A) × (X × A) → R be a bounded positive definite Kernel associated to a RKHS H, φ : X ×A → H is the feature map such that k(s, s′) = ⟨φ(s), φ(s′)⟩ for any s, s′ ∈ X ×A. Context-actions pairs are written as sm,i := (xm,i, am,i) ∈ X ×A and Sm := {s1,0, . . . , snm,m} denoting the history of all context-actions pairs seen up until the end of batch m. Km is the kernel matrix of all context-actions seen until the end of the batch m ≥ 1. Eventually, KS (s′) is the kernel column vector [k(s1, s′), . . . , k(sl, s′)]⊤ of size |S| = l. Ym = [−y0,1, * * * − y0,n0, * * * − ym,1, * * * − ym,nm ] denotes the vector of concatenated rewards observed up until the end of the batch m. At a batch m, a context xm,i is sampled for i ∈ {1, nm}, and then to sample an action a, the following decision rule is applied: In batch Kernel UCB, ˆqm,i,a is defined as where a ∈ arg max a∈A ˆqm,i,a. ˆqm,i,a = ˆmm,i,a + βm ˆσm,i,a, (51) (52) ˆμm,i,a = KSt−1 ˆσ2 m,i,a = 1 λ (cid:0)(xm,i, a)(cid:1)⊤ k(cid:0)(xm,i, a), (xm,i, a)(cid:1) − K −1 m−1Ym−1 1 λ KSm−1 (cid:0)(xm,i, a)(cid:1)⊤ K −1 m−1KSm−1 (cid:0)(xm,i, a)(cid:1), 24 Sequential Counterfactual Risk Minimization and βm is a theoretical parameter that is set to βm = 1√ (Han et al.), ˆqm,i,a is defined directly as m in practical heuristics (Lattimore & Szepesvari, 2019). In SBPE ˆqm,i,a = KSt−1 (cid:0)(xm,i, a)(cid:1)⊤ K −1 m−1Ym−1. (53) Algorithm 3 Batch bandit - SBPE (Han et al.) and Kernel UCB (Valko et al., 2013) Input: Logged observations (x0,i, a0,i, y0,i, π0,i)i=1,...,n0 , λ regularization and exploration parameters, k the kernel function initialization Kλ = [k(s0,i, s0,j)]1≤i,j≤n0 + λI, Y0 = [−y0,i]1≤i≤n0 for m = 1 to M do for i = 1 to nm do Observe context xi,m Choose ai,m ← arg maxa∈A ˆqm,i,a using Eq. (53) or (52) end Observe losses yi,m for all i in past batch {1, . . . , nm} Update Ym ← [−y0,1, * * * − y0,n0, * * * − ym,1, * * * − ym,nm] Update the translated gram matrix Kλ ← [k(si,p, sj,p)]1≤i,j≤np,1≤p≤m + λI end SBPE (Han et al.) uses a linear modelling, therefore we used a linear kernel. For the Kernel UCB (Valko et al., 2013) method, we used Gaussian and Polynomial kernels in our experiments. Note also that no regularization parameter λ is used in SBPE so we set λ = 0 in our experiments, and for K-UCB we chose λ in the grid [1e0, 1e1, 1e2]. Note in particular that we adapted the batch bandit baselines to the CRM setting by benefiting the initialization with the logged dataset to set the gram matrix Kλ as well as the reward vector Y0 with information from the logging data. This modification changes the original methods which take random actions at initializations. Eventually, the baselines were carefully optimized using the Jax library (https://github.com/google/jax) to allow for just in time compilations of algebraic blocks in both methods and to maximize their scaling capacity. RL baselines 2017) and TRPO (Schulman et al., 2015), we do the following: In order to compare our method to the two known off-policy online RL algorithm PPO (Schulman et al., 1. we use the stable_baselines3(Raffin et al., 2021) library for the implementation. When necessary we call multiple times the model PPO or TRPO, to have buffer size of geometrical increase. 2. we initialize the ActorCriticPolicy with a simpler MLP model having only one layer with output dimension of 1, (with argument net_arch= [1], that is mathematically the same modelling as in CRM and SCRM baselines). 3. At the initial step only and to enable a fair comparison with counterfactual methods using a logging dataset, we pretrain the RL policies to imitate the actions sampled from the logging policy: we process by multiple step of the Adam optimizer, minimizing a loss being the sum of 2 terms: • a MSE term between the sampled action of the ActorCriticPolicy for the contexts in the n0 instances, and the actions sampled by the logging policy. • the ENTROPY term guaranteeing to keep a minimum of exploration in order to initialize the RL algorithm (− (cid:80) pi log(pi)) 4. we combine the 2 last terms with a linear combinaison with hyperparameters being tuned a posteriori, i.e. LOSS = MSE + λ ENTROPY with the hyperparam λ ∈ {.5, 1, 2, 5, 10} 25 Sequential Counterfactual Risk Minimization E. Additional empirical results E.1. SCRM compared to CRM We provide here the additional plot in the Pricing setting. Figure 9: Test loss as a function of sample size on Pricing, Advertising (from left to right). E.2. Evaluation of IPS-IX We provide here the plots for the whole setting considered in policy evaluation with IPS-IX. Figure 10: Comparison of IPS estimators on a Cosine reward and series of shifted Gaussian policies. Setup (left), Bias (middle left), Variance (middle right), Average IPS weight (right). IPS-IX shows a low bias and compares favorably to IPS and SNIPS in terms of variance. E.3. Exploration/Exploitation tradeoff In this part we give the details used for the experiment described in Section 6.3. We consider again Example 3.1 with the Gaussian parametrized policies πθ = N (θ, σ2) and a loss lt(a) = (a − yt)2 − 1 where yt ∼ N (θ∗, σ∗2) with σ∗ = 0.3. Recall that πθ0 = N (θ0, σ). We consider a grid of σ ∈ [0.1, 0.3, 1, 3] and consider θ∗ = 1. Our experiment aims at illustrating the influence of sequential exploration that is an important detail of the SCRM and CRM principles. 26 246810Rollouts m5.45.25.04.84.6LossPricingCRMSCRM246810Rollouts m0.750.700.650.600.550.500.45LossAdvertisingCRMSCRM202461.000.750.500.250.000.250.500.751.0001234reward0123Shift 00.000.010.020.030.040.05Bias2ipsips_clippedsnipsips_ix0123Shift 00.00000.00250.00500.00750.01000.01250.0150Varianceipsips_clippedsnipsips_ix0123Shift 00.60.70.80.91.0E[W]ipsips_clippedsnipsips_ix
http://arxiv.org/abs/2302.12118v1
2023-02-23T15:58:30
2023-02-23T15:58:30
Financial Distress Prediction For Small And Medium Enterprises Using Machine Learning Techniques
Financial Distress Prediction plays a crucial role in the economy by accurately forecasting the number and probability of failing structures, providing insight into the growth and stability of a country's economy. However, predicting financial distress for Small and Medium Enterprises is challenging due to their inherent ambiguity, leading to increased funding costs and decreased chances of receiving funds. While several strategies have been developed for effective FCP, their implementation, accuracy, and data security fall short of practical applications. Additionally, many of these strategies perform well for a portion of the dataset but are not adaptable to various datasets. As a result, there is a need to develop a productive prediction model for better order execution and adaptability to different datasets. In this review, we propose a feature selection algorithm for FCP based on element credits and data source collection. Current financial distress prediction models rely mainly on financial statements and disregard the timeliness of organization tests. Therefore, we propose a corporate FCP model that better aligns with industry practice and incorporates the gathering of thin-head component analysis of financial data, corporate governance qualities, and market exchange data with a Relevant Vector Machine. Experimental results demonstrate that this strategy can improve the forecast efficiency of financial distress with fewer characteristic factors.
[ "Yuan Gao", "Biao Jiang", "Jietong Zhou" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12118v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12118v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "q-fin.ST" ]
A b s t r a c t (cid:209) F i n a n c i a l D i s t r e s s f o r e c a s t a s s u m e s a f u n d a m e n t a l p a r t i n t h e m o n e t a r y p e c u l i a r i t y . T h e e x a c t f o r e c a s t o f t h e n u m b e r a n d p l a u s i b i l i t y o f b o m b i n g s t r u c t u r e s g o e s a b o u t a s a l i s t o f t h e d e v e l o p m e n t a n d s t r e n g t h o f a c o u n t r y ' s e c o n o m y . F i n a n c i a l d i s t r e s s e x p e c t a t i o n i s a k e y t e s t e a c h s u p p o r t i n g s u p p l i e r f a c e s w h i l e d e c i d i n g b o r r o w e r r e l i a b i l i t y . T h e i n n a t e d a r k n e s s o f S m a l l a n d M e d i u m E n t e r p r i s e b u s i n e s s e s e n t a n g l e s c r e d i t d y n a m i c i n t e r a c t i o n , a c c o r d i n g l y i n f l a t i n g t h e c o s t t o b a c k a n d b r i n g i n g d o w n t h e l i k e l i h o o d o f g e t t i n g r e s e r v e s . C u s t o m a r i l y , a f e w s t r a t e g i e s h a v e b e e n i n t r o d u c e d f o r v i a b l e F C P . T h e n a g a i n , t h e a r r a n g e m e n t e x e c u t i o n , e x p e c t a t i o n e x a c t n e s s , a n d d a t a l a w f u l n e s s a r e n (cid:213) t a d e q u a t e f o r u s e f u l a p p l i c a t i o n s . F u r t h e r m o r e , m a n y o f t h e c r e a t e d s t r a t e g i e s p e r f o r m w e l l f o r a p o r t i o n o f t h e d a t a s e t y e t a r e n o t v e r s a t i l e t o v a r i o u s d a t a s e t s . C o n s e q u e n t l y , t h e r e i s a p r e r e q u i s i t e t o f o s t e r a p r o d u c t i v e e x p e c t a t i o n m o d e l f o r b e t t e r o r d e r e x e c u t i o n a n d v e r s a t i l i t y t o d i f f e r e n t d a t a s e t s . I n t h i s r e v i e w , w e p r o p o s e a c a l c u l a t i o n f o r h i g h l i g h t d e t e r m i n a t i o n o r d e r e x p e c t a t i o n i n l i g h t o f e l e m e n t c r e d i t s a n d d a t a s o u r c e g a t h e r i n g . t h e c u r r e n t f i n a n c i a l d i s t r e s s e x p e c t a t i o n m o d e l g e n e r a l l y j u s t p u r p o s e s t h e d a t a f r o m f i n a n c i a l e x p l a n a t i o n a n d d i s r e g a r d s t h e i d e a l n e s s o f o r g a n i z a t i o n t e s t b y a n d b y . h e n c e , w e p r o p o s e a c o r p o r a t e f i n a n c i a l d i s t r e s s e x p e c t a t i o n m o d e l t h a t i s b e t t e r f o l l o w i n g t h e t r a i n i n g a n d j o i n s t h e g a t h e r i n g m e a g e r h e a d p a r t e x a m i n a t i o n o f f i n a n c i a l d a t a , c o r p o r a t e a d m i n i s t r a t i o n q u a l i t i e s , a n d m a r k e t e x c h a n g e d a t a w i t h a R e l e v a n t v e c t o r m a c h i n e . E x p l o r a t o r y o u t c o m e s d e m o n s t r a t e t h e w a y t h a t t h i s s t r a t e g y c a n f u r t h e r d e v e l o p t h e f o r e c a s t p r o f i c i e n c y o f f i n a n c i a l d i s t r e s s w i t h f e w e r t r a d e m a r k f a c t o r s I . I ! T R O D U C T I O ! B e c a u s e o f c h a n g e s i n b u s i n e s s s e c t o r s a n d t h e e c o n o m y i n i t s e l f , f i n a n c i a l d i s t r e s s e x p e c t a t i o n i s c r i t i c a l . M o n e y l e n d e r s a n d i n v e s t o r s , o f f i c i a l s , n a t i o n a l b a n k s , i n s p e c t o r s , a n d s u p e r v i s o r s e s t e e m o p p o r t u n e d a t a r e g a r d i n g a c o m p a n y ' s f i n a n c i a l w e l l - b e i n g . T h e c a p a c i t y t o f o r e s e e f i n a n c i a l d i s t r e s s i s v i t a l f o r t h e a c t u a l o r g a n i z a t i o n s , t o e x p a n d t h e i r t r u e c a p a c i t y , k e e p u p w i t h a s w e l l a s i n c r e m e n t t h e q u a n t i t y o f c u r r e n t f i n a n c i a l b a c k e r s , a n d a m p l i f y t h e s t o c k w o r t h . F r o m v a r i o u s e x a m i n a t i o n s t u d i e s , i t h a s b e e n l a i d o u t t h a t s e r i o u s f i n a n c i a l d i s t r e s s s a b o t a g e s t h e f i n a n c i a l m a i n t a i n a b i l i t y o f e n t e r p r i s e s . T h e d i s c o v e r y o f c o r p o r a t e d i s a p p o i n t m e n t c a n a d v a n c e t h e f i n a n c i a l m a n a g e a b i l i t y o f e n t e r p r i s e s . A f e w d e f i n i t i o n s h a v e b e e n c r e d i t e d t o f i n a n c i a l l y t e m p e r a m e n t a l o r g a n i z a t i o n s , f o r e x a m p l e , c o r p o r a t e o r b u s i n e s s d i s a p p o i n t m e n t , i l l i q u i d i t y , i n d e b t e d n e s s , o r i n s o l v e n c y [ 1 ] [ 2 ] [ 3 ] . T h e p r o s p e r i t y o f n a t i o n s a n d t h e g l o b a l e c o n o m y r e l i e s h e a v i l y o n S M E s . H o w e v e r , o n e o f t h e m a j o r c h a l l e n g e s f a c e d b y S M E s i n r e c e n t y e a r s i s o b t a i n i n g f u n d i n g , w h i c h h a s b e c o m e e v e n m o r e d i f f i c u l t d u e t o t h e i n t r o d u c t i o n o f c a p i t a l r e q u i r e m e n t s . T h i s h a s p u t p r e s s u r e o n b a n k s ' l e n d i n g c a p a c i t y . B a s e l I I I h a s a d d e d a n a d d i t i o n a l b u r d e n b y i n c r e a s i n g t h e m i n i m u m c a p i t a l r a t i o f r o m 6 % t o 8 % , w h i c h f o r m e d h i g h e r b a r r i e r s f o r S M E s s e e k i n g f i n a n c i n g . T h e s i g n i f i c a n c e o f S M E w e l l - b e i n g o n t h e w o r l d w i d e e c o n o m y w a s a c c e n t u a t e d b y d i f f e r e n t i n v e s t i g a t i o n s . A p p l y i n g a n o r g a n i z a t i o n ' s r e l i a b i l i t y a s s e s s m e n t i s o n e o f t h e k e y p o i n t s a b a n k f a c e s , p r i o r t o c h o o s i n g , w h e t h e r t h e o r g a n i z a t i o n o u g h t t o b e e n d o r s e d f o r f i n a n c e [ 4 ] [ 5 ] . R e s t r i c t e d d a t a a c c e s s i b i l i t y , f i n a n c i a l a d a p t a b i l i t y , a n d a b s e n c e o f l u c i d i t y a r e n o t m a n y o f m a n y v a r i a b l e s , w h i c h a r e c o n f o u n d i n g r e l i a b i l i t y a s s e s s m e n t s f o r S M E s , a l o n g t h e s e l i n e s e x p a n d i n g c r e d i t c h a n c e a n d c o s t o f s u p p o r t i n g . 1 Y u a n G a o 1 , B i a o J i a n g , J i e t o n g Z h o u 1 C o l l e g e o f C o m p u t e r S c i e n c e a n d T e c h n o l o g y , H a r b i n E n g i n e e r i n g U n i v e r s i t y o n e @ h r b e u . e d u . c n K e y w o r d s (cid:209) R e l e v a n c e V e c t o r M a c h i n e ; A r t i f i c i a l ! e u r a l ! e t w o r k s ; F i n a n c i a l D i s t r e s s P r e d i c t i o n ; P C A ; S m a l l a n d M e d i u m E n t e r p r i s e s . F i n a n c i a l D i s t r e s s P r e d i c t i o n F o r S m a l l A n d M e d i u m E n t e r p r i s e s U s i n g M a c h i n e L e a r n i n g T e c h n i q u e s forecast. In the field of financial distress forecast, numerous element determination techniques are proposed, like unpleasant set strategy, LASSO technique, covering, and channel[10][11]. Nonetheless, the vast majority of these methodologies neglect to consider the characteristics and data wellsprings of discrete elements and the various impacts they might have on the tag. the data qualities of an organization can be gathered by the examination of financial explanations and data sources, the development capacity, dissolvability, working skill of financial proclamations and corporate administration qualities, and market exchange data. these alliances mirror the connection, overt repetitiveness, and complementarity between the elements. along these lines, it tends to be applied to resulting highlight choice strategies[12][13][14]. like Figure 2: Process of Integral Financial Distress slim likelihood of endurance While liquidation forecast mostly centers around foreseeing the finish of an organization's lifecycle, with the moderately through rebuilding, financial distress expectation is a more normal event, when occupational encounters impermanent issues conference its commitments. A few financial distresses could wind up as insolvencies however frequently they are long[15][16]. simple difficulties and don't keep going According to a bank point of view, while surveying reliability, it is vital to recognize borrowers which will actually want their commitments without encountering installment hardships. A wide range of creators involved different methodologies and techniques for financial distress expectation and got various outcomes shifting from very high - 95% expectation achievement which was reached by Altman in his previous examinations, to meet Figure 1: Financial Distress for Market Value and Debt In Financially distressed businesses are organizations that are encountering trouble in adapting to their everyday administration assignments. the worst situation imaginable, these organizations are inclined to go to liquidation lengths (Baharin and Sentosa, 2013). On the off chance that a calculation can acquire a similar skill from previous data to work on the expectation for the future, it can bring about organizations distinguishing warnings adequately early, or possibly with perfect timing, to make a proper healing move. Studies regarding corporate disappointment forecast for the most part mean to decide one or a few factors that make it conceivable to segregate between falling flat and sound organizations (Refait, 2004). The expectation to a great extent centers around financial data. The trailblazers, Beaver (1966) and Altman (1968). utilized univariate and straight discriminant investigations individually[6][7]. Later examinations have utilized different factual methods like Logit and Probit models. Factual techniques, in any case, rely upon prohibitive theories. In the nineties, on account of the improvements in PC sciences, a few creators depended on Machine Learning calculations (ML) like brain organizations to foresee financial distress[8][9]. A decent financial distress expectation plot should be sensible and productive. Nonetheless, an enormous number of excess and inconsequential characteristics would influence characterization execution by expanding figuring costs and the time expected to learn and test the classifier. Highlight choice, as a significant innovation in data mining and machine learning, has been generally utilized in arrangement models. Choosing highlights before applying the characterization technique to the first dataset enjoys a few benefits, for example, refining the data, diminishing estimation cost, and further developing order exactness. Subsequently, we take on an element determination calculation to work on the nature of the financial distress to 'near earth' indicators with results seething from 70 % to 85 %. Figure 3: Financial Distress variation in Banks High fluctuation in results, which have just hardly expanded all through the past 10 years, and ceaseless quest for a superior indicator demonstrates that beneficial devices for financial value assessment are required. Indeed, even though financial distress forecasting is a well-studied topic, there isn't much research on SME materials, particularly in terms of time factor inclusion and various machine learning process application. This paper's goal is to provide a financial distress anticipation model that incorporates time components and measures the perspective of the SME element's FICO score in a 1-year horizon by using the three most promising machine learning techniques. procedures. Despite past examinations, where the likelihood of default was displayed, this exploration assesses the FICO score viewpoint by demonstrating SME substance financial hardships, which won't be guaranteed to wind up as liquidations or defaults. Rather than utilizing factors that allow only a one-year financial proportion preview - extra time factors are added along with past-due history qualities, deals, and resource change markers[17][18][19]. The methodology taken for the ongoing review includes the use of Decision Trees, Artificial Neural Networks, and Naive Bayes, three Machine Learning techniques. These techniques will then be applied to predict a company's viability through the arrangement of several features from its bookkeeping. Unlike expectation models, which normally use crude proportions directly, the models developed in this study make use of the distinctions between determined proportions (their progression through periods). Additionally, the assessment is carried out on data sets that are not used for preparation to get rid of data overfitting. The goal of this study is to create a framework for financial forecasting that will be applied after being prepared using a variety of firms' verifiable final records. idea of another to assess the created models organization's financial data. This paper regards this test as a characterization issue instead of a relapse issue. This implies that the real upsides of the last records won't be if an rather endeavors anticipated, yet organization is dynamic or flopping in the accompanying financial period. [20][21] to decide the II. LITERATURE REVIEW the investigation of two renowned papers were distributed There are many purposes for the financial distress expectation models, including observing corporate dissolvability, evaluating the dangers of defaults on advances and securities, valuing credit subordinates, and different protections bearing credit chances. During the 1960s, that financial distress concerned expectations and the development of forecast models. One is Beaver's concentrate in 1966 [22][23], where corporate anticipated by univariate financial distress was examination, and those with tremendous bank overdrafts, neglected profits on a favored stock, defaults on corporate securities, and announcements of chapter 11 were characterized as organizations in financial distress. In that review, organizations in financial distress from 1954 to 1964 were tests, one more 79 ordinary organizations of comparable size and capital in a similar financial industry chose proportions, for example, the proportions estimating benefit, liquidity, and dissolvability, were chosen to anticipate the chance of corporate financial distress. for coordinating, and 14 taken as SMEs being inclined to higher inborn credit risk than bigger organizations, experience essentially stricter acknowledge value evaluation methods as well as higher insurance prerequisites. In this way, to guarantee lower obstructions to get the support it is critical to guarantee cutting-edge credit value evaluation models. In their examinations, the authors of such efficient research argued that experts who compare a new model to some reference classifier(s) have the propensity to favor the new model since model engineers are more skilled at their methodology and can tune it more lavishly than reference models. They found that the advantage of SMEs is strongly correlated with large corporations was inverse. They made this observation by using discriminant and Logit techniques. While the effect their size, whereas the correlation for was almost non-existent for large corporations, it was relative and not fixed for SME organizations. Fidrmuc and Hainz (2009) focused on the SME advance market in Slovakia using the Probit philosophy and discovered that the outcomes are questionable for the most part because of solid predispositions which are connected with industry explicitness as well as authoritative document impacts. As per the outcomes, income/all-out liabilities were the most incredible in the financial distress forecast; in any case, the univariate model was simply ready to assess each factor in turn and couldn't think about other organization factors all in all. The other paper was Altman's concentrate in 1968 [24]. By working on the lack of a univariate model, a multivariate differential investigation model was laid out to foresee corporate financial distress. Those legitimately bankrupt, dominated, or perceived as rebuilt by the public chapter 11 regulation were characterized as organizations in financial distress. In that review, 33 organizations in financial distress from 1946 to 1965 were taken as tests, one more 33 financially sound organizations with comparative resources were chosen for coordinating, and 22 financial proportions were chosen from five significant extensive financial corporate aspects, influence, dissolvability, and turnover limit. Then, the proportions were consolidated to make an extensive list of the complete resources, X2: Retained profit/all-out resources, X3: Earnings before premium and duties/all-out resources, X4: Market worth of value/book worth of all-out obligation, and X5: Sales/all-out resources. In 2017, Altman et al. anticipated financial distress for organizations in 31 nations/locales (generally in Europe) by the Z-Score model, and its exactness was 70-80%[25][26][27]. liquidity, benefit, like Corporate disappointment expectation representations can be arranged in two: factual-based or calculation- determined utilizing Machine Learning (ML) methods. As referenced in the prologue to this paper, trailblazers of chapter 11 forecast utilized measurable strategies to segregate between fizzling and sound organizations (Refait, 2004). By the by, and albeit measurable strategies are as yet utilized, in the nineties, a few creators embraced Artificial Intelligence calculations (or Machine Learning) procedures like brain organizations for organization disappointment prediction[28][29]. Machine Learning (ML) is "the study of getting PCs to act starved of being customized". This cycle endeavors to recognize significant examples among the data sources and independently fabricate a prototype that can depict these examples without human intercession. ML instruments are worried about giving projects the capacity to learn and adjust to various examples. Following the strides of wise creatures, numerous abilities are gotten or refined through learning at various examples, rather than adhering to express guidelines. ML may likewise be characterized as the mind-boggling calculation cycle of programmed design acknowledgment and shrewd dynamic given preparation test data (Dua and Du, 2016). Subsequently, ML methods must be assessed exactly because their exhibition is vigorously subject to the preparation dataset. The elements chosen for displaying an issue assume a critical part of the expectation. There are numerous angles to consider while talking about financial distress. The forecast generally centers around economic data. Financial proportions can be named resource the executives' proportions, influence proportions (surveying the capacity of a firm to meet financial obligations), liquidity proportions (evaluating the capacity of a firm to meet its obligation obligations), and productivity proportions[30]. Huang et al. employed various brain network methodologies to assess the performance of different classifiers for credit risk assessment. They found that the Probabilistic Neural Network exhibited the highest discriminatory power and had the lowest overall and Type 2 error rates. Zhang et al. (2015) utilized state-of-the-art artificial intelligence techniques to incorporate Supply Chain Finance (SCF) into credit risk assessment. Similarly, Zhu et al. (2016) investigated the performance of Logistic Regression, Artificial Neural Networks, and their Hybrid models using Stress Concentration Factor as a feature. Their results showed that the Artificial Neural Networks had a lower Type 2 error rate compared to Logistic Regression, while the two-stage hybrid model achieved the best overall precision. To address the variability of financial efficacy assumptions in development due to linguistic representation, Shon et al. (2016) proposed the use of Fuzzy Logistic Regression. This approach was deemed appropriate to improve the accuracy of credit risk assessment compared to conventional Logistic Regression. Addo et al. (2018) constructed binary classifiers for credit risk assessment using AI techniques, including Logistic Regression, Random Forests, and Neural Networks. Model evaluation was based on factors from financial statements, and the top 10 features were selected and used to compare performance across different methods. The Tree-based classifiers were found to perform similarly and be more robust than multi-layer Artificial Neural Networks. Arora and Kaur (2020) utilized the Bollaso (Bootstrap-Lasso) feature selection method to identify relevant and stable variables from a pool of features. These variables were then used as inputs to various machine learning models, including Random Forest, Relevance Vector Machine, Naïve Bayes, and k-Nearest Neighbors, to evaluate their predictive accuracy for financial stability assessment. Consistent with previous studies, Random Forest exhibited the highest accuracy compared to other methods. III. METHODS AND METHODOLOGY In the forecast of corporate financial distress, factors are isolated into a few gatherings as per market exchanges, development capacity, dissolvability, productivity, etc, and each gathering comprises a few factors. Right now, the univariate determination technique will overlook the data concealed in the variable social affair architecture, which could lessen the show of variable decisions and may even mis-select factors. there are more and more markers reflecting the monetary status of undertakings in reality, and countless of them are upheaval factors. Accepting all variables associated with the model capriciously, the precision of the model will be diminished. thusly, factors should be picked in the illustration. the advantage of pitiful head part assessment lies in its consistency under the little disrupting impact of information change and its penchant to vanquish multicollinearity ordinarily, and it can give an all- out factor choice way[31][32]. this paper proposes Relevance Vector Machine (RVM) is a standard machine learning characterization strategy now. Because of its benefits in tackling small examples and nonlinear issues and its great prescient presentation, it has been broadly applied practically speaking. thusly, joining the benefits of meager head part examination and Relevance Vector the GSPCA-RVM Machines, technique. Taking into account highlight gathering, the viability of meager head part examination in recognizing the main element pointers in every class is presented, which empowers us to construct a superior expectation model. Figure 1 is the flowchart of target acknowledgment joining SPCA and RVM. Furthermore, the particular strides of the calculation GSPCA-RVM are displayed as follows. Right off the bat, as per the data sources and financial proclamation investigation techniques, the trademark files of recorded organizations are partitioned into a few gatherings (like dissolvability, benefit, and development capacity). Second, utilize inadequate head part investigation to screen the traits of each social affair of documents. Third, join the brand name records screened by each social event into a new dataset, and conclude the readiness tests and test tests. then, at that point, input the planning tests with the RVM procedure, get the coefficient and deviation of the isolation capacity through learning, and foster the course of action model. Finally, input the test tests to the portrayal model, then, take the assumption handling, and lastly ascertain the precision[33][34]. GSPCA-RVM Algorithm. Considering that X addresses a normalized trademark lattice of n ∗ m, where n is the number of recorded organizations and m is the number of qualities of recorded organizations, the scanty head part examination is planned on the premise that the chief part investigation can be changed into a quadratic punishment relapse issue. that is, the arrangement of head parts is straightforwardly changed into LASSO relapse. in this way, the arrangement of meager head parts is successfully changed into the variable choice issue of the straight model. On this premise, the punishment construction of the versatile net is acquainted with acquiring the scanty head parts. inadequate head part examination is as per the following: the goal capability of (d̂, mβ̂) = argmin ∑‖Xi − αβMXi‖2 + ε‖β‖2 (1) n i=1 In this way, regression acquaintance is used to finding the initial principal component. Along these lines, the first head part investigation is changed into a relapse issue. By adding LASSO punishment thing to the above condition, meager head parts can be gotten. in this way, the accompanying streamlining issue can be acquired: (d̂, mβ̂) n n n = argmin ∑‖Xi − αβMXi‖2 + ε ∑‖β‖2 + ∑ εn‖β‖2 i=1 k=1 k=1 As expressed over, the arrangement of meager head parts can be changed into a punishment relapse issue. the general LASSO punishment relapse issue can be settled by the least point relapse. subsequently, the computation of meager head parts can likewise be advantageously gotten by utilizing the least point relapse calculation. Figure 4: Flowchart of Combined SPCA and RVM Relevant Vector Machine Figure 5: Graphical explanation of Principle Component Analysis and exchange qualities In the experimental exploration of financial distress expectation, scientists have not agreed on the choice of pointers. this paper endeavors to gather exhaustive data on trade financial qualities, administration marks of China's A-share recorded organizations. It comprises economic elements, market exchange highlights, and corporate administration pointers. As per the order technique for financial files of recorded organizations in RESSET financial exploration With the expansion of market exchange attributes bunch and corporate administration qualities bunch, the dissemination of significant data and pointers reflected by each gathering. Principal Component Analysis and financial proclamation As per the past segment, all attributes of recorded organizations are partitioned into 12 gatherings as per data sources investigation techniques. Scanty head part Each data collection was examined, and the primary head portion coefficient of each collection was noted. It was selected if the trademark variable's major head part component was monotonic. It was eliminated because the coefficient was zero. The primary head component coefficient and selected trademark data for each group are displayed in Table 3. To determine whether collecting sparsity (GSPCA) improves the first dataset's essential data and kills repetitive data, we lead inadequate head part investigation for each of the 179 highlights (SPCA) and hold the trademark records with nonzero coefficients of the main four head parts. The analytic tool of Relevant Vector Machine (RVM) uses a probabilistic erudition system to make expectations. The model gauges a likelihood ⁠, which is the likelihood of the class mark (significant burdensome issue) assumed novel information X. The RVM preparing methodology analyses back dissemination of loads, which depicts the 'significance' of each preparation model information to the prepared model. Other less significant preparing stage information is 'pruned' with their comparing loads set to nothing. RVM requires the determination of a portion of work and a bit width boundary. Here a non-straight Gaussian bit was utilized with the part width boundary decided utilizing the 'forget about one' cross-approval of the preparation informational index. In the ongoing review, the RVM calculation was executed utilizing a tool kit and in- house custom schedules as point by point somewhere else. The characterization issue was addressed as {Xn, tn}n=1 N ⁠, where Xn addresses preparing stage information and tn- comparing objective marks which can either be consistent qualities (for example monetary trouble rating scores) for a relapse for a issue, or parallel grouping values characterization issue. The above plan can be addressed as a standard direct model tn = y(Xn: W) + tn (3) Generalized to, N tn = ∑ n=1 ωnk(x, xn) + b + εn (4) Where W = (ω1, ω2, ω3, ... , ωN)T is a weighting vector, b is a model predisposition recognized during the preparation cycle, Xn is an element vector and "n addresses estimation commotion (expected zero mean Gaussian circulation and difference). This is a non-direct Gaussian piece planning capability k(x1, x2) = exp(−η‖X1 − X2‖), utilized for relapse issues. For characterization issues, as in the current investigation, a changed probability work was utilized. The goal was to foresee the back likelihood of enrolment of one of the two classes (significant burdensome issue versus controls) given preparing information. The direct model presented before the term was changed utilizing a calculated sigmoid capacity in As text examined fundamental and the Supplementary material, the piece width boundary was assessed utilizing a non-one-sided cross-approval system during the preparation stage. Highlight vectors with related weighting values were then utilized for making monetary pain expectations during the testing stage. The RVM calculation utilizes a Bayesian plan pointed toward assessing the back dispersion of weighting values: Poster distribution = (LikelihoodthPrior)/marginal distribution. (5) The likelihood of a given dataset can be expressed as ρ(t: W, σ2) = (2πσ2)−N/2exp {− 1 2σ2 ‖t − φW‖2} (6) A standard approach to avoid over-fitting (Tipping, introduce a zero-mean Gaussian prior 2001) distribution of the parameters defined as to is ρ (W α ) = ∏ N(ωn: 0, αn N n=0 −1) (7) σ(Y) = 1 (1 + e − y) 1 1 + expσ{W T, φ(X)} = (9) toy(x, W) = σ{W T, φ(x)} By adopting a Bernoulli distribution it is possible to derive: p(t: w) N = ∏ σ{y(xn: W}t[1 n=1 − σ{y(xn; W}]1−t (10) At long last, the back conveyance of the loads was assessed utilizing a Laplace technique. These loads were utilized for making RVM expectations. Where is a vector of N + 1 hyper-boundaries, each with a weighting limit coordinated with solitary hyper- boundaries. The way toward describing the priors of the hyperparameters (hyper-priors) and disturbance variance is depicted exhaustively elsewhere. At the point when the proof for the model was boosted as for the hyper- parameters, various hyper-parameters towards vastness compelling the comparing boundaries to nothing. These boundaries were pruned utilizing the programmed importance assurance technique (Mackay, 1992; Tipping, 2001) bringing about a scanty model. tend Since the probability (4) and earlier (5) are characterized to be re- the Bayesian equation (3) this permits communicated as p(W: t, α, σ2) = ρ(t:W,σ2)p(W:α) p(t:α,σ2) (8) The boundaries α and σ were assessed utilizing a sort II greatest probability strategy. Forecasts made by weighting the premise capacities (4) by the back mean loads can be Figure 6: Relevance Vector Machine architecture Empirical Research on Proposed Method Figure outwardly mirrors the conveyance of all information elements of recorded organizations and the consequences of screening highlighted by inadequate head part investigation. From the gathering, the trademark marks (OF) mostly center around productivity, dissolvability, development capacity, capital design, and per-share pointers. through inadequate head part investigation of each gathering of highlights (GSPCA), a decent aspect decrease impact can be accomplished. 61 highlights can be chosen from the first 179-pointers. Of the 40 markers in the element bunch mirroring the organization's productivity, just 3 were chosen by meager head part examination, and just 3 of the 21 pointers in the component bunch mirroring the list data per share were held. Generally, none of the signs of the trademark bunch mirroring the profit capacity of the organization or the trademark gathering of examination are inadequate, marks of the trademark bunch mirroring the development capacity of the organization are held. To analyze the impact of collection sparsity in highlight determination, this paper conducts a scanty head part examination on every one of the pointers (SPCA). this technique chooses 12 attributes from the first pointers, and these 12 markers chiefly mirror the data of the venture's capital construction, acquiring quality, and corporate administration. As can be finished from the Figure, albeit this technique accomplishes aspect decrease impact, it overlooks numerous parts of like productivity, development capacity, activity capacity, and market exchange. It might eliminate a ton of helpful data connected with an organization's gauge of financial distress. the organization free - new request execution strength appraisal arrangements like Liquidity, Leverage, Profitability, Coverage, and Activity. To also additionally factors were foster consolidated. As confirmed by Shumway (2001), as opposed to using factors that permit only one-year monetary extent to see - additional year time factors were added alongside past due history, changes in assets, and arrangement characteristics. Disregarding Random Forests, the best-performing procedure for a static period gathering - Artificial Neural Networks - experienced disintegrating in assumption responsiveness by 6 p.p. Mixed classifier response to time components might be associated with the trial thought of model new development, which can move from variables to getting ready system contrasts (Addo et al., 2018; Arora and Kaur; 2020). By and large, multi- period request was a preferred philosophy in assessment over a static-period pointer, which shows that time factors diminished the weakness factor by updating for periods at serious risk. Individual variable importance, in the best performing Random Forests classifier with additional elements, was tantamount all through a larger piece of variables. Most vital importance was connected with association age and least to country marker. Modestly little importance numbers for individual variables show that the major classifier strength is connected with associations between all factors and not independent elements[35]. The assessed financial distress indicator, whenever the traditional likelihood of default contrasted with classifiers, had somewhat lower expectation power. In correlation, other likelihood of default displaying studies had exactness as high (even in the wake of rectifying for lower predisposition). Potential explanations behind assessor precision could be connected to various ward variable detailing. Old-style credit risk forecast models are centered around the reality of liquidation (or default), while in this study financial distress is looked at when an SME element starts having monetary issues, as determined by changes in FICO ratings. This part is a finishing occasion in the organization's presence, seldom happens at least a time or two and it takes more than one component to set off. Then again, organizations could encounter various financial distress occasions without setting off a chapter 11. For instance, occasions like court debates shut occupied capital offices, and staff changes can be purposes behind brief economic shocks, in any event, for organizations that recently demonstrated a likelihood of default. According to the bank's point of view, contingent upon its gamble craving, neither one nor the other would be liked because of possibly higher capital necessities. low Figure 7: Feature results outcome by SPCA of empirical financial distress. IV. DISCUSSION To reflect genuine loan specialist credit dynamic structures and in opposition to the common likelihood of default indicators, subordinates are not set in stone by portraying monetary misery when an SME component faces monetary difficulties and does not show up at decisive periods of section 11. Customary monetary extents, proposed were used for picking free factors, which include a country identifier and monetary variables from monetary V. CONCLUSION In this paper, an RVM model in light of scanty head part examination (GSPCA-RVM) is proposed to manage financial distress expectations. Displaying credit risk is one of the significant subjects each moneylender faces, whether deciding the financial capacity of an insolvent to reimburse the credit or computing the principal prerequisites which are forced by the financial controller. This errand turns out to be significantly more enthusiastically when SME explicit variables like restricted data accessibility and financial adaptability are presented. In the component determination phase of the first dataset, we suggest a technique to bunch the highlights as per data causes and financial explanation examination. the reason for this strategy is to examine whether the prescient presentation of the model can be enhanced by choosing less, somewhat more significant factors from every data including classification. Contrasted and other estimating models, our strategy has a superior determining impact since it joins the administration technique and machine learning strategy in the field of big business financial distress gauging. Taking into account that the data element of recorded organizations has the attributes of regular gathering, applying the financial assertion examination strategy to the gathering of unique datasets keeps away from the normal aspect decrease technique overlooking the data concealed in the variable gathering structure, which might lessen the estimating impact of the model. Also, the meager calculation chooses less and more significant factors from every data highlight classification to further develop the expectation execution and logical capacity of the classical and extra examines which include classifications of the organization can give more data to foreseeing financial distress. REFERENCES [5] Chen, W.-S.; Du, Y.-K. Using neural networks and data mining techniques for the financial distress prediction model. Expert Syst. Appl. 2009, 36, 4075–4086. [6] Gregova, E.; Valaskova, K.; Adamko, P.; Tumpach, M.; Jaros, J. Predicting Financial Distress of Slovak Enterprises: Comparison of Selected Traditional and Learning Algorithms Methods. Sustainability 2020, 12, 3954. [7] Chen, S.D.; Jhuang, S. Financial distress prediction using data mining techniques. ICIC-ELB 2018, 9, 131–136. [8] Hahnenstein, L.; Köchling, G.; Posch, P.N. Do firms hedge in order to avoid financial distress costs? New empirical evidence using bank data. J. Bus. Finance. Account. 2020, 1–24. [9] Sharma, S.; Mahajan, V. Early Warning Indicators of Business Failure. J. Mark. 1980, 44, 80. [10] Felipe, C.M.; Roldán, J.L.; Leal-Rodríguez, A.L. An explanatory and predictive model for organizational agility. J. Bus. Res. 2016, 69, 4624–4631. [11] Shen, F.; Liu, Y.; Wang, R.; Zhou, W. A dynamic financial distress forecast model with multiple forecast results under unbalanced data environment. Knowl. Based. Syst. 2020, 192, 1–16. [12] Fama, E.; Jensen, M. Separation of ownership and control. J. Law Econ. 1983, 26, 301–325. [13] Dowell, G.W.S.; Shackell, M.B.; Stuart, N.V. Boards, CEOs, and surviving a financial crisis: Evidence from the Internet shakeout. Strat. Manag. J. 2011, 32, 1025–1045. [14] Mangena, M.; Tauringana, V.; Chamisa, E. Corporate Boards, Ownership Structure and Firm Performance in an Environment of Severe Political and Economic Crisis. Br. J. Manag. 2011, 23, S23– S41. [15] Tinoco, M.H.; Wilson, N. Financial distress and bankruptcy prediction among listed companies using accounting, market and macroeconomic variables. Int. Rev. Financ. Anal. 2013, 30, 394– 419. [1] [2] Jensen, M.C.; Meckling, W.H. Theory of the Firm: Managerial Behavior, Agency Costs, and Ownership Structure. SSRN Electron. J. 1998, 163–231. [16] Boughaci, D., Alkhawaldeh, A. A. K., Jaber, J. J., & Hamadneh, N. (2020). Classification with segmentation for credit scoring and bankruptcy 1–29. prediction. Empirical Economics, https://doi.org/10.1007/s00181-020-01901-8 01, Inekwe, J.N.; Jin, Y.; Valenzuela, M.R. The effects of financial distress: Evidence from US GDP growth. Econ. Model. 2018, 72, 8– 21. [17] Breiman, L. (2001). Random Forests. Statistics Department. Berkeley: University of California. Available from the internet: https://www.stat.berkeley.edu/~breiman/randomforest2001.pdf [3] Wu, L.; Shao, Z.; Yang, C.; Ding, T.; Zhang, W. The Impact of CSR and Financial Distress on Financial Performance-Evidence from Chinese Listed Companies of the Manufacturing Industry. Sustainability 2020, 12, 6799. [4] Jandik, T.; Makhija, A.K. Debt, debt structure, and corporate performance after unsuccessful takeovers: Evidence from targets that remain independent. J. Corp. Financ. 2005, 11, 882–914. [18] Butaru, F., Chen, Q., Clark, B., Das, S., Lo, A. W., & Siddique, A. (2016). Risk and Risk Management in the Credit Card Industry. Journal 218–239. Finance, Banking https://doi.org/10.1016/j.jbankfin.2016.07.015 and 72, of [19] Chang, Y.C., Chang, K.H., Chu, H.H., & Tong, L.I. (2016). Establishing decision tree-based short-term default credit risk assessment models. Communications in Statistics, 45 (23), 6803– 6815. https://doi.org/10.1080/03610926. 2014.968730 [20] Chatterjee, S. (2015). Modeling credit risk. London: Bank of internet: the Available England. https://www.bankofengland.co.uk/- /media/boe/files/ccbs/resources/modelling-credit-risk from [33] Sharma, D. (2012). Improving the Art, Craft, and Science of Economic Credit Risk Scorecards Using Random Forests: Why Credit Scorers and Economists Should Use Random Forests. Academy of Banking Studies Journal, 11 (1), 93– 117. [21] Davis, R. H., Edelman, D. B., & Gammerman, A. J. (1992). Machine-learning algorithms for credit-card applications. Journal of Management and Mathematics, 4 (1), 43–51. Available from internet: article- https://academic.oup.com/imaman/ abstract/4/1/43/656001?redirectedFrom=fulltext; https://doi.org/10.1093/imaman/4.1.43 Demsar, J. (2006). [34] Shen, F., Wang, R., &, Shen, Y. (2020). A cost-sensitive logistic regression credit scoring model based on a multi-objective optimization approach. Technological and Economic Development of https://doi.org/10. 26 Economy, 3846/tede.2019.11337 405–429. (2), [22] Statistical Comparisons of Classifiers over Multiple Data Sets. Excel: Lecture Notes and Cases. Arlington: Resampling Stats, Inc. [35] Shmueli, G., Patel, N. R., & Bruce, P. C. (2005). Data Mining In Journal of Machine Learning Research, 7, 1–30. [23] Dietsch, M., & Petey, J. (2002). The credit risk in SME loans portfolios: Modeling issues, pricing, and capital requirements. Journal of Banking (26), 303–322. and Finance, 2/3, https://doi.org/10.1016/S0378-4266(01)00224-2 [24] Drummond, C. (2006). Statistical Comparisons of Classifiers over Multiple Data Sets. Ontario: National Research Council Canada. [25] Kolari, J. W., Ou, C. C., & Shin, H. G. (2006). Assessing the Profitability and Riskiness of Small Business Lenders in the Banking Industry. Journal of Entrepreneurial Finance and Business Ventures, 11 (2), 1–26. https://doi.org/ 10.2139/ssrn.1017093 [26] Merton, R. C. (1974). On the Pricing of Corporate Debt: The Risk Structure of Interest Rates. Journal of Finance, 29 (2), 449–470. internet: from Available https://onlinelibrary.wiley.com/doi/10.1111/j.1540- 6261.1974.tb03058.x; 6261.1974.tb03058.x https://doi.org/10.1111/j.1540- the [27] Moscatelli, M., Parlapiano, F., Narizzano, S., & Viggian, G. (2020). Corporate default forecasting with machine learning. Expert Systems with 1–12. https://doi.org/10.1016/j.eswa.2020.113567 Applications, (11356), 161 [28] Ogachi, D., Richard Ndege, R., Gaturu, P., & Zoltan, Z. (2020). Corporate Bankruptcy Prediction Model, a Special Focus on Listed Companies in Kenya. Journal of Risk Financial Management, 13 (47), 1–14. https://doi.org/10. 3390/jrfm13030047 [29] Ohlson, J. A. (1980). Financial Ratios and the Probabilistic Prediction of Bankruptcy. Journal of Accounting Research, 18 (1), 109-131. internet: https://www.jstor.org/stable/2490395?seq=1#metadata_info_tab_co ntents; https://doi.org/10.2307/2490395 Available from the [30] Paliwal, M., & Kumar, U. A. (2009). Neural networks and statistical techniques: A review of applications. Expert Systems with Applications, 36, 2–17. https://doi.org/10.1016/j.eswa.2007.10.005 [31] Pickert, J. (2017). Risk assessment of unsecured loans - example of entering a new market. Central European Review of Economics and Management, 1 (3), 45–65. https://doi.org/10.29015/cerem.449 [32] Qu, Y., Quan, P., Lei, M., & Shi, I. (2019). Review of bankruptcy prediction using machine learning and deep learning techniques. Procedia 895–899. https://doi.org/10.1016/j.procs.2019.12.065 Computer Science, 162,
http://arxiv.org/abs/2302.12114v1
2023-02-23T15:52:14
2023-02-23T15:52:14
A Constraints Fusion-induced Symmetric Nonnegative Matrix Factorization Approach for Community Detection
Community is a fundamental and critical characteristic of an undirected social network, making community detection be a vital yet thorny issue in network representation learning. A symmetric and non-negative matrix factorization (SNMF) model is frequently adopted to address this issue owing to its great interpretability and scalability. However, it adopts a single latent factor matrix to represent an undirected network for precisely representing its symmetry, which leads to loss of representation learning ability due to the reduced latent space. Motivated by this discovery, this paper proposes a novel Constraints Fusion-induced Symmetric Nonnegative Matrix Factorization (CFS) model that adopts three-fold ideas: a) Representing a target undirected network with multiple latent factor matrices, thus preserving its representation learning capacity; b) Incorporating a symmetry-regularizer that preserves the symmetry of the learnt low-rank approximation to the adjacency matrix into the loss function, thus making the resultant detector well-aware of the target network's symmetry; and c) Introducing a graph-regularizer that preserves local invariance of the network's intrinsic geometry, thus making the achieved detector well-aware of community structure within the target network. Extensively empirical studies on eight real-world social networks from industrial applications demonstrate that the proposed CFS model significantly outperforms state-of-the-art models in achieving highly-accurate community detection results.
[ "Zhigang Liu", "Xin Luo" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12114v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12114v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.SI", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.SI", "cs.LG" ]
A Constraints Fusion-induced Symmetric Nonnegative Matrix Factorization Approach for Community Detection Zhigang Liu1,2, Xin Luo3* 1College of Computer Science and Technology, Chongqing University of Posts and Telecommunications, Chongqing, 400065, China 2Chongqing Key Laboratory of Big Data and Intelligent Computing, Chongqing Institute of Green and Intelligent Technology, Chinese Academy of Sciences, Chongqing, 400714, China 3College of Computer and Information Science, Southwest University, Chongqing 400715, China Abstract Community is a fundamental and critical characteristic of an undirected social network, making community detection be a vital yet thorny issue in network representation learning. A symmetric and non-negative matrix factorization (SNMF) model is frequently adopted to address this issue owing to its great interpretability and scalability. However, it adopts a single latent factor matrix to represent an undirected network for precisely representing its symmetry, which leads to loss of representation learning ability due to the reduced latent space. Motivated by this discovery, this paper proposes a novel Constraints Fusion-induced Symmetric Nonnegative Matrix Factorization (CFS) model that adopts three-fold ideas: a) Representing a target undirected network with multiple latent factor matrices, thus preserving its representation learning capacity; b) Incorporating a symmetry-regularizer that preserves the symmetry of the learnt low-rank approximation to the adjacency matrix into the loss function, thus making the resultant detector well-aware of the target network's symmetry; and c) Introducing a graph-regularizer that preserves local invariance of the network's intrinsic geometry, thus making the achieved detector well-aware of community structure within the target network. Extensively empirical studies on eight real-world social networks from industrial applications demonstrate that the proposed CFS model significantly outperforms state-of-the-art models in achieving highly-accurate community detection results. Keywords: Undirected Network, Social Network, Network Representation Learning, Community Detection, Non-negative Matrix Factorization, Symmetry-regularization. 1. Introduction Numerous entities are ubiquitous in real-world applications, which along with their interactions can be represented as a large- scale undirected network, such as a rating network in recommended systems [1-3], a biological network in bioinformatics [4-6], and a social network in social computing [7-10]. One of the most prominent features of a network is underlying community structure, which plays a critical role in extraction of useful knowledge that describes its networking organization and functional mechanism [11,12]. In general, a community is taken as a special sub-graph that contains a group of nodes with tight connections to form a compact cluster, while the inter-community connections are relatively sparse [13-15]. Aiming at revealing the latent structure indicating groups of cohesive nodes in a network, community detection has become a challenging problem in network representation learning and drawn much interest from different disciplines. Commonly, community detection can be considered as a problem of graph clustering, which is related to various real applications, such as outlier detection [16], social recommendation [17], and biological module identification [18]. To address it, a pyramid of detection approaches have been proposed [19,20]. Generally, the existing community detection methods are categorized as heuristic-based and model-based ones [21]. By meeting some predefined evaluation metrics, e.g., modularity [22], a heuristic method is able to identify communities via searching groups of nodes in a target network. Note that modularity is one of the most widely-accepted metrics for community detection indicating the strength of division of a network into clusters, i.e., it measures the difference between the number of edges falling within clusters in the target network and the corresponding expected number in an equivalent network where edges are distributed randomly. Thus, many methods have been proposed to discover communities via maximizing modularity, e.g., Fast Newman algorithm [23] and fast unfolding [24]. In addition, many studies leverage particular substructures, e.g., clique, as a heuristic measurement to perform community detection [25]. More recent methods for community detection are model-based ones that consider identifying communities as a learning task, i.e., network representation learning. To date, many machine learning techniques have been successfully applied to community detection, e.g., spectral analysis [26,27], matrix factorization [8,21], and deep learning [9,20,28]. Among those sophisticated methods, a Nonnegative Matrix Factorization (NMF)-based model is one of the representative approaches for community detection on undirected networks from real world applications. Given an undirected network, a standard NMF-based community detection method aims to learn a low-rank representation for its adjacency matrix by factorizing it into two latent factor matrices that are called the basis matrix and the representation matrix, respectively. NMF is quite suitable for graph clustering tasks. The reasons 1 are two-fold: a) its potential clustering capability, i.e., NMF and its variants have been proven to be equivalent to some classical clustering methods such as k-means; and b) its nice interpretability to community structure. Most of the current NMF-based community detectors achieve better performance via improving an NMF model's representation learning ability. For instance, Wang et al. [29] propose to apply the NMF-based approaches for community detection on three types of networks including the undirected network, directed network, and compound network. Sun et al. [30] propose a nonnegative encoder-decoder-based model for community detection, which introduces an encoder to transform the adjacency matrix into a low-dimensional representation, and a decoder to reconstruct the network from the learnt representation, thereby improving its representation ability. Ma et al. [31] propose to incorporate the prior information into NMF's factorization process to improve its performance for community detection on a multi-layer network. Despite of their efficiency in community detection, these methods fail to correctly describe the symmetry of an undirected network, which is its inherently fundamental property. To model the symmetry of an undirected network, a Symmetric and Nonnegative Matrix Factorization (SNMF) model is developed, which works by learning a unique latent representation matrix X to construct a low-rank approximation XXT to the adjacency matrix of the target network, thereby correctly characterizing its symmetry. The previous work [32] is proven that it is equivalent to a spectral clustering method. Yang et al. [33] first present a unified interpretation to an SNMF model in community detection, and then propose a unified semi-supervised framework that combines both network topology and prior information to improve detection accuracy. Shi et al. [34] propose a pairwisely constrained SNMF model that incorporates the pairwise constraints generated from a bit of ground-truth information to enhance its performance. In order to extract the intrinsic constraint information from the connections itself, Ye et al. [35] propose a homophily-preserving NMF model that combines both the network topology and node homophily of a network, thus achieving better representation of community structures. Luo et al. [36] propose several linear and nonlinear control schemes to adjust scaling-factors of nonnegative multiplicative update (NMU) learning rules, resulting in several highly-accurate SNMF-based community detectors. The above-mentioned SNMF-based methods achieve state-of-the- art performance. However, they only adopt a unique latent factor matrix to represent a target network, which ensures its rigorous symmetry but restricts its representation learning ability due to the shrinking of the latent space. To tackle this issue, some efforts have been done to enhance an SNMF model's representation learning capacity. Kuang et al. [37] propose a nonsymmetric formulation for an SNMF model (called SymNMF) by introduce a constraint term that minimizes the differences between two latent factor matrices of an NMF model for the graph clustering task. By doing so, the proposed SymNMF model is optimized via a two-block coordinate descent algorithm, since it forces the separation of unknown variables by associating the two latent factors with two different matrices. Subsequently, Zhu et al. [38] and Li et al. [39] also transfer the SNMF to a penalized nonsymmetric NMF model by introducing an equality regularizer to force its two latent factors identical and balancing the effect of the regularizer and the error term with a tunable hyper-parameter. They present an alternating nonnegative least squares (ANLS)-type learning algorithm to solve the reformulation model, as well as the rigorously mathematical proof of its convergence. Although the above methods can represent partial symmetry via setting a large enough regularization coefficient to force the two latent factors identical, the balance between symmetry and representation learning capacity is difficult to strike perfectly. With a small regularization coefficient, the models cannot represent the symmetry effectively. However, with a large regularization coefficient, the representation of symmetry is naturally enhanced, but the optimization process would overly concern the regularizer while weakening the fitting of the error term, which impacts the accuracy of the obtained network representation. Besides, if the solutions of the two latent factor matrices are close enough, the models are actually degenerated to SNMF. Motivated by this discovery, this paper presents and aim to answer the following question: Is it possible to develop an NMF-based community detector that is able to represent a target undirected network's symmetry while preserving its representation learning capacity, thus obtaining highly accurate community detection? To answer this question, in this paper, we propose a Constraints Fusion-induced Symmetric Nonnegative Matrix Factorization (CFS) model that adopts the following three ideas: a) Representing a target undirected network with multiple latent factor matrices, thus preserving its representation learning capacity; b) Incorporating a symmetry-regularizer that preserves the symmetry of the learnt low-rank approximation to the adjacency matrix into the loss function, thus making the resultant detector well-aware of the target network's symmetry; and c) Introducing a graph-regularizer that preserves local invariance of the network's intrinsic geometry, thus making the achieved detector well-aware of community structure within the target network. Main contributions of this work include: a) A novel symmetry-regularizer. It realizes the symmetry-constraint by forcing the resultant low-rank approximation and its transpose matrix identical. Note that it does not force the identity of two involved latent factor matrices directly. Hence, it will not impact the model's representation learning capacity. b) A CFS model. It models a target undirected network's symmetry by incorporating the proposed symmetry-regularizer which can preserve its representation learning capacity, thus achieving good enhancement of the representation learning ability for an SNMF model. In addition, it further incorporates the graph-regularization into its learning objective to preserve the intrinsic geometric features of the target network, thus ensuring its learning ability regarding local invariance. c) Rigorous convergence proof of CFS. The proof consists of two separate steps: a) Proving the non-increasing tendency of the learning objective by leveraging an auxiliary function-incorporated method; and b) Proving the latent factor learning sequences' convergence to a stationary point of the learning objective by proving the establishment of its KKT conditions. 2 Experimental results on eight publicly available and real networks form real applications indicate that the proposed CFS-based community detector obtains significant accuracy gain comparing with the benchmark and state-of-the-art methods. 2. Preliminaries 2.1. Problem Formulation A community detector models a target network with a graph G=(V, E) where V={vi | i=1, ..., n} is a set of n nodes and E={eij | i, j=1, ..., n} is a set of m edges. Then G is denoted by its adjacency matrix A=[aij]∈Rnn, where aij characterizes the interaction relationship between nodes vi and vj. In detail, for an unweighted network, aij is one if eij∈E, and zero otherwise. For a weighted network, A is real-valued. Besides, A is symmetric if G is an undirected graph, and asymmetric otherwise. In this study, we concern the problem of community detection in undirected networks, where all relationships between pairwise entities are symmetric. Given a network G=(V, E), ∀vi∈V, generally, a community detector aims to identify its correct affiliation to a community that consists of its closely related nodes in the target network. Given a network G=(V, E), an NMF-based community detector generally works by the following four key process stages: a) constructing the adjacency matrix A according to G; b) building an NMF-based model to learn a low-rank approximation to A; c) solving the model; and d) identifying node-community affiliation according to the obtained model. Specifically, it first assumes that G has K communities according to the prior information. Then, it learns a rank-K approximation  to A as Â=UXT subjecting to U0 and X0. From the perspective of linear expression, U consists of a set of base vectors and X is taken as a coefficient matrix. Hence, X can be also considered as a representation matrix for the target network, where each row vector denotes a representation for a network node. In the context of NMF-based community detection, X is taken as the soft threshold indicator to identify the node-community affiliation, i.e., ∀j∈{1, 2, ..., n} and k∈{1, 2, ..., K}, each entry xjk indicates the probability of node vj belonging to community Ck, which can be formulated as [8, 36]: (1) With (1), in terms of the case of non-overlapping community detection, for an arbitrary node vj, we only need to assign it into the community Ck by satisfying the condition that xjk is the maximum entry in row vector xj. 2.2. A (Symmetric)NMF-based Community Detector An NMF model has been widely used in information recommendation [40-46], dimensionality reduction [47-55], and feature extraction [55-60], owing to its nice interpretability. In addition, NMF is also highly suitable for the graph clustering task such as community detection, owing to its potential clustering capability. Given a target network G=(V, E) with the adjacency matrix A, an NMF-based model aims to learn a rank-K approximation  to A with two different nonnegative latent factor matrices U=[uik]∈RnK and X=[xjk]∈RnK, i.e., yielding Â=UXT. To acquire U and X, we can solve an objective function that minimizes the difference between A and Â. By adopting the square of the Frobenius norm of the difference between A and UXT, such an objective function is achieved: (2) where ||||F denotes the Frobenius norm. U and X are constrained to be nonnegative for the good interpretability that they together describe the nonnegative probabilities characterizing each node's community tendency. Note that (U, X) is non-convex to U and X together, thus making their global optima intractable. Fortunately, their solution of stationary point can be obtained by leveraging an alternative and iterative algorithm [43,44,60-66]. For instance, [44] provides a nonnegative multiplicative update (NMU) algorithm to iteratively optimize (2) as: (3) With (3), a benchmark NMF-based community detector is established [44]. However, although such a model learns a network's representation via adopting multiple latent factors, it does not consider the symmetry of the target undirected network, which is its intrinsic property. For an undirected network G, its adjacency matrix A is a symmetric square matrix. To better represent its symmetry, an NMF model can be transformed to the symmetric NMF (SNMF) with a symmetric factorization form, i.e., Â=UUT, by making two latent factor identical. In other words, an SNMF model adopts a unique latent factor matrix for representing the target network, thereby guaranteeing its rigorous symmetry. Similarly, its objective function is given as: (4) where U denotes the community soft threshold indicator, and it can be obtained by an NMU learning algorithm, i.e., (5) As revealed in [47], the convergence of an SNMF model under the learning scheme in (5) can be commonly unstable, making 3 : , if max|1,2,,.jjkjkjsvVvCxxsK==()2Tmin,, s.t. 0,0.FUXAUXUX=−()()()()TTT, .ikikjkjkikikjkjkuuAXUXXxxAUXUU()2Tmin, s.t. 0,FUAUUU=−()()T.ikikikikuuAUUUU an SNMF-based community detector suffer from accuracy reduction. Following the suggestion in [47], we adopt a learning scheme with a linearly adjusted multiplicative, i.e., (6) With (6), a benchmark SNMF-based community detector is established [29], which implies a strong symmetric constraint into its approximation, thereby ensuring the rigorous symmetry of the target network. Moreover, it has been proven to be equivalent to a spectral clustering model, making its nice interpretability for community detection which is actually a node clustering problem on graph data. Nevertheless, adopting a unique latent factor matrix gives rise to shrinkage of the latent space, which reduces its representation learning ability to a target network. 3. Methods In this part, we aim to present our CFS-based community detector. Its main principle is three-fold: a) Adopting an asymmetric factorization form with multiple latent factors to represent a target undirected network, thus preserving its representation learning capacity; b) Leveraging a novel symmetry-regularizer that forces the symmetry of the resultant low-rank approximation to the adjacency matrix, thus preserving its representation learning ability for macroscopic symmetry of a target undirected network; and c) Incorporating a graph-regularizer into its learning objective to preserve the intrinsic geometric features of the target network, thus ensuring its learning ability regarding local invariance. The learning algorithm for solving the proposed model is achieved by following the principle of NMU. Rigorous mathematical proof is presented to indicate that the proposed algorithm enables a CFS model to converge to a KKT stationary point of its learning objective. In addition, detailed algorithm is designed for implementing the proposed CFS-based community detector, as well its complexity analysis is also provided. 3.1. A Symmetry-regularized NMF Model To well represent the symmetry of a target network, a novel symmetry-regularizer, i.e., ||UXT−(UXT)T||2 F , is introduced to penalize the symmetry of the learnt low-rank approximation. By doing so, the learning objective function of CFS is given as: where A is the adjacency matrix of the target network. U and X are desired latent factor matrices, and they together form the low- rank approximation to A, i.e., UXT. μ>0 is a scale parameter being taken as a tradeoff between the generalized error and the symmetry regularization. With the adopted symmetry-regularizer in (7), the resultant low-rank approximation and its transpose are forced to be identical, which brings about the target network's symmetry. Besides, such a symmetry constraint is loose and can be adjusted with varying μ. Noted that by adopting the asymmetric factorization form in (7) to construct an SNMF model, its latent space is not shrunk with two different latent factor matrices. Hence, (7) also enables a CFS model to obtain high representation learning capacity to A. To preserve the local invariance of the target network, we further incorporate the graph regularization into (7) to achieve: (7) (8) where tr() denotes the trace of matrix. λ>0 is another tunable parameter to adjust the effect of graph-regularization. L=D−W is the Laplacian matrix of A, where W is a similarity matrix measuring the affinity between each node pair, and D is the degree matrix computed by Dii=∑lWil. In this work, we make W and A numerically equal according to [48]. Based on the commonly accepted property of ||X||2 F=tr(XXT), we achieve the following deduction: (9) where the principle of tr(AB)=tr(BA) is adopted in the second step of (9). By letting =[ik]∈RnK and =[jk]∈RnK be the Lagrangian multiplier matrices for the nonnegative constraints: U=[uik]0 and X=[xjk]0, we construct the Lagrangian function as: (10) whose partial derivatives with respect to U and X are computed as: (11a) (11b) Hence, a local minimum of (10) is achieved by setting (11) and (12) to be zeros, i.e., (U, X)/U=0 and (U, X)/X=0. After that, based on the KKT conditions that ∀i, j∈{1, 2, ..., n}, k∈{1, 2, ..., K}: ikuik=0 and jkxjk=0, the optimal solutions of uik and xjk are obtained: 4 ()()()T12+2.ikikikikuuAUUUU()22TTTmin,, s.t. 0,0,2FFUXAUXUXXUUX=−+−()()22TTTTmin,tr, s.t. 0,0,2FFUXAUXUXXUXLXUX=−+−+()()()()TTTTTTTTTmin,=tr2trtr, s.t. 0,0,UXAAAXUUXXUUXXUUXUXXLXUX−++−+()()()()()()TTTTTTTTTTT,=tr2trtrtrtr,UXAAAXUUXXUUXXUUXUXXLXUX−++−+−−()()TT,2212,UXAXUXXXUXU=−++−−()()TTT,22122.UXAUXUUUXULXX=−++−+− (12a) (12b) Finally, with (13) and (14), the following NMU-type learning scheme for CFS is achieved: (13a) (13b) Hereto, with (13) a CFS-based community detector is established. It should be pointed that if μ is set to zero, (13) degrades into the learning scheme for a graph-regularized NMF (GNMF)-based community detector [33]. If both μ and λ are set to zeros, (13) degrades into the learning scheme for a benchmark NMF-based community detector [44]. 4. Experimental Results and Analysis 4.1 General Settings Evaluation Protocol. To obtain fair experimental results, we adopt two types of metrics for evaluating the detection accuracy of tested community detectors. Note that as an unsupervised learning process, the performance of a community detection method commonly tested via leveraging the ground-truth, i.e., node-community labels, to measure its detecting accuracy. Hence, to avoid substituting label information into the model building process, we adopt an evaluation metric without ground-truth as a validation means to tune hyper-parameters. By doing so, a final community detector with the optimum hyper-parameters is established. Then, we test its performance by using several ground-truth based evaluation metrics. Hence, we first adopt an evaluation metric without ground-truth, i.e., Modularity [50], as a performance indicator to select hyper-parameters. We then adopt two ground-truth based evaluation metrics, i.e., Normalized Mutual Information (NMI) [51] and Adjusted Rand Index (ARI) [51] to test the performance of all involved community detectors. Datasets. Eight networks collected form real-world applications are used to evaluate the performance of involved methods. As summarized in Table 1, all adopted datasets are popular, publicly-available and wide-used in prior and related studies. Table 1 Details of Experimental Datasets No. D1 D2 D3 D4 D5 D6 D7 D8 Datasets Amazon DBLP Friendster LJ Orkut Youtube Polblogs Cora #Nodes 5,304 12,547 11,023 7,181 11,751 11,144 1,490 2,708 #Edges 16,701 35,250 280,755 253,820 270,667 36,186 16,718 5,429 #Communities Description 85 4 13 30 5 40 2 7 Amazon product [73] DBLP collaboration [73] Friendster online [73] LiveJournal online [73] Orkut online [73] Youtube online [73] Blogs about US politics [72] LINQS [74] Models. We compare the proposed CFS (M10) model with nine models including two benchmark models, i.e., NMF (M1) [44] and SNMF (M2) [47], and seven state-of-the-art models, i.e., NSED (M3) [30], SymNMF (M4) [37], GNMF (M5) [33], GSNMF (M6) [33], HPNMF (M7) [35], LpNMF (M8) [53] and SymHALS (M9) [38,39]. 4.2 Sensitivity Analysis Since hyper-parameters are commonly significant for a machine learning model [67-72], we aim to make clear the effects of the involved hyper-parameters in CFS, i.e., λ and μ. It should be pointed that their self-adaptation is still a critical and challenging issue, and we plan to address this issue in our future work. Note that in this part we leverage a ground-truth independent evaluation metric, i.e., Modularity, to tune hyper-parameters to avoid the issue of leaky validation. (a) D1 (b) D2 (c) D3 (d) D4 Fig. 1. The modularity values about various λ on D1-D4. 5 ()()()()()()TTTT10;1ikikikikikikikikAXXUXAXXUXuUXXuuuUXX+−+++==+()()()()()()()()TTTTTT10.1jkjkjkjkjkjkjkjkjkAUUXUAXAUUXUAXxXUUDXxxXUUDX++−+++++==++()()()()()1TT1,ttikikikikuuAXXUXUXX+++()()()()()()1TTT1.ttjkjkjkjkxxAUUXUAXXUUDX+=++++34363840424446Modularity (%)Value of  M100 10-2 10-1 100 101 102 103 Baseline202530354045Modularity (%)Value of 0 10-2 10-1 100 101 102 103 Baseline M103436384042Modularity (%)Value of 0 10-2 10-1 100 101 102 103 Baseline M1015202530354045Modularity (%)Value of 0 10-2 10-1 100 101 102 103 Baseline M10 (a) D1 (b) D2 (c) D3 (d) D4 Fig. 2. The modularity values about various μ on D1-D4. We first evaluate λ's effects by tuning it in the set of {0, 10-2, 10-1, 100, 101, 102, 103} while fixing μ at 2-8 randomly, as NMF is the baseline. The validation results regarding λ on D1-D4 is depicted in Fig. 1. Then, we evaluate the effects of μ by tuning it in the set of {2-10, 2-8, 2-6, 2-4, 2-2, 20, 21} while setting the optimal value of λ on each dataset, as GNMF is the baseline. Fig. 2 shows the validation results regarding μ on D1-D4. Form the experimental results shown in Fig. 1, Fig. 2, and Table 3, we see that the performance of M10 measured by Modularity is sensitive to both λ and μ. Both λ and μ have vital effects on M10's detection accuracy. Their optimal values are datasets-dependent. However, when λ=10, μ∈[2-6, 2-4], M10 obtains the relatively better results. 4.3 Performance Comparison We aim to compare our CFS with the baseline and state-of-the-art models, whose details are summarized in Section IV-A, to validate its performance. We record the average NMI and ARI values of ten compared models on eight real social networks in Tables 2 and 3. From the results, we conclude that: a) The proposed symmetry-regularizer is effective. As shown in Table 2, we can see that M10 outperforms M5 on all eight testing cases in terms of NMI. According to the results in Table 3, M10 also outperforms M5 on seven testing cases out of eight in total in terms of ARI. Hence, the results discussed above tell us that the proposed symmetry-regularizer enable M10 to achieve more accurate detection accuracy. That is to say, the proposed symmetry-regularizer is effective. b) M10 outperforms its peers in achieving highly accurate community detection results. From the comparison results recorded in Tables 2 and 3, we observe that M10 achieves the best detection accuracy on most testing cases across different evaluation metrics. Taking NMI as an example, we see that M10 significantly outperforms all the baseline and state-of-the-art models on six testing cases out of eight in total as shown in Table 2. Its accuracy gain is evident. Besides, the average Friedman rank of M10 regarding NMI is 1.25, which is the lowest one among all compared models as shown in Table 4, indicating that M10 achieves the best performance among all models. Overall, the comparison results indicate the significant superiority in detection accuracy of the proposed C-SNMF-based community detector compared both the baseline and state-of-the-art methods, owing to its compatible constraints fusion scheme via incorporating both the symmetry-regularizer and graph-regularizer. Table 2. Community Detection Performance (NMI%±STD%) of Compared Methods on Each Dataset. ( Indicates That M10 Loses to the Comparison Models) M5 M3 M4 M2 9.30±1.13 NMI D1 D2 D3 D4 D5 D6 D7 D8 Win/Loss Ranks* p-value** M6 M1 62.83±2.25 46.25±0.58 42.78±1.37 48.23±0.93 68.20±1.98 43.11±0.93 10.42±3.04 6.51±1.81 4.98±2.31 7.19±2.05 5.97±2.52 76.36±4.60 62.48±10.52 72.18±5.26 69.23±3.02 80.59±0.00 73.38±6.24 33.81±2.37 19.38±4.60 41.74±0.79 49.64±3.45 24.30±1.71 72.34±5.43 28.17±1.32 33.53±6.11 32.12±6.38 31.89±6.28 71.16±11.58 29.76±0.60 42.75±2.66 17.53±0.57 17.62±1.27 19.38±1.40 18.80±1.02 17.41±1.88 45.10±1.40 45.10±1.40 47.46±3.35 45.40±1.42 48.21±3.74 48.02±3.76 17.78±1.29 8.55±4.25 19.21±2.57 11.18±5.31 16.08±3.89 11.89±2.82 8/0 8/0 4.19 8.38 0.0039 0.0039 8/0 6.06 0.0039 *A lower Friedman rank value indicates a higher community detection accuracy. **The accepted hypotheses with a significance level of 0.05 are highlighted. 8/0 7.31 0.0039 8/0 7.88 0.0039 8/0 6.00 0.0039 M7 77.03±0.71 15.07±5.79 77.01±4.53 63.96±1.39 46.70±11.27 30.40±2.53 44.71±1.21 18.67±2.12 7/1 3.75 0.0273 M9 M10 M8 68.20±1.48 53.59±1.02 70.02±3.33 13.34±3.44 11.97±4.29 20.92±3.72 86.42±7.58 63.63±6.83 88.26±3.56 51.12±5.51 42.01±2.74 73.13±1.82 44.81±13.37 39.06±4.88 71.79±8.32 22.70±5.27 11.49±1.03 50.83±3.44 47.05±1.11 50.38±1.46 44.98±0.00 21.14±0.00 17.65±1.12 20.20±3.83 8/0 6.38 0.0039 7/1 3.81 0.0078 -- 1.25 -- Table 3. Community Detection Performance (ARI%±STD%) of Compared Methods on Each Dataset. ( Indicates That M10 Loses to the Comparison Models) ARI D1 D2 D3 D4 D5 D6 D7 D8 Win/Loss Ranks p-value M3 M1 M4 57.79±0.92 22.44±5.12 78.54±0.00 50.85±0.42 36.78±7.12 M5 M2 59.72±1.59 49.75±2.74 57.54±0.75 46.57±0.82 18.20±3.95 19.38±3.46 19.35±4.34 17.08±4.76 74.06±3.74 63.53±7.76 70.96±6.41 69.46±2.14 55.39±9.01 46.64±5.14 59.41±6.94 43.65±5.30 33.08±1.94 34.77±2.22 38.00±6.52 36.59±6.88 28.83±1.72 28.26±0.58 28.82±2.01 30.06±0.94 29.65±1.02 53.42±7.40 53.08±7.59 54.56±1.43 52.49±7.38 16.05±2.26 17.34±2.83 22.89±4.23 16.17±3.16 7/1 8/0 6.25 5.81 0.0078 0.0039 53.66±1.95 19.89±3.04 7/1 5.25 0.0078 8/0 7.88 0.0039 8/0 8.38 0.0039 6 M9 M7 M8 M10 M6 68.26±1.89 61.75±1.56 60.87±2.49 60.84±1.88 54.24±2.76 24.22±4.27 38.33±3.22 28.16±7.37 24.37±6.73 80.45±17.56 85.78±5.56 70.36±4.24 69.28±1.23 43.85±4.31 72.42±5.17 52.80±8.66 44.01±9.89 74.76±5.93 50.63±13.78 65.99±12.05 53.46±10.64 29.48±1.58 6.98±2.05 31.57±7.19 26.08±2.11 60.72±1.31 46.83±0.00 53.65±1.12 54.56±1.43 23.60±1.58 23.44±1.61 23.83±1.98 24.15±0.00 -- 8/0 2.00 5.31 -- 0.0039 25.58±8.79 54.45±9.07 58.42±5.36 40.37±8.94 24.16±1.82 57.49±1.24 22.09±2.26 7/1 5.13 0.0078 5/3 3.63 0.0742 6/2 5.38 0.0195 43.343.443.543.643.743.843.944.0Modularity (%)Value of  M102-10 2-8 2-6 2-4 2-2 20 21 Baseline202530354045Modularity (%)Value of 2-10 2-8 2-6 2-4 2-2 20 21 Baseline M1030323436384042Modularity (%)Value of 2-10 2-8 2-6 2-4 2-2 20 21 Baseline M1030.032.535.037.540.042.545.0Modularity (%)Value of 2-10 2-8 2-6 2-4 2-2 20 21 Baseline M10 5. Conclusions In the context of community detection in social networks, the symmetry of an undirected network plays an important role in correctly describing its intrinsically structural features. An SNMF algorithm introduces the symmetry constraint into an NMF framework, and it strictly models the symmetry of a given symmetric matrix. However, by doing so, its LF space reduces into half of the original NMF model, which degrades its performance for community detection. To address this issue, this work presents a novel Constraints Fusion-induced Symmetric Nonnegative Matrix Factorization (CFS) model. It realizes the relaxed symmetry by introducing an equality-constraint on the leant low-rank approximation of the target social network. Besides, it leverages a graph- regularization method into CFS to extract the features concerning the intrinsically geometric structure of networks. Empirical studies on eight real-world social networks from industrial applications demonstrate that a CFS-based detector can achieve the higher accuracy for community detection than state-of-the-art models. As future work, we plan to address the issue of self-adaptive hyper-parameters, self-adaption schemes, e.g., particle swarm optimization (PSO) algorithms [45,56,62] are highly demanded. References [1] X. Luo, Y. Zhou, Z. Liu, and M. Zhou. Fast and accurate non-negative latent factor analysis on high-dimensional and sparse matrices in recommender systems, IEEE Transactions on Knowledge and Data Engineering, DOI: 10.1109/TKDE.2021.3125252. [2] W. Li, Q. He, X. Luo, and Z. Wang. Assimilating second-order information for building non-negative latent factor analysis-based recommenders, IEEE Transactions on System Man Cybernetics: Systems, 2021, 52(1): 485-497 [3] X Luo, M. Zhou, S. Li, Z. You, Y. Xia, Q. Zhu, and H. Leung. An efficient second-order approach to factorizing sparse matrices in recommender systems. IEEE Transactions on Industrial Informatics. 2015, 11(4): 946-956. [4] D. Wu, X. Luo, M. Shang, Y. He, G. Wang, and M. Zhou. A deep latent factor model for high-dimensional and sparse matrices in recommender systems. IEEE Transactions on System Man Cybernetics: Systems, 2021, 51(7): 4285-4296. [5] L. Hu, X. Pan, Z. Tang, and X. Luo. A fast fuzzy clustering algorithm for complex networks via a generalized momentum method. IEEE Transactions on Fuzzy Systems, 2022, 30(9): 3473-348. [6] X. Luo, H. Wu, Z. Wang, J. Wang, and D. Meng. A novel approach to large-scale dynamically weighted directed network representation, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022, 44(12): 9756-9773. [7] S. Li, M. Zhou, X. Luo and Z. -H. You, Distributed winner-take-all in dynamic networks, IEEE Transactions on Automatic Control, 2017, 62(2): 577-589. [8] S. Li, M. Zhou and X. Luo, Modified primal-dual neural networks for motion control of redundant manipulators with dynamic rejection of harmonic noises, IEEE Transactions on Neural Networks and Learning Systems, 2018, 29(10):4791-4801. [9] Y. Zhou, X. Luo, and M. Zhou. Cryptocurrency transaction network embedding from static and dynamic perspectives: An overview. IEEE/CAA Journal of Automatica Sinica, DOI: 10.1109/JAS.2023.123450. [10] N. Dehmamy, S. Milanlouei, A. L. Barabasi, A structural transition in physical networks, Nature 563 (7733) (2018) 676-680. [11] S. Fortunato, D. Hric, Community detection in networks: A user guide, Physics Reports 659 (2016) 1-44. [12] S. Das, A. Biswas, Deployment of information diffusion for community detection in online social networks: A comprehensive review, IEEE Trans. on Computational Social Systems 8 (5) (2021) 1083-1107. [13] Z. Liu, X. Luo, and M. Zhou. Symmetry and graph bi-regularized non-negative matrix factorization for precise community detection. IEEE Transactions on Automation Science and Engineering, DOI: 10.1109/TASE.2023.3240335. [14] D. Wu, X. Luo, M. Shang, Y. He, G. Wang, and X. Wu. A data-characteristic-aware latent factor model for web services QoS prediction, IEEE Transactions on Knowledge and Data Engineering, 2022, 34(6): 2525-2538. [15] X. Shi, Q. He, X. Luo, Y. Bai, and M. Shang. Large-scale and scalable latent factor analysis via distributed alternative stochastic gradient descent for recommender systems, IEEE Transactions on Big Data, 2022, 8(2):420-431. [16] I. Souiden, M. N. Omri, Z. Brahmi, A survey of outlier detection in high dimensional data streams, Computer Science Review 44 (2022) 100463. [17] C. Hsu, M. Yeh, S. Lin, A general framework for implicit and explicit social recommendation, IEEE Trans. on Knowledge and Data Engineering 30 (12) (2018) 2228-2241. [18] T. He, K. C. C. Chan, Measuring boundedness for protein complex identification in PPI networks, IEEE/ACM Trans. on Computational Biology and Bioinformatics 16 (3) (2019) 967-979. [19] B. A. Attea, et al. A review of heuristics and metaheuristics for community detection in complex networks: Current usage, emerging development and future directions, Swarm and Evolutionary Computation 63 (8) (2021) 100885. [20] M. N. Al-Andoli, S. C. Tan, W. P. Cheah, S. Y. Tan, A review on community detection in large complex networks from conventional to deep learning methods: A call for the use of parallel meta-heuristic algorithms, IEEE Access 9 (2021) 96501-96527. [21] T. He, L. Bai, Y. S. Ong, Vicinal vertex allocation for matrix factorization in networks, IEEE Trans. on Cybernetics doi: 10.1109/TCYB.2021.3051606. [22] A. Clauset, M. E. J. Newman, C. Moore, Finding community structure in very large networks, Physical Review E 70 (6) (2004) 066111. [23] M. E. J. Newman, Fast algorithm for detecting community structure in networks, Physical Review E 69 (6) (2004) 066133. [24] V. D. Blondel, J. L. Guillaume, R. Lambiotte, E. Lefebvre, Fast unfolding of communities in large networks, Journal of Statistical Mechanics-Theory and Experiment (2008) P10008. [25] X. Wen, W. N. Chen, Y. Lin, et al., A maximal clique based multiobjective evolutionary algorithm for overlapping community detection, IEEE Trans. on Evolutionary Computation 21 (3) (2017) 363-377. [26] D. Huang, C. Wang, J. Wu, J. Lai, C. Kwoh, Ultra-scalable spectral clustering and ensemble clustering, IEEE Trans. on Knowledge and Data Engineering, 32 (6) (2020) 1212-1226. [27] X. Hu, H. Zhang, C. Yang, X. Zhao, B. Li, Regularized spectral clustering with entropy perturbation, IEEE Trans. on Big Data, 7 (6) (2021) 967-972. [28] D. Jin, P. Jiao, S. Pan, et al., A survey of community detection approaches: From statistical modeling to deep learning, IEEE Trans. on Knowledge and Data Engineering doi: 10.1109/TKDE.2021.3104155. [29] F. Wang, T. Li. X. Wang, S. Zhu, C. Ding, Community discovery using nonnegative matrix factorization, Data Mining And Knowledge Discovery, 22 (3) (2011) 493-521. [30] B. J. Sun, H. W. Shen, J. H. Gao, W. T. Ouyang, X. Q. Cheng, A non-negative symmetric encoder-decoder approach for community detection, in: Proc. of the 2017 ACM on Conference on Information and Knowledge Management, 2017, pp. 597-606. [31] X. Ma, D. Dong, Q. Wang, Community detection in multi-layer networks using joint nonnegative matrix factorization, IEEE Trans. on Knowledge and Data Engineering, 31(2) (2019) 273-286. [32] C. Ding, X. He, H. D. Simon, On the equivalence of nonnegative matrix factorization and spectral clustering, in: Proc. of the 2005 SIAM International Conference on Data Mining (SDM), 2005, pp. 606-610. [33] L. Yang, X. C. Cao, D. Jin, X. Wang, D. Meng, A unified semi-supervised community detection framework using latent space graph regularization, IEEE Trans. on Cybernetics, 45 (11) (2015) 2585-2598. 7 [34] X. H. Shi, H. T. Hu, Y. C. He, S. He, Community detection in social network with pairwisely constrained symmetric non-negative matrix factorization, in: Proc. of the 2015 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining, 2015, pp. 541-546. [35] F. Ye, C. Chen, Z. Wen, Z. Zheng, W. Chen, Y. Zhou, Homophily preserving community detection, IEEE Trans. on Neural Networks and Learning Systems, 31 (8) (2020) 2903-2915. [36] X. Luo, Z. Liu, L. Jin, Y. Zhou, M. Zhou, Symmetric nonnegative matrix factorization-based community detection models and their convergence analysis, IEEE Trans. on Neural Networks and Learning Systems, 33 (3) (2022) 1203-1215. [37] D. Kuang, S. Yun, H. Park, SymNMF: Nonnegative low-rank approximation of a similarity matrix for graph clustering, Journal of Global Optimization, 62 (3) (2015) 545-574. [38] Z. Zhu, X. Li, K, Liu, Q. Li, Dropping symmetry for fast symmetric nonnegative matrix factorization, in: Proc. of the 32nd Conference on Neural Information Processing Systems (NeurIPS), 2018, pp. 5160-5170. [39] X. Li, Z. Zhu, Q. Li, K. Liu, A provable splitting approach for symmetric nonnegative matrix factorization, IEEE Trans. on Knowledge and Data Engineering, doi: 10.1109/TKDE.2021.3125947. [40] L. Xin, Y. Yuan, M. Zhou, Z. Liu, M. Shang, Non-negative latent factor model based on β-divergence for recommender systems, IEEE Trans. on Systems, Man, and Cybernetics: Systems, 51 (8) (2021) 4612-4623. [41] D. Wu, Q. He, X. Luo, M. Shang, Y. He, and G. Wang. A Posterior-neighborhood-regularized latent factor model for highly accurate web service QoS prediction, IEEE Transactions on Services Computing, 2022, 15(2): 793-805. [42] D. Wu, Y. He, X. Luo, and M. Zhou. A latent factor analysis-based approach to online sparse streaming feature selection. IEEE Transactions on System Man Cybernetics: Systems, 2022, 52(11): 6744-6758. [43] M. Shang, Y. Yuan, X. Luo, and M. Zhou. An α-β-divergence-generalized recommender for highly-accurate predictions of missing user preferences, IEEE Transactions on Cybernetics, 2022, 52(8): 8006-8018. [44] D. D. Lee, H. S. Seung, Algorithms for non-negative matrix factorization, in: Proc. of Advances in Neural Information Processing Systems (NIPS), 2000, pp. 556-562. [45] J. Chen, X. Luo, and M. Zhou. Hierarchical particle swarm optimization-incorporated latent factor analysis for large-scale incomplete matrices, IEEE Transactions on Big Data, 2022, 8(6): 1524-1536. [46] Y. Song, Z. Zhu, M. Li, G. Yang, and X. Luo. Non-negative latent factor analysis-incorporated and feature-weighted fuzzy double c-means clustering for incomplete data. IEEE Transactions on Fuzzy Systems, 2022, 30(10): 4165-4176. [47] D. D. Wang, T. Li, S. H. Zhu, C. Ding, Multi-document summarization via sentence-level semantic analysis and symmetric matrix factorization, in: Proc. of the 31st International ACM SIGIR Conference on Research and Development in Information Retrieval, 2008, pp. 307-314. [48] L. Jin, X. Zheng, and X. Luo. Neural dynamics for distributed collaborative control of manipulators with time delays. IEEE/CAA Journal of Automatica Sinica, 2022, 9(5): 854-863. [49] Z., G. Yuan, and X. Luo. Symmetry and nonnegativity-constrained matrix factorization for community detection. IEEE/CAA Journal of Automatica Sinica, 2022, 9(9) 1691-1693. [50] M. E. J. Newman, Modularity and community structure in networks, Proceedings of the National Academy of Sciences of the United States of America, 103 (23) (2006) 8577-8582. [51] T. Chakraborty, A. Dalmia, A. Mukherjee, N. Ganguly, Metrics for community analysis: A survey, ACM Computing Surveys, 50 (4) (2017) 54. [52] Y. Yuan, X. Luo, M. Shang, and Z. Wang. A Kalman-filter-incorporated latent factor analysis model for temporally dynamic sparse data. IEEE Transactions on Cybernetics, DOI: 10.1109/TCYB.2022.3185117. [53] C. Leng, H. Zhang, G. Cai, I. Cheng, A. Basu, Graph regularized Lp smooth non-negative matrix factorization for data representation, IEEE/CAA Journal of Automatica Sinica, 6 (2) (2019) 584-595. [54] W. Li, X. Luo, H. Yuan, and M. Zhou. A momentum-accelerated hessian-vector-based latent factor analysis model, IEEE Transactions on Services Computing, DOI: 10.1109/TSC.2022.3177316. [55] X. Luo, H. Wu, and Z. Li. NeuLFT: A novel approach to nonlinear canonical polyadic decomposition on high-dimensional incomplete tensors, IEEE Transactions on Knowledge and Data Engineering, DOI: 10.1109/TKDE.2022.3176466. [56] X. Luo, Y. Yuan, S. L. Chen, N. Y. Zeng, Z. D. Wang, Position-transitional particle swarm optimization-incorporated latent factor analysis, IEEE Trans. on Knowledge and Data Engineering, doi: 10.1109/TKDE.2020.3033324. [57] X. Luo, Y. Zhong, Z. Wang, and M. Li. An alternating-direction-method of multipliers-incorporated approach to symmetric non-negative latent factor analysis, IEEE Transactions on Neural Networks and Learning Systems, DOI: 10.1109/TNNLS.2021.3125774. [58] X. Luo, W. Qin, A. Dong, K. Sedraoui, and M. Zhou, Efficient and high-quality recommendations via momentum-incorporated parallel stochastic gradient descent-based learning, IEEE/CAA Journal of Automatica Sinica, 2021, 8(2): 402-411. [59] X. Luo, Y. Zhou, Z. Liu, L. Hu, and M. Zhou. Generalized Nesterov's acceleration-incorporated, non-negative and adaptive latent factor analysis, IEEE Transactions on Services Computing, 2022, 15(5): 2809-2823. [60] X. Luo, M. Zhou, Z. Wang, Y. Xia, and Q. Zhu. An effective scheme for QoS estimation via alternating direction method-based matrix factorization, IEEE Transactions on Services Computing, 2019, 12(4): 503-518. [61] S. Li, Y. Zhang and L. Jin, Kinematic control of redundant manipulators using neural networks, IEEE Transactions on Neural Networks and Learning Systems, 2017, 28(10): 2243-2254. [62] J. Fang, Z. Wang, W. Liu, S. Lauria, N. Zeng, C. Prieto, F. Sikstrom, and X. Liu, A new particle swarm optimization algorithm for outlier detection: Industrial data clustering in wire arc additive manufacturing, IEEE Transactions on Automation Science and Engineering, DOI:10.1109/TASE.2022.3230080. [63] N. Zeng, P. Wu, Z. Wang, H. Li, W. Liu, X. Liu, A small-sized object detection oriented multi-scale feature fusion approach with application to defect detection, IEEE Transactions on Instrumentation and Measurement, 2022, 71, 3507014. [64] H. Li, P. Wu, N. Zeng, Y. Liu, Fuad E. Alsaadi, A survey on parameter identification, state estimation and data analytics for lateral flow immunoassay: from systems science perspective, International Journal of Systems Science, DOI:10.1080/00207721.2022.2083262. [65] M. Liu, L. Chen, X. Du, L. Jin and M. Shang, Activated gradients for deep neural networks, IEEE Transactions on Neural Networks and Learning Systems, DOI: 10.1109/TNNLS.2021.3106044. [66] L Jin, L Wei, and S Li, Gradient-based differential neural-solution to time-dependent nonlinear optimization, IEEE Transactions on Automatic Control, 68(1): 620-627. [67] F. Bi, X. Luo, B. Shen, H. Dong, and Z. Wang. Proximal alternating-direction-method-of-multipliers-incorporated nonnegative latent factor analysis. IEEE/CAA Journal of Automatica Sinica, DOI: 10.1109/JAS.2023.123474. [68] F. Bi, T. He, Y. Xie, and X. Luo, Two-stream graph convolutional network-incorporated latent feature analysis, IEEE Transactions on Services Computing, DOI: 10.1109/TSC.2023.3241659. [69] D. Wu, and X. Luo, Robust latent factor analysis for precise representation of high-dimensional and sparse data, IEEE/CAA Journal of Automatica Sinica, 2021, 8(4): 796-805. [70] Z. Li, S. Li, and X. Luo, An overview of calibration technology of industrial robots, IEEE/CAA Journal of Automatica Sinica, 2021, 8(1): 23-36. [71] D. Wu, P. Zhang, Y. He, and X. Luo, A double-space and double-norm ensembled latent factor model for highly accurate web service QoS prediction, IEEE Transactions on Services Computing, DOI: 10.1109/TSC.2022.3178543. [72] Y. Li, P. Luo, P. Pin, Utility-based model for characterizing the evolution of social networks, IEEE Trans. on Systems, Man, and Cybernetics: Systems 50 (3) (2020) 1083-1094. [73] J. Leskovec, R. Sosic, SNAP: A general-purpose network analysis and graph-mining library, ACM Trans. on Intel. Syst. and Technology, 8(1) (2016). [74] P. Sen, G. Namata, M. Bilgic, L. Getoor, B. Galligher, T. Eliassi-Rad, Collective classification in network data, AI Magazine, 29(3) (2008) 93-106. 8
http://arxiv.org/abs/2302.12094v1
2023-02-23T15:28:36
2023-02-23T15:28:36
Local and Global Explainability Metrics for Machine Learning Predictions
Rapid advancements in artificial intelligence (AI) technology have brought about a plethora of new challenges in terms of governance and regulation. AI systems are being integrated into various industries and sectors, creating a demand from decision-makers to possess a comprehensive and nuanced understanding of the capabilities and limitations of these systems. One critical aspect of this demand is the ability to explain the results of machine learning models, which is crucial to promoting transparency and trust in AI systems, as well as fundamental in helping machine learning models to be trained ethically. In this paper, we present novel quantitative metrics frameworks for interpreting the predictions of classifier and regressor models. The proposed metrics are model agnostic and are defined in order to be able to quantify: i. the interpretability factors based on global and local feature importance distributions; ii. the variability of feature impact on the model output; and iii. the complexity of feature interactions within model decisions. We employ publicly available datasets to apply our proposed metrics to various machine learning models focused on predicting customers' credit risk (classification task) and real estate price valuation (regression task). The results expose how these metrics can provide a more comprehensive understanding of model predictions and facilitate better communication between decision-makers and stakeholders, thereby increasing the overall transparency and accountability of AI systems.
[ "Cristian Munoz", "Kleyton da Costa", "Bernardo Modenesi", "Adriano Koshiyama" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12094v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12094v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 4 9 0 2 1 . 2 0 3 2 : v i X r a LOCAL AND GLOBAL EXPLAINABILITY METRICS FOR MACHINE LEARNING PREDICTIONS A PREPRINT Cristian Munoz Holistic AI London, UK [email protected] Kleyton da Costa Holistic AI London, UK [email protected] Bernardo Modenesi University of Michigan Ann Arbor, USA [email protected] Adriano Koshiyama Holistic AI London, UK [email protected] February 24, 2023 ABSTRACT Rapid advancements in artificial intelligence (AI) technology have brought about a plethora of new challenges in terms of governance and regulation. AI systems are being integrated into various industries and sectors, creating a demand from decision-makers to possess a comprehensive and nuanced understanding of the capabilities and limitations of these systems. One critical aspect of this demand is the ability to explain the results of machine learning models, which is crucial to promoting transparency and trust in AI systems, as well as fundamental in helping machine learning models to be trained ethically. In this paper, we present novel quantitative metrics frameworks for interpreting the predictions of classifier and regressor models. The proposed metrics are model agnostic and are defined in order to be able to quantify: (i) the interpretability factors based on global and local feature importance distributions; (ii) the variability of feature impact on the model output; and (iii) the complexity of feature interactions within model decisions. We employ publicly available datasets to apply our proposed metrics to various machine learning models focused on predicting customers' credit risk (classification task) and real estate price valuation (regression task). The results expose how these metrics can provide a more comprehensive understanding of model predictions and facilitate better communication between decision-makers and stakeholders, thereby increasing the overall transparency and accountability of AI systems. Keywords Artificial Intelligence * Explainability * Metrics * Risk Management in AI Systems 1 Introduction In recent years, several methods have been proposed in order to bring more clarity to results generated by artificial intelligence (AI) models. The increasing creation of these methods is due to the extensive application of AI in different economic sectors, private and governmental, achieving an unprecedented degree of prediction accuracy, but providing very little understanding regarding how these predictions have been made. The low level of intelligibility of AI models has deemed these models a common nickname: "black boxes". A machine learning (ML) model is a program that maps inputs to outputs, with the goal of predicting outputs by learning prediction patterns from data. A "black box", in the ML context, describes models that cannot be understood by simply analyzing their parameters. In general terms, an explainable or interpretable algorithm is one for which the rules for its prediction decisions can be questioned and explained in a way that is intelligible to humans. In particular, interpretability regards the ability to extract causal knowledge about the world from a model and explainability regards Explainability Metrics A PREPRINT being able to explain precisely how a complex model arrived at certain predictions, i.e. its mechanics. Understanding AI models' behavior is important to explain predictions to support the decision-making process, debug unexpected behavior for models (contributing to improving the model accuracy), refine modeling and data mining processes, verify that model behavior is reasonable and fair, present the model's predictions to stakeholders, etc. In the case of deep learning (DL) models - like artificial neural networks - we can observe high accuracy with a low capacity for explaining the mechanics of either individual or group predictions. This characteristic made the "black-box" ML models a less attractive alternative for policy-makers and market players who need transparency, robustness, and compliance with rules used to support decision-making. Furthermore, ML models are essentially data-driven, and, in this case, the problem of harmful biases in datasets needs to be solved before the models' application. In this research, we aim to contribute to the new and effervescent literature of explainable AI (XAI) methods. We propose and implement a set of new metrics of explainability in AI models context, each exhibiting distinct features, adding to the growing menu of tools for deciphering "black box" models and empowering AI stakeholders. For this, the paper is organized as follows: Section 2 describes the literature and common methodological approach from which we build our methods; Section 3 presents our proposed methods for explainable AI in local and global levels; Section 4 brings a set of applications for our new methods; and, we conclude the paper in Section 5. 2 Literature and Technical Background The literature in explainable methods for AI models is more recent than the AI literature itself, and it has been gaining prominence as AI models proliferate in virtually all areas of society (Elshawi et al. [2019], ElShawi et al. [2020], Buckmann et al. [2022], Thimoteo et al. [2022]). Despite its infancy, the explainable AI (XAI) literature already posses distinct taxonomies to classify its methods. In this section we discuss some of the XAI methods and forms to categorize them based on their proprieties. The discussion is far from being exhaustive, given how effervescent this field is, but the goal of this section is to help the reader understand our proposed XAI metrics and how they related to the rest of literature. 2.1 Taxonomies for XAI methods Explainable AI methods can be categorized with respect to their properties. For instance, these methods can be grouped according to (i) their capacity to elucidate how AI models make predictions locally vs globally; as well as according to (ii) whether they are tailored to work for specific AI models vs they could work in any AI model (i.e. model-agnostic). There is not a single unified way of grouping XAI tools, but these are popular groupings that help elucidate how our tools fit into the literature1. 2.1.1 Local vs Global XAI tools can be categorized as Local or Global, with each of these categories aiming to explain how the AI model makes predictions at different levels. The local set of methods focuses on understanding AI algorithm's behavior at a low hierarchical level. Based often on a single observation (or on small subset of observations), local XAI methods provide metrics relative to how each feature contributes to the final prediction outputted by the AI model. The typical user of local metrics is an individual being targeted by an algorithm – e.g. lending company might need to provide reasons for why certain customer had a mortgage request denied by its AI model (Bracke et al. [2019]). This type of metric is very present in the recent literature of individual and counterfactual fairness, which builds and is built upon local XAI methods (Ge et al. [2022], Albini et al. [2022]). The global set of XAI, on the other hand, focuses on understanding the AI algorithm's behaviour at a high hierarchical level, i.e. aiding its users to measure how features contribute to predictions over the whole dataset (or collection of datasets). Developers of AI algorithms, regulators, AI managers, science discovery, etc. are usually the main users of these tools, since they tend to be more interested in the general insights and knowledge discovery that the AI model produces, rather focusing at specific individual observations. 2.1.2 Model-specific vs Model-agnostic Model-specific XAI methods are often derived straightforwardly from the specific AI model that is fully transparent and explainable by design. That is, an additional explainability technique is not required to be overlaid on the AI model in 1There are other types of groupings, such as whether or not the method uses a model gradient vs a feature perturbation method, but these are beyond the scope of this project. 2 Explainability Metrics A PREPRINT order to be able to fully explain its prediction process. As example, the result of linear models can be straightforwardly obtained and explained based on estimated coefficients. Alternatively, the model-agnostic tools can be applied to the outputs of any AI algorithm, including very complex an opaque models, in order to provide interpretation on decision drivers for those models. According to Molnar [2021], this set of tools is post-hoc, i.e. they are applied after the model has been trained and they do not require access to its estimates or code, rather it only requires the ability to test the model. In this way, model-agnostic XAI methods are flexible to be used by auditors, researchers and other stakeholders, without having to disclose the model itself. 2.2 Relevant approaches in XAI methods 2.2.1 Feature Importance The feature importance is a widely used XAI method and it measures the increase in prediction error after permuting the selected features. Intuitively, if by altering the values of certain feature results in a considerable change in the AI model error, this feature is considered to be important. Alternatively, features are deemed unimportant if the AI model error remains virtually unchanged after altering its values. The Algorithm 1 describes the process to achieve the feature importance of each feature j in a feature matrix X. Algorithm 1: Permutation Feature Importance algorithm [Molnar, 2021], [Fisher et al., 2019] Initialization: Trained model f , feature matrix X, target vector y, error measure L(y, f ); Estimate the original model error (cid:15) = L(y, f (X)); For each feature: j = 0, 1, . . . , F ; 0. generate feature matrix Xpv by permuting values of feature j in the data X; 1. estimate error (cid:15)pv = L(y, f (Xpv)); 2. calculate permutated values feature importance Fj = (cid:15)pv (cid:15) or Fj = (cid:15)pv − (cid:15) ; Sort features by descending Fj ; Permutation feature importance is a powerful tool because its interpretation is intuitive and it can be applied to any model – i.e. it is a easy to understand global XAI method. In addition, it does not require retraining the model, nor knowing its estimates and nor its modus operandi. On the other hand, there is no consensus in the literature about a training or test set should be used in order to compute the features importance. 2.2.2 Partial Dependence curve A machine learning model f is often a function of a multitude of features x, which makes it infeasible to plot the estimated model in a high-dimensional space. Instead, the Partial Dependence curve (PD)2, can be used to assess how the predicted outcome of a model f behaves as a function of values of a particular selected feature xs, after averaging f over the values of all other features xA. Intuitively, the PD can be interpreted as the expected/average model response as a function of the input feature of interest [Pedregosa et al., 2011]. This is helps with model explainability since it makes possible to assess whether the relationship between the outcome and a feature is linear, and/or monotonic, or more complex. For example, if applied to a linear regression, the partial dependence plot always show a linear relationship. According to Molnar [2021], the PD function for a predictive model f can be theoretically defined as, f xs(xs) := ExA [f (xs, xA)] = (cid:90) f (xs, xA)dP(xA) (1) where xA are the remaining features and dP their measure. In practice, after the model f is trained, we have an estimate of the model, denoted by ˆf (xs, xA), and its PD curve with respect to xs can be estimated calculating averages in the training data using Bayesian Monte Carlo methods to obtain: ˆf xs(xs) := 1 N N (cid:88) i=1 ˆf (xs, x(i) A ) (2) The estimation assumes that features in A are not correlated. The violation of this assumption indicates that the averages calculated for the partial dependence may include data points that are implausible. 2The PD is also referred to as Partial Dependence Plot (PDP). 3 Explainability Metrics A PREPRINT 2.2.3 Surrogate model approximation The relationship between features and the outcome of an AI model is often too complex to be easily summarized in "black-box" models. On the other hand, there are models where explainability is straightforward as discussed in 2.1.2, such as a linear regression or a relatively small decision tree. It turns out that one could use the latter simpler models – also referred to as surrogate models – to approximate a complex "black-box" model, often locally (i.e. for a subset of observations), and reap the explainability properties of the approximating model. In other words, for a subset of observations, it is possible that a simple and explainable model can approximate reasonably well complex predictions made by a complex model, and, in turn, offer a straightforward connection between features and output in the prediction process. This surrogate model approximation can be implemented by fitting a simple explainable model to a dataset corresponding to the same features used to train the complex AI model, while using the outcome generated by the AI model, as opposed to using the observed outcome. 3 Proposed XAI methods In the previous section we laid out taxonomies and tools that we use to build our proposed XAI methods from. All of our 6 new metrics are model-agnostic, applicable to all types of AI models and they do not require knowledge of the model code nor estimates, only the ability to run predictions with these already working models. Furthermore, our proposed methods expand upon already existing XAI approaches, namely (i) Feature Importance, (ii) Partial Dependence curve and (iii) Surrogacy Models, as presented below. 3.1 Feature Importance-based metrics Following the notation presented in 2.2.1, consider a set of features importance, F = {F1, F2, . . . , FF }. We start by passing this vector through a normalizing function P (*), which normalizes the feature importance vector by the sum of their absolute values. A normalized value for feature importance j is defined as pj := |Fj | i=1 |Fi| . This implies that the vector of normalized features importance P (F) constitutes a probability measure: (cid:80)F P (F) := {p1, p2, ..., pF }, where pj ≥ 0 and (cid:88) i∈F pi = 1. (3) In order to evaluate the explainability of an AI model, an analysis of the distribution of the normalized feature weights can be conducted through various metrics, as proposed below. 3.1.1 Metric 1 - Global Feature Importance Spread (GFIS) The metric GFIS is based on the concept of entropy. More precisely on the entropy of the normalized features measure, which represents the concentration of information within a set of features. Lower entropy values indicate that the majority of the explanation is concentrated in a small number of features, suggesting that the model could be potentially explained more simply. Conversely, higher entropy values suggest that the importance of the features is more evenly distributed, resulting in a decreased level of explainability. The highest degree of complexity in explainability occurs when all feature weights are equal, is in a uniform distribution, which can serve a benchmark entropy for comparison. The uniform benchmark distribution would be defined as U = { ̄p, ̄p, . . . ̄p}, where ̄p = 1/F . On the assumption that a lower entropy indicates a more explainable model, a feature importance distribution P (F) can be compared to a baseline uniform distribution U to measure its level of explainability. However, simply comparing these two high dimensional objects is often not easy to humans, so we propose a form to summarize the differences into a single number, i.e. the spread of the two distributions can be measured using: (i) the Entropy Ratio; or (ii) the Kullback-Leibler Divergence; or (iii) the Gini coefficient. These metrics allow for a direct comparison between the two distributions, with the goal of determining the degree of explainability with a single measure: Table 1: Submetrics of Metric 1 Submetric Measure Equation Entropy Ratio Kullback-Leibler Divergence (cid:80)F SER(P (F)) = SKL(P (F)) = DKL(P (F)||U ) = (cid:80)F j=1 pj log pj j=1 ̄p log ̄p (cid:80)F j=1 pj log (cid:17) (cid:16) pj ̄p 1.1 1.2 1.3 Gini-Coefficient SG(P (F)) = 4 (cid:80)F (cid:80)F j=1 j(cid:48)=1 |pj −pj(cid:48) | 2F 2((cid:80) pj /F ) Explainability Metrics A PREPRINT The best (most easily explained AI) and worst (most complex AI) possible scores for SER are 0 and 1, respectively. The Kullback-Leibler Divergence SKL is a statistical distance metric that measures the dissimilarity between a given feature importance distribution and a uniform distribution. As a distance metric, the range of SKL is between 0 and ∞, with the lowest value indicating a uniform distribution and the worst possible explainability score. Lastly, the SG coefficient ranges from 0 to 1, being 0 the most complex and 1 the least complex AI model, in contrary to how SER is measured. 3.1.2 Metric 2 - Local Feature Importance Spread Stability (LFISS) Local Feature Importance refers to the assignment of feature normalized importance to different regions of the input data space. For a given dataset D with N samples, it is possible to compute a vector of feature importance for each individual observation d. With observation-individualized measures, we create a feature importance matrix P ∈ RN ×F where each row represents the normalized feature importance for each instance in the data space. Similar to the concept of global feature importance, the distribution associated with an instance d is represented by P d(F) = P[d, :], i.e. the d-th row of our matrix. For the entire dataset D, the matrix P is defined as: P = [P 1(F)T P 2(F)T * * * P N (F)T ]T , where P d(F) = [pd 1 pd 2 * * * pd F ]. In comparison to the previous metric presented in 3.1.1, we now face a collection of vectors, as opposed to only one vector. However, we still aim to collapse all these vectors into a single straightforward and intuitive measure that reflects the complexity regarding how features contribute to the final outcome, relative to a benchmark model in which all features contribute equally – i.e. to a uniform feature importance distribution. In order to accomplish the task in hand, we proceed in three steps. First, we follow the steps taken in 3.1.1 for each vector, i.e. we compute Sd := S(P d) for all instance d ∈ D, employing one of the S(*) functions described in Table 1. We stack these results in a vector S := {S1, S2, . . . , SN }. In the second step, we apply the normalizing function P (*) described in equation 3 in our vector, obtaining P (S). Finally, we apply once more the S(*) to measure the spread in P (S). The resulting LFISS metric would be given by the following: where SLF ISS := S(P (S)), (4) The interpretation of SLF ISS depends on the function S(*) chosen from Table 1. For instance, if the KL measure is used, a lower value of SLF ISS suggests that features explain the output in a stable form: either mostly complex across the dataset observations or mostly simple across the observations. In order to know which is the case i.e. mostly complex vs mostly simple, the GFIS can be used. On the other hand, high values of SLF ISS using the KL measure suggests that few features impact the final output strongly for a small subset of the dataset. This can serve to identify for which observations this is the case. S := {S(P 1), S(P 2), . . . , S(P N )}. 3.1.3 Metric 3 - Predictions Groups Contrast (PGC) The PGC metric compares the top-K ranking of features importance drawn from the entire dataset with the top-K ranking induced from specific subgroups of predictions. It can be applied to both categorical and regression problems, being useful for quantifying how the feature importance priority changes between subgroups. For categorical problems, G subgroups can represent output categories, and, for regression problems, G subgroups can be represented by different portions of the output support (e.g. quartiles). Given the top-k features importance indexed by I, and partial feature importance I g computed using only observations from group g ∈ D, two approaches can be used to analyze these two rankings are similar: IK := argsort(−P (F))[1 : K] and I g K = argsort(−Pg(F))[1 : K] (5) • Position Overlap Score MK(F, g) = 1 K (cid:88) k∈K m(Ik, I g k ), where m(a, b) = (cid:26)1, if a = b, 0, otherwise. • Position Range Overlap Score MK(F, g) = 1 K ||I g K ∩ IK|| Then, the predictions group contrast PGC is defined as: C(F) = 1 GF G (cid:88) F (cid:88) g K=1 MK(F, g) where 0 < C(F) < 1. A higher contrast value suggests that the model follows a very similar behavior for each group. A lower value suggests that the model has a radical change in the behavior of each group. 5 Explainability Metrics A PREPRINT 3.1.4 Metric 4 - α-Feature Importance (αF I ) The α Feature Importance metric quantifies the minimum proportion of features required to represent α of the total importance. In other words, this metric is focused in obtaining the minimum number of features necessary to obtain no less than α × 100% of the total explanation based on the normalized feature importance vector P (P) presented in equation 3. Define p(j) as the j-th largest number of the vector P , i.e. the j-th order statistic. Formally, our proposed metric can be computed as follows, αF I (F) = (cid:110) minJ F − J , subject to (cid:80)J j=F p(j) > α, J ≤ F (cid:111) F (6) where 0 < αF I < 1. If α is a relatively high number, such as 4/5, then a low αF I value indicates that a considerable portion of the model's behavior can be explained with a limited number of representative parameters. Conversely, a higher value indicates that a greater number of features are needed to describe the model's behavior. In our illustrations, we refer to this metric as the F F or 4/5 metric, pinning the value of α. More broadly, an XAI user can calculate the minimal number of features for a given α, namely M ∗(α) := F − J ∗(α), for various values of 0 ≤ α ≤ 1. The resulting increasingly monotonic curve M ∗(α) is also informative. It can be used to identify the most important features to explain outputs up to a certain α degree of explainability. When this curve plateaus, one can identify a set of features that are not so relevant/dispensable to explain the AI model outcomes. 3.2 Partial Dependence curve-based metric 3.2.1 Metric 5 - Partial Dependence Complexity (PDC) The Partial Dependence Complexity metric uses the concept of the Partial Dependence curve presented in 2.2.2 to evaluate how simple this curve can be represented. The partial dependence curve is used to show model predictions are affected on average by each feature. Curves represented by linear functions are easy to grasp and interpret, but some features may have a highly non-linear and complex effects on the model outcomes. Our proposed metric aims to measure how much the curve changes across the variable domain. In order to calculate the PDC metric, we suggest the following steps. First, we compute the numerical 2nd derivative of the PD presented in 2. We denote the numerical 2nd derivative by ˆf x(cid:48)(cid:48) s (*), which mathematically represents how fast the 1st derivative of the function changes. If the function is a simple line, the 2nd derivative is equal to zero. On the other hand, if the function is highly non-linear, the 1st derivative changes often, i.e. the 2nd derivative departs often from zero in magnitude. Given this intuition, our proposed metric consist the normalized norm of the vector containing the absolute value of the numerical 2nd derivative of the PD curve, denoted by (cid:126)vxs , computed over q points of the xs domain: P DCxs := (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:126)vxs ||(cid:126)vxs|| (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) , where (cid:126)vxs := (cid:110) | ˆf x(cid:48)(cid:48) s (xs1)|, | ˆf x(cid:48)(cid:48) (cid:111) s (xs2)|, . . . , | ˆf xs(cid:48)(cid:48) (xsq)| . (7) The closer P DCxs is to zero, the more linear the outcome depends on feature xs. On the other hand, the closer to one, less linear is the dependence of model outcomes to the feature xs. It is also possible to compute the size of the vector (cid:126)vxs without normalization and compare these values between different model architectures, or between features. 3.3 Surrogacy model-based metric 3.3.1 Metric 6 - Surrogacy Efficacy Score (SESc) The Surrogacy Efficacy Score is a technique for gaining a better understanding of the inner workings of complex "black box" models, as discussed in 2.2.3. For example, by using a Tree-based model, this method provides a more interpretable representation of the model's behavior by partitioning the input data based on the values of certain fields and creating simple rules to approximate the model's predictions. The Decision Tree model is trained to closely mimic the original model by minimizing the loss between the model's predictions and surrogate model predictions. Given a model f , a surrogate model DT , the input data x, the true output data y, the model f and the surrogate loss function are defined as: Lossf = L(y, y(cid:48)), where LossDT = L(y(cid:48), y(cid:48)(cid:48)), where After estimated our approximation surrogate model, we define our last metric as the following scores: y(cid:48) = f(x) y(cid:48)(cid:48) = DT(x) 6 Explainability Metrics A PREPRINT Problem Type Classification Regression Equation E = Accuracy(y(cid:48), y(cid:48)(cid:48)) E = RMSE_score(y(cid:48), y(cid:48)(cid:48)) An added benefit of the Surrogacy Efficacy Score is the ability to derive a list of global feature importances. These importances can then be utilized to compute the metrics described in section 3.1, providing valuable insights into the relative importance of different features in the model's predictions. 3.4 Summary of Proposed Metrics Table 2: List of proposed metrics and their abbreviations to be used in the results section Metric Fourth Fifts Feature Importance Spread - Divergence Feature Importance Spread - Ratio Feature Importance Contrast - Overlap Feature Importance Contrast - Range Overlap Partial Dependence Interpretability Level Feature Importance Spread Stability - Dataset Feature Importance Spread Stability - Features Surrogacy Efficacy Score Abbrev. PFI[80/100] PFID PFIR PFICO PFICRO PDEL FISSD FISSF SFI FI Type Global Global Global Global Global Global Local Local - Symbol FF SD SR CO CRO L TD TF E Output Domain [0,1] [0,∞) [0,1] [0,1] [0,1] [0,1] [0,∞) [0,∞) RMSE or Accuracy domain Reference 0 ∞ 0 1 1 1 0 0 - The metrics presented in the previous section measure different aspects of explainability. This subsection aims to guide users with basic interpretations that can be obtained from these metrics: • The Feature Importance Spread measures the concentration of feature importance. High concentrations facilitate the interpretability of a group of predictions as it requires prioritizing fewer features. • The Feature Importance Contrast quantifies the disparity between features used to explain a group of predictions compared to the overall average attributed to the whole model. If a group has a high disparity, it is important to analyze. • The Partial Dependence Interpretability Level quantifies the average complexity of curves that describe the dependence between the prediction and the input feature. A high level indicates high complexity in the dependence of the variables. • The Feature Importance Stability measures the variation of importance in the feature space. High stability indicates that the importance is similar throughout the input domain. Low stability indicates high contrast in importance, and global indicators may not be the best scores. • The Surrogacy Efficacy Score quantifies the veracity of a hypothesis: the prediction of the model can be explained by simple rules. 4 Experiments In this section, we evaluate the benefits of using global and local feature importance metrics proposed in this paper. We employ publicly available datasets to apply our proposed metrics to various machine learning models focused on predicting customers' credit risk (classification task) and real estate price valuation (regression task). For classification tasks, we consider the models logistic regression (LR), decision tree (DT), K-neighbors classifier (KNC), support vector classifier (SVC), AdaBoost, and multilayer perception (MLP). And for regression tasks, we consider linear regression (Linear), decision tree (DT), K-neighbors regressor (KNR), AdaBoost, and multilayer perceptron (MLP). 4.1 Classification Tasks The German credit dataset is a collection of 1000 records that contain information on 67 different variables related to a customer. These variables provide insights into various aspects of the customer such as their financial status, age, gender, credit history, and other relevant information. The purpose of this dataset is to be used as a training resource for machine learning models. The target feature - credit default - represents the outcome the model is trying to predict. 7 Explainability Metrics A PREPRINT By analyzing the relationships between the 67 features and the credit default, the model can learn patterns and make informed predictions on future cases. Table 3: Reference table for the domain, premise, and interpretation based on metrics results FI Type PFI Metric Name Domain PIF[80|100] FISR PFI Top-K FISR SFI LFI FICRO[C0] FICRO[C1] PDEL Accuracy FISSDR FISSDM FISSFR LFI Top-K FISSDR FISSDM FISSFR 0-100 0-100 0-100 0-100 0-100 0-100 0-100 0-100 0-INF 0-100 0-100 0-INF 0-100 Premise Output prediction represented by Features importance are Features importance are Features used to explain Group predictions Features used to explain Group predictions Interpret Partial Dependence Variables Represent ouptput prediction by simples rules is Feature Importance spread in the data space Average Feature Importance is Feature Importance in the data space Feature Importance spread in the data space Average Feature Importance is Feature Importance in the data space Lower Higher Few Features Many Features Concentrated Concentrated Different Different Dificult Dificult Stable Spread Stable Stable Spread Stable Spread Spread Same Same Easy Easy Unstable Concentrated Unstable Unstable Concentrated Unstable Table 3 provides a summary of the interpretation of each metric. The third column displays the domain of the variable, meaning the range of values that each metric can take. All metrics except for FISSDM (which can take values from zero to infinity) have a range of values from 0% to 100%. The following columns outline the premise for each metric and the interpretation that should be made based on the results (whether they are lower or higher). Table 4: Explainability Metrics for models trained with German Credit Dataset FI Type PFI Metric Name PIF[80|100] FISR PFI Top-K FISR SFI LFI FICRO[C0] FICRO[C1] PDEL Accuracy DFISR FISSDM FISSDR LFI Top-K DFISR FISSDM FISSDR LR 27% 82% 96% 74% 81% 0% 100% 72% 80% 100% 100% 100% 100% 0.38 0.37 0.36 0.41 98% 94% 97% 97% 99% 100% 100% 99% 0.32 0.30 0.29 0.29 99% 99% 99% 96% KNC SVC AdaBoost MLP DT 3% 26% 2% 24% 71% 32% 23% 75% 79% 98% - 88% 100% 91% 100% 75% 100% 93% 100% 100% 100% 100% 0% 99% 79% 72% 99% 0.48 94% 99% 0.42 94% 29% 78% 93% 86% 77% 0% 78% 100% 0.39 96% 100% 0.33 98% Table 4 shows that LR and AdaBoost have a very similar PFI value, however, the FISR metric indicates that LR spread more importance between features than others. Even for class C0 feature importance spread more than C1 – Appendix X). The interpretability of LR output prediction is more complicated because more variables needed to be disentangled to explain the prediction. In contrast, KNC and SVC have the highest concentration (low FISR value) and few features will be needed to explain the prediction. If we check the metric over the top-80 features can be found that LR, SVC, and AdaBoost spread the importance among the top group. MLP and DT concentrate even more on the importance. FICO and FICRO metrics quantify the features importance positions shared between group predictions. For instance, KNC and MLP have the same feature importance for classes C0 and C1. So, they use the same features priority to explain their output prediction. Big gaps between the FICRO class metric indicate more dissimilarities in their features priorities, for example, SVC has FICRO gap between C0 (75%) and C1 (100%). SFI accuracy shows that MLP output prediction is simple to explain with simple's rules and DT and SVC have a more complicated behavior (not explainable with simple rules). It is important to understand that we are not talking about the efficacy of the model output. The surrogate model is trying to fit the model prediction behavior with a DT with 3 levels. FISSDR indicate the stability 8 Explainability Metrics A PREPRINT level of the feature importance group. All the models have a good stability. Only the MLP model has a little change in their space. The average feature importance is a little unstable in all the models. LR and MLP show the highest importance spread. FISSDR shows that the feature importance value of LR and MLP are more unstable than other models and for MLP it continues happened in the Top-K model, which is a more critical dependency. DT, KNC and SVC show a heigh stability in the Top-k features importance. 4.2 Regression Tasks The Real Estate dataset is a collection of 414 records that provide information on 6 different features related to the pricing of houses. These features include various aspects of a house such as its location, age, and other relevant information that can impact its value. The dataset is used to build ML regression models that aim to estimate the price of a house per unit area. Table 5: Explainability Metrics for models trained with Real Estate Dataset FI Type PFI Metric Name PIF[80|100] FISR PFI Top-K FISR FICS[CQ0-Q1] FICS[CQ1-Q2] FICS[CQ2-Q3] FICS[CQ3-Q4] PDEL RMSE DFISR DFISM AFISR LFI Top-K DFISR DFISM AFISR SFI LFI DT Linear 43% 14% 86% 37% 100% - 11% 100% 0% 50% 100% 100% 50% 100% 100% 67% 100% 100% 100% 100% 100% 6,59 9,65 3,51 15% 7% 18% 0.26 0.27 0.48 98% 96% 92% 94% 93% 95% 0.23 0.20 0.36 97% 98% 93% KNR AdaBoost MLP 0% 29% 14% 14% 70% 36% 100% 100% - 100% 25% 79% 50% 79% 100% 86% 75% 100% - 1,23 4,17 16% 6% 0.42 0.28 92% 89% 95% 93% 0.32 0.14 90% 97% We can see different degrees of important spread (FISR), DT and AdaBoost have the higher spread and MLP and KNR have the higher feature importance concentration. DT, Adaboost and MLP have more complicated output prediction interpretability because their group predictions have different feature priorities. The feature priorities for Linear and KNR are more stable. For Linear model, only the first group selected different features priorities. Partial dependency curves look easy to explain (PDEL). Surrogate model could match easily MLP output prediction and Linear model output prediction. The DFISR are very unstable in the data space so would be recommended use local analysis approaches to explain the model. For the Top-K output prediction a more stable behavior in the feature importance spread (DFISR) and average feature importance (AFISR). 5 Conclusion The necessity of transparency in AI systems and the trade-off between accuracy and explainability in AI models increase the recent discussion about the interpretation of predictions generate with machine learning models. In this paper, we describe some models present in the literature and propose a new set of metrics concerning global and local feature importance. The interpretation structure based on premises improves the interpretation of results because in certain cases, viewing a single number (a metric) is more accurate than making a decision based on a set of graphical observations. We observe that most strategies focused on explainability leave room for ambiguity in terms of rating or quantifying the model's understanding and comparability. Furthermore, many strategies are only applicable to a specific architecture. A quantification of interpretability enables a practical understanding of what is happening inside complex AI models. To mitigate this gap, we propose six new explainability metrics based on three strategies - feature importance, partial dependence, and surrogacy. The results found show that the use of explainability metrics in AI systems can improve and empower AI models stakeholders. 9 Explainability Metrics A PREPRINT We create a reference table to interpret quickly the most important explainability metrics. Between our proposed metrics, feature concentration, features priority shared between predictions groups, complexity represented by simple rules, and local feature importance stability revealed to be the most important in understanding our models. As for future research, we plan on exploring the statistical properties of the metrics proposed, potentially creating inference tools for model selection and model auditing based on these tools. References Radwa Elshawi, Mouaz H. Al-Mallah, and Sherif Sakr. On the interpretability of machine learning-based model for predicting hypertension. BMC Medical Informatics and Decision Making, 19(1):146, Jul 2019. ISSN 1472-6947. doi:10.1186/s12911-019-0874-0. URL https://doi.org/10.1186/s12911-019-0874-0. Radwa ElShawi, Youssef Sherif, Mouaz Al-Mallah, and Sherif Sakr. Interpretability in healthcare: A compar- ative study of local machine learning interpretability techniques. Computational Intelligence, n/a(n/a), 2020. doi:https://doi.org/10.1111/coin.12410. URL https://onlinelibrary.wiley.com/doi/abs/10.1111/coin. 12410. 2022. England, Andreas an Marcus Buckmann, Joseph, application URL and Helena Robertson. economic interpretable machine report, Bank learning workflow with of https://www.bankofengland.co.uk/working-paper/2022/ an-interpretable-machine-learning-workflow-with-an-application-to-economic-forecasting. Lucas M Thimoteo, Marley M Vellasco, Jorge Amaral, Karla Figueiredo, Cátia Lie Yokoyama, and Erito Marques. Explainable artificial intelligence for covid-19 diagnosis through blood test variables. Journal of Control, Automa- tion and Electrical Systems, 33(2):625–644, 2022. URL https://link.springer.com/article/10.1007/ s40313-021-00858-y. forecasting. Technical An to Philippe Bracke, Anupam Datta, Carsten Jung, and Shayak Sen. Machine learning explainability in finance: an application to default risk analysis. 2019. URL https://papers.ssrn.com/sol3/papers.cfm?abstract_id= 3435104. Yingqiang Ge, Juntao Tan, Yan Zhu, Yinglong Xia, Jiebo Luo, Shuchang Liu, Zuohui Fu, Shijie Geng, Zelong Li, and Yongfeng Zhang. Explainable fairness in recommendation. In Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, SIGIR '22, page 681–691, New York, NY, USA, 2022. Association for Computing Machinery. ISBN 9781450387323. doi:10.1145/3477495.3531973. URL https://doi.org/10.1145/3477495.3531973. Emanuele Albini, Jason Long, Danial Dervovic, and Daniele Magazzeni. Counterfactual shapley additive explanations. In 2022 ACM Conference on Fairness, Accountability, and Transparency, FAccT 2022, page 1054–1070, New York, NY, USA, 2022. Association for Computing Machinery. ISBN 9781450393522. doi:10.1145/3531146.3533168. URL https://doi.org/10.1145/3531146.3533168. Interpretable Machine Learning. URL https://christophm.github.io/ Christoph Molnar. 2021. interpretable-ml-book/. Aaron Fisher, Cynthia Rudin, and Francesca Dominici. All models are wrong, but many are useful: Learning a variable's importance by studying an entire class of prediction models simultaneously, 2019. F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. 10
http://arxiv.org/abs/2302.12091v2
2023-06-19T12:49:34
2023-02-23T15:26:08
Random Teachers are Good Teachers
In this work, we investigate the implicit regularization induced by teacher-student learning dynamics in self-distillation. To isolate its effect, we describe a simple experiment where we consider teachers at random initialization instead of trained teachers. Surprisingly, when distilling a student into such a random teacher, we observe that the resulting model and its representations already possess very interesting characteristics; (1) we observe a strong improvement of the distilled student over its teacher in terms of probing accuracy. (2) The learned representations are data-dependent and transferable between different tasks but deteriorate strongly if trained on random inputs. (3) The student checkpoint contains sparse subnetworks, so-called lottery tickets, and lies on the border of linear basins in the supervised loss landscape. These observations have interesting consequences for several important areas in machine learning: (1) Self-distillation can work solely based on the implicit regularization present in the gradient dynamics without relying on any dark knowledge, (2) self-supervised learning can learn features even in the absence of data augmentation and (3) training dynamics during the early phase of supervised training do not necessarily require label information. Finally, we shed light on an intriguing local property of the loss landscape: the process of feature learning is strongly amplified if the student is initialized closely to the teacher. These results raise interesting questions about the nature of the landscape that have remained unexplored so far. Code is available at https://github.com/safelix/dinopl.
[ "Felix Sarnthein", "Gregor Bachmann", "Sotiris Anagnostidis", "Thomas Hofmann" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12091v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12091v2", "@rel": "related", "@type": "application/pdf" } ]
[ "Proceedings of the 40th International Conference on Machine\n Learning, PMLR, volume 202 (2023), pages 30022-30041" ]
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG" ]
Random Teachers are Good Teachers Felix Sarnthein 1 Gregor Bachmann 1 Sotiris Anagnostidis 1 Thomas Hofmann 1 Abstract 1. Introduction 3 2 0 2 n u J 9 1 ] G L . s c [ 2 v 1 9 0 2 1 . 2 0 3 2 : v i X r a In this work, we investigate the implicit regular- ization induced by teacher-student learning dy- namics in self-distillation. To isolate its effect, we describe a simple experiment where we con- sider teachers at random initialization instead of trained teachers. Surprisingly, when distilling a student into such a random teacher, we observe that the resulting model and its representations already possess very interesting characteristics; (1) we observe a strong improvement of the dis- tilled student over its teacher in terms of prob- ing accuracy. (2) The learned representations are data-dependent and transferable between different tasks but deteriorate strongly if trained on random inputs. (3) The student checkpoint contains sparse subnetworks, so-called lottery tickets, and lies on the border of linear basins in the supervised loss landscape. These observations have interest- ing consequences for several important areas in machine learning: (1) Self-distillation can work solely based on the implicit regularization present in the gradient dynamics without relying on any dark knowledge, (2) self-supervised learning can learn features even in the absence of data augmen- tation, and (3) training dynamics during the early phase of supervised training do not necessarily require label information. Finally, we shed light on an intriguing local property of the loss land- scape: the process of feature learning is strongly amplified if the student is initialized closely to the teacher. These results raise interesting ques- tions about the nature of the landscape that have remained unexplored so far. Code is available at www.github.com/safelix/dinopl. 1Department of Computer Science, ETH Z ̈urich, Switzerland. Correspondence to: Felix Sarnthein <[email protected]>. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 The teacher-student setting is a key ingredient in several areas of machine learning. Knowledge distillation is a com- mon strategy to achieve strong model compression by train- ing a smaller student on the outputs of a larger teacher model, leading to better performance compared to training the small model on the original data only (Bucilˇa et al., 2006; Ba & Caruana, 2013; Hinton et al., 2015; Polino et al., 2018; Beyer et al., 2022). In the special case of self-distillation, where the two architectures match, it is often observed in practice that the student manages to outperform its teacher (Yim et al., 2017; Furlanello et al., 2018; Yang et al., 2018). The predominant hypothesis in the literature attests this sur- prising gain in performance to the so-called dark knowledge of the teacher, i.e., its logits encode additional information about the data distribution (Hinton et al., 2015; Wang et al., 2021; Xu et al., 2018). Another area relying on a teacher-student setup is self- supervised learning where the goal is to learn informative representations in the absence of targets (Caron et al., 2021; Grill et al., 2020; Chen & He, 2021; Zbontar et al., 2021; Assran et al., 2022). Here, the two models typically receive two different augmentations of a sample, and the student is forced to mimic the teacher's behavior. Such a learning strategy encourages representations that remain invariant to the employed augmentation pipeline, which in turn leads to better downstream performance. Despite its importance as a building block, the teacher- student setting itself remains very difficult to analyze as its contribution is often overshadowed by stronger compo- nents in the pipeline, such as dark knowledge in the trained teacher or the inductive bias of data augmentation. In this work, we take a step towards simplifying and isolating the key components in the setup by devising a very simple ex- periment; instead of working with a trained teacher, we consider teachers at random initialization, stripping them from any data dependence and thus removing any dark knowledge. We also remove augmentations, making the setting completely symmetric between student and teacher and further reducing inductive bias. Counter-intuitively, we observe that even in this setting, the student still manages to learn from its teacher and even exceed it significantly in terms of representational quality, measured through linearly probing the features (see Fig. 1). This result shows the fol- Random Teachers are Good Teachers establish risk bounds. Allen-Zhu & Li (2020) on the other hand, study more realistic width networks and show that if the data satisfies a certain multi-view property, ensembling and distilling is provably beneficial. Yuan et al. (2020) study a similar setup as our work by considering teachers that are not perfectly pre-trained but of weaker (but still far from random) nature. They show that the dark knowledge is more of a regularization effect and that a similar boost in perfor- mance can be achieved by label smoothing. Stanton et al. (2021) further question the relevance of dark knowledge by showing that students outperform their teacher without fitting the dark knowledge. We would like to point out how- ever that we study completely random teachers and our loss function does not provide the hard labels for supervisory signal, making our task completely independent of the tar- gets. Self-supervised learning can be broadly split into two cate- gories, contrastive and non-contrastive methods. Contrastive methods rely on the notion of negative examples, where fea- tures are actively encouraged to be dissimilar if they stem from different examples (Chen et al., 2020; Schroff et al., 2015; van den Oord et al., 2018). Non-contrastive meth- ods follow our setting more closely as only the notion of positive examples is employed (Caron et al., 2021; Grill et al., 2020; Chen & He, 2021). While these methods enjoy great empirical successes, a theoretical understanding is still largely missing. Tian et al. (2021) investigate the collapse phenomenon in non-contrastive learning and show in a sim- plified setting how the stop gradient operation can prevent it. Wang et al. (2022) extend this work and prove in the linear setting how a data-dependent projection matrix is learned. Zhang et al. (2022) explore a similar approach and prove that SimSiam (Chen & He, 2021) avoids collapse through the notion of extra-gradients. Anagnostidis et al. (2022) show that strong representation learning occurs with heavy data augmentations even if random labels are used. Despite this progress on the optimization side, a good understanding of feature learning has largely remained elusive. The high-dimensional loss landscapes of neural networks re- main very mysterious, and their properties play a crucial role in our work. Safran & Shamir (2017) prove that spurious local minima exist in the teacher-student loss of two-layer ReLU networks. Garipov et al. (2018); Draxler et al. (2018) show that two SGD solutions are always connected through a non-linear valley of low loss. Frankle & Carbin (2018); Frankle et al. (2019; 2020) investigate the capacity of over- parameterized networks through pruning of weights. They find that sparse sub-networks develop already very early in neural network training. Zaidi et al. (2022); Benzing et al. (2022) investigate random initializations in supervised loss landscapes. Still, the field lacks a convincing explanation as to how simple first-order gradient-based methods such as SGD manage to navigate the landscape so efficiently. Figure 1. Linear probing accuracies of representations generated by teachers, students, and the flattened input images on CIFAR10 as a function of training time. Left: ResNet18. Right: VGG11 without batch normalization. lowing: (1) Even in the absence of dark knowledge, relevant feature learning can happen for the student in the setting of self-distillation. (2) Data augmentation is the main but not only ingredient in non-contrastive self-supervised learning that leads to representation learning. Surprisingly, we find that initializing the student close to the teacher further amplifies the implicit regularization present in the dynamics. This is in line with common practices in non-contrastive learning, where teacher and student are usu- ally initialized closely together and only separated through small asymmetries in architecture and training protocol (Grill et al., 2020; Caron et al., 2021). We study this locality effect of the landscape and connect it with the asymmetric valley phenomenon observed in He et al. (2019). The improvement in probing accuracy suggests that some information about the data is incorporated into the network's weights. To understand how this information is retained, we compare the behavior of supervised optimization to fine- tuning student networks. We find that some of the learning dynamics observable during the early phase of supervised training also occur during random teacher distillation. In particular, the student already contains sparse subnetworks and reaches the border of linear basins in the supervised loss landscape. This contrasts (Frankle et al., 2020) where train- ing on a concrete learning task for a few epochs is essential. Ultimately, these results suggest that label-independent opti- mization dynamics exist and allow exploring the supervised loss landscape to a certain degree. 2. Related Work Several works in the literature aim to analyze self-distillation and its impact on the student. Phuong & Lampert (2019) prove a generalization bound that establishes fast decay of the risk in the case of linear models. Mobahi et al. (2020) demonstrate an increasing regularization effect through re- peated distillation for kernel regression. Ji & Zhu (2020) consider a similar approach and rely on the fact that very wide networks behave very similarly to the neural tangent kernel (Jacot et al., 2018) and leverage this connection to 2 0255075100125150epoch0.10.20.30.40.5probingaccuracy0255075100125150epochteacherstudentinput Random Teachers are Good Teachers 3. Setting Notation. Let us set up some notation first. We consider a family of parametrized functions F = {fθ : Rd −→ Rm(cid:12) (cid:12)θ ∈ Θ} where θ denotes the (vectorized) parameters of a given model and Θ refers to the underlying parameter space. In this work, we study the teacher-student setting, i.e., we consider two models fθT and fθS from the same function space F. We will refer to fθT as the teacher model and to fθS as the student model. Notice that here we assume that both teacher and student have the same architecture unless otherwise stated. Moreover, assume that we have access to n ∈ N input-output pairs (x1, y1), . . . , (xn, yn) i.i.d.∼ D distributed according to some probability measure D, where xi ∈ Rd and yi ∈ {0, . . . , K − 1} encodes the class membership for one of the K ∈ N classes. Supervised. The standard learning paradigm in machine learning is supervised learning, where a model fθ ∈ F is chosen based on empirical risk minimization, i.e., given a loss function l, we train a model to minimize L(θ) := n (cid:88) i=1 l(fθ(xi), yi). Minimization of the objective is usually achieved by virtue of standard first-order gradient-based methods such as SGD or ADAM (Kingma & Ba, 2014), where parameters θ ∼ INIT are randomly initialized and then subsequently updated based on gradient information. Teacher-Student Loss. A similar but distinct way to per- form learning is the teacher-student setting. Here we first fix a teacher model fθT where θT is usually a parameter con- figuration arising from training in a supervised fashion on the same task. The task of the student fθS is then to mimic the teacher's behavior on the training set by minimizing a distance function d between the two predictions, L(θS) := n (cid:88) i=1 d (fθS (xi), fθT (xi)) . (1) We have summarized the setting schematically in Fig. 2. We experiment with several choices for the distance function but largely focus on the KL divergence. We remark that the standard definition of distillation (Hinton et al., 2015) consider a combination of losses of the form L(θS) := n (cid:88) i=1 d (fθS (xi), fθT (xi))+β n (cid:88) i=1 l(fθS (xi), yi), for β > 0, thus the objective is also informed by the true labels y. Here we set β = 0 to precisely test how much per- formance is solely due to the implicit regularization present in the learning dynamics and the inductive bias of the model. Figure 2. Schematic drawing of the teacher-student setup. The model consists of an encoder and projector. The same image is passed to both student and teacher, and the outputs of the projectors are compared. The student weights are then adjusted to mimic the output of the teacher. In this work, we consider a simplified setting without augmentations and without teacher updates such as EMA. Somewhat counter-intuitively, it has been observed in many empirical works that the resulting student often outperforms its teacher. It has been hypothesized in many prior works that the teacher logits fθT (x) encode some additional, rel- evant information for the task that benefits learning (dark knowledge), i.e., wrong but similar classes might have a non-zero probability under the teacher model (Hinton et al., 2015; Wang et al., 2021; Xu et al., 2018). In the following, we will explore this hypothesis by systematically destroying the label information in the teacher. Non-Contrastive. Self-supervised learning is a recently developed methodology enabling the pretraining of vision models on large-scale unlabelled image corpora, akin to the autoregressive loss in natural language processing (Devlin et al., 2019). A subset of these approaches is formed by non- contrastive methods. Consider a set of image augmentations G where any G ∈ G is a composition of standard augmen- tation techniques such as random crop, random flip, color jittering, etc. The goal of non-contrastive learning is to learn a parameter configuration that is invariant to the employed data augmentations while avoiding simply collapsing to a constant function. Most non-contrastive objectives can be summarized to be of the form L(θS) := n (cid:88) i=1 EG1,G2 [d (fθS (G1(xi)), fθT (G2(xi)))] , where the expectation is taken uniformly over the set of augmentations G. We summarize this pipeline schematically 3 Random Teachers are Good Teachers in Fig. 2. While the teacher does not directly receive any gradient information, the parameters θT are often updated based on an exponentially weighted moving average, θT ←− (1 − γ)θT + γθS which is applied periodically at a fixed frequency. In this work, we will consider a simplified setting without aug- mentations and where the teacher remains frozen at random initialization, γ = 0. Probing. Since minimizing the teacher-student loss is a form of unsupervised learning if the teacher itself has not seen any labels, we need a way to measure the quality of the resulting features. Here we rely on the idea of probing repre- sentations, a very common technique from self-supervised learning (Chen & He, 2021; Chen et al., 2020; Caron et al., 2021; Bardes et al., 2021; Grill et al., 2020). As illustrated in Fig. 2, the network is essentially split into an encoder gψ : Rd −→ Rr and a projector hφ : Rr −→ Rm where it holds that fθ = hφ ◦gψ. The encoder is usually given by the backbone of a large vision model such as ResNet (He et al., 2016) or VGG (Simonyan & Zisserman, 2014), while the projector is parametrized by a shallow MLP. We then probe the representations gψ by learning a linear layer on top, where we now leverage the label information y1, . . . , yn. Notice that the weights of the encoder remain frozen while learning the linear layer. The idea is that a linear model does not add more feature learning capacity, and the resulting probing accuracy hence provides an adequate measure of the quality of the representations. Unless otherwise stated, we perform probing on the CIFAR10 dataset (Krizhevsky & Hinton, 2009) and aggregate mean and standard deviation over three runs. 4. Random Teacher Distillation Distillation. Let us denote by θ ∼ INIT a randomly initial- ized parameter configuration, according to some standard initialization scheme INIT. Throughout this text, we rely on Kaiming initialization (He et al., 2015). In standard self- distillation, the teacher is a parameter configuration θ(l) T resulting from training in a supervised fashion for l ∈ N epochs on the task {(xi, yi)}n i=1. θ(l) T In a next step, the teacher is then distilled into a student, i.e., the student is trained to match the outputs of the pre-trained teacher f . In this work, we change the nature of the teacher and instead consider a teacher at random initializa- tion θT ∼ INIT (we drop the superscript 0 for convenience). The teacher has thus not seen any data at all and is hence of a similar (bad) quality as the student. This experiment, therefore, serves as the ideal test bed to measure the implicit regularization present in the optimization itself without rely- ing on any dark knowledge about the target distribution. Due to the absence of targets, the setup also closely resembles the learning setting of non-contrastive methods. Through that lens, our experiment can also be interpreted as a non- contrastive pipeline without augmentations and exponential moving average. We minimize the objective (1) with the ADAM optimizer (Kingma & Ba, 2014) using a learning rate η = 0.001. We analyze two encoder types based on the popular ResNet18 and VGG11 architectures, and similarly to Caron et al. (2021), we use a 2-hidden layer MLP with an L2 bottle- neck, as a projector. To assess whether batch-dependent statistics play a role, we remove the batch normalization lay- ers (Ioffe & Szegedy, 2015) from the VGG11 architecture. For more details on the architecture and hyperparameters, we refer to App. E. DATASET MODEL TEACHER STUDENT INPUT CIFAR10 CIFAR100 STL10 TinyImageNet ResNet18 VGG11 ResNet18 VGG11 ResNet18 VGG11 ResNet18 VGG11 35.50 36.55 11.58 12.05 24.24 24.67 4.85 5.25 46.02 51.98 21.50 26.62 40.58 46.20 10.40 12.88 39.02 14.07 31.51 3.28 Table 1. Linear probing accuracies (in percentage) of the represen- tations for various datasets for teacher, student and flattened input images. Students outperform the baselines in all cases. We display the linear probing accuracy of both student and teacher as a function of training time in Fig. 1. We follow the protocol of non-contrastive learning and initialize the student closely to the teacher. We will expand more on this choice of initialization in the next paragraph. Note that while the teacher remains fixed throughout training, accuracies can vary due to stochastic optimization of linear probing. The dashed line represents the linear probing accuracy obtained directly from the (flattened) inputs. We clearly see that the student significantly outperforms its teacher throughout the training. Moreover, it also improves over probing on the raw inputs, demonstrating that not simply less signal is lost due to random initialization but rather that meaningful learning is performed. We expand our experimental setup to more datasets, including CIFAR100 (Krizhevsky & Hinton, 2009), STL10 (Coates et al., 2011) and TinyImageNet (Le & Yang, 2015). We summarize the results in Table 1. We observe that across all tasks, distilling a random teacher into its student proves beneficial in terms of probing accuracy. For further ablations on the projection head, we refer to the App. B. Moreover, we find similar results for more architectures and k-NN instead of linear probing in App. C. 4 Random Teachers are Good Teachers Figure 3. Linear probing accuracies as a function of the locality parameter α on CIFAR10. The color gradient (bright → dark) reflects the value of α (0 → 1) for ResNet18 in green and VGG11 in red tones. Left: ResNet18. Middle: VGG11. Right: Summary. Figure 4. Linear probing accuracies of a VGG11 trained on CI- FAR5M or Gaussian noise inputs and evaluated on CIFAR10 as a function of sample size n. Representations are data dependent. Local Initialization. It turns out that the initialization of the student and its proximity to the teacher plays a crucial role. To that end, we consider initializations of the form θS(α) = 1 δ (cid:16) (cid:17) (1 − α)θT + α ̃θ , where ̃θ ∼ INIT is a fresh initialization, α ∈ [0, 1] and δ = (cid:112)α2 + (1 − α)2 ensures that the variance remains constant ∀α ∈ [0, 1]. By increasing α from 0 towards 1, we can gradually separate the student initialization from the teacher and ultimately reach the more classical setup of self- distillation where the student is initialized independently from the teacher. Note, that in the non-contrastive learning setting, teacher and student are initialized at the same pa- rameter values (i.e., α = 0), and only minor asymmetries in the architectures lead to different overall functions. We now study how the locality parameter α affects the re- sulting quality of the representations of the student in our setup. In Fig. 3, we display the probing accuracy as a func- tion of the training epoch for different choices of alpha. Furthermore, we summarize the resulting accuracy of the student as a function of the locality parameter α. Surpris- ingly, we observe that random teacher distillation behaves very similarly for all α ∈ [0, 0.6]. Increasing α more slows down the convergence and leads to worse overall probing performance. However, even initializing the student inde- pendently of the teacher (α = 1) results in a considerable improvement over the teacher. In other words, we show that representation learning can occur in self-distillation for any random teacher without dark knowledge. To the best of our knowledge, we are the first to observe such a locality phe- nomenon in the teacher-student landscape. We investigate this phenomenon in more detail in the next section and, for now, if not explicitly stated otherwise, use initializations with small locality parameter α ∼ 10−10. Safran & Shamir (2017) prove that spurious local minima exist in the teacher- student loss of two-layer ReLU networks. We speculate that this might be the reason why initializing students close to the teacher is beneficial, and provide evidence in App. D Data-Dependence. In a next step, we aim to understand better to which degree the learned features are data depen- dent, i.e., tuned to the particular input distribution x ∼ px. While the improvement over the raw input probe already suggests non-trivial learning, we want to characterize the role of the input data more precisely. As a first experiment, we study how the improvement of the student over the teacher evolves as a function of the sample size n involved in the teacher-student training phase. We use the CIFAR5M dataset, where the standard CIFAR10 dataset has been extended to 5 million data points using a generative adversarial network (Nakkiran et al., 2021). We train the student for different sample sizes in the interval [5 × 102, 5 × 106] and probe the learned features on the standard CIFAR10 training and test set. We display the resulting probing accuracy as a function of sample size in Fig. 4 (blue line). Indeed, we observe a steady increase in the performance of the student as the size of the data corpus grows, highlighting that data-dependent feature learning is happening. As further confirmation, we replace the inputs xi ∼ px with pure Gaussian noise, i.e. xi ∼ N (0, σ21), effectively removing any relevant structure in the samples. The lin- ear probing, on the other hand, is again performed on the clean data. This way, we can assess whether the teacher- student training is simply moving the initialization in a fa- vorable way (e.g. potentially uncollapsing it), which would still prove beneficial for meaningful tasks. We display the probing accuracy for these random inputs in Fig. 4 as well (orange line) and observe that such random input training does not lead to an improvement of the student across all dataset sizes. This is another indication that data-dependent feature learning is happening, where in this case, adapting to the noise inputs of course proves detrimental for the clean probing. Transferability. As a final measure for the quality of the learned features, we test how well a set of represen- tations obtained on one task transfers to a related but dif- 5 050100150epoch0.10.20.30.40.5probingaccuracy050100150epoch00.51αVGG11ResNet18teachers103104105106datasetsize0.200.300.400.50probingaccuracyCIFAR5Mrandomdatainput Random Teachers are Good Teachers DATASET MODEL TEACHER STUDENT CIFAR10 CIFAR100 STL10 ResNet18 VGG11 ResNet18 VGG11 ResNet18 VGG11 35.50 36.55 11.58 12.05 24.24 24.67 46.06 52.45 22.60 27.49 41.42 45.86 Table 2. Linear probing accuracies of the representations for vari- ous datasets for teacher and student. Students distilled from ran- dom teachers on TinyImageNet generalize out of distribution. i=1 i=1 ferent task. More precisely, we are given a source task i.i.d.∼ DA and a target task B = A = {(xi, yi)}n i.i.d.∼ DB and assume that both tasks are re- {(xi, yi)} ̃n lated, i.e., some useful features on A also prove to be useful on task B. We first use the source task A to perform random teacher distillation and then use the target task B to train and evaluate the linear probe. Clearly, we should only see an improvement in the probing accuracy over the (random) teacher if the features learned on the source task encode relevant information for the target task as well. We use TinyImageNet as the source task and evaluate on CIFAR10, CIFAR100, and STL10 as target tasks for our experiments. We illustrate the results in Table 2 and observe that transfer learning occurs. This suggests that the features learned by random teacher distillations can encode common properties of natural images which are shared across tasks. 5. Loss and Probing Landscapes Visualization. We now revisit the locality property iden- tified in the previous section, where initializations with α closer to zero outperformed other configurations. To gain further insight into the inner workings of this phenomenon, we visualize the teacher-student loss landscape as well as the resulting probing accuracies as a function of the model pa- rameters. Since the loss function is a very high-dimensional function of the parameters, only slices of it can be visual- ized at once. More precisely, given two directions v1, v2 in parameter space, we form a visualization plane of the form θ(λ1, λ2) = λ1v1 + λ2v2, (λ1, λ2) ∈ [0, 1]2 and then collect loss and probing values at a certain reso- lution. Such visualization strategy is very standard in the literature, see e.g., Li et al. (2018); Garipov et al. (2018); Izmailov et al. (2021). Denote by θ∗ S(α) the student trained until convergence initialized with locality parameter α. We study two choices for the landscape slices. First, we refer to a non-local view as the plane defined by the random teacher θT , the student at a fresh initialization θS(1) and the result- 6 Figure 5. Visualization of the loss and probing landscape. The left column corresponds to the non-local view with α = 1. The right column depicts the shared view, containing both the local (α = 0) and the non-local solution (α = 1). The first row displays the loss landscape and the second one shows the probing landscape. Con- tours lines represent ||θ||2, orthogonal projections are in App. C.3. ing trained student θ∗ S(1), i.e., we set v1 = θS(1) − θT and v2 = θ∗ S(1) − θT . As a second choice, we refer to a shared view as the plane defined by the random teacher θT , the trained student starting from a fresh initialization θ∗ S(1) and the trained student θ∗ S(0) initialized closely to the teacher, i.e., we set v1 = θ∗ S(0) − θT and v2 = θ∗ S(1) − θT . Note that α is not exactly zero but around 10−10. We show the results in Fig. 5, where the left and right columns represent the non-local and the shared view re- spectively, while the first and the second row display loss and probing landscapes respectively. Let us focus on the non-local view first. Clearly, for α = 1 the converged stu- dent θ∗ S(1) ends up in a qualitatively different minimum than the teacher, i.e., the two points are separated by a significant loss barrier. This is expected as the student is initialized far away from the teacher. Further, we see that the probing landscape is largely unaffected by moving from the initialization θS(0) to the solution θ∗ S(0), confirming our empirical observation in Fig. 3 that far way initialized students only improve slightly. The shared view reveals more structure. We see that although it was initialized very closely to the teacher, the student θ∗ S(0) moved consider- ably. While the loss barrier is lower as in the case of θ∗ S(1), it is still very apparent that θ∗ S(0) settled for a different, local minimum that coincides with a region of high probing accuracy. This is surprising as the teacher itself is the global loss minimum. For more visualizations, including the loss landscape for the encoder, we refer to App. C.3. 0.000.250.500.751.00losslandscapeθTθS(1)θ∗S(1)non-localview9090120120150150180210240270300θTθ∗S(0)θ∗S(1)sharedview901001001101101201201301301401400.00.51.00.000.250.500.751.00probinglandscapeθTθS(1)θ∗S(1)90901201201501501802102402703000.00.51.0θTθ∗S(0)θ∗S(1)9010010011011012012013013014014010−710−610−510−410−30.10.20.30.40.5 Random Teachers are Good Teachers Figure 6. Illustration of the lottery ticket hypothesis and iterative magnitude-based pruning. Asymmetric valleys. A striking structure in the loss land- scape of the shared view is the very pronounced asymmetric valley around the teacher θT . While there is a very steep increase in loss towards the left of the view (dark blue), the loss increases only gradually in the opposite direction (light turquoise) and quickly decreases into the local minimum of the converged student θ∗ S(0). Surprisingly, this direction orthogonal to the cliff identifies a region of high accuracy in the probing landscape. A fact remarkably in line with this situation is proven by He et al. (2019). They show that be- ing on the flatter side of an asymmetric valley (i.e., towards θ∗ S(0)) provably leads to better generalization compared to lying in the valley itself (i.e., θT ). Initializing the student closely to the teacher seems to capitalize on that fact and leads to systematically better generalization. Still, it remains unclear why such an asymmetric valley is only encountered close to the teacher and not for initializations with α = 1. We leave a more in-depth analysis of this phenomenon for future work. 6. Connection to Supervised Optimization Lottery Tickets. A way to assess the structure present in neural networks is through sparse network discovery, i.e., the lottery ticket hypothesis. The lottery ticket hypothesis by Frankle & Carbin (2018) posits the following: Any large network possesses a sparse subnetwork that can be trained as fast and which achieves or surpasses the test error of the original network. They prove this using the power of hindsight and discover such sparse networks through the following iterative pruning strategy: 1. Fix an initialization θ(0) ∼ INIT and train a network to convergence in a supervised fashion, leading to θ∗. 2. Prune the parameters based on some criterion, leading to a binary mask m and pruned parameters m ⊙ θ∗. 3. Prune the initialized network m ⊙ θ(0) and re-train it. The above procedure is repeated for a fixed number of 7 Figure 7. Illustration of stability of SGD and linear mode- connectivity. Blue contour lines indicate a basin of low test loss, πi denote different batch orderings for SGD. times r, and in every iteration, a fraction k ∈ [0, 1] of the weights is pruned, leading to an overall pruning rate of pr = (cid:80)r−1 i=0 (1 − k)i × k percentage of weights. We illustrate the algorithm in Fig. 6. The choice of pruning technique is flexible, but in the common variant iterative magnitude pruning (IMP), the globally smallest weights are pruned. The above recipe turns out to work very well for MLPs and smaller convolutional networks, and indeed very sparse solutions can be discovered without any deterioration in terms of training time or test accuracy (Frankle & Carbin, 2018). However, for more realistic architectures such as ResNets, the picture changes and subnetworks can only be identified if the employed learning rate is low enough. Sur- prisingly, Frankle et al. (2019) find that subnetworks in such architectures develop very early in training and thus add the following modification to the above strategy: Instead of rewinding back to the initialization θ(0) and applying the pruning there, another checkpoint θ(l) early in training is used and m ⊙ θ(l) is re-trained instead of m ⊙ θ(0). Frankle et al. (2019) demonstrate that checkpoints as early as 1 epoch can suffice to identify lottery tickets, even at standard learning rates. Interestingly, Frankle et al. (2019) further show that the point in time l where lottery tickets can be found coincides with the time where SGD becomes stable to different batch orderings π, i.e., different runs of SGD with distinct batch orderings but the same initialization θ(l) end up in the same linear basin. This property is also called linear mode connectivity; we provide an illustration in Fig. 7. Notice that in general, linear mode-connectivity does not hold, i.e., two SGD runs from the same initializa- tion end up in two disconnected basins (Frankle et al., 2019; Garipov et al., 2018). IMP from the Student. A natural question that emerges now is whether rewinding to a student checkpoint θ∗ S, ob- tained through random teacher distillation, already devel- oped sparse structures in the form of lottery tickets. We com- Random Teachers are Good Teachers Figure 8. Test accuracy as a function of sparsity for different ini- tialization and rewinding strategies. Fresh initializations θS are not robust to IMP with rewinding to initialization (l = 0), this only emerges with rewinding to l ≥ 1. Student checkpoints θ∗S are always robust to IMP even with rewinding to l = 0. One epoch corresponds to 196 steps. Aggregation is done over 5 checkpoints. pare the robustness of our student checkpoints θ∗ S with ran- dom initialization at different rewinding points θ(l), closely following the setup in Frankle et al. (2019). We display the results in Fig. 8, where we plot test performance on CI- FAR10 as a function of the sparsity level. We use a ResNet18 and iterative magnitude pruning, reducing the network by a fraction of 0.2 every round. We compare against rewinding to supervised checkpoints θ(l) for l ∈ {0, 1, 2, 5} where l is measured in number of epochs. We observe that rewinding to random initialization (l = 0), as shown in Frankle & Carbin (2018); Frankle et al. (2019), incurs strong losses in terms of test accuracy at all pruning levels and thus θS does not constitute a lottery ticket. The distilled student θ∗ S, on the other hand, contains a lottery ticket, as it remains very robust to strong degrees of pruning. In fact, θ∗ S shows similar behavior to the networks rewound to epoch 1 and 2 in supervised training. This suggests that random teacher distillation imitates some of the learning dynamics in the first epochs of supervised optimization. We stress here that no label information was required for sparse subnetworks to develop. This aligns with results in (Frankle et al., 2020), showing that auxiliary tasks such as rotation prediction can lead to lottery tickets. However, this is no surprise, as Anagnostidis et al. (2022) show that the data- informed bias of augmentations can already lead to strong forms of learning. We believe our result is more powerful since random teacher distillation relies solely on implicit regularization in SGD and does not require a task at all. Linear Mode Connectivity. In light of the observation regarding the stability of SGD in Frankle et al. (2019), we verify whether a similar stability property holds for the stu- dent checkpoint θ∗ S. To that end, we train several runs of SGD in a supervised fashion with initialization θ∗ S on differ- 8 Figure 9. Test error when interpolating between networks that were trained from the same initialization. Left: Networks initialized at the teacher location, i.e., random initialization. Right: Networks initialized at the converged student θ∗S(0). Aggregation is done over 3 initializations and 5 different data orderings πi. ent batch orderings π1, . . . , πb and study the test accuracies occurring along linear paths between different solutions θ∗ πi for i = 1, . . . , b, i.e. θπi−→πj (γ) := γθ∗ πi + (1 − γ)θ∗ πj . and θ∗ πj If the test accuracy along the path does not significantly worsen, we call θ∗ linearly mode-connected. We πi contrast the results with the interpolation curves for SGD runs started from the original, random initialization θS. We display the interpolation curves in Fig. 9, where we used three ResNet18 student checkpoints and finetuned each in five SGD runs with different seeds on CIFAR10. We observe that, indeed, the resulting parameters θ∗ all lie in approxi- πi mately the same linear basin. However, the networks trained from the random initialization face a significantly larger barrier. This confirms that random teacher distillation con- verges towards parameterizations θ∗ S, which are different from those at initialization θS. In particular, such θ∗ S would only appear later in supervised optimization when SGD is al- ready more stable to noise. Ultimately, it shows that random teacher distillation obeys similar dynamics as supervised optimization and can navigate toward linear basins of the supervised loss landscape. 7. Discussion and Conclusion In this work, we examined the teacher-student setting to disentangle its implicit regularization from other very com- mon components such as dark knowledge in trained teachers or data augmentations in self-supervised learning. Surpris- ingly, students learned strong structures even from random teachers in the absence of data augmentation. We studied the quality of the students and observed that (1) probing accuracies significantly improve over the teacher, (2) fea- tures are data-dependent and transferable across tasks, and (3) student checkpoints develop sparse subnetworks at the border of linear basins without training on a supervised task. 100.051.226.213.46.93.51.80.90.5weightsremaining(%)0.900.910.920.930.940.95testaccuracyinitθ∗S,rewindto'=0initθS,rewindto'=0initθS,rewindto'=1initθS,rewindto'=2initθS,rewindto'=5θ∗πiθ∗πj0.10.20.30.40.5testerrorfinetuneθSθ∗πiθ∗πjfinetuneθ∗S Random Teachers are Good Teachers The success of teacher-student frameworks such as knowl- edge distillation and non-contrastive learning can thus at least partially be attributed to the regularizing nature of the learning dynamics. These label-independent dynamics allow the student to mimic the early phase of supervised training by navigating the supervised loss landscape without label information. The simple and minimal nature of our setting makes it an ideal test bed for better understanding this early phase of learning. We hope that future theoretical work can build upon our simplified framework. Acknowledgements We thank Sidak Pal Singh for his valuable insights and interesting discussions on various aspects of the topic. References Allen-Zhu, Z. and Li, Y. Towards Understanding En- semble, Knowledge Distillation and Self-Distillation in In 11th International Conference on Deep Learning. Learning Representations (ICLR), 2 2020. URL https: //arxiv.org/abs/2012.09816. Anagnostidis, S., Bachmann, G., Noci, L., and Hofmann, T. The Curious Case of Benign Memorization. In 11th International Conference on Learning Representations (ICLR), 2022. doi: 10.48550/arxiv.2210.14019. URL https://arxiv.org/abs/2210.14019. Assran, M., Caron, M., Misra, I., Bojanowski, P., Bordes, F., Vincent, P., Joulin, A., Rabbat, M., and Ballas, N. Masked Siamese Networks for Label-Efficient Learning. In European Conference on Computer Vision (ECCV), 2022. doi: 10.48550/arxiv.2204.07141. URL https: //arxiv.org/abs/2204.07141. Ba, J. and Caruana, R. Do deep nets really need to In 28th Conference on Neural Information be deep? Processing Systems (NeurIPS), 2013. URL https: //arxiv.org/abs/1312.6184. Bardes, A., Ponce, J., and LeCun, Y. VICReg: Variance-Invariance-Covariance Regularization for Self- In 10th International Confer- Supervised Learning. ence on Learning Representations (ICLR), 2021. doi: 10.48550/arxiv.2105.04906. URL https://arxiv. org/abs/2105.04906. Benzing, F., Schug, S., Ch, S., Meier, R., Von Oswald, J., Ch, V., Akram, Y., Zucchet, N., Aitchison, L., Steger, A., and Ch, S. E. Random initialisations performing above chance and how to find them. ArXiv, 9 2022. URL https://arxiv.org/abs/2209.07509. Beyer, L., Zhai, X., Royer, A., Markeeva, L., Anil, R., and Kolesnikov, A. Knowledge distillation: A good teacher 9 is patient and consistent. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022. URL https://arxiv.org/abs/2106.05237. Bucilˇa, C., Caruana, R., and Niculescu-Mizil, A. Model In ACM International Conference on compression. Knowledge Discovery and Data Mining (SIGKDD), 2006. URL https://dl.acm.org/doi/abs/10. 1145/1150402.1150464. Caron, M., Touvron, H., Misra, I., J ́egou, H., Mairal, J., Bojanowski, P., and Joulin, A. Emerging Properties in Self-Supervised Vision Transformers. In IEEE/CVF Inter- national Conference on Computer Vision (ICCV), 2021. URL https://arxiv.org/abs/2104.14294. Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A Sim- ple Framework for Contrastive Learning of Visual Repre- sentations. In 37th International Conference on Machine Learning (ICML), 2020. ISBN 9781713821120. doi: 10.48550/arxiv.2002.05709. URL https://arxiv. org/abs/2002.05709. Chen, X. and He, K. Exploring Simple Siamese Repre- sentation Learning. In IEEE/CVF Conference on Com- puter Vision and Pattern Recognition, 2021. ISBN 9781665445092. doi: 10.48550/arxiv.2011.10566. URL https://arxiv.org/abs/2011.10566. Coates, A., Ng, A., and Lee, H. An analysis of single-layer networks in unsupervised feature learn- In 14th International Conference on Artificial ing. Intelligence and Statistics (AISTATS). PMLR, 2011. URL https://proceedings.mlr.press/v15/ coates11a.html. Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. BERT: Pre-training of deep bidirectional transformers for lan- guage understanding. In Conference of the North Amer- ican Chapter of the Association for Computational Lin- guistics: Human Language Technologies, 2019. doi: 10.18653/v1/N19-1423. URL https://arxiv.org/ abs/1810.04805. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al. An image is worth 16x16 words: Transformers for image recognition at scale. In 9th International Conference on Learning Represen- tations (ICLR), 2020. URL https://arxiv.org/ abs/2010.11929. Draxler, F., Veschgini, K., Salmhofer, M., and Hamprecht, F. A. Essentially No Barriers in Neural Network Energy Landscape. In 35th International Conference on Machine Learning (ICML), 2018. ISBN 9781510867963. URL https://arxiv.org/abs/1803.00885. Random Teachers are Good Teachers Frankle, J. and Carbin, M. The Lottery Ticket Hypothe- sis: Finding Sparse, Trainable Neural Networks. In 7th International Conference on Learning Representations (ICLR), 2018. doi: 10.48550/arxiv.1803.03635. URL https://arxiv.org/abs/1803.03635. Frankle, J., Dziugaite, G. K., Roy, D. M., and Carbin, M. Linear Mode Connectivity and the Lottery Ticket Hy- pothesis. In 37th International Conference on Machine Learning (ICML), 2019. URL https://arxiv.org/ abs/1912.05671. Frankle, J., Schwab, D. J., and Morcos, A. S. The Early In 8th Interna- Phase of Neural Network Training. tional Conference on Learning Representations (ICLR), 2020. doi: 10.48550/arxiv.2002.10365. URL https: //arxiv.org/abs/2002.10365. Furlanello, T., Lipton, Z. C., Tschannen, M., Itti, L., and Anandkumar, A. Born Again Neural Networks. 35th International Conference on Machine Learning (ICML), 2018. doi: 10.48550/arxiv.1805.04770. URL https: //arxiv.org/abs/1805.04770. Garipov, T., Izmailov, P., Podoprikhin, D., Vetrov, D., and Wilson, A. G. Loss Surfaces, Mode Connectivity, and Fast Ensembling of DNNs. In 32nd Conference on Neural Information Processing Systems (NeurIPS), 2018. doi: 10.48550/arxiv.1802.10026. URL https://arxiv. org/abs/1802.10026. Grill, J. B., Strub, F., Altch ́e, F., Tallec, C., Richemond, P. H., Buchatskaya, E., Doersch, C., Pires, B. A., Guo, Z. D., Azar, M. G., Piot, B., Kavukcuoglu, K., Munos, R., and Valko, M. Bootstrap your own latent: A new approach to self-supervised Learning. In 34th Conference on Neural Information Processing Systems (NeurIPS), 2020. doi: 10.48550/arxiv.2006.07733. URL https: //arxiv.org/abs/2006.07733. He, H., Huang, G., and Yuan, Y. Asymmetric Val- In 33rd leys: Beyond Sharp and Flat Local Minima. Conference on Neural Information Processing Systems (NeurIPS), 2019. URL https://arxiv.org/abs/ 1902.00744. He, K., Zhang, X., Ren, S., and Sun, J. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In IEEE International Confer- ence on Computer Vision (ICCV), 2015. URL https: //arxiv.org/abs/1502.01852. He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. URL https://arxiv.org/abs/1512.03385. 10 Hinton, G., Vinyals, O., and Dean, J. Distilling the Knowledge in a Neural Network. ArXiv, 2015. doi: 10.48550/arxiv.1503.02531. URL https://arxiv. org/abs/1503.02531. Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In 32nd International Conference on Machine Learning (ICML), 2015. URL https://proceedings.mlr. press/v37/ioffe15.html. Izmailov, P., Vikram, S., Hoffman, M. D., and Wilson, A. G. What Are Bayesian Neural Network Posteriors Really Like? 2021. Jacot, A., Gabriel, F., and Hongler, C. Neural tangent kernel: Convergence and generalization in neural net- In 32nd Conference on Neural Information works. Processing Systems (NeurIPS), 2018. URL https: //arxiv.org/abs/1806.07572. Ji, G. and Zhu, Z. Knowledge distillation in wide neu- ral networks: Risk bound, data efficiency and imper- In 34th Conference on Neural Informa- fect teacher. tion Processing Systems (NeurIPS), 2020. URL https: //arxiv.org/abs/2010.10090. Kingma, D. P. and Ba, J. Adam: A method for stochas- In 3rd International Conference on tic optimization. Learning Representations (ICLR), 2014. URL https: //arxiv.org/abs/1412.6980. Krizhevsky, A. and Hinton, G. features from tiny images. layers of report, University of Toronto, 2009. cal https://www.cs.toronto.edu/ ̃kriz/ learning-features-2009-TR.pdf. Learning multiple Techni- URL Le, Y. and Yang, X. Tiny imagenet visual recognition chal- lenge. Technical report, Stanford University, 2015. URL http://vision.stanford.edu/teaching/ cs231n/reports/2015/pdfs/yle_project. pdf. Li, H., Xu, Z., Taylor, G., Studer, C., and Goldstein, T. Visualizing the loss landscape of neural nets. In 32nd Conference on Neural Information Processing Systems (NeurIPS), 2018. URL https://arxiv.org/abs/ 1712.09913. Mobahi, H., Farajtabar, M., and Bartlett, P. L. Self- Distillation Amplifies Regularization in Hilbert Space. In 34th Conference on Neural Information Processing Sys- tems (NeurIPS), 2020. doi: 10.48550/arxiv.2002.05715. URL https://arxiv.org/abs/2002.05715. Random Teachers are Good Teachers Wang, Y., Li, H., Chau, L.-p., and Kot, A. C. Embrac- ing the dark knowledge: Domain generalization using In 29th ACM In- regularized knowledge distillation. ternational Conference on Multimedia, 2021. doi: 10. 1145/3474085.3475434. URL https://doi.org/ 10.1145/3474085.3475434. Xu, K., Park, D. H., Yi, C., and Sutton, C. Interpret- ing deep classifier by visual distillation of dark knowl- edge. ArXiv, 2018. URL https://arxiv.org/ abs/1803.04042. Yang, C., Xie, L., Su, C., and Yuille, A. L. Snapshot distillation: Teacher-student optimization in one gener- In IEEE/CVF Conference on Computer Vision ation. and Pattern Recognition (CVPR), 2018. URL https: //arxiv.org/abs/1812.00123. Yim, J., Joo, D., Bae, J., and Kim, J. A gift from knowledge distillation: Fast optimization, network min- In IEEE Conference imization and transfer learning. on Computer Vision and Pattern Recognition (CVPR), 2017. URL https://ieeexplore.ieee.org/ document/8100237. Yuan, L., Tay, F. E., Li, G., Wang, T., and Feng, J. Re- visiting knowledge distillation via label smoothing reg- In IEEE/CVF Conference on Computer ularization. Vision and Pattern Recognition (CVPR), 2020. URL https://arxiv.org/abs/1909.11723. Zaidi, S., Berariu, T., Kim, H., Bornschein, J., Clopath, C., Teh, Y. W., and Pascanu, R. When Does Re-initialization Work? Understanding Deep Learning Through Empirical Falsification (NeurIPS Workshop), 6 2022. URL https: //arxiv.org/abs/2206.10011. Zbontar, J., Jing, L., Misra, I., LeCun, Y., and Deny, S. Barlow Twins: Self-Supervised Learning via Redundancy Reduction. In 38th International Conference on Machine Learning (ICML), 2021. doi: 10.48550/arxiv.2103.03230. URL https://arxiv.org/abs/2103.03230. Zhang, C., Zhang, K., Zhang, C., Pham, T. X., Yoo, C. D., and Kweon, I. S. How Does SimSiam Avoid Collapse Without Negative Samples? A Unified Un- derstanding with Self-supervised Contrastive Learning. In 10th International Conference on Learning Represen- tations (ICLR), 2022. URL https://arxiv.org/ abs/2203.16262. Nakkiran, P., Neyshabur, B., and Sedghi, H. The deep bootstrap framework: Good online learners are good of- fline generalizers. In 9th International Conference on Learning Representations (ICLR), 2021. URL https: //openreview.net/forum?id=guetrIHLFGI. Phuong, M. and Lampert, C. Towards understanding In 36th International Confer- knowledge distillation. ence on Machine Learning (ICML), 2019. URL https: //arxiv.org/abs/2105.13093. Polino, A., Pascanu, R., and Alistarh, D. Model compres- In 6th Interna- sion via distillation and quantization. tional Conference on Learning Representations (ICLR), 2018. URL https://openreview.net/forum? id=S1XolQbRW. Safran, I. and Shamir, O. Spurious Local Minima are Com- mon in Two-Layer ReLU Neural Networks. 35th Inter- national Conference on Machine Learning (ICML), 2017. URL https://arxiv.org/abs/1712.08968. Schroff, F., Kalenichenko, D., and Philbin, J. Facenet: A unified embedding for face recognition and clustering. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. doi: 10.1109/CVPR.2015. 7298682. URL https://arxiv.org/abs/1503. 03832. Simonyan, K. and Zisserman, A. Very deep convolu- In tional networks for large-scale image recognition. 3rd International Conference on Learning Representa- tions (ICLR), 2014. URL https://arxiv.org/ abs/1409.1556. Stanton, S., Izmailov, P., Kirichenko, P., Alemi, A. A., and Wilson, A. G. Does Knowledge Distillation Really Work? In 35th Conference on Neural Information Processing Systems (NeurIPS), 2021. ISBN 9781713845393. URL https://arxiv.org/abs/2106.05945. Tian, Y., Chen, X., and Ganguli, S. Understanding self- supervised Learning Dynamics without Contrastive Pairs. In 38th International Conference on Machine Learning (ICML), 2021. doi: 10.48550/arxiv.2102.06810. URL https://arxiv.org/abs/2102.06810. van den Oord, A., Li, Y., and Vinyals, O. Representation learning with contrastive predictive coding. ArXiv, 2018. URL https://arxiv.org/abs/1807.03748. Wang, X., Chen, X., Du, S. S., and Tian, Y. Towards de- mystifying representation learning with non-contrastive self-supervision. ArXiv, 2022. URL https://arxiv. org/abs/2110.04947. 11 A. The Algorithm Random Teachers are Good Teachers Distillation from a random teacher has two important details. The outputs are very high-dimensional, 216-d. And a special component, the l2-bottleneck, is hidden in the architecture of the projection head just before the softmax. It linearly maps a feature vector to a low-dimensional space, normalizes it, and computes the dot product with a normalized weight matrix, i.e. x → ̃V T W T x + b ||W T x + b||2 with || ̃V:,i||2 = 1 for x ∈ Rn, W ∈ Rn×k, b ∈ Rk, ̃V ∈ Rk×m. This architecture is heavily inspired by DINO (Caron et al., 2021). Let us summarize the method in pseudo-code: 1 e n c o d e r , head , w n l a y e r = ResNet ( 5 1 2 ) , MLP( 2 0 4 8 , 2 0 4 8 , 2 5 6 ) , L i n e a r ( 216 ) 3 s t u d e n t = i n i t i a l i z e ( e n c o d e r , head , w n l a y e r ) 5 7 9 11 13 15 17 19 21 23 25 t e a c h e r = copy ( s t u d e n t ) # i n i t i a l i z e w i t h same p a r a m e t e r s f o r x , y i n r e p e a t ( d a t a , n e p o c h s ) : # a p p l y w e i g h t − n o r m a l i z a t i o n n o r m a l i z e d w e i g h t t = n o r m a l i z e ( t e a c h e r . w n l a y e r . w e i g h t ) n o r m a l i z e d w e i g h t s = n o r m a l i z e ( s t u d e n t . w n l a y e r . w e i g h t ) t a r g e t # p r e p a r e x t = t e a c h e r . h e a d ( t e a c h e r . e n c o d e r ( x ) ) x t = n o r m a l i z e ( x t ) x t = d o t ( n o r m a l i z e d w e i g h t t a r g e t = s o f t m a x ( x t ) t , x t ) # p r e p a r e p r e d i c t i o n x s = s t u d e n t . h e a d ( s t u d e n t . e n c o d e r ( x ) ) x s = n o r m a l i z e ( x s ) x s = d o t ( n o r m a l i z e d w e i g h t s , x s ) p r e d i c t i o n = s o f t m a x ( x s ) # compute l o s s , b a c k p r o p a g a t e and u p d a t e l o s s = sum ( t a r g e t * − l o g ( p r e d i c t i o n ) ) # c r o s s − e n t r o p y l o s s . b a c k w a r d ( ) o p t i m i z e r . s t e p ( s t u d e n t ) # u p d a t e o n l y s t u d e n t Figure 10. Comparing different output dimensions m of the projection head. Large m = 216 are not crucial for feature learning, but there is phase transition at the bottleneck dimension m = 28 = 256 Linear probing on CIFAR10. Left: ResNet18 (red). Right: VGG11 (green). 12 0255075100epoch0.10.20.30.40.5probingaccuracy0255075100epoch2022242628210212214216mResNet18VGG11 Random Teachers are Good Teachers B. Ablating the Projector B.1. Ablating Normalization Layers If the teacher is used in evaluation mode, then one possible source of asymmetry is introduced by batch normalization layers. But is the effect caused by this batch-dependent signal? Or does the batch dependency amplify the mechanism? In Fig. 11 we compare different types of normalization layers and no normalization (Identity). We observe that although BN stabilizes training, the effect also occurs with batch-independent normalization. Further, networks without normalization reach similar performance but take longer to converge. Figure 11. Comparing different types of normalization layers on CIFAR10. Left: ResNet18. Right: VGG11. B.2. Ablating the L2-Bottleneck The l2-Bottleneck is a complex layer with many unexplained design choices. We compare different combinations of weight-normalization (wn), linear layer (lin), and feature normalization (fn) for the first and second part of the bottleneck in Figures 12 for a ResNet18 and a VGG11 respectively. While the default setup is clearly the most performant, removing feature normalization is more destructive than removing weight normalization. In particular, only one linear layer followed by a feature normalization still exhibits a similar trend and does not break down. Figure 12. Ablating components of the l2-bottleneck on CIFAR10. Left: ResNet18. Right: VGG11. 13 020406080100epoch0.10.20.30.40.5probing accuracyresnet18020406080100epochvgg11BatchNormInstanceNormGroupNorm8LayerNormIdentity0255075100epoch0.10.20.30.40.5probing accuracy0255075100epochwn1 lin1 fn1 wn2 lin2 fn2 C. Additional Results Random Teachers are Good Teachers We present additional experimental results that serve to better understand the regularization properties of self-distillation with random teachers. C.1. K-NN probing A different probing choice, instead of learning a linear layer on top of the extracted embeddings, is to perform K-NN classification on the features. We apply K-nearest-neighbour classification with the number of neighbors set to K = 20, as commonly done in practice. As in Table 1 in the main text, we present results under K-NN evaluation in Table 3. Also, as in Table 2, we evaluate using K-NN probing the transferability of the learned embeddings from TinyImageNet in Table 4. DATASET MODEL TEACHER STUDENT INPUT CIFAR10 CIFAR100 STL10 TinyImageNet ResNet18 VGG11 ResNet18 VGG11 ResNet18 VGG11 ResNet18 VGG11 37.65 44.92 13.77 18.10 31.71 36.92 4.59 5.98 44.67 51.32 20.22 23.53 37.41 43.58 7.11 9.23 33.61 14.87 28.94 3.44 Table 3. K-NN probing accuracies (in percentage) of the representations for various datasets for teacher, student, and raw pixel inputs. DATASET MODEL TEACHER STUDENT CIFAR10 CIFAR100 STL10 ResNet18 VGG11 ResNet18 VGG11 ResNet18 VGG11 37.65 44.92 13.77 18.10 31.71 36.92 44.45 51.48 19.48 23.95 38.86 42.26 Table 4. K-NN probing accuracies (in percentage) of the representations for various datasets for teacher and student when transferred from TinyImageNet. 14 C.2. Architectures Random Teachers are Good Teachers For our experiments in the main text, we used the very common VGG11 and ResNet18 architectures. Here, we report results for different types of architectures to provide a better picture of the relevance of architectural inductive biases. In particular, we compare with the Vision Transformer (ViT) (Dosovitskiy et al., 2020) (patch size 8 for 32 × 32 images of CIFAR10) and find that the effect of representation learning is still present, albeit less pronounced. More generally, we observe that with less inductive bias, the linear probing accuracy diminishes but never breaks down. MODEL #PARAMS TEACHER STUDENT NONE (INPUT) 0 VGG11 VGG13 VGG16 VGG19 ResNet20* ResNet56* ResNet18 ResNet34 ResNet50 ViT-Tiny ViT-Small ViT-Medium ViT-Base 9′220′480 9′404′992 14′714′688 20′024′384 271′824 855′120 11′168′832 21′276′992 23′500′352 594′048 2′072′832 3′550′208 7′684′608 39.02 36.55 34.73 33.08 30.84 28.68 14.05 35.50 28.18 19.69 32.93 38.57 41.09 41.71 39.02 51.98 49.26 46.35 43.90 36.62 27.92 46.02 41.04 27.53 35.76 41.68 43.13 44.38 Table 5. Linear probing accuracies (in percentage) of the representations for various architectures for teacher, student, and flattened inputs on CIFAR10. ResNet20* and ResNet56* are the smaller CIFAR-variants from He et al. (2016). The students outperform their teachers in all cases. 15 C.3. Loss landscapes Random Teachers are Good Teachers The parameter plane visualized in Fig. 5 is defined by interpolation between three parameterizations, thus, distances and angles are not preserved. In the following Fig. 13, we orthogonalize the basis of the parameter plane to achieve a distance and angle-preserving visualization. We note that both converged solutions of the students θ∗ S(1) stay comparably close to their initializations. Further, we provide a zoomed crop of the asymmetric valley around the teacher θST in Fig. 14. S(0) and θ∗ Figure 13. Orthogonal projection of the loss landscape in the parameter plane. Figure 14. Higher resolution crop of the global optimum around the teacher. 16 −60−40−200204060losslandscapeθTθS(1)θ∗S(1)non-localview90100110110120120130130140140150150150150θTθ∗S(0)θ∗S(1)sharedview90100110110120120130130140140150150150150−100−50050100−60−40−200204060probinglandscapeθTθS(1)θ∗S(1)90100110110120120130130140140150150150150−100−50050100θTθ∗S(0)θ∗S(1)9010011011012012013013014014015015015015010−710−610−510−410−30.10.20.30.40.5−90−85−80−75−70−65−60−40−35−30−25−20−15−10θTθ∗S(0)10410811211612012410−710−610−510−410−3 Random Teachers are Good Teachers The same visualization technique allows plotting the KL divergence between embeddings produced by the teacher and other parametrization in the plane. While in Fig,13, the basin of the local solution matches with the area of increased probing accuracy, such a correlation is not visible if one only considers the encoder. Figure 15. Orthogonal projection of the embedding KL divergence landscape in the parameter plane. Figure 16. Higher resolution crop of the global optimum around the teacher. 17 −30−20−100102030losslandscapeθTθS(1)θ∗S(1)non-localview48546060666672727878848490909090θTθ∗S(0)θ∗S(1)sharedview485460606666727278788484849090−60−40−200204060−30−20−100102030probinglandscapeθTθS(1)θ∗S(1)48546060666672727878848490909090−60−40−200204060θTθ∗S(0)θ∗S(1)48546060666672727878848484909010−610−510−410−310−210−11000.10.20.30.40.5−60−55−50−45−40−35−30−20.0−17.5−15.0−12.5−10.0−7.5−5.0θTθ∗S(0)576063666972757810−610−410−2100 D. Optimization Metrics Random Teachers are Good Teachers To convince ourselves that independently initialized students (α = 1) are more difficult to optimize, we provide an overview of the KL-Divergence and distance from initialization for all α ∈ [0, 1] in Fig. 17. We observe that, indeed, for students initialized far away from their teacher, the loss cannot be reduced as efficiently. This coincides with worse probing performance. Note, however, that even the students with α = 1 are able to outperform their teachers. Figure 17. Optimization metrics for locality parameter α on CIFAR10. Left: ResNet18. Middle: VGG11. Right: Summary. 18 D.1. Restarting Random Teachers are Good Teachers An evident idea would be to restart the random teacher distillation procedure in some way or another. We considered several approaches, such as reintroducing the exponential moving average of the teacher, but were not successful. In Fig. 18, we show the most straightforward approach, where the student is reused as a new teacher, and a second round of distillation is performed. The gradient dynamics around the restarted student seem much more stable, and the optimization procedure does not even begin. Figure 18. Restarting random teacher distillation on CIFAR10 with ResNet18 and VGG11. Left: First round of distillation. Right: Second round of distillation 19 012345kldivergence×10−5kldivergenceResNet18VGG11010203040distancefrominitdistancefrominit050100epoch0.200.250.300.350.400.450.50probingaccuracy05101520epochprobingaccuracy E. Experimental Details Random Teachers are Good Teachers Our main goal is to demystify the properties of distillation in a simplistic setting, removing a series of 'tricks' used in practice. For clarity reasons, we here present a comprehensive comparison with the popular framework of DINO (Caron et al., 2021). E.1. Architecture Configuration Encoder Projection Head L2-Bottleneck(in, mid, out) ResNet18&VGG1 from torchvision, without fc or classification layers (embedding ∈ R512) (ResNet18 adjusted stem for CIFAR: conv from 7x7 to 3x3, remove maxpool) 3-Layer MLP: 512 → 2048 → 2048 → l2-bottleneck(256) → 216 (GELU activation, no batchnorms, init: trunc normal with σ = 0.02, biases=0) for x ∈ Rin, W ∈ Rin×mid, b ∈ Rmid, ̃V ∈ Rmid×out 1. linear to bottleneck: z = W T x + b ∈ Rmid 2. feature normalization: ̃z = z/||z||2 3. weightnormalized linear: y = ̃V T ̃z ∈ Rout, with || ̃V:,i||2 = 1 ⇒ f ̃V ,W (x) = ̃V T W T x+b ||W T x+b||2 with || ̃V:,i||2 = 1 E.2. Data Configuration Augmentations Training batchsize Evaluation batchsize DINO default Random Teacher Multicrop (2 × 2242 + 10 × 962) + SimCLR-like None (1 × 322) 64 per GPU 128 per GPU 256 256 E.3. DINO Hyperparameters Configuration Teacher update Teacher BN update BN in train mode Teacher centering DINO default ema with momentum 0.996 cos→ 1 Teacher sharpening Student sharpening Loss function track statistics with momentum 0.9 temperature 0.04 (paper: 0.04 lin→ 0.07) temperature 0.1 opposite-crop cross-entropy Random Teacher no updates BN in eval mode not applied temperature 1 temperature 1 single-crop cross-entropy E.4. Random Teacher Training Configuration Optimizer Learning rate Weight decay Gradient Clipping Freezing of last layer DINO default AdamW 0 lin→ 0.0005 cos→ 1e-6 schedule 0.04 lin→ 0.4 schedule to norm 3 during first epoch Random Teacher AdamW 0.001 (torch default) not applied not applied not applied E.5. IMP Training Configuration Training Epochs Optimizer Learning rate Weight decay Augmentations Lottery Ticket Hypothesis (Frankle et al., 2020) Random Teacher 160 SGD (momentum 0.9) 80 epochs 160 SGD (momentum 0.9) 80 epochs 40 epochs → 0.01 MultiStep: 0.1 0.0001 Random horizontal flip & padded crop (4px) → 0.001 → 0.01 MultiStep: 0.1 0.0001 Random horizontal flip & padded crop (4px) → 0.001 40 epochs 20
http://arxiv.org/abs/2302.12084v1
2023-02-23T15:16:40
2023-02-23T15:16:40
Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks
In recent years, large strides have been taken in developing machine learning methods for dermatological applications, supported in part by the success of deep learning (DL). To date, diagnosing diseases from images is one of the most explored applications of DL within dermatology. Convolutional neural networks (ConvNets) are the most common (DL) method in medical imaging due to their training efficiency and accuracy, although they are often described as black boxes because of their limited explainability. One popular way to obtain insight into a ConvNet's decision mechanism is gradient class activation maps (Grad-CAM). A quantitative evaluation of the Grad-CAM explainability has been recently made possible by the release of DermXDB, a skin disease diagnosis explainability dataset which enables explainability benchmarking of ConvNet architectures. In this paper, we perform a literature review to identify the most common ConvNet architectures used for this task, and compare their Grad-CAM explanations with the explanation maps provided by DermXDB. We identified 11 architectures: DenseNet121, EfficientNet-B0, InceptionV3, InceptionResNetV2, MobileNet, MobileNetV2, NASNetMobile, ResNet50, ResNet50V2, VGG16, and Xception. We pre-trained all architectures on an clinical skin disease dataset, and fine-tuned them on a DermXDB subset. Validation results on the DermXDB holdout subset show an explainability F1 score of between 0.35-0.46, with Xception displaying the highest explainability performance. NASNetMobile reports the highest characteristic-level explainability sensitivity, despite it's mediocre diagnosis performance. These results highlight the importance of choosing the right architecture for the desired application and target market, underline need for additional explainability datasets, and further confirm the need for explainability benchmarking that relies on quantitative analyses.
[ "Raluca Jalaboi", "Ole Winther", "Alfiia Galimzianova" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12084v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12084v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG", "92B20, 92C50, 68T45" ]
3 2 0 2 b e F 3 2 ] V C . s c [ 1 v 4 8 0 2 1 . 2 0 3 2 : v i X r a DERMATOLOGICAL DIAGNOSIS EXPLAINABILITY BENCHMARK FOR CONVOLUTIONAL NEURAL NETWORKS A PREPRINT Raluca Jalaboi1,2, Ole Winther1,3,4, and Alfiia Galimzianova2 1Department of Applied Mathematics and Computer Science at the Technical University of Denmark, Richard Petersens Plads, Building 324, DK-2800 Kongens Lyngby, Denmark 2Medable A/S, Havnegade 25, 3., DK-1058 Copenhagen C, Denmark 3Bioinformatics Centre, Department of Biology, University of Copenhagen, Copenhagen, Denmark 4Center for Genomic Medicine, Rigshospitalet, Copenhagen University Hospital, Copenhagen, Denmark ABSTRACT In recent years, large strides have been taken in developing machine learning methods for various dermatological applications, supported in part by the widespread success of deep learning. To date, diagnosing diseases from images is one of the most explored applications of deep learning within dermatology. Convolutional neural networks (ConvNets) are the most commonly used deep learning method in medical imaging due to their training efficiency and accuracy, although they are often described as black boxes because of their limited explainability. One popular way to obtain insight into a ConvNet's decision mechanism is gradient class activation maps (Grad-CAM). A quantitative evaluation of the Grad-CAM explainability has been recently made possible by the release of DermXDB, a skin disease diagnosis explainability dataset which enables benchmarking the explainability performance of ConvNet architectures. In this paper, we perform a literature review to identify the most common ConvNet architectures used for this task, and compare their Grad- CAM explainability performance with the explanation maps provided by DermXDB. We identified 11 architectures: DenseNet121, EfficientNet-B0, InceptionV3, InceptionResNetV2, MobileNet, MobileNetV2, NASNetMobile, ResNet50, ResNet50V2, VGG16, and Xception. We pre-trained all architectures on an clinical skin disease dataset, and then fine-tuned them on a subset of DermXDB. Validation results on the DermXDB holdout subset show an explainability F1 score of between 0.35- 0.46, with Xception the highest explainability performance, while InceptionResNetV2, ResNet50, and VGG16 displaying the lowest. NASNetMobile reports the highest characteristic-level explainability sensitivity, despite it's mediocre diagnosis performance. These results highlight the importance of choosing the right architecture for the desired application and target market, underline need for additional explainability datasets, and further confirm the need for explainability benchmarking that relies on quantitative analyses rather than qualitative assessments. Keywords deep learning, dermatologys, explainability, benchmark, review 1 Introduction With an expected shortage of approximately ten million healthcare professionals by 2030 [World Health Organization, 2016], the world is facing a massive healthcare crisis. Automation has been proposed as a solution to the scarcity of medical professionals, with the Food and Drugs Administration in the United States approving medical devices based on artificial intelligence for marketing to the public [U.S. Food and Drug Administration, 2018]. This development is due in part to the advancement in machine learning using unstructured data. Ever since Krizhevsky et al. [2017] won the ImageNet Large Scale Visual Recognition Challenge [Russakovsky et al., 2015] using a convolu- tional neural network (ConvNet), ConvNets have been at the forefront of machine learning based automation. Employed primarily in healthcare for imaging applications, ConvNets have been used for disease diagnosis [Gao et al., 2019], cell Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT counting [Falk et al., 2019], disease severity assessment [Gulshan et al., 2016], disease progression estimation [Kijowski et al., 2020], lesion or anatomical region segmentation [Hesamian et al., 2019, Ramesh et al., 2021], etc. Esteva et al. [2017] were the first to demonstrate that ConvNets can achieve expert-level performance in dermatological diagnosis using dermoscopy images. Since then, dermatology has embraced ConvNets as a solution to various diagnosis and segmentation tasks [Esteva et al., 2017, Zhang et al., 2019, Jinnai et al., 2020, Haenssle et al., 2020, Roy et al., 2022]. Despite these considerable advancements in medical imaging, there has not yet been a widespread adoption of machine learning based automation in the clinical workflow. One of the main hurdles that detract from adoption is the lack of ConvNet explainability [Kelly et al., 2019], this issue being enhanced by the recently implemented legislation aimed at ensuring that automated methods can offer an explanation into their decision mechanisms [Goodman and Flaxman, 2017]. Different post-hoc explainability methods have been proposed as a way to explain a ConvNet's decisions [Bai et al., 2021, Selvaraju et al., 2017, Lundberg and Lee, 2017, Ribeiro et al., 2016]. Gradient class activation maps (Grad-CAM) is currently the most commonly used explainability method within medical imaging, due to its intrinsic ease of interpretation and its low computational requirements. However, validating the resulting explanations is an expensive, time consuming process that requires domain expert intervention, and thus most explainability validations are performed as small, qualitative analyses. With the release of DermXDB [Jalaboi et al., 2022], it became possible to quantitatively analyse the explainability of ConvNets trained for diagnosing six skin conditions: acne, psoriasis, seborrheic dermatitis, viral warts, and vitiligo. The purpose of this benchmark is to provide the means to quantitatively compare the explainability of the state-of-the-art approaches to dermatological diagnosis using photographic imaging. Our contributions are twofold: 1. We perform a comprehensive systematic review to reveal the usage of the ConvNets for the task of dermato- logical diagnosis using photographic images, 2. We benchmark the identified ConvNets for diagnostic and explainability performance and compare them with eight expert dermatologists. 2 Background 2.1 Machine learning methods in dermatological diagnosis After the renewed interest in artificial intelligence and machine learning that started in 2012, practitioners from both academia and the industry began investigating automated methods for dermatological applications [Thomsen et al., 2020, Jeong et al., 2022]. Until 2017, the vast majority of articles applying machine learning methods on dermatological problems were using classical models such as support vector machines [Liu et al., 2012, Sabouri et al., 2014], and linear or logistic regression [Kaur et al., 2015, Kefel et al., 2016]. These models were trained using hand-crafted features or features extracted using classical computer vision methods such as gray-level co-occurrence matrices [Shimizu et al., 2014], Sobel and Hessian filters [Arroyo and Zapirain, 2014], or HOS texture extraction [Shrivastava et al., 2016]. However, the main drawback of classical computer vision approaches is that hand-crafting features is an expensive, time-consuming process, while their automated extraction is too sensitive to the environmental factors of the image acquisition (e.g. lighting, zoom). Esteva et al. [2017] were the first to propose a ConvNet for diagnosing skin conditions from dermoscopy images. Their ConvNet reached expert-level performance without requiring any hand-crafted features or classical computer vision models, thus paving the way towards the current popularity of ConvNets in dermatological applications. One key component to the rise of ConvNets was the introduction of large scale dermatological datasets. The International Skin Imaging Collaboration (ISIC) challenge dataset [Codella et al., 2018] is one of the best known open access dermoscopy datasets, containing 25,331 images distributed over nine diagnostic categories. Large clinical image datasets are also available for research purposes, such as SD-260 [Sun et al., 2016] which consists of 20,600 clinical images of 260 different skin diseases, and DermNetNZ [DermNetNZ, 2021] which contains more than 25,000 clinical images. Aided by the release of increasingly more performant architectures, their publicly available pre-trained weights on the ImageNet [Deng et al., 2009] dataset, and the recently published public dermatological datasets, the vast majority of research contributions in machine learning applications for dermatology rely on ConvNet architectures. ConvNets have been extensively used in lesion diagnosis [Tschandl et al., 2017, Han et al., 2018, Reshma et al., 2022] and lesion segmentation [Yuan et al., 2017, Wu et al., 2022, Baig et al., 2020] on different modalities relevant for the domain. Attempts at explaining the decisions taken by ConvNets were made by several groups [Tschandl et al., 2020, Tanaka et al., 2021], but no quantitative analysis was performed. 2 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Table 1: Search query used on PubMed to identify the list of relevant articles. We searched for articles focused on dermatology, using deep learning methods, written in English. The query was last performed on the 20th of February 2023. Search term Search term (((dermatology[MeSH Terms]) OR AND ((neural network[MeSH Terms]) OR (skin disease[MeSH Terms]) OR (skin lesion[MeSH Terms])) (machine learning[MeSH Terms]) OR (artificial intelligence[MeSH Terms]) OR (deep learning) OR (deep neural network) OR (convolutional neural network)) Search term AND (English[Language]) 2.2 Explainability in convolutional neural networks ConvNets have, from their very beginning, been notoriously difficult to interpret and explain. Interpretability is generally considered the ability to understand the internal structure and properties of a ConvNet architecture, while explainability is defined as a ConvNet's capacity to offer plausible arguments in favour of its decision [Roscher et al., 2020]. Within healthcare, explainability is especially important due to its intrinsic ability to interact with domain experts in a common vocabulary [Kelly et al., 2019]. Although some architecture or domain-specific explainability methods exist, most medical imaging research articles employ attribution-based methods due to their ease of use and open source access [Singh et al., 2020, Bai et al., 2021]. There are two main ways of implementing attribution-based methods: through perturbation and by using the ConvNet's gradients. Perturbation-based methods, such as Shapley values [Lipovetsky and Conklin, 2001], LIME [Ribeiro et al., 2016], or SharpLIME [Graziani et al., 2021], rely on modifying the original image and then evaluating the changes in the ConvNet's prediction. For example, LIME uses a superpixel algorithm to split the image into sections, and randomly selects a subset of superpixels to occlude. The target ConvNet then performs an inference step on the perturbed image. This procedure is run multiple times to identify the superpixels that lead to the most drastic change in the ConvNet's prediction. SharpLIME uses hand-crafted segmentations to split the image into relevant sections, and then proceeds with the perturbation process defined in LIME. The main drawback of perturbation based methods is the need to run the prediction algorithm multiple times, which leads to high computational costs and long running times. Gradient-based methods, such as saliency maps [Simonyan and Zisserman, 2015], guided backpropagation [Sprin- genberg et al., 2014], gradient class-activation maps (Grad-CAM) [Selvaraju et al., 2017], or layer-wise relevance propagation [Bach et al., 2015], use a ConvNet's backpropagation step to identify the areas in an image that contribute the most to the prediction. In general, gradient-based methods compute the gradient of a given input in relation to the prediction, and apply different post-processing methods to the output. In the case of Grad-CAM, image features are extracted by forward propagating the image until the last convolutional layer. Then, the gradient is set to 0 for all classes except the target class, and the signal is backpropagated to the last convolutional layer. The extracted image features that directly contribute to the backpropagated signal constitute the Grad-CAM for the given class. Since the analysis can be performed at the same time as the inference itself and only requires one iteration, Grad-CAM is often used in research and industrial applications [Pereira et al., 2018, Young et al., 2019, Tschandl et al., 2020, Hepp et al., 2021, Jalaboi et al., 2023]. Due to its popularity, in this paper we will use Grad-CAM to benchmark the explainability of commonly used ConvNet architectures. 3 Material and methods 3.1 Literature review We performed a systematic literature review on PubMed, following the methodology introduced by Thomsen et al. [2020]. The query, described in Table 1, focused on dermatological applications of deep learning. A total of 3,650 articles were retrieved. We excluded articles that focused on domains other than dermatology, articles that did not include an original contribution in disease classification, articles using modalities other than photographic images, articles using methods other than ConvNets, and articles using proprietary ConvNets. 3 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT 3.2 Explainability benchmark 3.2.1 Explainability dataset For explainability benchmarking, we use DermXDB, a skin disease diagnosis explainability dataset published by Jalaboi et al. [2022]. The dataset consists of 524 images sourced from DermNetNZ [DermNetNZ, 2021] and SD-260 [Sun et al., 2016], and labeled with diagnoses and explanations in the form of visual skin lesion characteristics by eight board-certified dermatologists. To match the Grad-CAM output, we focus on the characteristic localization task. 3.2.2 Diagnosis evaluation For establishing the expert-level diagnosis performance, we compare each dermatologist with the reference standard diagnosis. We follow the same approach for benchmarking the diagnosis performance of the ConvNets. We evaluate the performance using the categorical F1 score, sensitivity, and specificity, defined as: F1 score = 2T P 2T P + F P + F N , Sensitivity = Specificity = T P T P + F N T N T N + F P , , (1) (2) (3) where the true positives T P represent correctly classified samples, the false positives F P represent samples incorrectly classified as part of the target class, the false negatives F N represent samples of the target class incorrectly classified as being part of a different class, and the true negatives T N represent samples correctly identified as not being part of the target class. 3.2.3 Explainability evaluation For establishing expert-level explainability performance, we compare the attention masks of each dermatologist with the aggregated fuzzy union of attention masks created by the other seven dermatologists (explanation maps). More specifically, we define the image-level explanation maps as the union of all characteristics segmented by all dermatologists for an image, and the characteristic-level explanation maps as the union of all segmentations for each characteristic for an image. Figure 1 illustrates the mask creation process for a psoriasis case. The ConvNet Grad-CAM attention maps are compared with explanations maps derived from all eight dermatologist evaluations. These two types of explanation maps offer a way to check whether the ConvNets take into account the entire area selected by dermatologists as important to their decision, and whether they focus on specific characteristics when making their decisions. To quantify the similarity between the Grad-CAMs and the explanation maps, we compute the F1 score, sensitivity and specificity following their fuzzy implementation defined in [Crum et al., 2006], described as: F1 score = p∈pixels min(Gp, Ep) 2 (cid:80) p∈pixels(Gp) + (cid:80) p∈pixels(Ep) (cid:80) , Sensitivity = (cid:80) p∈pixels min(Gp, Ep) (cid:80) p∈pixels(Sp) , Specificity = (cid:80) p∈pixels min(1 − Gp, 1 − Ep) p∈pixels(1 − Ep) (cid:80) , (4) (5) (6) where G is the ConvNet-generated Grad-CAM, and E is the explanation map for a given image. For characteristics, we report the Grad-CAM sensitivity with regard to the characteristic-level explanation maps. Specificity and F1 score were considered too stringent, as multiple characteristics can be present and essential for a diagnosis, and an explainable ConvNet must detect all of them to plausibly explain the diagnosis. 4 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Figure 1: Explanation maps creation example for a psoriasis case evaluated by two dermatologists. Both dermatologists identified plaque and scale as the two characteristics associated with the psoriasis diagnosis, and localized them. By combining the localization maps for each characteristic, we obtain the characteristic-level explanation maps. By combining the localization maps created by each dermatologist, we obtain the individual dermatologist explanation maps. By combining all localization maps, we obtain the image-level explanation map. 3.2.4 Experimental setup From the 22 articles that fulfilled all inclusion criteria, we selected the set of ConvNets to benchmark based on their reproducibility: we required that all benchmarked ConvNets had been pre-trained on ImageNet due to the limited amount of training data available. Thus, we exclude architectures that do not have publicly available pre-trained ImageNet weights compatible with the deep learning Keras framework [Chollet, 2015], i.e. GoogLeNet [Szegedy et al., 2015], InceptionV4 [Babenko and Lempitsky, 2015], MobileNetV3 [Howard et al., 2019], SENet [Hu et al., 2018], SE-ResNet [Hu et al., 2018], SEResNeXT [Hu et al., 2018], and ShuffleNet [Zhang et al., 2018]. Furthermore, as several articles compare different versions of the same architecture (e.g. EfficientNet-B0 through EfficientNet-B7, see Table 2), we select the smallest version of each architecture for our benchmark to avoid overfitting to the DermXDB dataset. In the rest of this work, we will focus on the following ConvNets: DenseNet121 [Huang et al., 2017], EfficientNet-B0 [Tan and Le, 2019], InceptionResNetV2 [Szegedy et al., 2017], InceptionV3 [Szegedy et al., 2016], MobileNet [Howard et al., 2017], MobileNetV2 [Sandler et al., 2018], NASNetMobile [Zoph et al., 2018], ResNet50 [He et al., 2016a], ResNet50V2 [He et al., 2016b], VGG16 [Simonyan and Zisserman, 2015], and Xception [Chollet, 2017]. We used the pre-trained weights offered by Keras to initialize the networks in our experiments. Next, all ConvNets were pre-trained on a proprietary clinical photography skin disease dataset collected by a dermatologist between 2004-2018. All images included in the dataset were anonymized, and the patients consented to their data being used for research purposes. More information about the dataset is available in Appendix Table A1. We performed a hyper-parameter search for each ConvNet, with the values used for experimentation and the validation performance being reported in Appendix Table A2 and Appendix Table A3, respectively. We further fine-tuned all ConvNets for 50 epochs with 261 randomly chosen images from the DermXDB dataset. The remaining 263 images were used as the test set. Each ConvNet was trained and tested five times. All results presented in this paper are aggregated over the five test runs. All code used for running the experiments is available at https://github.com/ralucaj/dermx-benchmark. 5 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Figure 2: The Preferred Reporting Items for Systematic Reviews and Meta Analyses (PRISMA) statement flowchart of the performed review process for identifying the benchmarked ConvNet architectures. First, we screened articles to ensure that they were using dermatological data and deep learning methods. Afterwards, we excluded review articles and contributions focused on tasks other than classification, and articles that that used non-photographic image data, e.g. dermoscopy, whole slides. Finally, we excluded articles that used proprietary ConvNets, leading to 22 articles serving as the benchmark basis. 4 Results 4.1 Literature review Figure 2 displays the Preferred Reporting Items for Systematic Review and Meta-Analyses statement flowchart of the performed review, while Figure 3 illustrates the evolution of articles topics over the years. Out of the original 3,650 articles, only 22 fulfilled all the inclusion criteria. Table 2 summarizes the ConvNet architectures, their implementation, and reported performance employed in the final 22 articles selected for benchmarking. 6 Table 2: Overview of the 22 articles fulfilling all inclusion criteria. All articles use ConvNets for a dermatological classification task using photographic images. Tasks vary between binary or multi-disease diagnosis, disease risk assessment, lesion type classification, and severity assessment. Publication ConvNets employed Task Data Performance Aggarwal [2019] InceptionV3 Burlina et al. [2019] ResNet50 Zhao et al. [2019] Xception Burlina et al. [2020] ResNet50, ResNet152, InceptionV3, InceptionResNetV2, DenseNet Chin et al. [2020] DenseNet121, VGG16, ResNet50 Han et al. [2020] SENet, SE-ResNet50, VGG19 7 Liu et al. [2020] InceptionV4 Zhao et al. [2020] Wu et al. [2021] DenseNet121, Xception, InceptionV3, InceptionResNetV2 SEResNeXt, SE-ResNet, InceptionV3 Aggarwal and Papay [2022] InceptionResNetV2 Ba et al. [2022] EfficientNet-B3 Hossain et al. [2022] VGG16, VGG19, ResNet50, ResNet50V2, ResNet101, InceptionV3, ResNet101V2, InceptionResNetV2, InceptionV4, Xception, DenseNet121, DenseNet169, DenseNet201, Mo- bileNetV2, MobileNetV3Small, MobileNetV3Large, NASNetMobile, EfficientNet-B0 through EfficientNet- B5 Open source images and images scraped from Google Internet-scraped im- ages Clinical images Clinical and other photographic images scraped using Google and Bing Smartphone images Clinical images 0.66 F1 score, 0.65 sensitivity, 0.91 speci- ficity, 0.67 precision, 0.91 NPV, 0.57 MCC 82.79% accuracy, 0.76 kappa score 72% accuracy, 0.92-0.96 ROC AUC, 0.85- 0.93 sensitivity, 0.85-0.91 specificity 71.58% accuracy, 0.70 sensitivity, 0.96 specificity, 0.72 precision, 0.96 NPV, 0.67 kappa, 0.72 F1 score, 0.80 average preci- sion, 0.94 AUC 0.83-0.86 AUC, 0.72-0.77 sensitivity, 0.85- 0.86 specificity 44.8-56.7% accuracy, 0.94-0.98 AUC Clinical images 66% accuracy, 0.56 sensitivity Disease diagnosis on five classes Disease diagnosis on four classes Skin cancer risk assessment with three classes Disease diagnosis on eight classes Binary skin cancer risk as- sessment Disease classification on 134 classes Disease diagnosis on 26 classes Binary psoriasis classifica- tion Disease diagnosis on five classes Disease diagnosis on four classes Clinical images Clinical images Clinical images Disease diagnosis on 10 classes Binary Lyme disease classifi- cation Clinical images Smartphone images 96% accuracy, 0.95-0.98 AUC, 0.96-0.97 specificity, 0.83-0.95 sensitivity 0.96-0.97 AUC, 90-91% accuracy, 0.90- 0.93 sensitivity, 0.90 specificity 0.60-0.82 sensitivity, 0.60-0.82 specificity, 0.33-0.93 precision, 0.33-0.93 NPV, 0.43- 0.84 F1 score 78.45% accuracy, 0.73 kappa 61.42-84.42% accuracy, 0.72-0.90 sensitiv- ity, 0.50-0.81 specificity, 0.61-0.83 preci- sion, 0.63-0.87 NPV, 0.23-0.69 MCC, 0.22- 0.69 Cohen's kappa, 1.46-4.70 positive like- lihood ratio, 0.14-0.55 negative likelihood ratio, 0.66-0.0.85 F1 score, 0.65-0.92 AUC D e r m a t o l o g i c a l D i a g n o s i s E x p l a i n a b i l i t y B e n c h m a r k f o r C o n v o l u t i o n a l N e u r a l N e t w o r k s A P R E P R I N T Hüsers et al. [2022] MobileNet Liu et al. [2022] InceptionResNetV2 Malihi et al. [2022] Xception Munthuli et al. [2022] DenseNet121 Ni et al. [2022] DenseNet121, ResNet50 Roy et al. [2022] ResNet101 Sahin et al. [2022] Xia et al. [2022] NASNetMobile, ResNet18, GoogleNet, EfficientNet- B0, ShuffleNet, MobileNetV2 ResNet50 Zhou et al. [2022] ResNet50 Zhang and Ma [2022] ResNet50 8 Skin lesion severity classifi- cation with five classes Radiation dermatitis severity classification on four classes Disease diagnosis on 26 classes Binary monkeypox classifi- cation Binary skin cancer classifica- tion Disease diagnosis on three classes Acne severity classification with three classes Binary wound maceration classification Ulcer characteristic diagno- sis on two and three classes Binary wound type classifi- cation Clinical images Clinical images Clinical images Smartphone images Clinical images 69% accuracy, 0.69 sensitivity, 0.67 preci- sion 71.2-99.4% accuracy, 0.68-0.99 sensitivity, 0.71-1.00 precision, 0.70-0.94 F1 score 67-83% accuracy, 0.65-0.94 sensitivity, 0.70-0.75 specificity, 0.65-0.75 precision, 0.70-0.85 F1 score 0.43-0.91 sensitivity, 0.80-0.98 specificity, 0.50-0.87 F1 score 83% accuracy, 0.74-1.00 F1 score Clinical images 62.6% - 75.6% accuracy, 69.3-81.8 AUPR Smartphone images 73.33-91.11% accuracy Smartphone images 0.77-0.82 AUC, 0.76-0.79 AP Clinical images Clinical images 0.32 error rate, 0.68 sensitivity, 0.69 preci- sion, 0.68 F1 score 74% accuracy D e r m a t o l o g i c a l D i a g n o s i s E x p l a i n a b i l i t y B e n c h m a r k f o r C o n v o l u t i o n a l N e u r a l N e t w o r k s A P R E P R I N T Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Figure 3: Distribution of retrieved article topics per publication year, based on the search query defined in Table 1 (ran on the 20th of February 2023). 2017 marks an explosion in the number of deep learning applications in dermatology, a fact highlighted by the large increase in articles in the subsequent years, and an increase in review articles. Starting 2019, the industrial involvement in this field became apparent due to the increase in proprietary ConvNets. 2019 also marks the first emergence of dermatological applications using photographic imaging. Finally, although classification is still the most common application, other applications are becoming increasingly more researched. 4.2 Diagnosis results Table 3 provides an overview of the diagnostic performance of the networks and that of the dermatologists on average in terms of F1 score. As can be seen from the table, although several ConvNets achieve expert-level performance when diagnosing actinic keratosis, seborrheic dermatitis, and viral warts, none of them achieve overall expert-level performance. ConvNets follow the trend also seen in dermatologists of having difficulties correctly diagnosing actinic keratosis and seborrheic dermatitis, while the diagnosis of acne and viral warts displays higher performance. Similar trends can be observed for the sensitivity and specificity performance, as seen in Appendix Table A4 and Appendix Table A5, respectively. 4.3 Explainability results Table 4 shows the image-level explainability results for each of the benchmarked ConvNets, while Figure 4 shows the relationship between ConvNet diagnosis performance, image-level explainability, and number of parameters. Xception scores the highest on the image-level Grad-CAM F1 score, while InceptionResNetV2, ResNet50, and VGG16 have the lowest performance. DenseNet121 and NASNetMobile report expert-level sensitivity scores, while ResNet50V2 achieves expert-level performance in specificity. Looking at the characteristic-level sensitivity depicted in Figure 5, NASNetMobile and DenseNet121 achieve the highest overall performance. InceptionResNetV2, ResNet50, ResNet50V2, and VGG16 report the lowest scores. All ConvNets outperform dermatologists in closed comedo, open comedo, and pustule. The opposite is true for dermatoglyph disruption, leukotrichia, patch, plaque, scale, sun damage, and telangiectasia – no ConvNet reaches expert-level. Figure 6 illustrates the differences in Grad-CAMs between the benchmarked ConvNets. Older ConvNet architectures, such as VGG16, InceptionResNetV2, ResNet50, and ResNet50V2, tend to focus on small areas that contain charac- teristics relevant for the diagnosis, e.g. focusing on a single plaque in the psoriasis diagnosis example, while more modern ConvNets pay attention to the entire area covered by diagnosis-relevant lesions. Several ConvNets, namely 9 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Table 3: Diagnostic performance of the ConvNets (average ± standard deviation across five runs) and dermatolo- gists (average ± standard deviation across eight experts) using F1-score, split by diagnosis. Several ConvNets achieve expert-level per-disease diagnosis performance, in actinic keratosis, seborrheic dermatitis, and viral warts (in bold), although none reach the same performance for acne, psoriasis, and vitiligo. Acne Actinic keratosis Psoriasis Seborrheic dermatitis Viral warts Vitiligo ConvNets DenseNet121 0.80 ± 0.02 0.63 ± 0.08 0.66 ± 0.01 0.69 ± 0.03 0.88 ± 0.03 0.74 ± 0.03 EfficientNet-B0 0.72 ± 0.03 0.53 ± 0.10 0.60 ± 0.06 0.57 ± 0.08 0.80 ± 0.07 0.66 ± 0.02 InceptionV3 0.77 ± 0.02 0.57 ± 0.11 0.60 ± 0.02 0.54 ± 0.03 0.77 ± 0.04 0.73 ± 0.05 InceptionResNetV2 0.73 ± 0.02 0.52 ± 0.10 0.53 ± 0.05 0.56 ± 0.05 0.69 ± 0.03 0.53 ± 0.12 MobileNet MobileNetV2 0.72 ± 0.06 0.55 ± 0.19 0.51 ± 0.14 0.57 ± 0.06 0.68 ± 0.06 0.56 ± 0.10 0.56 ± 0.07 0.23 ± 0.09 0.31 ± 0.08 0.46 ± 0.05 0.63 ± 0.07 0.48 ± 0.14 NASNetMobile 0.50 ± 0.05 0.33 ± 0.12 0.42 ± 0.07 0.43 ± 0.05 0.55 ± 0.11 0.51 ± 0.05 ResNet50 ResNet50V2 VGG16 Xception Dermatologists 0.77 ± 0.04 0.53 ± 0.17 0.61 ± 0.03 0.61 ± 0.19 0.79 ± 0.02 0.61 ± 0.07 0.76 ± 0.04 0.62 ± 0.07 0.59 ± 0.01 0.57 ± 0.01 0.76 ± 0.01 0.75 ± 0.05 0.70 ± 0.05 0.62 ± 0.03 0.59 ± 0.03 0.49 ± 0.15 0.71 ± 0.03 0.62 ± 0.07 0.80 ± 0.04 0.64 ± 0.07 0.70 ± 0.02 0.60 ± 0.03 0.81 ± 0.04 0.81 ± 0.05 Average 0.95 ± 0.02 0.79 ± 0.14 0.85 ± 0.06 0.72 ± 0.09 0.93 ± 0.05 0.96 ± 0.03 EfficientNet-B0, MobileNet, MobileNetV2, and VGG16 seem to have overfit on the training set, focusing on the watermark rather than the image itself when diagnosing the vitiligo case. 5 Discussion 5.1 Literature review ConvNets have become a default approach when it comes to automated diagnosis using images, aligned with the rise of the deep learning methodology for vision recognition. The continuous breakthroughs in diagnostic performance across a wide variety of medical imaging modalities and disorders have made automated diagnosis as close to integration with practice as ever. In dermatology, the diagnosis performance has achieved that of the expert raters as early as 2017 with a seminal work of Esteva et al. [2017] that disrupted the research field and set the trend that still persists, as can be seen through the trends of the continuous growth outlined in Figure 3. The increased interest of industrial entities that started in 2019, illustrated in Figure 3 by the increase in proprietary methods, is further highlighted by the large number of dermatology-oriented med-tech companies relying on machine learning for their products. Year 2019 also marks the year when research groups began investigating photographic images as a primary modality for diagnosing skin conditions, meaning the rise of machine learning solutions to assist teledermatology. The potential of using ConvNets to streamline dermatological tasks is underlined by the diversity of tasks being solved in the retrieved articles. Classification was the first methodology to be approached, with applications in disease diagnosis, risk assessment, lesion type classification, lesion characteristics identification, and disease severity assessment. Segmentation and natural language processing applications are also gaining more traction, as shown by the constant increase in non-classification tasks in Figure 3. However, this potential has not yet translated into the much-needed transformation of the clinical practice. In part, this is due to regulatory challenges which are often faced due to the limited generalizability and lack of explainability of the methods [Kelly et al., 2019]. By benchmarking the diagnosis and explainability performance of ConvNets, we both 10 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Figure 4: ConvNet explainability as a function of ConvNet performance and their number of parameters. Xception displays both the highest performance and image-level explainability, while ResNet50 performs poorly in both criteria. enable a comparison among the methods, as well as help the identification gaps between the current state-of-the-art and the clinical practice. 5.2 Diagnosis benchmark The direct comparison of the diagnostic performance is not possible using reported values from the literature not only due to variability in the choice of the metrics, but more importantly due to the variance in the number of classes and the differences in the datasets used for training and validation (Table 2). By reformulating the task to the diagnosis of six disease classes, utilizing the same initialization, pre-training, and hyperparameter optimization search strategy, and training and validating on the common database, this benchmark minimizes the performance variability related to such implementation details. We found considerable variability among the diagnostic performance values, with the average F1 scores ranging from 0.50 to 0.80 for acne, from 0.23 to 0.64 for actinic keratosis, from 0.31 to 0.70 for psoriasis, from 0.43 to 0.69 for seborrheic dermatitis, from 0.55 to 0.88 for viral warts, and from 0.51 to 0.81 for vitiligo. These values were aligned with the diagnostic complexity of the diseases as expressed by the performance of the dermatologists, averaging 0.95 for acne, 0.79 for actinic keratosis, 0.85 for psoriasis, 0.72 for seborrheic dermatitis, 0.93 for viral warts, and 0.96 for vitiligo. As such, none of the ConvNets achieved the average dermatologist performance, although there were multiple instances of ConvNets reaching the range of the expert performance for a specific disease (see Table 3). The majority of the benchmarked ConvNets achieved expert level for diagnosis of actinic keratosis and seborrheic dermatitis: seven and six out of 11, respectively. This further confirms the similarity of ConvNet performance with respect to the dermatologists: most ConvNets display a similar difficulty in diagnosing actinic keratosis and seborrheic dermatitis as the eight dermatologists, and a similar ease of diagnosing acne and viral warts. 5.3 Explainability benchmark While diagnostic performance is recognized as critical for the generalizability of ConvNets, the explainability perfor- mance validation has been generally approached as an optional, qualitative, post-hoc analysis. One of the key challenges 11 NASNetMobile (5,3M)Xception (22,9M)InceptionV3 (23,9M)DenseNet121 (8,1M)EfficientNet-B0 (5,3M)MobileNetV2 (3,5M)MobileNet (4,3M)ResNet50V2 (25,6M)VGG16 (138,4M)InceptionResNetV2 (55,9M)ResNet50 (25,6M) Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Table 4: Explainability performance in terms of the image-level Grad-CAM evaluation for the ConvNets (average ± standard deviation across five runs), and an explanation map evaluation dermatologists (average ± standard deviation across eight experts). Older ConvNets, such as ResNet50, ResNet50V2, and VGG16, have lower performance than most other modern ConvNets. Two networks achieve expert-level sensitivity scores, and one achieves expert-level specificity (in bold). F1 score Sensitivity Specificity ConvNets DenseNet121 0.43 ± 0.01 0.61 ± 0.01 0.78 ± 0.00 EfficientNet-B0 0.39 ± 0.01 0.52 ± 0.00 0.82 ± 0.00 InceptionV3 0.42 ± 0.01 0.56 ± 0.01 0.82 ± 0.01 InceptionResNetV2 0.35 ± 0.01 0.40 ± 0.01 0.87 ± 0.01 MobileNet MobileNetV2 0.37 ± 0.02 0.50 ± 0.01 0.85 ± 0.01 0.38 ± 0.02 0.49 ± 0.02 0.87 ± 0.01 NASNetMobile 0.44 ± 0.00 0.62 ± 0.00 0.81 ± 0.00 ResNet50 ResNet50V2 VGG16 Xception Dermatologists 0.35 ± 0.01 0.42 ± 0.03 0.84 ± 0.01 0.37 ± 0.01 0.38 ± 0.01 0.91 ± 0.00 0.35 ± 0.01 0.40 ± 0.01 0.86 ± 0.01 0.46 ± 0.01 0.56 ± 0.00 0.88 ± 0.01 Average 0.66 ± 0.03 0.67 ± 0.07 0.93 ± 0.03 faced by researchers trying to implement a more objective validation of explainability is linking the human-approachable explanations with those feasible for ConvNets. With the use of the labels for dermatological diagnosis explainability available from the recently released DermXDB dataset, our benchmark is quantitative as well as predefined. Thus, we avoid potential biases and limitations stemming from machine learning experts with little domain knowledge performing a visual, qualitative evaluation of Grad-CAMs [Tschandl et al., 2020]. The image-level explainability analysis shows that no ConvNet reaches the same F1 score as the dermatologists, although several ConvNets achieve expert-level sensitivity or specificity. Different ConvNets show different patterns of explanation behaviour (Figure 6): some tend to focus on smaller areas that are highly indicative of the target diagnosis, while others tend to focus on the entire affected area. Extensive user tests with both experts and patients would enable us to learn which of the two options is preferred as an explanation: a single, classical lesion descriptive of the diagnosis, or highlighting the entire affected area. From a characteristic-level sensitivity perspective, most ConvNets outperform the average dermatologist performance in characteristics smaller than 1cm in diameter [Nast et al., 2016]. For larger characteristics, although NASNetMobile and Xception approach expert-level, no ConvNet exceeds it. The relationship between diseases and their characteristics is visible in the characteristic-level ConvNet explainability: most ConvNets report high sensitivity on characteristics often associated with acne and viral warts (e.g. closed and open comedones, papules, and thrombosed capillaries), while reporting a lower performance on characteristics associated with actinic keratosis and seborrheic dermatitis (e.g. plaque, sun damage, and patch). Characteristic-level explainability may be more relevant for use cases where identifying the differentiating factor between different diseases is the most important component for garnering trust. These result suggests that while ConvNets have the potential to produce human-approachable explanations, more work is necessary to fully achieve expert-level performance. Part of the necessary work is the creation of additional user-derived explainability datasets that enable quantitative analyses on a ConvNet's explainability within a domain. A component of this is performing extensive user tests to identify the explainability expectations of an application's end users. From a machine learning perspective, more research must be devoted to the creation of instrinsically explainable ConvNets, rather than relying solely on post-hoc explanation methods. Such a ConvNet must be aligned with the explainability requirements of its task and its users: a psoriasis diagnosis ConvNet aimed at dermatologists might 12 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Figure 5: Explainability performance in terms of characteristic-level Grad-CAM sensitivity for the ConvNets (averaged across five runs) and dermatologists (averaged across eight experts). NASNetMobile and Xception outperform expert level in seven characteristics, while no ConvNet achieves expert-level performance in eight characteristics. require high characteristic-level explainability to offer a constrative explanation against a possible differential diagnosis of atopic dermatitis, while the same ConvNet aimed at patients might require high image-level explainability to reassure the patient that all aspects of their condition are taken into consideration. 5.4 Limitations and future work Our work has a few limitations. First, the original DermXDB dataset contains little information about the gender, age, and ethnicity of the subjects, leading to difficulties in performing an in-depth bias analysis of our benchmark. Second, the small size of the dataset limits the training capabilities of our benchmark, which may underestimate the performance of the larger ConvNets. In future work, we plan on expanding this benchmark by using more explainability methods, such as saliency maps and LIME, to also create a benchmark of explainability methods and their performance compared to that of dermatologists. Additionally, with the increased popularity of visual transformers [Khan et al., 2022], an analysis of their Grad-CAM explainability would be of interest to the research world. 13 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Figure 6: Example of Grad-CAM outputs for six images that were correctly diagnosed by all ConvNets. Older ConvNets, such as VGG16, ResNet50, ResNet50V2, and InceptionResNetV2, tend to focus on a single, highly indicative lesion rather than the whole affected region. More modern ConvNets, such as NASNetMobile, Xception, and EfficientNet, focus on the entire affected area. Some ConvNets overfitted during training, and focus on the watermark when diagnosing vitiligo. 14 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT 6 Conclusions In this paper, we performed a systematic literature review to identify the most used ConvNet architectures for the diagnosis of skin diseases from photographic images. We benchmarked the 11 identified ConvNets on DermXDB, a skin disease explainability dataset. Xception stands out as a highly explainable ConvNet, although NASNetMobile outperforms it on characteristic-level sensitivity. Our findings highlight the importance of explainability benchmarking, and will hopefully motivate additional studies within the field of quantitative evaluations for explainability. Acknowledgments Funding: RJ's work was supported in part by the Danish Innovation Fund under Grant 0153-00154A. OW's work was funded in part by the Novo Nordisk Foundation through the Center for Basic Machine Learning Research in Life Science (NNF20OC0062606). OW acknowledges support from the Pioneer Centre for AI, DNRF grant number P1. References World Health Organization. Working for health and growth: investing in the health workforce. 2016. U.S. Food and Drug Administration. FDA permits marketing of artificial intelligence-based device to detect certain diabetes-related eye problems. News Release, April, 2018. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Communications of the ACM, 60(6):84–90, 2017. Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. Jun Gao, Qian Jiang, Bo Zhou, and Daozheng Chen. Convolutional neural networks for computer-aided detection or diagnosis in medical image analysis: an overview. Mathematical Biosciences and Engineering, 16(6):6536–6561, 2019. Thorsten Falk, Dominic Mai, Robert Bensch, Özgün Çiçek, Ahmed Abdulkadir, Yassine Marrakchi, Anton Böhm, Jan Deubner, Zoe Jäckel, Katharina Seiwald, et al. U-net: deep learning for cell counting, detection, and morphometry. Nature Methods, 16(1):67–70, 2019. Varun Gulshan, Lily Peng, Marc Coram, Martin C Stumpe, Derek Wu, Arunachalam Narayanaswamy, Subhashini Venugopalan, Kasumi Widner, Tom Madams, Jorge Cuadros, et al. Development and validation of a deep learning algorithm for detection of diabetic retinopathy in retinal fundus photographs. JAMA, 316(22):2402–2410, 2016. Richard Kijowski, Fang Liu, Francesco Caliva, and Valentina Pedoia. Deep learning for lesion detection, progression, and prediction of musculoskeletal disease. Journal of Magnetic Resonance Imaging, 52(6):1607–1619, 2020. Mohammad Hesam Hesamian, Wenjing Jia, Xiangjian He, and Paul Kennedy. Deep learning techniques for medical image segmentation: achievements and challenges. Journal of Digital Imaging, 32:582–596, 2019. KKD Ramesh, G Kiran Kumar, K Swapna, Debabrata Datta, and S Suman Rajest. A review of medical image segmentation algorithms. EAI Endorsed Transactions on Pervasive Health and Technology, 7(27):e6–e6, 2021. Andre Esteva, Brett Kuprel, Roberto A Novoa, Justin Ko, Susan M Swetter, Helen M Blau, and Sebastian Thrun. Dermatologist-level classification of skin cancer with deep neural networks. Nature, 542(7639):115–118, 2017. Jianpeng Zhang, Yutong Xie, Yong Xia, and Chunhua Shen. Attention residual learning for skin lesion classification. IEEE Transactions on Medical Imaging, 38(9):2092–2103, 2019. Shunichi Jinnai, Naoya Yamazaki, Yuichiro Hirano, Yohei Sugawara, Yuichiro Ohe, and Ryuji Hamamoto. The development of a skin cancer classification system for pigmented skin lesions using deep learning. Biomolecules, 10 (8):1123, 2020. Holger Andreas Haenssle, Christine Fink, Ferdinand Toberer, Julia Winkler, Wilhelm Stolz, Teresa Deinlein, Rainer Hofmann-Wellenhof, Aimilios Lallas, Steffen Emmert, Timo Buhl, et al. Man against machine reloaded: performance of a market-approved convolutional neural network in classifying a broad spectrum of skin lesions in comparison with 96 dermatologists working under less artificial conditions. Annals of Oncology, 31(1):137–143, 2020. Abhijit Guha Roy, Jie Ren, Shekoofeh Azizi, Aaron Loh, Vivek Natarajan, Basil Mustafa, Nick Pawlowski, Jan Freyberg, Yuan Liu, Zach Beaver, et al. Does your dermatology classifier know what it doesn't know? detecting the long-tail of unseen conditions. Medical Image Analysis, 75:102274, 2022. 15 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Christopher J Kelly, Alan Karthikesalingam, Mustafa Suleyman, Greg Corrado, and Dominic King. Key challenges for delivering clinical impact with artificial intelligence. BMC Medicine, 17(1):1–9, 2019. Bryce Goodman and Seth Flaxman. European union regulations on algorithmic decision-making and a "right to explanation". AI Magazine, 38(3):50–57, 2017. Xiao Bai, Xiang Wang, Xianglong Liu, Qiang Liu, Jingkuan Song, Nicu Sebe, and Been Kim. Explainable deep learning for efficient and robust pattern recognition: A survey of recent developments. Pattern Recognition, 120: 108102, 2021. Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-CAM: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE International Conference on Computer Vision, pages 618–626, 2017. Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. Advances in Neural Information Processing Systems, 30, 2017. Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "Why should I trust you?" Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1135–1144, 2016. Raluca Jalaboi, Frederik Faye, Mauricio Orbes-Arteaga, Dan Jøgensen, Ole Winther, and Alfiia Galimzianova. Dermx: an end-to-end framework for explainable automated dermatological diagnosis. Medical Image Analysis, page 102647, 2022. Kenneth Thomsen, Lars Iversen, Therese Louise Titlestad, and Ole Winther. Systematic review of machine learn- ing for diagnosis and prognosis in dermatology. Journal of Dermatological Treatment, 31(5):496–510, 2020. doi:https://doi.org/10.1080/09546634.2019.1682500. Hyeon Ki Jeong, Christine Park, Ricardo Henao, and Meenal Kheterpal. Deep learning in dermatology: a systematic review of current approaches, outcomes and limitations. JID Innovations, page 100150, 2022. Zhao Liu, Jiuai Sun, Lyndon Smith, Melvyn Smith, and Robert Warr. Distribution quantification on dermoscopy images for computer-assisted diagnosis of cutaneous melanomas. Medical & Biological Engineering & Computing, 50(5): 503–513, 2012. Peyman Sabouri, Hamid GholamHosseini, Thomas Larsson, and John Collins. A cascade classifier for diagnosis of melanoma in clinical images. In 2014 36th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, pages 6748–6751. IEEE, 2014. Ravneet Kaur, Peter P Albano, Justin G Cole, Jason Hagerty, Robert W LeAnder, Randy H Moss, and William V Stoecker. Real-time supervised detection of pink areas in dermoscopic images of melanoma: importance of color shades, texture and location. Skin Research and Technology, 21(4):466–473, 2015. S Kefel, S Pelin Kefel, RW LeAnder, R Kaur, R Kasmi, NK Mishra, RK Rader, JG Cole, ZT Woolsey, and WV Stoecker. Adaptable texture-based segmentation by variance and intensity for automatic detection of semitranslucent and pink blush areas in basal cell carcinoma. Skin Research and Technology, 22(4):412–422, 2016. Kouhei Shimizu, Hitoshi Iyatomi, M Emre Celebi, Kerri-Ann Norton, and Masaru Tanaka. Four-class classification of skin lesions with task decomposition strategy. IEEE Transactions on Biomedical Engineering, 62(1):274–283, 2014. Jose Luis García Arroyo and Begoña García Zapirain. Detection of pigment network in dermoscopy images using supervised machine learning and structural analysis. Computers in Biology and Medicine, 44:144–157, 2014. Vimal K Shrivastava, Narendra D Londhe, Rajendra S Sonawane, and Jasjit S Suri. Computer-aided diagnosis of psoriasis skin images with hos, texture and color features: a first comparative study of its kind. Computer Methods and Programs in Biomedicine, 126:98–109, 2016. Noel CF Codella, David Gutman, M Emre Celebi, Brian Helba, Michael A Marchetti, Stephen W Dusza, Aadi Kalloo, Konstantinos Liopyris, Nabin Mishra, Harald Kittler, et al. Skin lesion analysis toward melanoma detection: A challenge at the 2017 International Symposium on Biomedical Imaging (ISBI), hosted by the International Skin Imaging Collaboration (ISIC). In 2018 IEEE 15th International Symposium on Biomedical Imaging (ISBI 2018), pages 168–172. IEEE, 2018. Xiaoxiao Sun, Jufeng Yang, Ming Sun, and Kai Wang. A benchmark for automatic visual classification of clinical skin disease images. In European Conference on Computer Vision, pages 206–222. Springer, 2016. DermNetNZ. DermNetNZ. https://dermnetnz.org/, 2021. Accessed: 2021-04-01. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255. Ieee, 2009. 16 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT P Tschandl, H Kittler, and G Argenziano. A pretrained neural network shows similar diagnostic accuracy to medical students in categorizing dermatoscopic images after comparable training conditions. British Journal of Dermatology, 177(3):867–869, 2017. Seung Seog Han, Gyeong Hun Park, Woohyung Lim, Myoung Shin Kim, Jung Im Na, Ilwoo Park, and Sung Eun Chang. Deep neural networks show an equivalent and often superior performance to dermatologists in onychomycosis diagnosis: Automatic construction of onychomycosis datasets by region-based convolutional deep neural network. PloS One, 13(1):e0191493, 2018. G Reshma, Chiai Al-Atroshi, V Kumar Nassa, B Geetha, Gurram Sunitha, Mohammad Gouse Galety, and S Neelakan- dan. Deep learning-based skin lesion diagnosis model using dermoscopic images. Intelligent Automation and Soft Computing, 31(1):621–634, 2022. Yading Yuan, Ming Chao, and Yeh-Chi Lo. Automatic skin lesion segmentation using deep fully convolutional networks with jaccard distance. IEEE Transactions on Medical Imaging, 36(9):1876–1886, 2017. Huisi Wu, Shihuai Chen, Guilian Chen, Wei Wang, Baiying Lei, and Zhenkun Wen. Fat-net: Feature adaptive transformers for automated skin lesion segmentation. Medical Image Analysis, 76:102327, 2022. Ramsha Baig, Maryam Bibi, Anmol Hamid, Sumaira Kausar, and Shahzad Khalid. Deep learning approaches towards skin lesion segmentation and classification from dermoscopic images-a review. Current Medical Imaging, 16(5): 513–533, 2020. Philipp Tschandl, Christoph Rinner, Zoe Apalla, Giuseppe Argenziano, Noel Codella, Allan Halpern, Monika Janda, Aimilios Lallas, Caterina Longo, Josep Malvehy, et al. Human–computer collaboration for skin cancer recognition. Nature Medicine, 26(8):1229–1234, 2020. Masaya Tanaka, Atsushi Saito, Kosuke Shido, Yasuhiro Fujisawa, Kenshi Yamasaki, Manabu Fujimoto, Kohei Murao, Youichirou Ninomiya, Shin'ichi Satoh, and Akinobu Shimizu. Classification of large-scale image database of various skin diseases using deep learning. International Journal of Computer Assisted Radiology and Surgery, 16:1875–1887, 2021. Ribana Roscher, Bastian Bohn, Marco F Duarte, and Jochen Garcke. Explainable machine learning for scientific insights and discoveries. IEEE Access, 8:42200–42216, 2020. Amitojdeep Singh, Sourya Sengupta, and Vasudevan Lakshminarayanan. Explainable deep learning models in medical image analysis. Journal of Imaging, 6(6):52, 2020. Stan Lipovetsky and Michael Conklin. Analysis of regression in game theory approach. Applied Stochastic Models in Business and Industry, 17(4):319–330, 2001. Mara Graziani, Iam Palatnik de Sousa, Marley MBR Vellasco, Eduardo Costa da Silva, Henning Müller, and Vincent Andrearczyk. Sharpening local interpretable model-agnostic explanations for histopathology: Improved understand- ability and reliability. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 540–549. Springer, 2021. Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations, 2015. Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014. Sebastian Bach, Alexander Binder, Grégoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS One, 10(7):e0130140, 2015. Sérgio Pereira, Raphael Meier, Victor Alves, Mauricio Reyes, and Carlos A Silva. Automatic brain tumor grading from mri data using convolutional neural networks and quality assessment. In Understanding and Interpreting Machine Learning in Medical Image Computing Applications, pages 106–114. Springer, 2018. Kyle Young, Gareth Booth, Becks Simpson, Reuben Dutton, and Sally Shrapnel. Deep neural network or dermatologist? In Interpretability of Machine Intelligence in Medical Image Computing and Multimodal Learning for Clinical Decision Support, pages 48–55. Springer, 2019. Tobias Hepp, Dominik Blum, Karim Armanious, Bernhard Schoelkopf, Darko Stern, Bin Yang, and Sergios Gatidis. Uncertainty estimation and explainability in deep learning-based age estimation of the human brain: Results from the german national cohort mri study. Computerized Medical Imaging and Graphics, 92:101967, 2021. Raluca Jalaboi, Ole Winther, and Alfiia Galimzianova. Explainable image quality assessments in teledermatological photography. Telemedicine and e-Health, 2023. 17 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT William R Crum, Oscar Camara, and Derek L G Hill. Generalized overlap measures for evaluation and validation in medical image analysis. IEEE Transactions on Medical Imaging, 25(11):1451–1461, 2006. François Chollet. keras. https://github.com/fchollet/keras, 2015. Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1–9, 2015. Artem Babenko and Victor Lempitsky. Aggregating deep convolutional features for image retrieval. arXiv preprint arXiv:1510.07493, 2015. Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al. Searching for mobilenetv3. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1314–1324, 2019. Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 7132–7141, 2018. Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6848–6856, 2018. Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4700–4708, 2017. Mingxing Tan and Quoc Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105–6114. PMLR, 2019. Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In Thirty-first AAAI Conference on Artificial Intelligence, 2017. Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2818–2826, 2016. Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4510–4520, 2018. Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8697–8710, 2018. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016a. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pages 630–645. Springer, 2016b. François Chollet. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1251–1258, 2017. 1st Lt Pushkar Aggarwal. Data augmentation in dermatology image recognition using machine learning. Skin Research and Technology, 25(6):815–820, 2019. Philippe M Burlina, Neil J Joshi, Elise Ng, Seth D Billings, Alison W Rebman, and John N Aucott. Automated detection of erythema migrans and other confounding skin lesions via deep learning. Computers in Biology and Medicine, 105:151–156, 2019. Xin-yu Zhao, Xian Wu, Fang-fang Li, Yi Li, Wei-hong Huang, Kai Huang, Xiao-yu He, Wei Fan, Zhe Wu, Ming-liang Chen, et al. The application of deep learning in the risk grading of skin tumors for patients using clinical images. Journal of Medical Systems, 43(8):1–7, 2019. Philippe M Burlina, Neil J Joshi, Phil A Mathew, William Paul, Alison W Rebman, and John N Aucott. Ai-based detection of erythema migrans and disambiguation against other skin lesions. Computers in Biology and Medicine, 125:103977, 2020. 18 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT YPH Chin, ZY Hou, MY Lee, HM Chu, HH Wang, YT Lin, A Gittin, SC Chien, PA Nguyen, LC Li, et al. A patient-oriented, general-practitioner-level, deep-learning-based cutaneous pigmented lesion risk classifier on a smartphone. The British Journal of Dermatology, 182(6):1498–1500, 2020. Seung Seog Han, Ilwoo Park, Sung Eun Chang, Woohyung Lim, Myoung Shin Kim, Gyeong Hun Park, Je Byeong Chae, Chang Hun Huh, and Jung-Im Na. Augmented intelligence dermatology: deep neural networks empower medical professionals in diagnosing skin cancer and predicting treatment options for 134 skin disorders. Journal of Investigative Dermatology, 140(9):1753–1761, 2020. Yuan Liu, Ayush Jain, Clara Eng, David H Way, Kang Lee, Peggy Bui, Kimberly Kanada, Guilherme de Oliveira Mar- inho, Jessica Gallegos, Sara Gabriele, et al. A deep learning system for differential diagnosis of skin diseases. Nature Medicine, 26(6):900–908, 2020. Shuang Zhao, Bin Xie, Yi Li, X-y Zhao, Yehong Kuang, Juan Su, X-y He, Xian Wu, Wei Fan, Kai Huang, et al. Smart identification of psoriasis by images using convolutional neural networks: a case study in china. Journal of the European Academy of Dermatology and Venereology, 34(3):518–524, 2020. Haijing Wu, Heng Yin, Haipeng Chen, Moyuan Sun, Xiaoqing Liu, Yizhou Yu, Yang Tang, Hai Long, Bo Zhang, Jing Zhang, et al. A deep learning-based smartphone platform for cutaneous lupus erythematosus classification assistance: Simplifying the diagnosis of complicated diseases. Journal of the American Academy of Dermatology, 85 (3):792–793, 2021. Pushkar Aggarwal and Francis A Papay. Artificial intelligence image recognition of melanoma and basal cell carcinoma in racially diverse populations. Journal of Dermatological Treatment, 33(4):2257–2262, 2022. Wei Ba, Huan Wu, Wei W Chen, Shu H Wang, Zi Y Zhang, Xuan J Wei, Wen J Wang, Lei Yang, Dong M Zhou, Yi X Zhuang, et al. Convolutional neural network assistance significantly improves dermatologists' diagnosis of cutaneous tumours using clinical images. European Journal of Cancer, 169:156–165, 2022. Sk Imran Hossain, Jocelyn de Goër de Herve, Md Shahriar Hassan, Delphine Martineau, Evelina Petrosyan, Violaine Corbin, Jean Beytout, Isabelle Lebert, Jonas Durand, Irene Carravieri, et al. Exploring convolutional neural networks with transfer learning for diagnosing lyme disease from skin lesion images. Computer Methods and Programs in Biomedicine, 215:106624, 2022. Jens Hüsers, Guido Hafer, Jan Heggemann, Stefan Wiemeyer, Mareike Przysucha, Joachim Dissemond, Maurice Moelleken, Cornelia Erfurt-Berge, and Ursula Hübner. Automatic classification of diabetic foot ulcer images–a transfer-learning approach to detect wound maceration. In Informatics and Technology in Clinical Care and Public Health, pages 301–304. IOS Press, 2022. Tom J Liu, Mesakh Christian, Yuan-Chia Chu, Yu-Chun Chen, Che-Wei Chang, Feipei Lai, and Hao-Chih Tai. A pressure ulcers assessment system for diagnosis and decision making using convolutional neural networks. Journal of the Formosan Medical Association, 121(11):2227–2236, 2022. Leila Malihi, Jens Hüsers, Mats L Richter, Maurice Moelleken, Mareike Przysucha, Dorothee Busch, Jan Heggemann, Guido Hafer, Stefan Wiemeyer, Gunther Heidemann, et al. Automatic wound type classification with convolutional neural networks. Advances in Informatics, Management and Technology in Healthcare, 295:281, 2022. A Munthuli, J Intanai, P Tossanuch, P Pooprasert, P Ingpochai, S Boonyasatian, K Kittithammo, P Thammarach, T Boonmak, S Khaengthanyakan, et al. Extravasation screening and severity prediction from skin lesion image using deep neural networks. In 2022 44th Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), pages 1827–1833. IEEE, 2022. Ruiyan Ni, Ta Zhou, Ge Ren, Yuanpeng Zhang, Dongrong Yang, Victor CW Tam, Wan Shun Leung, Hong Ge, Shara WY Lee, and Jing Cai. Deep learning-based automatic assessment of radiation dermatitis in patients with nasopharyngeal carcinoma. International Journal of Radiation Oncology* Biology* Physics, 113(3):685–694, 2022. Veysel Harun Sahin, Ismail Oztel, and Gozde Yolcu Oztel. Human monkeypox classification from skin lesion images with deep pre-trained network using mobile application. Journal of Medical Systems, 46(11):79, 2022. Meng Xia, Meenal K Kheterpal, Samantha C Wong, Christine Park, William Ratliff, Lawrence Carin, and Ricardo Henao. Lesion identification and malignancy prediction from clinical dermatological images. Scientific Reports, 12 (1):15836, 2022. Jiancun Zhou, Zheng Wu, Zixi Jiang, Kai Huang, Kehua Guo, and Shuang Zhao. Background selection schema on deep learning-based classification of dermatological disease. Computers in Biology and Medicine, 149:105966, 2022. Hang Zhang and Tianyi Ma. Acne detection by ensemble neural networks. Sensors, 22(18):6828, 2022. Alexander Nast, Chris EM Griffiths, Roderick Hay, Wolfram Sterry, and Jean L Bolognia. The 2016 international league of dermatological societies' revised glossary for the description of cutaneous lesions. British Journal of Dermatology, 174(6):1351–1358, 2016. 19 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Salman Khan, Muzammal Naseer, Munawar Hayat, Syed Waqas Zamir, Fahad Shahbaz Khan, and Mubarak Shah. Transformers in vision: A survey. ACM Computing Surveys (CSUR), 54(10s):1–41, 2022. 20 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Appendix Table A1 presents statistics for the proprietary clinical dataset used in the hyper-parameter search and the pre-training step. Table A2 shows the best performing list of parameters identified for each ConvNet. The search space consisted of the following values for each hyperparameter: • Rotation: 10, 20 • Shear: 0.00, 0.25, 0.50 • Zoom: 0.25, 0.5 • Brightness ranges: 0.00-0.50, 0.00-0.25, 0.50-1.00, 0.50-1.50, 0.75-1.25 • Learning rate: 0.01, 0.001, 0.0001 • Last fixed layer: last convolutional layer, second to last convolutional block • Epochs: 10, 25, 50, 75 Table A1: Dataset statistics for the proprietary pre-training clinical dataset. Diagnosis Training Validation Acne Actinic keratosis Psoriasis Seborrheic dermatitis Viral warts Vitiligo 832 132 771 88 509 141 245 33 204 25 97 37 Table A2: Optimal list of hyperparameters for each ConvNet, as identified after a hyper-parameter search. ConvNet Rotation Shear Zoom Brightness Learning rate Last fixed layer Epochs DenseNet121 EfficientNet-B0 InceptionV3 InceptionResNetv2 MobileNet MobileNetV2 NASNetMobile ResNet50 ResNet50V2 VGG16 Xception 20 20 20 20 10 10 20 20 20 10 10 0.50 0.25 0.50 0.25 0.50 0.25 0.25 0.50 0.25 0.00 0.25 0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.25 0.25 0.50 [0.50, 1.50] [0.50, 1.50] [0.50, 1.50] [0.75, 1.25] [0.50, 1.50] [0.50, 1.50] [0.50, 1.00] [0.50, 1.50] [0.50, 1.00] [0.50, 1.00] [0.50, 1.50] 0.0001 conv5_block14_concat 0.0001 block6d_add 0.001 activation288 0.0001 block8_9_ac 0.0001 conv_pw_12_relu 0.0001 block_15_add 0.0001 normal_concat_11 0.0001 conv5_block3_out 0.001 post_relu 0.01 block5_pool 0.001 block14_sepconv2_act 75 50 50 50 50 75 75 50 75 75 50 21 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Table A3: Diagnostic performance of ConvNets in terms macro F1-score, sensitivity, and specificity on the validation subset of the proprietary clinical dataset (average ± standard deviation across five runs). ConvNet F1-score Sensitivity Specificity DenseNet121 0.80 ± 0.01 0.79 ± 0.01 0.98 ± 0.00 EfficientNet-B0 0.77 ± 0.01 0.78 ± 0.01 0.97 ± 0.00 InceptionV3 0.76 ± 0.02 0.74 ± 0.02 0.96 ± 0.00 InceptionResNetV2 0.73 ± 0.02 0.73 ± 0.02 0.97 ± 0.00 MobileNet 0.72 ± 0.02 0.71 ± 0.02 0.96 ± 0.00 MobileNetV2 0.72 ± 0.03 0.73 ± 0.02 0.96 ± 0.00 NASNetMobile 0.67 ± 0.04 0.64 ± 0.02 0.95 ± 0.01 ResNet50 ResNet50V2 VGG16 Xception 0.70 ± 0.01 0.68 ± 0.02 0.96 ± 0.00 0.76 ± 0.01 0.75 ± 0.02 0.96 ± 0.00 0.66 ± 0.03 0.67 ± 0.01 0.95 ± 0.00 0.82 ± 0.03 0.82 ± 0.02 0.97 ± 0.00 Table A4: Diagnostic performance of ConvNets (average ± standard deviation across five runs) and dermatologists (av- erage ± standard deviation across eight dermatologists) in terms of sensitivity on the DermXDB holdout set, split by diagnosis. Several ConvNets achieve expert-level sensitivity on multiple classes (in bold). Acne Actinic keratosis Psoriasis Seborrheic dermatitis Viral warts Vitiligo ConvNets DenseNet121 0.85 ± 0.03 0.52 ± 0.10 0.71 ± 0.03 0.76 ± 0.05 0.91 ± 0.03 0.66 ± 0.03 EfficientNet-B0 0.71 ± 0.08 0.43 ± 0.09 0.63 ± 0.07 0.64 ± 0.13 0.66 ± 0.05 0.84 ± 0.13 InceptionV3 0.83 ± 0.06 0.55 ± 0.15 0.62 ± 0.08 0.54 ± 0.13 0.70 ± 0.10 0.73 ± 0.12 InceptionResNetV2 0.70 ± 0.06 0.41 ± 0.12 0.62 ± 0.06 0.67 ± 0.11 0.43 ± 0.12 0.74 ± 0.07 MobileNet MobileNetV2 0.76 ± 0.07 0.48 ± 0.22 0.60 ± 0.26 0.66 ± 0.08 0.47 ± 0.17 0.68 ± 0.07 0.88 ± 0.08 0.14 ± 0.06 0.21 ± 0.10 0.63 ± 0.22 0.33 ± 0.14 0.61 ± 0.23 NASNetMobile 0.79 ± 0.07 0.24 ± 0.11 0.33 ± 0.09 0.48 ± 0.09 0.42 ± 0.03 0.48 ± 0.13 ResNet50 ResNet50V2 VGG16 Xception Dermatologists Average 0.79 ± 0.05 0.40 ± 0.16 0.69 ± 0.10 0.74 ± 0.07 0.54 ± 0.13 0.80 ± 0.04 0.85 ± 0.10 0.55 ± 0.13 0.58 ± 0.04 0.61 ± 0.08 0.74 ± 0.07 0.71 ± 0.02 0.74 ± 0.10 0.62 ± 0.09 0.65 ± 0.06 0.44 ± 0.18 0.54 ± 0.11 0.76 ± 0.07 0.89 ± 0.05 0.52 ± 0.08 0.72 ± 0.06 0.61 ± 0.11 0.81 ± 0.05 0.82 ± 0.04 0.95 ± 0.03 0.67 ± 0.18 0.88 ± 0.06 0.59 ± 0.11 0.88 ± 0.09 0.92 ± 0.05 22 Dermatological Diagnosis Explainability Benchmark for Convolutional Neural Networks A PREPRINT Table A5: Diagnostic performance of ConvNets (average ± standard deviation across five runs) and dermatologists (av- erage ± standard deviation across eight dermatologists) in terms of specificity on the DermXDB holdout set, split by diagnosis. Several ConvNets achieve expert-level specificity (in bold). Acne Actinic keratosis Psoriasis Seborrheic dermatitis Viral warts Vitiligo ConvNets DenseNet121 0.93 ± 0.01 0.97 ± 0.01 0.92 ± 0.01 0.91 ± 0.02 0.97 ± 0.01 0.98 ± 0.01 EfficientNet-B0 0.93 ± 0.06 0.96 ± 0.02 0.91 ± 0.01 0.89 ± 0.03 0.95 ± 0.01 0.95 ± 0.01 InceptionV3 0.92 ± 0.03 0.92 ± 0.02 0.92 ± 0.03 0.91 ± 0.06 0.96 ± 0.02 0.97 ± 0.03 InceptionResNetV2 0.94 ± 0.02 0.97 ± 0.01 0.86 ± 0.03 0.86 ± 0.02 0.97 ± 0.01 0.92 ± 0.04 MobileNet MobileNetV2 0.91 ± 0.05 0.96 ± 0.02 0.88 ± 0.07 0.87 ± 0.08 0.97 ± 0.02 0.94 ± 0.02 0.66 ± 0.15 0.99 ± 0.01 0.98 ± 0.03 0.79 ± 0.11 1.00 ± 0.00 0.94 ± 0.07 NASNetMobile 0.65 ± 0.04 0.97 ± 0.01 0.96 ± 0.01 0.86 ± 0.02 0.96 ± 0.03 0.96 ± 0.03 ResNet50 ResNet50V2 VGG16 Xception Dermatologists Average 0.93 ± 0.02 0.99 ± 0.01 0.89 ± 0.04 0.86 ± 0.04 0.97 ± 0.02 0.96 ± 0.01 0.90 ± 0.06 0.95 ± 0.03 0.92 ± 0.01 0.90 ± 0.04 0.96 ± 0.02 0.97 ± 0.01 0.90 ± 0.07 0.92 ± 0.03 0.90 ± 0.05 0.95 ± 0.04 0.97 ± 0.02 0.92 ± 0.03 0.91 ± 0.04 0.98 ± 0.01 0.93 ± 0.02 0.92 ± 0.02 0.97 ± 0.02 0.96 ± 0.03 0.99 ± 0.01 1.00 ± 0.00 0.96 ± 0.02 0.99 ± 0.01 1.00 ± 0.00 1.00 ± 0.00 23
http://arxiv.org/abs/2302.12074v1
2023-02-23T15:01:06
2023-02-23T15:01:06
Active learning for structural reliability analysis with multiple limit state functions through variance-enhanced PC-Kriging surrogate models
Existing active strategies for training surrogate models yield accurate structural reliability estimates by aiming at design space regions in the vicinity of a specified limit state function. In many practical engineering applications, various damage conditions, e.g. repair, failure, should be probabilistically characterized, thus demanding the estimation of multiple performance functions. In this work, we investigate the capability of active learning approaches for efficiently selecting training samples under a limited computational budget while still preserving the accuracy associated with multiple surrogated limit states. Specifically, PC-Kriging-based surrogate models are actively trained considering a variance correction derived from leave-one-out cross-validation error information, whereas the sequential learning scheme relies on U-function-derived metrics. The proposed active learning approaches are tested in a highly nonlinear structural reliability setting, whereas in a more practical application, failure and repair events are stochastically predicted in the aftermath of a ship collision against an offshore wind substructure. The results show that a balanced computational budget administration can be effectively achieved by successively targeting the specified multiple limit state functions within a unified active learning scheme.
[ "J. Moran A.", "P. G. Morato", "P. Rigo" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12074v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12074v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "stat.AP", "stat.CO" ]
Active learning for structural reliability analysis with multiple limit state functions through variance-enhanced PC-Kriging surrogate models J. Mor ́an A.a,∗, P.G. Moratob, P. Rigoa aANAST, Department of ArGEnCo, University of Liege, 4000, Liege, Belgium bDepartment of Wind and Energy Systems, Technical University of Denmark, 4000 Roskilde, Denmark 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 4 7 0 2 1 . 2 0 3 2 : v i X r a Abstract Existing active strategies for training surrogate models yield accurate structural reliability estimates by aiming at design space regions in the vicinity of a specified limit state function. In many practical engineering applications, various damage condi- tions, e.g. repair, failure, should be probabilistically characterized, thus demanding the estimation of multiple performance functions. In this work, we investigate the capability of active learning approaches for efficiently selecting training samples under a limited computational budget while still preserving the accuracy associated with multiple surrogated limit states. Specifically, PC-Kriging-based surrogate models are actively trained considering a variance correction derived from leave- one-out cross-validation error information, whereas the sequential learning scheme relies on U-function-derived metrics. The proposed active learning approaches are tested in a highly nonlinear structural reliability setting, whereas in a more practi- cal application, failure and repair events are stochastically predicted in the aftermath of a ship collision against an offshore wind substructure. The results show that a balanced computational budget administration can be effectively achieved by successively targeting the specified multiple limit state functions within a unified active learning scheme. Keywords: Active learning; Gaussian Processes; Structural reliability; Surrogate modeling; Offshore wind turbines; Polynomial chaos expansion. 1. INTRODUCTION An optimized design and management of engineering sys- tems from a life-cycle perspective aims at jointly minimizing maintenance costs and structural failure risk, quantified via economic and structural reliability metrics [1]. To probabilis- tically characterize a failure event and/or a specific damage condition, one or multiple performance functions can be ac- cordingly formulated, thereby accounting for the uncertainty associated with system response predictions and informing asset management decisions. The quantification of uncertain- ties associated with specifically defined failure and/or damage events normally demands the computation of several high- fidelity engineering simulations, e.g., finite element analysis, computational fluid dynamics. Considering that high-fidelity simulations can be time- consuming and computationally expensive, surrogate models offer an attractive solution by providing a light-running ap- proximation of the model response based on a reduced num- ber of data points. In general, surrogate (meta)models are able to efficiently learn the mathematical relationship between un- certain input design variables and a relevant output quantity ∗Corresponding author Email address: [email protected] (J. Mor ́an A.) of interest (QoI). Among various proposed surrogate mod- els, Gaussian Process-based models (GP), e.g., Kriging and PC-Kriging, have demonstrated their effectiveness in support- ing a wide range of engineering applications [2]. Leveraging on their probabilistic formulation, GP-based surrogate mod- els yield not only a point estimate of the QoI but also an un- certainty measure associated with the generated prediction. In many applications, surrogate models seek the minimization of the system response generalization error with the least num- ber of high-fidelity model evaluations, often inducing a global exploration of the design space. When dealing with structural reliability applications, the relevant limit state(s) can be di- rectly surrogated, and the experimental design logically fo- cuses on regions near the boundary in order to accurately es- timate the probability associated with a specific event, e.g., failure, damage condition. With the goal of efficiently improving the accuracy of a surrogated limit state function, active learning is a machine learning technique that sequentially selects the training sam- ples based on a specified learning metric. This approach is particularly useful when the computational cost of retrieving new high-fidelity model evaluations is high and/or in settings under a constrained computational/economic budget. From the original development of the Expected Feasibility Func- tion (EFF) [3] and the U-function [4], sophisticated active Preprint submitted to ICASP14 February 24, 2023 learning schemes have been widely proposed in the litera- ture, in which the training samples are collected based on an exploitation-exploration trade-off, i.e., exploiting observa- tions near the limit state or exploring yet uncertain ones. As suggested by [5], active learning approaches can be gener- ally categorized according to four distinctive features: (i) sur- rogate model choice, (ii) failure probability estimation tech- nique, (iii) learning enhancement metric, and (iv) stopping criteria. Active learning methods have been proven to be effective for a myriad of structural reliability problems [5]. The com- putational budget, however, is there mainly dedicated to effi- ciently capturing a limit state and its associated failure event. In many engineering applications (e.g., inspection and main- tenance planning), additional events rather than structural fail- ure may be relevant, hence potentially demanding the evalu- ation of multiple limit states that inform, for instance, opera- tional decisions. In this work, we investigate the capability of active learning approaches to identify training samples when dealing with multiple interrelated limit states under a common computational budget, in which, an observation can be infor- mative for estimating either the event associated with only one or multiple events. Specifically, PC-Kriging-based surrogate models are actively trained while additionally accounting for a variance correction derived from leave-one-out cross vali- dation error information, whereas the learning scheme relies on sequentially Monte Carlo samples evaluated according to a U-function. In order to effectively balance the generation of training points around multiple limit states within a common budget, we additionally propose here active learning strategies that se- quentially select observations with the objective of jointly im- proving the accuracy of all treated limit states. Besides the traditional exploitation-exploration trade-off, training sam- ples are sequentially picked by balancing the predicted accu- racy among the surrogated limit states. The proposed active training approaches are then tested in a characteristic multi- modal structural reliability setting, examining their accuracy and training efficiency; and in a more practical application, we efficiently surrogate limit states associated with both fail- ure and repair events corresponding to the aftermath of a ship collision against an offshore wind substructure. 2. LEARNING LIMIT STATE FUNCTIONS THROUGH SURROGATE MODELS 2.1. PC-Kriging surrogate models Consider the response of a system represented by y ∈ R, as a one-dimensional output space which is retrieved from the deterministic mapping of the M-dimensional stochastic input parameter space, whose realizations are denoted as x = {x1, . . . , xM}T ∈ Dx ⊂ RM. Within this frame of refer- ence, PC-Kriging (PCK) is a non-intrusive surrogate model- ing method that combines the probabilistic features of Gaus- 2 sian processes, also known as Kriging, with a prior trend specifically tailored to the underlying input random vector, x, via Polynomial Chaos Expansion (PCE). While Kriging es- timates the analyzed quantity of interest (QoI), y, through a stationary spatial random process where the covariance func- tion (kernel) is defined as a function of the relative distance between data points, PCE further incorporates prior knowl- edge to the Gaussian process mean, as the sum of orthogonal polynomials described by the joint probability density func- tion fX. Formally, a PCK metamodel, MPCK, is defined as: [2] (cid:88) y ≈ MPCK(x) = aαψα(x) + σ2Z(x), (1) α∈A where the left-hand term corresponds to the mean of a Gaus- sian process, defined as the linear combination of coefficients, aα, and multivariate orthogonal polynomials, ψα(x), specified according to the input random vector, x. The terms of the polynomial sum are multi-indexed through α ∈ A ⊂ NM. The constant variance, σ2, is formulated on the right-hand of the equation, along with the zero mean, unit variance, stationary Gaussian process, Z(x). The latter is described by an autocor- relation function R(|x − x(cid:48)|; θ), where the covariance is usually defined based on the relative distance of its inputs x, x(cid:48), and is parameterized by the hyperparameter θ ∈ R+, commonly referred as scale parameter or characteristic length. To calibrate a PCK model built from a set of polynomi- als truncated by the size of A, one can rely on non-intrusive methods that are based on discrete system responses, gath- ered from a sampling plan of N input realizations X = {X (1), . . . , X (N)}T ∈ Dx, also known as experimental de- sign. The parameters σ2 and aα can be calculated through maximum-likelihood, i.e., maximizing the likelihood associ- ated with model predictions, MPCK(X ). Since aα and σ2 are defined as a function of θ, an optimization process for deter- mining θ can be formulated as: ˆθ = arg min θ∈Dθ (cid:104) 1 2 log (det R) + N log(2πσ2) + N (cid:105) . (2) In an iterative process, various multivariate orthogonal poly- nomials of increasing truncation order can be trained follow- ing the optimization process described before and further clas- sified according to a specified error metric. For example, the optimal PCK model can be defined as the one that yields the minimum leave-one-out (LOO) cross-validated error, (cid:15) PCK LOO , formulated as: (cid:15) PCK LOO = 1 N N(cid:88) s=1 (cid:104) y(s) − MPCK (−s) (cid:16) X (s)(cid:17)(cid:105)2 . (3) This error metric is an estimate of the generalization error based on the current experimental design, which is the mean squared error between the responses y(s) and the model pre- (−s) , calibrated with X (−s) dictions at X (s) of a PCK model, MPCK sample points. 2.2. Active learning for structural reliability analysis Compared with conventional design of experiments, e.g., Latin hypercube sampling (LHS), more accurate predictions can be achieved with less high-fidelity model evaluations if an active training approach is followed, in which a surrogate model is sequentially trained based on the available observa- tions up to that point. Each subsequent experimental design point is selected as the one that results in a maximum expected improvement in model accuracy according to a metric com- puted from a learning scoring function. Very often, this en- hancement metric is mainly driven by the surrogate model's built-in probabilistic features, e.g., variance prediction. A well-known scoring function is the one proposed by [4], in which a metric denoted as 'U' is evaluated for a set of randomly generated samples. A tailored and efficient explo- ration of the design space can be additionally accomplished if the samples are generated via simulation-based methods, e.g., Monte Carlo, where the evaluated points are directly sampled from the underlying input random variables. More specifically, the above-mentioned U-function focuses on the design subspace near the limit state boundary considering an exploitation-exploration trade-off, as mentioned in Section 1. Mathematically, each subsequent experimental design point, Xg, is selected as: Xg = arg min x U(x) = arg min x |(cid:98)g(x)| σ(cid:98)g(x) , (4) where (cid:98)g(x) and σ(cid:98)g(x) represent the mean and standard de- viation, respectively, predicted via a surrogate model. The expected improvement metric favors design points close to the limit state boundary and high associated predicted vari- ance. In order to calculate more accurate expected improve- ment scores, the variance estimate provided by a PCK model for a specific design point can be corrected [6]. The selection of subsequent experimental design points can thus be further improved by adequately correcting the gen- erated variance predictions, σ(cid:98)g(x), which might be poten- tially biased [7]. To do that, a correction factor can be cal- culated from a leave-one-out (LOO) cross-validated analysis, which is then applied to the variance predictions associated with the experimental design, Xi, within the Voronoi domain (Vi)i=1,...,N: (cid:98)g(x)LOO = σ2 σ2 (cid:98)g(x)  1 +  N(cid:88) i=1 (cid:104) e2 LOO (cid:104) s2 LOO (cid:105) i (cid:105) i   , Ix∈Vi (5) LOO denotes the vector of LOO squared errors, s2 where e2 the vector of LOO variances and Ix∈Vi Voronoi cells (Vi)i=1,...,N. LOO the domain of the tive of more accurately representing a specific limit state func- tion. As mentioned in Section 1, multiple limit state functions defined within a common input design domain can be of inter- est in many practical applications, e.g., informing operational decisions or estimating the probability associated with a struc- tural failure event. If the experimental points are specific to a particular limit state function, g j, predictions generated for another limit state function, (cid:98)gk might not be necessarily accu- rate. To equally balance a certain given computational budget, a logical active training scheme could, for instance, alternate its focus between m considered limit state functions, improv- ing one at each consecutive step. If the experimental design points, X , are scored via the U-function (Eq. 4), the training sequence will subsequently evaluate the U-function defined with respect to an alternate limit state function from all con- sidered ones, i.e., Xg j with j = 1, ..., m. In practice, some limit state functions are substantially eas- ier to train, hence rendering accurate predictions when trained with only a few observations. By implementing the alter- nate active learning strategy, Xg j, the computational budget is equally allocated for all limit state functions, even if a certain limit state is accurately predicted by the surrogate model early in the sequential process. Instead, one can detect which surrogated limit state function is still far from reaching convergence and select the subsequent experimental design point by evaluating a learning scoring function with respect to the identified limit state. At each active learning step, t, a convergence-related metric δ((cid:98)βg j) inspired on the reliabil- ity index is here proposed for selecting the target limit state function: δ((cid:98)βg j) = (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (cid:98)βt+1,g j − (cid:98)βt,g j (cid:98)βt,g j (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) . (6) At each training step, the target limit state function, g∗ j, be- comes the one associated with the maximum δ((cid:98)βg j), and hence the experimental design point, Xg∗ , is accordingly chosen from a learning metric (e.g., U-function) estimated accord- ing to the identified limit state function. Note that the index βg j (x) follows an inverse relationship with the probability as- sociated with the event of interest, pg j, commonly defined in the standard normal space as βg j(x) = −Φ−1{pg j (x)}, where pg j is computed as the probability of the limit state being neg- ative, i.e., pg j = p{g j ≤ 0}. j 3. NUMERICAL EXPERIMENTS 3.1. Analytical reliability problem 2.3. Active learning strategies for multiple limit state func- tions settings Active learning strategies developed for reliability analysis sequentially select experimental design points with the objec- Inspired by [6], the first limit state, g1, studied here is de- fined as: g1 (x1, x2) = sin (cid:33) (cid:32) 5x1 2 + 2 − (cid:16) (cid:17) x2 1 + 4 (x2 − 1) 20 . (7) 3 Fig. 1. Active learning evolution corresponding to the tested strategies in terms of the predicted probability associated with both considered events g1 and g2. (Left) U-function score metrics evaluated from PC-Kriging variance predictors. (Right) U-function score metrics calculated from corrected variance predictors (U-LOO). For the sake of capturing the active training performance over a second limit state function, an additional performance func- tion g2 is proposed and formulated as: truth, βg j, which is known in this setting. Formally, the error estimator ε(i) , associated with a target limit state function g j, βg j is calculated for each conducted experiment i, as: g2 (x1, x2) = sin (2x1) − (cid:16) x2 1 (cid:17) + 4 (x2 + 1) 20 + 1 2 , (8) with random variables, x1 and x2, described as x1 (cid:118) N (μ = 1.5, σ = 1) and x2 (cid:118) N (μ = 2.5, σ = 1), respec- tively. The tested active learning strategies are restricted to a computational budget of 49 ground-truth observations. From the available budget, 10 training points are dedicated to an initial global exploration following a uniform stratification of samples through LHS, committing the remaining resources to the active training of the surrogate model. From the station- ary correlation families, the general form of Mat ́ern kernel of degree 5/2 is specified as the autocorrelation function R. At each active learning step, the subsequent experimental design point is selected as the sample that minimizes the U- function over a population of 105 randomly generated Monte Carlo samples. Also relying on training samples chosen ac- cording to U-function scoring metrics, active learning strate- gies that consider corrected variance predictions (Eq. 5) are additionally investigated. The results are reported in terms of relative error between the predicted limit state function index, (cid:99)βg j , and the ground = ε(i) βg j (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (cid:98)β(i) g j − βg j βg j (cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) . (9) In total, 15 experiments are executed for each tested ac- tive learning strategy considering both U and U-LOO scoring function metrics: (i) training points selected with respect to target limit state function g1, i.e., Xg1 , (ii) training points that specifically target limit state function g2, i.e., Xg2 , (iii) alter- nate sequential active learning approach, i.e., Xg j, and (iv) training points selected based on the convergence criterion stated in Eq. 6, i.e., Xg∗ . In order to objectively evaluate the error accumulated from both considered limit state functions, an error metric is formulated as: εβ(i) = (cid:80)m , providing a proxy for assessing the joint performance. j=1 ε(i) βg j j Results and discussion Figure 1 showcases the evolution of the surrogated event probabilities, pg1 and pg2 , estimated from all tested active training strategies. In particular, the resulting expected prob- ability, bounded by 30-60% percentiles, is represented over 49 training samples. With the purpose of interpreting the in- fluence of the predicted variance on the learning evolution, 4 pg1H88/221XPEHURIWUDLQLQJVDPSOHVpg2H1XPEHURIWUDLQLQJVDPSOHVgjg*jg1g27DUJHW Fig. 2. Box-plot representation of all investigated active learning approaches in terms of the combined relative error metric, εβ. (Left) U-function score metrics evaluated from PC-Kriging variance predictors. (Right) U-function score metrics calculated from corrected PC-Kriging variance predictors (U-LOO). Table 1. Error estimator associated with a target limit state function, εβg j , and combined error estimator, εβ. Strategy Learning metric j Xg j Xg∗ Xg1 Xg2 Xg j Xg∗ Xg1 Xg2 j U(PCK) U(PCK) U(PCK) U(PCK) U(PCK-LOO) U(PCK-LOO) U(PCK-LOO) U(PCK-LOO) E[εβg1 ](σ[εβg1 ]) 3.7 * 10−2(7.1 * 10−2) 4.5 * 10−2(7.8 * 10−2) 2.4 * 10−3(1.8 * 10−3) 4.6 * 10−1(6.0 * 10−1) 5.8 * 10−2(8.9 * 10−2) 3.7 * 10−2(6.6 * 10−2) 7.4 * 10−3(1.6 * 10−2) 4.0 * 10−1(4.5 * 10−1) E[εβg2 ](σ[εβg2 ]) 3.0 * 10−2(6.2 * 10−2) 8.2 * 10−3(7.4 * 10−3) 2.7 * 10−1(1.8 * 10−1) 7.1 * 10−3(6.0 * 10−3) 1.0 * 10−2(7.2 * 10−3) 6.0 * 10−3(5.2 * 10−3) 9.9 * 10−2(9.5 * 10−2) 6.9 * 10−3(4.3 * 10−3) E[εβg ](σ[εβg ]) 6.7 * 10−2(8.6 * 10−2) 5.3 * 10−2(7.7 * 10−2) 2.7 * 10−1(1.8 * 10−1) 4.7 * 10−1(6.0 * 10−1) 6.8 * 10−2(9.1 * 10−2) 4.3 * 10−2(6.6 * 10−2) 1.1 * 10−1(9.2 * 10−2) 4.1 * 10−1(4.4 * 10−1) strategies resulting from U-based learning scores computed from both PCK's variance (U) and corrected variance (U- LOO) are additionally compared. As seen in the figure, PCK models trained with respect to a specific target limit state result inaccurate when the surro- gate model is applied for the estimation of the other consid- ered limit state function. Particularly, strategies Xg1 and Xg2 render inaccurate estimations and significant training variance across experiments for pg2 and pg1 , respectively. In contrast, strategies that sequentially target both limit state functions within the available computational budget are able to yield a more balanced result in terms of accuracy and training stabil- ity. The straightforward alternate strategy, Xg j, for instance, concurrently reduces the inaccuracy gap resulting from both surrogated limit state functions over the training process. By implementing the strategy based on a converge-related metric, Xg∗ , more accurate predictions can be achieved for both limit state functions. This can be attributed to the fact that, at each learning step, the selected training point seeks the improve- ment of the most inaccurate surrogated limit state function. j The performance reached at the end of the training process is additionally described in Table 1, listing the expected rela- tive error metric and its corresponding standard deviation for each considered limit state function, εβg j , together with the to- tal relative error, εβ. For each listed error metric, the best strat- egy is highlighted. Evidently, the strategies Xg1 and Xg2 yield 5 accurate predictions for their corresponding target limit state function, yet high relative errors are then observed when they are applied to the other limit state function, thus ultimately resulting in a global high error, εβ, compared to the strate- gies Xg j and Xg∗ . When considering U-LOO-based learning score metrics, Xg∗ surprisingly becomes the best strategy for accurately representing the second limit state over all tested experiments, yet with a higher variability than Xg2 . j j To further inspect the spread of the reported relative error metric εβ over experiments, a box plot is shown in Figure 2, delimiting the interquartile range, i.e., between 25% and 75% quantiles, and featuring a whisker that extends over 2.5% and 97.5%. Additionally, the mean and median values are indi- cated with solid orange and dashed red lines, respectively. In the figure, one can clearly observe that the strategy based on the converge-related metric, Xg∗ , yields a lower mean and me- dian relative error in both U and U-LOO settings compared to its counterparts. While rendering accurate predictions for both limit state functions, the alternate active learning strat- egy, Xg j, logically results in higher variability over experi- ments compared to Xg∗ , as the target limit state function is not there intentionally assigned. With respect to the learn- ing metric, the reported results also show that correcting the variance retrieved from the surrogate model leads to more ac- curate learning strategies. j j gjg*jg1g28gjg*jg1g28/22 3.2. Offshore wind substructure subject to ship collision ac- cidental events In this second numerical experiment, we test the proposed active learning approaches for quantifying the probability as- sociated with a repair and a failure event in the aftermath of an offshore wind substructure subject to ship collisions. All computations are conducted on an Intel Core i9−10920X pro- cessor with a clock speed of 3.50 GHz. The assumed ground truth corresponds, in this setting, to the substructure pene- tration, ∆p, computed from a simplified numerical model [8] based on limit plastic analysis. Since each numerical simula- tion requires approximately 3 minutes of computational time, a non-surrogated estimation of the failure and repair probabil- ities is computationally unfeasible. Both considered limit state functions are defined according to the resulting maximum substructure penetration, ∆p,max. A failure occurs if the maximum penetration exceeds a critical value, ∆F: gF (vs, ρ0) = ∆F − ∆p,max (vs, ρ0) , (10) whereas a repair event is stated as a function of a specified damage condition, ∆d, as: (11) gd (vs, ρ0) = ∆d − ∆p,max (vs, ρ0) , where ∆F and ∆d are specified as 3 and 2 meters, respectively. The random variables governing a collision scenario are the initial velocity of the ship, vs, and the material flow stress, ρ0, assumed here as elastic-perfectly plastic. These variables are probabilistically described as vs (cid:118) N (μ = 3.0, σ = 0.6) m/s and ρ0 (cid:118) N (μ = 317, σ = 30) N/mm2, respectively. Results and discussion The active learning evolution is showcased in Figure 3, rep- resenting both failure and damage probabilities over 10 exper- iments. Note that, in this case, only the corrected variance ac- tive learning scheme (U-LOO) is investigated. Since a closed- form solution of the analyzed failure and damage events is not available, all tested strategies are examined in terms of convergence. One can observe that with only a few training samples, most strategies easily reach convergence, yet active learning schemes that only target one specific limit state func- tion (i.e., XgF and Xgd ), are evidently more unstable when ap- plied to the other considered limit state. Instead, active learn- ing strategies that interchangeably target all considered limit state functions converge to both estimated failure and damage event probabilities, all trained under the same computational budget. 4. CONCLUSIONS Surrogate-based active learning strategies for reliability analysis effectively yield accurate predictions for a specifi- cally targeted limit state function, yet they may render inaccu- rate estimates for other regions within the design space. This Fig. 3. Active learning evolution in terms of the predicted probability associ- ated with both considered events, gF and gd, all relying on U-function metrics estimated from corrected variance predictors (U-LOO). paper reveals that, by sequentially targeting multiple limit state functions throughout the training process, combined ac- tive learning strategies are able to achieve a balanced compu- tational budget allocation, resulting in low overall prediction errors. Acknowledgement Mr. Mor ́an gratefully acknowledges the support received by the National Fund for Scientific Research in Belgium F.R.I.A. - F.N.R.S. References [1] P. G. Morato, K. G. Papakonstantinou, C. P. An- driotis, inspec- J. S. Nielsen, P. Rigo, Optimal tion and maintenance planning for deteriorating struc- tural components through dynamic Bayesian networks and Markov decision processes, Structural Safety 94 (2022) 102140. doi:https://doi.org/10.1016/j. strusafe.2021.102140. [2] R. Schobi, B. Sudret, J. Wiart, POLYNOMIAL-CHAOS- BASED KRIGING, International Journal for Uncertainty Quantification 5 (2) (2015) 171–193. 6 pgFH8/221XPEHURIWUDLQLQJVDPSOHVpgdHgjg*jgFgd [3] B. J. Bichon, M. S. Eldred, L. P. Swiler, S. Mahadevan, J. M. McFarland, Efficient global reliability analysis for nonlinear implicit performance functions, AIAA Journal 46 (10) (2008) 2459–2468. arXiv:https://doi.org/ 10.2514/1.34321, doi:10.2514/1.34321. [4] B. Echard, N. Gayton, M. Lemaire, AK-MCS: An active learning reliability method combining Kriging and Monte Carlo Simulation, Structural Safety 33 (2) (2011) 145– 154. doi:https://doi.org/10.1016/j.strusafe. 2011.01.002. [5] M. Moustapha, S. Marelli, B. Sudret, Active learning for structural reliability: Survey, general framework and benchmark, Structural Safety 96 (2022) 102174. doi:https://doi.org/10.1016/j.strusafe. 2021.102174. [6] N.-C. Xiao, M. J. Zuo, W. Guo, Efficient reliability analysis based on adaptive sequential sampling design and cross-validation, Applied Mathematical Modelling 58 (2018) 404–420. doi:https://doi.org/10.1016/ j.apm.2018.02.012. [7] L. Le Gratiet, C. Cannamela, Cokriging-based sequential design strategies using fast cross-validation techniques for multi-fidelity computer codes, Technometrics 57 (3) (2015) 418–427. [8] T. Pire, Crashworthiness of offshore wind turbine jackets based on the continuous element method, PhD disserta- tion, University of Li`ege, Belgium (2018). 7
http://arxiv.org/abs/2302.12059v1
2023-02-23T14:33:54
2023-02-23T14:33:54
A Statistical Learning Take on the Concordance Index for Survival Analysis
The introduction of machine learning (ML) techniques to the field of survival analysis has increased the flexibility of modeling approaches, and ML based models have become state-of-the-art. These models optimize their own cost functions, and their performance is often evaluated using the concordance index (C-index). From a statistical learning perspective, it is therefore an important problem to analyze the relationship between the optimizers of the C-index and those of the ML cost functions. We address this issue by providing C-index Fisher-consistency results and excess risk bounds for several of the commonly used cost functions in survival analysis. We identify conditions under which they are consistent, under the form of three nested families of survival models. We also study the general case where no model assumption is made and present a new, off-the-shelf method that is shown to be consistent with the C-index, although computationally expensive at inference. Finally, we perform limited numerical experiments with simulated data to illustrate our theoretical findings.
[ "Alex Nowak-Vila", "Kevin Elgui", "Genevieve Robin" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12059v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12059v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG" ]
A Statistical Learning Take on the Concordance Index for Survival Analysis 3 2 0 2 b e F 3 2 ] L M . t a t s [ 1 v 9 5 0 2 1 . 2 0 3 2 : v i X r a Alex Nowak-Vila Owkin Inc. Kevin Elgui Owkin Inc. Genevi`eve Robin Owkin Inc. Abstract The introduction of machine learning (ML) tech- niques to the field of survival analysis has in- creased the flexibility of modeling approaches, and ML based models have become state-of-the- art. These models optimize their own cost func- tions, and their performance is often evaluated using the concordance index (C-index). From a statistical learning perspective, it is therefore an important problem to analyze the relationship between the optimizers of the C-index and those of the ML cost functions. We address this issue by providing C-index Fisher-consistency results and excess risk bounds for several of the com- monly used cost functions in survival analysis. We identify conditions under which they are con- sistent, under the form of three nested families of survival models. We also study the general case where no model assumption is made and present a new, off-the-shelf method that is shown to be consistent with the C-index, although computa- tionally expensive at inference. Finally, we per- form limited numerical experiments with simu- lated data to illustrate our theoretical findings. 1 INTRODUCTION Survival analysis (Gross et al., 1981; Kalbfleisch and Pren- tice, 2002), the field of statistics concerned with model- ing time-to-event data, is central to healthcare applica- tions to predict time from diagnosis to death or risk of disease recurrence. Rather than directly modeling time- to-event, many survival models predict risk of event oc- currence (Haider et al., 2020). Many definitions of risk can be found in the literature; the most classic are the expected time-to-event, the probability of an event occur- ring after a given time, or the multiplicative factor in the Proceedings of the 26th International Conference on Artificial Intelligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). hazard rate under the proportional hazards (PH) assump- Importantly, survival data are often right-censored, tion. and only a lower bound on the time-to-event is observed; it usually corresponds to the time at which patients leave the study. Most classical survival models have therefore been extended to the censored case (see, e.g. Klein and Moeschberger (2011) Chapter 3 for a review of the differ- ent types of censoring and Chapter 4 for survival estimation in the censored case). Machine learning models are increasingly used in survival analysis and have shown state-of-the-art results in various application areas (Zhu et al., 2016, 2017; Yousefi et al., 2017; Katzman et al., 2018; Ching et al., 2018; Kvamme et al., 2019; Barnwal et al., 2020; Steingrimsson and Mor- rison, 2020; Cottin et al., 2022; Schutte et al., 2022). Eval- uating this jungle of risk models is therefore an impor- tant issue to make it comprehensive for practitioners (Park et al., 2021). Among existing metrics in survival analy- sis, the concordance index (C-index) is probably the most commonly used (Harrell et al., 1996). It can be viewed as an extension of the Area Under the ROC Curve (AUC) for continuous outcomes and assesses the ability of a risk prediction method to correctly rank individuals according to their risk scores. More specifically, it is defined as the probability that pairs of predicted risks are ranked in the same order as the corresponding observed time-to-events. From a statistical learning perspective, the question arises whether the C-index can be directly optimized, i.e., used as an objective function to be maximized in an ML approach. Unfortunately, the C-index is a non-concave, discontinu- ous loss with respect to the parameters of the risk model; consequently, gradient-based methods cannot be used di- rectly to maximise it. In practice, models are often learned by minimizing a smooth surrogate loss on the training data and then evaluated using the C-index. Examples of train- ing losses include the negative log-likelihood of survival models such as Cox (1972) Proportional Hazards (PH) or Accelerated Failure Time (AFT) models (Wei, 1992), loss functions defined as the expectation of an error measure be- tween the time to event and the risk predictor (Steingrims- son and Morrison, 2020), or smooth approximations of the negated C-index (Chen et al., 2013). Despite the widespread use of the C-index as an evaluation A Statistical Learning Take on the Concordance Index for Survival Analysis measure, the relationship between optimizers of these train- ing losses and those of the C-index is not well understood. In particular, it is not known under what conditions Fisher consistency (Fisher, 1922), also known as classification- calibration (Bartlett et al., 2006), holds, i.e., minimizers of the training loss correspond to optimizers of the C-index. If this property holds, we can safely say that the ML model converges to the optimal C-index as sample size grows to infinity-if the model is expressive enough. The aim of this paper is to answer this very question. We study the consistency properties of classical cost functions in survival analysis with respect to the C-index, and pro- vide associated excess risk bounds. We analyze in par- ticular the properties of Maximum Likelihood Estimation (MLE), conditional average risk estimation, and smooth C- index maximization. We identify conditions under which these methods are consistent, under the form of three nested families of survival models. In addition, we study the more general case where no model assumption is made. In this case, we present a new, off-the-shelf convex method that is shown to be consistent with the C-index, although com- putationally expensive at inference. Finally, we perform limited numerical experiments with simulated data to illus- trate our theoretical findings. In all cases, we discuss how censoring can be incorporated in our results. Note that, most of the theoretical results can be applied beyond sur- vival analysis to any continuous ranking task in the sense of Cl ́emenc ̧on and Achab (2018). Specifically, the following contributions are provided: • The properties of commonly used risk estimation pro- cedures in survival analysis are analyzed in terms of Fisher-consistency and C-index excess risk bounds. • Conditions under which these procedures are Fisher- consistent with respect to the C-index are derived in the form of three nested families of survival mod- els corresponding to increasingly stringent model as- sumptions. For each family, we characterize the max- imizers of the C-index, and provide important exam- ples. • We discuss a novel, off-the-shelf convex estimation method which, although computationally expensive at inference, proves consistent without any modeling as- sumption. • Limited experiments are conducted with simulated data to illustrate our theoretical findings. Related Work This work is in line with an extensive literature on the sta- tistical efficiency of minimizing surrogate losses of non- convex and discontinuous evaluation metrics such as the 0-1 loss. Bartlett et al. (2006) derives upper bounds on the excess risk of convex surrogates for binary classifi- cation, while Agarwal (2014) provides similar results for surrogates of bipartite ranking losses. Cortes and Mohri (2003) provides a statistical analysis of the relationship between AUC and error rate minimization, and Gao and Zhou (2015) identifies sufficient conditions for consistency of pairwise surrogate losses with the AUC. From an opti- mization point of view, Calders and Jaroszewicz (2007) suggests maximizing the AUC directly using polynomial approximations. While the C-index is widely used in survival analysis and several papers have investigated its properties from a prac- tical point of view (Longato et al., 2020; Park et al., 2021), there are comparatively few statistical learning results eval- uating its relationship to commonly used cost functions used in survival analysis. Steck et al. (2007) provide lower bounds on the C-index that can be directly optimized and examine their relationship to Cox's proportional hazards, showing that this popular model approximately maximizes the C-index. The authors do not examine consistency. Chen et al. (2013) develop a gradient-boosting procedure to opti- mize smooth surrogates of the C-index; however, the statis- tical consistency of such surrogates remains to be analyzed. Since the C-index is fundamentally a ranking measure, our work has similarities with the extensive literature on rank- ing algorithms and their statistical properties (Cl ́emenc ̧on et al., 2008; Duchi et al., 2010; Chapelle et al., 2011; Ra- jkumar and Agarwal, 2014; Yuan et al., 2016; He et al., 2018; Ai et al., 2019; Wu et al., 2021; Werner, 2021). As far as we are aware, none of these papers analyze rank- ing algorithms in terms of consistency with the C-index. Cl ́emenc ̧on and Achab (2018) examines the optimizers of the C-index, but they focus only on the case where the con- ditional cumulative distribution functions do not cross one another; we consider much less restrictive assumptions. 2 SETTING AND BACKGROUND 2.1 Survival Analysis Consider the classical survival analysis framework to model time-to-events and their relationship to individual covariates. The time-to-event, denoted T , is assumed con- tinuous and takes values in R +; individual covariates are denoted by X and take values in X ⊂ Rd. Let P = Prob(R + × X) be the space of joint probability densities μ of non-negative time-to-events and covariates; μ(t, x) is also referred to as the survival model. The density of events conditional on covariates x is denoted μ(t|x), and the con- ditional survival function S(t|x) = P {T > t|X = x} = (cid:90) +∞ t μ(t|x)dt. (1) Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin We also consider the right-censored setting where the time- to-event T is not directly observed but rather a lower bound U = C ∧ T where C is a continuous, nonnega- tive random variable corresponding to the censoring time. The binary random variable ∆ = 1(C ≥ T ) specifying whether the lower bounds corresponds to the time-to-event or to the censoring time is also observed. Throughout this paper, the censoring is assumed independent of the covari- ates, i.e. C ⊥ X, and the censoring curve is defined by G(t) = P {C > t}. Definition 2.1 presents the case where there exists a global ordering respecting all pairwise comparisons under (3). Definition 2.1 (Optimal risk ordering). An optimal risk or- dering is a function f (cid:63) satisfying f (cid:63)(x) ≤ f (cid:63)(x(cid:48)) ⇒ P {T > T (cid:48)|x, x(cid:48)} ≥ 1 2 , (5) for all pairs x, x(cid:48). Note that if condition (5) is satisfied then it follows directly that f (cid:63) is an optimizer of the C-index and it only depends on the conditional density of events μ(t|x). 2.2 Concordance Index Consider a scalar valued function f : x ∈ Rd (cid:55)→ f (x) ∈ R; f may for instance come from an inference procedure as- sessing the risk of occurrence of events, depending on co- variates x. In such settings, the higher f (x), the smaller the time-to-event. Many quantities may be used to define the risk; for instance, the conditional expectation of the time-to-event E {T |X = x}, the probability of an event oc- curring beyond a certain time t0, P {T > t0|X = x}, or a statistic specific to a survival model such as the multiplica- tive factor of the baseline hazard under the PH assumption. The C-index is defined as the probability of having a pair- wise concordant order between the predicted risks and the observed time-to-events (Harrell et al., 1982). It is usually presented as the following conditional probability: C(f ) = P {f (X) < f (X (cid:48)) | T > T (cid:48)} . (2) The C-index depends on the joint distribution of (T, X), so that two survival models μ and μ(cid:48) yield two different defini- tions of the C-index Cμ and Cμ(cid:48). Whenever the model μ is clear from context, we drop the subscript for ease of nota- tion. Since the C-index measures the quality of the ranking induced by f rather than the risk values themselves, it is defined up to monotone transformation of the risk. For any pair of real random variables Y and Z, the sta- tistical preference order (Taplin, 1997) denoted by (cid:23), is defined as Y (cid:23) Z ⇐⇒ P {Y > Z} ≥ 1 2 . (3) A risk function f defining a global ordering maximally pre- serving the statistical preference (3) in expectation for all pairs of conditional random variables T |X = x and T |X = x(cid:48) is optimal with respect to the C-index. This follows di- rectly from the fact that: C(f ) ∝ P {f (X) < f (X (cid:48)), T > T (cid:48)} We show in Sec. 3 that an optimal risk ordering does not exists in general. C-index estimation with right-censored data In the survival analysis setting introduced in Sec. 2.1, time- to-events T are not observed but rather a lower bound U = C ∧ T 1 and an event indicator ∆ = 1(C ≥ T ). In this case the question arises of how to consistently es- timate the C-index of a risk model f . Using the Inverse Censored Probability Weighting (IPCW) strategy of Robins and Finkelstein (2000), one can see that E {1(T > T (cid:48))} = E = E (cid:27) (cid:26) 1(T > T (cid:48))1(C ∧ C (cid:48) ≥ T (cid:48)) G(T (cid:48))2 (cid:27) (cid:26) ∆(cid:48)1(U > U (cid:48)) G(U (cid:48))2 , where G is the censoring curve defined at the end of Sec. 2.1. In particular, this leads to the following expres- sion for the C-index as an expectation over (X, U, ∆): C(f ) = E (cid:26) ∆(cid:48)1(U > U (cid:48))1(f (X) < f (X (cid:48))) G(U (cid:48))2 (cid:27) The C-index can be consistently estimated from data using the empirical average instead of the expectation; this esti- mator is known as Uno's C-index (Uno et al., 2011). 2.3 Fisher Consistency As previously discussed, the C-index (2) cannot be max- imized using gradient descent. Instead, the function f is learned by minimizing a smooth risk R(f ). Fisher consis- tency is a property guaranteeing that the minimizers of the smooth risk are also maximizers of the C-index. Defini- tion 2.2 formalizes the notion of Fisher consistency over a family of distributions. Definition 2.2 (Fisher Consistency). The risk R is said to be Fisher consistent to the C-index under a distribution family Q ⊆ P if Rμ(f (cid:63)) = min f Rμ(f ) =⇒ Cμ(f (cid:63)) = max f Cμ(f ), = E 1(f (X) < f (X (cid:48)))1(T > T (cid:48)) = EX,X (cid:48) P {T > T (cid:48)|X, X (cid:48)} 1(f (X) < f (X (cid:48))). for all distribution μ ∈ Q, where Rμ, Cμ are the smooth risk and C-index computed over the joint distribution μ. (4) 1a ∧ b = min(a, b). A Statistical Learning Take on the Concordance Index for Survival Analysis In this paper, pairs of smooth risks and families of distribu- tions are examined for which Fisher consistency holds for the C-index. In the following, the four families of survival models are described alongside examples and theoretical results char- acterizing the associated oracle C-index maximizers. Consistency for AUC with binary labels The C-index is a continuous outcome version of the well-known AUC used in binary output ranking problems, also known as bipar- tite ranking. AUC is defined as the pairwise probability of concordant order between the risk and the binary labels: AUC(f ) = P {f (X) > f (X (cid:48))|Y = 1, Y (cid:48) = 0} , (6) where Y, Y (cid:48) ∈ {0, 1} are binary. The loss is non- continuous and cannot be optimized directly by gradient descent. In this case, however, the set of optimizers of (6) can be easily characterized as monotone transformations of the conditional distribution (Agarwal, 2014). This can be seen as the function f (x) = P {Y = 1|X = x} satisfies ⇐⇒ f (x) ≥ f (x(cid:48)), P {Y > Y (cid:48)|x, x(cid:48)} ≥ 1 2 which directly follows from the identity f (x)(1 − f (x(cid:48))) = P {Y > Y (cid:48)|x, x(cid:48)}. Hence, any smooth risk R whose min- imizer is a monotone transformation of the conditional distribution is consistent to the AUC. This includes least squares, logistic regression, and more generally any proper loss function (Agarwal, 2014). 3 Maximizers of C-index The problem of maximizing the C-index associated to a survival model μ writes C (cid:63) μ = max f Cμ(f ). (7) The aim of this section is to classify the set of possi- ble survival models μ-the joint density of (T, X)-in terms of properties of the associated maximizers of (7). We introduce four families of survival models, denoted by A (cid:40) B (cid:40) C and D ..= Cc = P \ C, defined informally as follows: • A: Survival curves S(t|x) do not cross. Existing work studying consistency with respect to C-index, such as Cl ́emenc ̧on et al. (2013); Cl ́emenc ̧on and Achab (2018) are limited to this family of models. • B: − E{T |X = x} is an optimal risk ordering (5). We prove in Sec. 4 that a large family of smooth risk functions is consistent in this family. • C: There exists an optimal risk ordering satisfying (5). We prove in Sec. 4 that MLE is Fisher-consistent for several examples of models in family C. A. Conditional Survival Curves do not Cross Family A is defined as the set of survival models whose conditional survival curves uniformly bound one another. In other words, models μ ∈ A satisfy assumption A. Assumption A. For all (x, x(cid:48)) ∈ X2, t (cid:55)→ S(t|x)−S(t|x(cid:48)) has constant sign. Under Assumption A, Thm. 3.1 shows that the negative conditional expectation − CE(x) = E {T | X = x} satis- fies Condition (5); the proof can be found in the Appendix. Theorem 3.1. If μ ∈ A, the negative conditional expecta- tion is an optimal risk ordering for the C-index satisfying Condition (5), thus Cμ(− CE) = C (cid:63) μ. The two most commonly used survival models, namely Cox PH and AFT, satisfy Assumption A and therefore Thm. 3.1 applies, as discussed below. Proportional Hazards model. The hazard function is de- fined as h(t) = S(cid:48)(t)(1 − S(t))−1, where S(cid:48) denotes the notetime derivative of the survival curve. In the PH model, the conditional hazard h(t|x) factorizes as h(t|x) = h0(t)ef (x), where h0 is the (non-negative) baseline hazard and f is a function of the covariates (Cox, 1972). This yields S(t|x) = S0(t)ef (x) , S0(t) = e− (cid:82) t 0 h0(τ )dτ , where S0 is the baseline survival curve. It directly follows that survival curves do not cross at any point in time, there- fore Assumption A is satisfied and Thm. 3.1 applies. In this example f (x) also defines an optimal ranking; derivations are provided in the appendix to support this claim. Accelerated Failure Times model. The AFT model as- sumes the following form for time-to-events: log T = f (X) + ε, (8) where ε is an independent random variable. The survival curve is parametrized as S(t|x) = S0(te−f (x)), where S0 is the survival curve of eε. Note that the survival curves do not cross each other as they are defined as scaling by ef (x). In this example also, Assumption A is satisfied and Thm. 3.1 applies. As for the PH model, note that f (x) also defines an optimal ranking; derivations are provided in the appendix to support this claim. B. Conditional Expectation is an Optimal Ordering • D: There is no optimal risk ordering satisfying (5). We introduce in Sec. 4 an off-the-shelf estimation method which proves consistent in this setting, al- though being computationally expensive at inference. Family B is defined as the set of survival models for which the negative conditional expectation is an optimal risk or- dering. In other words, models μ ∈ B satisfy the following condition. Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin Assumption B. The negative conditional expectation − CE(x) = − E {T |X = x} is an optimal risk ordering satisfying (5). Note that Thm. 3.1 proved the inclusion A ⊂ B. Now, the strict inclusion, A (cid:40) B is proved by providing an exam- ple of survival models such that μ ∈ B \ A. Consider the extended AFT model presented in the previous section by adding symmetric heteroscedastic noise. Definition 3.2 (AFT-H). In the AFT-H model, the time-to- event has the form log T = f (x) + σ(x)ε, (9) where σ : X → R + is a positive-valued function satisfying f (x) ≤ f (x(cid:48)) =⇒ σ(x) ≤ σ(x(cid:48)) and ε is a centered Gaussian random variable. Prop. 3.3 shows that AFT-H satisfies assumption B. Proposition 3.3 (AFT-H satisfies B). Assume that μ is in AFT-H. Then, the negative conditional expectation is an optimal risk ordering, thus Cμ(− CE) = C (cid:63) μ. This result is a reformulation of Corollary 2 by Lebedev (2019); we provide the original statement in the appendix. Note that under AFT-H the conditional survival curves take the following form S(t|x) = Sε (cid:16) log t − f (x) σ(x) (cid:17) , where Sε(X) = P {X > ε}. Fixing f (x) and varying σ(x) we can clearly see how the survival curves cross so that AFT-H does not always satisfy assumption A. C. There exists an Optimal Risk Ordering Family C is defined as the set of survival models admitting an optimal risk ordering satisfying (5). Assumption C. There exists an optimal ordering f (cid:63) survival model μ, satisfying (5). μ for Under assumption C, a closed form for the maximum C- index attained at f (cid:63) can be derived by combining Prop. 3.4 below to the expression of pairwise conditional probabili- ties for specific models. Proposition 3.4. Assume that μ satisfies assumption C. Then, the optimal C-index takes the following form: C (cid:63) μ = Cμ(f (cid:63) μ) = EX,X (cid:48) φ(P {T > T (cid:48)|X, X (cid:48)}), where φ(a) = max(a, 1 − a) and f (cid:63) satisfies (5). Analogously to the previous cases, a family of distributions satisfying assumption C is introduced, using exponential family models. Then, an example of model μ ∈ C \ B is provided. Definition 3.5 (Exponential family survival model). For θ : X → R, β : R + → R, η : R → R, and A : R → R such that, for all x ∈ X, the conditional density of a curved exponential family model is given by +, τ : R + → R μ(t|x) = β(t) exp [η ◦ θ(x)τ (t) − A ◦ θ(x)] , (10) with associated parameter θ(x). For instance, θ(x) = θ(cid:62)x in a generalized linear model. The scalar exponential family from definition 3.5 covers many of the survival curves classically used in survival analysis, e.g., the exponential, chi-squared, Laplace and normal distributions. Under the exponential family model, the scalar parameterization θ(x) satisfies the optimal risk ordering condition, as shown in the following proposition proved in the Appendix. Thus, maximization of the C- index can be achieved by estimating the parameters θ(x) of the model. Proposition 3.6. Under Assumption C, with θ continuous, β positive, τ non-decreasing and η continuously differen- tiable and non-decreasing, θ(x) is an optimal risk ordering for the C-index, thus Cμ(θ) = C (cid:63) μ. Weibull with varying shape parameter Consider the model defined by Weibull conditional survival curves with varying shape parameter S(t|x) = e−tf (x) . (11) The following Prop. 3.7 proves the strict inclusion B (cid:40) C. Proposition 3.7. The above Weibull model (11) satisfies assumption C but not assumption B. The proof is based on the result by Lebedev (2019) show- ing that f gives an optimal risk ordering. Assumption B is not satisfied as the expectation of a Weibull is not monotone on the shape parameter. Indeed, the expectation is given by Γ(1 + 1 f (x) ), where Γ denotes the Gamma function. This function has a minimum between 1.46 and 1.47, decreas- ing first and increasing for larger values. Thus, it gives a different ranking than the optimal risk ordering f . D. There is no Optimal Risk Ordering Family D contains survival models for which there does not exist an optimal risk ordering satisfying condition (5). The following example illustrates this phenomenon. Let {Ti}1≤i≤n be random variables corresponding to time-to- event of individuals 1 ≤ i ≤ n, and consider the following assumption. Assumption D. There exists m ≥ 3, a subset of indices I ⊂ {1, . . . , n}, |I| = m, and an ordering i1 < i2 < . . . < im such that, denoting im+1 = i1, min k∈{1,...,m} (cid:0)P (cid:8)Tik < Tik+1 (cid:9)(cid:1) > 1 2 . A Statistical Learning Take on the Concordance Index for Survival Analysis by introducing the considered method and their extensions to the censoring case. Then, we provide excess risk bounds on the associated C-index suboptimality. 4.1 Estimation Procedures Figure 1: Survival curves and time-to-event distributions of a cycle of length three. In this case P (T1 < T2) = P (T2 < T3) ≈ 0.52 and (T3 < T1) ≈ 0.55. Hence, it is a cycle as min(P (T1 < T2), P (T2 < T3), P (T3 < T1)) > 1 2 . Assumption D implies the existence of a cyclic sequence with respect to the statistical preference order (3), which implies there is no ranking function satisfying the optimal risk ordering (5). In Fig. 1, we illustrate this phenomenon with a cyclic sequence made of a uni-modal and two multi- modal time-to-event distributions. In the previous sections, we showed that for μ ∈ A, B, C, the maximizer of the C-index in fact only depends on the conditional density μ(t|x); however, if μ ∈ D, the max- imizer may also depend on the marginal covariate distri- bution μ(x). This is an important characteristic of cyclic sequences, since the optimizer of the C-index may change under distributional shifts of the marginal population of pa- tients. This phenomenon is shown in the following result, proved in the Appendix. Proposition 3.8. Under Assumption D, the maximizer of the C-index depends on the marginal distribution of the pa- tients covariates μ(x). In particular, this means that the optimal relative order be- tween patients may change if new patients are added to the original patient cohort. This phenomena does not happen in the binary setting where the ranking measure is the AUC as its optimizer is the conditional expectation, as discussed in Sec. 2.3. 4 CONSISTENCY AND EXCESS RISK BOUNDS We now study several estimation procedures classically used in survival analysis, all based on Fisher-consistent, In particular, we discuss under smooth cost functions. which families of survival models introduced in the pre- vious section Fisher-consistency holds. Although existing work was limited to family A (e.g. Cl ́emenc ̧on et al. (2013); Cl ́emenc ̧on and Achab (2018)), we prove that all the con- sidered methods are consistent in family B (cid:41) A. We start Estimating the conditional expectation (A, B). Without a specific survival model but under assumption B, one can use any cost function minimized by a monotone trans- formation of the conditional expectation. The following Thm. 4.1 provides a family of risks based on Fenchel- Young losses (Blondel et al., 2020) satisfying this property. Theorem 4.1. Let Ω : C → R be a twice-differentiable strongly convex function 2 defined in a closed domain C ⊇ R + such that limu→∞ ∇Ω(u) = +∞. Define the cost function S(v, t) = Ω∗(v) − vt where Ω∗ is the Fenchel conjugate of Ω (Rockafellar, 1997) 3. Then, the following risk R(f ) = E(X,U,∆) ∆S(f (X), U ) G(U ) , (12) is convex, smooth, and its minimizer is a monotone trans- formation of the conditional expectation. Thus, under as- sumption B it is Fisher consistent to the C-index. When C = R and Ω(u) = u2/2 this corresponds precisely to ICPW (Robins and Finkelstein, 2000) on least squares. However, Thm. 4.1 provides a larger family of consistent smooth risks by choosing Ω and its domain C using the construction of Fenchel-Young losses. Note that the estimator minimizing (12) is not efficient in the presence of censoring as only samples corresponding to events ∆ = 1 contribute to the cost function. To alle- viate this issue, Steingrimsson and Morrison (2020) uses semi-parametric efficiency theory for missing data (Tsiatis, 2006; Robins et al., 1994), and develops an augmented es- timator with smallest asymptotic variance among all unbi- ased estimators of E S(f (X), T ). Maximum Likelihood Estimators (A, B, C). Assume the conditional survival model μf (t|x) lies in a family of distri- butions so that one of the parameters f (x) gives the optimal risk ranking (5), thus belonging to class C. We can learn the optimal parameter under censoring by minimizing the following MLE loss (Kalbfleisch and Prentice, 2002): R(f ) = − E(X,U,∆) ∆ log μf (U |X)+(1−∆) log Sf (U |X). The derivation of this loss can be found in the Appendix. This loss can be used for all models presented in the previ- ous section, namely PH, AFT, AFT-H, Weibull and the ex- ponential family. Whenever the model is identifiable, the 2A one-dimensional strongly convex function is one for which uΩ ≥ C > 0 for all u the Hessian is uniformly lower bounded ∇2 in the domain. 3The Fenchel conjugate Ω∗ of Ω is defined for all v ∈ R as Ω∗(v) = supu∈C vu − Ω(u) Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin Figure 2: C-index empirical excess risks of the different methods of ranking for various training sizes n. The left, center and right figures correspond to data generated from models satisfying assumptions A, B and C, respectively. MLE is consistent to the true parameter and thus Fisher consistent to the C-index. An important advantage of this loss is that the censored samples have an explicit role and provide signal during the learning procedure. Note that, pe- nalized versions of (4.1) can also be used to obtain explicit finite sample risk bounds (see Prop. 4.4). Smooth C-index (A, B, C, D). In family D, one can- not assume the existence of an optimal risk ordering. In this case, an alternative method is smooth C-index maxi- mization, which is based on smoothing the indicator func- tion defining the C-index under censoring as presented in Sec. 2.2, leading to a non-convex smooth loss (Mayr et al., 2016). The non-convexity of this approach may cause con- vergence problems and a scaling parameter may be tuned to guarantee proper convergence. Estimating pairwise probabilities (A, B, C, D). The smooth C-index has two-main problems: its non concavity and the fact its optimizer is not robust to marginal distribu- tion shifts due to Prop. 3.8. We propose a novel method- ology whereby instead of learning a risk function f spec- ifying the ranking on the training cohort, we (1) learn the pairwise conditional probabilities P {T > T (cid:48)|x, x(cid:48)} on the training data with an estimator h(x, x(cid:48)) and then (2) we construct the ranking that better satisfies the relative order constraints in expectation over the finite validation cohort x1, . . . , xn by solving: ple approximations of this problem exist (Even et al., 1998; Demetrescu and Finocchi, 2003). This method addresses the two problems of the smooth C- index. First, the pairwise conditional probabilities can be learned using convex estimation methods, such as logis- tic regression on the binary problem ̃Y = sign(T − T (cid:48)) and ̃X = (X, X (cid:48)). Second, the ranking estimator is robust to marginal distributional shifts as the inference algorithm (13) is computed on the validation cohort. It is interest- ing to note that the computational bottleneck of the smooth C-index coming from its non concavity has now been trans- posed into the computational bottleneck of the combinato- rial inference problem. 4.2 Excess Risk Bounds The question is now to obtain excess risk bounds on the C-index when there exists an optimal risk ranking f (cid:63) satis- fying (5). The following Thm. 4.2 bounds the excess risk of the C-index. Theorem 4.2 (Excess risk bounds). Let f (cid:63) be an optimal risk ranking satisfying (5). Let L > 0 a positive constant satisfying |2P {T > T (cid:48)|x, x(cid:48)} − 1| ≤ L|f (cid:63)(x) − f (cid:63)(x(cid:48))|, (14) for all pairs x, x(cid:48). Then, the excess risk of the C-index can be bounded as min σ∈S n (cid:88) i,j=1 γji1(σ(i) < σ(j)), (13) C(f (cid:63)) − C(f ) ≤ 2L EX |f (X) − f (cid:63)(X)|. where S is the set of permutations of size n and γij = |2h(xi, xj) − 1|1(h(xi, xj) > 1/2). The derivation of this methodology follows easily from the C-index expres- sion (4) and it is consistent by construction. The combi- natorial problem (13) is known as the Minimum Weight Feedback Arc Set (MWFAS) problem (Duchi et al., 2010; Karp, 1972); it is known to be NP-Hard. However, multi- The proof of this result can be found in the Appendix, and is based on a reduction of the problem to a binary clas- sification problem with input (X, X (cid:48)) and output Z = sign(T − T (cid:48)), similar to Agarwal (2014) for the bipartite ranking setting. The following Prop. 4.3 shows that con- dition (14) is satisfied for most of the models presented in Sec. 3. The proof is in the Appendix. A Statistical Learning Take on the Concordance Index for Survival Analysis Proposition 4.3. Condition (14) is satisfied by: 5 EXPERIMENTS (i) The PH model with L = 1. (ii) The AFT model (8) with L the Lipschitz constant of the cumulative distribution function Fε−ε(cid:48) of the sym- metric random variable ε − ε(cid:48). (iii) The AFT-H model (9) with L the same as AFT scaled by a factor a where σ(x) ≥ 1/a for all x. (iv) The exponential family (10). We now provide two examples of application of Prop. 4.3. Example of Lasso estimator on Cox PH model Prop. 4.3 shows that Thm. 4.2 applies in particular to the PH model. For this specific case, we illustrate our theoretical findings with an application to the Lasso estimator for the Cox PH model. This estimator is analyzed in Huang et al. (2013), where finite sample bounds on the (cid:96)1-penalized negative log-likelihood estimation and prediction errors are proven. More specifically, assuming a generalized linear model f (cid:63)(x) = θ(cid:63)(cid:62)x, the Lasso estimator ˆθLasso is shown to satisfy (cid:107)ˆθLasso − θ(cid:63)(cid:107)1 (cid:46) (cid:107)θ(cid:63)(cid:107)0 log(d) in high probability for sufficiently large training datasets. Operator (cid:46) denotes inequality up to log and constant terms depending on the model, and (cid:107)θ(cid:63)(cid:107)0 denotes the number of non-zero entries of θ(cid:63). Combining this result with Thm. 4.2, and notincing that n EX |(ˆθLasso − θ(cid:63))(cid:62)X| ≤ (cid:107)ˆθLasso − θ(cid:63)(cid:107)1 EX (cid:107)X(cid:107)∞, we obtain the following informal result. Proposition 4.4 (informal). With probability at least 1 − ε(n), ε(n) → 0 as n → +∞, C(θ(cid:63)) − C(ˆθLasso) (cid:46) EX (cid:107)X(cid:107)∞ * (cid:107)θ(cid:63)(cid:107)0 log(d) n . The quantity EX (cid:107)X(cid:107)∞ depends on the covariates model and corresponds to "the size" of the input space. Finite sample bounds for family B. Under assumption B and using the smooth cost function (12) we can obtain ex- cess risk bounds on the C-index in terms of the excess of the smooth risk R(f ). Theorem 4.5. Let R be the risk defined in (12). Under assumption B, the following inequality holds: C (cid:63) − C(f ) ≤ 4Lγ(cid:112)R(f ) − R(cid:63), where Ω(cid:48)(cid:48)(u) ≥ 1/γ2 for all u in the domain C 4. Combining the above Thm. 4.5 with finite sample bounds on the excess risk such as the ones obtained by Ausset et al. (2019) one can translate them to the C-index. 4Recall that Ω is convex thus Ω(cid:48)(cid:48)(u) ≥ 0 In this section we perform experiments to validate our the- oretical findings 5. More specifically, we assess empirically the consistency of different estimation methods with re- spect to the C-index, under simulation regimes correspond- ing to families A, B and C. Data Generation and Evaluation Procedure We simulate survival data using the three different regimes A, B and C presented in Sec. 3. We first simulate the training covari- ates x1, . . . , xn ∈ Rd as well as a unit vector β ∈ Rd with d = 10 and parameterize the optimal ranking lin- early f (x) = β(cid:62)x. We then simulate the corresponding time-to-events t1, . . . , tn as realizations of the distribution of T |X, parameterized by β and depending on the selected regime of simulation. Four different models are fit using the the cost functions studied in Sec. 4. First, a linear model (L-MSE) optimizing a mean square error loss function to regress the conditional expectation of T given x; second, a linear Cox model (Cox) optimizing a log-likelihood; third, a linear model (L-smoothσ) optimizing a smooth C-index (with smoothing parameter σ ∈ {.01, 10} that accounts for the smoothness of the approximation of the indicator func- tion), and finally a pairwise model (MWFAS) that predicts pairwise probabilities using XGBoost, and from which the ranking is obtained by solving the MWFAS combinatorial problem presented in Sec. 4.1 with a fast approximation algorithm. We compute the obtained C-index from a test dataset of fixed size (ntest = 3000) using the same distribu- tion as the training dataset. Results The results are provided in Fig. 2. For the three generation regimes, we observe that the proposed method MWFAS yields the best performance and converges to the optimal C-index when n is sufficiently large. It has simi- lar performance to Cox in the regime A where Cox is well specified. When Cox is not well-specified it does not con- verge to the optimal ranking. Lastly, note that the value of the smoothing parameter used by L-smoothσ can harm the performance of the resulting model and it is important to choose it properly to improve convergence guarantees. Acknowledgements The authors would like to thank Paul Trichelair for his valu- able guidance throughout the project. References Agarwal, S. (2014). Surrogate regret bounds for bipartite ranking via strongly proper losses. The Journal of Ma- chine Learning Research, 15(1):1653–1674. Ai, Q., Wang, X., Bruch, S., Golbandi, N., Bendersky, M., 5Code can be found in https://github.com/owkin/ owkin-metric Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin and Najork, M. (2019). Learning groupwise multivariate In Pro- scoring functions using deep neural networks. ceedings of the 2019 ACM SIGIR international confer- ence on theory of information retrieval, pages 85–92. Ausset, G., Cl ́emenc ̧on, S., and Portier, F. (2019). Empiri- cal risk minimization under random censorship: Theory and practice. arXiv preprint arXiv:1906.01908. Barnwal, A., Cho, H., and Hocking, T. D. (2020). Sur- vival regression with accelerated failure time model in xgboost. arXiv preprint arXiv:2006.04920. Bartlett, P. L., Jordan, M. I., and McAuliffe, J. D. (2006). Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138–156. Blondel, M., Martins, A. F., and Niculae, V. (2020). Learn- Journal of Machine ing with fenchel-young losses. Learning Research, 21(35):1–69. Calders, T. and Jaroszewicz, S. (2007). Efficient auc op- In European Conference timization for classification. on Principles of Data Mining and Knowledge Discov- ery, pages 42–53. Springer. Chapelle, O., Chang, Y., and Liu, T.-Y. (2011). Future di- rections in learning to rank. In Proceedings of the Learn- ing to Rank Challenge, pages 91–100. PMLR. Chen, Y., Jia, Z., Mercola, D., and Xie, X. (2013). A gra- dient boosting algorithm for survival analysis via direct optimization of concordance index. Computational and mathematical methods in medicine, 2013. Ching, T., Zhu, X., and Garmire, L. X. (2018). Cox-nnet: An artificial neural network method for prognosis pre- diction of high-throughput omics data. PLOS Computa- tional Biology, 14(4):e1006076. Cl ́emenc ̧on, S. and Achab, M. (2018). Ranking data with continuous labels through oriented recursive partitions. arXiv preprint arXiv:1801.05772. Cl ́emenc ̧on, S., Lugosi, G., and Vayatis, N. (2008). Rank- ing and empirical minimization of u-statistics. The An- nals of Statistics, 36(2):844–874. Cl ́emenc ̧on, S., Robbiano, S., and Vayatis, N. (2013). Ranking data with ordinal labels: optimality and pair- wise aggregation. Machine Learning, 91(1):67–104. Cortes, C. and Mohri, M. (2003). Auc optimization vs. error rate minimization. Advances in neural information processing systems, 16:313–320. Cottin, A., Pecuchet, N., Zulian, M., Guilloux, A., and Katsahian, S. (2022). Idnetwork: A deep illness- death network based on multi-state event history pro- cess for disease prognostication. Statistics in Medicine, 41(9):1573–1598. Cox, D. R. (1972). Regression models and life-tables. Jour- nal of the Royal Statistical Society: Series B (Method- ological), 34(2):187–202. Demetrescu, C. and Finocchi, I. (2003). Combinatorial al- gorithms for feedback problems in directed graphs. In- formation Processing Letters, 86(3):129–136. Devroye, L., Gy ̈orfi, L., and Lugosi, G. (2013). A probabilistic theory of pattern recognition, volume 31. Springer Science & Business Media. Duchi, J. C., Mackey, L. W., and Jordan, M. I. (2010). On the consistency of ranking algorithms. In ICML, pages 327–334. Even, G., Schieber, B., Sudan, M., et al. (1998). Approxi- mating minimum feedback sets and multicuts in directed graphs. Algorithmica, 20(2):151–174. Fisher, R. A. (1922). On the mathematical foundations of theoretical statistics. Philosophical Transactions of the Royal Society A, 222:309–368. Gao, W. and Zhou, Z.-H. (2015). On the consistency of auc pairwise optimization. In Proceedings of the 24th Inter- national Conference on Artificial Intelligence, IJCAI'15, page 939–945. AAAI Press. Gross, A. J., Elandt-Johnson, R. C., and Johnson, N. L. (1981). Survival models and data analysis. BioScience. Haider, H., Hoehn, B., Davis, S., and Greiner, R. (2020). Effective ways to build and evaluate individual survival distributions. J. Mach. Learn. Res., 21:85–1. Harrell, F. E., Califf, R. M., Pryor, D. B., Lee, K. L., and Rosati, R. A. (1982). Evaluating the yield of medical tests. Jama, 247(18):2543–2546. Harrell, F. E., Lee, K. L., and Mark, D. B. (1996). Mul- tivariable prognostic models: issues in developing mod- els, evaluating assumptions and adequacy, and measur- ing and reducing errors. Statistics in medicine, 15 4:361– 87. He, Y., Liu, J., and Ning, X. (2018). Drug selection via joint push and learning to rank. IEEE/ACM Transactions on Computational Biology and Bioinformatics, 17(1):110– 123. Huang, J., Sun, T., Ying, Z., Yu, Y., and Zhang, C.-H. (2013). Oracle inequalities for the lasso in the Cox model. The Annals of Statistics, 41(3). Kalbfleisch, J. D. and Prentice, R. L. (2002). The Statistical Analysis of Failure Time Data. John Wiley & Sons, 2nd edition. Karp, R. M. (1972). Reducibility among combinatorial In Complexity of computer computations, problems. pages 85–103. Springer. Katzman, J. L., Shaham, U., Cloninger, A., Bates, J., Jiang, T., and Kluger, Y. (2018). DeepSurv: personalized treatment recommender system using a Cox proportional hazards deep neural network. BMC Medical Research Methodology, 18(1):24. A Statistical Learning Take on the Concordance Index for Survival Analysis Klein, J. P. and Moeschberger, M. L. (2011). Survival Analysis : Techniques for Censored and Truncated Data. New York: Springer, second edition. Kvamme, H., Borgan, Ø., and Scheel, I. (2019). Time-to- Event Prediction with Neural Networks and Cox Regres- sion. Journal of Machine Learning Research, 20(129):1– 30. Lebedev, A. V. (2019). The nontransitivity problem for three continuous random variables. Automation and Re- mote Control, 80(6):1058–1068. Levy, H. and Robinson, M. (2006). Stochastic domi- nance: Investment decision making under uncertainty, volume 34. Springer. Longato, E., Vettoretti, M., and Di Camillo, B. (2020). A practical perspective on the concordance index for the evaluation and selection of prognostic time-to-event models. Journal of Biomedical Informatics, 108:103496. Mayr, A., Hofner, B., and Schmid, M. (2016). Boosting the discriminatory power of sparse survival models via optimization of the concordance index and stability se- lection. BMC bioinformatics, 17(1):1–12. Nowak-Vila, A., Bach, F., and Rudi, A. (2019). A gen- eral theory for structured prediction with smooth convex surrogates. arXiv preprint arXiv:1902.01958. Park, S. Y., Park, J. E., Kim, H., and Park, S. H. (2021). Review of statistical methods for evaluating the perfor- mance of survival or other time-to-event prediction mod- els (from conventional to deep learning approaches). Ko- rean Journal of Radiology, 22:1697 – 1707. Rajkumar, A. and Agarwal, S. (2014). A statistical con- vergence perspective of algorithms for rank aggregation from pairwise data. In International conference on ma- chine learning, pages 118–126. PMLR. Robins, J. and Finkelstein, D. (2000). Correcting for non- compliance and dependent censoring in an aids clini- cal trial with inverse probability of censoring weighted (ipcw) log-rank tests. Biometrics, 56(3):779-788. Robins, J. M., Rotnitzky, A., and Zhao, L. P. (1994). Esti- mation of regression coefficients when some regressors are not always observed. Journal of the American statis- tical Association, 89(427):846–866. Rockafellar, R. T. (1997). Convex analysis. princeton land- marks in mathematics. Schutte, K., Brulport, F., Harguem-Zayani, S., Schiratti, J.-B., Ghermi, R., Jehanno, P., Jaeger, A., Alamri, T., Naccache, R., Haddag-Miliani, L., Orsi, T., Lamarque, J.-P., Hoferer, I., Lawrance, L., Benatsou, B., Bousaid, I., Azoulay, M., Verdon, A., Bidault, F., Balleyguier, C., Aubert, V., Bendjebbar, E., Maussion, C., Loiseau, N., Schmauch, B., Sefta, M., Wainrib, G., Clozel, T., Am- mari, S., and Lassau, N. (2022). An artificial intelligence model predicts the survival of solid tumour patients from imaging and clinical data. European Journal of Cancer, 174:90–98. Steck, H., Krishnapuram, B., Dehing-Oberije, C., Lambin, P., and Raykar, V. C. (2007). On ranking in survival analysis: Bounds on the concordance index. Advances in neural information processing systems, 20. Steingrimsson, J. A. and Morrison, S. (2020). Deep learning for survival outcomes. Statistics in medicine, 39(17):2339–2349. Steinhaus, H. and Trybula, S. (1959). On a paradox in ap- plied probabilities. Bull. Acad. Polon. Sci, 7(67-69):108. Taplin, R. H. (1997). The statistical analysis of preference data. Journal of the Royal Statistical Society: Series C (Applied Statistics), 46(4):493–512. Tsiatis, A. A. (2006). Semiparametric theory and missing data. Uno, H., Cai, T., Pencina, M. J., D'Agostino, R. B., and Wei, L.-J. (2011). On the c-statistics for evaluating over- all adequacy of risk prediction procedures with censored survival data. Statistics in medicine, 30(10):1105–1117. Wei, L. J. (1992). The accelerated failure time model: A useful alternative to the cox regression model in survival analysis. Statistics in Medicine, 11(14-15):1871–1879. Werner, T. (2021). A review on instance ranking problems in statistical learning. Machine Learning, pages 1–49. Wu, X., Zeng, W., Lin, F., and Zhou, X. (2021). Neurank: learning to rank with neural networks for drug–target in- teraction prediction. BMC bioinformatics, 22(1):1–17. Yousefi, S., Amrollahi, F., Amgad, M., Dong, C., Lewis, J. E., Song, C., Gutman, D. A., Halani, S. H., Ve- lazquez Vega, J. E., Brat, D. J., and Cooper, L. A. D. (2017). Predicting clinical outcomes from large scale cancer genomic profiles with deep survival models. Sci- entific Reports, 7(1):11707. Yuan, Q., Gao, J., Wu, D., Zhang, S., Mamitsuka, H., and Zhu, S. (2016). Druge-rank: improving drug–target in- teraction prediction of new candidate drugs or targets by ensemble learning to rank. Bioinformatics, 32(12):i18– i27. Zhu, X., Yao, J., and Huang, J. (2016). Deep convolu- tional neural network for survival analysis with patho- logical images. In 2016 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), pages 544– 547, Shenzhen, China. IEEE. Zhu, X., Yao, J., Zhu, F., and Huang, (2017). WSISA: Making Survival Prediction from Whole Slide In 2017 IEEE Conference Histopathological Images. on Computer Vision and Pattern Recognition (CVPR), pages 6855–6863, Honolulu, HI. IEEE. J. Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin A Statistical Learning Take on the Concordance Index for Survival Analysis: Supplementary Materials Outline. The supplementary material is organized as follows. In Section 1 we provide the proofs of the results from Section 3 of the main paper and in Section 2 we provide the proofs of the results from Section 4 of the main paper A Statistical Learning Take on the Concordance Index for Survival Analysis A PROOF OF RESULTS FROM SECTION 3 Let's first recall the definition of an optimal risk ordering and the assumption A, B, C and D presented in Section 3 of the paper. Definition A.1 (Optimal risk ordering). f (cid:63)(x) ≤ f (cid:63)(x(cid:48)) ⇒ P {T > T (cid:48)|x, x(cid:48)} ≥ 1 2 , (15) for all pairs x, x(cid:48). Note that if condition (15) is satisfied then it follows directly that f (cid:63) is an optimizer of the C-index and it only depends on the conditional density of events μ(t|x). Assumption A. For all (x, x(cid:48)) ∈ X2, t (cid:55)→ S(t|x) − S(t|x(cid:48)) has constant sign. Assumption B. The negative conditional expectation − CE(x) = − E {T |X = x} is an optimal risk ordering satisfy- ing (15). Assumption C. There exists an optimal ordering f (cid:63) Assumption D. There is not an optimal ordering f (cid:63) μ for survival model μ, satisfying (15). μ for survival model μ, satisfying (15). A.1 Proof of Theorem 3.1 We start with the following Lemma A.2 from Levy and Robinson (2006). Lemma A.2 (Levy and Robinson (2006)). Let T, T (cid:48) be two random variables with survival functions ST and ST (cid:48), respec- tively. We have that ST (t) ≥ ST (cid:48)(t) for all t ≥ 0 if and only if E T (cid:48)φ(T ) ≥ E T (cid:48)φ(T (cid:48)) for any non-decreasing function φ : R → R. Equipped with Lemma A.2, we can state the following proposition. Proposition A.3. Let T, T (cid:48) be two independent continuous random variables. ST (t) ≥ ST (cid:48)(t) for all t ≥ 0 =⇒ P {T > T (cid:48)} ≥ 1 2 . Proof. Since the random variables are continuous, P {T ≥ T (cid:48)} ≥ 1 addition, 2 is equivalent to P {T ≥ T (cid:48)} ≥ P {T (cid:48) ≥ T }. In P {T ≥ T (cid:48)} = E 1(T ≥ T (cid:48)) = E T (cid:48) ET {1(T ≥ T (cid:48))|T (cid:48)} = E T (cid:48) ET {1(T ≥ T (cid:48))} = E T (cid:48)ST (T (cid:48)), where we used the independence of T, T (cid:48). Thus, P {T ≥ T (cid:48)} ≥ P {T (cid:48) ≥ T } also equivalent to On the other hand, since the survival curves are uniformly bounded, it holds that ET (cid:48) ST (T (cid:48)) ≥ ET (cid:48) ST (cid:48)(T (cid:48)). Applying Lemma A.2 to −ST (cid:48) which is non-decreasing, we obtain that ET (cid:48) ST (cid:48)(T (cid:48)) ≥ E T ST (cid:48)(T ), which concludes the proof. E T (cid:48)ST (T (cid:48)) ≥ E T ST (cid:48)(T ). (16) Recall the statement of Theorem 3.1 below. Theorem 3.1. If μ satisfies assumption A, the negative conditional expectation is an optimal risk ordering for the C-index satisfying Condition (15), thus Cμ(− CE) = C (cid:63) μ. Proof. Note that, under Assumption A, for any x, x(cid:48), − E {T |X = x} ≤ − E {T (cid:48)|X = x(cid:48)} if and only if S(t|x) ≥ S(t|x(cid:48)) for any t ≥ 0. Using that {T |X = x} and {T |X = x(cid:48)} are independent continuous random variables and applying Prop. A.3 yields the desired result. Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin A.2 Proof of Proposition 3.3 The AFT-H model has the following form: log T = f (x) + σ(x)ε, (17) where ε is a standard Gaussian random variable. Recall the statement of Proposition 3.3. Proposition 3.3 (AFT-H satisfies B). Assume μ is in AFT-H and that if f (x) < f (x(cid:48)) then σ(x) < σ(x(cid:48)). Then, the negative conditional expectation is an optimal risk ordering, thus Cμ(− CE) = C (cid:63) μ. Proof. We will first show that the negative conditional expectation − E {log T | X = x} is an optimal risk ordering satisfying (15). Following the proof of Corollary 2 by Lebedev (2019), we show that if T, T (cid:48) are defined as log T = a + bε, log T (cid:48) = a(cid:48) + b(cid:48)ε(cid:48) where ε, ε(cid:48) are symmetric around zero and independent, then P {T > T (cid:48)} ≥ 1 2 if and only if a ≥ a(cid:48). If we denote by F12 the c.d.f of bε − b(cid:48)ε(cid:48), which is symmetric around zero too, then P {T > T (cid:48)} = P {(a + bε) − (a(cid:48) + b(cid:48)ε(cid:48)) < 0} = F12(a − a(cid:48)), where the right hand side is greater or equal than 1/2 if and only if a ≥ a(cid:48). In particular, this means that − E {log T | X = x} = −f (x) gives an optimal risk ordering. We conclude that − E T |X = x is also an optimal risk ordering by noting that if f (x) < f (x(cid:48)), then log E T |X = x = f (x) + log E eσ(x)ε ≤ f (x(cid:48)) + log E eσ(x(cid:48))ε ≤ log E T (cid:48)|X = x(cid:48). This follows from the assumption f (x) < f (x(cid:48)) =⇒ σ(x) < σ(x(cid:48)) and that the log moment generating function of a standard Gaussian random variable is monotone and takes the closed form log E etε = 1 2 t2. A.3 Proof of Proposition 3.4 Recall the statement of Proposition 3.4. Proposition 3.4. Assume μ satisfies assumption C. Then, the optimal C-index takes the following form: C (cid:63) μ = Cμ(f (cid:63) μ) = EX,X (cid:48) φ(P {T > T (cid:48)|X, X (cid:48)}), where φ(a) = max(a, 1 − a) and f (cid:63) μ satisfies (15). Proof. We use the following expression of the C-index: C(f ) = EX,X (cid:48) P {(f (X) − f (X (cid:48)))(T − T (cid:48)) < 0}. From this, we obtain that C(f ) = EX,X (cid:48) P {T > T (cid:48)|X, X (cid:48)} 1(r(X, X (cid:48)) < 0) + EX,X (cid:48) P {T < T (cid:48)|X, X (cid:48)} 1(r(X, X (cid:48)) > 0) = EX,X (cid:48) P {T > T (cid:48)|X, X (cid:48)} 1(r(X, X (cid:48)) < 0) + EX,X (cid:48)(1 − P {T > T (cid:48)|X, X (cid:48)})1(r(X, X (cid:48)) > 0) where r(x, x(cid:48)) = f (x) − f (x(cid:48)). Under assumption C, if f (cid:63) satisfies (15), then the largest term of the right hand side of the above equation is non-zero, leading to the result. A.4 Proof of Proposition 3.6 We first recall the definition of the exponential family we presented in the main paper. + → R Definition A.4 (Exponential family survival model). For θ : X → R, β : R A : R → R such that, for all x ∈ X, the conditional density is a curved exponential family model +, τ : R + → R, η : R → R, and μ(t|x) = β(t) exp [η ◦ θ(x)τ (t) − A ◦ θ(x)] , (18) with associated parameter θ(x). For instance, θ(x) = θ(cid:62)x in a generalized linear model. Recall also the statement of Proposition 3.6 Proposition 3.6. Under Assumption C, with θ continuous, β positive, τ non-decreasing and η continuously differentiable and non-decreasing, θ(x) is an optimal risk ordering for the C-index, thus Cμ(θ) = C (cid:63) μ. Proof. We need to prove that, for all x, x(cid:48) ∈ X, η ◦ θ(x) ≥ θ(x(cid:48)) ⇒ P {T > T (cid:48)|x, x(cid:48)} ≥ 1 2 . A Statistical Learning Take on the Concordance Index for Survival Analysis We start by showing that, under the assumptions of Proposition 3.6, the scalar exponential family (conditional) distribution μ(t|x) = ρ(t)eη◦θ(x)τ (t)−A◦θ(x) satisfies the Monotone Likelihood Ratio (MLR) property, i.e., for all x, x(cid:48) ∈ X such that θ(x) ≥ θ(x(cid:48)) and for all t1 ≥ t0, μ(t1|x) μ(t1|x(cid:48)) ≥ μ(t0|x) μ(t0|x(cid:48)) . (19) Indeed, using the canonical form we have that, for all x, x(cid:48) ∈ X such that θ(x) ≥ θ(x(cid:48)) and for all t1 ≥ t0 μ(t|x) = β(t) exp [η ◦ θ(x)τ (t) − A ◦ θ(x)] , μ(t1|x) μ(t1|x(cid:48)) = eA◦θ(x(cid:48)) eA◦θ(x) exp {τ (t1)[η ◦ θ(x) − η ◦ θ(x(cid:48))]} ≥ eA◦θ(x(cid:48)) eA◦θ(x) exp {τ (t0)[η ◦ θ(x) − η ◦ θ(x(cid:48))]} = μ(t0|x) μ(t0|x(cid:48)) , where we have used that τ (t1) ≥ τ (t0) and η ◦ θ(x) ≥ η ◦ θ(x(cid:48)) by assumption to obtain the inequality of the third line. We now prove that inequality (19) implies P {T > T (cid:48)|x, x(cid:48)} ≥ 1 2 . Indeed, P {T > T (cid:48)|x, x(cid:48)} = (cid:90) +∞ (cid:20)(cid:90) +∞ 0 t0 μ(t1|x)μ(t0|x(cid:48))dt1 (cid:21) dt0 ≥ (cid:90) +∞ (cid:20)(cid:90) +∞ 0 t0 μ(t1|x(cid:48))μ(t0|x)dt1 (cid:21) dt0 = P {T (cid:48) > T |x, x(cid:48)} A.5 Proof of Proposition 3.7 We consider the following Weibull model with varying shape parameter: S(t|x) = e−tf (x) . (20) Recall the statement of Proposition 3.7 Proposition 3.7. The Weibull model (20) satisfies assumption C but not assumption B. Proof. We have the following identity: P {T < T (cid:48)} = (cid:90) +∞ 0 exp−tα2 d(1 − exp−xα1 ) = (cid:90) +∞ 0 exp−uα2 /α1 −u du = I(α2/α1), where we have done the change of variables u = xα1 . Now we follow the proof of Proposition 1 by Lebedev (2019) and show that I(β) ≥ 1 2 if and only if β ≥ 1. The integrand is increasing in β for 0 < β < 1 and decreasing for β > 1. Let β ≥ 2, then I(β) > (cid:90) 1 0 exp−uβ −u du ≥ (cid:90) 1 0 exp−u2−u du = √ (cid:32) πe1/4 Φ √ (cid:16) 3 2 2 (cid:17) (cid:16) − (cid:33) (cid:17) √ 2 2 ≈ 0.507 > 1/2, where Φ is the c.d.f of a standard Gaussian random variable. Let 1 < β < 2. Then the function uβ−1, β > 0, is concave and its graph lies below the tangent at β = 1: As a result, uβ−1 ≤ (β − 1)u + (2 − β). uβ ≤ (β − 1)u2 + (2 − β)u, which can be used for estimating the integral as: I(β) ≥ (cid:90) ∞ 0 exp−(β−1)u2−(3−β)u du = (cid:114) π β − 1 (3−β)2 4(β−1) exp (cid:32) 1 − Φ (cid:16) 3 − β (cid:112)2(β − 1) (cid:33) (cid:17) . Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin Plotting this function (see Fig. 3 of Lebedev (2019)) we can clearly see how it exceeds 1/2. Moreover, this inequality turns into equality at the limits of the interval (Steinhaus and Trybula, 1959). We have thus proved that the shape parameter f (x) is an optimal risk ordering under the Weibull model (20), thus assumption C is satisfied. On the other hand, Assumption B is not satisfied as the expectation of a Weibull is not monotone on the shape parameter. Indeed, the expectation is given by Γ(1 + 1 f (x) ), where Γ denotes the Gamma function. This function has a minimum between 1.46 and 1.47, decreasing first and increasing for larger values. Thus, it gives a different ranking than the optimal risk ordering f , and consequently it does not define an optimal risk ordering. Assumption B is consequently not satisfied. A.6 Proof of Proposition 3.8 Recall the statement of Proposition 3.8. Proposition 3.8. Under Assumption D, the maximizer of the C-index depends on the marginal distribution of the patients covariates μ(x). Proof. As shown in Section 2.1, the maximiser of the C-index can be written as the solution of the following problem: max f EX,X (cid:48) P {T > T (cid:48)|X, X (cid:48)} 1(f (X) < f (X (cid:48))). Assume for simplicity that the marginal population has support in a finite set of elements x1, . . . , xn. Then the optimal ranking of these n points is the solution of the following combinatorial problem over the set of permutations Sn of size n: max σ∈Sn n (cid:88) i,j=1 γij1(σi < σj), where γij = pipjP {T > T (cid:48)|xi, xj}. This corresponds to the Minimum Weighted Feedback Arc Set (MWFAS) problem with weights γij. Thus, its solution clearly depends on the factor pipj under no further assumption. A Statistical Learning Take on the Concordance Index for Survival Analysis B PROOF OF RESULTS FROM SECTION 4 B.1 Proof of Theorem 4.1 We first recall below the definitions of strongly convex functions and of the Fenchel-Young conjugate. Definition B.1 (Strongly convex). A twice-differentiable strongly convex function Ω with parameter β defined in a convex domain C ⊂ R is a function satisfying Ω(cid:48)(cid:48)(u) ≥ β for all u in the domain C. Definition B.2 (Fenchel-Young conjugate (Rockafellar, 1997)). Let Ω a function with domain C. The Fenchel-conjugate Ω∗ of Ω is a convex function defined as Ω∗(v) = sup u∈C vu − Ω(u). If Ω is differentiable, then the domain of Ω∗ corresponds to the image of the gradient Ω(cid:48) union the subgradients at the boundary of the domain C. If Ω is strongly convex, then Ω∗ is continuously differentiable. Recall now the statement of Theorem 4.1 Theorem 4.1. Let Ω : C → R be a twice-differentiable strongly convex function defined in a closed convex domain C ⊇ R + such that lim|u|→∞ Ω(cid:48)(u) = +∞ where the limit is taken also to the negative real numbers if C is unbounded in this direction. Define the cost function S(v, t) = Ω∗(v) − vt where Ω∗ is the Fenchel conjugate of Ω (Rockafellar, 1997). Then, the following risk R(f ) = E(X,U,∆) ∆S(f (X), U ) G(U ) , (21) is convex, smooth, and its minimizer is a monotone transformation of the conditional expectation. Thus, under assumption B it is Fisher consistent to the C-index. Proof. Let's first consider the case without censoring where we observe the pair of random variables (X, T ). We want to prove that the minimiser f (cid:63) of the risk R(f ) = E(X,T ) S(f (X), T ) where S(v, t) = Ω∗(v) − vt is a monotone transformation of the conditional expectation. The loss function S has the following properties: - The loss S is a Fenchel-Young loss function (Blondel et al., 2020) with domain R (i.e., S : R × R + → R), which follows from the property limu→+∞ ∇Ω(u) = +∞ (and also limu→−∞ ∇Ω(u) = +∞ if C is unbounded to the indeed for any v, there exists u such that v ∈ ∂Ω(u) if u ∈ C, where ∂Ω(u) stands for the negative values). subgradient of Ω at point u, which equals just the gradient at the interior of the domain C. Thus the domain of Ω∗ is the real line (see definition B.2). - S is smooth as Ω is strongly convex (Rockafellar, 1997) (see also definition B.2). - Its minimizer f (cid:63) can be written as f (cid:63)(x) = Ω(cid:48)(CE(x)), where CE(x) = E {T |X = x} stands for the conditional + → R is monotone due to the expectation (Blondel et al., 2020). Note that the smooth transformation Ω(cid:48) : C ⊇ R convexity of Ω. When censoring is present, we can use Inverse Censoring Probability Weighting (ICPW) (Robins and Finkelstein, 2000) to construct an unbiased estimate of the risk R(f ) = E(X,T ) S(f (X), T ) = E(X,T ) E {1(T ≤ C)|X}S(f (X), T ) E {1(T ≤ C)|X} = E X E T |X E C|X 1(T ≤ C)S(f (X), T ) G(U ) = E (X,U,∆) ∆S(f (X), T ) G(U ) , where G(u) = P {C ≥ u} stands for the censoring survival function. Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin B.2 Proof of Theorem 4.2 Recall the statement of Theorem 4.2 Theorem 4.2 (Excess risk bounds). Let f (cid:63) be an optimal risk ranking satisfying (15). Let L > 0 a positive constant satisfying |2P {T > T (cid:48)|x, x(cid:48)} − 1| ≤ L|f (cid:63)(x) − f (cid:63)(x(cid:48))|, (22) for all pairs x, x(cid:48). Then, the excess risk of the C-index can be bounded as C(f (cid:63)) − C(f ) ≤ L EX |f (X) − f (cid:63)(X)|. The result will be based on a reduction to a binary classification problem using the following Lemma B.3. Lemma B.3 (Theorem 2.2 of Devroye et al. (2013)). Let Y ∈ {−1, 1} a binary random variable, and consider the binary classification risk E(r) = EZ,Y 1(r(Z)Y < 0). Then, we have that for any measurable function r : Z → R. E(r) − E(cid:63) = EZ |2P {Y |Z} − 1|1(r(Z)r(cid:63)(Z) < 0), The proof now consists in lifting the C-index ranking problem in (X, T ) into a binary classification problem to apply Lemma B.3. Let Z = (X, X (cid:48)) and Y = sign(T − T (cid:48)) ∈ {−1, 1} and consider the binary classification risk E(r) = EZ,Y 1(r(Z)Y < 0) where r : X × X → {−1, 1}. Note that the risk E is equal to the C-index if we set This can be easily seen from r(z) = r((x, x(cid:48))) = 1(f (x) ≥ f (x(cid:48))). C(f ) = E 1(f (X) > f (X (cid:48)), T > T (cid:48)) = = 1 2 1 2 E 1((f (X) − f (X (cid:48)))(T − T (cid:48)) < 0) E 1(r(Z)Y < 0) = 1 2 E(r). Moreover, as the maximizer r(cid:63) of the binary classification risk is known to be r(cid:63)(z) = 1(2P {Y = 1|z} ≥ 1) and f (cid:63) satisfies the optimal risk ranking condition (15), we also have r(cid:63)(z) = 1(f (cid:63)(x) ≥ f (cid:63)(x(cid:48))). Thus, applying Lemma B.3 we obtain that 1 2 where rx,x(cid:48)(f, f (cid:63)) = 1((f (cid:63)(x) − f (cid:63)(x(cid:48)))(f (x) − f (x(cid:48))) < 0). Using now (22) we obtain EX,X (cid:48){|2P {T > T (cid:48)|x, x(cid:48)} − 1|rX,X (cid:48)(f, f (cid:63))}, C (cid:63) − C(f ) = {|2P {T > T (cid:48)|x, x(cid:48)} − 1|rx,x(cid:48)(f, f (cid:63))} ≤ L|f (cid:63)(x) − f (cid:63)(x(cid:48))|rx,x(cid:48)(f, f (cid:63))} ≤ L|f (cid:63)(x) − f (x) − (f (cid:63)(x(cid:48)) − f (x(cid:48)))| ≤ L(|f (cid:63)(x) − f (x)| + |f (cid:63)(x(cid:48)) − f (x(cid:48))|). where we have used that ab ≤ 0 =⇒ |a| ≤ |a − b| for a, b ∈ R. Finally, taking the expectation over the i.i.d. pairs X, X (cid:48) on both sides of the inequality we obtain the desired result. B.3 Proof of Proposition 4.3 Recall the statement of Proposition 4.3. Proposition 4.3. Condition (22) is satisfied by: (i) The PH model with L = 1. (ii) The AFT model with L the Lipschitz constant of the cumulative distribution function of the symmetric random variable ε − ε(cid:48). (iii) The AFT-H model (17) with L is the Lipschitz constant of the cumulative distribution function of ε scaled by a factor a where σ(x) ≥ 1/a for all x. (iv) The exponential family. A Statistical Learning Take on the Concordance Index for Survival Analysis Cox model (i). In the Cox PH model, condition (22) of Thm. 4.2 is satisfied with L = 1. This comes from the identity P {T > T (cid:48)|x, x(cid:48)} = = (cid:90) +∞ 0 (cid:90) +∞ 0 h(t|x)S(t|x)S(t|x(cid:48))dt h0(t)ef (x)e− (cid:82) t 0 h0(τ )dτ (ef (x)+ef (x(cid:48) ))dt = ef (x) ef (x) + ef (x(cid:48)) , where at the last identity we have done the change of variables u = − (cid:82) t 0 h0(τ )dτ . The final results follows from: |2P {T > T (cid:48)|x, x(cid:48)} − 1| = |ef (x) − ef (x(cid:48))| ef (x) + ef (x(cid:48)) = max(ef (x), ef (x(cid:48))) ef (x) + ef (x(cid:48)) |f (x) − f (x(cid:48))| ≤ |f (x) − f (x(cid:48))|. AFT model (ii). Under the AFT model we have the following identity: P {T > T (cid:48)|x, x(cid:48)} = P {log T > log T (cid:48)|x, x(cid:48)} = P {f (x) − f (x(cid:48)) > ε − ε(cid:48)} = Fε−ε(cid:48)(f (x) − f (x(cid:48))), where Fε−ε(cid:48) is the cumulative distribution function of the symmetric random variable ε − ε(cid:48). Thus, inequality (22) is satisfied with the Lipschitz constant of the Fε−ε(cid:48). AFT-H model (iii). follows the same law as (cid:112)(σ(x)2 + σ(x(cid:48))2)ε. Using this and performing the same computations as for the AFT model, we obtain the follow- ing identity: the symmetric random variable σ(x)ε − σ(x(cid:48))ε(cid:48) Note that |2P {T > T (cid:48)|x, x(cid:48)} − 1| = Fε (cid:32) f (x) − f (x(cid:48)) (cid:112)σ(x)2 + σ(x(cid:48))2 (cid:33) . If σ(x) ≥ a > 0 for all x, then (cid:32) Fε f (x) − f (x(cid:48)) (cid:112)σ(x)2 + σ(x(cid:48))2 (cid:33) ≤ L (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) f (x) − f (x(cid:48)) (cid:112)σ(x)2 + σ(x(cid:48))2 (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) ≤ L √ 2a |f (x) − f (x(cid:48))|. Exponential family model (iv). Assume the conditional time-to-event density writes, for x ∈ X, μ(t|x) = β(t) exp [η ◦ θ(x)τ (t) − A ◦ θ(x)] , where θ and A are continuous functions, and η and τ are continuous, non-decreasing functions. Assume further that X is compact (this assumption is satisfied, e.g., if all covariates are bounded). Note that, by continuity of the application θ, θ(X) is also compact; without loss of generality, we assume Θ = θ(X). Then, the following Proposition holds. Proposition B.4. There exists L > 0 such that, for all (x, x(cid:48)) ∈ X2, |2P {T > T (cid:48)|x, x(cid:48)} − 1| ≤ L |θ(x) − θ(x(cid:48))| . Proof. Consider the function G : Θ → R + defined by where, for all θ ∈ Θ, and Gθ0 (θ) = (cid:90) +∞ 0 S(t; θ0)μ(t; θ)dt, μ(t; θ) = β(t) exp [η(θ)τ (t) − A(θ)] S(t; θ0) = (cid:90) +∞ t β(t1) exp [η(θ0)τ (t) − A(θ0)] dt1. First, t (cid:55)→ S(t; θ0)μ(t; θ) is integrable w.r.t. the variable t. Second, θ (cid:55)→ S(t; θ0)μ(t; θ) is continuously differentiable w.r.t. the variable θ. Third, since Θ is compact and η, A are continuous, η− ≤ η(θ) ≤ η+ and A− ≤ A(θ) ≤ A+ for all for all θ ∈ Θ; we obtain that for all t ∈ R + and for all θ ∈ Θ, S(t; θ0)μ(t; θ) ≤ S(t; θ0)β(t) exp [max{η−τ (t), η+τ (t)} − A−] . Alex Nowak-Vila, Kevin Elgui, Genevi`eve Robin Thus, by the dominated convergence theorem, Gθ0 is differentiable w.r.t. θ, and G(cid:48) θ0 (θ) = (cid:90) +∞ 0 S(t; θ0)μ(cid:48)(t; θ)dt. We now use similar arguments to show that G(cid:48) is continuous. First, t (cid:55)→ S(t; θ0)μ(cid:48)(t; θ) is integrable w.r.t. the variable θ0 t. Second, θ (cid:55)→ S(t; θ0)μ(cid:48)(t; θ) is continuous w.r.t. the variable θ. Third, since Θ is compact and η, A are continuous, η− ≤ η(θ) ≤ η+ and A− ≤ A(θ) ≤ A+ for all for all θ ∈ Θ; we obtain that for all t ∈ R + and for all θ ∈ Θ, S(t; θ0)μ(t; θ) ≤ S(t; θ0)β(t) (max{η−τ (t), η+τ (t)} − A−) × exp (max{η−τ (t), η+τ (t)} − A−) . (23) (24) By the dominated convergence theorem, G(cid:48) is continuous w.r.t. θ. We obtain that Gθ0 is continuously differentiable w.r.t. θ0 θ on a bounded domain. It is thus Lipschitz continuous, and there exists a positive constant Lθ0 such that, for all θ, ̃θ ∈ Θ, |Gθ0(θ) − Gθ0( ̃θ)| ≤ Lθ0 |θ − ̃θ|, where | * | denotes the Euclidean norm on Θ. The final step consists in proving that the family of constants {Lθ0}θ0∈Θ are uniformly bounded. To do so, it suffices to show that the derivative G(cid:48) θ0 (θ) is bounded uniformly for all θ0 and for all θ. Using (23), we obtain that G(cid:48) θ0 (θ) ≤ (cid:90) +∞ 0 {S(t; θ0)β(t) (max{η−τ (t), η+τ (t)} − A−) × exp (max{η−τ (t), η+τ (t)} − A−−)}dt. S(t; θ0) ≤ (cid:90) +∞ t β(t) exp [max{η−τ (t1), η+τ (t1)} − A−] dt1. Noticing that completes the proof. B.4 Proof of Theorem 4.5 Recall the statement of Theorem 4.5 Theorem 4.5. Let R be the risk defined in (21). Under assumption B, the following inequality holds: C (cid:63) − C(f ) ≤ 2Lγ(cid:112)R(f ) − R(cid:63), where Ω(cid:48)(cid:48)(u) ≥ 1/γ2 for all u in the domain C. Proof. We can safely assume there is no censoring (R(f ) = E (X,T )S(f (X), T )); if there is censoring we can just use the ICPW technique described in the proof of Theorem 4.1 to write the expectation in terms of (X, U, ∆). We assume that (22) is satisfied by the conditional expectation CE as |2P {T > T (cid:48)|x, x(cid:48)} − 1| ≤ L| CE(x) − CE(x(cid:48))|, so applying Thm. 4.2 we obtain C(f (cid:63)) − C(h) ≤ L EX |h(X) − CE(X)|. The result is based on the excess risk bound proof by Nowak-Vila et al. (2019). If S is a Fenchel-Young loss Blondel et al. (2020) then we can write R(f ) − R(cid:63) = EX DΩ(CE(X), ∇Ω∗(f (X))), where DΩ(u, v) = Ω(u) − Ω(v) − ∇Ω(v)(cid:48)(u − v) is the Bregman divergence of the convex function Ω at the pair of points u, v (Blondel et al., 2020). Moreover, if Ω is 1/γ2 strongly convex (i.e., Ω(cid:48)(cid:48) ≥ 1/γ2), then (u − v)2 ≤ 2γ2DΩ(u, v). A Statistical Learning Take on the Concordance Index for Survival Analysis Then, the final result follows from Cauchy-Schwartz: C(f (cid:63)) − C(f ) = C(f (cid:63)) − C(∇Ω∗(f )) =≤ L EX |∇Ω∗(f (X)) − CE(X)| ≤ L(cid:112)EX |∇Ω∗(f (X)) − CE(X)|2 ≤ 2Lγ(cid:112)EX DΩ(CE(X), ∇Ω∗(f (X))) = √ √ 2Lγ(cid:112)R(f ) − R(cid:63).
http://arxiv.org/abs/2302.12718v1
2023-02-23T14:28:55
2023-02-23T14:28:55
Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data
We study the problem of inferring heterogeneous treatment effects (HTEs) from time-to-event data in the presence of competing events. Albeit its great practical relevance, this problem has received little attention compared to its counterparts studying HTE estimation without time-to-event data or competing events. We take an outcome modeling approach to estimating HTEs, and consider how and when existing prediction models for time-to-event data can be used as plug-in estimators for potential outcomes. We then investigate whether competing events present new challenges for HTE estimation -- in addition to the standard confounding problem --, and find that, because there are multiple definitions of causal effects in this setting -- namely total, direct and separable effects --, competing events can act as an additional source of covariate shift depending on the desired treatment effect interpretation and associated estimand. We theoretically analyze and empirically illustrate when and how these challenges play a role when using generic machine learning prediction models for the estimation of HTEs.
[ "Alicia Curth", "Mihaela van der Schaar" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12718v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12718v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ME", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ME", "cs.LG", "stat.ML" ]
Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data 3 2 0 2 b e F 3 2 ] E M . t a t s [ 1 v 8 1 7 2 1 . 2 0 3 2 : v i X r a Alicia Curth University of Cambridge Mihaela van der Schaar University of Cambridge, The Alan Turing Institute Abstract We study the problem of inferring heteroge- neous treatment effects (HTEs) from time-to- event data in the presence of competing events. Albeit its great practical relevance, this prob- lem has received little attention compared to its counterparts studying HTE estimation with- out time-to-event data or competing events. We take an outcome modeling approach to estimat- ing HTEs, and consider how and when exist- ing prediction models for time-to-event data can be used as plug-in estimators for potential out- comes. We then investigate whether competing events present new challenges for HTE estima- tion – in addition to the standard confounding problem –, and find that, because there are mul- tiple definitions of causal effects in this setting – namely total, direct and separable effects –, com- peting events can act as an additional source of covariate shift depending on the desired treat- ment effect interpretation and associated esti- mand. We theoretically analyze and empirically illustrate when and how these challenges play a role when using generic machine learning predic- tion models for the estimation of HTEs. 1 INTRODUCTION Competing events are ubiquitous in medical applications where the focus is on the time until occurrence of an ad- verse event due to a specific cause (Lim et al., 2010; Lam- bert et al., 2010). Especially when patients have comor- bidities, the effect of a treatment on an event of interest can only be assessed when taking into account the presence of risk due to a competing event. For example, when assess- ing the effectiveness of different cancer treatments for in- dividual cancer patients one may have to consider how to Proceedings of the 26th International Conference on Artificial Intelligence and Statistics (AISTATS) 2023, Valencia, Spain. PMLR: Volume 206. Copyright 2023 by the author(s). take into account how an individual's risk for cardiovas- cular events changes due to treatment. This question, how- ever, is far from straightforward: competing events – which act as mediators of the treatment on the outcome of interest – give rise to multiple and different definitions of coun- terfactual risk that could be used depending on the policy or research question of interest, as recently formalized in Young et al. (2020). To see this, note that a treatment which causes a high number of cardiovascular events will auto- matically result in fewer events due to cancer – which will appear as a protective (total) effect of treatment on the risk of events due to cancer, but may not be the desired inter- pretation of what makes a treatment effective against an ad- verse outcome of interest. Instead, one could be interested in the direct effect of treatment on outcome (under elimi- nation of competing events) or in the effect of the compo- nent in the treatment on outcome that acts only on the pri- mary outcome (Young et al., 2020; Stensrud et al., 2020). Related work. Possibly because of this conceptual dif- ficulty, heterogeneous treatment effect (HTE) estimation from time-to-event (TTE) data with competing events has received no attention from the machine learning (ML) liter- ature yet. This stands in stark contrast with the ML litera- ture on closely related problems – (a) TTE prediction with competing events (sometimes also referred to as 'compet- ing risks') and (b) HTE estimation with other outcomes – which has flourished in recent years. The literature on the former has adapted a variety of ML methods for risk pre- diction in the presence of competing events – e.g. using Bayesian nonparametric methods in continuous time (Alaa and van der Schaar, 2017b; Zhang and Zhou, 2018) and neural networks in discrete time (Lee et al., 2018; Wang and Sun, 2022). The literature on the latter has focused on HTE estimation for binary or continuous outcomes, and has either provided model-agnostic strategies to estimate HTEs using any ML method (K ̈unzel et al., 2019; Nie and Wager, 2017; Kennedy, 2020; Curth and van der Schaar, 2021a) or adapted specific ML methods to correct for specific chal- lenges of HTE estimation (Shalit et al., 2017; Curth and van der Schaar, 2021b). The largest stream of this litera- ture has focused on analyzing and correcting confounding- induced covariate shift (Shalit et al., 2017; Johansson et al., 2018; Hassanpour and Greiner, 2019; Assaad et al., 2021). Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data Closest to our setting are two recent papers that have in- vestigated covariate shift challenges inherent to HTE esti- mation for TTE data without competing events: Chapfuwa et al. (2021) used generative models for counterfactual TTE analysis in continuous time and Curth et al. (2021a) used neural networks for discrete time analyses. An extended discussion of related work can be found in Appendix A. Outlook. In this paper, we study heterogeneous treat- ment effect estimation in the presence of competing events through the causal framework recently established in Young et al. (2020) and used therein to derive estimators for different average treatment effects. We begin by con- sidering how the ML toolbox developed for individualized risk prediction in the TTE setting with and without compet- ing events could be used for estimation of different HTEs through a potential outcome modeling approach, or con- versely, consider what type of effects are implicitly targeted when different types of ML risk prediction algorithms are used as a basis for treatment decisions. As the ML literature on HTE estimation has focused on the presence of covari- ate shifts due to confounders, we then move to investigate which forms of covariate shift arise as we target different HTEs. We finally investigate and illustrate their effects em- pirically across simulation studies. Note that – possibly un- conventionally for this literature – our focus here is not on designing or proposing a new method, but rather on un- derstanding the unique challenges in a new and practically relevant problem which is why we rely on simple existing methods to allow for clear insights. Our contributions are thus threefold: Conceptually, we study a new problem in the ML literature on HTE esti- mation and investigate how one could make use of the strong TTE estimation ML toolbox for solving it. The- oretically, we analyze covariate shift problems that arise therein. Empirically, we obtain insights into how estima- tion is affected in practice. Overall, we focus on under- standing the challenges underlying the problem, hoping that the insights that we provide will pave the way for future methodological work on this practically relevant problem. 2 PROBLEM SETUP We adopt the setup of (Young et al., 2020; Stensrud et al., 2020) in which patients are characterized by pre-treatment characteristics X∈X , a binary treatment A∈{0, 1} assigned at baseline, and {Yk}k∈{1,...,K} and {Dk}k∈{1,...,K}, bi- nary indicators for whether the main event and competing event, respectively, have occurred by time period k ≤ K, where K is the maximum time of follow-up. By conven- tion, we assume that Dk precedes Yk, and that occurrence of either event precludes the other. Further, ̄Vκ denotes the history (V0, . . . , Vκ) of variable Vk through interval κ. Fig. 1 depicts the assumed underlying causal graph. This data structure, which is in so-called long format, can equivalently be represented in short format of tuples (X, A, T, E) where T indicates the (discrete) time at which the event occurred (i.e. T = min k : Yk=1 ∨ Dk=1) and E ∈ {Y, D} indicates its type (i.e. E=Y if YT =1 else D). We will generally use long format as it uniquely allows to capture the sequential na- ture of the problem, but will sometimes use the short for- mat when it simplifies no- tation. We also assume no loss to follow-up due to cen- soring (i.e. no patient drop-out) for simplicity, but discuss later in Sec. 4.2 how censoring would play a role. Figure 1: Assumed Causal Graph Based on the assumed causal structure in Fig. 1, it is easy to see that we can model all risk functions of interest in the competing events literature – e.g. the cause-specific cumu- lative incidence functions P(T ≤ k, E = Y |X = x, A = a) – by relying on conditional hazard functions. These are the hazard (probability) of the main event occurring given that there has been no event yet, i.e. hY (k, x, a) = P(Yk=1| ̄Dk= ̄Yk−1=0, X=x, A=a) and, analogously, the hazard of the competing event occur- ring given event-free history hD(k, x, a) = P(Dk=1| ̄Dk−1= ̄Yk−1=0, X=x, A=a) These can be used to model e.g. the cause-specific cumu- lative incidence function, or risk, of an event occurring by time k, as P(T ≤ k, E=Y |X=x, A=a)= P(Yk=1|X=x, A=a)= (cid:80)k ×(cid:81)l−1 l=1 hY (l, x, a) q=1(1−hY (q, x, a))(1−hD(q, x, a)) (1) 3 DEFINING AND ESTIMATING HTE GIVEN COMPETING EVENTS 3.1 Preliminaries: Estimating HTEs from TTE data without competing events using prediction models To introduce the HTE estimation problem, counterfactuals and existing strategies for estimation, we begin with the simpler setting in which there are not competing events. Define the counterfactuals1 (or potential outcomes) Y a k for a ∈ {0, 1} and times k ∈ {1, . . . , K} as the event indicator for the scenario in which a patient – possibly countrary to fact – has been assigned to treatment A=a at baseline, i.e. has been intervened on. Then, we can define heterogeneous 1Here, we use the term counterfactual following e.g. Young et al. (2020); Stensrud et al. (2020) exchangeably with the term potential outcome, which is different from Pearl (2009)'s usage of the term; within Pearl's framework we only consider interven- tional quantities. Throughout, our counterfactuals/potential out- comes Y a or Y a, ̄d correspond to do-operations do(A = a) or do(A = a, ̄DK = ̄d), respectively. Alicia Curth, Mihaela van der Schaar treatment effects τ (x) as contrasts of functions of these po- tential outcomes: For example, if we are interested in dif- ferences in risk of the event occuring by the end of study K, we have that for a patient with characteristics X=x, the treatment effect is τ (x) = P(Y 1 K = 1|X = x) − P(Y 0 K = 1|X = x) (2) Under the standard ignorability assumptions (Rosenbaum and Rubin, 1983) – which ensure that ̄Y a k |=A|X for all k and randomness in treatment assignment for all x – we have that P(Y a k = 1|X = x) = P(Yk = 1|X = x, A = a). Therefore a simple and popular way to estimate HTEs is through outcome modeling: fitting a standard supervised learning model to predict YK as ˆμa(x) = ˆP(YK = 1|X = x, A = a) e.g. by appending A to X like a standard covariate, or by fitting two separate prediction models, one on each treat- ment group (these two strategies are often referred to as S- and T-learner, respectively (K ̈unzel et al., 2019)). Then, the HTE can be estimated as ˆτ (x) = ˆμ1(x) − ˆμ0(x). 3.2 Total effects: Using competing event prediction models for estimating HTEs in the presence of competing events allows to estimate total effects In a competing events setting, we can similarly define coun- terfactuals under intervention on treatment Y a k (and analo- gously for the competing event resulting in Da k). At first glance, applying the same treatment effect estimation strat- egy discussed above to the setting with competing events seems appealing: one could use one of the recently pro- posed predictive ML models for the cause-specific cumu- lative incidence function (e.g. Lee et al. (2018)'s DeepHit or any other model that allows to estimate eq. (1)) and es- timate treatment effect on risk as the difference ˆτ (x)=ˆP(YK=1|X=x, A=1)−ˆP(YK=1|X=x, A=0) which, under similar ignorability assumptions, formalized below, is a valid approach. event: Even when the treatment does not affect the pri- mary event at all, it is possible that P(Y 1 K = 1|X = x) (cid:54)= P(Y 0 K = 1|X = x) if treatment affects the competing event because this affects how many individuals are available to experience the event (in other words, competing events act as mediators in this context (Young et al., 2020)). Formally, this is because, as can be seen in eq. 1, P(Y a K = 1|X = x) depends on the conditional hazard of both the primary and the competing event – thus even if hY (k, x, a) is indepen- dent of a, the cause-specific risk may not be if hD(k, x, a) changes with treatment. Fig. 2(A) illustrates the treatment effect's path associated with a total effect. To see why this may be undesirable, consider a cancer treatment that causes all patients in some subgroup in the treatment arm to experience heart failure but has no actual effect on their cancer-related events: in this case, the total effect would show that treatment reduces the total risk of events due to cancer in this subgroup, but this is only true because no patients are available to experience cancer-related events. Note that this is not a problem with the identification of ef- fects, but rather a feature when using cause-specific risks to estimate effects. Thus, when using cause-specific risks and associated total effects for individualized treatment de- cision making one should be aware that this results in en- tanglement of different treatment effect pathways. Remark: Focusing on all-cause survival. A simple way to overcome the competing events problem could be to com- bine outcomes as Y all k = Yk ∨ Dk, i.e. letting go of the distinction of causes, and thus consider the overall effect of treatment on all-cause survival. We do not consider this approach further here as this changes the outcome of in- terest, does not give competing events a special status and can thus be regarded a simple TTE analysis problem to be solved with e.g. the strategies discussed in Chapfuwa et al. (2021); Curth et al. (2021a). 3.3 Direct Effects: Using TTE models that treat competing events as censoring allows to estimate direct effects k , Da Assumption 1 (Ignorability w.r.t. treatment) For (i) Exchangeabil- each k ∈ {1, . . . , K}, we have: ity w.r.t. A: Y a k|=A|X, (ii) Positivity w.r.t. A: P(A = a|X = x) > 0 for ∀x : P(X = x) > 0 and a ∈ {0, 1} and (iii) Consistency w.r.t. A: We observe the counterfactuals associated with the given treatment A, i.e. Yk = AY 1 k and Dk = AD1 k + (1 − A)Y 0 k + (1 − A)D0 k However, using competing event prediction models, which output cause-specific risks, in this way estimates a specific type of treatment effect – a total effect (Young et al., 2020) – which may not always be the effect of most natural in- terest to an investigator. This is because probabilities out- putted by cause-specific models depend not only on the oc- currence of the primary event, but also on the competing K Another type of counterfactual one could therefore be in- terested in estimating is Y a, ̄d=0 , where an additional in- tervention is made and the competing event is eliminated: That is, an intervention that sets the entire history ̄DK to the deterministic value ̄d = 0. Considering differences τ (x) = P(Y 1, ̄d=0 = 1|X = x) then corresponds to direct effects of treatment onto the event of interest (Young et al., 2020). Fig. 2(B) illustrates the treatment effect's path associated with a direct effect. This effect is identified under Assumption 1 and an addi- tional strong assumption: = 1|X = x) − P(Y 0, ̄d=0 K K Assumption 2 (Ignorability w.r.t. competing event.) For each k ∈ {1, . . . , K}, we have: (i) Exchangeability: k|X, ̄Yk−1= ̄Dk−1=0, A=a, (ii) Positivity w.r.t. D: Y a k |=Da Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data Figure 2: Illustration of the path of total, direct and separable direct effect of treatment A onto Y2. w.r.t. D: P(Dk = 0|X = x, ̄Yk−1 = ̄Dk−1 = 0, A = a) > 0 whenever P(X = x, ̄Yk−1 = ̄Dk−1 = 0, A = a) > 0, (iii) Consistency w.r.t. elimination of D: For an observation with A = a and ̄Dk = 0 we observe the corresponding counterfactual, i.e. ̄Yk = ̄Y a, ̄d=0 . k Then it from observational data, as P(Y a, ̄d=0 P(YK=1| ̄DK=0, A=a, X=x), using the formula is also possible to estimate direct effects =1|X = x) = K P(Y a, ̄d=0 K =1|X=x) = K (cid:88) l=1 hY (l, x, a) l−1 (cid:89) q=1 (1−hY (q, x, a)) relative to the total risk, where, the dependence on hD(l, x, a) has been removed. That is, the direct risk treats competing events like a source of independent censoring (Young et al., 2020). This direct effect can therefore also be estimated using off-the-shelf ML methods using outcome modeling. In this case, however, one would no longer need to model the competing event as a separate cause, but in- stead treat it as a censoring event and use single survival models for YK only as e.g. Curth et al. (2021a) or simply use only the cause-specific hazard functions hY (l, x, a) if they are available from a competing events model. Note that direct effects not only require stronger identifying assumptions than total effects, but the presence of the in- tervention do( ̄DK = 0) also introduces a conceptual chal- lenge: such a hypothetical intervention may not always be feasible (Stensrud et al., 2020) – e.g. an intervention elimi- nating all risk of cardiovascular events in cancer trial could be somewhat hard to conceptualize. 3.4 Separable Effects: Estimating path-specific (separable) effects requires access to hazard estimators A final alternative effect definition, presenting fewer con- ceptual challenges than direct effects, was recently pro- posed in Stensrud et al. (2020): separable direct and in- direct effects are path-specific effects that assume A con- ceptually consists of components AY and AD, which af- fect only the primary event Yk and the competing event Dk, respectively. While we have that A=AY =AD in the observed data, we could hypothesize an intervention that sets AD and AY to separate values. This could be plau- sible if a treatment may consist of different active compo- nents with different biological functions that could be de- activated in the future (Stensrud et al., 2020) – allowing to define counterfactuals Y aY ,aD ) which can be used to e.g. investigate separable direct effects on risk E[Y 1,aD K |X=x] and separable indirect effects on risk E[Y aY ,1 K |X=x]. Fig. 2(C) illustrates the treat- ment effect's path associated with a separable direct effect. K − Y 0,aD K −Y aY ,0 (and DaY ,aD k k Risk under separable treatments can be estimated from ob- served data (where treatment was not separated) under As- sumption 1 and additional Assumption 3, which, as dis- cussed in Appendix C, has implications similar to Assump- tion 2 needed for direct effect estimation. Assumption 3 (Identification w.r.t. separable treatment.) For each k ∈ {1, . . . , K}, we have: (i) Dismissible com- ponents: P(Y aY ,aD=1 k P(Y aY ,aD=0 k =1| ̄Y aY ,aD=1 k−1 =0, ̄DaY ,aD=1 k =0, X=x) = =1| ̄Y aY ,aD=0 k−1 =0, ̄DaY ,aD=0 k =0, X=x) and Day=1,aD k and a similar condition equalizing the conditional hazards of Day=0,aD (see Appendix C), (ii) positivity k w.r.t. A (in surviving population): P(A = a| ̄Dk = ̄Yk = 0, X = x) > 0 whenever P( ̄Dk = ̄Yk = 0, X = x) > 0 for a ∈ {0, 1}, (iii) Consistency: For an observation with A = a, we observe the corresponding counterfactuals, i.e. Yk = Y a,a and Dk = Da,a k . k Then, risk under separable components can be estimated as P(Y aY ,aD K = 1|X = x) = K (cid:88) l=1 hY (l, x, aY ) l−1 (cid:89) (1−hY (q, x, aY ))(1−hD(q, x, aD)) q=1 which differs from the identification formula for total risk in that it evaluates the hazard of the competing event un- der treatment aD (cid:54)= aY . As no current ML prediction models target such separable treatment paths, most TTE models cannot directly be used by e.g. including treatment as a standard covariate and simply issuing predictions; yet any TTE model from which conditional hazard estimates ˆhD(k, x, a) and ˆhY (k, x, a) can be extracted can be used to estimate separable risk through computation of the for- mula above instead of issuing its standard predictions. Remark: Implications for the use of TTE prediction models for treatment decision making. Some existing work propos- ing ML TTE competing events prediction methods use the Alicia Curth, Mihaela van der Schaar example of making treatment plans as motivation for their method (e.g. Alaa and van der Schaar (2017b)). We there- fore wish to reemphasize that, through our discussion in this section, it becomes clear that the use of different types of TTE prediction methods implicitly means considering different types of effects in this context. Assuming that the necessary identifying assumptions hold, when TTE predic- tion models that explicitly model competing events (e.g. Alaa and van der Schaar (2017b); Lee et al. (2018)) are used to inform treatment plans, this implicitly corresponds to consideration of total effects, while approaches treat- ing competing events as censoring events implicitly lead to consideration of direct effects. As discussed above, sep- arable effects are generally not implicitly a by-product of generic TTE prediction methods. 4 UNDERSTANDING COVARIATE SHIFTS DUE TO COMPETING EVENTS identifying assumptions described Assuming that all above2 hold, all different types of treatment effects can be estimated from observed data – yet not without further challenges. Because the data available for training fol- lows an observational distribution, while the target quan- tities are defined with respect to interventions, covariate shift arises. Covariate shift arising due to treatment se- lection on observables (confounding) has been studied in detail in the ML literature on HTE estimation with stan- dard (binary/continuous) outcomes since Johansson et al. (2016); Shalit et al. (2017). More recently, Chapfuwa et al. (2021) tackled only confounding-induced covariate shift in the context of survival outcomes, and Curth et al. (2021a) showed that censoring acts as an additional source of co- variate shift in the TTE setting. In this section, we take a closer look at how covariate shift can arise in the TTE setting with competing events when learning treatment-specific hazard functions from observa- tional data. We show that, because the different effects are defined with respect to different interventions, competing events can act as an additional source of covariate shift de- pending on the chosen treatment effect of interest. 4.1 Learning treatment-specific hazard functions Here, we focus on learning hazard functions because they can be (a) used to compute all treatment effects defined in the previous section, and (b) easily estimated using off-the- shelf ML methods simply by restricting the training set – and can thus be analyzed like a standard supervised learn- ing problem. The simplest and most flexible problem for- mulation, which we focus on here, imposes no assumption on how hazards evolve over time (e.g. no proportional haz- 2Appendix C contains extended discussions of assumptions. ards assumption) or on how treatment affects outcome, by fitting a separate model for each conditional hazard, giving an estimator for each time-step by treatment group by event type (i.e. K ×2×2 estimators in total). To do so, inspired by the approach described in e.g. Stitel- man and van der Laan (2010); Curth et al. (2021a) in the standard TTE setting, we simply separate the observed data Dobs = {(Xi, Ai, ̄YK,i, ̄DK,i}n i=1 by treatment group, and then, for each time step k, first fit a classification model for outcome Dk and then fit a classification model for outcome Yk, by using only the patients still at risk of the events: That is, for each time-step k, we estimate ˆhD(k, x, a) = ˆP(Dk = 1| ̄Dk−1= ̄Yk−1=0, X=x, A=a) by solving a standard classification problem with input-output tuples DD a,k={(Xi, Dk,i)}i∈ID(k,a) where ID(k, a)={i ∈ [n] : ̄Dk−1,i = ̄Yk−1,i = 0, Ai = a} is the competing at- risk set at time-step k with nD k,a=|ID(k, a)|, and estimate ˆhY (k, x, a)= ˆP(Yk =1| ̄Dk,= ̄Yk−1,=0, X=x, A=a) by fit- ting a classification model for input-output tuples DY a,k = {(Xi, Yk,i)}i∈IY (k,a) using patients remaining in the main at-risk set IY (k, a)={i ∈ [n] : ̄Yk−1,i= ̄Dk,i=0, Ai=a}, with nY k,a=|IY (k, a)|, at time-step k. 4.2 How does covariate shift arise? When fitting the conditional hazard for the main event3 us- ing empirical risk minimization (ERM) for the classifica- tion approach described above, the hazard estimator is ˆhY (k, x, a) ∈ arg min h∈H ˆRobs a,k(h) X∼pobs a,k(h)= (cid:80) ˆRobs version where the E i∈IY (a,k) (cid:96)(Yk,i, h(Xi)) risk Robs of is = empirical the a,k,Yk∼hY (k,x,a)[(cid:96)(Yk, h(X))], H denotes the hy- pothesis class under investigation, (cid:96) is some loss function and Pobs a,k refers to the observational at-risk covariate distri- a,k(X = x) = P(X=x| ̄Yk−1= ̄Dk=0, A=a) bution, i.e. Pobs a,k(h) ∝ P(X=x)P(A=a|X = x)(1−hD(k, x, a)) × (cid:81)k−1 l=1 (1−hD(l, x, a))(1−hY (l, x, a)) (3) Our target distribution, however, tional distribution: der consideration are associated with different of interventions, responds to an interventional distribution Pint rise to the (hypothetical) interventional risk Rint E the observa- is not because the treatment effects un- types the target covariate distribution cor- a,k, giving a,k(h) = a,k,Yk∼hY (k,x,a)[(cid:96)(Yk, h(X))]. This mismatch be- tween observed and target distribution is known as co- variate shift and has as a consequence that the learnt X∼pint 3From here on, we focus on our discussion on the main event, but analogous derivations can be made when effects on the com- peting event are of interest, where the observational distribution is P(X = x| ̄Yk−1=Dk−1=0, A=a). Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data function is not necessarily optimal as it is possible that arg minh∈H Rint a,k(h) (cid:54)= arg minh∈H Robs a,k(h). It is well- known that such a mismatch can be addressed by relying Pint a,k(X=x) on so-called importance weights w∗(x) ∝ a,k(X=x) to Pobs give ˆRw,obs i∈IY (a,k) w∗(Xi)(cid:96)(Yk,i, h(Xi)) which is unbiased for the interventional risk. Below, we dis- cuss the type of covariate shift and associated importance weights arising when conceptualizing the interventions for the three effects under investigation: (h)= (cid:80) a,k a,k • Total effect: The total effect requires only an interven- tion on treatment do(A = a), thus, as can be read off from the causal graph in Fig. 1, the interventional at-risk distri- bution Pdo(A=a) (X = x) is proportional to P(X=x)(1 − hD(k, x, a)) (cid:81)k−1 l=1 (1−hD(l, x, a))(1−hY (l, x, a)), which differs from the observational distribution only in the treat- ment assignment factor P(A=a|X=x). That is, if treat- ment was assigned completely at random as in a random- ized trial, the two distributions Pobs a,k would be the same. The covariate shift arising when estimating to- tal effects is thus the same shift arising in the standard treatment effect setting considered in e.g. Shalit et al. (2017), leading to time-independent importance weights w∗,do(A=a) (x) ∝ P (A=a|X=x)−1. a,k and Pint a,k a,k • Direct effect: The direct effect requires intervention do(A=a, ̄DK=0), which, in addition to treatment assign- ment bias, also removes all competing events. There- the interven- fore, as can be read off from Fig. 1, tional at-risk distribution Pdo(A=a, ̄DK =0) (X = x) ∝ P(X=x) (cid:81)k−1 l=1 (1−hY (l, x, a)). This differs from the ob- servational distribution in both the absence of the treat- ment assignment factor and removes all effects of com- peting event on the population composition through re- moval of the factor (cid:81)k the latter re- sults in covariate shift only if the risk of the compet- ing event is dependent on covariates. As discussed in the competing event is effectively treated Section 3.3, as a censoring event here and the shift is thus equiv- alent to the censoring-induced shift discussed in Curth et al. (2021a). The importance weights needed to cor- rect for this shift would thus be w∗,do(A=a, ̄DK =0) (x) ∝ (cid:104) P (A=a|X=x) (cid:81)k l=1(1−hD(l, x, a)); l=1(1−hD(l, x, a)) (cid:105)−1 a,k . • Separable effects: Finally, separable effects require separate interventions on both treatment components do(AY =aY , AD=aD), thus the interventional distribution Pdo(AY =aY ,AD=aD) (X = x), which is identified due to the dismissible component condition (see Appendix C), is proportional to a,k P(X=x)(1−hD(k, x, aD)) (1−hD(l, x, aD))(1−hY (l, x, aY )) × k−1 (cid:89) l=1 the that factor and in that This differs the treatment assignment (cid:81)k l=1(1−hD(l, x, aD)) instead of (cid:81)k latter from the observational distribution in it has l=1(1−hD(l, x, aY )). in treat- is dependent on covari- The importance weights needed to correct for (x) ∝ Note the at-risk distribution only if ment on the competing event ates. this shift would thus be w∗,do(AY =aY ,AD=aD) (cid:104) the effect of in covariate results shift (cid:105)−1 a,k P (A = a|X = x) (cid:81)k (cid:81)k l=1 hD(l,x,aY ) l=1 hD(l,x,aD) . Remark: How would the addition of censoring play a role? As we noted above, direct effect estimation essentially cor- responds to TTE estimation with ignorable censoring – as one would usually 'switch off' censoring for a treatment ef- fect analysis (Young et al., 2020). Thus, if we were to add an additional event Ck to our setting to allow censoring (pa- tient drop-out), this would (a) require additional identify- ing assumptions similar to assumption 2, e.g. Y a k |X, and (b) lead to the same covariate shift issues as a com- peting event in direct effect estimation setting – any obser- vational distribution would thus gain an additional factor (cid:81)k P(Cl = 0| ̄Dl−1 = ̄Yl−1 = ̄Cl−1 = 0, X = x, A = a), which should then be (inversely) multiplied with any im- portance weight. k |=C a l=1 4.3 How does this covariate shift affect estimation of hazards from observational data? To analyze how the learning of hazard functions will be impacted by the multitude of sources of covariate shift we outlined above, we can apply well-known results from the literature on domain adaptation and importance weighting to our problem. Below, we adapt the bound of Cortes et al. (2010) to our setting; refer to Appendix C for proofs. Proposition 1 Given timestep k and treatment a, for a loss function (cid:96)h ∈ [0, 1] of any hypothesis h ∈ H, such that d = Pdim({(cid:96)h : h ∈ H}) (where Pdim is the pseudo- dimension) and (cid:96)h ∈ L, where L is a space of point- wise loss functions, and a weighting function w(x) with E[w(X)] = 1, with probability 1 − δ over at-risk sample a,k with empirical distribution ˆpobs DY a,k(h) − ˆRw,obs Rint [(w∗ (cid:113)E (cid:113)E a,k, we have (cid:12) (cid:12) a,k(x) − w(x))(cid:96)h(x)] (cid:12) (h) ≤ pobs a,k a,k (cid:12) (cid:12) (cid:12) E [w2(x)l2 max( [w2(x)l2 h(x)]) pobs a,k ˆpobs a,k + CH nY a,k h(x)], nY 3/8 a,k e2nY = 25/4(d log with CH nY et al. (2010) (Theorem 4). a,k a,k d + log 4 δ )3/8 due to Cortes The proposition above, broken down further in two corol- laries below by incorporating ideas from Johansson et al. (2018) and Maia Polo and Vicente (2022), tells us multiple things about the difficulty of the hazard estimation prob- lem and the consequences of the arising covariate shifts. A Alicia Curth, Mihaela van der Schaar first observation from the general statement above is that, unsurprisingly, the at-risk sample size nY a,k determines the speed of learning. This sample size naturally decreases in k through the occurance of main events even in the ab- sence of competing events, but decreases further as a func- tion of the frequency of competing events, meaning that nY,obs a,k ≤ nY,int for hypothetical datasets of size n created using the interventions corresponding to direct (or sepa- rable) effects, where the inequality is strict if competing events exist (or if treatment influences the rate of compet- ing events occurring). a,k Corollary 1 (Perfect importance weights) For w(x)=w∗,int a,k (x), we have a,k(h)− ˆRw∗,obs Rint a,k (h)≤ (cid:113) 1 a,k, pobs rel(pint a,k)nY a,k ESS∗ CH nY a,k 3/8 rel = exp2(D2(pint where ESS∗ a,k)) is the ex- pected relative effective sample size, with D2(p||q) = log2Ex∼p the R ́enyi divergence of order 2. a,k||pobs (cid:105) (cid:104) p(x) q(x) In Corollary 1, we see that for the special case of perfect importance weights the first term of the RHS in Proposi- tion 1 is zero and the speed of learning is slowed down if the relative effective sample size ESS∗ rel < 1 – i.e. whenever interventional and observational covariate distri- butions differ. To gain further intuition, note that Maia Polo and Vicente (2022) show that for self-normalized impor- tance weights ̄w∗ rel from data 1 rel a.s. as |I| → ∞, which is as lowest when all weights are equal. Time-dependent im- i , we can approximate ESS∗ → ESS∗ i∈I ̄w∗,2 n (cid:80) i portance weights may generally be more variable as pint a,k pobs a,k if hD(l, x, a) is constant in l, we have k increases, e.g. ((cid:81)k l=1 hD(l, x, aD))−1 = (hD(l, x, aD))−k, meaning that the covariate shift problem could be exacerbated over time for the direct and separable effects. However, as the density ratio is integrated w.r.t. pint a,k in the R ́enyi divergence, this effect can subside if the overall at-risk probability is small, as we also demonstrate empirically below. Corollary 2 (Standard supervised learning (unweighted)) For w(x) = 1, we have Rint a,k(h)− ˆRobs a,k(h)≤CLIP ML(pint where IPMG(p, q) = supg∈G an integral probability metric and CL > 0 is s.t. a,k, pobs a,k)+nY −3/8CH a,k (cid:82) g(x)(p(x) − q(x))dx(cid:12) ∈ L. (cid:12) (cid:12) na,k (cid:12) is (cid:96) CL Finally, we consider the special case of no weighting in Corollary 2. Here, ESS∗ rel = 1 due to constant weights and the first term of the RHS of 1 is bounded by an IPM-term – which does not decrease as the sample size grows4, reflect- ing that standard ERM on the observational data may never 4A large proportion of the ML HTE literature has therefore a,k(h)− ˆRobs recover the best interventional solution. As a consequence, Rint a,k(h) may never vanish – depending also on how rich the underlying hypothesis class is. This is well- known to be a problem for misspecified parametric models5 (Sugiyama et al., 2007), while, when using rich hypothe- ses classes through flexible nonparametric or deep meth- ods, one generally does not have to trade off model perfor- mance in different regions of the covariate space, meaning that, given sufficient data, importance weighting would not be expected to make a difference (Byrd and Lipton, 2019). 5 EXPERIMENTS Finally, we empirically investigate whether, when and how the different shifts play a role when learning hazard func- tions with the purpose of estimating the different HTEs. As is common practice in the HTE literature (Curth et al., 2021b), we have to rely on simulated data because coun- terfactuals are not available in real data, meaning that real datasets provide no ground truth for evaluating methods. While the standard HTE estimation problem in absence of competing events is only missing a single counterfactual (with respect to interventions on treatment assignment), the problem is exacerbated in our setting where additional (un- observable) interventions on competing events would be In required to create ground truth targets for evaluation. addition to the fully synthetic and highly stylized experi- ments considered below, we present additional results from a semi-synthetic setup using the real Twins dataset Louizos et al. (2017) in Appendix E, leading to similar insights as the results presented below. An illustrative DGP. Because there are many different forces at play which we wish to disentangle, we focus on a simple setup here that allows us to highlight important problem features. We assume that individuals are charac- terized by x=(x1, x2), two binary risk factors X1 ∼ B(0.5) and X2 ∼ B(0.5−ρ(1−2X1)) that may be correlated; un- less indicated otherwise we set ρ=0.35. We assume a very simple hazard for both outcomes E ∈ {Y, D}: hE(k, x, a) = (cid:40) pE low + apE high + apE pE low,τ if xSE = 0 high,τ if xSE = 1 (4) * +pE with 0 < pE *,τ ≤ 1 for both settings. This model is constant over time and depends only on the covariate xSE , where SE is the index of the support covariate for focused on learning representations that minimize an empirical estimate of the IPM-term Shalit et al. (2017). This is easily pos- sible in the standard setting as Pint is observed in the marginal covariate distribution P(X=x) and can hence be used to approx- imate the IPM term – however, in our setting, the interventional distribution is an unobserved at-risk distribution that differs per time-step (i.e. Pint a,k is not the marginal P(X = x) except for at k = 1), giving no straightforward analogue to this approach. 5For correctly specified parametric models and likelihood loss, a,k(h). a,k(h) = arg minh∈H Rint we always have arg minh∈H Robs Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data Figure 3: Estimation performance in RM SEτ as parameters of the DGP vary (left) and RM SEa,k the 3 effects (columns) across 3 settings (rows). For RM SEa,k haz over time k (right), for haz, each DGP's varying parameter is fixed its highest value. low=pD high,τ =pE the event model. We let SY = SD = 1, and, unless low=pD otherwise indicated, set pY high = 0.01, and create a high primary outcome risk group with pY high=0.1 and assume no treatment effect pE low,τ =0 for E ∈ {Y, D}. We assign treatment based on the propensity score π(x)=expit(ξ(xSA −0.5)) where both ξ ∈ [−6, 6] and whether SA overlaps SE determines the strength of con- founding. We generate samples of size n=5000 for K=30 time-steps, and elaborate further on the experiments and data generating processes (DGP) in Appendix D6. Using this DGP, we consider three main settings: 1. Setting 1: There is confounding as SA = 1 when |ξ| > 0, but treatment has no effect on either event. Varying ξ should lead to different levels of covariate shift due to confounding for all effects. low,τ = .01). Varying pD 2. Setting 2: There is no confounding (ξ = 0), treatment has no effect on the main event but affects the compet- ing event (pD high,τ , the hetero- geneous effect of treatment on competing events in the high-risk group, should lead to a covariate shift in the at-risk group when interventions associated with direct and separable effect are considered. 3. Setting 3: There is no confounding (ξ = 0), treatment has a heterogeneous effect on the main event (it equal- izes main event risk between both groups, pY high,τ = −.09) but has no effect on the competing event. When the high risk group is also at higher (baseline) risk of the competing event (as pD high varies) this may mask the protective effect of treatment on the main event, and should lead to a covariate shift in the at-risk group for the intervention associated with the direct effect only. Estimators. We focus on a setup where ˆhY (k, x, a) is misspecified, illustrating the effects of covariate shift on the main outcome model. We assume that the competing event model can be correctly specified, which may be the case 6Code to replicate all experiments can be found at https: //github.com/AliciaCurth/CompCATE or https:// github.com/vanderschaarlab/CompCATE. in reality if Dk is a well-studied comorbidity. Due to the simple DGP, both models could easily be estimated with an (unrestricted) logistic regression (LR) per time step us- ing the classification framework discussed in the previous section. We use unrestricted (and hence correctly spec- ified) LRs for hD(k, x, a), but induce misspecfication in hY (k, x, a) by fitting constant ˆhY a,k for each k ≤ K (this is equivalent to fitting a simple Kaplan-Meier estimator (Ka- plan and Meier, 1958) by treatment arm). We also demon- strate that similar conclusions apply when using a LR with L2-penalty that is set too aggressively. To highlight how different covariate shifts affect learning of the different effects, we compare the estimates obtained by Observa- tional ERM to importance-weighted ERM with Estimated weights ˆw∗,int and to two oracle solutions: weighted ERM with true importance weights w∗,int and unweighted ERM on a counterfactual sample of size n from the (usually in- accessible) interventional distribution. a,k a,k Evaluation Metrics. Using independent test sets of size nte=104, we report the root-mean-squared-error RM SEτ =RM SE(τ (x)) of estimating the three different types of risk differences of Section 3 (capturing a total, direct and separable direct HTE), which corresponds to an adaptation of Hill (2011)'s popular Precision in Estimating Heterogeneous Effects (PEHE) metric to our setting. To link back to our theoretical analysis, we also report the RMSE of estimating the hazard function, RM SEa,k haz= where P int a,k is the interventional at-risk distribution cor- responding to the effect of interest. We report mean and standard error across 10 replications of each experiment. [(hY (l, X, a)−ˆhY (l, X, a))2] X∼Pint a,k (cid:113)E 5.1 Empirical insights • Confounding-induced covariate shifts indeed impact es- timation of all effects. In Fig. 3 we present results for all 3 settings, highlighting that some effect estimates are in- deed impacted by more covariate shifts than others. In first Alicia Curth, Mihaela van der Schaar setting, we observe that all effect estimates are impacted by increasing confounding strength |ξ|: standard ERM per- forms poorly while importance weighting performs almost identically to the counterfactual solution. • Shifts induced by competing events indeed do not af- fect estimation of all effects. Next, we consider settings 2 and 3 in which treatment assignment is random, but co- variate shift can arise due to a differential effect of treat- ment on the competing event (Setting 2), or due to the high risk group also being at higher risk of the competing event which may mask a protective treatment effect on the main event (Setting 3). In Fig. 3 we observe that, as expected, bias due to covariate shift in setting 2 arises only for sepa- rable and direct effect, both of which require elimination of the differential effect of treatment on the competing event – while the total effect does not. Setting 3 exhibits a co- variate shift that induces bias only for the direct effect as expected, as treatment has no separable indirect effect here. We also find that, while the error in estimation of hY a,k ap- pears small at each time step, it becomes substantial as all K separate hazard functions are cumulated and used to es- timate the difference in risk. Note that the absolute error in estimation of the hazard appears to decrease over time in most settings – this may appear counterintuitive at first glance as nY a,k decreases over time, but is expected in our setting where the interventional at-risk population becomes more homogeneous over time as only low risk individuals are expected to survive, making the constant model approx- imately correct for later time steps. • Effective sample size behaves and contributes as ex- pected. In settings 2 & 3, when considering RM SEa,k haz across k, we observe a tradeoff as expected from our theoretical analysis: as k increases, covariate shift be- comes more extreme, initially widening the performance gap between weighted and unweighted ERM solution. As k grows larger, the increased variance (low ESS) of the weighted solution then starts to hinder its performance. Fi- nally, for very large k all solutions converge as the target distribution becomes more homogeneous. This tradeoff is indeed also reflected in the (absolute) effective sample sizes as measured by ((cid:80) ̄w∗,2 i )−1 in Fig. 4(a). i∈IY a,k (a) ESS in setting 2. (b) RM SEτ in setting 4. Figure 4: Additional results. Left: effective sample size (ESS) for direct effect estimation in setting 2 (pD high,τ =.2). Right: RM SEτ of direct effect estimation for varying con- founding ξ in presence of side effects (additional setting 4) • Multiple shifts can offset or exacerbate each other. Fi- nally, we combine settings 1 and 2 (setting 4: pD high,τ = 0.1, ξ varies); thus the high risk group experiences adverse reactions to treatment in the competing event, and setting ξ > 0 (ξ < 0) corresponds to assigning more (less) high risk individuals to treatment. In Fig. 4(b), we observe that having assigned more high risk individuals to treatment can offset the shift induced by competing events for (separable) direct effects (and, conversely, the more sensible practice of assigning less high risk individuals to treatment would ex- acerbate the covariate shift for (separable) direct effects). • When do such covariate shifts truly matter? In Fig. 5 we finally investigate when shifts matter for ERM. We revisit setting 1, and, in panels A&B, highlight that when xSA is not a true confounder (does not affect Yk), the resulting covariate shift biases ERM only when xSY also shifts due to correlation with xSA (the same holds true for other shifts when SY (cid:54)= SD). In panels C&D, we confirm the impact of misspecification by using a LR as outcome model: an unrestricted LR (C) can fit the DGP well and covariate shift thus has little effect, while the introduction of excessive regularization (D) leads to the need to prioritize regions of X (which observational ERM does incorrectly). Figure 5: Variations on setting 1 with constant estimators (A & B) and logistic regressions (C & D) 6 CONCLUSION We studied the challenges inherent to HTE estimation in the presence of competing events, and found that inclusion of competing events not only leads to multiple definitions of effects but also to multiple sources of covariate shifts when estimating them. Theoretically and empirically, we highlighted that, when and how different shifts bias esti- mation of different effects. Having gained understanding of its challenges, an interesting next step, further discussed in Appendix B, would be to consider how to adapt ideas from the ML literature on HTE & TTE estimation – such as the deep treatment-specific hazard estimator of Curth et al. (2021a) – to construct more sophisticated solutions for our problem setting. Finally, note that we do not wish to argue here that one measure of effect is superior to others – instead, we only aim to raise awareness that using different types of out- come predictors can lead to different effect interpretations and that the challenges inherent to learning them differ. Ultimately, in applications the choice of estimand should be made by domain expert – who is also needed to verify that its untestable identifying assumptions hold – and cor- respond to their policy or research question of interest. Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data Acknowledgements We would like to thank anonymous reviewers and members of the vanderschaar-lab for insightful comments on earlier drafts of this paper, and Mats Stensrud for a very interest- ing discussion on the topic. AC gratefully acknowledges funding from AstraZeneca. References Aalen, O. O. (1994). Effects of frailty in survival analysis. Statistical Methods in Medical Research, 3(3):227–243. Alaa, A. and van der Schaar, M. (2018). Limits of esti- mating heterogeneous treatment effects: Guidelines for practical algorithm design. In International Conference on Machine Learning, pages 129–138. Alaa, A. M. and van der Schaar, M. (2017a). Bayesian inference of individualized treatment effects using multi- task gaussian processes. Advances in Neural Information Processing Systems, 30:3424–3432. Alaa, A. M. and van der Schaar, M. (2017b). Deep multi- task gaussian processes for survival analysis with com- In Proceedings of the 31st International peting risks. Conference on Neural Information Processing Systems, pages 2326–2334. Assaad, S., Zeng, S., Tao, C., Datta, S., Mehta, N., Henao, R., Li, F., and Duke, L. C. (2021). Counterfactual rep- resentation learning with balancing weights. In Interna- tional Conference on Artificial Intelligence and Statis- tics, pages 1972–1980. PMLR. Athey, S. and Imbens, G. (2016). Recursive partitioning for heterogeneous causal effects. Proceedings of the Na- tional Academy of Sciences, 113(27):7353–7360. Athey, S., Tibshirani, J., Wager, S., et al. (2019). Gen- The Annals of Statistics, eralized random forests. 47(2):1148–1178. Bellot, A. and van der Schaar, M. (2018a). Multitask boost- ing for survival analysis with competing risks. Advances in Neural Information Processing Systems, 31. Bellot, A. and van der Schaar, M. (2018b). Tree-based In Inter- bayesian mixture model for competing risks. national Conference on Artificial Intelligence and Statis- tics, pages 910–918. PMLR. Bica, I., Alaa, A. M., Jordon, J., and van der Schaar, M. (2020). Estimating counterfactual treatment out- comes over time through adversarially balanced repre- sentations. International conference on learning repre- sentations. Byrd, J. and Lipton, Z. (2019). What is the effect of impor- tance weighting in deep learning? In International Con- ference on Machine Learning, pages 872–881. PMLR. Chapfuwa, P., Assaad, S., Zeng, S., Pencina, M. J., Carin, L., and Henao, R. (2021). Enabling counterfactual sur- vival analysis with balanced representations. In Proceed- ings of the Conference on Health, Inference, and Learn- ing, pages 133–145. Cortes, C., Mansour, Y., and Mohri, M. (2010). Learning bounds for importance weighting. Advances in neural information processing systems, 23. Curth, A., Lee, C., and van der Schaar, M. (2021a). Survite: Learning heterogeneous treatment effects from time-to- event data. Proceedings of the Thirty-Fifth Conference on Neural Information Processing Systems. Curth, A., Svensson, D., Weatherall, J., and van der Schaar, M. (2021b). Really doing great at estimating cate? a crit- ical look at ml benchmarking practices in treatment ef- fect estimation. In Thirty-fifth Conference on Neural In- formation Processing Systems Datasets and Benchmarks Track (Round 2). Curth, A. and van der Schaar, M. (2021a). Nonparamet- ric estimation of heterogeneous treatment effects: From In International Con- theory to learning algorithms. ference on Artificial Intelligence and Statistics, pages 1810–1818. PMLR. Curth, A. and van der Schaar, M. (2021b). On induc- tive biases for heterogeneous treatment effect estima- tion. Advances in Neural Information Processing Sys- tems, 34:15883–15894. Fang, T., Lu, N., Niu, G., and Sugiyama, M. (2020). Re- thinking importance weighting for deep learning under distribution shift. Advances in Neural Information Pro- cessing Systems, 33:11996–12007. Fine, J. P. and Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing risk. Jour- nal of the American statistical association, 94(446):496– 509. Gray, R. J. (1988). A class of k-sample tests for compar- ing the cumulative incidence of a competing risk. The Annals of statistics, pages 1141–1154. Hassanpour, N. and Greiner, R. (2019). Counterfactual re- gression with importance sampling weights. In IJCAI, pages 5880–5887. Hassanpour, N. and Greiner, R. (2020). Learning disen- tangled representations for counterfactual regression. In International Conference on Learning Representations. Hill, J. L. (2011). Bayesian nonparametric modeling for causal inference. Journal of Computational and Graph- ical Statistics, 20(1):217–240. Johansson, F., Shalit, U., and Sontag, D. (2016). Learning In Inter- representations for counterfactual inference. national conference on machine learning, pages 3020– 3029. Alicia Curth, Mihaela van der Schaar Johansson, F. D., Kallus, N., Shalit, U., and Sontag, D. (2018). Learning weighted representations for general- ization across designs. arXiv preprint arXiv:1802.08598. Kaplan, E. L. and Meier, P. (1958). Nonparametric estima- tion from incomplete observations. Journal of the Amer- ican statistical association, 53(282):457–481. (2011). Scikit-learn: Machine learning in Python. Jour- nal of Machine Learning Research, 12:2825–2830. Prentice, R. L., Kalbfleisch, J. D., Peterson Jr, A. V., Flournoy, N., Farewell, V. T., and Breslow, N. E. (1978). The analysis of failure times in the presence of compet- ing risks. Biometrics, pages 541–554. Kennedy, E. H. (2020). Optimal doubly robust estima- arXiv preprint tion of heterogeneous causal effects. arXiv:2004.14497. Rosenbaum, P. R. and Rubin, D. B. (1983). The central role of the propensity score in observational studies for causal effects. Biometrika, 70(1):41–55. K ̈unzel, S. R., Sekhon, J. S., Bickel, P. J., and Yu, B. (2019). Metalearners for estimating heterogeneous treat- ment effects using machine learning. Proceedings of the national academy of sciences, 116(10):4156–4165. Shalit, U., Johansson, F. D., and Sontag, D. (2017). Estimating individual treatment effect: generalization bounds and algorithms. In International Conference on Machine Learning, pages 3076–3085. PMLR. Lambert, P. C., Dickman, P. W., Nelson, C. P., and Royston, P. (2010). Estimating the crude probability of death due to cancer and other causes using relative survival models. Statistics in medicine, 29(7-8):885–895. Shi, C., Blei, D., and Veitch, V. (2019). Adapting neural networks for the estimation of treatment effects. In Ad- vances in Neural Information Processing Systems, pages 2507–2517. Lee, C., Yoon, J., and Van Der Schaar, M. (2019). Dynamic-deephit: A deep learning approach for dy- namic survival analysis with competing risks based on longitudinal data. IEEE Transactions on Biomedical En- gineering, 67(1):122–133. Lee, C., Zame, W. R., Yoon, J., and van der Schaar, M. (2018). Deephit: A deep learning approach to survival In Thirty-second AAAI analysis with competing risks. conference on artificial intelligence. Li, Y., Jia, W., Kang, Y., Chen, T., Li, X., Du, X., Dong, J., Ma, C., Wang, F., and Xie, G. (2020). Deepcomp: Which competing event will hit the patient first? In 2020 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), pages 629–636. IEEE. Lim, H. J., Zhang, X., Dyck, R., and Osgood, N. (2010). Methods of competing risks analysis of end-stage renal disease and mortality among people with diabetes. BMC medical research methodology, 10(1):1–10. Louizos, C., Shalit, U., Mooij, J. M., Sontag, D., Zemel, R., and Welling, M. (2017). Causal effect inference with deep latent-variable models. In Advances in Neural In- formation Processing Systems, pages 6446–6456. Maia Polo, F. and Vicente, R. (2022). Effective sample size, dimensionality, and generalization in covariate shift adaptation. Neural Computing and Applications, pages 1–13. Nie, X. and Wager, S. (2017). Quasi-oracle estima- tion of heterogeneous treatment effects. arXiv preprint arXiv:1712.04912. Pearl, J. (2009). Causality. Cambridge university press. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cour- napeau, D., Brucher, M., Perrot, M., and Duchesnay, E. Stensrud, M. J., Young, J. G., Didelez, V., Robins, J. M., and Hern ́an, M. A. (2020). Separable effects for causal inference in the presence of competing events. Journal of the American Statistical Association, pages 1–9. Stitelman, O. M. and van der Laan, M. J. (2010). Collab- orative targeted maximum likelihood for time to event data. The International Journal of Biostatistics, 6(1). Stojanov, P., Gong, M., Carbonell, J., and Zhang, K. (2019). Low-dimensional density ratio estimation for co- variate shift correction. In The 22nd International Con- ference on Artificial Intelligence and Statistics, pages 3449–3458. PMLR. Sugiyama, M., Krauledat, M., and M ̈uller, K.-R. (2007). Covariate shift adaptation by importance weighted cross validation. Journal of Machine Learning Research, 8(5). Wager, S. and Athey, S. (2018). Estimation and infer- ence of heterogeneous treatment effects using random forests. Journal of the American Statistical Association, 113(523):1228–1242. Wang, Z. and Sun, J. (2022). Survtrace: transformers for survival analysis with competing events. In Proceedings of the 13th ACM International Conference on Bioinfor- matics, Computational Biology and Health Informatics, pages 1–9. Wen, J., Yu, C.-N., and Greiner, R. (2014). Robust learn- ing under uncertain test distributions: Relating covariate shift to model misspecification. In International Confer- ence on Machine Learning, pages 631–639. PMLR. Yoon, J., Jordon, J., and van der Schaar, M. (2018). Gan- ite: Estimation of individualized treatment effects using generative adversarial nets. In International Conference on Learning Representations. Young, J. G., Stensrud, M. J., Tchetgen Tchetgen, E. J., and Hern ́an, M. A. (2020). A causal framework for classical Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data statistical estimands in failure-time settings with com- peting events. Statistics in medicine, 39(8):1199–1236. Zhang, Q. and Zhou, M. (2018). Nonparametric bayesian lomax delegate racing for survival analysis with compet- ing risks. Advances in Neural Information Processing Systems, 31. APPENDIX Alicia Curth, Mihaela van der Schaar This Appendix is structured as follows: In Appendix A, we present an additional literature review. In Appendix B, we discuss possible extensions incorporating more sophisticated solutions from the ML literatures on TTE prediction and In Appendix D, we give additional HTE estimation. details of the simulation experiments presented in the main text. In Appendix E, we finally conduct additional experiments based on real data. In Appendix C, we discuss identifying assumptions and proofs. A ADDITIONAL LITERATURE REVIEW Time-to-event prediction using ML in the presence of competing events. While modeling time-to-event data in the presence of competing events has been studied in the statistics literature for decades (Prentice et al., 1978; Gray, 1988; Fine and Gray, 1999), Lee et al. (2018) are the first paper we are aware of that consider time-to-event analysis with competing events in a (deep) machine learning context. Lee et al. (2018)'s proposed DeepHit assumes a discrete-time setup and uses fully connected neural networks with both shared and time-specific components for prediction of cause-specific incidence at every time-step. This work has since been extended further proposing improvements upon using simple neural networks in discrete time e.g. using RNNs in Li et al. (2020) or transformers in Wang and Sun (2022) and been complemented with work in continuous time relying on e.g. multi-task boosting (Bellot and van der Schaar, 2018a) or Bayesian nonparametric methods e.g. multi-task gaussian processes (Alaa and van der Schaar, 2017a), Lomax delegate racing (Zhang and Zhou, 2018) or tree-based mixture models (Bellot and van der Schaar, 2018b). Heterogeneous treatment effect estimation using ML. The ML literature on HTE estimation has centered mainly on binary or continuous outcomes, and has expanded rapidly over the last years. One stream of work has provided model- agnostic strategies (also sometimes referred to as meta-learner strategies (K ̈unzel et al., 2019)) to estimate HTEs using any ML method (K ̈unzel et al., 2019; Nie and Wager, 2017; Kennedy, 2020; Curth and van der Schaar, 2021a). A majority of the work published in machine learning has, however, focussed on adapting specific ML methods for HTE estimation: early work relied mainly on tree-based methods (Hill, 2011; Athey and Imbens, 2016; Wager and Athey, 2018; Athey et al., 2019), but was followed by adaptations of e.g. Gaussian processes Alaa and van der Schaar (2017a, 2018) and GANs Yoon et al. (2018). At this point, the most popular solution seems to be to adapt neural networks for treatment effect estimation, see e.g. Johansson et al. (2016); Shalit et al. (2017); Johansson et al. (2018); Shi et al. (2019); Hassanpour and Greiner (2019, 2020); Assaad et al. (2021); Curth and van der Schaar (2021a,b). The work outlined above focusses exclusively on binary/continuous outcomes, thus closest to our setting are two recent papers that have investigated challenges inherent to HTE estimation for TTE data without competing events, focussing on covariate shift: Chapfuwa et al. (2021) used generative models for counterfactual TTE analysis in continuous time and Curth et al. (2021a) used neural networks for discrete time analyses but neither considers how to incorporate competing events. Estimating treatment effects in the presence of competing events. The most likely reason for a lack of work on esti- mating heterogeneous treatment effects in the presence of competing events is that even the simpler average treatment effect setting has received rigorous characterisation within a causal framework only very recently: Young et al. (2020); Stensrud et al. (2020) are the first to formally characterize and define different types of causal effects and their identifying condi- tions within a counterfactual framework; their formalization allowed us to extrapolate their insights, combined with the literature on HTEs from the standard settings, to heterogeneous effects. Lacking such unified characterisation, prior work has considered estimation of average effects either in a model-dependent fashion by considering regression coefficients in cause-specific hazard models Prentice et al. (1978) or by testing for treatment-differences across e.g. cause-specific cumulative incidence functions Gray (1988), thus considering mainly total effects. B POSSIBLE METHODOLOGICAL EXTENSIONS Because we put our focus on understanding the unique challenges in adding competing events to the HTE estimation problem, we relied on simple ML methods to allow for clear empirical insights. Having gained understanding of the challenges inherent to the HTE competing events problem, an interesting next step would therefore be to consider how to adapt and incorporate ideas from the vast ML literature on HTE & TTE estimation to construct more sophisticated solutions. We discuss some possible avenues of interest for future research below. A first approach would be to make the time-to-event (hazard) predictions – which we use to compute the effects – them- Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data selves better, for example by sharing information across time-steps. As described in section 3, any time-to-event model that allows to compute cause-specific hazard functions for every time-step could be used to estimate all three types of effects. Instead of fitting separate models per time-step as we do in our experiments, one could therefore flexibly share information across time-steps (and possibly across causes) as in discrete-time neural networks for TTE prediction (Lee et al., 2018; Li et al., 2020; Curth et al., 2021a; Wang and Sun, 2022). Complementing such a methodological extension, it would also be interesting to theoretically study whether sharing of information over time-steps might mitigate some covariate shift issues. Further, the literature on domain adaptation and HTE estimation has proposed more sophisticated solutions to address covariate shift than classical importance weighting. As we allude to in footnote 4 in the main text, a large proportion of the ML HTE literature (e.g. Shalit et al. (2017); Johansson et al. (2018); Assaad et al. (2021)) has focused on learning balanced representations that minimize an empirical estimate of the IPM-term – which is not readily available in our setting as the interventional at-risk distribution is not equal to the marginal covariate distribution. Faced with a similar obstacle, Curth et al. (2021a) simply used the marginal distribution for balancing nonetheless – which they demonstrated to work well empirically. Improving upon this naive solution by investigating how to correctly balance representations may be an interesting next step both in their and our setting. A different avenue would be to improve upon using standard importance weights by removing uninformative dimensions: if we knew which features caused outcome, we would only need to compute importance weights taking into account distributional differences in dimensions that actually matter for prediction, which could significantly reduce variance in the importance weights and hence speed up learning (Stojanov et al., 2019; Maia Polo and Vicente, 2022). One possible way of doing so might be to jointly learning importance weights and representations for time-to-event prediction, adapting ideas from e.g. Hassanpour and Greiner (2019); Fang et al. (2020) Finally, an interesting future direction may be to consider more complex data-types, e.g. allowing for (some) patient characteristics to be repeatedly measured over time, necessitating the incorporation of time-varying covariates. This is also an interesting scenario because it makes identifying assumptions relying on measuring all common causes of Yk and Dk (Assumptions D1 and S1 in the following section) more likely to hold. Such covariates could easily be incorporated in our problem formulation and possible solutions could rely on recurrent networks such as Lee et al. (2019) in the TTE prediction setting and Bica et al. (2020) in the longitudinal treatment effect estimation setting. C ASSUMPTIONS AND PROOFS C.1 Formal Presentation of Identification Assumptions Below we discuss assumptions for nonparametric identification of effects, which are based on those given in Young et al. (2020) for total and direct effect and Stensrud et al. (2020) for separable effects. Some assumptions are shared by all causal parameters described in Section 3; they are analogues to the standard ignorabil- ity assumptions of Rosenbaum and Rubin (1983) from the standard treatment effect setting and are known as unconfound- edness, overlap and consistency assumptions: for each k ∈ {1, . . . , K} we require • Assumption 1. Exchangeability w.r.t. treatment: Y a • Assumption 2. Positivity w.r.t. treatment: P(A = a|X = x) > 0 for ∀x : P(X = x) > 0 and a ∈ {0, 1} • Assumption 3. Consistency w.r.t. treatment assignment: We observe the counterfactuals associated with the given treatment A, i.e. Yk = AY 1 k|=A|X k and Dk = AD1 k + (1 − A)Y 0 k + (1 − A)D0 k k , Da While total effects require no additional assumptions, both direct and separable effects require further identification as- sumptions associated with the additional interventions performed in their definitions. Direct effects. Direct effects require additional unconfoundedness, overlap and consistency assumptions to identify distributions under elimination of the competing event. For each k ∈ {1, . . . , K} we require • Assumption D1. Exchangeability: w.r.t. competing event Y a • Assumption D2: Positivity w.r.t. competing event: P(Dk = 0|X = x, ̄Yk−1 = ̄Dk−1 = 0, A = a) > 0 whenever P(X = x, ̄Yk−1 = ̄Dk−1 = 0, A = a) > 0 • Assumption D3. Consistency w.r.t. elimination of competing event: For an observation with A = a and ̄Dk = 0 we observe the corresponding counterfactual, i.e. ̄Yk = ̄Y a, ̄d=0 . k|X, ̄Yk−1 = ̄Dk−1 = 0, A = a k |=Da k Alicia Curth, Mihaela van der Schaar Figure 6: Figure illustrating causal graphs with hidden variables in which different effects are identified. (A): No hidden variables, all effects are identified. (B): Hidden variable causing all Yk, all effects are identified. (C): Hidden variable causing Yk and Dk; total effect is identified but separable and direct effect are not. (D): Hidden confounder of outcome treatment association, no effect is identified. Separable effects. Stensrud et al. (2020) derived assumptions enabling identification of separable (in)direct effects; owing to the conceptual difference in intervention on only parts of the treatment, these are more involved to state than those above. In particular, for each k ∈ {1, . . . , K} we require: • Assumption S0. Conceptual assumptions defining separable treatment: A is separable into components AY and AD. Setting A = a is equivalent to setting both AY and AD to a, so that Y aY =a,aD=a = Da k. Further, AY exerts effects on Dk only through its effect on ̄Yk−1 i.e. k andDaY =a,aD=a = Y a k k Y aY =1,aD k−1 = DaY =1,aD k−1 = Y aY =0,aD k−1 = DaY =0,aD k−1 = 0 =⇒ DaY =1,aD k = DaY =0,aD k for aD ∈ {0, 1} (5) and conversely, AD exerts effects on Yk only through its effect on ̄Dk i.e. Y aY ,aD=1 k−1 = DaY ,aD=1 k = Y aY ,aD=0 k−1 = DaY ,aD=0 k = 0 =⇒ Y aY ,aD=1 k = Y aY ,aD=1 k for aY ∈ {0, 1} (6) • Assumption S1. Dismissible Component conditions: W.r.t. primary event P(Y aY ,aD=1 k P(Y aY ,aD=0 k = 1|Y aY ,aD=1 k−1 = 0, DaY ,aD=1 k = 0, X = x) = = 1|Y aY ,aD=0 k−1 = 0, DaY ,aD=0 k = 0, X = x) and w.r.t. competing event P(DaY =1,aD k = 1|Y aY =1,aD k−1 = 0, DaY =1,aD k = 0, X = x) = P(DaY =0,aD k = 1|Y aY =0,aD k−1 = 0, DaY =0,aD k = 0, X = x) (7) (8) • Assumption S3. Positivity w.r.t. treatment (in surviving population): P(A = a| ̄Dk = ̄Yk = 0, X = x) > 0 whenever P( ̄Dk = ̄Yk = 0, X = x) > 0 for a ∈ {0, 1} • Assumption S3. Consistency: For an observation with A = a, we observe the corresponding counterfactuals, i.e. Yk = Y a,a and Dk = Da,a k . k C.2 Discussion of Assumptions. Consistency assumptions are always needed to ensure that we observe one of the counterfactuals for each individual; these assumptions may not hold if e.g. the act of monitoring outcomes can change their value or if there is interference between individual units. Positivity assumptions ensure that there is some overlap between observational and interventional distri- butions; if these assumptions do not hold we could not (nonparametrically) extrapolate to the interventional distribution (and importance weights w∗(x) would not be defined for all x). Finally, exchangeability assumptions and the dismissible component assumptions ensure that there are no hidden variables (variables not included in X) causing treatment assignment and events (all effects) and Yk and Dk (separable and direct ef- fect only), which would make observed distributions inherently different from distributions under intervention. To illustrate when these assumptions do not hold, we highlight scenarios where different hidden variables do (not) violate assumptions Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data in Fig. 6. In Panel A (the same as Fig. 1 in the main text), no hidden variables exist and all effects are identified. In Panel B, hidden variables causing both Y1 and Y2 exist – e.g. some form of underlying frailty (Aalen, 1994), inducing heterogeneity in risk of only the main event occuring – which are allowed under all effects. In Panel C, Yk and Dk are caused by some shared hidden variable, which violates assumptions D1 and S1 – thus separable and direct effects are not identified, while the total effect is. Finally, in Panel D, there is a hidden confounder of the treatment-outcome association, which violates assumption 1 – therefore, no effect is identified. C.3 Identification of interventional at-risk covariate distribution for separable effects (Sec. 4.2) The interventional at-risk covariate distribution corresponding to the intervention do(AY = aY , AD = aD) can be iden- tified from observational data under the assumptions stated above and is proportional to P(X=x)(1−hD(k, x, aD)) × (cid:81)k−1 l=1 (1−hD(l, x, aD))(1−hY (l, x, aY )) as stated in Sec. 4.2. Proof: the interventional distribution is proportional to P(X=x)P(DaY ,aD k =0|DaY ,aD k−1 =0, Y aY ,aD k−1 =0, X=x) × k−1 (cid:89) l=1 P(Y aY ,aD l =0|DaY ,aD l which is equal to × k−1 (cid:89) l=1 P(Y aY ,aY l =0|DaY ,aY l =0, Y aY ,aD l−1 =0, X=x)P(DaY ,aD l =0|DaY ,aD l−1 =0, Y aY ,aD l−1 =0, X = x) P(X=x)P(DaD,aD k =0|DaD,aD k−1 =0, Y aD,aD k−1 =0, X=x) =0, Y aY ,aY l−1 =0, X=x)P(DaD,aD l =0|DaD,aD l−1 =0, Y aD,aD l−1 =0, X = x) because of the dismissible component conditions if aY (cid:54)= aD, and trivially if aY = aD. This is equal to P(X=x)P(DaD k =0|DaD k−1=0, Y aD k−1=0, X=x) × k−1 (cid:89) l=1 P(Y aY l =0|DaY l =0, Y aY l−1=0, X=x)P(DaD l =0|DaD l−1=0, Y aD l−1=0, X = x) = P(X=x)P(Dk=0|Dk−1=0, Yk−1=0, X=x, A=aD) P(Yl=0|Dl=0, Yl−1=0, X=x, A=aY )P(Dl=0|Dl−1=0, Yl−1=0, X = x, A=aD) × k−1 (cid:89) l=1 = P(X=x)(1−hD(k, x, aD)) × k−1 (cid:89) (1−hD(l, x, aD))(1−hY (l, x, aY ) l=1 (9) (10) (11) (12) (13) by consistency (assumptions S0 and S3), exchangeability (assumption 1) and by definition of the hazard functions, respec- tively. C.4 Proof of proposition 1 (Section 4.3) Proposition 2 (Restated) Given timestep k and treatment a, for a loss function (cid:96)h ∈ [0, 1] of any hypothesis h ∈ H, such that d = Pdim({(cid:96)h : h ∈ H}) (where Pdim is the pseudo-dimension) and (cid:96)h ∈ L, where L is a space of pointwise loss functions, and a weighting function w(x) with E[w(X)] = 1, with probability 1−δ over at-risk sample DY a,k with empirical distribution ˆpobs a,k, we have Rint a,k(h) − ˆRw,obs a,k (h) ≤ (cid:12) (cid:12) (cid:12) E pobs a,k [(w∗ (cid:12) (cid:12) (cid:12) + a,k(x) − w(x))(cid:96)h(x)] max( (cid:114) E pobs a,k [w2(x)l2 h(x)], (cid:114) E ˆpobs a,k nY a,k 3/8 [w2(x)l2 h(x)]) CH nY a,k (14) with CH nY a,k = 25/4(d log e2nY a,k d + log 4 δ )3/8 due to Cortes et al. (2010) (Theorem 4). For w(x)=w∗ a,k(x) (exact importance weights, Lemma 1), we have Alicia Curth, Mihaela van der Schaar a,k(h)− ˆRw∗,obs Rint a,k (h) ≤ (cid:113) ESS∗ 1 a,k, pobs rel(pint a,k)nY a,k CH nY a,k 3/8 where ESS∗ rel = exp2(D2(pint the R ́enyi divergence of order 2. a,k||pobs a,k)) is the expected relative effective sample size, with D2(p||q) = log2Ex∼p For w(x) = 1 (standard supervised learning, Lemma 2), we have Rint a,k(h)− ˆRobs a,k(h) ≤ CLIP ML(pint a,k, pobs a,k) + nY a,k −3/8CH na,k where IPMG(p, q) = supg∈G (cid:12) (cid:12) (cid:82) g(x)(p(x) − q(x))dx(cid:12) (cid:12) is an integral probability metric and CL > 0 is s.t. (cid:96) CL ∈ L. Proof: Eq. (14) follows directly from Thm 4 in Cortes et al. (2010). (15) (cid:105) (cid:104) p(x) q(x) (16) Further, when w(x) = w∗ we used the restatement in terms of ESS∗ rel of Maia Polo and Vicente (2022). a,k(x), the statement in eq. (15, follows directly from Theorem 3 of Cortes et al. (2010), where Finally, to prove equation (16), note that when w(x) = 1, we can bound the first term of eq. (14) as (cid:12) E (cid:12) (cid:12) pobs a,k [(w∗ (cid:12) (cid:12) (cid:12) = a,k(x) − 1)(cid:96)h(x)] (cid:12) (cid:12) E (cid:12) (cid:12) (cid:12) pobs a,k [( pint a,k pobs a,k (cid:12) (cid:12) (cid:12) − 1)(cid:96)h(x)] (cid:12) (cid:12) = (cid:90) (cid:12) (cid:12) (cid:12) (cid:12) (cid:96)h(x)(pint a,k(x) − pobs a,k(x))dx (cid:12) (cid:12) (cid:12) (cid:12) (17) ≤ CL sup f ∈L (cid:90) (cid:12) (cid:12) (cid:12) (cid:12) fh(x)(pint a,k(x) − pobs (cid:12) (cid:12) a,k(x))dx (cid:12) (cid:12) ≤ CLIP ML(pint a,k, pobs a,k) as in e.g. Shalit et al. (2017); Johansson et al. (2018)'s bounds for the standard treatment effect estimation setting. Note further that because (cid:96)h ∈ [0, 1] by assumption, max( h(x)]) ≤ 1 in the second term. Putting the two together gives (16). [w2(x)l2 w2(x)l2 h(x)], (cid:113)E (cid:113)E pobs a,k ˆpobs a,k D EXPERIMENTAL DETAILS Synthetic DGPs For clarity, we explicitly write out the DGPs used to create settings 1-4 in the main text below. Setting 1 (ξ varies): hY (k, x, a) = 0.01(1 − x1) + 0.1x1 and hD(k, x, a) = 0.01 and π(x)=expit(ξ(x1−0.5)) Setting 2 (pD high,τ varies): hY (k, x, a) = 0.01(1 − x1) + 0.1x1 and hD(k, x, a) = 0.01 + pD high,τ ∗ x1 ∗ a and π(x) = 0.5 Setting 3 (pD high varies): hY (k, x, a) = 0.01(1 − x1) + (0.1 − 0.09a) ∗ x1 and hD(k, x, a) = 0.01(1 − x1) + pD high ∗ x1 and π(x) = 0.5 Setting 4 (ξ varies): hY (k, x, a) = 0.01(1−x1)+0.1x1 and hD(k, x, a) = 0.01+0.1∗x1∗a and π(x)=expit(ξ(x1−0.5)) with X1 ∼ B(0.5) and X2 ∼ B(0.5−ρ(1−2X1)) and ρ = .35 for all Figures except in Fig. 6 panel A&B where π(x) depends on x2 instead of x1. Implementations7 Throughout, as unrestricted/correctly specified estimators for the hazard of the competing event ˆhD for each time step and for all propensity estimators ˆπ, we use logistic regressions (LR), relying on the sklearn(Pedregosa et al., 2011) implementation with default parameters and l2-penalty C = 100. As described in the main text, we use constants to induce a misspecified hazard model for the main event at each time step . For the results using LRs for the main event hazard in Fig. 5C&D in the main text, we set l2-penalty C = 1 in Fig. 5C to reduce capacity of the model and create a misspecified model, and C = 100 for the unrestricted version in Fig. 5D. 7Code to replicate all experiments can be found at https://github.com/AliciaCurth/CompCATE or https:// github.com/vanderschaarlab/CompCATE. Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data E ADDITIONAL EXPERIMENTS USING REAL DATA E.1 Creating a semi-synthetic benchmark from the Twins dataset Due to the usual absence of counterfactuals in practice, benchmarking treatment effect estimation methods on real data is a challenging problem (Curth et al., 2021b). In our setting, this problem is exacerbated relative to the standard HTE setting because there are more interventions than 'just' intervention on treatment, meaning that there are even more unobserved counterfactuals (namely those corresponding to interventions on competing events or separable interventions). The Twins Dataset. The (real-world) Twins benchmark dataset used in Louizos et al. (2017); Yoon et al. (2018) for binary outcomes and in Curth et al. (2021a) for TTE outcomes without competing events is an interesting exception as Twins could be treated as their respective counterfactual under treatment – which has been exploited in the standard setting where we only wish to intervene on treatment: The dataset consists of 11400 pairs of twins, for whom one can create a binary treatment such that a = 1 denotes being the heaver twin at birth, and use this to emulate a hypothetical study measuring the HTE of birthweight on 1-year infant mortality (binary outcome) or survival times (in days, administratively censored at t=365). Note that, fortunately, the mortality rate is relatively low, giving an event rate of around 16% over the full horizon. The dataset as used in Yoon et al. (2018); Louizos et al. (2017); Curth et al. (2021a) contains 30 covariates for each twin relating to the parents, the pregnancy, and the birth (e.g., marital status, race, residence, number of previous births, pregnancy risk factors, quality of care during pregnancy, and number of gestation weeks prior to birth), of which we use 27 in our experiments (we dropped the three categorical features due to low variance). Semi-synthetic benchmarking setup. We use this dataset as a basis for a semi-synthetic benchmarking setup in which we use the original covariates and event times to create an observational time-to-event dataset with competing events by (i) selectively observing only one twin during training and (ii) introducing a simulated competing event. As both are simulated, we can intervene on these processes to give oracle solutions based on interventional distributions to compare to the solutions obtained from observational distributions. Note that, because most events happen early on – 80% of events happen on days 0-10, with 60% of events occuring on day 0 – we consider only the first 10 days, so that here K = {0, . . . , 10}. In training, we selectively observe only one of the two twins, and for (i) induce confounding by sampling A|X ∼ B(π(X)) with propensity score π(Xi) = expit(ξAZtrain(|S|−1 (cid:80) p∈S Xi,p)) where Ztrain(*) denotes standardization over the training set, ξA determines the strength of selection and S is a feature subset which is chosen as discussed below. For (ii), using the observed trajectories ̄Y a k ∼ hd(k, x, a) for units with Y a k to zero whenever a competing event occurs. As a hazard we use K from the Twins dataset, we introduce competing events by simulating Da k−1 = 0, and setting all future values of Y a hD(k, x, a) = (cid:40) (cid:16) expit 0.1 k−1 otherwise log(0.1) + ξD(1 − a)Ztrain(|S|−1 (cid:80) (cid:17) p∈S xp) if k = 1 (18) which mimics the main outcome in that most events and heterogeneity occurs initially in period 0 and then levels of. As above Ztrain(*) denotes standardization over the training set and ξD determines the heterogeneity in the competing event process. Note that treatment here equalizes the odds of the competing event across individuals. As before, we consider 3 settings to be able to disentangle the different forces at play here. In setting 1, we remove the competing event and consider only the effect of treatment selection by varying ξA. In setting 2, we assign treatment randomly and consider only the effect of the covariate shift induced by the competing event by varying ξD. In setting 3, we combine the two, set ξA = 2 and vary ξD. For both propensity and competing hazard, to ensure that the variables determining treatment assignment and com- peting event are actually important for the main event, we choose set S by selecting the most important covariates from a (treatment-agnostic) random forest for predicting mortality at time step 0 on the Twins data (using sklearn's SelectFromModel class). In Fig. 8 in the experiments below, we show that choosing outcome-relevant features in such manner makes a difference in an experiment where we instead randomly sample a feature set of size |S|. Estimators. Because the event data is real and not simulated, unlike in the main text, we do not know what correctly specified model is in this case. Here, we therefore consider as base models a constant model as in the main text, as well as a LR with cross-validated l1-penalty in {10−3, 10−2, 10−1} and a random forest with 100 trees. The compet- ing events and propensity models are once more fit using a (correctly specified) LR with cross-validated l1-penalty in {10−3, 10−2, 10−1, 1}. The four learning strategies – observational, weighting (true and estimated) and counterfactual Alicia Curth, Mihaela van der Schaar Figure 7: RMSE of estimating RMST under control (left) and under treatment (right) under the different interventions (columns) across different DGPs (rows) using (misspecified) constant estimators per time-step on Twins. Shaded area indicates one standard error. – are as before. Note that because treatment assignment and competing event are simulated, ground truth weights and counterfactuals are accessible. Evaluation. As the main event data is real and ground truth probabilities are unknown, we instead evaluate all models K = min(T int, K) in terms of their predictions of event-free restricted mean survival time under intervention RM ST int which we can compute from the observed (twins) event times T Y,twins(a) and simulated competing event times T D,sim(a) (both are set to K+1 if event never occurs) as RM ST int K =    min(T Y,twins(a), T D,sim(a), K) if int = do(A = a) min(T Y,twins(a), K) if int = do(A = a, ̄D = 0) min(T Y,twins(aY ), T D,sim(aD), K) if int = do(AY = ay, AD = aD) The expected value of the RMST is equal to the area under the event-free survival curve, which for the different interven- tions can be computed from the hazard functions as E[RM ST int K ] =  1 + (cid:80)K−1  l=1 1 + (cid:80)K−1 l=1  1 + (cid:80)K−1 l=1 (cid:104)(cid:80)l (cid:104)(cid:80)l (cid:104)(cid:80)l q=1(1 − hD(q, x, a))(1 − hY (q, x, a)) (cid:105) q=1(1 − hY (q, x, a)) q=1(1 − hD(q, x, aD))(1 − hY (q, x, aY )) if int = do(A = a, ̄D = 0) (cid:105) if int = do(A = a) (cid:105) if int = do(AY = ay, AD = aD) Below we will sometimes refer to RMST(a); this refers to the different versions of RMST evaluated for A = a at time K = 10 (only for the separable direct effect, RMST(0) corresponds to aY = aD = 0 and RMST(1) corre- sponds to aY = 1, aD = 0). We report the RMSE of estimating RMST using the hazards from the different models, (cid:113) 1 K ])2; here we split the data 50/50 for training and testing (by twin pairs), and ntest report means and standard errors of the RMSE across 5 replications of each experiment. Code to replicate the experiments will be released upon acceptance of the paper. K,i − ˆE[RM ST int i=1 (RM ST int (cid:80)ntest E.2 Results using the Twins data In Fig. 7 we present results for all three settings and interventions corresponding to the three effects under consideration, using constant models at each time step to possibly induce misspecification. We observe that many of the conclusions from the stylized simulations from the main text carry over also to this more complex and realistic setup based on real data. We observe that varying confounding through ξA (top row) remains important for all effects. We observe that only the Understanding the Impact of Competing Events on Heterogeneous Treatment Effect Estimation from Time-to-Event Data estimator of the control8 RMST in the direct effect setting is impacted by varying the competing event intensity ξD alone (middle row), while when adding the two together we observe that varying ξD can impact also estimation of the other effects. We also note that all differences between approaches overall appear much more salient for the RMST of the control group than for the treated group. While for settings 2 and 3 it is partially a consequence of how we designed the competing event hazard function, this is not the case for setting 1 – here it may give some evidence that the outcome model in the treated population is not substantially misspecified and may be near constant; therefore we now focus on the control RMST for the remainder of this section. Additionally, we focus on estimation under intervention do(A = a, ̄D = 0), corresponding to direct effects, for which the results are most pronounced. We next consider the effect of having selected outcome-relevant covariates for treatment assignment and compet- In Fig. 8 we instead se- ing event. lect random features and observe that indeed, compared to outcome-relevant features as in Fig. 7, the shift induced in the different settings no longer sys- tematically plays a role. Figure 8: RMSE of estimating control RMST under intervention do(A = 0, ̄D = 0) (corresponding to direct effects) using a constant model for the three settings when features in S are randomly chosen. Finally, we use more flexible models – random forests (RFs) and logistic re- gressions (LRs) – instead of the simple constant models (returning to a setting where S is outcome-relevant). In Fig. 9 we present results for the three settings. We observe that for RFs, these covariate shifts appear to also play a role similarly to the constant estimator, albeit with smaller magnitude in effect on the estimation error. Interestingly, for LRs we do not observe any performance degradation of the observational solution relative to the counterfactual solution (and if anything, we observe that variance induced by weighting sometimes degrades performance). As robustness to arbitrary distribution shifts can indicate correct specification (Wen et al., 2014), this may provide some evidence that the LR-model is actually correctly specified to capture the complexity of the underlying Twins time-to-event outcome data. (a) Random forest (b) Logistic Regression Figure 9: RMSE of estimating control RMST under intervention do(A = 0, ̄D = 0) (corresponding to direct effects) using random forests (left) and logistic regressions (right) for the three settings. 8Note that, due to our hazard specification for the competing event, there is no covariate shift in the treatment group for the direct effect, thus it is expected that behaviour in estimation of RMST(1) is not impacted by ξD in rows 2 and 3
http://arxiv.org/abs/2302.12052v1
2023-02-23T14:23:23
2023-02-23T14:23:23
Attention Mechanism for Contrastive Learning in GAN-based Image-to-Image Translation
Using real road testing to optimize autonomous driving algorithms is time-consuming and capital-intensive. To solve this problem, we propose a GAN-based model that is capable of generating high-quality images across different domains. We further leverage Contrastive Learning to train the model in a self-supervised way using image data acquired in the real world using real sensors and simulated images from 3D games. In this paper, we also apply an Attention Mechanism module to emphasize features that contain more information about the source domain according to their measurement of significance. Finally, the generated images are used as datasets to train neural networks to perform a variety of downstream tasks to verify that the approach can fill in the gaps between the virtual and real worlds.
[ "Hanzhen Zhang", "Liguo Zhou", "Ruining Wang", "Alois Knoll" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12052v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12052v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.LG", "eess.IV" ]
ATTENTION MECHANISM FOR CONTRASTIVE LEARNING IN GAN-BASED IMAGE-TO-IMAGE TRANSLATION Hanzhen Zhang, Liguo Zhou*, Ruining Wang, Alois Knoll Chair of Robotics, Artificial Intelligence and Real-time Systems, Technical University of Munich [email protected] 3 2 0 2 b e F 3 2 ] V C . s c [ 1 v 2 5 0 2 1 . 2 0 3 2 : v i X r a ABSTRACT Using real road testing to optimize autonomous driving al- gorithms is time-consuming and capital-intensive. To solve this problem, we propose a GAN-based model that is ca- pable of generating high-quality images across different do- mains. We further leverage Contrastive Learning to train the model in a self-supervised way using image data acquired in the real world using real sensors and simulated images from 3D games. In this paper, we also apply an Attention Mech- anism module to emphasize features that contain more infor- mation about the source domain according to their measure- ment of significance. Finally, the generated images are used as datasets to train neural networks to perform a variety of downstream tasks to verify that the approach can fill in the gaps between the virtual and real worlds. Index Terms- GAN, Self-supervised, Attention Mecha- nism, Contrastive Learning 1. INTRODUCTION With the development of deep learning, rapid progress has been made in autonomous driving technology. However, training the deep learning model needs a massive amount of labeled real road data. Autonomous driving vehicles also re- quire to go through a lot of road testing before they can ac- tually be used in transportation. Using real road testing to optimize autonomous driving algorithms is time-consuming and capital-intensive, and testing on open roads has safety implications and regulatory constraints. In addition, extreme weather conditions and complex traffic scenarios are diffi- cult to be reproduced in reality. Therefore, it makes sense to convert simulator image data into photo-realistic image data, which can save time and capital costs and help the research and implementation of autonomous driving algorithms. Figure 1 shows the three steps toward Photo-realistic Vir- tualization of road objects. In this paper, we focus on solving the third step towards the photo-realistic virtualization of road objects, namely the GAN-based post-processing algorithms. Specifically, we need to design a suitable generator that can learn the joint distribution of the two domains (real and simu- lated world) and find transformations between them. Consid- ering the difficulty of acquiring paired images, i.e. generated labels, we need to train the generator with unpaired images for self-supervised learning. Moreover, in order to maximize the mutual information between the source and the translated images across different domains, we also need to solve the problem that Generators need to be able to identify important information and features. The main contributions of this paper can be summarized as follows: • We introduce the main modules and Attention Mech- anism module into our Attention-based CUT_GAN. Then we evaluate the performance of the designed model on several datasets to check its validity. • We compare several attention mechanisms through ab- lation experiments to verify the improvement of differ- ent attention mechanisms on the performance of gener- ators. Furthermore, the effectiveness of the attention mechanism module is verified by comparing the de- signed model with other generative algorithms. 2. RELATED WORKS In this section, we make a comprehensive review of the devel- opment of the methods used in this paper, including Genera- tive Adversarial Networks, Image-to-Image Generators, and self-supervised methods. 2.1. Generative Adversarial Networks Since Ian GoodFellow proposed the GAN model [1] in 2014, generative adversarial networks have rapidly become the hottest generative model. CGAN (conditional GAN) [2] adds constraints to the original GANs so that the network can gen- erate samples in a given direction. The proposal of DC- GAN (deep convolutional GAN) [3] has great significance to the development of GAN, which combines convolutional neural networks (CNN) and GAN. It combines CNN and GAN to ensure the quality and diversity of the generated im- ages. LSGAN (least squares GAN) [4], also known as least squares generative adversarial network, replaces the cross- entropy loss function of a traditional GAN with a least squares (a) High-poly 3D Models (b) High Definition Rendering (c) GAN-based Post-processing Fig. 1. Three Steps towards Photo-realistic Virtualization of Road Object loss function, which effectively improves the problems of low quality and unstable training of the original GANs. Cycle- GAN [5] allows images from two domains to be transformed into each other and does not require paired images as training data. BigGAN [6] gets its performance boost by scaling up the model, and is so far the best GAN model for generating image quality. 3. ATTENTION−BASED CUT_GAN In this section, we introduce the structure of our proposed Image-to-Image Translation Network called Attention-based CUT_GAN. Sections 3.2 and 3.3 introduce the two parts of Generative adversarial networks: Generator and Discrimina- tor. Section 3.4 describes Patchwise Contrastive Learning and other parts of the loss function. 2.2. Image-to-image Translation 3.1. Network Overview The image-to-image translation methods can be classified into two classes: Supervised methods and Unsupervised methods. Supervised methods such as Pix2pix [7] can translate im- ages from one domain to another e.g. from night to day, from sketch to real picture and so on, but images must be paired. In unsupervised methods, Cycle GAN [5] first translates an image from a source domain A to a target domain B in the absence of paired examples, then couples it with an inverse mapping: domain B to domain A and uses cycle consistency loss to let generated A image the same as the original image as much as possible. In ACGAN [8], the discriminator not only discriminates whether the input image is from the distribution of the generated data or from the distribution of the real data, but also predicts the class of the input image. 2.3. Self-supervised Learning Self-supervised learning differs from unsupervised learning mainly in that unsupervised learning focuses on detecting specific data patterns, such as clustering, community discov- ery, or anomaly detection, while self-supervised learning aims at recovering and remaining within the supervised learning paradigm. According to Jie Tang et al. [9], self-supervised learning can be divided into three general categories: Generative, Con- trastive, and Generative-Contrastive. ContraGAN [10], which uses Contrastive Learning, tries to draw close to image repre- sentations that have the same category label, when consider- ing drawing close to the same transformed image. The overflow of our proposed Image-to-Image Translation Network is depicted in figure 2. We wish to translate im- ages from input domain χ ⊂ RH×W ×3 to appear like an im- age from the output domain Y ⊂ RH×W ×3. We are given a dataset of unpaired instances X = {x ∈ χ}, Y ={y ∈ Y }. Our method only requires learning the mapping in one di- rection and avoids using inverse auxiliary generators and dis- criminators. This can largely simplify the training procedure and reduce training time. Fig. 2. Overview of the proposed Image-to-Image Translation Network Given an image Ix, the target image G(Ix) can be ob- tained by the generator, which consists of an Encoder and De- coder. Meanwhile, the discriminator will determine whether the generated image is fake or real. Based on the original GAN foundation, our proposed network extracts the Encoder in the generator and uses it to extract the feature maps of the source image Ix and the target image G(Ix) respectively. At this point, due to the dimensionality reduction operation of convolution, the feature map can be seen as dividing the im- age into patches of the same size as the perceptual field. The original CUT_GAN randomly samples patches in the feature map to compute the Contrastive loss. However, not all patches have rich domain information, so random sam- pling causes the GAN network to not maximize the informa- tion learned between two domains. To address this problem, we propose an additional Attention Module to intentionally select more significant patches for computing the Contrastive loss. The attention mechanism module calculates the signif- icance of each patch, and by ranking them we select patches that are more important, i.e. contain more information about the domains. Finally, all these sampled patches are used to compute the self-supervised contrastive loss. This loss term encour- ages two elements (corresponding patches) to map to a simi- lar point in a learned feature space, relative to other elements (patches) in the dataset, referred to as negatives. The output can as results take on the appearance of the target domain while retaining the structure, or content, of the specific input. 3.2. Generator The generator G is designed to map the latent space vector (z) to data space. Since our data are images, converting z to data space means ultimately creating an RGB image with the same size as the training images (i.e. 3×64×64). Empirically, the depth of the network is critical to the per- formance of the model. When the number of layers is in- creased, the network can perform more complex feature pat- tern extraction, so theoretically better results can be achieved when the model is deeper. However, experiments have re- vealed a degradation problem in deep networks: as the depth of the network increases, the accuracy of the network satu- rates and even decreases. To address this problem, we propose a ResNet-based gen- erator G [11] consists of two down-sampling blocks, nine in- termediate blocks, two up-sampling blocks and two convolu- tion layers. We apply Instance Normalization (IN) [12] [13] and ReLU [14] in the generator, except for the output layer, which uses Tanh as the activation function. The network be- fore the sixth residual block is regarded as the encoder E and the rest is the decoder. We adopt the multi-layer feature ex- traction in CUT_GAN [15], which takes the features from five layers. including the input image, the first and second down- sampling blocks, and the first and fifth residual blocks. 3.3. Discriminator The discriminator D is a binary classification network that takes an image as input and outputs a scalar probability that Fig. 3. Perceptual field the input image is real (as opposed to fake). The discriminator in our proposed network uses a design called PatchGAN [16]. In general, the discriminator of the original GAN is designed to output only one boolean value (True or False), which is an evaluation of the whole image generated by the generator. In contrast, PatchGAN is de- signed to be fully convolutional, where the image is mapped using convolution into an N × N matrix, which is equivalent to the final evaluation value in the original GAN. Each point (true or false) in the N × N matrix represents a small region (in the sense of patch) of the original image, which is the ap- plication of the perceptual field, which is shown in Figure 3. Instead of measuring the whole image with a single value, the whole image is now evaluated using an N × N matrix, which obviously allows more areas to be focused on, which is the advantage of PatchGAN. 3.4. Patchwise Contrastive Learning Image translation needs to ensure consistency of content. More precisely, important elements of the image such as pedestrians, cars, traffic lights, and even road patterns should be preserved as much as possible. Contrastive learning can then solve this problem. Specifically, a patch is selected from the real image as query; a number of patches are selected from the simulated image, and the patches with the same position as query are used as positive samples, while the others are used as negative samples. Inspired by [17] [18] [15], we use PatchNCE [15] as con- trastive loss. NCE, which is called "Noise Contrastive Esti- mation", estimates model parameters and normalization con- stants by maximizing the same objective function. NCE con- verts the problem into a binary classification problem, where the classifier is able to bifurcate the data samples and the noise samples. In addition, the negative samples for con- trastive learning are selected patches within a single input im- age, rather than other images from the dataset. Figure 4 depicts the structure of Patchwise Contrastive Loss. As mentioned before, a generator is an encoder-decoder architecture, which passes the real and simulated images through this encoder, and selects the feature maps output from the L layers of the encoder to calculate the contrastive loss in the feature space instead of the original image, as shown in LP atchN CE(G, H, X) = Ex∼X L (cid:88) Sl(cid:88) l( ˆzs l , zs l , zS\s l ). l=1 s=1 (1) Note that in the above equation, L represents a total of L layers of encoder output feature maps to calculate the con- trastive loss, different spatial locations in the feature maps of different layers correspond to different image patches in the original image. The deeper the layer, the larger the cor- responding patch. Sl represents that the feature maps of the current layer have a total of Sl spatial locations. ˆzl = Hl(Gl enc(G(x)))(where H stands for MLP) indicates that the generated image is passed through the encoder of the genera- tor, and the feature maps output at the l-th layer of the encoder are obtained by MLP for ˆzl. zl = Hl(Gl enc(x)) indicates that the real image is input to the encoder of the generator, and the feature maps output at the l-th layer of the encoder are ob- tained by MLP for zl. ˆzs l is query, zs is negative samples, which indicates locations other than s in zl. l is one spatial location of ˆzl. ˆzs l is positive samples, zS\s l Fig. 4. Patchwise Contrastive Loss Each spatial location corresponds to the original map is a patch, and each spatial location in the new feature maps ob- tained by MLP. H is a vector whose dimension is the number of channels. Since query, positive samples, and negative sam- ples are all vectors, we can give the introduction of InfoNCE formula in l(v, v+, v−) = log[ exp(v * v+/τ ) exp(v * v+/τ ) + (cid:80)N n=1 exp(v * v− n /τ ) ]. (2) Before passing vectors into the above formulas, they need to be normalized to prevent space collapse or expansion. Es- sentially it is actually a cross-entropy loss function, which can close the distance between the query and the positive samples in the feature space, while pushing away the distance between the query and the negative samples in the feature space. It is actually equivalent to an N+1 class classification problem (classifying query with a class corresponding to one positive sample and a class corresponding to N negative samples), as shown in Figure 4. 4. EXPERIMENT SETTING In this section, we describe the details of Attention-based CUT_GAN Implementation, including used Datasets, loss function and evaluation metrics. 4.1. Datasets The experiments are based on the Cityscapes [],which con- tains a diverse set of stereo video sequences recorded in street scenes from 50 different cities, with high quality pixel-level annotations of 5000 frames in addition to a larger set of 20000 weakly annotated frames. and Playing for Data dataset [19], which consists of 24966 densely labelled frames split into 10 parts for convenience. The class labels are compatible with the CamVid and CityScapes datasets, so that it's easy to use while the target is Cityscapes dataset. 4.2. Training To show the effect of the proposed patch-based contrastive loss, we intentionally match the architecture and hyperparam- eter settings of CycleGAN, except the loss function. This includes the ResNet-based generator [11] with 9 residual blocks, PatchGAN discriminator [16], Least Square GAN loss [4], batch size of 1, and Adam optimizer [20] with learn- ing rate 0.002. Our full model Attention-based CUT_GAN is trained up to 400 epochs, which is the same as CUT_GAN settings. Our encoder Genc is the first half of the CycleGAN generator [5]. In order to calculate our multi-layer, patch-based contrastive loss, we extract features from 5 layers, which are RGB pixels, the first and second downsampling convolution, and the first and the fifth residual block. The layers we use correspond to receptive fields of sizes 1 × 1, 9 × 9, 15 × 15, 35 × 35, and 99 × 99. For each layer's features, we sample 256 locations arrcording to their significance, and apply 2-layer MLP to ac- quire 256-dim final features. We normalize the vector by its L2 norm. 4.3. Loss function The loss of Attention-based CUT_GAN comprises three least square loss LGAN [4], PatchNCE loss main parts: LP atchN CE(G, H, X) from domain X, PatchNCE loss LP atchN CE(G, H, Y ) from domain Y, which are shown in LGAN (G, D, X, Y ) + λX LP atchN CE(G, H, X)+ λY LP atchN CE(G, H, Y ). (3) We choose λX = 1 when we jointly train with the identity loss λY = 1, and choose a larger value λX = 10 without the identity loss (λY = 0) to compensate for the absence of the regularizer. Our model is relatively simple compared to recent methods that often use 5-10 losses and hyper-parameters. IS(more is better), Self-Attention module is the best, which achieves 2.45. For the evaluation metric SWD(less is better), CycleGAN is the best, which reaches only 287.18. 4.4. Evaluation Metrics 5.2. Discussion Aimed at assessing visual quality and discovered correspon- dence, we mainly use three metrics to evaluate the gener- ated images: Frechet Inception Distance, Inception Score and Sliced Wasserstein Distance. 4.4.1. Frechet Inception Distance Frechet Inception Distance(FID) is a measure of similarity be- tween two datasets of images, which empirically estimates the distribution of real and generated images in a deep network space and computes the divergence between them. FID was shown to correlate well with human judgement of visual qual- ity and is most often used to evaluate the quality of samples of Generative Adversarial Networks. The smaller the value of FID, the closer the generated image is to the data distribution of the target domain. 4.4.2. Inception Score Inception Score evaluates the quality of GAN-generated im- ages in terms of both clearness and diversity. 4.4.3. Sliced Wasserstein Distance SWD can measure image distribution mismatches or imbal- ances without additional labels. The idea is to first obtain the representation of the high-dimensional probability distribu- tion in one dimension by linear mapping, and then calculate the wasserstein distance of the one-dimensional representa- tion of the two probability distributions. We use Fréchet Inception Distance(FID) and Sliced Wasser- stein Distance (SWD) to evaluate the quality of translated im- ages. FID and SWD both measure the distance between two distributions of real and generated images, and lower indicate the generated image is similar to the real one. In addition, we use Inception Score as evaluation metrics, which considers both image quality and diversity. According to attention mechanisms, there are four set- tings in our model, Triplet Attention, External Attention, Self- attention and Bottleneck Attention. For the metric of FID, the translated results of Triplet-Attention based model are more realistic than other methods. For the metric of IS, the translated results of Self-Attention based model performs the best than other methods. However, for the metric of SWD, our proposed Attention-based CUT_GAN not exceeds Cy- cleGAN. Further, considering the three evaluation metrics together, our Attention-based CUT_GAN model (no matter which attention mechanism is applied) performs better than the original CUT_GAN model. Moreover, our method does not add extra model parameters in both generator G and dis- criminator D. Compared to baseline methods, our Attention-based CUT_GAN model has the ability to translate the domain- relevant features accurately. Further, the position and struc- ture of the objects in the generated image are also maintained partially invariant. For example, there are a large number of trees being generated in baseline models, however, this is not present in the simulated image(source domain). This problem is mitigated in our proposed model. 5. RESULTS AND DISCUSSION 6. CONCLUSION In this section, we show the experimental results of four at- tention modules separately: Triplet Attention, External Atten- tion, Self-attention and Bottleneck Attention. In addition, the baseline GAN such as CycleGAN and CUT_GAN are also presented and compared. 5.1. Qualitative Comparision Table 1 shows ablation results for the effect of each atten- tion module in our Attention-based CUT_GAN. We summa- rize the Fréchet Inception Distance(FID), Inception Score(IS) and Wasserstein Distance(SWD) results on Attention-based CUT_GAN with four different attention modules. In addition, CUT_GAN and CycleGAN are shown as baselines. For the evaluation metric FID(less is better), Triplet Attention mod- ule is the best, which obtains 50.55. For the evaluation metric This paper focuses on solving the third step towards the photo-realistic virtualization of road objects, namely the in- telligent post-processing algorithms. Firstly, this paper pro- poses a Generative adversarial network to realize unpaired image-to-image translation and transformation between the simulated domain and the real domain. Secondly, we pro- pose an Attention Mechanism Module for cross-domain con- trastive learning in the task of Image-to-Image Translation. Instead of randomly selecting the anchor, positive and nega- tive samples to compute the contrastive loss, we measure the significance of source domain features and select them based on significance so that the constraint becomes more relevant for the domain translation. Finally, we experimentally prove that our Attention-based CUT_GAN outperforms the original CUT_GAN and increases the mutual information between the source domain and target domain. CUT_GAN CycleGAN Self-attention 52.87 2.44 287.18 51.41 2.45 354.234 55.48 2.42 395.78 External_attention 52.68 2.32 390.29 BAM Triplet 50.55 51.40 2.31 2.42 346.21 388.73 FID IS SWD Table 1. Qualitative Comparision of baselines(CUT_GAN and CycleGAN) and Attention-based CUT_GAN with four different attention modules For the Attention Mechanism Module, we apply four dif- ferent attention mechanisms: Triplet Attention, External At- tention, Self-attention and Bottleneck Attention. All set- tings outperform the original CUT_GAN without adding ex- tra model parameters in both generator and discriminator. Be- sides, we process all generated images and convert them into training datasets of semantic segmentation, in order to verify the practical value of this thesis. After training, the seman- tic segmentation network can achieve higher accuracy when tested with real images. However, it is still not good as the network is trained with real images. We demonstrated the ef- fectiveness of introducing the attention mechanism module, but at the same time, there still has a lot of work to be done to improve it. 7. REFERENCES [1] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio, "Generative adversar- ial networks," Communications of the ACM, vol. 63, no. 11, pp. 139–144, 2020. [2] Guim Perarnau, Joost Van De Weijer, Bogdan Radu- canu, and Jose M Álvarez, "Invertible conditional gans for image editing," arXiv preprint arXiv:1611.06355, 2016. [3] Alec Radford, Luke Metz, and Soumith Chintala, "Un- supervised representation learning with deep convolu- tional generative adversarial networks," arXiv preprint arXiv:1511.06434, 2015. [4] Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley, "Least squares in Proceedings of generative adversarial networks," the IEEE international conference on computer vision, 2017, pp. 2794–2802. [5] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros, "Unpaired image-to-image translation using cycle-consistent adversarial networks," in Proceedings of the IEEE international conference on computer vi- sion, 2017, pp. 2223–2232. [6] Andrew Brock, Jeff Donahue, and Karen Simonyan, "Large scale gan training for high fidelity natural image synthesis," arXiv preprint arXiv:1809.11096, 2018. [7] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros, "Image-to-image translation with conditional ad- versarial networks," in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017. [8] Augustus Odena, Christopher Olah, and Jonathon Shlens, "Conditional image synthesis with auxiliary classifier gans," in International conference on machine learning. PMLR, 2017, pp. 2642–2651. [9] Xiao Liu, Fanjin Zhang, Zhenyu Hou, Li Mian, Zhaoyu Wang, Jing Zhang, and Jie Tang, "Self-supervised learn- ing: Generative or contrastive," IEEE Transactions on Knowledge and Data Engineering, 2021. [10] Minguk Kang and Jaesik Park, "Contragan: Contrastive learning for conditional image generation," Advances in Neural Information Processing Systems, vol. 33, pp. 21357–21369, 2020. [11] Justin Johnson, Alexandre Alahi, and Li Fei-Fei, "Per- ceptual losses for real-time style transfer and super- resolution," in European conference on computer vision. Springer, 2016, pp. 694–711. [12] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky, "Instance normalization: The missing ingredient for fast stylization," arXiv preprint arXiv:1607.08022, 2016. [13] Sergey Ioffe and Christian Szegedy, "Batch normaliza- tion: Accelerating deep network training by reducing internal covariate shift," in International conference on machine learning. PMLR, 2015, pp. 448–456. [14] Andrew L Maas, Awni Y Hannun, Andrew Y Ng, et al., "Rectifier nonlinearities improve neural network acous- tic models," in Proc. icml. Atlanta, Georgia, USA, 2013, vol. 30, p. 3. [15] Taesung Park, Alexei A. Efros, Richard Zhang, and Jun- Yan Zhu, "Contrastive learning for unpaired image-to- image translation," in European Conference on Com- puter Vision, 2020. [16] Jinlin Ma, Meng Wei, Ziping Ma, Li Shi, and Kai Zhu, "Retinal vessel segmentation based on generative adver- sarial network and dilated convolution," in 2019 14th International Conference on Computer Science & Edu- cation (ICCSE). IEEE, 2019, pp. 282–287. [17] Michael Gutmann and Aapo Hyvärinen, "Noise- contrastive estimation: A new estimation principle for unnormalized statistical models," in Proceedings of the thirteenth international conference on artificial intelli- gence and statistics. JMLR Workshop and Conference Proceedings, 2010, pp. 297–304. [18] Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Inter- Ilya Sutskever, and Pieter Abbeel, "Infogan: pretable representation learning by information maxi- mizing generative adversarial nets," Advances in neural information processing systems, vol. 29, 2016. [19] Stephan R. Richter, Vibhav Vineet, Stefan Roth, and Vladlen Koltun, "Playing for data: Ground truth from computer games," in European Conference on Com- puter Vision (ECCV), Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling, Eds. 2016, vol. 9906 of LNCS, pp. 102–118, Springer International Publishing. [20] P Kingma Diederik and Jimmy Ba Adam, "A arXiv preprint method for stochastic optimization," arXiv:1412.6980, 2014.
http://arxiv.org/abs/2302.12050v1
2023-02-23T14:22:45
2023-02-23T14:22:45
SPINDLE: Spinning Raw Text into Lambda Terms with Graph Attention
This paper describes SPINDLE - an open source Python module implementing an efficient and accurate parser for written Dutch that transforms raw text input to programs for meaning composition, expressed as {\lambda} terms. The parser integrates a number of breakthrough advances made in recent years. Its output consists of hi-res derivations of a multimodal type-logical grammar, capturing two orthogonal axes of syntax, namely deep function-argument structures and dependency relations. These are produced by three interdependent systems: a static type-checker asserting the well-formedness of grammatical analyses, a state-of-the-art, structurally-aware supertagger based on heterogeneous graph convolutions, and a massively parallel proof search component based on Sinkhorn iterations. Packed in the software are also handy utilities and extras for proof visualization and inference, intended to facilitate end-user utilization.
[ "Konstantinos Kogkalidis", "Michael Moortgat", "Richard Moot" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12050v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12050v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CL", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CL", "cs.AI", "cs.LG", "cs.LO" ]
SPINDLE: Spinning Raw Text into Lambda Terms with Graph Attention Konstantinos Kogkalidis♦ and Michael Moortgat♦ and Richard Moot(cid:50) ♦ Institute for Language Sciences, Utrecht University (cid:50) LIRMM, Université de Montpellier, CNRS {k.kogkalidis,m.j.moortgat}@uu.nl, [email protected] 3 2 0 2 b e F 3 2 ] L C . s c [ 1 v 0 5 0 2 1 . 2 0 3 2 : v i X r a Abstract This paper describes SPINDLE1 – an open source Python module implementing an effi- cient and accurate parser for written Dutch that transforms raw text input to programs for meaning composition, expressed as λ terms. The parser integrates a number of break- through advances made in recent years. Its output consists of hi-res derivations of a multi- modal type-logical grammar, capturing two or- thogonal axes of syntax, namely deep function- argument structures and dependency relations. These are produced by three interdependent systems: a static type-checker asserting the well-formedness of grammatical analyses, a state-of-the-art, structurally-aware supertagger based on heterogeneous graph convolutions, and a massively parallel proof search compo- nent based on Sinkhorn iterations. Packed in the software are also handy utilities and extras for proof visualization and inference, intended to facilitate end-user utilization. 1 Introduction The transparency and formal well-behavedness of lambda calculi make them the ideal format for ex- pressing compositional structures, a fact that has been duly emphasized by parsers and tools with a predominant focus on semantics. Lambda calculi form a key ingredient of type-logical grammars, where they find use as the computational coun- terpart of a so-called grammar logic, a substruc- tural logic of the intuitionistic linear variety that is designed to capture (aspects of) natural language syntax and semantics (Moortgat, 1997). For type- logical grammars, the Curry-Howard isomorphism guarantees a straightforward passage between logi- cal rules, type constructors and term-forming opera- tors; put simply, Parse ≡ Proof ≡ Program, and Cat- egory ≡ Proposition ≡ Type. The modus operandi 1Stylized spind2λe and standing for spindle parses into dependency-decorated λ expressions. Source code and user instructions can be found at https://github.com/ konstantinosKokos/spindle. is straightforward: a lexicon associates words with logical formulas, and the logic's rules of inference decide how formulas may interact with one another. By extension, words may only combine in a strict, well-typed manner, forming larger phrases in the process. Parsing becomes a process of log- ical deduction, at the end of which the result (a proof) gives rise to a recipe for meaning assem- bly (a program). This program is turned into exe- cutable code as soon as one plugs in appropriate interpretations for the lexical constants (words) and for the term operations (composition instructions). The set-up is general-purpose in that it readily ac- commodates different choices for these interpre- tations; valid targets can for instance be found in (truth-conditional) formal semantics, distributional- compositional models (Sadrzadeh and Muskens, 2018), or tableau-based theorem provers (Abzian- idze, 2017). In this work, we are interested in what happens prior to semantic execution; that is, we abstract away from lexical semantics and seek to reveal the compositional recipe underlying a natural language utterance. To that end, we employ a type gram- mar aimed at capturing two different syntactic axes, only rarely observed together in the wild: function- argument structures and dependency relations. To procure a derivation from an input phrase, we de- sign and implement a system combining three dis- tinct but communicating components. Component number one is the implementation of the grammar's type system - it comes packed with a number of useful facilities, most important being a static type checker that verifies the syntactic well-formedness of the analyses construed. Component number two is a supertagger responsible for assigning a type to each input word - the tagger is formulated on the basis of a hyper-efficient heterogeneous graph con- volution kernel that boasts state-of-the-art accuracy among categorial grammar datasets. The third and last component is a neural permutation module that exploits the linearity constraint of the target logic to simplify proof search as optimal transport learn- ing (Peyré et al., 2019) - this reformulation allows for a massively parallel and easily optimizable im- plementation, unobstructed by the structure ma- nipulation breaks common in conventional parsers. The three components alternate roles through the processing pipeline, switching between phases of low level linear algebra routines and high level logical reasoning (GPU and CPU intensive, respec- tively). Their integration yields a lightspeed-fast and highly accurate neurosymbolic parser, neatly packaged and made publicly available. 2 System Decomposition 2.1 Type Grammar The system's theoretical backbone is its type logic – a uniquely flavoured, semantics-first type-logical grammar that strays from the categorial norm in two major ways. First, it focuses on deep syntactic structure (or tectogrammar, in Curry's terms) rather than surface form; its functional types are therefore oblivious to directional or positional constraints, abiding only to the linearity condition: every occur- rence of an atomic proposition must be used once and exactly once. Second, it dresses functional types up, so as to have them encode grammatical functions, making a three-way distinction between complements, heads and adjuncts. A full exposition of the grammar is beyond the scope of this paper, but a superficial and simplified rundown should help shed light on what is to follow. Its first aspect, function-argument structures, is modeled using linear logic's implication arrow, (cid:40), which gives us access to resource-conscious ver- sions of function application and variable abstrac- tion (Girard, 1987; Abramsky, 1993). In their lin- guistic usecase, functional types of the form A(cid:40)B denote predicates that consume a single occurrence of some object of type A, the result being a compos- ite phrase of type B. Reasoning about gaps, ellipses and the like is accomplished with the aid of higher- order types, i.e. instances of the previous scheme where A is itself a function - these higher-order types launch a process of hypothetical reasoning, whereby we may temporarily assume the existence of a resource to produce a derivation locally, only to later withdraw the hypothesis, creating a new function in the process. The second aspect, de- pendency relations, are modeled using a labeled assortment of residuated pairs of unary operators x : A (cid:96) x : A id (c (cid:55)→ A) ∈ L c : A (cid:96) c : A lex Γ (cid:96) s : A(cid:40)B ∆ (cid:96) t : A Γ, ∆ (cid:96) s t : B (cid:40)E Γ, x : A (cid:96) s : B Γ (cid:96) λx.s : A(cid:40)B (cid:40)I Γ (cid:96) s : (cid:50)δ A (cid:104)Γ(cid:105)δ (cid:96) (cid:72)δs : A (cid:50)δE Γ (cid:96) s : A (cid:104)Γ(cid:105)δ (cid:96) (cid:77)δs : ♦δ A ♦δI Figure 1: Logical rules of inference used by the type grammar (subset). The id rule instantiates a fresh vari- able of arbitrary type A. The lex rule provides declares a constant c as being of type A, given type assignment c (cid:55)→ A pulled from the lexicon L (or, in the post- neural era, the supertagger). Introduction rules are com- plex types constructors, elimination rules are destruc- tors. The (cid:40)E rule says a term s of type A(cid:40)B derived from premises Γ can apply to a term t of type A derived from premises ∆, producing a complex term s t of type B derived from the merger of Γ and ∆. The (cid:40)I rule says that if the premises of some term s of type B in- clude a variable x of type A, we can abstract over the latter, producing a term λx.s of type A(cid:40)B. The (cid:50)δE rule removes the box from a term s of type (cid:50)δ A, pro- ducing term (cid:72)δs of type A and enclosing the premises under brackets (cid:104)_(cid:105)δ. Dually, the ♦δI rule puts a term s of type A under the scope of a diamond, producing term (cid:77)δs of type ♦δ A and again enclosing the premises under brackets (cid:104)_(cid:105)δ. lent from temporal logic. Atomic types without any dependency decorations are assigned to linguisti- cally autonomous units and phrases, e.g. NP for a noun phrase. Functional types denoting heads impose a diamond ♦c on the complements they select for, label c being the dependency slot the complement is to occupy, e.g. ♦suNP(cid:40)Smain for an intransitive verb looking for a subject-marked noun phrase to produce a matrix clause. Dually, functional types denoting adjuncts are themselves decorated with a box (cid:50)a, label a now being the dependency role projected by the adjunct prior to application, e.g. (cid:50)mod(NP(cid:40)NP) for an adjective, promising to provide a function over noun phrases if one is to remove its box. Introducing a diamond or eliminating a box leaves a structural imprint that encloses complete phrases under brackets, and a computational imprint that calls for a special treat- ment of the wrapped term – both labeled by the grammatical function of the diamond (resp. box) that was introduced (resp. eliminated). The key log- ical rules of the type grammar and their isomorphic term operations are presented in Figure 1. die c2 (cid:96) (cid:50)det(N(cid:40)NP) (cid:104)c2(cid:105)det (cid:96) N(cid:40)NP lex (cid:50)detE rare c3 (cid:96) (cid:50)mod(N(cid:40)N) (cid:104)c3(cid:105)mod (cid:96) N(cid:40)N lex (cid:50)modE (cid:104)c3(cid:105)mod, c4 (cid:96) N tekening c4 (cid:96) N lex (cid:40)E (cid:40)E (cid:104)c2(cid:105)det, (cid:104)c3(cid:105)mod, c4 (cid:96) NP (cid:104)(cid:104)c2(cid:105)det, (cid:104)c3(cid:105)mod, c4(cid:105)su (cid:96) ♦suNP ♦suI (cid:40)E is c1 (cid:96) ♦predcPRON(cid:40)♦suNP(cid:40)SVI lex x (cid:96) ♦predcPRON c1, x (cid:96) ♦suNP(cid:40)SVI id (cid:40)E Wat c0 (cid:96) ♦whbody(♦predcPRON(cid:40)SVI)(cid:40)WHQ lex c1, x, (cid:104)(cid:104)c2(cid:105)det, (cid:104)c3(cid:105)mod, c4(cid:105)su (cid:96) SVI c1, (cid:104)(cid:104)c2(cid:105)det, (cid:104)c3(cid:105)mod, c4(cid:105)su (cid:96) ♦predcPRON(cid:40)SVI (cid:104)c1, (cid:104)(cid:104)c2(cid:105)det, (cid:104)c3(cid:105)mod, c4(cid:105)su(cid:105)whbody (cid:96) ♦whbody(♦predcPRON(cid:40)SVI) (cid:40)I c0, (cid:104)c1, (cid:104)(cid:104)c2(cid:105)det, (cid:104)c3(cid:105)mod, c4(cid:105)su(cid:105)whbody (cid:96) c0 (cid:77) whbody(λx.c1 x (cid:77)su((cid:72) det(c2) ((cid:72) mod(c3) c4)) : WHQ ♦whbodyI (cid:40)E whbody su det mod Wat is die rare tekening Figure 2: Natural deduction proof for the sentence Wat is die rare tekening? 'What is that strange drawing?'. For space economy, compositional λ term is only explicitly written in the endsequent (bottom of the proof). From the antecedent structure of the endsequent, we may also recover a dependency tree. Color coding serves to informally differentiate between complement (red) vs. adjunct (green) structural brackets/dependency arcs. 2.1.1 Proof Representation 2.1.2 Implementation Proofs in the type logic are traditionally served in the tree-like natural deduction format. Proofs in natural deduction benefit from an easy transla- tion to (i) λ expressions, by following the rules of Figure 1, and (ii) dependency trees, by simply casting structural brackets to dependency arcs, go- ing from the head of each phrase to (the heads of) its dependents. Figure 2 presents a visual ex- ample. An alternative representation is in the far less verbose format of a proof net, a geometric construction that abstracts away from the bureau- cratic book-keeping of hypothetical reasoning and tree-structured rule ordering. Figure 3 presents the proof net equivalent of the running example. Proof nets are easier to reason about in a neural setup by allowing us to treat parsing as the vastly sim- plified problem of matching each occurrence of an atomic proposition in negative position, i.e. a prerequisite of a conditional implication, with an occurrence in positive position, i.e. a (condition- ally) proven statement. The parallel nature of proof nets allows the matching to occur simultaneously across the entire proof; that is, all decisions are done in a single instant, without the bottleneck of having to wait for conditionals to be satisfied in a bottom-up fashion. On the other hand, proof nets are slightly underspecified compared to natural de- duction proofs, being explicit only with respect to function-argument structures – translating from one format to another requires establishing some conventions on what constitutes a canonical proof. The syntax of the type system is implemented as a tiny DSL written in Python.2 It is used as the representation format of AEthel (Kogkalidis et al., 2020a), a dataset of some 70 000 analyses of writ- ten Dutch, which also constitutes the system's train- ing data. The implementation was originally de- signed to assert the type-safety of the dataset, to facilitate the conversion between natural deduction trees, λ terms and proof nets, and to ease third- party corpus analysis by providing niceties such as search and pretty printing utilities, cross compila- tion to LATEX for visualization purposes, interfaces for proof transformations, etc. All these function- alities are imported unchanged. The conversion routines allow us to conduct neural proof search in the favorable regime of proof nets, and convert the result to natural deduction format only at the very end, just for the sake of presentation and/or sanity testing. Importantly, the type-checker is re- purposed as a tool for verifying the correctness of analyses constructed – an analysis that does not amount to a valid proof will fail to pass the checker, throwing a type error and alerting us to the fact. In other words, we can blindly trust anything the parser gives us as correct, at least in the sense of (proof-theoretic) syntactic validity. 2Source code can be found at https://github.com/ konstantinosKokos/aethel. PRON0 1 Svi NP4 5 Svi (cid:40)♦predc WHQ2 PRON3 (cid:40)♦su N6 NP7 N8 N9 (cid:40)♦whbody Wat (cid:40)♦predc is (cid:50)det(cid:40) die (cid:50)mod(cid:40) N10 rare tekening Figure 3: Proof net equivalent of the proof of Figure 2, with unary diamonds (resp. boxes) fused with the impli- cation dominating (resp. dominated by) them for depth compression. Atomic propositions are indexed by enu- meration for identification purposes. Color coding here serves to differentiate between resources we have (green) and resources we need (red) – the rule is start green from the bottom, change (resp. keep) color for the left (resp. right) daughter of an implication. Bold edges denote the tree structure underlying type assignments. Dashed edges denote the correct matching between resources of opposite polarity. 2.2 Supertagging Module Lexical type ambiguity and lexical type sparsity are common and pervasive problems for any cat- egorial grammar. The de facto approach rests on a supertagger, a neural module replacing the fixed lexicon, traditionally formulated as a sequence clas- sifier and trained to produce the most plausible type assignments for each word in the context of an in- put sentence. Here, these problems are exacerbated by the highly elaborated type system. Some 80% of AEthel's approx. 6 000 types are rare (i.e. have less than 10 occurrences in the corpus), and some 10% of the total sentences contain at least 1 such rare type. This necessitates a more ambitious treat- ment than the standard "set-and-forget" approach of completely discarding rare type assignments as inconsequential. The solution comes in the form of a constructive supertagger, an auto-regressive neural decoder that is trained to construct types on the fly according to their algebraic decompo- sition, rather than treat them as singular, opaque blocks (Kogkalidis et al., 2019). This configuration enables the construction of valid types regardless of whether they have been seen before or not, ex- tending coverage beyond the training data. The supertagger employed here follows a geometrically informed, task-specific decoding order, whereby types are represented as the structural unfolding of binary trees. Following Prange et al. (2021), trees are decoded in parallel across the entire batch of input sequences, establishing an upper temporal bound on decoding that scales with the maximal tree depth – in practice, a constant. To circumvent the locality of a standard tree decoder, the target output being not a batch of trees but a batch of sequences of trees (see Figure 3), the supertagger is formulated as a a graph neural network, utilizing message-passing connections to transfer feedback from tree nodes to their lexical roots and from lex- ical roots to their neighbours, ensuring that deci- sions made at each decoding step are influenced by prior decisions across the entire output (Kogka- lidis and Moortgat, 2022). As a result, it strikes the perfect balance between the speed and memory ef- ficiency of a tree-shaped architecture, allowing for more training iterations and faster inference, and the stronger autoregressive properties of a seq2seq model, improving performance. Further, being in- herently constrained to trees, its output is struc- turally correct-by-construction – under no circum- stance can any of the types produced be ill-formed. Used in isolation, the architecture currently sits at the top of the accuracy leaderboard for categorial grammar supertagging across different formalisms and languages – the performance is marginally in- ferior in the multi-task training setup adopted here. 2.3 Permutation Module Conducting search over proof nets is typically ill- advised. The problem traditionally involves ex- amining all possible bijections between positive and negative atomic propositions. The number of such bijections scales factorial to the number of atomic propositions, quickly becoming prohibitive. To navigate this combinatorially explosive land- scape, neural proof nets relax proof search into a continuous, differentiable problem, where finding the correct bijection is translated to a transporta- tion problem (Kogkalidis et al., 2020b) learned by yet another graph neural network. Concretely, the representations of all occurrences of atomic propo- sitions are extracted from the decoder and binned according to their sentential index, sign and polarity (e.g. a single bin would be all occurrences of a pos- itive NP in sentence #13 of the input batch). Each bin is contrasted with its inverse polarity counter- part using some similarity metric (here a weighted inner product). The result is a collection of square matrices, each matrix containing attention weights (or similarity scores) in the cartesian product of positive and negative items of the same sign and sentence. These matrices are grouped by their car- dinality, and the Sinkhorn operator (Sinkhorn and Knopp, 1967) is used to push them towards bina- rity and bistochacity, yielding approximations of permutation matrices representing the goal bijec- tions (Mena et al., 2018). To make things concrete using the running ex- ample of Figure 3, each of the atomic types Svi, NP and PRON has a single negative and a single positive occurrence, therefore their bijections are trivial (a testament to supertagging being almost parsing). The single positive occurrence of WHQ stands for the goal type of the phrase, and remains unmatched. Only N requires a decision, having two possible bijections. The correct candidate is en- coded by the permutation table below, where rows enumerate positive and columns negative items: 6 (cid:88) 8 (cid:88) ΠN := 9 10 This reformulation entails a tremendous speedup: the painstakingly slow problem of symbolic proof search is cast into simple, well-optimized and batchable matrix operations. The current parser builds on the insight that the permutation module is invariant to the source of atomic symbol represen- tations, and in fact greatly benefits from the faster and more accurate task-adapted supertagger. 2.4 Integration Neurosymbolic integration yields an end-to-end pipeline that consists of the following phases. First, the user inputs a list of sentences to be parsed. Contextualized token representations are obtained from a fine-tuned BERTBASE model, which are then aggregated according to the input's word bound- aries. The resulting word representations act as initial seeds for decoding to begin on an empty canvas. During decoding, types are progressively constructed, while seeds are updated by exchang- ing messages with one another on the basis of their sequential proximity. After a small number of de- coding steps, the process terminates, yielding a se- quence of type assignments for each input sentence. A rudimentary invariance check is then performed, controlling whether each sequence counts an equal number of atomic propositions of each polarity. Sentences failing the invariance check are not eligi- ble for proof search, and their analysis stops early. Passing sentences are symbolically processed to obtain a collection of sparse indexing tensors, used to gather the decoder's representations into the bins described earlier. Bins are batched and contrasted, and a small number of Sinkhorn iterations is em- ployed as a 2-dimensional softmax analogue. The soft Sinkhorn distances are discretized using the Hungarian algorithm in order to enforce bijectiv- ity (Jonker and Volgenant, 1987). Bijections are re- associated with their origin symbols and sentences, using the reverse of the previous indexing operation. Control is then passed to the symbolic component, which attempts to traverse the candidate proof nets, verifying the correctness criteria of acyclicity and connectedness in the process (Danos and Regnier, 1989). The traversal coincides with a translation to a natural deduction format, the construction of which corresponds to static type checking of the output (Lamarche, 2008). Assuming no type mis- matches are caught, the output is a proof proper, which by Curry-Howard isomorphism is rewritten as a dependency-decorated λ term. The user is finally presented with an analysis for each input sentence – ideally, a λ term, but occasionally a rejected intermediate result together with an error description. 3 Evaluation 3.1 Performance The system has been evaluated on the test set of AEthel. Without any pre-filtering or post-processing training wheels (i.e. no constraints on sentence length, type rarity/depth or cardinality of bijec- tions), the parser produces a proof that satisfies strict syntactic equality with the ground truth in 3 191 of the 5 770 test set samples. This amounts to a significant 55.30% of the test sentences being analyzed without a single error with respect to type assignments, phrasal chunking, function-argument structures and dependency annotations produced3 In total, 4 901 sentences are assigned a passing analysis, which sets the coverage to a more modest 84.94%. The discrepancy between the high accu- racy and low coverage is due to the rigidness of the type system: only 5 010 of the sentences satisfy the invariance check, being thus amenable to any proof. This signals that the performance bottleneck lies on the supertagger rather than the permutation module; a parse is assigned to 97.82% of parsable sentences, and it's also the perfect parse 75.30% of the time. These findings are summarized in Table 1. parsability (some proof obtainable) coverage (some proof obtained) 86.83 84.94 structures in isolation. Relaxation two targets the modal enhancement of the logic, collapsing the set of atomic types into a single point (thus treating all functional types of the same shape as equal) in or- der to examine dependency structures in isolation. Relaxing on both axes at once is essentially casting proofs into the untyped λ calculus, where all we care about are the type- and dependency- agnostic function-argument structures – this is the metric most comparable to external theories.4 Note that relaxations are performed only after inference – the point being that a strict proof must have been pro- duced for its relaxations to be considered (i.e. lax accuracy is still bottlenecked by strict coverage). The results are averaged over covered samples5 and presented in Table 2. modulo – modalities functional types both local metrics r p F1 89.52 90.93 91.09 92.31 89.68 91.13 91.26 92.52 89.39 90.85 90.97 92.24 Table 2: Decomposition metrics and relaxations. types correct (correct proof obtainable) accuracy (correct proof obtained) 3.2 Efficiency 56.88 55.30 Table 1: Sentential-level evaluation of the parser. To obtain a more refined perspective on perfor- mance, we employ an adaptation of the parsing community's favorite F1-score. Concretely, we gather all samples for which a proof was produced, and decompose both prediction and ground truth into their respective sets of subproofs. We measure tp as the two sets' intersection, f p as the differ- ence between predicted and correct subproofs and f n as the difference between correct and predicted subproofs, from which we may obtain precision as p = tp/(tp + f p), recall as r = tp/(tp + f n) and their harmonic mean as F1 = 2pr/(p + r). On top of the vanilla versions of these metrics, we can also ex- amine relaxations by incorporating a combination of two modulo factors. Relaxation one targets the functional core of the logic, applying a forgetful transformation that strips proofs of their modali- ties in order to examine typed function-argument 3This is comparable to the state-of-the-art for the similar (in fact simpler) problem of CCG parsing; see Clark (2021) for an up-to-date overview. Regarding efficiency, the architecture contains a non-negligible total of 117M parameters, 94% of which are inherited from the underlying BERT model. The memory footprint of the network's forward pass does not exceed 3.5GB on the test set with a batch size of 64, making it reasonably lightweight for use at home. Using a middle range laptop GPU, the network takes about 15 seconds to tag the full test set (i.e. 370 sents/sec or 6 000 tokens/sec), and 80 seconds to tag and parse it (i.e. 70 sents/sec), including tokenization and post- processing. Note, however, that sentence-level batching is not yet implemented for inference mode proof search, i.e. sentences are tagged in parallel but proven sequentially. Cross-sentential padding and batching of Sinkhorn inputs is in the works – benchmarking shows that the asymptotic behav- ior of a forward pass over batches of 64 matrices only starts becoming apparent when they exceed 4Proofs are in β and η normal, so no free points from abstractions. Variables are only equal if they match in both name and type, so no free points from variable instantiations either. 5Averaging over the full test set would artificially inflate p and deflate r scores, since no partial proofs are returned from failing samples. >>> from inference import InferenceWrapper as IW >>> from aethel.utils.tex import compile_tex, sample_to_tex >>> parser = IW(weight_path='./data/model_weights.pt') >>> analysis = parser.analyze(['Wat is die rare tekening?'])[0] >>> analysis Analysis( lexical_phrases=( LexicalPhrase(string=Wat, type=(♦whbody(♦predc(VNW)→SV1))→WHQ, len=1), LexicalPhrase(string=is, type=♦predc(VNW)→♦su(NP)→SV1, len=1), LexicalPhrase(string=die, type=(cid:50)det(N→NP), len=1), LexicalPhrase(string=rare, type=(cid:50)mod(N→N), len=1), LexicalPhrase(string=tekening, type=N, len=1), LexicalPhrase(string=?, type=PUNCT, len=1)), proof=c0, (cid:104)c1, (cid:104)(cid:104)c2(cid:105)det, (cid:104)c3(cid:105)mod, c4(cid:105)su(cid:105)whbody (cid:96) c0 (cid:77)whbody((λx0.c1 x0 (cid:77)su((cid:72)det(c2) ((cid:72)mod(c3) c4)))) : WHQ) >>> tex_proof = compile_tex(sample_to_tex(analysis)) # see Figure 2 for output :) Figure 4: User interaction example in python console. the order of 27, being locked at an insubstantial 1ms prior to that.6 4 User Interface The user interface is bare-bones, but simple and easy to use. The parser is currently packaged as a code repository, which, once downloaded, can be used as a python module. A front-end class wraps around the scary inner workings of the parser and provides easy access to an inference routine. Struc- ture checking is handled internally and error han- dling is graceful: the user is guaranteed an output even in the case of a partial failure. The output implements the same protocols as samples of the AEthel corpus, and is thus compatible with all of the latter's bells and whistles. Proofs can be pretty- printed, interactively processed and transformed (e.g. for semantic applications), or visualized using LATEX as a middlewoman. For the more ambitious, training and evaluation utilities are also available. 5 Conclusion & Future Work Thus concludes the demonstration tour of spind2λe: a unique neurosymbolic parser that can accurately and efficiently convert raw text into λ expressions. Unlike cheaper alternatives, these λ expressions are not structureless ad-hoc imitations produced from arbitrary decoding, but executable, type-safe and 100% guaranteed correct programs. The soft- ware focuses on Dutch, but the universality of the intuitionistic linear core allows easy cross-lingual adaptation that essentially boils down to retraining with a new type lexicon; a French implementation is currently in the works (De Pourtales et al., 2023). 6To comprehend how extremely unrealistic 27 is, consider that this would amount to finding the correct bijection out of 27! = 3.9 × 10215 possibilities across 64 pairs of sets in parallel. As to what the future holds, the intention is to keep the module synchronized and up-to-date with AEthel: any upcoming major release of the latter will be reflected in an update of the former (be it soft patching or retraining). Compatibility aside, planned features include deploying the module as a web service, compiling it as a stand-alone pack- age and documenting the annotations (so as to be more inclusive towards the type-uninitiated). Any performance, stability or efficiency improvements stemming from related research or moments of en- gineering inspiration are also likely to find their way to the user-facing front. Contributions and feedback are always welcome. Limitations The implementation described capitalizes on a dis- entanglement between neural and symbolic oper- ations to improve efficiency. But doing so comes at the heavy price of a unidirectional data flow that lacks feedback. The symbolic component has the singular role of testing and verifying the neural out- put, but emits back no messages of its own. Failures may be caught, but they are nonetheless irrecov- erable – a partial output that fails some structural constraint signifies an abrupt and non-negotiable end to the processing pipeline, significantly reduc- ing coverage. A better operationalization would be to use the symbolic core to continuously ask for neural output as long as the structural constraints are not met (or the user is not satisfied with the parse provided). However, this would only be fea- sible if the neural components were to be extended with some notion of backtracking. In that sense, the parallel nature of both the supertagger and the parser becomes now a double-edged sword, hinder- ing the potential applicability of standard heuristic algorithms like beam search. More generally, the software carries the standard risks of any NLP architecture reliant on machine learning, namely linguistic biases inherited from the unsupervised pretraining of the incorporated language model and annotation biases derived from the supervised training over human-labeled data. Konstantinos Kogkalidis, Michael Moortgat, and Richard Moot. 2020a. AETHEL: Automatically ex- In Pro- tracted typelogical derivations for Dutch. ceedings of the 12th Language Resources and Eval- uation Conference, pages 5257–5266, Marseille, France. European Language Resources Association. and Konstantinos Kogkalidis, Michael Moortgat, In Pro- Richard Moot. 2020b. Neural proof nets. ceedings of the 24th Conference on Computational Natural Language Learning, pages 26–40, Online. Association for Computational Linguistics. François Lamarche. 2008. Proof nets for intuitionistic linear logic: Essential nets. Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. 2018. Learning latent permutations In International with gumbel-sinkhorn networks. Conference on Learning Representations. Michael Moortgat. 1997. Categorial type logics. In Handbook of logic and language, pages 93–177. El- sevier. Gabriel Peyré, Marco Cuturi, et al. 2019. Computa- tional optimal transport: With applications to data Foundations and Trends® in Machine science. Learning, 11(5-6):355–607. Jakob Prange, Nathan Schneider, and Vivek Srikumar. 2021. Supertagging the long tail with tree-structured decoding of complex categories. Transactions of the Association for Computational Linguistics, 9:243– 260. Mehrnoosh Sadrzadeh and Reinhard Muskens. 2018. Static and dynamic vector semantics for lambda cal- culus models of natural language. J. Lang. Model., 6(2):319–351. Richard Sinkhorn and Paul Knopp. 1967. Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics, 21(2):343–348. Acknowledgements This software described was developed with funds from the Dutch Research Council (NWO, grant nr. 360-89-070). References Samson Abramsky. 1993. Computational interpreta- tions of linear logic. Theoretical computer science, 111(1-2):3–57. Lasha Abzianidze. 2017. LangPro: Natural language In Proceedings of the 2017 Con- theorem prover. ference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 115– 120, Copenhagen, Denmark. Association for Com- putational Linguistics. Stephen Clark. 2021. Something old, something new: Grammar-based CCG parsing with transformer mod- els. CoRR, abs/2109.10044. Haskell B Curry. 1961. Some logical aspects of gram- Structure of language and its matical structure. mathematical aspects, 12:56–68. Vincent Danos and Laurent Regnier. 1989. The struc- ture of multiplicatives. Archive for Mathematical logic, 28(3):181–203. Caroline De Pourtales, Julien Rabault, Konstantinos Kogkalidis, and Richard Moot. 2023. DeepGrail: Neural proof nets for French. Technical report, LIRMM. Forthcoming. Matthias Fey and Jan Eric Lenssen. 2019. Fast graph representation learning with pytorch geomet- ric. arXiv preprint arXiv:1903.02428. Jean-Yves Girard. 1987. Linear logic. Theoretical computer science, 50(1):1–101. Roy Jonker and Anton Volgenant. 1987. A shortest augmenting path algorithm for dense and sparse lin- ear assignment problems. Computing, 38(4):325– 340. Konstantinos Kogkalidis and Michael Moortgat. 2022. Geometry-aware supertagging with heterogeneous dynamic convolutions. Konstantinos Kogkalidis, Michael Moortgat, and Te- jaswini Deoskar. 2019. Constructive type-logical su- pertagging with self-attention networks. In Proceed- ings of the 4th Workshop on Representation Learn- ing for NLP (RepL4NLP-2019), pages 113–123, Flo- rence, Italy. Association for Computational Linguis- tics.
http://arxiv.org/abs/2302.12047v1
2023-02-23T14:19:07
2023-02-23T14:19:07
Domain Generalisation via Domain Adaptation: An Adversarial Fourier Amplitude Approach
We tackle the domain generalisation (DG) problem by posing it as a domain adaptation (DA) task where we adversarially synthesise the worst-case target domain and adapt a model to that worst-case domain, thereby improving the model's robustness. To synthesise data that is challenging yet semantics-preserving, we generate Fourier amplitude images and combine them with source domain phase images, exploiting the widely believed conjecture from signal processing that amplitude spectra mainly determines image style, while phase data mainly captures image semantics. To synthesise a worst-case domain for adaptation, we train the classifier and the amplitude generator adversarially. Specifically, we exploit the maximum classifier discrepancy (MCD) principle from DA that relates the target domain performance to the discrepancy of classifiers in the model hypothesis space. By Bayesian hypothesis modeling, we express the model hypothesis space effectively as a posterior distribution over classifiers given the source domains, making adversarial MCD minimisation feasible. On the DomainBed benchmark including the large-scale DomainNet dataset, the proposed approach yields significantly improved domain generalisation performance over the state-of-the-art.
[ "Minyoung Kim", "Da Li", "Timothy Hospedales" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12047v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12047v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CV" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 7 4 0 2 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 DOMAIN GENERALISATION VIA DOMAIN ADAPTA- TION: AN ADVERSARIAL FOURIER AMPLITUDE AP- PROACH Minyoung Kim1, Da Li1 & Timothy M. Hospedales1,2 1Samsung AI Center Cambridge, UK {mikim21,dali.academic}@gmail.com 2University of Edinburgh, UK [email protected] ABSTRACT We tackle the domain generalisation (DG) problem by posing it as a domain adap- tation (DA) task where we adversarially synthesise the worst-case 'target' domain and adapt a model to that worst-case domain, thereby improving the model's robust- ness. To synthesise data that is challenging yet semantics-preserving, we generate Fourier amplitude images and combine them with source domain phase images, exploiting the widely believed conjecture from signal processing that amplitude spectra mainly determines image style, while phase data mainly captures image semantics. To synthesise a worst-case domain for adaptation, we train the classifier and the amplitude generator adversarially. Specifically, we exploit the maximum classifier discrepancy (MCD) principle from DA that relates the target domain performance to the discrepancy of classifiers in the model hypothesis space. By Bayesian hypothesis modeling, we express the model hypothesis space effectively as a posterior distribution over classifiers given the source domains, making ad- versarial MCD minimisation feasible. On the DomainBed benchmark including the large-scale DomainNet dataset, the proposed approach yields significantly improved domain generalisation performance over the state-of-the-art. 1 INTRODUCTION Contemporary machine learning models perform well when training and testing data are identically distributed. However, in practice it is often impossible to obtain an unbiased sample of real-world data for training, and therefore distribution-shift inevitably exists between training and deployment. Performance can degrade dramatically under such domain shift (Koh et al., 2021), and this is often the cause of poor performance of real-world deployments (Geirhos et al., 2020). This important issue has motivated a large amount of research into the topic of domain generalisation (DG) (Zhou et al., 2021a), which addresses training models with increased robustness to distribution shift. These DG approaches span a diverse set of strategies including architectural innovations (Chattopadhyay et al., 2020), novel regularisation (Balaji et al., 2018), alignment (Sun & Saenko, 2016) and learning (Li et al., 2019) objectives, and data augmentation (Zhou et al., 2021b) to make available training data more representative of potential testing data. However, the problem remains essentially unsolved, especially as measured by recent carefully designed benchmarks (Gulrajani & Lopez-Paz, 2021). Our approach is related to existing lines of work on data-augmentation solutions to DG (Zhou et al., 2021b; Shankar et al., 2018), which synthesise more data for model training; and alignment-based approaches to Domain Adaptation (Sun & Saenko, 2016; Saito et al., 2018) that adapt a source model to an unlabeled target set – but cannot address the DG problem where the target set is unavailable. We improve on both by providing a unified framework for stronger data synthesis and domain alignment. Our framework combines two key innovations: A Bayesian approach to maximum classifier dis- crepancy, and a Fourier analysis approach to data augmentation. We start from the perspective of maximum classifier discrepancy (MCD) from domain adaptation (Ben-David et al., 2007; 2010; Saito et al., 2018). This bounds the target-domain error as a function of discrepancy between multiple source-domain classifiers. It is not obvious how to apply MCD to the DG problem where we have no access to target-domain data. A key insight is that MCD provides a principled objective that we 1 Published as a conference paper at ICLR 2023 Figure 1: Overall training flow of the proposed approach (AGFA). We generate target-domain data by synthesizing Fourier amplitude images trained adversarially. See main text in Sec. 3 for details. can maximise in order to synthesise a worst-case target domain, and also minimise in order to train a model that is adapted to that worst-case domain. Specifically, we take a Bayesian approach that learns a distribution over source-domain classifiers, with which we can compute MCD. This simplifies the model by eliminating the need for adversarial classifier training in previous applications of MCD (Saito et al., 2018), which leaves us free to adversarially train the worst-case target domain. To enable challenging worst-case augmentations to be generated without the risk of altering image semantics, our augmentation strategy operates in the Fourier amplitude domain. It synthesises amplitude images, which can be combined with phase images from source-domain data to produce images that are substantially different in style (amplitude), while retaining the original semantics (phase). Our overall strategy termed Adversarial Generation of Fourier Amplitude (AGFA) is illustrated in Fig. 1. In summary, we make the following main contributions: (1) We provide a novel and principled perspective on DG by drawing upon the MCD principle from DA. (2) We provide AGFA, an effective algorithm for DG based on variational Bayesian learning of the classifier and Fourier-based synthesis of the worst-case domain for robust learning. (3) Our empirical results show clear improvement on previous state-of-the-arts on the rigorous DomainBed benchmark. 2 PROBLEM SETUP AND BACKGROUND We follow the standard setup for the Domain Generalisation (DG) problem. As training data, we are given labeled data S = {(x, y)|(x, y) ∼ Di, i = 1, . . . , N } where x ∈ X and y ∈ Y = {1, . . . , C}. Although the source domain S consists of different domains {Di}N i=1 with domain labels available, we simply take their union without using the originating domain labels. This is because in practice the number of domains (N ) is typically small, and it is rarely possible to estimate a meaningful population distribution for empirical S from a few different domains. What distinguishes DG from the closely-related (unsupervised) Domain Adaptation (DA), is that the target domain (T ) on which model's prediction performance is measured is unknown for DG, whereas in DA the input data x from the target domain are revealed (without class labels y). Below we briefly summarise the MCD principle and Ben-David's theorem, one of the key theorems in DA, as we exploit them to tackle DG. Ben-David's theorem and MCD principle in DA. In unsupervised DA, Ben-David's theo- rem (Ben-David et al., 2010; 2007) provides an upper bound for the target-domain generalisation error of a model (hypothesis). We focus on the tighter bound version, which states that for any classifier h in the hypothesis space H = {h|h : X → Y}, the following holds (without the sampling error term): eT (h) ≤ eS(h) + sup h,h(cid:48)∈H (cid:12) (cid:12)dS(h, h(cid:48)) − dT (h, h(cid:48))(cid:12) (cid:12) + e∗(H; S, T ), (1) where eS(h) := E(x,y)∼S[I(h(x) (cid:54)= y)] is the error rate of h(*) on the source domain S, dS(h, h(cid:48)) := Ex∼S[I(h(x) (cid:54)= h(cid:48)(x))] denotes the discrepancy between two classifiers h and h(cid:48) on S (similarly for eT (h) and dT (h, h(cid:48))), and e∗(H; S, T ) := minh∈H eS(h) + eT (h). Thus we can provably reduce the target domain generalisation error by simultaneously minimizing the three terms in the upper bound1, namely source-domain error eS(h), classifier discrepancy, and minimal source-target error. 1Some recent work such as (Vedantam et al., 2021), however, empirically studied potential risk of looseness of the bound in certain scenarios. 2 Published as a conference paper at ICLR 2023 Previous approaches (Saito et al., 2018; Kim et al., 2019) aim to minimise the upper bound, and one reasonable strategy is to constrain the hypothesis space H in such a way that it contains only those h's with small eS(h). Within this source-confined hypothesis space (denoted by H|S), the terms eS(h) and dS(h, h(cid:48)) in the bound are expected to be close to 0 for all h, h(cid:48) ∈ H|S, and the bound of (1) effectively reduces to what is called the Maximum Classifier Discrepancy (MCD) loss, MCD(H|S; T ) := sup h,h(cid:48)∈H|S |dT (h.h(cid:48))| = sup h,h(cid:48)∈H|S Ex∼T (cid:2)I(h(x) (cid:54)= h(cid:48)(x))(cid:3). (2) This suggests the MCD learning principle: we need to minimise both the error on S (so as to form the source-confined hypothesis space H|S) and the MCD loss on T . Note however that the last term e∗ is not considered in (Saito et al., 2018; Kim et al., 2019) mainly due to the difficulty of estimating the target domain error. We will incorporate e∗ in our DG algorithm as described in the next section. We conclude the section by briefly reviewing how the MCD learning principle was exploited in previous works. In (Saito et al., 2018) they explicitly introduce two classifier networks h(x) = g(φ(x)) and h(cid:48)(x) = g(cid:48)(φ(x)), where the classification heads g, g(cid:48) and the feature extractor φ are cooperatively updated to minimise the error on S (thus implicitly obtaining H|S), they are updated adversarially to maximise (minimise) the MCD loss on T with respect to g and g(cid:48) (φ, respectively). In (Kim et al., 2019), they build a Gaussian process (GP) classifier on the feature space φ(x), in which H|S is attained by GP posterior inference. Minimisation of the MCD term is then accomplished by the maximum margin learning which essentially enforces minimal overlap between the two largest posterior modes. Note that (Saito et al., 2018)'s strategy requires adversarial optimisation, and hence it is less suitable for our DG algorithm which will require adversarial generator learning: Having two adversarial learning components would make the training difficult since we need to find two nested equilibrium (saddle) points. We instead adopt the Bayesian hypothesis modeling approach of (Kim et al., 2019). In the next section, we describe our approach in greater detail. 3 ADVERSARIAL GENERATION OF FOURIER AMPLITUDE (AGFA) Defining and optimising a hypothesis space. Our DG approach aims to minimise the MCD loss, MCD(H|S; T ) defined in (2). The first challenge is that the target domain data T is not available in DG. Before we address it, we clarify the optimisation problem (i.e., what is the MCD loss optimised for?) and how the hypothesis spaces (H and H|S) are represented. The MCD loss is a function of hypothesis space H (or H|S), not a function of individual classifier h in it. Hence, minimising the MCD loss amounts to choosing the best hypothesis space H. To this end, we need to parametrise the hypothesis space (so as to frame it as a continuous optimisation), and our choice is the Bayesian linear classifier with deterministic feature extractor. We consider the conventional neural-network feed-forward classifier modeling: we have the feature extractor network φθ(x) ∈ Rd (with the weight parameters θ) followed by the linear classification head W = [w1, . . . , wC] (C-way classification, each wj ∈ Rd), where the class prediction is done by the softmax likelihood: P (y = j|x, θ, W ) ∝ ew(cid:62) j φθ(x), j = 1, . . . , C. (3) So each configuration (θ, W ) specifies a particular classifier h. To parametrise the hypothesis space H ((cid:51) h), ideally we can consider a parametric family of distributions over (θ, W ). Each distribution Pβ(θ, W ) specified by the parameter β corresponds to a particular hypothesis space H, and each sample (θ, W ) ∼ Pβ(θ, W ) corresponds to a particular classifier h ∈ H. Although this is conceptually simple, to have a tractable model in practice, we define θ to be deterministic parameters and only W to be stochastic. A reasonable choice for P (W ), without any prior knowledge, is the standard Gaussian, P (W ) = (cid:81)C j=1 N (wj; 0, I). Now, we can represent a hypothesis space as H = {P (y|x, θ, W ) | W ∼ P (W )}. Thus H is parametrised by θ, and with θ fixed (H fixed), each sample W from P (W ) instantiates a classifier h ∈ H. The main benefit of this Bayesian hypothesis space modeling is that we can induce the source-confined hypothesis space H|S (i.e., the set of classifiers that perform well on the source domain) in a principled manner by the posterior, P (W |S, θ) ∝ P (W ) * (cid:89) (x,y)∼S P (y|x, θ, W ). (4) 3 Published as a conference paper at ICLR 2023 The posterior places most of its probability density on those samples (classifiers) W that attain high likelihood scores on S (under given θ) while being smooth due to the prior. To ensure that the source domain S is indeed explained well by the model, we further impose high data likelihood on S as constraints for θ, θ ∈ ΘS where ΘS := {θ | log P (S|θ) ≥ Lth}, (5) where Lth is the (constant) threshold that guarantees sufficient fidelity of the model to explaining S. Then it is reasonable to represent H|S by the support of P (W |S, θ) for θ ∈ ΘS, postulating that H|S exclusively contains smooth classifiers h that perform well on S. Formally, the source-confined hypothesis space can be parametrised as: H|S(θ) = {P (y|x, θ, W ) | W ∼ P (W |S, θ)} for θ ∈ ΘS, (6) where we use the notation H|S(θ) to emphasise its dependency on θ. Intuitively, the hypothesis space H|S is identified by choosing the feature space (i.e., choosing θ ∈ ΘS), and individual classifiers h ∈ H|S are realised by the Bayesian posterior samples W ∼ P (W |S, θ) (inferred on the chosen feature space). Since the posterior P (W |S, θ) in (6) and the marginal likelihood log P (S|θ) in (5) do not admit closed forms in general, we adopt the variational inference technique to approximate them. We defer the detailed derivations (Sec. 3.1) for now, and return to the MCD minimisation problem since we have defined the hypothesis space representation. Optimising a worst-case target domain. For the DG problem, we cannot directly apply the MCD learning principle since the target domain T is unknown during the training stage. Our key idea is to consider the worst-case scenario where the target domain T maximises the MCD loss. This naturally forms minimax-type optimisation, min θ∈ΘS max T MCD(H|S(θ); T ). (7) To solve the saddle-point optimisation (7), we adopt the adversarial learning strategy with a generator network (Goodfellow et al., 2014). The generator for T has to synthesise samples x of T that need to satisfy three conditions: (C1) The generated samples maximally baffle the classifiers in H|S to have least consensus in prediction (for inner maximisation); (C2) T still retains the same semantic class information as the source domain S (for the definition of DG); and (C3) The generated samples in T need to be distinguishable along their classes2. Paramaterising domains. To meet these conditions, we generate target domain images using Fourier frequency spectra. We specifically build a generator network that synthesises amplitude images in the Fourier frequency domain. The synthesised amplitude images are then combined with the phase images sampled from the source domain S to construct new samples x ∈ T by inverse Fourier transform. This is motivated by signal processing where it is widely believed that the frequency phase spectra capture the semantic information of signals, while the amplitudes take charge of non-semantic (e.g., style) aspects of the signals (Oppenheim & Lim, 1981). Denoting the amplitude generator network as Gν((cid:15)) with parameters ν and random noise input (cid:15) ∼ N (0, I), our target sampler (x, y) ∼ T are generated as follows: 1. (xS, yS) ∼ S 2. AS∠PS = F(xS) 3. A = Gν((cid:15)), (cid:15) ∼ N (0, I) 4. x = F −1(A∠PS), y = yS (Sample an image and its class label from S) (Fourier transform to have amplitude and phase for xS) (Generate an amplitude image from G) (Construct target data with the synthesised A) Here, F(*) is the 2D Fourier transform, F (u, v) = F(x) = (cid:82)(cid:82) x(h, w)e−i(hu+wv)dhdw, and A∠P stands for the polar representation of the Fourier frequency responses (complex numbers) for the amplitude image A and the phase image P . That is, A∠P = A * ei*P = A * (cos P + i sin P ) with i = −1, where all operations are element/pixel-wise. Note that we set y = yS in step 4 since the original phase (semantic) information PS is retained in the synthesised x. √ 2This condition naturally originates from the solvability of the DG problem. 4 Published as a conference paper at ICLR 2023 Algorithm summary. Finally the worst-case target MCD learning can be solved by adversarial learning, which can be implemented as an alternating optimisation: (Fix ν) min θ∈ΘS (Fix θ) max ν MCD(H|S(θ); T (ν)) MCD(H|S(θ); T (ν)) (8) (9) We used T (ν) to emphasise functional dependency of target images on the generator parameters ν. Note that although the MCD loss in DA can be computed without the target domain labels (recall the definition (2)), in our DG case the class labels for the generated target data are available, as induced from the phase PS (i.e., y = yS in step 4). Thus we can modify the MCD loss by incorporating the target class labels. In the following we provide concrete derivations using the variational posterior inference, and propose a modified MCD loss that takes into account the induced target class labels. 3.1 CONCRETE DERIVATIONS USING VARIATIONAL INFERENCE Source-confined hypothesis space by variational inference. The posterior P (W |S, θ) does not admit a closed form, and we approximate P (W |S, θ) by the Gaussian variational density, Qλ(W ) = C (cid:89) j=1 N (wj; mj, Vj), (10) where λ := {mj, Vj}C we optimise the evidence lower bound (ELBO), j=1 constitutes the variational parameters. To enforce Qλ(W ) ≈ P (W |S, θ), ELBO(λ, θ; S) := (cid:88) (x,y)∼S EQλ(W ) (cid:2) log P (y|x, W, θ)(cid:3) − KL(cid:0)Qλ(W )||P (W )(cid:1), (11) which is the lower bound of the marginal data likelihood log P (S|θ) (Appendix A.3 for derivations). Hence maximising ELBO(λ, θ; S) with respect to λ tightens the posterior approximation Qλ(W ) ≈ P (W |S, θ), while maximising it with respect to θ leads to high data likelihood log P (S|θ). The latter has the very effect of imposing the constraints θ ∈ ΘS in (8) since one can transform constrained optimisation into a regularised (Lagrangian) form equivalently (Boyd & Vandenberghe, 2004). Optimising the MCD loss. The next thing is to minimise the MCD loss, MCD(H|S(θ); T ) with the current target domain T generated by the generator network Gν. That is, solving (8). We follow the maximum margin learning strategy from (Kim et al., 2019), where the idea is to enforce the prediction consistency for different classifiers (i.e., posterior samples) W ∼ Qλ(W ) on x ∼ T by separating the highest class score from the second highest by large margin. To understand the idea, let j∗ be the model's predicted class label for x ∼ T , or equivalently let j∗ have the highest class score j∗ = arg maxj w(cid:62) j φ(x) as per (3). (We drop the subscript in φθ(x) for simplicity in notation.) We let j† be the second most probable class, i.e., j† = arg maxj(cid:54)=j∗ w(cid:62) j φ(x). Our model's class prediction would change if w(cid:62) j†φ(x) for some W ∼ Qλ(W ), which leads to discrepancy of classifiers. To avoid such overtaking, we need to ensure that the (plausible) minimal value of w(cid:62) j†φ(x). Since the score (logit) fj(x) := w(cid:62) j∗ φ(x) is greater than the (plausible) maximal value of w(cid:62) j φ(x) is Gaussian under Qλ(W ), namely j∗ φ(x) < w(cid:62) fj(x) ∼ N (μj(x), σj(x)2) where μj(x) = m(cid:62) j φ(x), σ2 j (x) = φ(x)(cid:62)Vjφ(x), (12) the prediction consistency is achieved by enforcing: μj∗ (x) − ασj∗ (x) > μj†(x) + ασj†(x), where we can choose α = 1.96 for 2.5% rare one-sided chance. By introducing slack variables ξ(x) ≥ 0, μj∗ (x) − ασj∗ (x) ≥ 1 + max j(cid:54)=j∗ (cid:0)μj(x) + ασj(x)(cid:1) − ξ(x). (13) Satisfying the constraints amounts to fulfilling the desideratum of MCD minimisation, essentially imposing prediction consistency of classifiers. Note that we add the constant 1 in the right hand side of (13) for the normalisation purpose to prevent the scale of μ and σ from being arbitrary small. The constraints in (13) can be translated into the following MCD loss (as a function of θ): 1 + T 2(cid:0)μj(x) + ασj(x)(cid:1) − T 1(cid:0)μj(x) − ασj(x)(cid:1)(cid:17) MCD(θ; T ) := Ex∼T (14) (cid:16) + 5 Published as a conference paper at ICLR 2023 Figure 2: Illustration of the SMCD loss on three different hypothesis spaces H|S shown in three panels. For C = 3-way classification case, each panel shows the class logit scores (Gaussian random) fj(x) ∼ N (μj(x), σj(x)2) for j = 1, 2, 3, at some input x ∈ T . We assume that the true (induced) class label y = 2. (Left) Since the mean logit for class 2, μ2(x) is the maximum among others, the prediction is marginally correct (from softmax). Beyond that, the logit of the worst plausible hypothesis for class 2, μ2(x) − 1.96σ2(x) is greater than that of the runner-up class 1, μ1(x) + 1.96σ1(x) by some positive margin (green arrow), meaning there is little chance of prediction overtaking (so, consistent); equivalently, the SMCD loss is small. (Middle) Prediction is marginally correct, but prediction overtaking is plausible, indicated by the negative margin (red arrow); the SMCD loss is large. (Right) Incorrect marginal prediction (to class 1) with more severe negative margin (red arrow); the SMCD loss is even larger. where T k is the operator that selects the top-k element, and (a)+ = max(0, a). Modified MCD loss. The above MCD loss does not utilise the target domain class labels y = yS that are induced from the phase information PS (Recall the target domain data generation steps 1 ∼ 4 above). To incorporate the supervised data {(x, y)} ∈ T in the generated target domain, we modify the MCD loss as follows: First, instead of separating the margin between the two largest logit scores as in the MCD, we maximise the margin between the logit for the given class y and the largest logit among the classes other than y. That is, we replace the constraints (13) with the following: μy(x) − ασy(x) ≥ 1 + max j(cid:54)=y (cid:0)μj(x) + ασj(x)(cid:1) − ξ(x), (15) where y is the class label (induced from the phase information) for the generated instance x. See Fig. 2 for illustration of the idea. Consequently, our new MCD loss (coined supervised MCD or SMCD for short) is defined as follows: SMCD(θ; T ) := E(x,y)∼T (cid:16) 1 + max j(cid:54)=y (cid:0)μj(x) + ασj(x)(cid:1) − (cid:0)μy(x) − ασy(x)(cid:1)(cid:17) . + (16) Here the variational parameters λ is treated as constant since the only role of λ is to maximise the ELBO. It should be noted that (16) essentially aims at maximising the logit for the given class y (the last term), or equivalently, classification error minimisation on T , and at the same time minimising the logit for the runner-up class (the middle max term). Surprisingly, the former amounts to minimising the minimal source-target error term e∗(H; S, T ) in the generalisation bound (1), which we have left out so far. That is, e∗(H; S, T ) = minh∈H eS(h) + eT (h) ≈ minh∈H|S eT (h), and the last term of the SMCD loss leads to θ that makes eT (h) small for all h ∈ H|S(θ). Moreover, minimising the logit for the runner-up class (the middle max term of the SMCD) has the effect of margin maximisation. Algorithm summary. Our AGFA algorithm can be understood as MCD-based DA with adversarial amplitude generated target domain. It entails the following alternating optimisation (η > 0 is the trade-off hyperparameter for SMCD): 1. minλ,θ −ELBO(λ, θ; S) + ηSMCD(θ; T ) 2. maxν SMCD(θ; T ) (model learning + VI; ν fixed) (adversarial generator learning; θ, λ fixed) Our algorithm is summarised in Alg. 1 (in Appendix) and illustrated schematically in Fig. 1. At test time, we can apply the classifier (3) with the learned θ and any sample W ∼ Qλ(W ) to target domain inputs to predict class labels. In our experiments, we take the posterior means wj = mj instead of sampling from Qλ(W ). 3.2 FURTHER CONSIDERATIONS Post-synthesis mixup of generated amplitude images. In our adversarial learning, the ampli- tude generator network Gν synthesises target domain image samples that have highly challenging 6 Published as a conference paper at ICLR 2023 amplitude spectra to the current model. Although we retain the phase information from source domains, unconstrained amplitude images can potentially alter the semantic content destructively (e.g., a constant zero amplitude image would zero out the image content), rendering it impossible to classify. To this end, instead of using the generator's output A = Gν((cid:15)) directly, we combine it with the source domain amplitude image corresponding to the phase image by simple mixup. That is, by letting AS be the amplitude spectra corresponding to the phase PS, we alter A as: A ← λA + (1 − λ)AS where λ ∼ Uniform(0, α). (17) This post-synthesis mixup can address our desideratum C3 that we discussed before, that is, the generated samples for the target domain need to be distinguishable by class to solve the DG problem. Post-synthesis mixup, ensures synthesised amplitude images lie closer to the amplitude manifold of the source data, ensuring the model can solve the classification problem. Dense model averaging (SWAD). We found that the DG training becomes more stable and the target-domain test performance becomes more consistent when we use the dense model averaging strategy SWAD (Cha et al., 2021). We adopt the SWAD model averaging for the variational and model parameters (λ, θ) while the generator network is not averaged. Amplitude image structures. From the definition of the Fourier transform, the frequency domain function should be even-conjugate, i.e., F (−u, −v) = F (u, v), for the real-valued images. This implies that amplitude images are symmetric. Conversely, if the amplitude images are symmetric, inverse Fourier transform returns real-valued signals. Thus when generating amplitude images, we only generate the non-redundant part (frequencies) of the amplitude images. Also, the amplitude should be non-negative. We keep these constraints in mind when designing the generator network. 4 RELATED WORK MCD. Several studies have used the MCD principle for domain adaptation, to align a source model to unlabeled target data (Saito et al., 2018; Kim et al., 2019; Lu et al., 2020). We uniquely exploit the MCD principle for the DG problem, in the absence of target data, by using MCD to synthesise worst-case target domain data, as well as to adapt the model to that synthesised domain. Augmentation approaches to DG. Several DG approaches have been proposed based on data augmentation. Existing approaches either define augmentation heuristics (Zhou et al., 2021b; Xu et al., 2021), or exploit domain adversarial learning – i.e., confusing a domain classifier (Shankar et al., 2018; Zhou et al., 2020). Our adversarial learning is based on the much stronger (S)MCD principle that confuses a category classifier. This provides much harder examples for robust learning, while our Fourier amplitude synthesis ensures the examples are actually recognisable. Alignment approaches to DG. Several approaches to DG are based on aligning between multiple source domains (Sun & Saenko, 2016; Ganin et al., 2016; Li et al., 2018c;b), under the assumption that a common feature across all source domains will be good for a held out target domain. Differently, we use the MCD principle to robustify our source trained model by aligning it with the synthesised worst-case target domain. 5 EXPERIMENTS We test our approach on the DomainBed benchmark (Gulrajani & Lopez-Paz, 2021), including: PACS (Li et al., 2017), VLCS (Fang et al., 2013), OfficeHome (Venkateswara et al., 2017), Ter- raIncognita (Beery et al., 2018), and DomainNet (Peng et al., 2019). For each dataset, we adopt the standard leave-one-domain-out source/target domain splits. The overall training/test protocols are similar to (Gulrajani & Lopez-Paz, 2021; Cha et al., 2021). We use the ResNet-50 (He et al., 2016) as our feature extractor backbone, which is initialised by the pretrained weights on ImageNet (Deng et al., 2009). For the generator network, we found that a linear model performed the best for the noise dimension 100. Our model is trained by the Adam optimiser (Kingma & Ba, 2015) on machines with single Tesla V100 GPUs. The hyperparameters introduced in our model (e.g., SMCD trade-off η) and the general ones (e.g., learning rate, SWAD regime hyperparameters, maximum numbers of iterations) are chosen by grid search on the validation set according to the DomainBed protocol (Gulrajani & Lopez-Paz, 2021). For instance, η = 0.1 for all datasets. The implementation details including chosen hyperparameters can be found in Appendix A.1. 7 Published as a conference paper at ICLR 2023 Table 1: Average accuracies on DomainBed datasets. Note: † indicates that the results are excerpted from the published papers or (Gulrajani & Lopez-Paz, 2021). Our own runs are reported without †. Note that FACT (Xu et al., 2021) adopted a slightly different data/domain split protocol from DomainBed's, explaining discrepancy on PACS. Algorithm PACS VLCS OfficeHome TerraInc. DomainNet Avg. ERM (Cha et al., 2021)† IRM (Arjovsky et al., 2019)† GroupDRO (Sagawa et al., 2020)† I-Mixup (Xu et al., 2020; Yan et al., 2020; Wang et al., 2020b)† MLDG (Li et al., 2018a)† CORAL (Sun & Saenko, 2016)† MMD (Li et al., 2018b)† DANN (Ganin et al., 2016)† CDANN (Li et al., 2018c)† MTL (Blanchard et al., 2021)† SagNet (Nam et al., 2021)† ARM (Zhang et al., 2020)† VREx (Krueger et al., 2020)† RSC (Huang et al., 2020)† Mixstyle (Zhou et al., 2021b)† FACT (Xu et al., 2021)† FACT (Xu et al., 2021) Amp-Mixup (Xu et al., 2021) SWAD (Cha et al., 2021)† FACT+SWAD Amp-Mixup+SWAD (Proposed) AGFA 84.2 83.5 84.4 84.6 84.9 86.2 84.7 83.7 82.6 84.6 86.3 85.1 84.9 85.2 85.2 88.2 86.4 84.7 88.1 88.1 88.1 89.3 77.3 78.6 76.7 77.4 77.2 78.8 77.5 78.6 77.5 77.2 77.8 77.6 78.3 77.1 77.9 − 76.6 75.9 79.1 77.7 78.2 79.5 67.6 64.3 66.0 68.1 66.8 68.7 66.4 65.9 65.7 66.4 68.1 64.8 66.4 65.5 60.4 66.6 66.6 64.0 70.6 70.6 70.3 71.5 47.8 47.6 43.2 47.9 47.8 47.7 42.2 46.7 45.8 45.6 48.6 45.5 46.4 46.6 44.0 − 45.4 46.8 50.0 51.0 51.2 52.4 44.0 33.9 33.3 39.2 41.2 41.5 23.4 38.3 38.3 40.6 40.3 35.5 33.6 38.9 34.0 − 42.6 42.0 46.5 46.7 46.4 47.1 64.2 61.6 60.7 63.4 63.6 64.5 58.8 62.6 62.0 62.9 64.2 61.7 61.9 62.7 60.3 − 63.5 62.7 66.9 66.8 66.8 68.0 5.1 MAIN RESULTS The test accuracies averaged over target domains are summarised in Table 1, where the results for individual target domains are reported in Appendix A.2. The proposed approach performs the best for all datasets among the competitors, and the difference from the second best model (SWAD) is significant (about 1.1% margin). We particularly contrast with two recent approaches: SWAD (Cha et al., 2021) that adopts the dense model averaging with the simple ERM loss and FACT (Xu et al., 2021) that uses the Fourier amplitude mixup as means of data augmentation with additional student-teacher regularisation. First, SWAD (Cha et al., 2021) is the second best model in Table 1, implying that the simple ERM loss combined with the dense model averaging that seeks for flat minima is quite effective, also observed previously (Gulrajani & Lopez-Paz, 2021). FACT (Xu et al., 2021) utilises the Fourier amplitude spectra similar to our approach, but their main focus is data augmentation, producing more training images by amplitude mixup of source domain images. FACT also adopted the so-called teacher co-regularisation which forces the orders of the class prediction logits to be consistent between teacher and student models on the amplitude-mixup data. To disentangle the impact of these two components in FACT, we ran a model called Amp-Mixup that is simply FACT without teacher co-regularisation. The teacher co-regularisation yields further improvement in the average accuracy (FACT > Amp-Mixup in the last column of Table 1), verifying the claim in (Xu et al., 2021), although FACT is slightly worse than Amp-Mixup on VLCS and TerraIncognita. We also modified FACT and Amp-Mixup models by incorporating the SWAD model averaging (FACT+SWAD and Amp-Mixup+SWAD in the table). Clearly they perform even better in combi- nation with SWAD. Since Amp-Mixup+SWAD can be seen as dropping the teacher regularisation and adopting the SWAD (regularisation) strategy instead, we can say that SWAD is more effective regularisation than student-teacher. Nevertheless, despite the utilisation of amplitude-mixup augmen- tation, it appears that FACT and Amp-Mixup have little improvement over the ERM loss even when the SWAD strategy is used. This signifies the effect of the adversarial Fourier-based target domain generation in our approach which exhibits significant improvement over ERM and SWAD. 5.2 FURTHER ANALYSIS Sensitivity to η (SMCD strength). We analyze sensitivity of the target domain generalisation performance to the SMCD trade-off hyperparameter η. We run our algorithm with different values of η. The results are shown in Fig. 3. Note that η = 0 ignores the SMCD loss term (thus generator has no influence on the model training), which corresponds to the ERM approach. The test accuracy of the proposed approach remains significantly better than ERM/SWAD for all those η with moderate variations around the best value. See Appendix A.2 for the results on individual target domains. 8 Published as a conference paper at ICLR 2023 Figure 3: Sensitivity to η (SMCD trade-off) on PACS and OfficeHome. Figure 4: Sensitivity to α (post-mixup strength) on PACS and OfficeHome. Table 2: Ablation study: 1) unsupervised MCD (instead of SMCD), 2) without post-mixup, 3) without SWAD, and 4) pixel-based target image generation (instead of amplitude generation). Unsupervised MCD Without post-mixup Without SWAD Pixel-based generation Art 88.94 ± 0.23 88.90 ± 0.16 84.20 ± 0.68 88.85 ± 0.15 Cartoon 83.83 ± 0.19 81.80 ± 0.17 81.56 ± 0.55 83.62 ± 0.26 Photo 97.27 ± 0.10 97.43 ± 0.14 94.83 ± 0.12 97.23 ± 0.15 Sketch 81.77 ± 0.36 80.86 ± 0.31 79.28 ± 0.94 82.10 ± 0.63 Average 87.95 87.25 84.97 87.95 (Proposed) AGFA 89.80 ± 0.34 85.16 ± 0.65 97.59 ± 0.27 84.67 ± 0.82 89.30 Sensitivity to α (post-synthesis mixup strength). We mix up the generated amplitude images and the source domain images as in (17) to make the adversarial target domain classification task solvable. The task becomes easier for small α (less impact of the generated amplitudes), and vice versa. Note that α = 0 ignores generated amplitude images completely in post-mixup, and the training becomes close to ERM learning where the only difference is that we utilise more basic augmentation (e.g., flip, rotation, color jittering). As shown in Fig. 4, the target test performance is not very sensitive around the best selected hyperparameters. See also ablation study results on the impact of post-mixup below. Impact of SMCD (vs. unsupervised MCD). We verify the positive effect of the proposed super- vised MCD loss (SMCD in (16)) that exploits the induced target domain class labels, compared to the conventional (unsupervised) MCD loss (14) without using the target class labels. The result in Table 2 supports our claim that exploiting target class labels induced from the phase information is quite effective, improving the target generalisation performance. Impact of post-synthesis mixup. We argued that our post-synthesis mixup of the generated ampli- tude images makes the class prediction task easier for the generated target domain, for the solvability of the DG problem. To verify this, we compare two models, with and without the post-mixup strategy in Table 2. The model trained with post-mixup performs better. Impact of SWAD. We adopted the SWAD model averaging scheme (Cha et al., 2021) for improving generalisation performance. We verify the impact of the SWAD as in Table 2 where the model without SWAD has lower target test accuracy signifying the importance of the SWAD model averaging. Impact of amplitude generation. The amplitude image generation in our adversarial MCD learn- ing allows us to separate the phase and amplitude images and exploit the class labels induced by the phase information. However, one may be curious about how the model would work if we instead generate full images without phase/amplitude separation in an adversarial way. That is, we adopt a pixel-based adversarial image generator, and in turn replace our SMCD by the conventional MCD loss (since there are no class labels inducible in this strategy). We consider two generator architectures: linear (from 100-dim input noise to full image pixels) and nonlinear (a fully connected network with one hidden layer of 100 units), where the former slightly performs better. Table 2 shows that this pixel-based target image generation underperforms our amplitude generation. 6 CONCLUSION We tried to address the domain generalisation problem from the perspective of maximum classifier discrepancy: Improving robustness by synthesising a worst-case target domain for learning, and training the model to be robust to that domain with the (S)MCD objective. To provide an approxima- 9 0.00.010.050.1*0.20.51.0 (impact of SMCD)88.088.288.488.688.889.089.2Target accuracy (%)PACSProposedSWAD0.00.010.050.1*0.150.20.25 (impact of SMCD)70.670.871.071.271.4Target accuracy (%)OfficeHomeProposedSWAD0.00.20.40.60.80.91.0* (strength of post-mixup)88.0088.2588.5088.7589.0089.25Target accuracy (%)PACSProposedSWAD0.00.10.2*0.30.40.60.81.0 (strength of post-mixup)70.670.871.071.271.4Target accuracy (%)OfficeHomeProposedSWAD Published as a conference paper at ICLR 2023 tion to style and content separation for synthesis, the worst-case domain is synthesised in Fourier amplitude space. Our results provide a clear improvement on the state-of-the-arts on the challenging DomainBed benchmark suite. REFERENCES Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019. Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. Metareg: Towards domain gen- eralization using meta-regularization. In Advances in Neural Information Processing Systems, 2018. Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. European Conference on Computer Vision, 2018. S. Ben-David, J. Blitzer, K. Crammer, A. Kulesza, F. Pereira, and J. W. Vaughan. A theory of learning from different domains. Machine Learning, 79(1–2):151–175, 2010. Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. In Advances in Neural Information Processing Systems, 2007. Gilles Blanchard, Aniket Anand Deshmukh, Urun Dogan, Gyemin Lee, and Clayton Scott. Domain generalization by marginal transfer learning. Journal of Machine Learning Research, 22(2):1–55, 2021. S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge: Cambridge University Press, 2004. Junbum Cha, Sanghyuk Chun, Kyungjae Lee, Han-Cheol Cho, Seunghyun Park, Yunsung Lee, and Sungrae Park. SWAD: Domain Generalization by Seeking Flat Minima. In Advances in Neural Information Processing Systems (NeurIPS), 2021. Prithvijit Chattopadhyay, Yogesh Balaji, and Judy Hoffman. Learning to balance specificity and invariance for in and out of domain generalization. European Conference on Computer Vision, 2020. Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In IEEE Conference on Computer Vision and Pattern Recognition, 2009. Qi Dou, Daniel C Castro, Konstantinos Kamnitsas, and Ben Glocker. Domain generalization via model-agnostic learning of semantic features. In Advances in Neural Information Processing Systems, 2019. Chen Fang, Ye Xu, and Daniel N. Rockmore. Unbiased metric learning: On the utilization of multiple datasets and web images for softening bias. International Conference on Computer Vision, 2013. Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 17(1):1–35, 2016. Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A Wichmann. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665–673, 2020. I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, 2014. Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. International Conference on Learning Representations, 2021. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2016. 10 Published as a conference paper at ICLR 2023 Zeyi Huang, Haohan Wang, Eric P. Xing, and Dong Huang. Self-challenging improves cross domain generalization. European Conference on Computer Vision, 2020. Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging weights leads to wider optima and better generalization. In Uncertainty in Artificial Intelligence, 2018. Minyoung Kim, Pritish Sahu, Behnam Gholami, and Vladimir Pavlovic. Unsupervised Visual Domain Adaptation: A Deep Max-Margin Gaussian Process Approach. Computer Vision and Pattern Recognition, 2019. Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, 2015. Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsub- ramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, Tony Lee, Etienne David, Ian Stavness, Wei Guo, Berton Earnshaw, Imran Haque, Sara M Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. Wilds: A bench- mark of in-the-wild distribution shifts. In ICML, volume 139 of Proceedings of Machine Learning Research, pp. 5637–5664. PMLR, 2021. David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (REx). arXiv preprint arXiv:2003.00688, 2020. Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M. Hospedales. Deeper, broader and artier domain generalization. International Conference on Computer Vision, 2017. Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy Hospedales. Learning to generalize: Meta learning for domain generalization. AAAI Conference on Artificial Intelligence, 2018a. Da Li, Jianshu Zhang, Yongxin Yang, Cong Liu, Yi-Zhe Song, and Timothy M. Hospedales. Episodic training for domain generalization. In ICCV, 2019. Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. IEEE Conference on Computer Vision and Pattern Recognition, 2018b. Ya Li, Mingming Gong, Xinmei Tian, Tongliang Liu, and Dacheng Tao. Domain generalization via conditional invariant representations. AAAI Conference on Artificial Intelligence, 2018c. Zhihe Lu, Yongxin Yang, Xiatian Zhu, Cong Liu, Yi-Zhe Song, and Tao Xiang. Stochastic classifiers for unsupervised domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9111–9120, 2020. Hyeonseob Nam, HyunJae Lee, Jongchan Park, Wonjun Yoon, and Donggeun Yoo. Reducing domain gap by reducing style bias. IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021. Oren Nuriel, Sagie Benaim, and Lior Wolf. Permuted AdaIN: Reducing the bias towards global statis- tics in image classification. IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021. Alan V Oppenheim and Jae S Lim. The importance of phase in signals. Proceedings of the IEEE, 69 (5):529–541, 1981. Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. International Conference on Computer Vision, 2019. Shiori Sagawa, Pang Wei Koh, Tatsunori B. Hashimoto, and Percy Liang. Distributionally robust neural networks. International Conference on Learning Representations, 2020. Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum classifier discrepancy for unsupervised domain adaptation. Computer Vision and Pattern Recognition, 2018. 11 Published as a conference paper at ICLR 2023 Seonguk Seo, Yumin Suh, Dongwan Kim, Jongwoo Han, and Bohyung Han. Learning to optimize domain specific normalization for domain generalization. European Conference on Computer Vision, 2020. Shiv Shankar, Vihari Piratla, Soumen Chakrabarti, Siddhartha Chaudhuri, Preethi Jyothi, and Sunita Sarawagi. Generalizing across domains via cross-gradient training. In ICLR, 2018. Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. European Conference on Computer Vision, 2016. Ramakrishna Vedantam, David Lopez-Paz, and David J. Schwab. An Empirical Investigation of Domain Generalization with Empirical Risk Minimizers. In Advances in Neural Information Processing Systems (NeurIPS), 2021. Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. Computer Vision and Pattern Recognition, 2017. Shujun Wang, Lequan Yu, Caizi Li, Chi-Wing Fu, and Pheng-Ann Heng. Learning from extrinsic and intrinsic supervisions for domain generalization. European Conference on Computer Vision, 2020a. Yufei Wang, Haoliang Li, and Alex C Kot. Heterogeneous domain generalization via domain mixup. IEEE International Conference on Acoustics, Speech and Signal Processing, 2020b. Minghao Xu, Jian Zhang, Bingbing Ni, Teng Li, Chengjie Wang, Qi Tian, and Wenjun Zhang. Adversarial domain adaptation with domain mixup. AAAI Conference on Artificial Intelligence, 2020. Qinwei Xu, Ruipeng Zhang, Ya Zhang, Yanfeng Wang, and Qi Tian. A Fourier-based Framework for Domain Generalization. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2021. Shen Yan, Huan Song, Nanxiang Li, Lincan Zou, and Liu Ren. Improve unsupervised domain adaptation with mixup training. arXiv preprint arXiv:2001.00677, 2020. Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. Mixup: Beyond Empirical Risk Minimization. International Conference on Learning Representations, 2018. Marvin Zhang, Henrik Marklund, Abhishek Gupta, Sergey Levine, and Chelsea Finn. Adaptive risk minimization: A meta-learning approach for tackling group shift. arXiv preprint arXiv:2007.02931, 2020. Yabin Zhang, Minghan Li, Ruihuang Li, Kui Jia, and Lei Zhang. Exact Feature Distribution Matching for Arbitrary Style Transfer and Domain Generalization. IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022. Shanshan Zhao, Mingming Gong, Tongliang Liu, Huan Fu, and Dacheng Tao. Domain generalization via entropy regularization. In Advances in Neural Information Processing Systems, 2020. Kaiyang Zhou, Yongxin Yang, Timothy Hospedales, and Tao Xiang. Deep domain-adversarial image generation for domain generalisation. In Proceedings of the AAAI Conference on Artificial Intelligence, 2020. Kaiyang Zhou, Ziwei Liu, Yu Qiao, Tao Xiang, and Chen Change Loy. Domain generalization: A survey. arXiv preprint arXiv:2103.02503, 2021a. Kaiyang Zhou, Yongxin Yang, Yu Qiao, and Tao Xiang. Domain generalization with mixstyle. International Conference on Learning Representations, 2021b. 12 Published as a conference paper at ICLR 2023 A APPENDIX The Appendix consists of the following contents: • Implementation Details (Sec. A.1) • Full Results (Sec. A.2) • Derivation of ELBO in Variational Inference (Sec. A.3) • Additional Experimental Results (Sec. A.4) A.1 IMPLEMENTATION DETAILS We adopt the ResNet50 (He et al., 2016) architecture (removing the final classification layer) as the feature extractor network. For the amplitude generator network, we have tested several fully- connected network architectures with different numbers of hidden layers and hidden units, and the simple linear network peformed the best. The input noise dimension for the generator is chosen as 100. The covariance matrices of the variational parameters are restricted to be diagonal. The number of MC samples from Qλ(W ) in the ELBO optimisation is chosen as 50. The optimisation hyperparameters are chosen by the same strategy as (Cha et al., 2021), where we employ the Adam optimiser (Kingma & Ba, 2015) with learning rate 5 × 10−5, and no dropout, weight decay used. The batch size was 32 (for each training domain) in ERM/SWAD (Cha et al., 2021), but we halved it in our model since the remaining half are constructed by the adversarial target generation. The standard basic data augmentation is also applied to the input images. Following the suggestion from (Cha et al., 2021), we run our model up to 5000 iterations for all datasets except for DomainNet. But the algorithm may stop earlier before the maximum iterations if SWAD termination condition is met (See Sec. A.1.1 below). Since DomainNet is a large-scale dataset, and it is required to have a even larger number of iterations to go through the entire data at least several times. In (Cha et al., 2021), they used 15000 iterations which roughly corresponds to 3 to 10 data epochs. In our model, since we halved the number of input images in the batch, in order to have the same training epochs as (Cha et al., 2021), we increase it up to 30000 iterations for DomainNet. The details of the SWAD implementation follows in the next section. A.1.1 SWAD MODEL AVERAGING We adopt the SWAD model averaging strategy (Cha et al., 2021) to have a more robust model that is less affected by overfitting. We apply the SWAD to the feature extractor network parameters θ and the variational parameters λ, but not the adversarial generator network. Since SWAD is an important component in our model, we provide more details here. SWAD is motivated from stochastic weight averaging (SWA) (Izmailov et al., 2018), however, unlike SWA's model averaging for every epoch, SWAD takes dense model averaging for every (batch) iteration. A key component of the SWAD algorithm is to determine the model averaging regime, the interval of iterations for which the model averaging is performed. This regime is aimed to avoid overfitting, and known as overfit-aware model averaging. The regime is specified by the start and end iteration numbers, ts and te, respectively, and we take model averaging for iterations t ∈ [ts, te], that is, θSW AD = 1 te − ts + 1 te(cid:88) t=ts θt, λSW AD = 1 te − ts + 1 te(cid:88) t=ts λt, (18) where θt and λt are the model parameters after iteration t. Here (θSW AD, λSW AD) are the final model parameters returned by the training algorithm. Now we describe how the regime is determined. Ideally, we expect the intermediate models during the interval [ts, te] to be overfit-free, having high generalisation performance. To this end, we evaluate the model on the validation set (held out from the source domain training data), and denote the validation loss of the t-th model by lt val. Then the start iteration of the regime, ts is determined by the first t where the validation loss is not improved for the next Ns iterations (e.g., Ns = 3). That is, ts = min{t − Ns + 1 | lt−Ns+1 val 13 ≤ lt val, lt−1 val , . . . , lt−Ns+1 val }. (19) Published as a conference paper at ICLR 2023 Algorithm 1 AGFA Algorithm with SWAD Model Averaging. Input: Source data S, SMCD trade-off η, post-mixup α, and learning rate γ, and SWAD hyperparameters Ns, Ne, r. Initialise: θ (feature extractor), λ (variational parameters), and ν (generator). (flag) SWAD-Regime-Entered ← F ALSE, (iteration) t ← 0. Repeat: i )}n i )}n i ← λAG i = F(xS i , yS i=1 from S. i=1 by Fourier transform AS i ∠P S i = Gν((cid:15)i), (cid:15)i ∼ N (0, I) for i = 1, . . . , n. 0. Sample a minibatch SB = {(xS 1. Prepare {(AS i , P S 2. Generate amplitude images AG 3. Post-mixup: AG 4. Construct a target batch TB = {(xT 5. Evaluate Lmodel := −ELBO(λ, θ; SB) + ηSMCD(θ; TB). 6. Update the model and variational parameters: (λ, θ) ← (λ, θ) − γ∇(λ,θ)Lmodel. 7. Evaluate Lgen := −SMCD(θ; TB). 8. Update the generator network: ν ← ν − γ∇νLgen. 9. (SWAD procedure) i , λ ∼ Uniform(0, α). i )}n i + (1 − λ)AS i , yT i = F −1(AG i i = yS i . i=1: xT i ), yT ∠P S i ). t ← t + 1, (λt, θt) ← (λ, θ). If SWAD-Regime-Entered == F ALSE: = min0≤t(cid:48)<Ns lt−t(cid:48) If lt−Ns+1 val : val ts ← t − Ns + 1, lval ← 1 Ns SWAD-Regime-Entered ← T rue. (cid:80)Ns−1 t(cid:48)=0 lt−t(cid:48) val . Else: If r * lval < min0≤t(cid:48)<Ne lt−t(cid:48) val : te ← t − Ne. Return θSW AD = 1 te−ts+1 (cid:80)te t=ts θt, λSW AD = 1 te−ts+1 (cid:80)te t=ts λt. Once we find ts, we compute the (average) starting validation loss, lval = (cid:80)ts+Ns−1 t=ts lt val Ns , (20) which is used as a reference when we decide the end iteration te. As we enter the regime, we start model averaging every iteration. To determine when to stop, we inspect the validation losses to see if the model starts overfitting. Specifically, if the validation losses are consecutively greater than lval by some margin, we regard it as overfit signal. That is, val, lt−1 te = min{t − Ne | lt val , . . . , lt−Ne+1 > r * lval}, (21) val where r and Ne are user-driven hyperparameters (e.g., r = 1.3, Ne = 6). The pseudo code of our AGFA algorithm with the SWAD strategy is summarised in Alg. 1. There are three hyperparameters in SWAD, (Ns, Ne, r), and following (Cha et al., 2021), we use Ns = 3, Ne = 6, r = 1.3 for all datasets in DomainBed except r = 1.2 for VLCS. One technical issue is that evaluating the validation loss every iteration is computationally demanding. Similarly as (Cha et al., 2021), we compute the validation loss at every V -th iterations (e.g., V = 50 for VLCS, V = 500 for DomainNet, and V = 100 for the rest) although the model averaging is still performed every iteration. Accordingly, the equations (19), (20), and (21) need to be changed where essentially all iteration numbers in those equations should be changed to multiples of V . The model averaging in Alg. 1 is implemented by the running (online) average and the use of (FIFO) queue data structures similarly as (Cha et al., 2021), which does not incur significant extra computational overhead. A.2 FULL RESULTS The full results (test errors on individual target domains) on DomainBed datasets are summarised in Table 3 (PACS), Table 4 (VLCS), Table 5 (OfficeHome), Table 6 (TerraIncognita), and Table 7 (DomainNet). We also show the full results of the sensitivity analysis in Table 8 (the SMCD loss trade-off η) and Table 9 (the post-synthesis mixup strength α). Moreover, we visualise in Fig. 5 the ablation study 14 Published as a conference paper at ICLR 2023 Table 3: Average accuracies on PACS. Note: † indicates that the results are excerpted from the published papers or (Gulrajani & Lopez-Paz, 2021). Our own runs are reported without †. FACT (Xu et al., 2021) adopted a slightly different data/domain split from DomainBed's, explaining discrepancy. Algorithm A C P S MASF (Dou et al., 2019)† DMG (Chattopadhyay et al., 2020)† MetaReg (Balaji et al., 2018)† ER (Zhao et al., 2020)† pAdaIN (Nuriel et al., 2021)† EISNet (Wang et al., 2020a)† DSON (Seo et al., 2020)† ERM (Cha et al., 2021)† IRM (Arjovsky et al., 2019)† GroupDRO (Sagawa et al., 2020)† I-Mixup (Xu et al., 2020; Yan et al., 2020; Wang et al., 2020b)† MLDG (Li et al., 2018a)† CORAL (Sun & Saenko, 2016)† MMD (Li et al., 2018b)† DANN (Ganin et al., 2016)† CDANN (Li et al., 2018c)† MTL (Blanchard et al., 2021)† SagNet (Nam et al., 2021)† ARM (Zhang et al., 2020)† VREx (Krueger et al., 2020)† RSC (Huang et al., 2020)† Mixstyle (Zhou et al., 2021b)† FACT (Xu et al., 2021)† FACT (Xu et al., 2021) Amp-Mixup (Xu et al., 2021) SWAD (Cha et al., 2021)† FACT+SWAD Amp-Mixup+SWAD (Proposed) AGFA 82.9 82.6 87.2 87.5 85.8 86.6 87.0 85.7 ± 0.6 84.8 ± 1.3 83.5 ± 0.9 86.1 ± 0.5 85.5 ± 1.4 88.3 ± 0.2 86.1 ± 1.4 86.4 ± 0.8 84.6 ± 1.8 87.5 ± 0.8 87.4 ± 1.0 86.8 ± 0.6 86.0 ± 1.6 85.4 ± 0.8 86.8 ± 0.5 89.6 ± 0.5 87.8 ± 0.2 84.7 ± 0.6 89.3 ± 0.2 89.6 ± 0.8 88.7 ± 0.1 89.8 ± 0.3 80.5 78.1 79.2 79.3 81.1 81.5 80.6 77.1 ± 0.8 76.4 ± 1.1 79.1 ± 0.6 78.9 ± 0.8 80.1 ± 1.7 80.0 ± 0.5 79.4 ± 0.9 77.4 ± 0.8 75.5 ± 0.9 77.1 ± 0.5 80.7 ± 0.6 76.8 ± 0.5 79.1 ± 0.6 79.7 ± 1.8 79.0 ± 1.4 81.8 ± 0.2 80.5 ± 1.1 81.0 ± 1.1 83.4 ± 0.6 82.5 ± 0.3 83.2 ± 0.4 85.2 ± 0.6 95.0 94.5 97.6 98.3 97.2 97.1 96.0 97.4 ± 0.4 96.7 ± 0.6 96.7 ± 0.3 97.6 ± 0.1 97.4 ± 0.3 97.5 ± 0.3 96.6 ± 0.2 97.3 ± 0.4 96.8 ± 0.3 96.4 ± 0.8 97.1 ± 0.1 97.4 ± 0.3 96.9 ± 0.5 97.6 ± 0.3 96.6 ± 0.1 96.8 ± 0.1 96.2 ± 0.2 95.0 ± 0.2 97.3 ± 0.3 96.6 ± 0.2 96.4 ± 0.1 97.6 ± 0.3 72.3 78.3 70.3 76.3 77.4 78.1 82.9 76.6 ± 0.7 76.1 ± 1.0 78.3 ± 2.0 75.8 ± 1.8 76.6 ± 1.1 78.8 ± 1.3 76.5 ± 0.5 73.5 ± 2.3 73.5 ± 0.6 77.3 ± 1.8 80.0 ± 0.4 79.3 ± 1.2 77.7 ± 1.7 78.2 ± 1.2 78.5 ± 2.3 84.5 ± 0.8 81.2 ± 0.6 78.1 ± 1.0 82.5 ± 0.5 83.8 ± 0.8 84.1 ± 0.5 84.7 ± 0.8 Avg 82.7 83.4 83.6 85.3 85.4 85.8 86.6 84.2 83.5 84.4 84.6 84.9 86.2 84.7 83.7 82.6 84.6 86.3 85.1 84.9 85.2 85.2 88.2 86.4 84.7 88.1 88.1 88.1 89.3 results for the four different modeling choices: 1) Impact of SMCD (vs. conventional unsupervised MCD), 2) Impact of post-synthesis mixup, 3) Impact of SWAD, and 4) Impact of amplitude generation (vs. pixel-based image generation). For the pixel-based image generation, we consider two generator architectures: linear (from 100-dim input noise to full image pixels) and nonlinear (a fully connected network with one hidden layer of 100 units). Visualisation of generated adversarial images. We visualise in Fig. 6 some synthesised amplitude images and constructed target domain images from the learned model on the PACS dataset. Although the generated amplitude images visually look like random noise, they appear to have the effect of attenuating high frequency spectra (shown as darker pixels in the fifth column) when combined with the source domain amplitude images by post-mixup. The constructed images from the generated amplitude images alone without post-mixup (sixth column) look a lot like edge detection maps, whereas the post-mixup constructed ones (seventh column) remain visually similar to the original source domain images, promoting DG solvability. A.3 DERIVATION OF ELBO IN VARIATIONAL INFERENCE We derive the evidence lower bound (ELBO) in (11) in the main paper. To enforce Qλ(W ) ≈ P (W |S, θ), we minimise their KL divergence, KL(cid:0)Qλ(W )||P (W |S, θ)(cid:1) = EQλ(W ) (cid:21) (cid:20) = EQλ(W ) log Qλ(W )P (S|θ) P (S|W, θ)P (W ) (cid:20) log (cid:21) Qλ(W ) P (W |S, θ) = log P (S|θ) − EQλ(W ) = log P (S|θ) − EQλ(W ) = log P (S|θ) − (cid:88) (cid:20) (cid:21) Qλ(W ) (cid:2) log P (S|W, θ)(cid:3) + EQλ(W ) P (W ) (cid:2) log P (S|W, θ)(cid:3) + KL(cid:0)Qλ(W )||P (W )(cid:1). EQλ(W ) (cid:2) log P (y|x, W, θ)(cid:3) + KL(cid:0)Qλ(W )||P (W )(cid:1). log (22) (23) (24) (25) (26) (x,y)∼S 15 Published as a conference paper at ICLR 2023 Table 4: Average accuracies on VLCS. The same interpretation as Table 3. V C L S Algorithm ERM (Cha et al., 2021)† IRM (Arjovsky et al., 2019)† GroupDRO (Sagawa et al., 2020)† I-Mixup (Xu et al., 2020; Yan et al., 2020; Wang et al., 2020b)† MLDG (Li et al., 2018a)† CORAL (Sun & Saenko, 2016)† MMD (Li et al., 2018b)† DANN (Ganin et al., 2016)† CDANN (Li et al., 2018c)† MTL (Blanchard et al., 2021)† SagNet (Nam et al., 2021)† ARM (Zhang et al., 2020)† VREx (Krueger et al., 2020)† RSC (Huang et al., 2020)† Mixstyle (Zhou et al., 2021b)† FACT (Xu et al., 2021) Amp-Mixup (Xu et al., 2021) SWAD (Cha et al., 2021)† FACT+SWAD Amp-Mixup+SWAD (Proposed) AGFA 98.0 ± 0.3 98.6 ± 0.1 97.3 ± 0.3 98.3 ± 0.6 97.4 ± 0.2 98.3 ± 0.1 97.7 ± 0.1 99.0 ± 0.3 97.1 ± 0.3 97.8 ± 0.4 97.9 ± 0.4 98.7 ± 0.2 98.4 ± 0.3 97.9 ± 0.1 98.6 ± 0.3 97.6 ± 0.1 97.4 ± 0.7 98.8 ± 0.1 98.4 ± 0.1 98.7 ± 0.1 99.0 ± 0.1 64.7 ± 1.2 64.9 ± 0.9 63.4 ± 0.9 64.8 ± 1.0 65.2 ± 0.7 66.1 ± 1.2 64.0 ± 1.1 65.1 ± 1.4 65.1 ± 1.2 64.3 ± 0.3 64.5 ± 0.5 63.6 ± 0.7 64.4 ± 1.4 62.5 ± 0.7 64.5 ± 1.1 65.5 ± 0.5 65.6 ± 0.3 63.3 ± 0.3 63.1 ± 0.3 63.9 ± 0.5 64.5 ± 0.6 71.4 ± 1.2 73.4 ± 0.6 69.5 ± 0.8 72.1 ± 0.5 71.0 ± 1.4 73.4 ± 0.3 72.8 ± 0.2 73.1 ± 0.3 70.7 ± 0.8 71.5 ± 0.7 71.4 ± 1.3 71.3 ± 1.2 74.1 ± 0.4 72.3 ± 1.2 72.6 ± 0.5 69.2 ± 0.8 70.5 ± 0.9 75.3 ± 0.5 72.4 ± 0.5 73.5 ± 0.2 75.4 ± 0.3 75.2 ± 1.6 77.3 ± 0.9 76.7 ± 0.7 74.3 ± 0.8 75.3 ± 1.0 77.5 ± 1.2 75.3 ± 3.3 77.2 ± 0.6 77.1 ± 1.5 75.3 ± 1.7 77.5 ± 0.5 76.7 ± 0.6 76.2 ± 1.3 75.6 ± 0.8 75.7 ± 1.7 73.9 ± 0.7 70.1 ± 0.8 79.2 ± 0.6 77.0 ± 0.4 76.7 ± 0.2 78.9 ± 0.6 Table 5: Average accuracies on OfficeHome. The same interpretation as Table 3. Algorithm C L S V ERM (Cha et al., 2021)† IRM (Arjovsky et al., 2019)† GroupDRO (Sagawa et al., 2020)† I-Mixup (Xu et al., 2020; Yan et al., 2020; Wang et al., 2020b)† MLDG (Li et al., 2018a)† CORAL (Sun & Saenko, 2016)† MMD (Li et al., 2018b)† DANN (Ganin et al., 2016)† CDANN (Li et al., 2018c)† MTL (Blanchard et al., 2021)† SagNet (Nam et al., 2021)† ARM (Zhang et al., 2020)† VREx (Krueger et al., 2020)† RSC (Huang et al., 2020)† Mixstyle (Zhou et al., 2021b)† FACT (Xu et al., 2021)† FACT (Xu et al., 2021) Amp-Mixup (Xu et al., 2021) SWAD (Cha et al., 2021)† FACT+SWAD Amp-Mixup+SWAD (Proposed) AGFA 63.1 ± 0.3 58.9 ± 2.3 60.4 ± 0.7 62.4 ± 0.8 61.5 ± 0.9 65.3 ± 0.4 60.4 ± 0.2 59.9 ± 1.3 61.5 ± 1.4 61.5 ± 0.7 63.4 ± 0.2 58.9 ± 0.8 60.7 ± 0.9 60.7 ± 1.4 51.1 ± 0.3 60.3 ± 0.1 61.2 ± 0.1 57.1 ± 0.3 66.1 ± 0.4 66.4 ± 0.2 65.9 ± 0.2 67.5 ± 0.3 51.9 ± 0.4 52.2 ± 1.6 52.7 ± 1.0 54.8 ± 0.6 53.2 ± 0.6 54.4 ± 0.5 53.3 ± 0.3 53.0 ± 0.3 50.4 ± 2.4 52.4 ± 0.6 54.8 ± 0.4 51.0 ± 0.5 53.0 ± 0.9 51.4 ± 0.3 53.2 ± 0.4 54.9 ± 0.4 55.2 ± 0.1 51.9 ± 0.1 57.7 ± 0.4 58.3 ± 0.2 57.9 ± 0.4 58.5 ± 0.1 77.2 ± 0.5 72.1 ± 2.9 75.0 ± 0.7 76.9 ± 0.3 75.0 ± 1.2 76.5 ± 0.1 74.3 ± 0.1 73.6 ± 0.7 74.4 ± 0.9 74.9 ± 0.4 75.8 ± 0.4 74.1 ± 0.1 75.3 ± 0.1 74.8 ± 1.1 68.2 ± 0.7 74.5 ± 0.1 74.0 ± 0.2 72.5 ± 0.3 78.4 ± 0.1 78.0 ± 0.1 77.8 ± 0.2 79.3 ± 0.1 78.1 ± 0.2 74.0 ± 2.5 76.0 ± 0.7 78.3 ± 0.2 77.5 ± 0.4 78.4 ± 0.5 77.4 ± 0.6 76.9 ± 0.5 76.6 ± 0.8 76.8 ± 0.4 78.3 ± 0.3 75.2 ± 0.3 76.6 ± 0.5 75.1 ± 1.3 69.2 ± 0.6 76.6 ± 0.1 76.2 ± 0.4 74.4 ± 0.2 80.2 ± 0.2 79.6 ± 0.1 79.7 ± 0.1 80.7 ± 0.1 Since KL divergence is non-negative, re-arranging (26) yields: (cid:88) log P (S|θ) ≥ EQλ(W ) (cid:2) log P (y|x, W, θ)(cid:3) − KL(cid:0)Qλ(W )||P (W )(cid:1), Avg 77.3 78.6 76.7 77.4 77.2 78.8 77.5 78.6 77.5 77.2 77.8 77.6 78.3 77.1 77.9 76.6 75.9 79.1 77.7 78.2 79.5 Avg 67.6 64.3 66.0 68.1 66.8 68.7 66.4 65.9 65.7 66.4 68.1 64.8 66.4 65.5 60.4 66.6 66.6 64.0 70.6 70.6 70.3 71.5 (27) and the right hand side constitutes the ELBO. (x,y)∼S A.4 ADDITIONAL EXPERIMENTAL RESULTS A.4.1 RESULTS ON RESNET-18 BACKBONE To test our approach on backbone networks other than ResNet-50, we run experiments with the ResNet-18 backbone on the PACS dataset. The results are summarised in Table 10. Compared to the recent approaches MixStyle (Zhou et al., 2021b) and EFDMix (Zhang et al., 2022), our approach AGFA again shows higher performance even with the smaller ResNet-18 backbone. 16 Published as a conference paper at ICLR 2023 Table 6: Average accuracies on TerraIncognita. The same interpretation as Table 3. Algorithm L100 L38 L43 L46 ERM (Cha et al., 2021)† IRM (Arjovsky et al., 2019)† GroupDRO (Sagawa et al., 2020)† I-Mixup (Xu et al., 2020; Yan et al., 2020; Wang et al., 2020b)† MLDG (Li et al., 2018a)† CORAL (Sun & Saenko, 2016)† MMD (Li et al., 2018b)† DANN (Ganin et al., 2016)† CDANN (Li et al., 2018c)† MTL (Blanchard et al., 2021)† SagNet (Nam et al., 2021)† ARM (Zhang et al., 2020)† VREx (Krueger et al., 2020)† RSC (Huang et al., 2020)† Mixstyle (Zhou et al., 2021b)† FACT (Xu et al., 2021) Amp-Mixup (Xu et al., 2021) SWAD (Cha et al., 2021)† FACT+SWAD Amp-Mixup+SWAD (Proposed) AGFA 54.3 ± 0.4 54.6 ± 1.3 41.2 ± 0.7 59.6 ± 2.0 54.2 ± 3.0 51.6 ± 2.4 41.9 ± 3.0 51.1 ± 3.5 47.0 ± 1.9 49.3 ± 1.2 53.0 ± 2.9 49.3 ± 0.7 48.2 ± 4.3 50.2 ± 2.2 54.3 ± 1.1 52.4 ± 1.2 56.0 ± 0.8 55.4 ± 0.0 57.0 ± 0.6 56.6 ± 0.6 61.0 ± 0.3 42.5 ± 0.7 39.8 ± 1.9 38.6 ± 2.1 42.2 ± 1.4 44.3 ± 1.1 42.2 ± 1.0 34.8 ± 1.0 40.6 ± 0.6 41.3 ± 4.8 39.6 ± 6.3 43.0 ± 2.5 38.3 ± 2.4 41.7 ± 1.3 39.2 ± 1.4 34.1 ± 1.1 42.3 ± 1.0 38.9 ± 0.7 44.9 ± 1.1 46.6 ± 1.1 46.3 ± 0.3 46.2 ± 2.3 55.6 ± 0.3 56.2 ± 1.8 56.7 ± 0.9 55.9 ± 0.8 55.6 ± 0.3 57.0 ± 1.0 57.0 ± 1.9 57.4 ± 0.5 54.9 ± 1.7 55.6 ± 1.1 57.9 ± 0.6 55.8 ± 0.8 56.8 ± 0.8 56.3 ± 1.4 55.9 ± 1.1 55.5 ± 0.3 56.9 ± 0.2 59.7 ± 0.4 60.3 ± 0.5 60.2 ± 0.6 60.3 ± 0.7 38.8 ± 2.5 39.6 ± 0.8 36.4 ± 2.1 33.9 ± 1.4 36.9 ± 2.2 39.8 ± 2.9 35.2 ± 1.8 37.7 ± 1.8 39.8 ± 2.3 37.8 ± 0.8 40.4 ± 1.3 38.7 ± 1.3 38.7 ± 3.1 40.8 ± 0.6 31.7 ± 2.1 31.3 ± 0.9 35.7 ± 0.8 39.9 ± 0.2 40.1 ± 0.3 41.8 ± 0.4 42.3 ± 0.9 Avg 47.8 47.6 43.2 47.9 47.8 47.7 42.2 46.7 45.8 45.6 48.6 45.5 46.4 46.6 44.0 45.4 46.8 50.0 51.0 51.2 52.4 Table 7: Average accuracies on DomainNet. The same interpretation as Table 3. Algorithm C I P Q R S DMG (Chattopadhyay et al., 2020)† MetaReg (Balaji et al., 2018)† ERM (Cha et al., 2021)† IRM (Arjovsky et al., 2019)† GroupDRO (Sagawa et al., 2020)† I-Mixup (Citation as before) MLDG (Li et al., 2018a)† CORAL (Sun & Saenko, 2016)† MMD (Li et al., 2018b)† DANN (Ganin et al., 2016)† CDANN (Li et al., 2018c)† MTL (Blanchard et al., 2021)† SagNet (Nam et al., 2021)† ARM (Zhang et al., 2020)† VREx (Krueger et al., 2020)† RSC (Huang et al., 2020)† Mixstyle (Zhou et al., 2021b)† FACT (Xu et al., 2021) Amp-Mixup (Xu et al., 2021) SWAD (Cha et al., 2021)† FACT+SWAD Amp-Mixup+SWAD (Proposed) AGFA 65.2 59.8 63.0 ± 0.2 48.5 ± 2.8 47.2 ± 0.5 55.7 ± 0.3 59.1 ± 0.2 59.2 ± 0.1 32.1 ± 13.3 53.1 ± 0.2 54.6 ± 0.4 57.9 ± 0.5 57.7 ± 0.3 49.7 ± 0.3 47.3 ± 3.5 55.0 ± 1.2 51.9 ± 0.4 62.5 ± 0.3 62.3 ± 0.1 66.0 ± 0.1 66.3 ± 0.1 66.1 ± 0.1 66.7 ± 0.1 22.2 25.6 21.2 ± 0.2 15.0 ± 1.5 17.5 ± 0.4 18.5 ± 0.5 19.1 ± 0.3 19.7 ± 0.2 11.0 ± 4.6 18.3 ± 0.1 17.3 ± 0.1 18.5 ± 0.4 19.0 ± 0.2 16.3 ± 0.5 16.0 ± 1.5 18.3 ± 0.5 13.3 ± 0.2 19.4 ± 0.1 19.0 ± 0.2 22.4 ± 0.3 22.7 ± 0.2 22.4 ± 0.2 22.9 ± 0.2 50.0 50.2 50.1 ± 0.4 38.3 ± 4.3 33.8 ± 0.5 44.3 ± 0.5 45.8 ± 0.7 46.6 ± 0.3 26.8 ± 11.3 44.2 ± 0.7 43.7 ± 0.9 46.0 ± 0.1 45.3 ± 0.3 40.9 ± 1.1 35.8 ± 4.6 44.4 ± 0.6 37.0 ± 0.5 48.2 ± 0.4 47.2 ± 0.4 53.5 ± 0.1 53.7 ± 0.1 53.3 ± 0.1 54.0 ± 0.1 15.7 11.5 13.9 ± 0.5 10.9 ± 0.5 9.3 ± 0.3 12.5 ± 0.4 13.4 ± 0.3 13.4 ± 0.4 8.7 ± 2.1 11.8 ± 0.1 12.1 ± 0.7 12.5 ± 0.1 12.7 ± 0.5 9.4 ± 0.1 10.9 ± 0.3 12.2 ± 0.2 12.3 ± 0.1 13.9 ± 0.3 12.9 ± 0.6 16.1 ± 0.2 16.3 ± 0.1 16.2 ± 0.3 16.7 ± 0.2 59.6 64.6 63.7 ± 0.2 48.2 ± 5.2 51.6 ± 0.4 55.8 ± 0.3 59.6 ± 0.2 59.8 ± 0.2 32.7 ± 13.8 55.5 ± 0.4 56.2 ± 0.4 59.5 ± 0.3 58.1 ± 0.5 53.4 ± 0.4 49.6 ± 4.9 55.7 ± 0.7 46.1 ± 0.3 60.5 ± 0.7 59.5 ± 0.3 65.8 ± 0.4 65.0 ± 0.6 64.6 ± 0.5 65.9 ± 0.1 49.0 50.1 52.0 ± 0.5 42.3 ± 3.1 40.1 ± 0.6 48.2 ± 0.5 50.2 ± 0.4 50.1 ± 0.6 28.9 ± 11.9 46.8 ± 0.6 45.9 ± 0.5 49.2 ± 0.1 48.8 ± 0.2 43.5 ± 0.4 42.0 ± 3.0 47.8 ± 0.9 43.4 ± 0.4 51.0 ± 0.7 51.0 ± 0.1 55.5 ± 0.3 55.9 ± 0.1 55.6 ± 0.1 56.3 ± 0.1 Avg 43.6 43.6 44.0 33.9 33.3 39.2 41.2 41.5 23.4 38.3 38.3 40.6 40.3 35.5 33.6 38.9 34.0 42.6 42.0 46.5 46.7 46.4 47.1 A.4.2 RESULTS ON COLOURED-MNIST AND ROTATED-MNIST Although relatively smaller and easier datasets in the DomainBed benchmark, we also test our method on the Coloured-MNIST and Rotated-MNIST datasets. Following the experimental protocols including the four-layer ConvNet backbone as in (Gulrajani & Lopez-Paz, 2021), the test accuracies are reported in Table 11 (Colored-MNIST) and Table 12 (Rotated-MNIST). As shown, all approaches including ours perform equally well on these datasets. A.4.3 RESULTS ON SINGLE-SOURCE GENERALISATION We have focused predominantly on the most popular leave-one-domain-out DG setting in our empirical study. Another reasonable experimental setting is single source generalisation setting: training on only one source domain and testing on the rest domains. Our single source domain results 17 Published as a conference paper at ICLR 2023 Table 8: Sensitivity analysis on the SMCD loss trade off η on PACS and OfficeHome. (a) PACS η = 0.0 η = 0.01 η = 0.05 η = 0.1 η = 0.2 η = 0.5 η = 1.0 η = 0.0 η = 0.01 η = 0.05 η = 0.1 η = 0.15 η = 0.2 η = 0.25 Art 89.08 ± 0.14 89.24 ± 0.26 89.52 ± 0.26 89.80 ± 0.34 89.40 ± 0.60 89.00 ± 0.14 89.11 ± 0.36 Art 66.09 ± 0.28 66.86 ± 0.17 66.95 ± 0.09 67.46 ± 0.28 66.46 ± 0.33 66.05 ± 0.03 66.15 ± 0.17 Cartoon 83.55 ± 0.16 84.41 ± 0.53 84.83 ± 0.20 85.16 ± 0.65 84.57 ± 0.25 84.40 ± 0.38 84.20 ± 0.55 Photo 97.23 ± 0.19 97.17 ± 0.07 97.33 ± 0.17 97.59 ± 0.27 97.33 ± 0.15 97.03 ± 0.17 96.49 ± 0.22 Sketch 82.55 ± 0.30 84.31 ± 0.37 83.75 ± 0.14 84.67 ± 0.82 83.88 ± 0.16 83.10 ± 0.80 82.39 ± 0.57 Average 88.10 88.78 88.86 89.30 88.80 88.38 88.05 (b) OfficeHome Clipart 57.72 ± 0.34 58.43 ± 0.34 58.56 ± 0.32 58.45 ± 0.13 58.31 ± 0.22 58.10 ± 0.11 58.29 ± 0.36 Product 78.47 ± 0.16 78.53 ± 0.09 78.96 ± 0.28 79.27 ± 0.07 78.59 ± 0.33 78.69 ± 0.18 78.16 ± 0.04 Real 80.19 ± 0.11 80.51 ± 0.31 80.46 ± 0.24 80.70 ± 0.11 80.51 ± 0.09 80.45 ± 0.06 79.87 ± 0.21 Average 70.62 71.08 71.23 71.47 70.97 70.82 70.62 Table 9: Sensitivity analysis on the post-mixup trade off α on PACS and OfficeHome. (a) PACS α = 0.0 α = 0.2 α = 0.4 α = 0.6 α = 0.8 α = 0.9 α = 1.0 α = 0.0 α = 0.1 α = 0.2 α = 0.3 α = 0.4 α = 0.6 α = 0.8 α = 1.0 Art 89.29 ± 0.37 89.23 ± 0.22 89.37 ± 0.17 89.42 ± 0.48 89.47 ± 0.61 89.66 ± 0.23 89.80 ± 0.34 Cartoon 83.55 ± 0.20 83.80 ± 0.21 83.93 ± 0.07 84.30 ± 0.16 84.39 ± 0.18 85.04 ± 0.28 85.16 ± 0.65 Photo 97.11 ± 0.07 97.25 ± 0.05 97.27 ± 0.10 97.31 ± 0.13 97.41 ± 0.15 97.60 ± 0.13 97.59 ± 0.27 Sketch 82.17 ± 0.91 82.59 ± 0.84 83.37 ± 0.43 83.71 ± 0.60 83.68 ± 0.15 84.27 ± 0.40 84.67 ± 0.82 (b) OfficeHome Art 65.99 ± 0.17 67.04 ± 0.15 67.46 ± 0.28 66.98 ± 0.24 67.04 ± 0.32 66.45 ± 0.33 66.56 ± 0.23 66.47 ± 0.30 Clipart 57.72 ± 0.16 58.09 ± 0.11 58.45 ± 0.13 58.50 ± 0.22 58.37 ± 0.26 57.99 ± 0.20 57.89 ± 0.18 57.96 ± 0.09 Product 78.36 ± 0.08 78.72 ± 0.15 79.27 ± 0.07 78.87 ± 0.18 78.57 ± 0.09 78.53 ± 0.21 78.50 ± 0.12 78.46 ± 0.30 Real 80.22 ± 0.09 80.36 ± 0.08 80.70 ± 0.11 80.45 ± 0.06 80.43 ± 0.09 80.22 ± 0.11 80.21 ± 0.18 79.97 ± 0.29 Average 88.03 88.22 88.49 88.69 88.74 89.14 89.30 Average 70.57 71.05 71.47 71.20 71.10 70.80 70.79 70.72 18 Published as a conference paper at ICLR 2023 Figure 5: Ablation study of four different modeling choices: SMCD, post-mixup, SWAD, and amplitude generation (instead of pixel-based target image generation). Figure 6: Visualisation of the generated amplitude and constructed images. The columns are (from left to right): 1) original image, 2) phase and 3) amplitude spectra after Fourier transform, 4) generated amplitude image, 5) post-mixup of 3 and 4, 6) constructed image from phase in 2) and generated amplitude image in 4) (by inverse Fourier transform), and 7) constructed image from phase 2 and the post-mixup amplitude 5. on the PACS benchmark are shown in Table 13 for (a) ResNet-18 and (b) ResNet-50 backbones. The results indicate that improvement of the proposed AGFA over the existing DG methods is even more pronounced: averaged accuracies higher than the best prior method EFDMIX (Zhang et al., 2022) by about 10% for ResNet-18 and by about 7% for ResNet-50. 19 ACPSAvgTarget domain708090100Target accuracy (%)Supervised MCD (Proposed)Unsupervised MCDACPSAvgTarget domain708090100Target accuracy (%)W/ post-mixup (Proposed)Without post-mixupACPSAvgTarget domain708090100Target accuracy (%)W/ SWAD (Proposed)Without SWADACPSAvgTarget domain708090100Target accuracy (%)Amp. (Proposed)Pixel (Linear)Pixel (FC-Net) Published as a conference paper at ICLR 2023 Table 10: Average accuracies on PACS with ResNet-18 backbone. Results on ERM, Mixup (Zhang et al., 2018), MixStyle (Zhou et al., 2021b), and EFDMix (Zhang et al., 2022) are excerpted from (Zhang et al., 2022). Algorithm Art Cartoon Painting Sketch ERM Mixup MixStyle EFDMix (Proposed) AGFA 77.0 ± 0.6 76.8 ± 0.7 83.1 ± 0.8 83.9 ± 0.4 84.5 ± 0.6 75.9 ± 0.6 74.9 ± 0.7 78.6 ± 0.9 79.4 ± 0.7 78.5 ± 0.5 96.0 ± 0.1 95.8 ± 0.3 95.9 ± 0.4 96.8 ± 0.4 95.7 ± 0.1 69.2 ± 0.6 66.6 ± 0.7 74.2 ± 2.7 75.0 ± 0.7 80.9 ± 0.2 Avg 79.5 78.5 82.9 83.9 84.9 Table 11: Average accuracies on Colored-MNIST with the four-layer ConvNet backbone. Results on competing methods are excerpted from (Gulrajani & Lopez-Paz, 2021). Algorithm 0.1 0.2 0.9 72.7 ± 0.2 ERM 72.0 ± 0.2 IRM 72.7 ± 0.3 DRO 72.4 ± 0.2 Mixup 71.4 ± 0.4 MLDG 71.8 ± 0.4 CORAL 72.1 ± 0.2 MMD 72.0 ± 0.3 ADA 72.2 ± 0.3 CondADA (Proposed) AGFA 72.6 ± 0.1 73.2 ± 0.3 73.2 ± 0.0 73.1 ± 0.3 73.3 ± 0.3 73.3 ± 0.0 73.3 ± 0.2 72.8 ± 0.2 72.4 ± 0.5 73.2 ± 0.2 73.8 ± 0.1 10.0 ± 0.0 10.1 ± 0.2 10.0 ± 0.0 10.0 ± 0.1 10.0 ± 0.1 10.1 ± 0.1 10.5 ± 0.2 10.0 ± 0.2 10.4 ± 0.3 10.5 ± 0.1 Avg 52.0 51.8 51.9 51.9 51.6 51.7 51.8 51.5 51.9 52.3 Table 12: Average accuracies on Rotated-MNIST with the four-layer ConvNet backbone. Results on competing methods are excerpted from (Gulrajani & Lopez-Paz, 2021). Algorithm 0 15 30 45 60 75 95.6 ± 0.1 ERM 95.9 ± 0.2 IRM 95.9 ± 0.1 DRO 96.1 ± 0.2 Mixup 95.9 ± 0.2 MLDG 95.7 ± 0.2 CORAL 96.6 ± 0.1 MMD 95.6 ± 0.3 DANN 96.0 ± 0.5 C-DANN (Proposed) AGFA 98.1 ± 0.1 99.0 ± 0.1 98.9 ± 0.0 98.9 ± 0.0 99.1 ± 0.0 98.9 ± 0.1 99.0 ± 0.0 98.9 ± 0.0 98.9 ± 0.0 98.8 ± 0.0 98.9 ± 0.0 98.9 ± 0.0 99.0 ± 0.0 99.0 ± 0.1 98.9 ± 0.0 99.0 ± 0.0 99.1 ± 0.1 98.9 ± 0.1 98.9 ± 0.0 99.0 ± 0.1 99.0 ± 0.0 99.1 ± 0.1 98.8 ± 0.1 99.0 ± 0.0 99.0 ± 0.0 99.1 ± 0.0 99.1 ± 0.0 99.1 ± 0.1 99.0 ± 0.1 99.1 ± 0.0 98.8 ± 0.0 99.0 ± 0.0 98.9 ± 0.1 99.0 ± 0.0 99.0 ± 0.1 99.0 ± 0.0 99.0 ± 0.0 99.0 ± 0.0 98.9 ± 0.0 98.9 ± 0.1 99.0 ± 0.0 96.7 ± 0.2 95.5 ± 0.3 96.9 ± 0.1 96.6 ± 0.1 96.0 ± 0.2 96.7 ± 0.2 96.2 ± 0.1 95.9 ± 0.5 96.5 ± 0.3 96.4 ± 0.1 Avg 98.1 97.8 98.1 98.1 98.0 98.1 98.1 97.9 98.0 98.0 A.4.4 COMPARISON WITH PIXEL-BASED TARGET IMAGE GENERATION Our Fourier-based target image generation is effective for preserving semantic class information from the source domains, thanks to the phase/amplitude separation. To see if non-Fourier-based generation also has similar property, we visualise adversarial target images generated by a purely pixel-based manner without phase/amplitude separation. For the linear pixel-based generator model (from 100-dim input noise to full image pixels), which performed slightly better than nonlinear ones in test accuracy, we show some examples in Fig. 7. Whereas the pixel-based generation is visually uninformative and looks like pure random noise, our Fourier-based generation contains salient object edge information that is closely related to class semantics. 20 Published as a conference paper at ICLR 2023 Table 13: Single source domain generalisation results on PACS with (a) ResNet-18 and (b) ResNet-50 backbones. Each column shows test accuracies averaged over the rest three target domains. Results on ERM, MixStyle (Zhou et al., 2021b), and EFDMix (Zhang et al., 2022) are excerpted from (Zhang et al., 2022). Algorithm Art (a) ResNet-18 Cartoon ERM MixStyle EFDMix (Proposed) AGFA 58.6 ± 2.4 61.9 ± 2.2 63.2 ± 2.3 74.2 ± 1.1 66.4 ± 0.7 71.5 ± 0.8 73.9 ± 0.7 77.5 ± 0.6 Painting Sketch 34.0 ± 1.8 41.2 ± 1.8 42.5 ± 1.8 48.5 ± 2.6 27.5 ± 4.3 32.2 ± 4.1 38.1 ± 3.7 58.3 ± 0.9 Algorithm Art (b) ResNet-50 Cartoon ERM MixStyle EFDMix (Proposed) AGFA 63.5 ± 1.3 73.2 ± 1.1 75.3 ± 0.9 79.8 ± 0.9 69.2 ± 1.6 74.8 ± 1.1 77.4 ± 0.8 81.7 ± 0.6 Painting Sketch 38.0 ± 0.9 46.0 ± 2.0 48.0 ± 0.9 48.6 ± 0.5 31.4 ± 1.5 40.6 ± 2.0 44.2 ± 2.4 64.6 ± 1.1 Avg 46.6 51.7 54.4 64.6 Avg 50.5 58.6 61.2 68.7 Figure 7: Comparison between pixel-based and our Fourier-based generated target images. Whereas the pixel-based generation is visually uninformative and looks like pure random noise, our Fourier- based generation contains salient object edge information that is closely related to class semantics. 21
http://arxiv.org/abs/2302.12024v1
2023-02-23T13:34:01
2023-02-23T13:34:01
On the curse of dimensionality for Normalizing Flows
Normalizing Flows have emerged as a powerful brand of generative models, as they not only allow for efficient sampling of complicated target distributions, but also deliver density estimation by construction. We propose here an in-depth comparison of coupling and autoregressive flows, both of the affine and rational quadratic spline type, considering four different architectures: Real-valued Non-Volume Preserving (RealNVP), Masked Autoregressive Flow (MAF), Coupling Rational Quadratic Spline (C-RQS), and Autoregressive Rational Quadratic Spline (A-RQS). We focus on different target distributions of increasing complexity with dimensionality ranging from 4 to 1000. The performances are discussed in terms of different figures of merit: the one-dimensional Wasserstein distance, the one-dimensional Kolmogorov-Smirnov test, the Frobenius norm of the difference between correlation matrices, and the training time. Our results indicate that the A-RQS algorithm stands out both in terms of accuracy and training speed. Nonetheless, all the algorithms are generally able, without much fine-tuning, to learn complex distributions with limited training data and in a reasonable time, of the order of hours on a Tesla V100 GPU. The only exception is the C-RQS, which takes significantly longer to train, and does not always provide good accuracy. All algorithms have been implemented using TensorFlow2 and TensorFlow Probability and made available on GitHub.
[ "Andrea Coccaro", "Marco Letizia", "Humberto Reyes-Gonzalez", "Riccardo Torre" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.12024v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.12024v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.ML", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.ML", "cs.LG", "hep-ex", "hep-ph" ]
On the curse of dimensionality for Normalizing Flows Andrea Coccaro1*, Marco Letizia1,2*, Humberto Reyes-Gonz ́alez1,3* and Riccardo Torre1* 1*INFN, Sezione di Genova, Via Dodecaneso 33, Genova, 16146, Italy. 2*MaLGa - DIBRIS, University of Genova, Via Dodecaneso 35, Genova, 16146, Italy. 3*Department of Physics, University of Genova, Via Dodecaneso 33, Genova, 16146, Italy. *Corresponding author(s). E-mail(s): [email protected]; [email protected]; [email protected]; [email protected]; Abstract Normalizing Flows have emerged as a powerful brand of generative models, as they not only allow for efficient sampling of complicated target distributions, but also deliver density estimation by con- struction. We propose here an in-depth comparison of coupling and autoregressive flows, both of the affine and rational quadratic spline type, considering four different architectures: Real-valued Non- Volume Preserving (RealNVP), Masked Autoregressive Flow (MAF), Coupling Rational Quadratic Spline (C-RQS), and Autoregressive Rational Quadratic Spline (A-RQS). We focus on different target distributions of increasing complexity with dimensionality ranging from 4 to 1000. The performances are discussed in terms of different figures of merit: the one-dimensional Wasserstein distance, the one-dimensional Kolmogorov-Smirnov test, the Frobenius norm of the difference between correlation matrices, and the training time. Our results indicate that the A-RQS algorithm stands out both in terms of accuracy and training speed. Nonetheless, all the algorithms are generally able, without much fine-tuning, to learn complex distributions with limited training data and in a reasonable time, of the order of hours on a Tesla V100 GPU. The only exception is the C-RQS, which takes significantly longer to train, and does not always provide good accuracy. All algorithms have been imple- mented using TensorFlow2 and TensorFlow Probability and made available on GitHub (cid:135). Keywords: Machine Learning, Generative Models, Density Estimation, Normalizing Flows 3 2 0 2 b e F 3 2 ] L M . t a t s [ 1 v 4 2 0 2 1 . 2 0 3 2 : v i X r a 1 2 CONTENTS Contents 1 Introduction 2 Normalizing Flows 2.1 Coupling flows 2.2 Autoregressive flows . . . . . . . . . . . . . . . . . . . 3 Architectures 3.1 The RealNVP . . . . . . . . . . . . 3.2 The MAF . . . . . . . . . . . . . . 3.3 The RQS bijector . . . . . . . . . . 3.4 The C-RQS . . . . . . . . . . . . . 3.5 The A-RQS . . . . . . . . . . . . . 4 Non-parametric quality metrics 5 Testing the Normalizing Flows 5.1 Correlated Mixture of Gaussians . 5.2 Extremely multi-modal CMoG . . 5.3 Truncated Gaussians . . . . . . . . 6 Conclusions and Outlook 2 3 4 5 5 6 6 6 7 7 8 9 9 10 11 13 A Implementation of NF architectures 14 14 A.1 The RealNVP . . . . . . . . . . . . 14 A.2 The MAF . . . . . . . . . . . . . . 15 A.3 The C-RQS . . . . . . . . . . . . . 16 A.4 The A-RQS . . . . . . . . . . . . . B Hyperparameters C Correlated mixture of Gaussians D Extremely multimodal mixture of Gaussians correlated E Truncated Gaussians F Corner plots 1 Introduction 16 17 18 19 20 Since a few years now, the High Energy Physics (HEP) community has started to substantially explore Machine Learning techniques for a diverse variety of tasks and, as such, a large number of ideas, applications, and tools are being pub- lished [1, 2]. This is not only the case within experimental collaborations, but also among the phenomenology and formal theory communities [3–6]. Even more, as we head towards the High- Luminosity era of the Large Hadron Collider (HL- LHC), in which unprecedented amount of highly complex data need to be simulated, collected, and finally analyzed, the importance of building reli- able and more efficient methods, techniques, and workflows for HEP is becoming compulsory. As the community has already realized, ML plays a crucial role in this development. In particular, ML provides a potential solution to meet the expected computing resources for simulating and recon- structing the products of the collisions and will also be essential for developing novel strategies for triggering and reconstructing data, as well as for the statistical analysis, interpretation, and preser- vation of such data. This represents a brand new field of research, that effectively complements the HL-LHC physics programme. Furthermore, sup- ported by the largely enhanced precision expected at the HL-LHC, dedicated ML methods will pro- vide great opportunities to pursue data-driven searches, i.e. for anomaly detection, data quality monitoring and efficient background estimation. However, to ensure a systematic implementation of ML methods in the HEP workflows, one needs to carefully study their properties and capabilities against complex, high-dimensional data and to assess their ability to match the required precision, typically much higher than that of industrial and "real-life" applications. This program, which can go under the name of "Precision ML", cannot be separated from the development of reliable quality metrics and proper assessment of uncertainties. Here we focus on Normalizing Flows (NFs) [7–10], a class of neural density estimators that, on one side offers a competitive approach to gen- erative models, such as Generative Adversarial Networks (GAN) [11] and Variational AutoEn- coders (VAE) [12, 13], for the generation of syn- thetic data, and, on the other side, opens up a wide range of applications due to its ability to directly perform density estimation. While appli- cations of the generative direction of NFs is rather obvious in a field like HEP, which poses its founda- tions on Monte Carlo simulations, it is interesting to mention some of the possible density estima- tion applications. The ability to directly learn the Likelihood, or the posterior in a Bayesian framework, has applications ranging from analy- sis inference, reinterpretation, and preservation, to CONTENTS 3 simulation-based likelihood-free inference [14–19], to unfolding of HEP analyses [20], to the gen- eration of effective priors for Bayesian inference [21–26] and systematic uncertainty estimation and parametrization, or effective proposals for sequen- tial Monte Carlo [27–32], numerical integration based on importance sampling algorithms [33– 36], and probabilistic programming applied to fast inference [37, 38]. The basic principle behind NFs is to per- form a series of invertible bijective transformations on a simple base distribution to approximate the complex distribution of interest. The optimal parameters of the transformations, often called bijectors, are derived from training Neural Net- works (NNs) that directly take the negative log- likelihood of the true data computed with the NF distribution as the loss function. As it turns out, PDFs are everywhere in HEP: from the likelihood function of an experimental or phenomenologi- cal result, to the distribution that describes a particle-collision process. Furthermore, it has been shown that directly using the likelihood as loss function, leads to a more stable learning pro- cess, making NFs very efficient sample generators. Thus, NFs have found numerous applications in inte- HEP: they have been used for numerical gration and event generation [39–43], anomaly detection [44–46], detector unfolding [47, 48], etc. This growing interest in NFs implies the urgency of testing state-of-the-art NF architectures against complex high-dimensional data to ensure their systematic usability and to assess their expected performances, which is the purpose of the present study. By testing NFs against generic complex dis- tributions of increasing dimensionality, we aim to make a step forward in the general understanding of the performances and properties of NFs applied to high dimensional data. Our strategy is the following. We implemented and tested four of the mostly used NF archi- tectures of the coupling and autoregressive type: Real-valued Non-Volume Preserving (RealNVP) [49], Masked Autoregressive Flow (MAF) [50], Coupling Rational Quadratic Spline (C-RQS) [51], and Autoregressive Rational Quadratic Spline (A- RQS) [51]. We tested these NF architectures against three types of target distributions with dimensionalities ranging from 4 to 1000: Corre- lated Mixture of Gaussians (CMoG), Extremely Multimodal Correlated Mixture of Gaussians (CMoGem), and Truncated Gaussians (TG). We also performed a small-scale hyperparameter scan, explicitly avoiding to fine-tune the models, and provide the best result for each NF architecture and target distribution. The performances were measured by means of several figures of merit: the median (over dimensions) 1D Wasserstein dis- tance, the median (over dimensions) p-value of 1D Kolmogorov-Smirnov tests, the Frobenius norm of the difference of the correlation matrices, and the training time. The paper is organized as follows. In Section 2 we describe the concept of NFs in more detail, focusing on the coupling and autoregressive types. In Section 3 we introduce the specific NF architec- tures under investigation. In Section 4 we present the metrics used in our analysis and in Section 5 we discuss our results. Finally, we provide our con- cluding remarks in Section 6, with emphasis on the several prospective research avenues that we plan to follow. 2 Normalizing Flows Normalizing Flows are made of series of bijective, continuous, and invertible transformations that map a simple base PDF to a more complicated target PDF. The purpose of NFs is to estimate the unknown underlying distribution of some data of interest and to allow the generation of samples approximately following the same distribution. Since the parameters of both the base distribu- tion and the transformations are known, one can generate samples from the target distribution by drawing samples from the base distribution and then applying the proper transformation. This is known as the generative direction of the flow. Furthermore, since the NF transformations are invertible, one can also obtain the probability density of the true samples, via inverse transfor- mations from the target to the base PDF. This is known as the normalizing direction of the flow. It is called "normalizing" because the base distri- bution is often Gaussian, even though this is not a requirement, and this is also the origin of the name Normalizing Flows. The basic idea behind NFs is the change of variable formula for a PDF. Let X, Y ∈ RD be random variables with PDFs pX , pY : RD → R. Let us define a bijective map g : X → Y , with 4 CONTENTS inverse f = g−1.1 The two densities are then related by the well known formula pY (y) = pX (g−1(y)) | det Jg |−1 = pX (f (y)) | det Jf | , (1) where Jf = ∂f is the Jacobian of g(x). ∂y is the Jacobian of f (y) and Jg = ∂g ∂x Let us now consider a set of parameters {φ} characterizing the chosen base density pX (typi- cally the mean vector and covariance matrix of a multivariate Gaussian) and parametrize the map g by another set of parameters {θ}. One can then perform a maximum likelihood estimation of the parameters Φ = {φ, θ} given some measured data D = {y(i)}M i=1 distributed according to the unknown PDF py. The log-likelihood of the data is given by the following expression log p(D | Φ) = M (cid:88) i=1 log pY (y(i) | Φ) = M (cid:88) i=1 log pX (f (y(i); θ) | θ, φ) + log | det Jf | , (2) where we made the dependence of f on θ explicit through the notation fθ. Then, the best estimate of the parameters Φ is given by ˆΦ = arg max log p(D | Φ) . (3) Φ Once the parameters ˆΦ have been estimated from the data, one can sample the estimated target dis- tribution by sampling the base PDF and applying the generative map g. The normalizing direction f can instead be used to perform density evaluation by transforming the new data of interest into sam- ple generated by the base PDF, which is easier to evaluate. Beside being invertible, the map g should satisfy the following properties: • it should be sufficiently expressive to appropri- ately model the target distribution; 1Throughout the paper we always interpret X as the base distribution and Y as the target distribution, i.e. the data. We also always model flows in the generative direction, from base to data. • it should be computationally efficient, that means that both f (for training, that means computing the likelihood) and g (for generating samples), as well as their Jacobian determinants must be easily calculable. The composition of invertible bijective func- tions is also an invertible bijective function. Thus, g can be generalized to a set of N transforma- tions as g = gN ◦ gN −1 ◦ ...g1 with inverse f = f1 ◦ ...fN −1 ◦ fN and det Jf = (cid:81)N i=1 det Jfi, where each fi depends on a yi intermediate random vari- able. This is a standard strategy to increase the flexibility of the overall transformation. Typically, but not mandatorily, NF models are implemented using NNs to determine the param- eters of the bijectors. The optimal values are obtained by minimizing a loss function corre- sponding to minus the log-likelihood defined as in Eq. 2. This makes the models extremely flexible, with a usually stable training, at the cost of a potentially large number of parameters. Nonethe- less, the flow transformation must be carefully designed, for instance, even if a given map and its inverse, with their respective Jacobians, are computable, one direction might be more efficient than the other, leading to models that favor sam- pling over evaluation (and training) or vice-versa. Among the wide and growing variety of NF archi- tectures available, see Ref. [52] for an overview, we focus in this work on coupling [10] and autore- gressive flows [53], arguably the most widely used implementations of NFs, particularly in HEP. 2.1 Coupling flows Coupling flows, originally introduced in Ref. [10], are made of stacks of so-called coupling layers, in which a distribution with dimensionality D is partitioned in two parts A and B with dimension- alities d and D−d, respectively. The parameters of the bjiector transforming dimensions A are mod- eled by a NN that uses B as input; effectively constructing p(yd|xd−D) conditional probability distributions. At each coupling layer, different par- tition combinations are applied, such that the full distribution is properly transformed. In other words, starting from a disjoint par- tition of a random variable Y ∈ RD such that (yA, yB) ∈ Rd × RD−d and a bijector h( * ; θ) : Rd → Rd, a coupling layer maps g : X → Y as CONTENTS 5 follows yA = h(xA; Θ(xB)) , yB = xB , , (4) where the parameters θ are defined by a generic function Θ(xB) only defined on the RD−d parti- tion, generally modeled by a NN. The function Θ(xB) is called a conditioner, while the bijectors h and g are called coupling function and coupling flow, respectively. The necessary and sufficient condition for the coupling flow g to be invertible is that the coupling function h is invertible. In this case the inverse transformation is given by xA = h−1(yA; Θ(xB)) , xB = yB , (5) y1 = x1 , The resulting Jacobian of g is again a triangular matrix, whose determinant is easily computed as det Jg = D (cid:89) i=1 ∂hi ∂xi . (8) where ∂hi/∂xi are the diagonal terms of the Jacobian. Given the structure of the bijector similar to the coupling flow, also in this case the bijector is a referred to as a coupling function. Note that Θj can also be alternatively determined with the precedent untransformed dimensions of X [53], such that yi = h(xi; Θi(x1:i−1) , i = 2, . . . , D . (9) The choice of variables used to model the condi- tioner may depend on whether the NF is intended for sampling or density estimation. In the for- mer case, Θ is usually chosen to be modeled from the base variable X, so that the transformations in the generative direction would only require one forward pass through the flow. The trans- formations in the normalizing direction would instead require D iterations trough the autore- gressive architecture. This case is referred to as inverse autoregressive flow2 [53] and corresponds to the transformations in Eq. (9). Conversely, in the case of density estimation, it is convenient to parametrize the conditioner using the target vari- able Y , since transformations would be primarily in the normalizing direction. This case is referred to as direct autoregressive flow and corresponds to the transformations in Eq. (7). In any case, when training the NFs one always needs to per- form the normalizing transformations to estimate the log-likelihood of the data, as in Eq. 2. In our study, we only consider the direct autoregressive flow described by Eq. (7). 3 Architectures In the previous section we have described NFs, focusing on the two most common choices for The Jacobian of g is then a two block triangular matrix. For the dimensions {1 : d}, is given by the Jacobian of h, and for dimensions {d : D} is the identity matrix. Thus, the Jacobian determinant is just det Jg = d (cid:89) i=1 ∂hi ∂xA i . (6) Note that the choice of the partition is arbitrary. The most common choice is to split the dimensions in half, but other partitions are possible [52]. 2.2 Autoregressive flows Autoregressive flows, first introduced in Ref. [53], can be viewed as a generalization of coupling flows. Now, the transformations of each dimension i are modeled by an autoregressive DNN according to the previously transformed dimensions of the dis- tribution, resulting in the p(yi|y1:i−1) conditional probability distributions, where y1:i−1 is a short- hand notation to indicate the list of variables y1, . . . yi−1. After each autoregressive layer, the dimensions are permuted, to ensure the expressiv- ity of the bijections over the full dimensionality of the target distribution. Let us consider a bijector h( * ; θ) : R → R, parametrized by θ. We can define an autoregres- sive flow function g such that y1 = x1 , yi = h(xi; Θi(y1:i−1) , i = 2, . . . , D . (7) 2Notice that Ref. [52], parametrizing the flow in the normal- izing direction (the opposite of our choice), apparently uses the inverse of our formulas for direct and inverse flows. Our notation (and nomenclature) is consistent with Ref. [50]. 6 CONTENTS parametrizing the bijector g in terms of the cou- pling function h. The only missing ingredient to make NFs concrete, remains the explicit choice of h. For this study, we have chosen four of the most popular implementations of coupling and autoregressive flows: the Real-valued Non-Volume Preserving (RealNVP) [49], the Masked Autore- gressive Flow (MAF) [50], and the Coupling and Autoregressive Rational-Quadratic Neural Spline Flows (C-RQS and A-RQS) [51].3 We discuss them in turn in the following subsections and give addi- tional details about our specific implementation in Appendices A.1-A.4. 3.1 The RealNVP The RealNVP [49] is a type of coupling flow whose coupling functions h are affine functions with the following form: i = 1, . . . , d , yi = xi , yi = xiesi−d(x1:d) + ti−d(x1:d) , i = d + 1, . . . , D , (10) where the s and t functions, defined on Rd → RD−d, respectively correspond to the scale and translation transformations modeled by NNs. The product in Eq. (10) is intended elementwise for each i so that, xd+1 is multiplied by s1, xd+2 by s2, and so on, up to xD, which is multiplied by sD−d. The Jacobian of this transformation is a triangular matrix with diagonal diag(Id, diag(exp(si(x1:d)))) with i = d + 1, . . . , D, so that its determinant is independent of t and simply given by det J = D−d (cid:89) i=1 esi(x1:d) = exp (cid:33) s(x1:d) . (11) (cid:32)D−d (cid:88) i=1 i = 1, . . . , d , xi = yi , xi = (yi − ti−d(y1:d)) e−si−d(y1:d) , i = d + 1, . . . , D . (12) A crucial property of the affine transformation (10) is that its inverse (12) is again an affine trans- formation depending only on s and t, and not on 3Reference [51] refers to coupling and autoregressive RQS flows as RQ-NSF (C) and RQ-NSF (AR), where RQ-NSF stands for Rational-Quadratic Neural Spline Flows, and A and C for autoregressive and coupling, respectively. their inverse. This implies that the s and t func- tions can be arbitrarily complex (indeed they are parametrized by a DNN), still leaving the Real- NVP equally efficient in the forward (generative) and backward (normalizing) directions. 3.2 The MAF The MAF algorithm was developed starting from the Masked Autoencoder for Distribution Esti- mation (MADE) [54] approach for implementing an autoregressive Neural Network through layers masking (see Appendix A.2). In the original MAF implementation [50], the bijectors are again affine functions described as y1 = x1 , yi = xiesi−1(y1:i−1) + ti−1(y1:i−1) , i = 2, . . . , D . (13) The functions s and t are now defined on RD−1 → RD−1. The determinant of the Jacobian is simply det J = D−1 (cid:89) i=1 esi(y1:i) = exp (cid:33) si(y1:i) (14) (cid:32)D−1 (cid:88) i=1 and the inverse transformation is x1 = y1 , xi = (yi − ti−1(y1:i−1)) e−si−1(y1:i−1) , i = 2, . . . , D . (15) As in the case of the RealNVP, the affine transfor- mation guarantees that the inverse transformation only depends on s and t and not on their inverse, allowing for the choice of arbitrarily complex func- tions without affecting computational efficiency. 3.3 The RQS bijector The bijectors in a coupling or masked autoregres- sive flow are not restricted to affine functions. It is possible to implement more expressive trans- formations as long as they remain invertible and computationally efficient. This is the case of the so-called Rational-Quadratic Neural Spline Flows [51]. The spline bijectors are made of K bins, where in each bin one defines a monotonically- increasing rational-quadratic function. The bin- ning is defined on an interval B = [−B, B], outside of which the function is set to the identity transformation. The bins are defined by a set of CONTENTS 7 i )}K , y(k) i K + 1 coordinates {(x(k) k=0, called knots, monotonically increasing between {(x(0) ) = (−B, −B) to {(x(K) ) = (B, B). We use the bracket index notation to denote knots coordi- nates, which are defined for each dimension of the vectors xi and yi. It is possible to construct a rational-quadratic spline bijector with the desired properties with the following procedure [55]. , y(K) i , y(0) i i i Let us define the quantities i = x(k+1) h(k) i = (y(k+1) ∆(k) − x(k) i − y(k) i , i i (16) )/h(k) i . i Obviously, ∆(k) represents the variation of yi with respect to the variation of xi within the k-th bin. Moreover, since we assumed monotonically increasing coordinates, ∆(k) is always positive or zero. We are interested in defining a bijec- tor g(xi), mapping the B interval to itself, such that g(x(k) i = i /dx(k) dy(k) ) = y(k) satisfying the conditions , and with derivatives d(k) i i i i The ratio in Eq. (19) can then be written in the simplified form yi = y(k) i + (y(k+1) − y(k) i i i + (d(k+1) ∆(k) )(∆(k) i + d(k) i θ2 i − 2∆(k) + d(k) i θi(1 − θi)) )θi(1 − θi) i i . (21) The Jacobian Jg = ∂yi/∂xj is then diagonal, with entries given by (∆(k) i (1 − θi)2) )2(d(k+1) i i + (d(k+1) (∆(k) i + 2∆(k) θ2 + d(k) i θi(1 − θi) + d(k) i − 2∆(k) )θi(1 − θi))2 (22) for i = 1, . . . , D. The inverse of the transformation (19) can also be easily computed by solving the quadratic Eq. (19) with respect to xi. , i i i i )}K , y(k) i i }K−1 In practice, B and K are fixed variables (hyperparameters), while {(x(k) k=0 and {d(k) k=1 are 2(K + 1) plus K − 1 parameters, modeled by a NN, which determine the shape of the spline function. The different implementations of the RQS bijector, in the context of coupling and autoregressive flows, are determined by the way in which such parameters are computed. We briefly describe them in turn in the following two subsections. In the coupling flow case (C-RQS), one performs the usual partitioning of the D dimensions in the two sets composed of the first d and last D − d dimensions. The first d dimensions are then kept unchanged yi = xi for i = 1, . . . , d, while the parameters describing the RQS transformations of the other D − d dimensions are determined from the inputs of the first d dimensions, denoted by x1:d. Schematically, we could write (x1:d) , (x1:d) , (23) i x(k) i = x(k) i = y(k) y(k) i = d(k) d(k) i i (x1:d) , for i = d + 1, . . . , D. A schematic description of our implementation of the C-RQS is given in Appendix A.3. i = d(k+1) d(k) i , d(k+1) d(k) i i > 0 = 0 for ∆(k) i = 0 , for ∆(k) i > 0 , (17) 3.4 The C-RQS necessary, and also sufficient, in the case of a rational quadratic function, to ensure monotonic- ity [55]. Moreover, for the boundary knots, we set i = d(K) d(0) = 1 to match the linear behavior outside the B interval. For xi ∈ [x(k) ] we define , x(k+1) i i i θi = (xi − x(k) i )/h(k) i , (18) such that θi ∈ [0, 1]. Then, for xi in each of the intervals [x(k) ] with k = 0, . . . , K − 1, we define , x(k+1) i i (19) (θi)/Q(k) yi = P (k) i with the functions P and Q defined by P (k) i (θi) = ∆(k) i y(k+1) (θi) , i i +(y(k) i y(k) i + ∆(k) θ2 i d(k) i d(k+1) + y(k+1) i i i + (d(k+1) i − 2∆(k) + d(k) i i i Q(k) i (θi) = ∆(k) (1 − θi)2 )θi(1 − θi) , )θi(1 − θi) . (20) 3.5 The A-RQS The RQS version of the MAF, that we call A-RQS, is instead obtained leaving unchanged the first 8 CONTENTS dimension y1 = x1 and determining the param- eters of the transformation of the i-th dimen- sion from the output of all preceding dimensions, denoted by y1:i−1. Schematically, this is given by i i = x(k) x(k) y(k) i = y(k) i = d(k) d(k) i i (y1:i−1) , (y1:i−1) , (24) (y1:i−1) , for i = 2, . . . , D. 4 Non-parametric quality metrics We evaluate the performances of the different algorithms in terms of a few figures of merit: median of p-values of 1D Kolmogorov-Smirnov (KS) tests, median of 1D Wasserstein distances (W-distance), and Frobenius norm (F-norm) of the difference of the correlation matrices. Before describing these metrics in details, we stress that, while the median p-value of the 1D KS-tests has a clear statistical interpretation in terms hypoth- esis testing, and therefore allows to quantify the performances of a given model, the W-distance and the F-norm are distance measures, and can- not be interpreted as statistical tests.4 Therefore, these metrics only allow one to compare models with each others and to conclude when a model "is better" than another one, but do not allow one to draw conclusions on how "good" a model is or how much a model is better than another one. • The Kolmogorov-Smirnov test is a statisti- cal test used to determine whether or not two 1D samples come from the same unknown PDF. The null hypothesis assumes that both samples come from the same PDF. The KS statistic is given by Dy,z = supx | Fy(x) − Fz(x) | (25) rejecting the null-hypothesis is obtained as the maximal p satisfying the condition (cid:115) Dy,z > −ln( p 2 ) * 1 + nz ny 2nz , (26) where ny and nz are the sizes of the two samples. For characterizing the performances of our results, we compute the mean of the KS-test p-values obtained comparing several pairs of sub-samples of each 1D marginal distribution obtained from the test and NF generated sam- ples. Then, we compute the median of the result for each dimension over all dimensions. Since, under the null hypothesis, the p-value is a random variable with a uniform distribu- interval, and its mean and tion in the [0, 1] median are therefore equal to 0.5, which repre- sents the optimal value for our test. We choose the median in place of the mean over dimensions to avoid, especially for very large dimension- ality, that a few badly-performing dimensions could deliver a very small mean, leading to a too pessimistic interpretation of the performances. Nevertheless, we always also compute the mean over dimensions and observe good agreement with the median, signaling that, on average, all dimensions are learned "equally well". • The Wasserstein distance between two 1D distributions is given as a function of their respective empirical distributions as Wy,z = (cid:90) R dx | Fy(x) − Fz(x) | . (27) Again, we compute the measure for each dimen- sion and take the median over all dimensions and use it as our metric, whose optimal value is zero. In the following we refer to this metric simply as W-distance. • The Frobenius norm of a matrix M is given where Fy,z(x) are the empirical distributions of each of the samples {yi} and {zi}, and sup is the supremum function. The p-value for by M F = (cid:115)(cid:88) i,j | mij |2, (28) 4One could obviously define a test statistic based on these distances. However, the test statistic distribution would not be known a priori and hypothesis testing would require to perform pseudo-experiments. This is beyond the scope of our analysis. where mij are the elements of M . By defining M = Cy − Cz, where Cy,z are the correlation matrices of two distributions Y and Z of equal CONTENTS 9 dimensionality, we obtain a metric of the dis- crepancy between the correlation matrices of the two as M F = (cid:115)(cid:88) i,j | yij − zij |2, (29) where yij and zij are the elements of Cy and Cz, respectively. Notice that, since the F-norm tends to become larger as the size of the matrix increases, this metric, differently from the previous ones, depends on the dimension- ality. Nonetheless, the optimal value is always zero. 5 Testing the Normalizing Flows We tested the four architectures discussed above on three classes of toy distributions of various dimensionality: Correlated Mixture of Gaussians (CMoG), extremely multi-modal Correlated Mix- ture of Gaussians (CMoGem), and Truncated Distributions (TD). We describe them in turn in the following subsections. In all cases we consider a training sample size of 105 with 70% used as training data and 30% used as validation data. The test sample size is always 105. 5.1 Correlated Mixture of Gaussians Our CMoG distributions are defined as fol- lows: we take a mixture of n = 3 components N = 4, 8, 16, 32, 64, 100, 200, 400, 1000 dimen- sional multivariate Gaussian distributions with diagonal covariance matrices, defined by means randomly generated in the [0, 10] interval and standard deviations randomly generated in the [0, 1] interval5. The components are mixed accord- ing to an n dimensional categorical distribution (with random probabilities). This means that a different probability is assigned to each com- ponent, while different dimensions of the same component multivariate Gaussian are assigned the 5The values for the means and standard deviations are chosen so that the different components can generally be resolved. same probability. The resulting multivariate dis- tribution has random (order one) off-diagonal ele- ments in the covariance matrix and multi-modal 1D marginal distributions. For each of the four different algorithms described above and for each value of N we perform a small scan over some of the free hyper- parameters. Details on the choice of the hyperpa- rameters are reported in Appendix B. All models have been trained on Tesla V100 Nvidia GPUs. The performances of the best NF models for the CMoG distributions are reported in Fig. 1 and Table 2. The figure shows the median 1D W-distance (upper-left), the median KS-test p- value (upper-right), the Frobenius norm (lower- left), and the training time (lower-right).6 The best models are chosen as those with the mini- mal median 1D W-distance. One could define the best models differently, for instance considering the median KS-test p-values, but the conclusions do not change substantially, since all metrics are rather correlated. From Fig. 1 we immediately notice that the C-RQS algorithm does not converge above 100 dimensions, while the best compromise between low 1D W-distance, large median KS-test p-value, and small training time, is given by the A-RQS algorithm. Nevertheless, we see that for all points in the plots but the MAF in 1000 dimensions, the median KS-test p-values are above 0.2, which, considering the small training set size, can be con- sidered a good result. Also training times are good, almost constant with respect to dimensionality (suggesting that they depend more on the training sample size than on the dimensionality of the tar- get distribution), being often below one hour and never above a few hours. To give a pictorial idea of the A-RQS performances, in Fig. 4 we show the 1D and 2D marginal distributions for the N = 1000 dimensional CMoG for a selection of dimensions. This model produced a median KS-test p-value of 0.51 training with only 105 points for about 4 hours. Another example of the A-RQS perfor- mances is given by the best model in N = 200 dimensions, where we obtained a median KS-test p-value of 0.52 training for less than half an hour. 6There is a certain degree of uncertainty in the mentioned training times, which are slightly conservative. We had at our disposal two Tesla V100 GPUs and all models have been trained in pairs. This slightly decreased the performances of each single training, but improved the overall training time. 10 CONTENTS Fig. 1 Performance comparison between the best models obtained with RealNVP, MAF, C-RQS, and A-RQS architectures when learning the CMoG distributions, measured by the median 1D W-distance (upper-left), the median p-value of 1D KS-tests (upper-right), the F-norm of the difference between the correlation matrices (lower-left), and the training time (lower-right). 5.2 Extremely multi-modal CMoG To push even further the complication of the tar- get distribution, we generalized the CMoG to n = 10 components, where each component cannot be generally resolved anymore. We call this extremely multi-modal generalization CMoGem. We limited to 10 components to avoid data to look just as ran- dom noise. In this case we did not repeat the entire hyperparameters scan performed for the CMoG, but directly focused on the hyperparameters that ended up as best choices in the CMoG case. This also gives an idea of the generalization capabil- ities of the various algorithms. We also limited to N ≤ 400 dimensions, since training became unstable for N = 1000 dimensions. Results are shown in Fig. 2 and Table 3 and are similar to those of the CMoG case: the C-RQS algorithm does not converge above 100 dimen- sions and turns out to be the slowest algorithm. MAF and RealNVP generally perform well, with a slight preference for the MAF, which is also faster. The A-RQS algorithm performs well up to 100 dimensions, but performances deprecate for larger dimensionality. This also happens for MAF and RealNVP, even though in a less dramatic way. In order to check if the architecture for the A-RQS was too simple to generalize to the CMoGem case, we made two additional runs for the A-RQS with three layers with 512 nodes and 16 and 32 spline knots. The best models arising from this last run are shown in the figure as A-RQS 2 (dashed line). The improvement in performances, especially for 481632641002004001000Number of dimensions102101Median 1D Wasserstain distanceBest Models for Correlated Mixture of GaussiansRealNVPMAFC-RQSA-RQS481632641002004001000Number of dimensions0.10.20.30.40.50.6Median p-value of 1D KS-testsBest Models for Correlated Mixture of GaussiansRealNVPMAFC-RQSA-RQS481632641002004001000Number of dimensions102101100101F-norm of difference of correlation matricesBest Models for Correlated Mixture of GaussiansRealNVPMAFC-RQSA-RQS481632641002004001000Number of dimensions103104Training time (s)Best Models for Correlated Mixture of GaussiansRealNVPMAFC-RQSA-RQS CONTENTS 11 Fig. 2 Performance comparison between the best models obtained with RealNVP, MAF, C-RQS and A-RQS architectures when learning the CMoGem distributions, measured by the median 1D W-distance (upper-left), the median p-value of 1D KS-tests (upper-right), the F-norm of the difference between the correlation matrices (lower-left), and the training time (lower-right). large dimensionality, is evident, and even more evident is the improvement in the training time, due to the smaller number of epochs needed for reaching the required convergence. Nevertheless, the MAF seems to be more stable in this case for dimensionality higher than 100 and still provides good training times. For comparison, also in this case we show, in Figure 5 the 1D and 2D marginal distributions for the N = 200 dimensional CMo- Gem for a selection of dimensions obtained with the best A-RQS 2 model. This model produced a median KS-test p-value of 0.35 training with only 105 points for about 22 minutes. 5.3 Truncated Gaussians Normalizing Flows deliver, by construction, con- tinuous distributions. In physics, it often happens to have distributions that are truncated, because of some kinematical or theoretical limit. It is there- fore interesting to study how well our NF archi- tectures can describe this type of distributions. To do so, we considered a class of distributions, that we call Truncated Gaussians (TG). For this case we consider dimensionalities up to N = 100 and mix uni-modal Gaussian distributions defined by means randomly generated in the [0, 10] inter- val, standard deviations randomly generated in the [0, 1] interval, and truncation implemented as follows: for each dimension we choose randomly between low, high, or two-side truncation and truncate on the mean for the first two cases and 48163264100200400Number of dimensions102101Median 1D Wasserstain distanceBest Models for Extremely Multimodal CMoGRealNVPMAFC-RQSA-RQSA-RQS 248163264100200400Number of dimensions101Median p-value of 1D KS-testsBest Models for Extremely Multimodal CMoGRealNVPMAFC-RQSA-RQSA-RQS 248163264100200400Number of dimensions102101100101F-norm of difference of correlation matricesBest Models for Extremely Multimodal CMoGRealNVPMAFC-RQSA-RQSA-RQS 248163264100200400Number of dimensions103104Training time (s)Best Models for Extremely Multimodal CMoGRealNVPMAFC-RQSA-RQSA-RQS 2 12 CONTENTS Fig. 3 Performance comparison between the best models obtained with RealNVP, MAF, C-RQS and A-RQS architectures when learning the TG distributions, measured by the median 1D W-distance (upper-left), the median p-value of 1D KS-tests (upper-right), the F-norm of the difference between the correlation matrices (lower-left), and the training time (lower-right). between the mean minus one standard deviation and the mean plus one standard deviation for the last case. The resulting multivariate distribution is uncorrelated, i.e. has negligible off-diagonal terms in the correlation matrix. Since our NF distributions are always defined over infinite continuous ranges, we transformed them with a soft clipping bijector with hinge 10−4 after training to ensure definite boundaries.7 A poorly modeled distribution beyond the bound- aries would present large spikes at such limits after clipping. As before, a small hyperparameter scan 7The hinge represents the "smoothness" of the trunca- in the clipping bijector, as a tion, which is implemented, differentiable function. was performed to train the NFs. The hyperparam- eter space is the same as in the CMoG, and is shown in Table 1. The best-performance configurations along with their corresponding metrics results for each flow architecture are shown in Fig. 3 and Table 4. Results are similar to those obtained for CMoG and CMoGem, with the exception of C- RQS, which remains the slowest architecture, but features better performances. Again the A-RQS proves to be the best choice in terms of both precision, timing, and scalability. For a visual rep- resentation of the performances we show, in Figure 6, the 1D and 2D marginal distributions for the N = 100 dimensional TG distribution for a selec- tion of dimensions obtained with the best A-RQS model. This model produced a median KS-test p- value of about 0.5 training with only 105 points for 48163264100Number of dimensions103102Median 1D Wasserstain distanceBest Models for Truncated GaussiansRealNVPMAFC-RQSA-RQS48163264100Number of dimensions102101Median p-value of 1D KS-testsBest Models for Truncated GaussiansRealNVPMAFC-RQSA-RQS48163264100Number of dimensions102101100F-norm of difference of correlation matricesBest Models for Truncated GaussiansRealNVPMAFC-RQSA-RQS48163264100Number of dimensions102103104105Training time (s)Best Models for Truncated GaussiansRealNVPMAFC-RQSA-RQS CONTENTS 13 about 35 minutes. From the 1D marginal distri- butions in Fig. 6 one notices that, for a couple of dimensions, the NF tends to interpret as bi-modal the uni-modal distributions. While precision is very high in average, we believe that more preci- sion in each of the dimensions may require more training points or a more fine-tuned model. As a final remark, we would like to stress that performances of the architectures considered in this paper are expected to be sub-optimal when applied to fully uncorrelated distributions: cou- pling and autoregressive flows use information from some dimensions to learn others and when dimensions are uncorrelated obtaining good accu- racies is more challenging. This is also confirmed by other experiments we performed with uncorre- lated mixtures of Gaussians, which systematically resulted in poorer results than those obtained with CMoG of the same dimensionality. We believe that in case of uncorrelated distributions, other approaches need to be employed. Nevertheless, we do not consider fully uncorrelated distributions as a realistic example of HEP distributions since in those cases, at least for subsets of the dimensions, correlations are to be expected. 6 Conclusions and Outlook Normalizing Flows have many potential appli- cations in HEP, both in their normalizing and generative directions. However, to ensure a stan- dardized usage and to match the required preci- sion, their application to high-dimension datasets need to be properly evaluated. This paper makes a step forward in this direction by quantifying the ability of state-of-the-art coupling and autore- gressive flow architectures to model distributions of increasing complexity and dimensionality. This was done by testing the most widely used brand of NFs in HEP, the coupling (RealNVP and C-RQS) and the autoregressive flows (MAF and A-RQS), against several classes of generic distributions. Performances were measured by means of different metrics and by considering the training times. As the main highlight, we found that the A-RQS is greatly capable of precisely learning all the high- dimensional complex distributions it was tested against, always within a few hours of training on a Tesla V100 GPU and with limited training data. As of the other tested architectures, our results show that reasonably good results can be obtained with all of them but the C-RQS, which ended up being less stable and longer to train, especially in high dimensionality. Our analysis was performed implementing all architectures in TensorFlow2 with Tensor- Flow Probability using Python. The code is available in Ref. [56], while a general-purpose user- friendly framework for NFs in TensorFlow2 named NF4HEP is under development and can be found in Ref. [57]. We stress that the intention of this study is to secure generic assessments of how NFs per- form in high dimensions. For this reason the target distributions were chosen independently of any particular experimentally-driven physics dataset. Nonetheless, this study represents the first of a series to come. Let us briefly mention, in turn, the research directions we aim to follow starting from the present paper. • Development of reliable multivariate quality metrics, including approaches based on machine learning [58, 59]. New results [60–62] suggests that classifier-based two-sample tests have the potential to match the needs of the HEP com- munity when paired with a careful statistical analysis. These tests can leverage different ML models to provide high flexibility and sensitiv- ity together with short training times, especially when based on kernel methods [62]. On the other hand, further studies are needed to inves- tigate their efficiency and scalability to high dimensions. • Study of the dependence of the NF perfor- mances on the number of samples [63]. In the present paper we always kept the number of samples to 105 (70% used for training and 30% used for validation). It is clear that such number is pretty large in small dimensionality, like N = 4 dimensions, and undersized for large dimen- sionality, like N ≥ 100. It is important to study the performances of the considered NF archi- tectures in the case of scarce or very abundant data, assessing the dependency of the final pre- cision on the number of training samples. This can also be related to developing techniques to infer the uncertainty of the NF models. • An open question, particularly important for HEP applications, is whether generative mod- els can be used for statistical augmentation, i.e. to generate more samples than those used for 14 CONTENTS training to reduce statistical uncertainty, or if uncertainty is dominated by the training sample size. Normalizing Flows, being semi-analytical generative models based on bijective maps, may be a good candidate class of models to assess the statistical augmentation properties. Indeed this essentially depends on how well the gener- ative model learns the proper target distribu- tion parameters: when the target distribution is learned parametrically, it is not unreason- able to expect good statistical augmentation performances. Nevertheless, in case statistical augmentation would prove to be poor in the generative direction, one could still use NF in the normalizing direction to build effective pri- ors and proposals to enhance known sampling techniques, such as Markov Chain Monte Carlo, whose statistical properties are well known. • Applications of the architectures and imple- mentations developed in this project to real- data HEP cases are already under investigation. In a forthcoming publication we show how a O(100) dimensional experimental likelihood, arising from HEP global fits, can be efficiently learned by NFs. • A final issue that needs to be addressed to ensure a widespread use of NFs in HEP is the ability to preserve and distribute pre-trained NF-based models. This is, for the time being, not an easy and standard task and support from the relevant software developer community will have to come to achieve this goal. A Implementation of NF architectures A.1 The RealNVP 1, . . . , yI D/2+1, . . . , yI We are given a collection of vectors {yI i } with i = 1, . . . , D representing the dimensionality and I = 1, . . . , N the number of samples representing the unknown PDF pY . For all samples yI we con- sider the half partitioning given by the two sets D/2} and ̃yI = {yI ˆyI = {yI D}. We then use the ˆyI samples as inputs to train a fully connected MLP (a dense DNN) giving as out- put the vectors of ti and si, with i = 1, . . . , D/2 in Eq. (10). These output vectors are provided by the DNN through two output layers, which are dense layers with linear and tanh activation functions for ti and si, respectively, and are used to implement the transformation in Eq. (12), which outputs the (inversely) transformed samples. Moreover, in order to transform all dimensions and to increase the expressivity of the model, we use a series of such RealNVP bijectors, feeding the output of each bijector as input for the next one, and invert- ing the role of the two partitions at each step. After the full transformation is performed, one obtains the final {xI i } with i = 1, . . . , D vectors and the transformation Jacobian (the product of the inverse of Eq. (11) for each bijector). With these ingredients, and assuming a normal base dis- tribution pX , one can compute the negative of the log-Likelihood of Eq. (2), which is used as loss function for the DNN optimization. Acknowledgments We thank Luca Silvestrini for pushing us towards the study of NFs and for fruitful discussions. We are thankful to the developers of TensorFlow2, which made possible to perform this analysis. We thank the IT team of INFN Genova, and in particular Mirko Corosu, for useful support. We are thankful to OpenAI for the development of ChatGPT and to ChatGPT itself for useful dis- cussions. H.R.G. acknowledges the hospitality of Sabine Kraml at LPSC Grenoble and the discus- sions on Normalizing Flows held there with the rest of the SModelS Collaboration. This work was partially supported by the Italian PRIN grant 20172LNEEZ. M.L. acknowledges the financial support of the European Research Council (grant SLING 819789). As it is clear from the implementation, the RealNVP Normalizing Flow, i.e. the series of RealNVP bijectors, is trained in the normalizing direction, taking data samples as inputs. Never- theless, since the si and ti vectors only depend, at each step, on untransformed dimensions, once the DNN is trained, they can be used both to compute the density, by using Eq. (12) and to generate new samples, with equal efficiency, by using Eq. (10). This shows that the RealNVP is equally efficient in both the normalizing and generative directions. A.2 The MAF As in the case of the RealNVP, also for the MAF, the forward direction represents the normalizing direction. In this case the vectors si and ti, of dimension D − 1 describing the affine bijector CONTENTS 15 in Eq. (13) are parametrized by an autoregres- sive DNN with D inputs and 2(D − 1) outputs, implemented through the MADE [54] masking procedure, according to the TensorFlow Probabil- ity implementation (see [64]). The procedure is based on binary mask matrices defining which con- nections (weights) are kept and which are dropped to ensure the autoregressive property.8 Mask matrices are determined from numbers (degrees) assigned to all nodes in the DNN: each node in the input layer is numbered sequentially from 1 to D; each node in each hidden layer is assigned a num- ber between 1 and D, possibly with repetition; the first half output nodes (representing si) are num- bered sequentially from 1 to D−1 and the same for the second half (representing ti). Once all degrees are assigned, the matrix elements of the mask matrices are 1 if two nodes are connected and 0 if they are "masked", i.e. not connected. The mask matrices are determined connecting the nodes of each layer with index k with all nodes in the pre- ceding layer having an index smaller or equal than k. As for the RealNVP, a series of MAF bijec- tors is used, by feeding each with the {xI i }, with i = 1, . . . , D, according to Eq. (15) computed from the previous one. The last bijector computes the final {xI i }, with i = 1, . . . , D, according to Eq. (15) and the transformation Jacobian (the product of the inverse of Eq. (14) for each bijector), used to compute and optimize the log-Likelihood as defined in Eq. (2). The efficiency of the MAF in the normalizing and generative directions is not the same, as in the case of the RealNVP. Indeed, computing the log-Likelihood for density estimation, requires a single forward pass of {yi} through the NF. How- ever, generating samples requires to start from {xi}, randomly generated from the base distribu- tion. Then one needs the following procedure to compute the corresponding {yi}: • define the first component of the required yinput i is the NF = x1 where yinput = yinput 1 i as youtput 1 input; • start with a yinput i NF to determine youtput 2 = xi and pass it through the as function of youtput ; 1 8The binary mask matrices are simple transition matrices between pairs of layers of dimension (K(cid:48), K) with K(cid:48) the num- ber of nodes in the forward layer (closer to the output) and K the number of nodes in the backward layer (closer to the input). Obviously K = D for the input layer and K(cid:48) = D for the output layer. i • update yinput with yinput = youtput 2 through the NF to determine youtput of youtput 1 and youtput 2 • iterate until all the youtput 2 3 ; i computed. and pass as function components are It is clear to see that the procedure requires D passes through the NF to generate a sample, so that generation in the MAF is D times less efficient than density estimation. The Inverse Autoregres- sive Flow (IAF) [53] is an implementation similar to the MAF that implements generation in the for- ward direction (obtained by exchanging x and y in Eq.s (13) and (15). In the case of IAF, computing the log-Likelihood (which is needed for training) requires D steps, while generation only requires a single pass through the flow. The IAF is therefore much slower to train and much faster to generate new samples. A.3 The C-RQS The C-RQS parameters are determined by the following procedure [51]. 1. A dense DNN takes x1, . . . , xd as inputs, and outputs an unconstrained parameter vector θi of length 3K − 1 for each i = d + 1, . . . , D dimension. 2. The vector θi is partitioned as θi = [θw i , θh i have length K, while θd i , θd i ], i has i and θh where θw length K − 1; 3. The vectors θw i and θh i are each passed through a softmax and multiplied by 2B; the outputs are interpreted as the widths and heights of the K bins, which must be positive and span the B interval. Then, the cumulative sums of the K bin widths and heights, each start- ing at −B, yield the K + 1 knots parameters {(x(k) i k=0; i is passed through a softplus func- tion and is interpreted as the values of the derivatives {d(k) k=1 at the internal knots. i }K−1 , y(k) i )}K 4. The vector θd As for the RealNVP, in order to transform all dimensions, a series of RQS bijectors is applied, inverting the role of the two partitions at each step. 16 CONTENTS Hyperparameters for the MoG models Hyperpar. MAF RealNVP A-RQS C-RQS number of bijectors number of hidden layers 5, 10 5, 10 2 5, 10 3 × 128 3 × 256 3 × 128 3 × 256 3 × 128 3 × 256 3 × 128 3 × 256 3 × 512 number of spline knots total number of runs – 4 – 4 8, 12 8, 12 4 12 Table 1 Hyperparameter values used in our analysis. A.4 The A-RQS In the autoregressive implementation, we follow the same procedure used in the MAF implemen- tation and described in Section A.2, but instead of obtaining the 2(D − 1) outputs determining the affine parameters, we obtain the 3K − 1 param- eters needed to compute the values of the knots parameters and derivatives. Once these are deter- mined the procedure follows the steps 2 to 4 of the C-RQS implementation described in the previous subsection. B Hyperparameters For all models we used a total of 105 train- ing (70% used for actual training and 30% used for validation) and 105 test points. We employed ReLu activation function with no regularization. All models were trained for up to 1000 epochs with initial learning rate set to 10−3. The learn- ing rate was reduced by a factor of 0.2 after 50 epochs without improvement better than 10−4 on the validation loss. Early stopping was used to terminate the learning after 60 epochs without the same amount of improvement. The batch size was set to 256 for RealNVP and to 512 for the other algorithms. For the two neural spline algo- rithms we also set the range of the spline equal to [−16, 16]. All other relevant hyperparameters, with their multiple values when they are scanned over, are reported in Table 1. C Correlated mixture of Gaussians CONTENTS 17 hidden layers # of bijec. algorithm spline knots batch Median Median size W-distance KS-test Frobenius Norm # of epochs training time (s) Best models for CMoG 4D 3 × 128 3 × 256 3 × 128 3 × 128 8D 3 × 128 3 × 128 3 × 128 3 × 128 16D 3 × 128 3 × 128 3 × 128 3 × 128 32D 3 × 256 3 × 128 3 × 128 3 × 128 64D 3 × 128 3 × 128 3 × 128 3 × 128 100D 3 × 128 3 × 256 3 × 256 3 × 512 200D 3 × 128 3 × 256 3 × 128 400D 3 × 128 3 × 128 3 × 256 1000D 3 × 128 3 × 128 3 × 128 C-RQS A-RQS RealNVP 5 2 5 5 MAF RealNVP 5 5 MAF 5 2 C-RQS A-RQS 2 A-RQS 10 MAF 10 5 RealNVP C-RQS 5 MAF 2 5 5 A-RQS RealNVP C-RQS A-RQS RealNVP 2 5 5 MAF 5 C-RQS 5 2 RealNVP A-RQS 10 MAF 5 C-RQS 2 10 A-RQS RealNVP 5 MAF A-RQS 2 5 MAF 10 RealNVP 2 10 A-RQS RealNVP 5 MAF 8 12 – – – – 12 12 8 – – 8 – 8 – 12 8 – – 12 – 12 – 8 12 – 8 8 – – 8 – – 512 512 256 512 256 512 512 512 512 512 256 512 512 512 256 512 512 256 512 512 256 512 512 512 1.18e-02 1.49e-02 1.82e-02 2.25e-02 5.24e-01 4.71e-01 4.54e-01 4.59e-01 1.17e-02 2.10e-02 1.66e-02 3.05e-02 1.87e-02 1.92e-02 2.00e-02 2.36e-02 4.93e-01 5.01e-01 4.92e-01 5.25e-01 4.59e-02 4.69e-02 4.83e-02 3.78e-02 8.82e-03 2.34e-02 2.71e-02 3.06e-02 5.08e-01 4.53e-01 3.85e-01 3.59e-01 8.98e-02 2.49e-01 5.30e-01 2.09e-01 1.74e-02 2.05e-02 2.39e-02 4.12e-02 5.01e-01 4.69e-01 4.71e-01 3.31e-01 1.16e-01 2.12e-01 1.99e-01 4.65e-01 1.75e-02 1.88e-02 3.07e-02 4.97e-02 4.61e-01 4.43e-01 5.04e-01 4.40e-01 2.70e-01 3.00e-01 2.41e-01 6.25e-01 4.22e-02 4.24e-02 5.70e-02 8.85e-02 4.48e-01 4.80e-01 3.84e-01 2.47e-01 5.87e-01 1.47e+00 7.96e-01 1.62e+00 512 256 512 1.93e-02 3.53e-02 6.74e-02 5.22e-01 5.30e-01 4.48e-01 9.35e-01 2.09e+00 3.12e+00 512 512 256 2.35e-02 5.16e-02 1.08e-01 4.75e-01 4.67e-01 2.63e-01 8.43e+00 1.30e+01 4.48e+01 310 237 268 323 325 327 198 190 184 153 147 148 176 220 207 142 189 245 317 249 429 149 141 148 263 548 484 313 365 163 8690 1297 1424 745 1735 752 5022 1017 980 1203 1403 2937 493 1148 1104 3606 999 1175 903 6506 2414 911 692 3317 1554 6051 1258 2518 1447 1833 512 256 512 3.38e-02 7.67e-02 3.96e-01 5.14e-01 3.54e-01 3.02e-05 6.04e+00 1.34e+01 5.67e+01 1000 592 133 15493 8504 502 Table 2 Values of the most relevant hyperparameters and metrics for the best models in the case of the CMoG distributions. The number of training epochs and the training time are also shown, giving an idea of how much each model needs to be trained. 18 CONTENTS D Extremely multimodal correlated mixture of Gaussians hidden layers # of bijec. algorithm spline knots batch Median size W-distance Median KS-test Frobenius Norm # of epochs training time (s) Best models for CMoGem 4D 3 × 128 3 × 512 3 × 256 3 × 128 3 × 128 8D 3 × 128 3 × 128 3 × 128 3 × 128 3 × 512 16D 3 × 128 3 × 512 3 × 256 3 × 128 3 × 128 32D 3 × 256 3 × 128 3 × 512 3 × 128 3 × 128 64D 3 × 128 3 × 512 3 × 128 3 × 128 3 × 128 100D 3 × 512 3 × 256 3 × 256 3 × 128 3 × 512 200D 3 × 512 3 × 256 3 × 128 3 × 128 400D 3 × 128 3 × 512 3 × 256 3 × 128 C-RQS A-RQS2 A-RQS 5 2 2 5 MAF 5 RealNVP A-RQS C-RQS 2 5 5 MAF 5 2 RealNVP A-RQS2 2 2 A-RQS A-RQS2 10 MAF 10 5 RealNVP C-RQS 5 MAF 2 2 5 5 A-RQS A-RQS2 RealNVP C-RQS RealNVP A-RQS2 C-RQS A-RQS 5 2 5 2 5 MAF 2 2 A-RQS2 A-RQS 10 MAF 5 5 RealNVP C-RQS 2 10 A-RQS2 RealNVP 5 MAF 2 A-RQS 5 MAF 2 10 2 A-RQS2 RealNVP A-RQS 8 64 12 – – 12 12 – – 64 8 32 – – 8 – 8 64 – 12 – 64 12 8 – 32 12 – – 8 64 – – 12 – 32 – 8 512 512 512 512 256 512 512 512 256 512 512 512 512 256 512 512 512 512 256 512 256 512 512 512 512 512 512 512 256 512 512 256 512 512 512 512 256 512 2.32e-02 2.76e-02 3.34e-02 4.01e-02 5.54e-02 2.49e-02 3.83e-02 4.51e-02 4.67e-02 5.54e-02 3.66e-02 4.04e-02 4.65e-02 4.99e-02 7.11e-02 4.00e-02 4.03e-02 4.50e-02 7.90e-02 8.75e-02 5.13e-02 5.96e-02 9.23e-02 9.91e-02 1.29e-01 5.26e-02 7.32e-02 9.64e-02 2.08e-01 2.17e-01 5.42e-01 4.86e-01 4.85e-01 5.51e-01 4.13e-01 2.08e-02 1.24e-02 3.64e-02 3.24e-02 2.81e-02 4.68e-01 5.27e-01 5.23e-01 4.87e-01 4.27e-01 4.37e-02 8.11e-02 5.92e-02 3.83e-02 8.22e-02 5.21e-01 4.78e-01 4.54e-01 4.47e-01 4.20e-01 1.41e-01 1.77e-01 1.24e-01 1.31e-01 1.87e-01 4.69e-01 4.89e-01 4.61e-01 3.40e-01 3.52e-01 3.00e-01 2.53e-01 2.52e-01 5.06e-01 5.18e-01 4.38e-01 4.60e-01 3.73e-01 3.45e-01 3.04e-01 7.16e-01 9.92e-01 1.48e+00 1.17e+00 2.27e+00 4.05e-01 4.07e-01 3.54e-01 9.60e-02 8.60e-02 1.00e+00 1.39e+00 1.78e+00 4.84e+00 4.11e+00 8.93e-02 1.54e-01 1.55e-01 1.90e-01 3.53e-01 1.69e-01 2.29e-01 1.34e-01 5.10e+00 6.32e+00 5.91e+00 1.16e+01 1.18e-01 1.90e-01 1.97e-01 2.63e-01 2.89e-01 1.11e-01 1.04e-01 2.41e-02 1.13e+01 2.17e+01 1.46e+01 2.49e+01 459 275 361 446 453 255 213 368 288 127 293 101 142 205 262 261 301 110 272 163 369 116 485 227 482 95 193 166 383 144 102 221 492 849 460 116 152 701 9105 1471 2041 1105 2502 1426 5151 917 1625 701 1590 558 694 2154 5525 670 1648 642 1473 4456 2070 797 14009 1675 1393 637 1118 833 1990 3435 1342 2351 1348 5030 1287 1654 1640 4781 Table 3 Values of the most relevant hyperparameters and metrics for the best models in the case of the CMoGem distributions. The number of training epochs and the training time are also shown, giving an idea of how much each model needs to be trained. E Truncated Gaussians CONTENTS 19 hidden layers # of bijec. algorithm spline knots batch Median Median size W-distance KS-test Frobenius Norm # of epochs training time (s) Best models for TG 4D 3 × 256 3 × 128 3 × 128 3 × 256 8D 3 × 128 3 × 128 3 × 512 3 × 128 16D 3 × 128 3 × 128 3 × 128 3 × 128 32D 3 × 128 3 × 128 3 × 256 3 × 128 64D 3 × 128 3 × 128 3 × 128 3 × 128 100D 3 × 128 3 × 128 3 × 256 3 × 256 2 10 10 A-RQS RealNVP C-RQS 5 MAF 10 2 10 RealNVP A-RQS C-RQS 5 MAF 2 5 5 A-RQS RealNVP C-RQS 10 MAF 2 5 5 A-RQS C-RQS RealNVP 10 MAF 2 5 A-RQS C-RQS 10 MAF 10 RealNVP 2 A-RQS 10 MAF 5 5 RealNVP C-RQS 12 – 12 – – 12 8 – 12 – 12 – 12 12 – – 12 12 – – 8 – – 12 512 256 512 512 256 512 512 512 512 256 512 512 512 512 256 512 512 512 512 256 512 512 256 512 3.11e-03 4.17e-03 4.95e-03 7.90e-03 5.01e-01 4.90e-01 4.83e-01 4.98e-01 1.74e-02 4.56e-02 2.48e-02 3.55e-02 4.10e-03 4.17e-03 5.00e-03 8.71e-03 4.54e-01 4.85e-01 4.34e-01 3.44e-01 6.65e-02 5.63e-02 5.07e-02 9.78e-02 4.14e-03 7.81e-03 9.45e-03 1.50e-02 5.04e-01 4.38e-01 2.95e-01 2.54e-01 1.21e-01 1.62e-01 1.60e-01 2.19e-01 3.34e-03 6.50e-03 7.76e-03 8.56e-03 4.94e-01 4.02e-01 2.63e-01 3.17e-01 2.40e-01 4.00e-01 4.05e-01 3.22e-01 4.17e-03 1.04e-02 1.58e-02 1.88e-02 4.96e-01 3.63e-01 1.22e-01 7.50e-02 4.72e-01 5.37e-01 7.21e-01 1.82e+00 389 248 340 188 208 314 266 190 259 360 196 304 295 255 343 307 350 932 324 260 3.86e-03 2.08e-02 2.60e-02 3.02e-02 4.97e-01 7.15e-02 5.34e-03 6.20e-02 7.40e-01 1.08e+00 1.39e+00 7.36e-01 384 304 1000 1000 2148 2620 19829 452 2166 1756 11918 457 1426 1788 5015 1390 1553 6355 1510 1384 2607 22134 1350 2378 2104 1336 5208 25587 Table 4 Values of the most relevant hyperparameters and metrics for the best models in the case of the TG distributions. The number of training epochs and the training time are also shown, giving an idea of how much each model needs to be trained. 20 CONTENTS F Corner plots Fig. 4 1D and 2D marginal distributions for 32 randomly chosen dimensions of the N = 1000 dimensional CMoG distribu- tion. Red and blue curves and points represent the test samples and the NF generated samples obtained with the A-RQS best model, respectively. Considering the high dimensionality, the non-trivial structure of the distribution, the limited number of training samples, and the low level of tuning of the hyperparameters, the result can be considered very accurate. CONTENTS 21 Fig. 5 1D and 2D marginal distributions for 29 randomly chosen dimensions of the N = 200 dimensional CMoGem distribution. Red and blue curves and points represent the test samples and the NF generated samples obtained with the A-RQS 2 best model, respectively. Considering the high dimensionality, the non-trivial structure of the distribution, the limited number of training samples, and the low level of tuning of the hyperparameters, the result can be considered very accurate. 22 CONTENTS Fig. 6 1D and 2D marginal distributions for 25 randomly chosen dimensions of the N = 100 dimensional TG distribution. Red and blue curves and points represent the test samples and the NF generated samples obtained with the A-RQS best model, respectively. Considering the high dimensionality, the non-trivial structure of the distribution, the limited number of training samples, and the low level of tuning of the hyperparameters, the result can be considered very accurate. CONTENTS 23 References [1] InspireHEP Search Results. [2] M. Feickert and B. Nachman, "A Liv- ing Review of Machine Learning for Parti- cle Physics", arXiv:2102.02770 [Semantic Scholar]. [3] K. Albertsson, P. Altoe, D. Anderson, M. Andrews, J. P. A. Espinosa, A. Aurisano et al., "Machine Learning in High Energy Physics Community White Paper", Jour- nal of Physics: Conference Series 1085 (2018) 022008, arXiv:1807.02876 [Seman- tic Scholar]. [4] P. Shanahan et 2021 al., Computational Frontier CompF03 Top- ical Group Report: Machine Learning", arXiv:2209.07559 [Semantic Scholar]. "Snowmass [5] D. Bourilkov, "Machine and Deep Learn- ing Applications in Particle Physics", Int. J. Mod. Phys. A 34 (2020) 1930019, arXiv:1912.08245 [Semantic Scholar]. [6] G. Karagiorgi, G. Kasieczka, S. Kravitz, B. Nachman and D. Shih, "Machine Learn- ing in the Search for New Fundamental Physics", Nature Rev. Phys. 4 (2022) 399, arXiv:2112.03769 [Semantic Scholar]. [7] E. Tabak and E. Vanden-Eijnden, "Den- sity estimation by dual ascent of the log- likelihood", Communications in Mathematical Sciences 8 (2010) 217 [Semantic Scholar]. [8] E. Tabak and C. Turner, "A family of non- parametric density estimation algorithms", Communications on Pure and Applied Math- ematics 66 (2013) 145 [Semantic Scholar]. [9] D. J. Rezende and S. Mohamed, "Varia- tional Inference with Normalizing Flows", in International Conference on Machine Learning, 2015, arXiv:1505.05770 [Seman- tic Scholar]. [10] L. Dinh, D. Krueger and Y. Bengio, "NICE: Non-linear Independent Components Estimation", arXiv:1410.8516 [Semantic Scholar]. [11] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair et al., "Generative Adversarial Nets", in Advances in Neural Information Processing Systems, Z. Ghahramani, M. Welling, C. Cortes, eds., N. Lawrence and K. Weinberger, vol. 27, Curran Associates, Inc., 2014, arXiv:1406.2661 [Semantic Scholar]. [12] D. P. Kingma and M. Welling, "Auto- Encoding Variational Bayes", in 2nd Inter- national Conference on Learning Represen- tations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Pro- ceedings, 2014, arXiv:1312.6114 [Semantic Scholar]. [13] D. J. Rezende, S. Mohamed and D. Wierstra, "Stochastic Backpropagation and Approxi- mate Inference in Deep Generative Models", in Proceedings of the 31st International Con- ference on Machine Learning, E. P. Xing and T. Jebara, eds., vol. 32 of Proceedings of Machine Learning Research, pp. 1278– 1286, PMLR, Bejing, China, 22–24 jun, 2014, arXiv:1401.4082 [Semantic Scholar]. [14] Y. Fan, D. J. Nott and S. A. Sisson, "Approx- imate Bayesian computation via regres- sion density estimation", Stat 2 (2013) 34, arXiv:1212.1479 [Semantic Scholar]. [15] G. Papamakarios and I. Murray, "Fast (cid:15)- free Inference of Simulation Models with Bayesian Conditional Density Estimation", in Advances in Neural Information Pro- cessing Systems, D. Lee, M. Sugiyama, U. Luxburg, I. Guyon and R. Garnett, eds., vol. 29, Curran Associates, Inc., 2016, arXiv:1605.06376 [Semantic Scholar]. [16] J. Brehmer, G. Louppe, J. Pavez and K. Cranmer, "Mining gold from implicit models to improve likelihood-free inference", Proc. Nat. Acad. Sci. 117 (2020) 5242, arXiv:1805.12244 [Semantic Scholar]. [17] S. R. Green, C. Simpson and J. Gair, "Gravitational-wave estima- tion with autoregressive neural network parameter 24 CONTENTS flows", Phys. Rev. D 102 (2020) 104057, arXiv:2002.07656 [Semantic Scholar]. (2022) 083014, arXiv:2112.06707 [Seman- tic Scholar]. [18] V. A. Villar, "Amortized Bayesian Infer- ence for Supernovae in the Era of the Vera Rubin Observatory Using Normaliz- in 36th Conference on Neural ing Flows", Information Processing Systems, 11, 2022, arXiv:2211.04480 [Semantic Scholar]. [19] J.-E. Campagne, F. Lanusse, J. Zuntz, A. Boucaud, S. Casas, M. Karamanis et al., "JAX-COSMO: An End-to-End Dif- ferentiable and GPU Accelerated Cosmol- ogy Library", arXiv:2302.05163 [Semantic Scholar]. [20] M. Bellagente, "Go with the Flow: Nor- malising Flows applications for High Energy Physics", PhD Thesis, U. Heidelberg (2022) [Semantic Scholar]. [21] D. Zoran and Y. Weiss, "From learning mod- els of natural image patches to whole image restoration", in Proceedings of the 13rd Inter- national Conference on Computer Vision, pp. 479–486, 2011 [Semantic Scholar]. [22] S. R. Green and J. Gair, "Complete parameter inference for GW150914 using deep learning", Mach. Learn. Sci. Tech. 2 (2021) 03LT01, arXiv:2008.03312 [Seman- tic Scholar]. [23] T. Gl ̈usenkamp, "Unifying supervised learn- ing and VAEs – automating statistical inference in (astro-)particle physics with amortized conditional normalizing flows", arXiv:2008.05825 [Semantic Scholar]. [24] D. Kodi Ramanah, R. Wojtak, Z. Ansari, C. Gall and J. Hjorth, "Dynamical mass inference of galaxy clusters with neural flows", Mon. Not. Roy. Astron. Soc. 499 (2020) 1985, arXiv:2003.05951 [Semantic Scholar]. [25] D. H. T. Cheung, K. W. K. Wong, O. A. Han- nuksela, T. G. F. Li and S. Ho, "Testing the robustness of simulation-based gravitational- wave population inference", Phys. Rev. D 106 [26] D. Ruhe, K. Wong, M. Cranmer and P. Forr ́e, "Normalizing Flows for Hierar- chical Bayesian Analysis: A Gravitational Wave Population Study", arXiv:2211.09008 [Semantic Scholar]. [27] S. S. Gu, Z. Ghahramani and R. E. Turner, "Neural Adaptive Sequential Monte Carlo", in Advances in Neural Information Pro- cessing Systems, C. Cortes, N. Lawrence, D. Lee, M. Sugiyama and R. Garnett, eds., vol. 28, Curran Associates, Inc., 2015, arXiv:1506.03338 [Semantic Scholar]. [28] B. Paige and F. Wood, "Inference Networks for Sequential Monte Carlo in Graphical Models", in Proceedings of the 33rd Inter- national Conference on International Con- ference on Machine Learning - Volume 48, ICML'16, p. 3040–3049, JMLR.org, 2016, arXiv:1602.06701 [Semantic Scholar]. [29] S. Foreman, T. Izubuchi, L. Jin, X.-Y. Jin, J. C. Osborn and A. Tomiya, "HMC with Normalizing Flows", PoS LATTICE2021 (2022) 073, arXiv:2112.01586 [Semantic Scholar]. [30] A. Singha, D. Chakrabarti and V. Arora, "Conditional normalizing flow for Markov chain Monte Carlo sampling in the critical region of lattice field theory", Phys. Rev. D 107 (2023) 014512 [Semantic Scholar]. [31] M. Caselle, E. Cellini, A. Nada and M. Panero, "Stochastic normalizing flows for lattice field theory", PoS LATTICE2022 (2023) 005, arXiv:2210.03139 [Semantic Scholar]. [32] A. G. D. G. Matthews, M. Arbel, D. J. Rezende and A. Doucet, "Continual Repeated Annealed Flow Transport Monte Carlo", in International Conference on Machine Learn- ing, 1, 2022, arXiv:2201.13117 [Semantic Scholar]. CONTENTS 25 [33] G. Papamakarios and I. Murray, "Distilling Intractable Generative Models", in Probabilis- tic Integration Workshop at the Neural Infor- mation Processing Systems Conference, 2015, 2015 [Semantic Scholar]. [34] M. Gabri ́e, G. M. Rotskoff and E. Vanden- Eijnden, "Adaptive Monte Carlo augmented Proc. Nat. with Acad. e2109420119, arXiv:2105.12603 [Semantic Scholar]. normalizing 119 flows", (2022) Sci. [35] S. Pina-Otey, V. Gaitan, F. S ́anchez and T. Lux, "Exhaustive neural importance sam- pling applied to Monte Carlo event gener- ation", Phys. Rev. D 102 (2020) 013003, arXiv:2005.12719 [Semantic Scholar]. [36] C. Gao, S. H ̈oche, J. Isaacson, C. Krause and H. Schulz, "Event Generation with Normaliz- ing Flows", Phys. Rev. D 101 (2020) 076002, arXiv:2001.10028 [Semantic Scholar]. [37] T. A. Le, A. G. Baydin and F. Wood, "Infer- ence Compilation and Universal Probabilistic Programming", in Proceedings of the 20th International Conference on Artificial Intel- ligence and Statistics, A. Singh and J. Zhu, eds., vol. 54 of Proceedings of Machine Learn- ing Research, pp. 1338–1348, PMLR, 20– 22 apr, 2017, arXiv:1610.09900 [Semantic Scholar]. [38] G. Papamakarios, E. Nalisnick, D. J. Rezende, S. Mohamed and B. Lakshmi- narayanan, "Normalizing Flows for Proba- bilistic Modeling and Inference", J. Mach. Learn. Res. 22 (2022) 1, arXiv:1912.02762 [Semantic Scholar]. [39] A. Butter, T. Heimel, S. Hummerich, T. Krebs, T. Plehn, A. Rousselot et al., "Gen- erative Networks for Precision Enthusiasts", arXiv:2110.13632 [Semantic Scholar]. [40] R. Verheyen, "Event Generation and Den- sity Estimation with Surjective Normaliz- ing Flows", SciPost Phys. 13 (2022) 047, arXiv:2205.01697 [Semantic Scholar]. [41] C. Krause and D. Shih, "CaloFlow: Fast and Accurate Generation of Calorimeter Showers with Normalizing Flows", arXiv:2106.05285 [Semantic Scholar]. [42] C. Krause and D. Shih, "CaloFlow II: Even Faster and Still Accurate Genera- tion of Calorimeter Showers with Normaliz- ing Flows", arXiv:2110.11377 [Semantic Scholar]. [43] C. Gao, J. Isaacson and C. Krause, "i-flow: High-dimensional Integration and Sampling with Normalizing Flows", Mach. Learn. Sci. Tech. 1 (2020) 045023, arXiv:2001.05486 [Semantic Scholar]. [44] B. Nachman and D. Shih, "Anomaly Detec- tion with Density Estimation", Phys. Rev. D 101 (2020) 075042, arXiv:2001.04990 [Semantic Scholar]. [45] T. Golling, S. Klein, R. Mastandrea and B. Nachman, Flow-Enhanced "FETA: Transportation for Anomaly Detection", arXiv:2212.11285 [Semantic Scholar]. [46] S. Caron, L. Hendriks and R. Verheyen, "Rare and Different: Anomaly Scores from a com- bination of likelihood and out-of-distribution models to detect new physics at the LHC", SciPost Phys. 12 (2022) 077 [Semantic Scholar]. [47] M. Bellagente, A. Butter, G. Kasieczka, T. Plehn, A. Rousselot, R. Winterhalder et al., "Invertible Networks or Partons to Detector and Back Again", SciPost Phys. 9 (2020) 074, arXiv:2006.06685 [Semantic Scholar]. [48] M. Backes, A. Butter, M. Dunford and B. Malaescu, "An unfolding method based Invertible Neural Net- on works training", arXiv:2212.08674 [Semantic Scholar]. (cINN) using conditional iterative [49] L. Dinh, J. Sohl-Dickstein and S. Ben- gio, "Density estimation using Real NVP", in International Conference on Learning Representations, 2017, arXiv:1605.08803 [Semantic Scholar]. Problems in Particle Physics, Astrophysics, and Cosmology 1 (2003) 311. [59] R. J. A. Li, Kansal, Duarte, N. Chernyavskaya, M. Pierini, B. Orzari et al., "On the Evaluation of Genera- in High Energy Physics", tive Models arXiv:2211.10295 [Semantic Scholar]. [60] R. T. D'Agnolo, G. Grosso, M. Pierini, A. Wulzer and M. Zanetti, "Learning mul- tivariate new physics", Eur. Phys. J. C 81 (2021) 89, arXiv:1912.12155 [Semantic Scholar]. [61] P. Chakravarti, M. Kuusela, J. Lei and L. Wasserman, "Model-Independent Detec- tion of New Physics Signals Using Inter- pretable Semi-Supervised Classifier Tests", arXiv:2102.07679 [Semantic Scholar]. [62] M. Letizia, G. Losapio, M. Rando, G. Grosso, A. Wulzer, M. Pierini et al., "Learning new physics efficiently with nonparametric methods", Eur. Phys. J. C 82 (2022) 879, arXiv:2204.02317 [Semantic Scholar]. [63] L. Del Debbio, J. M. Rossney and M. Wil- son, "Machine Learning Trivializing Maps: A First Step Towards Understanding How Flow-Based Samplers Scale Up", PoS LAT- TICE2021 (2022) 059, arXiv:2112.15532 [Semantic Scholar]. [64] TensorFlow Probability MAF docu- mentation. 26 CONTENTS [50] G. Papamakarios, T. Pavlakou and I. Mur- ray, "Masked Autoregressive Flow for Density Estimation", in Advances in Neural Infor- mation Processing Systems, I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan et al., eds., vol. 30, Curran Associates, Inc., 2017, arXiv:1705.07057 [Semantic Scholar]. [51] C. Durkan, A. Bekasov, I. Murray and G. Papamakarios, "Neural Spline Flows", in Proceedings of the 33rd International Confer- ence on Neural Information Processing Sys- tems, Curran Associates Inc., Red Hook, NY, USA, 2019, arXiv:1906.04032 [Semantic Scholar]. [52] I. Kobyzev, S. J. Prince and M. A. Brubaker, "Normalizing Flows: An Introduction and Review of Current Methods", IEEE Trans- actions on Pattern Analysis and Machine Intelligence 43 (2021) 3964 [Semantic Scholar]. [53] D. P. Kingma, T. Salimans, R. Jozefow- icz, X. Chen, I. Sutskever and M. Welling, "Improved Variational Inference with Inverse Autoregressive Flow", in Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS'16, p. 4743–4751, Curran Associates Inc., Red Hook, NY, USA, 2016, arXiv:1606.04934 [Semantic Scholar]. [54] M. Germain, K. Gregor, I. Murray and H. Larochelle, "MADE: Masked Autoen- coder for Distribution Estimation", in Pro- ceedings of the 32nd International Confer- ence on Machine Learning, arXiv, 2015, arXiv:1502.03509 [Semantic Scholar]. [55] J. A. Gregory and R. Delbourgo, "Piecewise Rational Quadratic Interpolation to Mono- tonic Data", IMA Journal of Numerical Analysis 2 (1982) 123 [Semantic Scholar]. [56] Code repository for this paper on GitHub (cid:135). [57] NF4HEP code repository on GitHub (cid:135). [58] J. H. Friedman, "On multivariate goodness– of–fit and two–sample testing", Statistical
http://arxiv.org/abs/2302.11996v5
2023-06-26T12:36:03
2023-02-23T13:18:12
K-SHAP: Policy Clustering Algorithm for Anonymous Multi-Agent State-Action Pairs
Learning agent behaviors from observational data has shown to improve our understanding of their decision-making processes, advancing our ability to explain their interactions with the environment and other agents. While multiple learning techniques have been proposed in the literature, there is one particular setting that has not been explored yet: multi agent systems where agent identities remain anonymous. For instance, in financial markets labeled data that identifies market participant strategies is typically proprietary, and only the anonymous state-action pairs that result from the interaction of multiple market participants are publicly available. As a result, sequences of agent actions are not observable, restricting the applicability of existing work. In this paper, we propose a Policy Clustering algorithm, called K-SHAP, that learns to group anonymous state-action pairs according to the agent policies. We frame the problem as an Imitation Learning (IL) task, and we learn a world-policy able to mimic all the agent behaviors upon different environmental states. We leverage the world-policy to explain each anonymous observation through an additive feature attribution method called SHAP (SHapley Additive exPlanations). Finally, by clustering the explanations we show that we are able to identify different agent policies and group observations accordingly. We evaluate our approach on simulated synthetic market data and a real-world financial dataset. We show that our proposal significantly and consistently outperforms the existing methods, identifying different agent strategies.
[ "Andrea Coletta", "Svitlana Vyetrenko", "Tucker Balch" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11996v5", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11996v5", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI" ]
K-SHAP: Policy Clustering Algorithm for Anonymous Multi-Agent State-Action Pairs Andrea Coletta 1 Svitlana Vyetrenko 2 Tucker Balch 2 Abstract 1. Introduction 3 2 0 2 n u J 6 2 ] G L . s c [ 5 v 6 9 9 1 1 . 2 0 3 2 : v i X r a Learning agent behaviors from observational data has shown to improve our understanding of their decision-making processes, advancing our ability to explain their interactions with the environment and other agents. While multiple learning tech- niques have been proposed in the literature, there is one particular setting that has not been explored yet: multi agent systems where agent identities remain anonymous. For instance, in financial mar- kets labeled data that identifies market partici- pant strategies is typically proprietary, and only the anonymous state-action pairs that result from the interaction of multiple market participants are publicly available. As a result, sequences of agent actions are not observable, restricting the applicability of existing work. In this paper, we propose a Policy Clustering algorithm, called K-SHAP, that learns to group anonymous state- action pairs according to the agent policies. We frame the problem as an Imitation Learning (IL) task, and we learn a world-policy able to mimic all the agent behaviors upon different environmen- tal states. We leverage the world-policy to explain each anonymous observation through an additive feature attribution method called SHAP (SHapley Additive exPlanations). Finally, by clustering the explanations we show that we are able to identify different agent policies and group observations ac- cordingly. We evaluate our approach on simulated synthetic market data and a real-world financial dataset. We show that our proposal significantly and consistently outperforms the existing meth- ods, identifying different agent strategies. 1J.P. Morgan AI Research, London, UK. 2J.P. Morgan AI Re- search, New York, USA. Correspondence to: Andrea Coletta <an- [email protected]>. Proceedings of the 40 th International Conference on Machine Learning, Honolulu, Hawaii, USA. PMLR 202, 2023. Copyright 2023 by the author(s). 1 Insect colonies, animal swarms, and human societies are examples of the complex multi-agent systems in nature. Each agent in these systems develops a be- havioral strategy to take suitable actions in response to environmental changes. Animals learn different be- haviors to survive and exploit available resources (e.g., food), while humans may develop complex behaviors to efficiently interact and pursue their own goals. The study and understanding of human and animal behav- iors has been a fundamental problem in both computer and behavioral sciences (Cichos et al., 2020). In particular, understanding agent behaviors from observational data is essential to study, predict and simulate their behaviors (Li et al., 2020; Suo et al., 2021). Existing work borrows tools from the reinforcement learn- ing literature to learn agent strategies (Hussein et al., 2017; Ho and Ermon, 2016; Song et al., 2018; Fu et al., 2021) using Markov Decision Processes (MDPs) as an efficient mathematical framework to formulate the problem. In par- ticular, Inverse Reinforcement Learning (IRL) (Ng et al., 2000) has been widely studied to characterize the decision- making behavior of animals and humans. IRL aims at recov- ering a reward function that explains the agent goal. It has been used to study worm behavioral strategies (Yamaguchi et al., 2018); to model the behaviors of mice exploring a labyrinth (Ashwood et al.); to identify and capture the behav- ior of troll accounts in social networks (Luceri et al., 2020). Imitation Learning (IL) (Hussein et al., 2017) is another technique that has demonstrated great success in modeling agent behaviors, learning directly from their trajectories (state-action pairs). Recently, IL has shown to learn realistic driving behaviors from human demonstrations (Suo et al., 2021). Finally, Hidden Markov Models (HMMs) have been extensively used to analyze temporal dynamics and model agent behaviors from observed sequential data. HMMs have been used to study different animal behaviors, including honey bees (Feldman and Balch, 2004) and mice (Jiang et al., 2018). While all these techniques assume that clear observation se- quences for each agent are given, some critical domains with K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs anonymous state-action pairs, in this paper we propose a novel policy-clustering method – in which we group state- action observations that belong to agents sharing the same behavior or policy. These clusters describe the different behaviors of agents, enabling further studies and analysis. In detail, we propose K-SHAP, a Policy Clustering algo- rithm for anonymous state-action pairs. K-SHAP comprises three major phases shown in Figure 1. First, we model the problem as an Imitation Learning task to learn a world- policy (Coletta et al., 2022) using supervised learning over the anonymous state-action pairs. The world-policy is an extension of the world-model approach (Ha and Schmid- huber, 2018) to state-action pairs: it emulates collective agent behaviors, learning their actions (output) in response to the different environmental states (input). Then, we inter- pret the world-policy to explain each anonymous observa- tion through an additive feature attribution method, namely SHAP (SHapley Additive exPlanations) (Lundberg and Lee, 2017). Finally, we show that the explanations, called SHAP values, better reveal the intrinsic clustering structure among data; and by applying a K-Means algorithm (Hartigan and Wong, 1979) in the new SHAP values space, we can group the anonymous observations into K clusters, which reflect the real agent strategies. To support the soundness of our method, we experimentally evaluate it with market data. We first consider synthetic data from a multi-agent simulator labeled with agent IDs to serve as a ground truth (Byrd et al., 2019; Liu et al., 2022), then we consider real anonymous market data from NASDAQ stock exchange (NASDAQ, 2022). For real data we evaluate the Utility and Silhouette, as ground truth labels are not available. In particular, by Utility we mean the ability to im- prove a specific downstream task (i.e., supervised learning) when trained on the clusters rather than original demon- strations. We compare our proposal against state-of-art clustering algorithms, including Deep Clustering Network (DCN) (Mukherjee et al., 2019) and ClusterGAN (Mukher- jee et al., 2019). We also adapt Σ-GIRL (Ramponi et al., 2020), a Multiple-Intent IRL clustering algorithm, to anony- mous state-action pairs. We show that we significantly and consistently outperform the existing work, and that K-SHAP clusters anonymous observations according to the agent be- haviors. K-SHAP outperforms existing methods by a factor of 2 on all the performance metrics. 1.1. Main contributions To the best of our knowledge, this is the first work that addresses the problem of policy clustering with anonymous state-action pairs as observations from multiple agents. We summarize the main contributions of our paper as follows: • We formalize the k-policy clustering problem under Figure 1: The three major phases of K-SHAP. privacy concerns may provide only anonymous state-action pairs as data. For example, military operations are often anonymous to conceal strategies to opponents, especially in case of cyber-attacks or when illegal activities are operated (e.g., use of chemical or biological weapons) (Koblentz, 2019; Rid and Buchanan, 2015). In financial markets la- beled data that identifies market participants is typically pro- prietary, and publicly available transaction data is typically anonymous (NASDAQ, 2022). However, understanding market participant strategies for the purpose of ensuring that markets are orderly and compliant with regulations is necessary (Hagstr ̈omer and Nord ́en, 2013; Kirilenko et al., 2017; Wang et al., 2021). For instance, in (Kirilenko et al., 2017) the authors were able to study and demonstrate that high frequency traders did not contribute to the 2010 flash crash using audit trail transaction-level data, which reveals the identities of market participants. Nevertheless, it is most common that only the anonymous state-action pairs without any agent identifiers are publicly available from exchanges (NASDAQ, 2022). It is well known that thousands of individual market partici- pants can be broadly assigned to a small number of distinct behavioral strategies (Kirilenko et al., 2017; Vyetrenko et al., 2020). For example, multiple market agents might trade on momentum signals even though these momentum signals are of different magnitudes. Similarly, all market makers are required to place both buy and sell orders to provide liq- uidity in the markets, even though individual market makers might act upon different proprietary signals to do that. Previ- ous work has used IRL with reward clustering to distinguish high frequency from other trading strategies in simulated (but not the real) markets (Yang et al., 2012). However, the proposed method requires the inventory level and the la- beled sequence of actions for each trader, which are usually unknown in real markets. We are not aware of any other work that would allow us to identify the individual agents or their strategies from anonymous state-action pairs. To address the challenge of learning agent strategies from anonymous multi-agent state-action pairs. 2 AIARTIFICIAL INTELLIGENCEElements CollectionWorld Policy π"!SHAP valuesDφ=φ" "#$% Anonymous ObservationsD=s",a" "#$% ImitationLearningK-Means(Dφ , k=2)Strategy AStrategy B K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs • We propose K-SHAP, a Policy Clustering Algorithm which leverages IL and SHAP values to identify k distinct behavioral clusters. • We experimentally evaluate K-SHAP against exist- ing work, showing that it achieves good performance in all performance metrics, with both synthetic and real-world data. In particular, we show that K-SHAP can group market observations according to the trader strategies, improving our understanding of market par- ticipant and their impact. 2. Preliminaries and Problem Formulation 2.1. Agent behaviors as Markov Decision Processes We consider a multi-agent system with N autonomous agents interacting in a given environment. We adopt Markov Decision Processes (MDPs) as a natural underlying de- cision model for each single agent. A MDP is a tuple M = (S, A, P, R) composed by: the state space S; the action space A; a transition function P : S × A → ∆(S), where ∆(S) denotes the probability distributions over state space S; and a reward function R : S × A → R. We consider that each agent follows a policy π (i.e., behav- ior) to maximize the expected reward over time: J(π) = E (cid:34)T −1 (cid:88) (cid:35) γtR(st, at) t=0 (1) where γ ∈ [0, 1] is the discounted factor that can be used to prioritize early actions. We consider a general policy π : S → A that describes the preferred action a ∈ A in the state s ∈ S. 2.2. Agent observations In our problem setting, we do not have direct access to the agent rewards or policies, we consider instead a more general case of an MDP without reward (MDP\{R}). In this setting the reward R is unknown, and agent behaviors are represented by a set of trajectories D = {ξ0, . . . , ξt} for each agent, where a trajectory is a sequence of state- action pairs ξi = {(s0, a0), . . . , (sk, ak)}. However, we have an additional confidentiality constraint: agents act anonymously and their observations do not contain any identifier. Thus, we are not able to identify a trajectory ξ for a single agent, but observational data is anonymously gath- ered from all the agents into a new set D = {(si, ai)}T i=1 over a time T . Notice that the collected state-action pairs (si, ai) do not contain any information about which anony- mous agent generated the action ai at state si, preventing the identification of state-action sequences generated by an agent. This scenario is typical of military or financial do- mains, where agents want to hide their strategies for tactical reasons. In particular, in financial domains, the actions are the orders submitted by traders according to the current fi- nancial market state. Anonymous observations exponentially increase the com- plexity of behavioral studies as identifying an agent behavior with existing approaches is almost impracticable: consider- ing k agents and n observations, we have O(kn) possible assignment of the observations to reconstruct the agent tra- jectories needed by most of the existing methodologies. 2.3. Reward functions to model agent behaviors Given an MDP formulation, a classic approach to identify agent behaviors is to study their reward function R. This function is the most succinct representation of the agent goals, which define their extrinsic motivation to act (Chen- tanez et al., 2004). Therefore, rewards help to study agent behaviors and can be used to solve intent-clustering (Ram- poni et al., 2020; Babes et al., 2011) in which we aim at identifying groups of agents sharing the same goal. Consid- ering a MDP\{R}, previous work employs IRL to recover the unknown reward function R : S × A → R from the agent demonstrations (Ramponi et al., 2020; Yamaguchi et al., 2018; Yang et al., 2012). In the general case, the un- known reward function Rω(s, a) can be defined as a linear combination of q weighted features: ωT φ(s, a), ω ∈ Rq, where φ(s, a) is the feature function and ωT the feature weights. However, in IRL the problem is ill-posed: even under per- fect knowledge with demonstrations from an optimal policy, there exist many solutions (reward functions) for which a given behavior is optimal (Ng et al., 2000). In general, the real reward function is not identifiable (Cao et al., 2021). Most important, IRL requires observations as sequences of state-action pairs for each agent, while we consider domains in which state-action pairs are anonymous. 2.4. Learning a policy to study agent behaviors Another simple, yet effective, approach to study the behavior of an agent is to directly describe their mapping from state features to actions, as the most parsimonious description of the policy itself. Recently, IL (Hussein et al., 2017) has demonstrated that it is possible to reconstruct the agent policies directly from state-action pair observations. In particular, in IL we aim at learning an optimal policy πθ for an agent i according to its demonstrations: arg max θ Es∼dπi ,a∼πi(*|s)[log πθ(a|s)] (2) Notice that dπi denotes the distribution over states induced by agent policy πi. Once we reconstruct the policy πi, we directly study the behavior of the agent i by investigating how the policy maps state to actions. In fact, for a simple policy the best explanation is often the 3 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs model πi itself, as a parsimonious description of the agent behavior. However, models describing complex policies cannot be easily studied and explained. In such cases, we can borrow techniques from explainable AI to investigate the behavior of the model (Dwivedi et al., 2022). 2.5. SHAP (SHapley Additive exPlanations) A recent successful technique for explainability is the SHAP values method (SHapley Additive exPlanations) (Lundberg and Lee, 2017). This method belongs to the additive feature attribution methods, which are local methods designed to ex- plain a single prediction f (x) based on the input x (Ribeiro et al., 2016). These methods approximate the real model f using a simpler explanation model g. The model g tries to guarantee that g(x′) ≈ f (hx(x′)), where x′ is a simplified input for g, and hx is a mapping function to reconstruct the original input x = hx(x′). The explanation model is then a linear combination of binary variables x′: market state contribution to the action, which characterizes the different trader strategies (see Section 1). 2.6. Policy-Clustering under anonymous state-action pairs In the general policy-clustering setting we consider a set of n agents A = {A0, . . . , An} following a finite unknown set of policies π = {π0, . . . , πk} such that k < n (i.e., multiple agents may have the same behavior πi). The goal of policy-clustering is to group the agents A into k clus- ters, according to their policies from the observational data D = {ξ0, . . . , ξt}n i=0. Agents in the same cluster will follow the same strategy or behavior. Unlike the general formula- tion, we relax the assumption of knowing agent identities and trajectories. Thus, the goal of policy-clustering under anonymous state-action pairs is to group the anonymous ob- servational data D = {(si, ai)}T i=0 into k clusters, such that observations in the same cluster belong to agents sharing the same policy π. g(x′) = φ0 + m (cid:88) i=1 φi * x′ i (3) 3. K-SHAP Framework where m is the number of simplified input features, and φi ∈ R measures the contribution of each feature to the model output. The sum of all feature contributions approxi- mates the original model output f (x). In particular, SHAP values method uses classic game theory to explain the model predictions. Given a set of features F the method computes the contribution φi of each feature i ∈ F by evaluating the model with and without such a feature. To fairly account for the effects of the withholding of a feature among the others, SHAP computes the average contribution of a fea- ture i considering the model over all the possible subsets S ⊆ F \ i: (cid:88) φi = S⊆F \i |S|!(|F | − |S| − 1)! |F |! (cid:21) (cid:20) fS∪{i}(xS∪{i})−fS(xS) where xS represents the input features in the subset S, and fS is the model trained on the subset of features S or its approximation. Therefore, the SHAP values describe how the input features (state) contribute to the output (action). We denote with Φ ∈ Rm the new space of SHAP values, and with φ ∈ Φ the SHAP values vector for an input x. While IL and SHAP values provide a promising approach to study the behavior of an agent, IL requires a trajectory ξ, or a set of state-action pairs, for each agent to approximate the policy correctly. Therefore, we cannot directly combine these two methods in our setting, as state-action pairs are anonymous without any agent identifier. In the following sections, we will show that if we are able to learn a world- policy describing all the agent behaviors, SHAP values are naturally well suited to describe each observation as the This section introduces our main contribution, K-SHAP, a Policy Clustering algorithm that learns to cluster the anonymous input observations D into k different policies. K-SHAP is inspired by recent advancements in Imitation Learning, world policy, and explainable AI. The Algorithm comprises three major phases: • We first frame the problem as an IL task with anony- mous state-action pairs to learn a unique world policy able to emulate all the agent behaviors; • We compute local explanations of the world policy for each state-action pair through SHAP (SHapley Ad- ditive exPlanations). The explanations describe the different agent behaviors upon each observation; • We discuss SHAP values properties and how they fa- cilitate the clustering. Finally, we apply a K-Means algorithm to group the observations into k policies. 3.1. World Policy Hypothetically we could learn the agent policies by solving n IL problems, one for each agent; however, anonymous state-action pairs restrict this approach due to the lack of individual agent trajectories. Another approach could be a world policy ˆπθ trained over all the observations D. Recent work shows that highly complex environments with multiple autonomous agents can be successfully simulated by learning a unique world-policy able to mimic all the agents (Ha and Schmidhuber, 2018; Coletta et al., 2021; 2022). To truthfully simulate the real world and the agent 4 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs interactions, these models have to learn and impersonate multiple heterogeneous behaviors upon different input from the environment. Therefore, they inherently hold some knowledge about all the agent strategies. Hereafter, we assume that a world-policy ˆπθ is the most parsimonious model able to represent the different agent behaviors by learning their mapping from states to actions from a set of observations D: ˆπθ = arg min θ (cid:88) (s,a)∈D l(πθ(s), a) (4) where l is the loss function of the learning problem. Given the world policy, we can study its behavior over each state-action pair (si, ai), to infer the different strategies adopted by the real agents, and cluster the observations accordingly. In K-SHAP we train a world policy ˆπθ in a behavioral cloning fashion, which learns the expert policies using supervised learning.1 3.2. Local explanations Explaining the world-policy ˆπθ behavior under different inputs can reveal details about the strategies adopted by the real agents. K-SHAP borrows a successful technique from explainable AI, namely SHAP (SHapley Additive ex- Planations) (Lundberg and Lee, 2017) to disentangle the world-policy's complexity and study its behavior. For a demonstration (s, a) we can compute the SHAP val- ues as a vector φ ∈ R|F | defined as the average marginal contribution φi of each state feature i ∈ F to the prediction ˆπθ(s) ≈ a. Therefore, we can express the behavior of a real agent for an observation j as the approximated mapping from state s to action a, defined by the SHAP values vec- tor φj (which describes how each state feature i drives the agent behavior a in the state s). In general, the state s can be any representation of the environment in which the agent interacts, including images, text and tabular data, as SHAP values method can deal with complex and continuous data. 3.3. K-SHAP Algorithm We now describe how K-SHAP combines IL and SHAP values to group the anonymous state-action pairs. The full procedure is shown in Algorithm 1. First, K-SHAP learns the world policy using all the avail- able observations (line 1) in a behavioral cloning fashion. It trains a model using supervised learning, where each state s is used as input and the related action a is considered as the output for the model. Then, by leveraging the world-policy 1Different training procedures or approaches can be applied to learn the world-policy, including adversarial training (Ho and Ermon, 2016). Algorithm 1 K-SHAP Algorithm Input: A set of observations D = {(si, ai)}T clusters k, the IL loss function l Output: Labels L for each observation to a given policy i=1, the number of 1 ˆπθ = arg min (cid:80) l(πθ(si), ai) θ (si,ai)∈D 2 Dφ = ⟨⟩ 3 for i = 0 to |D| do φ = ⟨⟩ 4 5 6 7 foreach j ∈ F do φ[j] ← (cid:80) S⊆F \j ωS (cid:2)ˆπS∪{j}(siS∪{j} ) − ˆπS(siS )(cid:3) where ωS = |S|!(|F |−|S|−1)! |F |! Dφ[i] ← φ 8 L = K-Means(Dφ, k) 9 return L ˆπθ and SHAP, it computes the explanations (i.e., SHAP values) for each observation (s, a) ∈ D. The explanations represent the anonymous observations in a new SHAP val- ues space Dφ = {φi}T i=0 (lines 3-7). Finally, we adopt an existing clustering approach, namely K-Means, to group observations according to their SHAP values, such that ob- servation in the same cluster will be originated from the same strategy (line 8). Formally, we cluster observations by minimizing the inertia, or within-cluster sum-of-squares, of their SHAP values: k (cid:88) (cid:88) j=0 φi∈Cj ||φi − μj||2 (5) where μ are the cluster centroids, and Cj identify the obser- vations assigned to cluster j. We now briefly discuss two essential properties of SHAP values that we leverage to solve our k policy-clustering prob- lem. The first implication of the new space Dφ is the ability to capture the agent behaviors as a response to the environ- ment. In fact, SHAP values explain the world-policy ˆπθ predictions with a linear explanation model g that captures state features contributions to an action a. By assuming that the world-policy mimics the different agent behaviors, the SHAP values define how the agents respond to the dif- ferent input features. Therefore, the SHAP vectors φ are similar for observations that originate from comparable be- haviors - they respond similarly to environmental changes (i.e., features) – and they are close in the vector space Dφ. Contrarily, dissimilar behaviors have different vectors in the space. Secondly, SHAP values offer a natural advantage in cluster- ing problems (Lundberg et al., 2018): by definition SHAP values convert all the state features into the same metric 5 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Figure 2: Example of K-SHAP clustering. space. Each feature will have the same units as the model output, as the features measure their impact on the model output in the new SHAP space. This enables us to easily compare and cluster data, regardless of the different mag- nitude and units of the features. For example, while in Figure 2 it can be challenging to compare the temperature in Fahrenheit to the number of flowers, in the SHAP space both the features will have the same unit, representing their contribution to the action a. K-SHAP training Our method generally requires select- ing the number of clusters k as a unique hyper-parameter. When k is unknown, we adopt the classic Elbow method to optimize k according to the distortion or variance of the clusters in the SHAP values space. In Appendix D.1, we compare the clustering performance in scenarios where the value of k is either unknown or provided. In Section 4, we also show that we can use dimensionality reduction tech- niques like UMAP (McInnes et al., 2018a) on the SHAP values space to visualize or improve clustering. Finally, as we adopt a supervised IL technique we may need to use multiple world-policies in case of observations with identical states to disambiguate them and let the models learn the correct behaviors. In the case of identical states, a unique world-policy may average actions from multiple agents, with inaccurate SHAP values and clustering. Algorithm illustration As an illustrative example, in Fig- ure 2 we consider honey bees that act according to two dif- ferent unknown behaviors (a) foraging and (b) defense. For simplicity, we describe the honey bee action a ∈ [−1, 1] as the probability of staying close to protect the hive (a ≈ −1) or moving to search for food (a ≈ 1). We identify four state features describing the number of flowers, bees, tempera- ture, and hazards close to the hive. • In the scenario (a), we consider a foraging observation in which the honey bee observes the environment and flies close to the flower. We explain the honey behavior through the world policy using SHAP values. The SHAP values describe the honey bee behavior (i.e., search for food) as a 6 strong contribution to the action a = 1 from the presence of a flower (i.e., food), and a small contribution from presence of warm weather (i.e., temperature). The presence of other bees around the hive is instead a negative contribution, as they may compete for the flower. • In the scenario (b), we consider a defense observation in which a honey bee observes the environment and chooses to defend the hive. In this case the SHAP values describe the bee behavior as a major contribution to the action a = −1 from the presence of one hazard (i.e., mantis). The presence of few bees slightly reduces the need to defend the hive. Finally, in the leftmost picture we show how we use the computed SHAP values to group the observations into k = 2 policies through a K-Means algorithm. The picture shows SHAP values from foraging and defense observations that lay into different regions of the space, i.e., clusters. 4. Experiments We now experimentally evaluate K-SHAP on both synthetic and real data. We apply K-SHAP to anonymous observa- tions from agents in a financial market (i.e., traders), and we experimentally demonstrate that we can identify state-action pair clusters dictated by the different behavioral strategies. We average the results over 20 runs, and we assume to know the number of clusters k.2 We consider a Random Forest as the world-policy for K-SHAP, and we compute the SHAP values using TreeSHAP (Lundberg et al., 2020). We consider two variants of our approach: K-SHAP in which we directly cluster the SHAP values; and K-SHAP (Z) in which we cluster a 2-dimensional embedding Z of the SHAP values, obtained by applying UMAP (McInnes et al., 2018a). UMAP is a dimensionality reduction technique similar to t-SNE (Van der Maaten and Hinton, 2008) that preserves more the global structure of the data, and requires less computational resources. 2In Appendix D.1, we show that K-SHAP achieves similar performance also when the number of clusters k is unknown. World Policy !"!state !!"#"!!≈%!1 = hazards2 = bees0 = flowers75°F= temperature-0.7"#"!!0.0+0.1state features0.0b) defensestrategySHAP values #!World Policy !"!state !!"#"!!≈%!a) foraging strategySHAP values #!+0.61-0.3+0.10.0"#"!!state features1 = flowers5 = bees75°F= temperature0 = hazardsK-Means(φi "#$%, k=2)3D representation K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Data We first use the state-of-art multi-agent market sim- ulator ABIDES (Byrd et al., 2019) to simulate synthetic market data. We would like to underline that simulated envi- ronment allows to generate state-action pairs with agent IDs, hence, providing the ground truth information for our study. We let market agents realize six distinct trading strategies: 3 • Market Making (Chakraborty and Kearns, 2011) that pro- vides liquidity to the market by placing both buy and sell orders; • Fundamental Trading (Wah et al., 2017) that trades ac- cording to a belief of the real stock value; • (δ1, δ2)-based Momentum Trading (Byrd et al., 2019) that trades following two momentum signals of the price (i.e., moving averages) computed over the last δ1 and δ2 minutes; • Noise Trading (Gode and Sunder, 1993) that places orders randomly; • Irrational RL Trading (Liu et al., 2022) that models a sub-rational human behavior; • Rational RL Trading (Liu et al., 2022) that models an electronic (i.e., rational) trading algorithm. By combining these strategies, we generate six scenarios: • Abides π3 comprises of Market Making, (12, 26)-based Momentum, and Fundamental trading strategies, with 127 agents. • Abides π4 comprises of Market Making, (12, 26)-based Momentum, Fundamental, and Noise trading strategies, with 5127 agents. • Abides π5 comprises of Market Making, (0.2, 0.4)-based Momentum, (12, 26)-based Momentum, (48, 96)-based Mo- mentum, and Fundamental trading strategies, with 157 agents. • Abides π6 comprises of Market Making, (0.2, 0.4)-based Momentum, (12, 26)-based Momentum, (48, 96)-based Mo- mentum, Fundamental, and Noise trading strategies, with 5157 agents. • RL-Agents Bubble comprises of a Irrational and Ratio- nal RL agent, with a Bubble market scenario (Siegel, 2003). • RL-Agents Sine comprises of a Irrational and Rational RL agent, with a cyclic market scenario. In the last two scenarios, we model the market and train the RL agents according to the original paper (Liu et al., 2022). In these two scenarios we simulate 11 days of market, while in the first four scenarios we simulate 4 days. For real market data we consider historical data from NASDAQ stock exchange where agent IDs are not avail- able (NASDAQ, 2022). We consider three stocks (i.e., AVXL, AINV, and ADAP) over 4 trading days from 05th to 8th Jan 2021. 3A detailed description of ABIDES agents is provided in Ap- pendix B.1. Metrics For synthetic data the ground-truth cluster la- bels are available, and we apply three standard metrics to evaluate the clustering: purity score, Adjusted Rand Index (ARI) (Hubert and Arabie, 1985) and Normalized Mutual Information (NMI) (Vinh et al., 2009). The purity score ranges from 0 to 1, and it evaluates how homogeneous each cluster is (where 1 being a cluster consists of observations from a single strategy). The ARI ranges from -1 to 1, and it represents the adjusted for chance version of Rand index, which measures the percentage of correct cluster assign- ments (where 1 being a perfect clustering and 0 being a random clustering). The NMI ranges from 0 to 1 (where 1 indicated a perfect clustering), and it measures how much information is shared between the clusters and the labels, adjusted by the number of clusters. For the historical market data where the ground truth is not available we evaluate the Silhouette Index (Rousseeuw, 1987) and we introduce a Utility metric for the clusters. The Silhouette Index measures the similarity of each state-action pair to its own cluster compared to other clusters. It ranges between -1 and 1, where 1 indicate the highest degree of confidence that the observation belongs to a correct cluster. The Utility evaluates the learning improvement when we learn a unique policy from all the state-action pairs w.r.t. learning k policies from the identified clusters. Thus, an improvement in Utility indicates that each cluster contains homogeneous state-action pairs in terms of strategy, as a model trained on them can predict the next action more eas- ily. An higher Utility indicates a better clustering. Both the Silhouette Index and the Utility are the appropriate metrics to use as they can validate the cluster analysis in the absence of ground truth.4 Benchmarks To the best of our knowledge this is the first approach to tackle policy clustering under anonymous state- action pairs. We first compare our approach against data clustering methods, which represent a natural first attempt to cluster anonymous observations: • We consider K-Means (Hartigan and Wong, 1979) to group the anonymous observations, using the state-action pairs di- rectly (K-Means), or their 2d embedding Z obtained through UMAP (K-Means (Z)). • We consider Deep Clustering Network (DCN) (Mukherjee et al., 2019) that jointly optimizes dimensionality reduction and clustering. The dimensionality reduction is accom- plished via learning a deep autoencoder. We apply DCN on the anonymous state-action pairs. • We consider ClusterGAN (Mukherjee et al., 2019) that clusters by back-projecting the data to the latent-space learned by a generative adversarial network (GAN) (Good- fellow et al., 2020). It introduces a mixture of one-hot and continuous variables as latent variables, which retain infor- 4We provide a mathematical definition of the metrics in Ap- pendix C.1. 7 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Dataset Algorithm ARI NMI Purity Abides π3 (Byrd et al., 2019) Abides π4 (Byrd et al., 2019) Figure 3: Two-dimensional space visualization of state-action pairs and learned clustering embedding, using UMAP. K-SHAP better reveals the intrinsic clustering structure among data. Abides π5 (Byrd et al., 2019) mation about the data and reveal some intrinsic clustering structure. • We also consider HC-MGAN (de Mello et al., 2022), a Hierarchical Clustering approach using Multiple GANs to implicitly learn a latent representation of the data. In partic- ular, this work clusters data by exploiting the fact that each GAN tends to generate data that correlates with a sub-region of the real data distribution. Finally, we consider Σ-GIRL (Ramponi et al., 2020), a re- cent work that solves an intention-clustering problem. This work clusters agents based on their goals in an expectation- maximization (EM) fashion, using IRL in the maximization step. It solves a problem similar to ours, but it does not consider anonymous state-action pairs. We consider a mod- ified version called EM K-Clustering. Instead of a joint optimization process in which we learn the agent-cluster assignments and the reward functions through IRL, we learn the observation-cluster assignments and the policy functions through IL. We consider a Neural Network (NN) to learn the policies through IL. 4.1. Multi-Agent Synthetic Data Table 1 investigates the algorithm performance using the simulated market data with ground truth labels. In all the sce- narios, our algorithm K-SHAP outperforms existing work. In Abides π3, K-SHAP outperforms other approaches of around 300% in terms of ARI and NMI, while it consistently and significantly shows the best performance in all Abides scenarios. In the scenarios with two RL agents, most of the approaches fail to distinguish between the two different strategies. However, when we apply K-SHAP using a 2- dimensional embedding of the SHAP values (K-SHAP (Z)) we obtain encouraging results. It achieves 10 times better performance in terms of ARI and NMI. It is worth noticing that the purity score is less relevant with only two clusters (e.g., if we put all the observations in one cluster, we still obtain a purity score of 0.5). Figure 3 shows a 2-dimensional visualization of the original K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) HC-MGAN (de Mello et al., 2022) EM K-Clustering K-SHAP K-SHAP (Z) K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) HC-MGAN (de Mello et al., 2022) EM K-Clustering K-SHAP K-SHAP (Z) K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) HC-MGAN (de Mello et al., 2022) EM K-Clustering K-SHAP K-SHAP (Z) K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) HC-MGAN (de Mello et al., 2022) EM K-Clustering K-SHAP K-SHAP (Z) K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) HC-MGAN (de Mello et al., 2022) EM K-Clustering K-SHAP K-SHAP (Z) K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) HC-MGAN (de Mello et al., 2022) EM K-Clustering K-SHAP K-SHAP (Z) 0.00±0.00 0.00±0.00 0.11±0.10 0.10±0.09 0.03±0.01 0.13±0.07 0.50±0.10 0.23±0.00 0.00±0.00 0.00±0.00 0.08±0.08 0.04±0.06 0.04±0.01 0.08±0.04 0.35±0.07 0.21±0.08 0.00±0.00 0.01±0.00 0.07±0.06 0.08±0.04 0.04±0.01 0.07±0.03 0.22±0.08 0.20±0.03 0.00±0.00 0.01±0.00 0.06±0.04 0.06±0.03 0.02±0.00 0.07±0.03 0.15±0.01 0.15±0.02 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.42±0.20 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.02±0.00 0.02±0.00 0.25±0.07 0.00±0.00 0.00±0.00 0.14±0.14 0.14±0.12 0.07±0.02 0.15±0.11 0.56±0.05 0.25±0.00 0.00±0.00 0.00±0.00 0.11±0.12 0.06±0.04 0.07±0.01 0.11±0.06 0.52±0.02 0.32±0.03 0.01±0.00 0.01±0.00 0.10±0.08 0.11±0.05 0.07±0.00 0.12±0.06 0.37±0.06 0.33±0.01 0.01±0.00 0.01±0.00 0.10±0.07 0.11±0.07 0.05±0.01 0.12±0.04 0.31±0.01 0.29±0.01 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.35±0.15 0.00±0.00 0.00±0.00 0.00±0.00 0.00±0.00 0.01±0.00 0.01±0.00 0.01±0.00 0.20±0.06 0.35±0.00 0.35±0.00 0.33±0.25 0.50±0.08 0.42±0.02 0.53±0.07 0.77±0.03 0.60±0.00 0.27±0.01 0.28±0.00 0.24±0.19 0.33±0.07 0.36±0.02 0.43±0.10 0.65±0.11 0.55±0.03 0.23±0.00 0.24±0.00 0.22±0.17 0.33±0.04 0.29±0.01 0.40±0.12 0.51±0.10 0.50±0.06 0.20±0.01 0.21±0.00 0.19±0.15 0.29±0.04 0.23±0.01 0.38±0.15 0.42±0.01 0.42±0.02 0.58±0.00 0.58±0.00 0.37±0.27 0.58±0.00 0.58±0.00 0.58±0.00 0.58±0.00 0.81±0.10 0.56±0.00 0.56±0.00 0.39±0.28 0.56±0.00 0.58±0.01 0.58±0.00 0.56±0.00 0.75±0.04 Table 1: Multi-Agent Synthetic Data Abides π6 (Byrd et al., 2019) RL-Agents Bubble (Liu et al., 2022) RL-Agents Sine (Liu et al., 2022) state-action pairs against the learned clustering embedding for DCN, ClusterGAN, and K-SHAP. We omit K-Means and EM K-Clustering, as they do not use embedding repre- sentations. We consider Abides π4 and the colors represent the ground-truth labels. The figure clearly shows how the original state-action pairs do not retain any natural struc- ture to help the clustering. Moreover, ClusterGAN latent space does not efficiently cluster the observations, while DCN only partially identifies Market Makers observations. Instead, for our algorithm the SHAP values better reveal the intrinsic clustering structure among data, and only Noise Agents, which place random orders, are slightly confused with Momentum Agents. 4.2. Historical Market Data Finally, we consider an experiment with historical market data from NASDAQ stock exchange where agent IDs are not available. We define the Utility as the percentage difference between the mean squared error (MSE) obtained by a NN trained over all the state-action pairs, and the MSE obtained by k NNs trained over the identified clusters. Each NN predicts the next action a given the current market state s, and all the NNs have the same architecture. 8 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Stock Algorithm Utility Silhouette ADAP (NASDAQ, 2022) AINV (NASDAQ, 2022) AVXL (NASDAQ, 2022) K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) EM K-Clustering K-SHAP K-SHAP (Z) K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) EM K-Clustering K-SHAP K-SHAP (Z) K-Means K-Means (Z) ClusterGAN (Mukherjee et al., 2019) DCN (Yang et al., 2017) EM K-Clustering K-SHAP K-SHAP (Z) 0.00±0.00 0.06±0.01 0.12±0.11 0.00±0.00 0.47±0.02 0.33±0.00 0.21±0.04 0.00±0.00 0.05±0.02 0.07±0.06 0.00±0.00 0.43±0.02 0.19±0.06 0.10±0.05 0.00±0.01 0.05±0.04 0.13±0.03 0.14±0.04 0.53±0.04 0.36±0.01 0.24±0.05 0.23±0.01 0.00±0.01 0.02±0.01 0.00±0.00 0.01±0.01 0.12±0.00 0.00±0.01 0.24±0.00 0.00±0.00 0.01±0.01 0.00±0.01 0.01±0.03 0.11±0.06 0.01±0.01 0.21±0.00 0.12±0.04 0.01±0.01 0.02±0.02 0.01±0.02 0.09±0.00 0.02±0.03 Table 2: Historical Market Data Table 2 shows that K-Means always achieves the best Sil- houette while the best algorithm for the Utility is EM K- Clustering. However, K-Means optimizes the clusters for within-cluster sum-of-squares which maximizes the Silhou- ette; while EM K-Clustering optimizes the clusters using k policies in an EM fashion, which indirectly maximizes the Utility metric. Both the approaches easily succeed in these metrics but they fail short in the other metric: K-Means has 0 Utility, and EM K-Clustering has 0.01 Silhouette. Instead, K-SHAP achieves a good trade-off between Silhouette and Utility, without maximizing any of them directly. In all the scenarios we consider k = 3, we refer to Appendix D.3 for more experiments and charts. 4.3. The impact of state features While K-SHAP is most effective when the latent policies use multiple state features to make decisions, K-SHAP can also distinguish strategies using only few features. Given the local accuracy property (see Section 2.5), the local ex- planation φi for a state feature i can be both negative or positive, with different magnitudes according to the impact on the action. Therefore, policies that use the same few features, but in different ways, can still be distinguished; while with null states our approach may fail. To better study the applicability of our approach with few and no features, we created an iterated prisoner's dilemma and a one-shot prison dilemma. First, we consider a strategy that always "betrays" and one that always "cooperates". K-SHAP achieves P urity = 0.5, NMI = 0 and ARI = 0 (i.e., random clusters) when It achieves P urity=NMI=ARI=1 (i.e., the state is null. perfect clusters) when the state is provided (i.e., time-step and previous opponent's action). In the latter scenario, with just a two-dimensional state space, the SHAP latent space is meaningful and can be used to distinguish the policies. "cooperates" and a strategy that flips his behavior w.r.t. the previous action. When the state is null we have random clus- ters. When the state is provided (i.e., time-step and previous action) K-SHAP achieves P urity = 0.75, N M I = 0.35, and ARI = 0.25. We introduced this example to highlight that: while the SHAP values φ can be useful even when the strategies rely on the same few features, the world policy may underfit with such a small state space and overlapping agent strategies, resulting in worse clusters. We conclude that the number of state features, and how the latent policies use them, is important for both the SHAP values and the world policy. 5. Conclusions and Future Work We proposed a Policy Clustering algorithm, K-SHAP, that groups anonymous state-action pairs according to the agent strategies. We framed the problem as an IL to learn a com- pact representation of the agent strategies as a world-policy; we explained such a policy using SHAP; finally, we use the SHAP values to group observations according to the agent behaviors. We shown that K-SHAP consistently outper- forms existing work on both synthetic and real market data. As we only access anonymous observations, the current approach works well when the actions are mostly driven by the state features: K-SHAP has not enough information to classify an action driven only by a sequence of previous actions, unless the state retains traces of the agent actions. Similarly, identical state-action pairs cannot be classified with different strategies. As future work, we envisioned to further explore and apply K-SHAP in these scenarios. Please refer to the appendix for more detailed experiments and discussions on our work impact. Disclaimer This paper was prepared for informational purposes by the Artificial Intelligence Research group of JPMorgan Chase & Co. and its affiliates ("J.P. Morgan"), and is not a product of the Research Department of J.P. Morgan. J.P. Morgan makes no representation and warranty whatsoever and disclaims all liability, for the completeness, accuracy or reliability of the information contained herein. This document is not intended as investment research or investment advice, or a recommendation, offer or solicitation for the purchase or sale of any security, financial instrument, financial product or service, or to be used in any way for evaluating the merits of participating in any transaction, and shall not constitute a solicitation under any jurisdiction or to any person, if such solicitation under such jurisdiction or to such person would be unlawful. Acknowledgements As a further example we consider a strategy that always Images are in part designed by Macrovector / Freepik. 9 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs References Selim Amrouni, Aymeric Moulin, Jared Vann, Svitlana Vyetrenko, Tucker Balch, and Manuela Veloso. Abides- gym: gym environments for multi-agent discrete event simulation and application to financial markets. In Pro- ceedings of the Second ACM International Conference on AI in Finance, pages 1–9, 2021. Zoe Ashwood, Aditi Jha, and Jonathan W Pillow. Dynamic inverse reinforcement learning for characterizing animal behavior. In Advances in Neural Information Processing Systems. Monica Babes, Vukosi Marivate, Kaushik Subramanian, and Michael L Littman. Apprenticeship learning about multiple intentions. In Proceedings of the 28th interna- tional conference on machine learning (ICML-11), pages 897–904, 2011. Joseph B Bak-Coleman, Mark Alfano, Wolfram Barfuss, Carl T Bergstrom, Miguel A Centeno, Iain D Couzin, Jonathan F Donges, Mirta Galesic, Andrew S Gersick, Jennifer Jacquet, et al. Stewardship of global collective behavior. Proceedings of the National Academy of Sci- ences, 118(27):e2025764118, 2021. Jean-Philippe Bouchaud, Julius Bonart, Jonathan Donier, and Martin Gould. Trades, quotes and prices: financial markets under the microscope. Cambridge University Press, 2018. David Byrd, Maria Hybinette, and Tucker Hybinette Balch. Abides: Towards high-fidelity market simulation for ai research. arXiv preprint arXiv:1904.12066, 2019. Haoyang Cao, Samuel Cohen, and Lukasz Szpruch. Iden- tifiability in inverse reinforcement learning. Advances in Neural Information Processing Systems, 34:12362– 12373, 2021. Tanmoy Chakraborty and Michael Kearns. Market making and mean reversion. In Proceedings of the 12th ACM con- ference on Electronic commerce, pages 307–314, 2011. Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, pages 785–794, 2016. Nuttapong Chentanez, Andrew Barto, and Satinder Singh. Intrinsically motivated reinforcement learning. Advances in neural information processing systems, 17, 2004. Andrea Coletta, Matteo Prata, Michele Conti, Emanuele Mercanti, Novella Bartolini, Aymeric Moulin, Svitlana Vyetrenko, and Tucker Balch. Towards realistic market simulations: a generative adversarial networks approach. In Proceedings of the Second ACM International Confer- ence on AI in Finance, pages 1–9, 2021. Andrea Coletta, Aymeric Moulin, Svitlana Vyetrenko, and Tucker Balch. Learning to simulate realistic limit order book markets from data as a world agent. In Proceed- ings of the Third ACM International Conference on AI in Finance, pages 428–436, 2022. Daniel PM de Mello, Renato M Assunc ̧ao, and Fabricio Murai. Top-down deep clustering with multi-generator gans. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 7770–7778, 2022. Kshama Dwarakanath, Svitlana Vyetrenko, and Tucker Balch. Equitable marketplace mechanism design. In Proceedings of the Third ACM International Conference on AI in Finance, pages 232–239, 2022. Rudresh Dwivedi, Devam Dave, Het Naik, Smiti Singhal, Omer Rana, Pankesh Patel, Bin Qian, Zhenyu Wen, Tejal Shah, Graham Morgan, et al. Explainable ai (xai): core ideas, techniques and solutions. ACM Computing Surveys (CSUR), 2022. Adam Feldman and Tucker Balch. Modeling honey bee behavior for recognition using human trainable models. In Modeling Other Agents from Observations (Workshop at AAMAS), 2004. Justin Fu, Andrea Tacchetti, Julien Perolat, and Yoram Bachrach. Evaluating strategic structures in multi-agent inverse reinforcement learning. Journal of Artificial In- telligence Research, 71:925–951, 2021. Dhananjay K Gode and Shyam Sunder. Allocative efficiency of markets with zero-intelligence traders: Market as a partial substitute for individual rationality. Journal of political economy, 101(1):119–137, 1993. Robert L Goldstone and Marco A Janssen. Computational models of collective behavior. Trends in cognitive sci- ences, 9(9):424–430, 2005. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. Communications of the ACM, 63(11):139–144, 2020. Frank Cichos, Kristian Gustavsson, Bernhard Mehlig, and Giovanni Volpe. Machine learning for active matter. Na- ture Machine Intelligence, 2(2):94–103, 2020. David Ha and J ̈urgen Schmidhuber. Recurrent world models facilitate policy evolution. Advances in neural informa- tion processing systems, 31, 2018. 10 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Bj ̈orn Hagstr ̈omer and Lars Nord ́en. The diversity of high-frequency traders. Journal of Financial Markets, 16(4):741–770, 2013. Scott M Lundberg, Gabriel G Erion, and Su-In Lee. Consis- tent individualized feature attribution for tree ensembles. arXiv preprint arXiv:1802.03888, 2018. John A Hartigan and Manchek A Wong. Algorithm as 136: A k-means clustering algorithm. Journal of the royal statistical society. series c (applied statistics), 28(1):100– 108, 1979. Jonathan Ho and Stefano Ermon. Generative adversarial imitation learning. Advances in neural information pro- cessing systems, 29, 2016. Lawrence Hubert and Phipps Arabie. Comparing partitions. Journal of classification, 2(1):193–218, 1985. Ahmed Hussein, Mohamed Medhat Gaber, Eyad Elyan, and Chrisina Jayne. Imitation learning: A survey of learning methods. ACM Computing Surveys (CSUR), 50(2):1–35, 2017. Zheheng Jiang, Danny Crookes, Brian D Green, Yunfeng Zhao, Haiping Ma, Ling Li, Shengping Zhang, Dacheng Tao, and Huiyu Zhou. Context-aware mouse behavior recognition using hidden markov models. IEEE Transac- tions on Image Processing, 28(3):1133–1148, 2018. Andrei Kirilenko, Albert S Kyle, Mehrdad Samadi, and Tugkan Tuzun. The flash crash: High-frequency trad- ing in an electronic market. The Journal of Finance, 72(3):967–998, 2017. Gregory D Koblentz. Chemical-weapon use in syria: atroci- ties, attribution, and accountability. The Nonproliferation Review, 26(5-6):575–598, 2019. Blake LeBaron. Agent-based computational finance. Hand- book of computational economics, 2:1187–1233, 2006. Guangyu Li, Bo Jiang, Hao Zhu, Zhengping Che, and Yan Liu. Generative attention networks for multi-agent behav- ioral modeling. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7195–7202, 2020. Penghang Liu, Kshama Dwarakanath, and Svitlana S Vyetrenko. Biased or limited: Modeling sub-rational human investors in financial markets. arXiv preprint arXiv:2210.08569, 2022. Luca Luceri, Silvia Giordano, and Emilio Ferrara. Detect- ing troll behavior via inverse reinforcement learning: A case study of russian trolls in the 2016 us election. In Proceedings of the international AAAI conference on web and social media, volume 14, pages 417–427, 2020. Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. Advances in neural infor- mation processing systems, 30, 2017. Scott M Lundberg, Gabriel Erion, Hugh Chen, Alex De- Grave, Jordan M Prutkin, Bala Nair, Ronit Katz, Jonathan Himmelfarb, Nisha Bansal, and Su-In Lee. From local explanations to global understanding with explainable ai for trees. Nature machine intelligence, 2(1):56–67, 2020. Leland McInnes, John Healy, and James Melville. Umap: Uniform manifold approximation and projection for di- mension reduction. arXiv preprint arXiv:1802.03426, 2018. Leland McInnes, John Healy, Nathaniel Saul, and Lukas Grossberger. Umap: Uniform manifold approximation and projection. The Journal of Open Source Software, 3(29):861, 2018. Sudipto Mukherjee, Himanshu Asnani, Eugene Lin, and Sreeram Kannan. Clustergan: Latent space clustering in generative adversarial networks. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 4610–4617, 2019. NASDAQ. Nasdaq total view, 2022. Andrew Y Ng, Stuart Russell, et al. Algorithms for inverse reinforcement learning. In Icml, volume 1, page 2, 2000. F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cour- napeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit- learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. Giorgia Ramponi, Amarildo Likmeta, Alberto Maria Metelli, Andrea Tirinzoni, and Marcello Restelli. Truly batch model-free inverse reinforcement learning about multiple intentions. In International Conference on Artifi- cial Intelligence and Statistics, pages 2359–2369. PMLR, 2020. Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you? explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pages 1135–1144, 2016. Thomas Rid and Ben Buchanan. Attributing cyber attacks. Journal of Strategic Studies, 38(1-2):4–37, 2015. Peter J Rousseeuw. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of computational and applied mathematics, 20:53–65, 1987. 11 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Bo Yang, Xiao Fu, Nicholas D Sidiropoulos, and Mingyi Hong. Towards k-means-friendly spaces: Simultaneous deep learning and clustering. In international conference on machine learning, pages 3861–3870. PMLR, 2017. Jeremy J Siegel. What is an asset price bubble? an op- erational definition. European financial management, 9(1):11–24, 2003. Jiaming Song, Hongyu Ren, Dorsa Sadigh, and Stefano Er- mon. Multi-agent generative adversarial imitation learn- ing. Advances in neural information processing systems, 31, 2018. Simon Suo, Sebastian Regalado, Sergio Casas, and Raquel Urtasun. Trafficsim: Learning to simulate realistic multi- agent behaviors. In Proceedings of the IEEE/CVF Confer- ence on Computer Vision and Pattern Recognition, pages 10400–10409, 2021. Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018. Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008. Nguyen Xuan Vinh, Julien Epps, and James Bailey. Infor- mation theoretic measures for clusterings comparison: is a correction for chance necessary? In Proceedings of the 26th annual international conference on machine learning, pages 1073–1080, 2009. Svitlana Vyetrenko, David Byrd, Nick Petosa, Mahmoud Mahfouz, Danial Dervovic, Manuela Veloso, and Tucker Balch. Get real: Realism metrics for robust limit order In Proceedings of the First book market simulations. ACM International Conference on AI in Finance, pages 1–8, 2020. Elaine Wah, Mason Wright, and Michael P Wellman. Wel- fare effects of market making in continuous double auc- tions. Journal of Artificial Intelligence Research, 59:613– 650, 2017. Xintong Wang, Christopher Hoang, Yevgeniy Vorobeychik, and Michael P. Wellman. Spoofing the limit order book: A strategic agent-based analysis. Games, 12(2), 2021. Shoichiro Yamaguchi, Honda Naoki, Muneki Ikeda, Yuki Tsukada, Shunji Nakano, Ikue Mori, and Shin Ishii. Identification of animal behavioral strategies by inverse reinforcement learning. PLoS computational biology, 14(5):e1006122, 2018. Steve Yang, Mark Paddrik, Roy Hayes, Andrew Todd, An- drei Kirilenko, Peter Beling, and William Scherer. Be- havior based learning in identifying high frequency trad- In 2012 IEEE Conference on Compu- ing strategies. tational Intelligence for Financial Engineering & Eco- nomics (CIFEr), pages 1–8. IEEE, 2012. 12 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs A. Broader Impact Our paper introduces a first approach to understand agent strategies and their interaction in anonymized systems. In general, we believe this is an important research area to develop more accurate computational models of complex systems (Goldstone and Janssen, 2005), resulting in a better understanding of agent behaviors needed to design more suitable solutions (Bak- Coleman et al., 2021). For example, in financial markets, identifying archetypal behavioral strategies allows to construct market simulation environments that can reproduce important structural properties of the market (LeBaron, 2006). Experimentation with counterfactual scenarios in such simulators has been documented to provide significant benefits for the financial community. For instance: • Agent-based simulation that was constructed with similar archetypal agents was used to replay May 2010 flash crash scenario – hence, promoting the understanding of the flash crash and allowing to subsequently design the policies that prevent flash crashes in the future (Kirilenko et al., 2017). • Another benefit of our approach to financial systems is the investigation of market mechanisms that can make markets more fair – it was demonstrated in simulated market environments that stock exchanges can implement the dynamic fee policy in order to enable equitability of outcomes to market participants (Dwarakanath et al., 2022). • Additionally, evaluating trading strategies or assumptions against poorly calibrated agent-based models can lead to harmful and misleading conclusions (e.g., a severe market crash in 1987 causing $1.71 trillion losses is attributed to the prevalence of simplistic market models) (Bouchaud et al., 2018) - hence, it is imperative to build reliable market simulation models for the overall market stability. B. Details of the Datasets Here we introduce experimental details that do not fit into the main body of the paper. In our experiments, we consider a stock market in which multiple agents (i.e., traders) interact by selling and buying shares. We consider a synthetic simulated market, which serves as ground truth, and historical market data from NASDAQ stock exchange (NASDAQ, 2022). Each state-action pair is generated by a trader in the market. The state represents the recent and ongoing stock market state (e.g., the price, volume and volatility of the stock) and the action is the agent trade (e.g., buy/sell a given number of shares at price x). In the following, we discuss in detail how we construct the synthetic datasets, and we summarize the main statistics of both synthetic and historical market data. B.1. Multi-Agent Synthetic data All the synthetic datasets have been generated using a state-of-art multi-agent simulator called ABIDES (Byrd et al., 2019), and its OpenAI Gym extension called ABIDES-gym (Amrouni et al., 2021). The simulator is written in Python3, and it is publicly available at https://github.com/jpmorganchase/abides-jpmc-public. It is a high-fidelity multi-agent market simulation used by practitioners and researchers to generate synthetic markets. The market is generated by simulating the interactions between a given set of agents, for which we can define the number, type, and strategy to simulate different markets. More details on the simulator can be found in the original ABIDES paper (Byrd et al., 2019). Agent Strategies Here we describe the agent strategies in detail: • Market Making agents provide liquidity to the market by both buying and selling shares while making a profit by keeping a low net position. We use the implementation provided in the public repository of ABIDES, (i.e., adaptive market maker agent.py) that follows the Chakraborty-Kearns 'ladder' market-making strat- egy (Chakraborty and Kearns, 2011), wherein the size of orders placed at each level is set as a fraction of measured transacted volume in the previous time period. • Noise agents belong to the class of Zero Intelligence (ZI) agents introduced in (Gode and Sunder, 1993) to model agents that do not base their trading decisions on the knowledge of market microstructure. Noise agents wake up once in the trading day, and place one order randomly. Both their order direction d ∈ {buy, sell}, and volume v ∈ [1, 100] are randomly sampled, while the order price is the best available on the market (i.e., near touch). We use the implementation provided in the public repository of ABIDES, i.e., noise agent.py. 13 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs • Fundamental Trading agents belong to the class of ZI agents, but have access to an exogenous fundamental value of the stock, which represents the agent's understanding of the outside world (e.g., assets and earnings of the company). These agents trade the stock according this estimated exogenous fundamental value. They believe that if the stock is overpriced w.r.t. to the fundamental value, the price will go down, and vice versa. Therefore, they sell in the first case and buy in the other one. All the agents have a noisy observation of a simulated fundamental value of the stock, which they use to generate orders. They randomly sample the order volume v ∈ [1, 100], while the price is the best available for 90% of the orders (i.e., near touch). For 10% of the orders, they use a more aggressive price close to the far touch. We use the implementation provided in the public repository of ABIDES, i.e., value agent.py. • (δ1, δ2)-based Momentum Trading agents trade according to a price momentum indicator of the stock. These agents consider two moving averages (MAs) of the stock price. The short MA is computed using the price values in the previous δ1 minutes, while the long MA considers δ2 minutes. This agent attempts to exploit extreme short-term price moves, by playing a buy order when the short MA δ1 ≥ long MA δ2, and a sell order otherwise. The order volume v ∈ [1, 100] is randomly sampled, and the price is the best available (i.e., near touch). We extended the implementation provided in the public repository of ABIDES, (i.e., momentum agent.py) by changing the MA windows. • Irrational RL Trading agents model a sub-rational human behavior. We train these RL agents according to the original paper (Liu et al., 2022), in which the authors model a myopic human investor by decreasing the discount factor γ in the Bellman equation (Sutton and Barto, 2018). Therefore, as γ → 0 the RL agent becomes more myopic and trades to maximize only a one-step reward. In the experiments the Irrational RL agents use γ = 0.01. • Rational RL Trading agents (Liu et al., 2022) model an electronic (i.e., rational) trading algorithm. We train these RL agents according to the original paper (Liu et al., 2022), in which the authors increase the discount γ to have a fully rational agent that considers both short-term and long-term rewards. In the experiments the Rational RL agents use γ = 0.99. Market Scenarios We combine the agent strategies to generate six different market scenarios. • In the first four scenarios (Abides π3, Abides π4, Abides π5, and Abides π6) we simulate 4 days of synthetic market, considering for each strategy the following number of agents: 5000 Noise agents; 110 Fundamental Agents; 2 Market Making Agents; 15 (0.2,0.4)-based Momentum Agents; 15 (12,26)-based Momentum Agents; and 15 (48,96)-based Momentum Agents. The agents trade a synthetic stock priced at around 100$. The market is simulated with nanosecond time resolution, and we consider 29 state features and 3 features for the agent actions (i.e., order depth, volume, and direction). The detailed statistics for these datasets are reported in Table 5 for Abides π3; Table 6 for Abides π4; Table 7 for Abides π5 and Table 8 for Abides π6. We use the implementation provided in the public repository of ABIDES (i.e., rmsc04.py) to define the agent interactions. • The last two scenarios consider RL-based agents, which are simulated according to the two original paper (Liu et al., 2022). In particular we consider a Bubble (Siegel, 2003) market scenario, and a market scenario in which the price follows a sine wave, with the same starting and closing price. In these scenarios, the market is simulated every minute, and the agents have 9 different actions modeled as an integer a ∈ [−4, 4]. The action a ∈ {−4, −3, −2, −1} represents a buy order of size 2, where the value of a represents the order price w.r.t. the mid-price. The action a = 0 represents the HOLD action. The action a ∈ {1, 2, 3, 4} represents a sell order of size 2, where the value of a represents the order price w.r.t. the mid-price. In these scenarios, we simulate 11 days of market data, we consider 20 state features and 1 integer feature for the agent actions. In Table 12 and Table 13 we summarize the dataset properties for the Bubble and Sine market scenarios, respectively. B.2. Historical Market Data Finally, we consider real market data from NASDAQ stock exchange (NASDAQ, 2022). In particular, we use historical market data that includes all the orders submitted to the market, without any agent identifiers. We consider three stocks (i.e., AVXL, AINV, and ADAP) over 4 days from 05th to 8th Jan 2021. The historical data contains anonymous state-action pairs at nanosecond time resolution, and we consider the same 29 state features and 3 action features as in Abides synthetic dataset. Table 9, Table 10, and Table 11, summarize the dataset properties for AINV, AVXL, and ADAP, respectively. 14 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs C. Algorithm and Benchmark details • We consider K-Means (Hartigan and Wong, 1979) to group the anonymous observations, using the state-action pairs directly (K-Means), or their 2d embedding Z obtained through UMAP (K-Means (Z)). We use K-Means implementation provided by scikit-learn (Pedregosa et al., 2011), and the official UMAP implementation (McInnes et al., 2018b). • We consider Deep Clustering Network (DCN) (Mukherjee et al., 2019) that jointly optimizes dimensionality reduction and clustering. The dimensionality reduction is accomplished via learning a deep autoencoder. We apply DCN on the anonymous state-action pairs: we feed both the states and the actions to the deep autoencoder that learns their encoding and reconstruction. We consider the official implementation of the paper available at https://github.com/boyangumn/DCN-New. • We consider ClusterGAN (Mukherjee et al., 2019) that clusters by back-projecting the data to the latent-space. It introduces a mixture of one-hot and continuous variables as latent variables, which retain information about the data and reveal some intrinsic clustering structure. We apply ClusterGAN to the anonymous state-action pairs. We consider the official implementation of the paper available at https://github.com/sudiptodip15/ClusterGAN. • Finally, we consider a modified version of Σ-GIRL (Ramponi et al., 2020). This work solves the intent-clustering problem in an expectation-maximization (EM) fashion, using IRL in the maximization step. Instead of a joint optimization process in which we learn the agent-cluster assignments and the reward functions through IRL, we learn the observation- cluster assignments and the policy functions through IL. In particular, we learn to assign the anonymous observations to k clusters while learning k policies through IL. We consider a Neural Network (NN) to learn the policies through IL. The NN architecture is described in Appendix C. We modified the official implementation of the paper available at https://github.com/gioramponi/sigma-girl-MIIRL. Neural Network Architecture Here we briefly describe the architecture of the NN used in the experiments: to solve the IL task in EM K-Clustering; to model the world-policy in Appendix D.2; and to compute the Utility score C.1. We consider a feedforward Neural Network with 2 linear hidden layers with Leaky ReLU activation function, and respectively 64 and 32 neurons. After Each hidden layer we consider a 0.1-dropout layer. World-Policy Architecture For the Random Forest world-policy we use the implementation provided by scikit-learn (Pe- dregosa et al., 2011), where we fix the number of trees to 100 and we use mean squared error as objective. For UMAP we use the official implementation (McInnes et al., 2018b), and we fix the number of neighbors observations to 15. C.1. Metrics • The purity score ranges from 0 to 1, and it evaluates how homogeneous each cluster is (where 1 being a cluster consists of observations from a single strategy). The purity is defined as follows: purity(Ω, C) = 1 N (cid:88) k max j |Ωk ∩ Cj| where N is the number of observations, k and j are the number of clusters and strategies (ground truth), respectively. We denote with Ω the set of identified clusters, while C represents the ground truth clusters. • The Adjusted Rand Index (ARI) (Hubert and Arabie, 1985) ranges from -1 to 1, and it represents the adjusted for chance version of Rand index, which measures the percentage of correct cluster assignments (where 1 being a perfect clustering and 0 being a random clustering). We use the ARI implementation provided by scikit-learn (Pedregosa et al., 2011), and we refer to the original paper for further details (Hubert and Arabie, 1985). • The Normalized Mutual Information (NMI) (Vinh et al., 2009) ranges from 0 to 1 (where 1 indicated a perfect clustering), and it measures how much information is shared between the clusters and the labels, adjusted by the number of clusters. We use NMI implementation provided by scikit-learn (Pedregosa et al., 2011), and we refer to the original paper for further details (Vinh et al., 2009). • The Silhouette Index (SI) (Rousseeuw, 1987) measures the similarity of each state-action pair to its own cluster compared to other clusters. It ranges between -1 and 1, where 1 indicate the highest degree of confidence that the observation belongs to a correct cluster. Let bi be the mean euclidean distance between a sample i and all other points in the same cluster; and ci 15 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs the mean distance between the sample i and all the other points in the nearest cluster, then the SI is computed as follows: SI = 1 N N (cid:88) i=0 ci − bi max(bi, ci) • The Utility evaluates the learning improvement when we learn a unique policy from all the state-action pairs w.r.t. learning k policies from the identified clusters. Thus, an improvement in Utility indicates that each cluster contains homogeneous state-action pairs in terms of strategy, as a model trained on them can predict the next action more easily. A higher utility indicates a better clustering. In particular, to evaluate the Utility we compare the performance of a NN trained over all the state-action pairs w.r.t. to k NNs trained on the identified clusters. Let εi = ||π(si) − ai||2 be the error for an observation i when the action ai is predicted by a learned policy π. We denote with ˆεi the error when i is predicted by a unique policy ˆπ trained on all the state-action pairs, while we denote with ̄εi the error when i is predicted by a policy ̄π trained on the cluster where i belongs. Thus, the Utility U can be defined as : U = 1 N N (cid:88) i=0 ˆεi − ̄εi ˆεi D. Additional Experiments Here we present additional experiments that do not fit into the main body of the paper. D.1. Unknown number of clusters k In this section, we evaluate the ability of K-SHAP to group the anonymous observations when the number of clusters k is unknown. In such a case we adopt the classic Elbow method to optimize k according to the distortion of the clusters in the SHAP values space. The distortion measures the mean distance of each point to its assigned cluster. Figure 4 shows the performance of K-SHAP when the ground truth number of clusters k is given (left picture) and when k is unknown (right picture). We consider only synthetic data as we do not know the ground truth k for real market data. The picture shows that even if the performance is slightly inferior, K-SHAP maintains a similar trend and satisfactory performance when k is unknown. Figure 4: K-SHAP - Elbow Optimization 16 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs D.2. Contributions of the world-policy model We now evaluate K-SHAP using three different models for the world-policy: • Random Forest - we use the implementation provided by scikit-learn (Pedregosa et al., 2011), where we fix the number of trees to 100 and we use mean squared error as objective. • XGBoost (Chen and Guestrin, 2016) - we use the implementation provided at https://github.com/dmlc/xgboost. We fix the max depth to 100, and we use mean squared error as objective. • Neural Network - we implement a feedforward NN with 2-hidden layers using PyTorch. The architecture details are provided in Appendix C. For each world-policy we also consider a variant that uses a 2d embedding Z of the SHAP values, obtained through UMAP. Table 3 and Table 4 show the results for the different world-policies, for both synthetic and real data. The results on synthetic data confirm that a Random Forest world-policy better suits the anonymous market observations and provides better results. However, also XGBoost achieves comparable performance, while the NN is not able to fully capture the structure of the data, achieving lower performance. The results are similar on the real historical data, even if XGBoost and NN outperform Random Forest for some stocks. In general, the higher the model accuracy in predicting the next action, given the input state, the better the SHAP values and related clustering. Dataset World-Policy ARI NMI Purity Abides π3 (Byrd et al., 2019) Abides π4 (Byrd et al., 2019) Abides π5 (Byrd et al., 2019) Abides π6 (Byrd et al., 2019) RL-Agents Bubble (Liu et al., 2022) RL-Agents Sine (Liu et al., 2022) Random Forest Random Forest (Z) NN NN (Z) XGBoost XGBoost (Z) Random Forest Random Forest (Z) NN NN (Z) XGBoost XGBoost (Z) Random Forest Random Forest (Z) NN NN (Z) XGBoost XGBoost (Z) Random Forest Random Forest (Z) NN NN (Z) XGBoost XGBoost (Z) Random Forest Random Forest (Z) NN NN (Z) XGBoost XGBoost (Z) Random Forest Random Forest (Z) NN NN (Z) XGBoost XGBoost (Z) 0.50±0.10 0.23±0.00 0.03±0.02 0.20±0.01 0.48±0.01 0.34±0.06 0.35±0.07 0.21±0.08 0.04±0.01 0.16±0.04 0.29±0.01 0.24±0.01 0.22±0.08 0.20±0.03 0.06±0.05 0.15±0.01 0.21±0.01 0.20±0.01 0.15±0.01 0.15±0.02 0.12±0.00 0.13±0.01 0.15±0.01 0.16±0.00 0.00±0.00 0.42±0.20 0.00±0.00 0.09±0.07 0.00±0.00 0.00±0.00 0.02±0.00 0.25±0.07 0.00±0.00 0.05±0.00 0.02±0.00 0.01±0.00 0.56±0.05 0.25±0.00 0.05±0.01 0.23±0.01 0.55±0.01 0.41±0.07 0.52±0.02 0.32±0.03 0.06±0.01 0.19±0.05 0.44±0.05 0.35±0.01 0.37±0.06 0.33±0.01 0.09±0.08 0.20±0.01 0.36±0.02 0.32±0.02 0.31±0.01 0.29±0.01 0.20±0.01 0.17±0.01 0.31±0.02 0.26±0.00 0.00±0.00 0.35±0.15 0.00±0.00 0.08±0.07 0.00±0.00 0.00±0.00 0.01±0.00 0.20±0.06 0.00±0.00 0.04±0.00 0.01±0.00 0.00±0.00 0.77±0.03 0.60±0.00 0.42±0.02 0.58±0.01 0.76±0.00 0.69±0.06 0.65±0.11 0.55±0.03 0.35±0.01 0.44±0.03 0.57±0.01 0.56±0.00 0.51±0.10 0.50±0.06 0.30±0.04 0.37±0.01 0.48±0.01 0.48±0.01 0.42±0.01 0.42±0.02 0.31±0.00 0.32±0.01 0.41±0.01 0.40±0.01 0.58±0.00 0.81±0.10 0.58±0.00 0.64±0.06 0.58±0.00 0.58±0.00 0.56±0.00 0.75±0.04 0.56±0.00 0.62±0.00 0.56±0.00 0.56±0.00 Table 3: World Policies - Multi-Agent Synthetic Data Stock World-Policy Utility Silhouette ADAP (NASDAQ, 2022) Random Forest (Z) Random Forest NN NN (Z) XGBoost XGBoost (Z) Random Forest AINV (NASDAQ, 2022) Random Forest (Z) NN NN (Z) XGBoost XGBoost (Z) Random Forest AVXL (NASDAQ, 2022) Random Forest (Z) NN NN (Z) XGBoost XGBoost (Z) 0.33±0.00 0.21±0.04 0.01±0.00 0.00±0.00 0.33±0.01 0.28±0.05 0.19±0.06 0.10±0.05 0.00±0.00 0.00±0.00 0.28±0.00 0.21±0.02 0.36±0.01 0.28±0.06 0.00±0.00 0.00±0.00 0.36±0.01 0.36±0.02 0.12±0.00 0.00±0.01 0.22±0.01 0.01±0.01 0.11±0.00 0.01±0.01 0.11±0.06 0.01±0.01 0.06±0.02 0.03±0.05 0.09±0.00 0.01±0.01 0.09±0.00 0.04±0.05 0.05±0.00 0.05±0.06 0.08±0.00 0.01±0.01 Table 4: World Policies - Historical Market Data 17 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs D.3. Historical market data at varying of number of clusters k In this section, we evaluate the Utility and Silhouette when we vary the number of clusters k from 2 to 6. We use historical market data for AVXL stock. For clarity of the presentation, we remove from the picture the variants of K-Means and K-SHAP that use a dimensionality reduction technique, namely K-Means (Z) and K-SHAP (Z). Figure 5 confirms the trend shown in the paper, and K-SHAP still represents a good trade-off between Utility and Silhouette. For k = 2 K-SHAP groups the state-action pairs mostly into buy and sell orders. These two clusters improve the Silhouette, as the orders in each cluster are more homogeneous, but the Utility is close to 0. In fact, a cluster containing only buy (or sell) observations does not highlight any particular strategy. Figure 5: Historical Market data AVXL at varying of nr. clusters k. 18 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Feature Spread Vol. Imbalance Lev.1 Vol. Imbalance Lev.2 Vol. Imbalance Lev.5 Exec. Vol. Imbalance 1min Exec. Vol. Imbalance 5min Exec. Vol. Imbalance 12min Exec. Vol. Imbalance 26min Price return 1min Price return 5min Price return 12min Price return 26min Price MA 12s Price MA 26s Price MA 60s Price MA 5min Price MA 12min Price MA 26min Price MA 48min Price MA 1h36min Spread MA 12s Spread MA 26s Spread MA 60s Spread MA 5min Spread MA 12min Spread MA 26min Price MA Diff 12s-26s Price MA Diff 12min-26min Price MA Diff 48min-1h36min Order Size Order depth Order Direction mean 2.346 0.500 0.507 0.513 0.462 0.463 0.463 0.463 -0.000 -0.000 -0.000 -0.000 99.966 99.966 99.966 99.966 99.966 99.967 99.970 99.976 1.599 1.594 1.595 1.601 1.606 1.611 0.501 0.392 0.395 41.634 9.217 0.495 min max Type Feature 1.000 0.001 0.002 0.007 0.000 0.187 0.255 0.289 -0.002 -0.003 -0.003 -0.005 99.547 99.532 99.562 99.586 99.599 99.644 99.759 99.832 1.000 1.000 1.000 1.000 1.000 1.000 0.000 0.000 0.000 1.000 -23.000 0.000 Int 67.000 Float 0.999 Float 0.998 Float 0.997 Float 1.000 Float 0.820 Float 0.765 Float 0.725 Float 0.002 Float 0.004 Float 0.006 Float 0.007 Float 100.821 Float 100.822 Float 100.821 Float 100.814 Float 100.804 Float 100.793 Float 100.754 Float 100.567 Float 49.083 Float 57.192 Float 39.950 Float 21.200 Float 13.250 Float 7.885 Float 1.000 Float 1.000 Float 1.000 Int 100.000 91.000 Int 1.000 Bin Spread Vol. Imbalance Lev.1 Vol. Imbalance Lev.2 Vol. Imbalance Lev.5 Exec. Vol. Imbalance 1min Exec. Vol. Imbalance 5min Exec. Vol. Imbalance 12min Exec. Vol. Imbalance 26min Price return 1min Price return 5min Price return 12min Price return 26min Price MA 12s Price MA 26s Price MA 60s Price MA 5min Price MA 12min Price MA 26min Price MA 48min Price MA 1h36min Spread MA 12s Spread MA 26s Spread MA 60s Spread MA 5min Spread MA 12min Spread MA 26min Price MA Diff 12s-26s Price MA Diff 12min-26min Price MA Diff 48min-1h36min Order Size Order depth Order Direction mean 2.647 0.503 0.511 0.517 0.464 0.464 0.464 0.463 -0.000 0.000 0.000 0.000 99.970 99.970 99.970 99.970 99.970 99.969 99.971 99.978 1.638 1.627 1.626 1.632 1.641 1.661 0.512 0.406 0.395 43.883 6.441 0.502 min max Type 1.000 0.001 0.002 0.007 0.000 0.187 0.255 0.289 -0.003 -0.004 -0.004 -0.005 99.534 99.527 99.562 99.586 99.599 99.644 99.759 99.832 1.000 1.000 1.000 1.000 1.000 1.000 0.000 0.000 0.000 1.000 -23.000 0.000 67.000 0.999 0.998 0.997 1.000 0.820 0.765 0.725 0.002 0.004 0.006 0.007 100.821 100.822 100.821 100.814 100.804 100.793 100.754 100.567 49.083 57.192 39.950 21.200 13.250 7.885 1.000 1.000 1.000 100.000 91.000 Int Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Int Int 1.000 Bin Table 5: Summary and Description of Abides π3 Table 6: Summary and Description of Abides π4 Feature Spread Vol. Imbalance Lev.1 Vol. Imbalance Lev.2 Vol. Imbalance Lev.5 Exec. Vol. Imbalance 1min Exec. Vol. Imbalance 5min Exec. Vol. Imbalance 12min Exec. Vol. Imbalance 26min Price return 1min Price return 5min Price return 12min Price return 26min Price MA 12s Price MA 26s Price MA 60s Price MA 5min Price MA 12min Price MA 26min Price MA 48min Price MA 1h36min Spread MA 12s Spread MA 26s Spread MA 60s Spread MA 5min Spread MA 12min Spread MA 26min Price MA Diff 12s-26s Price MA Diff 12min-26min Price MA Diff 48min-1h36min Order Size Order depth Order Direction mean 2.779 0.507 0.509 0.515 0.464 0.462 0.463 0.461 -0.000 -0.000 -0.000 -0.000 99.964 99.964 99.964 99.964 99.964 99.965 99.968 99.975 1.617 1.593 1.590 1.612 1.614 1.604 0.506 0.397 0.374 42.638 4.688 0.486 min max Type Feature 1.000 0.001 0.004 0.005 0.002 0.187 0.255 0.290 -0.002 -0.003 -0.003 -0.005 99.564 99.547 99.577 99.586 99.599 99.644 99.759 99.832 1.000 1.000 1.000 1.000 1.000 1.000 0.000 0.000 0.000 1.000 -23.000 0.000 Int 67.000 Float 0.999 Float 0.998 Float 0.997 Float 0.988 Float 0.819 Float 0.765 Float 0.725 Float 0.002 Float 0.004 Float 0.006 Float 0.007 Float 100.821 Float 100.822 Float 100.821 Float 100.813 Float 100.804 Float 100.793 Float 100.754 Float 100.567 Float 46.250 Float 57.192 Float 33.100 Float 21.200 Float 13.250 Float 7.885 Float 1.000 Float 1.000 Float 1.000 Int 100.000 91.000 Int 1.000 Bin Spread Vol. Imbalance Lev.1 Vol. Imbalance Lev.2 Vol. Imbalance Lev.5 Exec. Vol. Imbalance 1min Exec. Vol. Imbalance 5min Exec. Vol. Imbalance 12min Exec. Vol. Imbalance 26min Price return 1min Price return 5min Price return 12min Price return 26min Price MA 12s Price MA 26s Price MA 60s Price MA 5min Price MA 12min Price MA 26min Price MA 48min Price MA 1h36min Spread MA 12s Spread MA 26s Spread MA 60s Spread MA 5min Spread MA 12min Spread MA 26min Price MA Diff 12s-26s Price MA Diff 12min-26min Price MA Diff 48min-1h36min Order Size Order depth Order Direction mean 2.904 0.507 0.511 0.516 0.465 0.463 0.463 0.462 -0.000 0.000 0.000 -0.000 99.967 99.967 99.967 99.968 99.967 99.967 99.969 99.976 1.635 1.614 1.608 1.634 1.644 1.643 0.514 0.408 0.380 44.081 3.617 0.489 min max Type 1.000 0.001 0.004 0.005 0.002 0.187 0.255 0.290 -0.003 -0.004 -0.004 -0.005 99.534 99.527 99.576 99.586 99.599 99.644 99.759 99.832 1.000 1.000 1.000 1.000 1.000 1.000 0.000 0.000 0.000 1.000 -23.000 0.000 67.000 0.999 0.998 0.997 1.000 0.819 0.765 0.725 0.002 0.004 0.006 0.007 100.821 100.822 100.821 100.813 100.804 100.793 100.754 100.567 46.250 57.192 33.100 21.200 13.250 7.885 1.000 1.000 1.000 100.000 91.000 Int Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Int Int 1.000 Bin Table 7: Summary and Description of Abides π5 Table 8: Summary and Description of Abides π6 19 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Feature mean min max Type Feature mean min max Type Spread Vol. Imbalance Lev.1 Vol. Imbalance Lev.2 Vol. Imbalance Lev.5 Exec. Vol. Imbalance 1min Exec. Vol. Imbalance 5min Exec. Vol. Imbalance 12min Exec. Vol. Imbalance 26min Price return 1min Price return 5min Price return 12min Price return 26min Price MA 12s Price MA 26s Price MA 60s Price MA 5min Price MA 12min Price MA 26min Price MA 48min Price MA 1h36min Spread MA 12s Spread MA 26s Spread MA 60s Spread MA 5min Spread MA 12min Spread MA 26min Price MA Diff 12s-26s Price MA Diff 12min-26min Price MA Diff 48min-1h36min Order Size Order depth Order Direction 2.719 0.477 0.488 0.482 0.615 0.663 0.671 0.650 0.000 0.000 0.000 0.000 11.258 11.257 11.257 11.257 11.256 11.256 11.261 10.380 2.506 2.517 2.536 2.664 2.802 3.035 0.582 0.516 0.452 105.494 0.655 0.550 1.000 0.001 0.008 0.070 0.000 0.000 0.000 0.034 -0.008 -0.014 -0.022 -0.030 10.416 10.419 10.421 10.430 10.452 10.465 10.482 10.492 1.000 1.000 1.000 1.000 1.000 1.154 0.000 0.000 0.000 1.000 -4.000 0.000 Int 12.000 Float 0.999 Float 0.997 Float 0.938 Float 1.000 Float 1.000 Float 1.000 Float 1.000 Float 0.011 Float 0.012 Float 0.016 Float 0.021 Float 12.131 Float 12.133 Float 12.129 Float 12.131 Float 12.198 Float 12.252 Float 12.375 Float 11.471 Float 10.333 Float 9.846 Float 8.300 Float 9.400 Float 11.500 Float 18.154 Float 1.000 Float 1.000 Float 1.000 Int 300.000 74.000 Int 1.000 Bin Spread Vol. Imbalance Lev.1 Vol. Imbalance Lev.2 Vol. Imbalance Lev.5 Exec. Vol. Imbalance 1min Exec. Vol. Imbalance 5min Exec. Vol. Imbalance 12min Exec. Vol. Imbalance 26min Price return 1min Price return 5min Price return 12min Price return 26min Price MA 12s Price MA 26s Price MA 60s Price MA 5min Price MA 12min Price MA 26min Price MA 48min Price MA 1h36min Spread MA 12s Spread MA 26s Spread MA 60s Spread MA 5min Spread MA 12min Spread MA 26min Price MA Diff 12s-26s Price MA Diff 12min-26min Price MA Diff 48min-1h36min Order Size Order depth Order Direction 3.038 0.479 0.478 0.479 0.536 0.574 0.584 0.569 -0.000 -0.000 -0.001 -0.002 5.560 5.561 5.561 5.560 5.561 5.564 5.569 5.574 2.804 2.835 2.887 3.067 3.216 3.374 0.547 0.465 0.517 149.949 1.599 0.497 1.000 0.000 0.001 0.048 0.000 0.000 0.000 0.010 -0.016 -0.022 -0.030 -0.041 5.132 5.140 5.140 5.143 5.145 5.153 5.160 5.179 1.000 1.000 1.000 1.000 1.167 1.308 0.000 0.000 0.000 1.000 -4.000 0.000 12.000 1.000 0.999 0.974 1.000 1.000 1.000 0.972 0.011 0.016 0.021 0.033 6.020 6.017 6.015 6.015 6.010 6.009 5.997 6.026 11.917 15.192 16.783 16.000 13.417 15.885 1.000 1.000 1.000 600.000 94.000 Int Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Float Int Int 1.000 Bin Table 9: Summary and Description of AINV stock data Table 10: Summary and Description of AVXL stock data Feature mean min max Type Spread Vol. Imbalance Lev.1 Vol. Imbalance Lev.2 Vol. Imbalance Lev.5 Exec. Vol. Imbalance 1min Exec. Vol. Imbalance 5min Exec. Vol. Imbalance 12min Exec. Vol. Imbalance 26min Price return 1min Price return 5min Price return 12min Price return 26min Price MA 12s Price MA 26s Price MA 60s Price MA 5min Price MA 12min Price MA 26min Price MA 48min Price MA 1h36min Spread MA 12s Spread MA 26s Spread MA 60s Spread MA 5min Spread MA 12min Spread MA 26min Price MA Diff 12s-26s Price MA Diff 12min-26min Price MA Diff 48min-1h36min Order Size Order depth Order Direction 2.254 0.459 0.462 0.475 0.568 0.582 0.574 0.565 0.001 0.002 0.004 0.007 5.994 5.993 5.992 5.990 5.984 5.974 5.964 5.953 2.193 2.199 2.238 2.397 2.688 3.098 0.609 0.605 0.560 156.239 1.069 0.546 1.000 0.000 0.002 0.068 0.000 0.000 0.000 0.004 -0.027 -0.038 -0.054 -0.069 5.260 5.260 5.260 5.281 5.329 5.373 5.411 5.448 1.000 1.000 1.000 1.000 1.000 1.000 0.000 0.000 0.000 1.000 -4.000 0.000 Int 26.000 Float 1.000 Float 0.998 Float 0.967 Float 1.000 Float 1.000 Float 1.000 Float 1.000 Float 0.025 Float 0.053 Float 0.056 Float 0.077 Float 6.405 Float 6.404 Float 6.401 Float 6.393 Float 6.375 Float 6.391 Float 6.407 Float 6.433 Float 23.667 Float 26.192 Float 28.350 Float 25.200 Float 27.333 Float 18.077 Float 1.000 Float 1.000 Float 1.000 Int 600.000 50.000 Int 1.000 Bin Table 11: Summary and Description of ADAP stock data 20 K-SHAP: Policy Clustering Algorithm for Anonymous State-Action Pairs Feature mean min max Type Feature mean min max Type Price Best Ask Price Best Bid Vol Best Ask Vol Best Bid Exec. Vol Ask 1min Exec. Vol Bid 1min Book depth Ask Book depth Bid Last Exec Price Volatility 30 min Spread Price Norm. Price MA 1min Norm. Price MA 2min Norm. Price MA 3min Norm. Price MA 5min Norm. Price MA 6min Norm. Price MA 10min Norm. Price MA 15min Norm. Price MA 30min Action 99.893 99.892 51.604 43.314 3.504 3.800 14.420 15.873 99.884 72.411 1.013 99.892 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 0.319 98.858 98.857 0.000 0.000 0.000 0.000 0.000 0.000 98.857 0.000 0.000 98.857 0.992 0.992 0.988 0.987 0.987 0.987 0.988 0.987 -4.000 100.352 100.350 1443.000 1000.000 400.000 298.000 1378.000 1342.000 100.302 608.599 2.000 100.350 1.011 1.012 1.012 1.012 1.012 1.013 1.013 1.013 4.000 Float Float Int Int Int Int Int Int Float Float Int Float Float Float Float Float Float Float Float Float Int Price Best Ask Price Best Bid Vol Best Ask Vol Best Bid Exec. Vol Ask 1min Exec. Vol Bid 1min Book depth Ask Book depth Bid Last Exec Price Volatility 30 min Spread Price Norm. Price MA 1min Norm. Price MA 2min Norm. Price MA 3min Norm. Price MA 5min Norm. Price MA 6min Norm. Price MA 10min Norm. Price MA 15min Norm. Price MA 30min Action 100.088 100.087 45.171 45.905 3.199 2.453 116.077 71.810 100.057 276.131 1.001 100.087 1.000 1.001 1.001 1.001 1.001 1.000 1.001 1.000 0.095 98.932 98.931 0.000 0.000 0.000 0.000 0.000 0.000 98.931 0.000 0.000 98.931 0.990 0.990 0.989 0.987 0.987 0.985 0.986 0.986 -4.000 101.217 101.217 500.000 776.000 113.000 200.000 3664.000 1396.000 101.024 744.593 2.000 101.217 2.002 2.002 2.002 2.002 2.002 2.002 2.002 2.002 4.000 Float Float Int Int Int Int Int Int Float Float Int Float Float Float Float Float Float Float Float Float Int Table 12: Summary and Description of RL-Agents Bubble Table 13: Summary and Description of RL-Agents Sine 21
http://arxiv.org/abs/2302.11982v1
2023-02-23T12:57:34
2023-02-23T12:57:34
A Plot is Worth a Thousand Words: Model Information Stealing Attacks via Scientific Plots
Building advanced machine learning (ML) models requires expert knowledge and many trials to discover the best architecture and hyperparameter settings. Previous work demonstrates that model information can be leveraged to assist other attacks, such as membership inference, generating adversarial examples. Therefore, such information, e.g., hyperparameters, should be kept confidential. It is well known that an adversary can leverage a target ML model's output to steal the model's information. In this paper, we discover a new side channel for model information stealing attacks, i.e., models' scientific plots which are extensively used to demonstrate model performance and are easily accessible. Our attack is simple and straightforward. We leverage the shadow model training techniques to generate training data for the attack model which is essentially an image classifier. Extensive evaluation on three benchmark datasets shows that our proposed attack can effectively infer the architecture/hyperparameters of image classifiers based on convolutional neural network (CNN) given the scientific plot generated from it. We also reveal that the attack's success is mainly caused by the shape of the scientific plots, and further demonstrate that the attacks are robust in various scenarios. Given the simplicity and effectiveness of the attack method, our study indicates scientific plots indeed constitute a valid side channel for model information stealing attacks. To mitigate the attacks, we propose several defense mechanisms that can reduce the original attacks' accuracy while maintaining the plot utility. However, such defenses can still be bypassed by adaptive attacks.
[ "Boyang Zhang", "Xinlei He", "Yun Shen", "Tianhao Wang", "Yang Zhang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11982v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11982v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CR", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CR", "cs.LG" ]
To Appear in the 32nd USENIX Security Symposium, August 2023. A Plot is Worth a Thousand Words: Model Information Stealing Attacks via Scientific Plots Boyang Zhang1 Xinlei He1 Yun Shen2 Tianhao Wang3 Yang Zhang1 1CISPA Helmholtz Center for Information Security 2NetApp 3University of Virginia Abstract 3 2 0 2 b e F 3 2 ] R C . s c [ 1 v 2 8 9 1 1 . 2 0 3 2 : v i X r a Building advanced machine learning (ML) models requires expert knowledge and many trials to discover the best archi- tecture and hyperparameter settings. Previous work demon- strates that model information can be leveraged to assist other attacks, such as membership inference, generating adver- sarial examples. Therefore, such information, e.g., hyper- It is well known parameters, should be kept confidential. that an adversary can leverage a target ML model's output to steal the model's information. In this paper, we discover a new side channel for model information stealing attacks, i.e., models' scientific plots which are extensively used to demonstrate model performance and are easily accessible. Our attack is simple and straightforward. We leverage the shadow model training techniques to generate training data for the attack model which is essentially an image classi- fier. Extensive evaluation on three benchmark datasets shows that our proposed attack can effectively infer the architec- ture/hyperparameters of image classifiers based on convolu- tional neural network (CNN) given the scientific plot gen- erated from it. We also reveal that the attack's success is mainly caused by the shape of the scientific plots, and further demonstrate that the attacks are robust in various scenarios. Given the simplicity and effectiveness of the attack method, our study indicates scientific plots indeed constitute a valid side channel for model information stealing attacks. To miti- gate the attacks, we propose several defense mechanisms that can reduce the original attacks' accuracy while maintaining the plot utility. However, such defenses can still be bypassed by adaptive attacks.1 1 Introduction Machine learning (ML) has made tremendous progress in various domains during the past decade. While proven pow- erful, state-of-the-art ML models require expert knowledge for architecture design. Also, model developers often need to perform many trials on the hyperparameters to obtain the best performing model. This process can be quite costly. Thus, an ML model's information, such as its architecture and hyper- parameters, is deemed an important asset of the model owner and must be kept confidential. 1Our code is available at https://github.com/boz083/Plot_Steal. (a) ResNet18 (b) ResNet34 (c) ResNet18 (d) ResNet34 Figure 1: Examples of t-SNE and loss plots of ResNet18 and ResNet34 models trained on CIFAR-10. Scientific plots from different variants of ResNet models indeed show different pat- terns, which can be exploited by the attackers. Recent studies demonstrate that ML models are vulnerable to information stealing attacks, such as model type [9, 29] and hyperparameters [30, 42]. These attacks first leverage a dataset to query a target ML model and obtain the responses. The query-response pairs are then exploited to train an attack model whereby the goal is to infer the information of the target ML model. To mitigate these attacks, many defenses have been proposed to perturb the information contained in the model's responses or alert the model owner of suspicious queries [24, 26, 32, 37]. On the other hand, ML models' scientific plots are easily accessible, via models' project websites or the correspond- ing research papers/blogs. For instance, ML model own- ers often use t-distributed stochastic neighbor embedding (t- SNE) [40] to visualize high-dimensional embeddings gen- erated from their ML models to better understand and in- terpret model performance. Loss plots (learning curves) are frequently used during model training to guide model design and debugging (e.g., how fast the model converges, if the learning process is stable, etc.). Essentially, these scientific plots are abstractions of the model and may directly contain the model's confidential information. However, to the best of our knowledge, no one has investigated whether scientific plots can be a valid side channel for an adversary to exploit and infer a target ML model's proprietary information. In this paper, we propose the first model information steal- ing attack that leverages scientific plots to steal a target ML model's information, including model type (e.g., ResNet18, training ResNet34, or MobileNetV2), batch size, etc. The primary contribution of our attack is to show that scientific plots can be a valid side channel to leak the model's proprietary information. We concentrate on training optimizer, 1 the popular convolutional neural network (CNN) models for image classification and the two most widely used scientific plots in machine learning, i.e., t-SNE and loss plots, shown in Figure 1. Attack Methodology. Given a scientific plot, our goal is to infer information about the model. We leverage the shadow training technique [30, 38] to generate a diverse set of data samples, and from that, we train a simple classifier as the attack model. Concretely, we first prepare shadow models trained with different model types and hyperparameters. We then generate a set of scientific plots for each shadow model, and label each plot with the shadow model's information. To train the attack model, we take the (cid:104)plot, label(cid:105) pairs as the training data, and train a Convolution Neural Network (CNN) as the attack model. Once the attack model is trained, we can infer the information of a model from its scientific plot. Evaluation. Our evaluation on three datasets, including CIFAR-10, FashionMNIST, and SVHN, shows that the pro- posed attack can achieve high accuracy. For instance, on CIFAR-10, given the t-SNE and loss plot generated from a specific model, the attack accuracy for predicting the model's type from a predefined set of 6 popular models is 92.8% and 95.3%, respectively. Given the simple attack method we use, our results demonstrate the severe risk of leaking the model's information by sharing the scientific plots. Also, we conduct extensive ablation study to show our attack is ro- bust against different plot generation settings (e.g., different density/perplexity for t-SNE plot and with/without axis for loss plots). We empirically show that our attack performs comparably to existing query-based hyperparameter stealing attacks, yet our attack does not require interaction with the target model. To reason the success behind our attacks, we further apply Grad-CAM [35] on our attack models and show that the shape of the t-SNE and the turning point on the loss curve serve as strong signals of the success of the attack. Defense. To mitigate the attacks, we investigate several de- fense mechanisms. We first observe that the defense can be performed under different phases in generating the t-SNE plots, i.e., the embeddings before running t-SNE and the co- ordinates after running t-SNE. Also, different perturbation strategies can be applied, including thresholding (saving only the largest k% embedding values), rounding (saving the val- ues to k-th decimal), and noising (adding Gaussian noise to all values). We find that embedding thresholding before running t-SNE and noising after t-SNE are two effective de- fense mechanisms. They can reduce the original attack per- formance to a large extent while preserving the plot's utility (measured by kNN accuracy following [40]). For loss plots, we find that the sliding window technique can serve as a good defense strategy since it maintains the plot's utility (mea- sured by the average L2 distance of the losses) while largely mitigating the attack performance. Interestingly, given those defenses, we further show that with proper modification, our attacks can still be effective. Based on our evaluation, we ap- peal that scientific plots should be properly perturbed before being published to protect certain proprietary model infor- mation. 2 In summary, we make the following contributions: • We propose the first model information stealing attack via scientific plots. Our evaluation reveals that the attack is effective and robust under different settings. • We investigate the success of our attack with the help of Grad-CAM and discover that the attack model captures the essential information from the shape of the plot. • We propose several effective defenses to mitigate our at- tack. However, we also reveal that an adaptive attacker can bypass the defenses. 2 Preliminary Scientific Plots. Showing scientific plots is a common way to corroborate the efficacy of ML models. We briefly intro- duce two widely used scientific plots, t-SNE and loss plots, which are regularly employed to better understand and visu- ally interpret an ML model's performance. t-SNE Plot. One popular practice to demonstrate an ML model's representation ability is to project some sam- ples' embeddings obtained from the model into the low- dimensional (usually 2-D) space using the t-distributed stochastic neighbor embedding (t-SNE) technique [40]. In t- SNE, similar embeddings are mapped into nearby places and dissimilar embeddings are projected far away (see Figure 2 for sample plots). Thus, by observing whether data points from different classes are well separated, we can get a good understanding of the ML model's performance. We illustrate the detailed procedure in Appendix A. Loss Plot. A loss plot shows the training/validation loss val- ues during the training procedure. The training loss indicates how well the model fits the training data, while the validation loss indicates how well the model generalizes to validation data that is not used to train the model. It is a practical way to illustrate the model's generalization ability and convergence rate (see Figure 9 for sample plots). Model Information Stealing Attacks. Model information stealing attacks aim to infer the type [9, 29] or hyperparame- ters of a target model [30, 42]. While existing attacks rely on query responses from the target model to infer model infor- mation, we propose a new attack leveraging only the publicly accessible scientific plots. Our results show that the adver- sary can successfully infer the detailed hyperparameters of the ML models from these plots (see Section 5). 3 Threat Model and Methodology 3.1 Threat Model Adversary's Goal. The primary goal of an adversary is to infer key hyperparameters of a target CNN image clas- sifier from its scientific plots. The inference targets ex- amined in this paper include a selection of popular model types/architectures, optimization algorithms, and batch size settings (see Section 5.1 for the complete set of targets con- sidered in this work). The reason we focus on these targets as they are popular and have been used in a large number of models. Our attack can certainly incorporate other inference targets as well (see Section 9 for some discussion). Note that model type/hyperparameter stealing is well recognized by the scientific community [9, 29, 30, 42]. Adversary's Background Knowledge. We assume that the adversary has direct access to the scientific plots, for ex- ample, a screenshot of plots from PDF or websites. Al- though in many scenarios, the adversary might obtain more information from the plot (e.g., high-resolution images, raw data points, vectorized plots), we use screenshots for high accessibility. The adversary can make adjustments to the plots (e.g., using simple image editing software), including removing axes, labels, plot titles, adjusting color settings, etc. Moreover, similar to previous works on hyperparame- ter stealing [30,42], we assume the adversary has knowledge of the distribution of the target model's training dataset and a selection of candidates for each inference target. The adversary does not know the data used to generate those plots: For t-SNE plots, the attacker does not know which samples are used for plotting; and in loss plots, the attacker does not know the training/testing samples used to compute the losses. Besides, the adversary has no query ac- cess to the target model (which is different from previous query-based stealing attacks [30, 42]). Attack Scenarios. Sharing scientific plots is common but the associated risk is not well understood. We believe it is important to systematically evaluate the attack. Below, we list five realistic scenarios to motivate our study. • The first scenario is inferring proprietary model informa- tion for training a model without tuning architecture or hy- perparameters. • Alternatively, the second scenario is assisting a company to verify if their proprietary models are infringed by the com- petitors (e.g., by inferring the competitor's model hyperpa- rameters) in a non-intrusive manner (i.e., via the scientific plots published by the competitors). • The third scenario is serving as an auditing tool to verify the claims in research papers. We acknowledge that mod- els' information is often specified together with scientific plots in research papers. However, the information might be incomplete, e.g., batch size and optimization algorithm used are not stated in [18, 25]. Also, authors of a consider- able portion of papers do not publish their models.2 • Furthermore, the model information obtained by our attack can be leveraged to assist other types of attacks. As such, the fourth scenario is training better surrogate models for generating adversarial examples on a black-box model (see Section 5.5) using the inferred model information from our attack. • In the same spirit, the fifth scenario is facilitating adver- sarial reconnaissance to determine potential attacks' diffi- culty. For instance, our attack infers the model type, which helps determine whether to launch membership inference attacks against the model (since certain models tend to overfit more than others) [19]. 2From our rudimentary search for papers published in IEEE S&P, CCS, USENIX Security, and NDSS since 2017 that are related to machine learn- ing and have GitHub repositories for their codes, we find 37 papers in total, but only 13 repositories include model weights and hyperparameters of any kind. 3.2 Attack Methodology The attack procedure is divided into three steps: shadow model training, scientific plot generation, and attack model training. We first use shadow models with different model configurations to mimic the behavior of the target models. Then, those shadow models can be used to generate scien- tific plots with different model information and train the at- tack model. Shadow Model Training. To better capture the character- istics of the target model's information, it is necessary to generate a diverse set of shadow models that are initialized with different model information including model type, op- timizer, batch size, etc. We assume the adversary has a se- lection of possible values for the inference targets. Thus, the shadow models are trained with settings randomly selected from the pool. We follow [34,38] and adopt a shadow dataset that comes from the same distribution of the target model's training dataset to train the shadow model. We later exam- ine the attack with out-of-distribution datasets. The shadow dataset and the target dataset have no overlap. Our shadow model training is in line with the latest research direction [6] whereby many shadow models are trained to attain the attack goal. Scientific Plot Generation. Once the shadow models are trained, for each shadow model, we can generate a scientific plot. In this paper, the main example of scientific plots is scatter plots of data points visualized with t-SNE. Note that we also evaluate the model information leakage via the loss plot where the average training and testing losses are visual- ized during each training epoch. Using the trained shadow models, the adversary generates plots with the same setting as the observed one from the target model. Attack Model Training. The attack model is an image clas- sifier where the input is the generated scientific plots and the output is the corresponding model information such as model type, optimization algorithm, etc. We train the attack model using the scientific plots generated by the shadow models. The ground truth labels are the shadow models' information. Once the attack model is trained, given a scientific plot gen- erated from a specific target model, the attack model can pre- dict its model information. Comparison with Existing Hyperparameter Stealing At- tacks. Model hyperparameter stealing attacks aim to infer the target model's hyperparameters [30, 42]. Typically, they assume the adversary has black-box access (otherwise the f . To conduct the problem is trivial) to the target model attack, the adversary queries f using a query dataset and gets the responses (e.g., predicted probabilities or just la- bels) from the target model. By observing the query-response pairs, the attacker then constructs an attack model to infer the hyperparameters. Existing attacks have an important as- sumption that the adversary has the (black-box) query access to the target model [30, 42], which means they can lever- age an adversarially crafted dataset to query the target model and obtain the response. Our model information stealing at- tack does not require any interaction with the target model but only leverages a single publicly accessible scientific plot. 3 Also, in the scientific plot, the information is compressed. For example, in the t-SNE plots, the embeddings are pro- jected into only two dimensions using t-SNE and only the average losses instead of the individual losses for training and testing data are reported in the loss plot, which further in- creases the attack difficulty. Our evaluation reveals that even in this case, our proposed attack, albeit simple and straight- forward, can still effectively infer the model information. 4 Evaluation Setup In this section, we describe the default experiment settings. Later we also conduct a series of ablation studies to show our attack is robust in different settings in Section 5.2. Shadow and Target Model Training. We use three bench- mark datasets, CIFAR-10, FashionMNIST, and SVHN, in the experiments. Each dataset is divided into 4 non-overlapping partitions, namely shadow training, shadow testing, target training, and target testing. For each shadow/target model, we randomly sample 20,000 data points for training. We also use the popular approach of fine-tuning pre- trained models [8, 14, 45] and adopt the models pre-trained from ImageNet (if available) as initialization for further training. The choice of architecture and training hyperpa- rameters are randomly sampled from the pool of possible values. In total 2250 shadow models and 750 target models are trained for each dataset. To ensure all shadow and tar- get models are properly trained, we discard low-performing models (test accuracy below 50% on the target task). The trained shadow and target models have relatively close per- formance on the target task, as seen in Figure 3. t-SNE Creation. In the default setting, for each trained shadow/target model, we randomly select 2,000 samples from the corresponding test dataset. We then follow the widely-used settings to generate t-SNE plots. We query the model with these samples and take the output of the second to last layer as the samples' embeddings to generate the t- SNE plot. The plots are saved as images without axis, la- bels, and titles, keeping only the scattered sample points in 2-dimensional space. Different colors are used in t-SNE plots to denote those samples' classes in the original classifica- tion task. However, to extend the range of possible t-SNE plots used for target models, we convert the color t-SNE plots into grayscale t-SNE plots. This eliminates the chance that the attack relies on difference in color schemes. We later observe that the attack performance remains unchanged for color, grayscale, or binary (i.e., 1-bit monochrome) t-SNE plots (see Table 3). The t-SNE plots used for experiments are 300x300 PNG images with 100dpi. Most t-SNE plots used in scientific papers and blog posts tend to have higher dimension/definition [1–3]. Loss Plot Creation. During the shadow model training, we record the average training loss 5 times per epoch and the average test loss every epoch. Both training and testing loss curves are then plotted with different colors. Normally, loss plots have axis information to denote the training epoch and loss value. To investigate whether such information facili- tates the attack, we generate two types of loss plots, i.e., with 4 or without axis information. Attack Model Training. For fast convergence, we leverage ResNet18 [15] pre-trained on ImageNet as the base attack model. For t-SNE plots, we fine-tune the attack model for 80 epochs with batch size 32, learning rate 0.0001, and Adam as its optimizer. For loss plots, we fine-tune the attack model for 40 epochs, and the rest of the settings are the same as above. Runtime Configuration. The experiments are repeated 10 times. We report the mean as well as standard deviation val- ues. For each run, we follow the same experimental setup. 5 t-SNE Evaluation 5.1 Model Information Stealing Attacks Against t-SNE In this section, we first highlight what model information can be inferred from t-SNE plots. Here we consider three differ- ent inference targets: (1) the target model's model type, (2) the optimization algorithm, and (3) the batch size used in the target model's training procedure. The attack is evaluated under both the mixed and fixed settings. The mixed setting is the default setting described in Section 4. In fixed set- ting, the adversary has other knowledge of the model infor- mation (e.g., the adversary knows the model type and batch size when inferring optimization algorithm). We also inves- tigate our attack performance on additional inference targets within model architectures by building custom models. 1. Model Type Inference. We consider six popular model types: ResNet18, ResNet34, ResNet50, MobileNetV2, Mo- bileNetV3, and DenseNet121. They belong to three widely used model families, i.e., ResNet [15], MobileNet [17], and DenseNet [20]. We intentionally selects different types of models from the same family to increase the attack difficulty, since models from the same family behave similarly and are harder to distinguish. We first conduct our attack by infer- ring the target model's family and then the more fine-grained actual model type. From Table 1, we observe the attack model can extract the model family and more fine-grained model type information for all three datasets (the first and second rows). For instance, on CIFAR-10, the model family (type) prediction reaches 85.7% (77.1%) accuracy. The confusion matrix of the in- ference results (Figure 15 in Appendix) shows that the attack model can accurately identify model types even within the same family. The values in the parenthesis show the attack performance in a fixed setting. In this case, the attack per- forms exceedingly well, with inference accuracy at around 90% on model types for all 3 datasets. Although this is a less realistic attack scenario, we use it to showcase the strength of this side-channel attack when the adversary has additional knowledge. From a more intuitive perspective, Figure 2 shows the example t-SNE plots generated from different model types, which indeed have different patterns. For example, ResNet family's t-SNEs show multiple sharp edges in clusters, while those of the MobileNet family have more rounded clusters. (a) ResNet18 (b) ResNet34 (c) ResNet50 (d) MobileV2 (e) MobileV3 (f) DenseNet121 Figure 2: t-SNE plots generated from models of different types (batch size 128, Adam Optimizer). (a) Model Types (b) Batch Size (c) Optimization Algorithms Figure 3: Average accuracy on the original classification tasks for models trained on 3 different datasets. The target task performances remain similar across different model types, batch size and optimization algorithms. Table 1: Average attack accuracy for different inference targets on 3 different datasets. The number of candidates for inference targets are in brackets. The values in parenthesis are results in fixed setting. Inference Targets CIFAR-10 FashionMNIST SVHN Model Family <3> 85.7(94.4) ± 0.6% 84.8(98.9) ± 1.0% 81.0(96.9) ± 0.9% 77.1(92.8) ± 1.0% 75.1(88.0) ± 1.3% 74.1(95.2) ± 1.0% Model Type <6> 96.1(100.0) ± 0.2% 72.9(99.8) ± 1.8% 97.4(100.0) ± 0.2% Optimizer <2> 69.4(90.3) ± 1.4% 65.7(96.3) ± 0.6% 66.2(84.8) ± 0.5% Batch Size <3> 60.5(77.4) ± 0.7% 52.8(93.6) ± 0.7% 57.4(74.4) ± 0.9% Batch Size <4> 2. Optimization Algorithm. The optimization algorithms are also a crucial part of training the ML model. In our eval- uation, we consider two commonly used optimization algo- rithms, Adam and SGD. Two sets of target models are trained to have similar prediction performance. The average accu- racy on the CIFAR-10 classification task is 72.5%/74.1% for models optimized with Adam/SGD and both have ≤ 1% standard deviation. The difference in average accuracy for the other 2 datasets are both below 1%. Interestingly, although the models trained with different optimization algorithms have similar performance, the t-SNE plots are significantly different (see Figure 10 in Appendix). With such differences, the attack model achieves close to 100% accuracy (less than 1% from perfect prediction in fixed setting for all 3 datasets) in inferring the optimization al- gorithms on both CIFAR-10 and SVHN datasets. We sus- pect the difference is due to the different ratio of 0 values in the embeddings, given the fact that dimension reduction algorithms like t-SNE typically are sensitive to input spar- sity [40]. For instance, on CIFAR-10, we find that the em- beddings 52.6% 0 values if optimized by SGD while 68.6% for Adam. The significant difference in t-SNE plots can- not be generalized to FashionMNIST dataset, even though the attack still achieves inference accuracy higher than ran- dom guessing. The embeddings from models optimized by the two algorithms also have similar sparsity, as conjectured (FashionMNIST ResNet18 models have 52.0% and 49.4% 0 values when optimized by SGD and Adam respectively.). 3. Batch Size. The last two rows of Table 1 show that the at- tack model can successfully infer batch size information (64 vs 128 vs 256 vs 512) of the target models from generated t-SNE plots. The attack performance is lower compared to model types and optimization algorithms from previous sec- tions. However, the inference accuracy is still much higher than the random guessing baseline for all 3 datasets. For in- stance, when the potential batch sizes are 64 vs 128 vs 512, our attack can reach 69.4% accuracy on CIFAR-10. Simi- lar batch sizes are more easily misclassified (see Figure 16 in Appendix). When a strong adversary has knowledge of model type and optimization algorithm, the attack perfor- mance also improves significantly. The 3-class batch size inference on all 3 datasets have attack accuracy higher than 80% in this setting, notably reaching 96.3% on FashionM- NIST dataset. 4. Custom Model Architecture Inference. Results from above show our attack model can precisely infer the model type from t-SNE plots. However, those models with differ- ent types still differ notably from each other, e.g., ResNet18 and ResNet34 have 18 and 34 layers, respectively. We fur- ther investigate whether our attack remains effective to the models only with subtle differences. The rationale is that the more subtle the difference is, the more difficult for the at- tacker to materialize the information inference attack. To this end, we construct custom CNN models based on 6 key hy- perparameters, similar to the ones investigated in the previ- 5 CIFAR10FashionMNISTSVHN0.00.20.40.60.81.0TargetTaskAverageAccuracyResNet18ResNet34ResNet50MobileV2MobileV3DenseNet121CIFAR10FashionMNISTSVHN0.00.20.40.60.81.0TargetTaskAverageAccuracy64128256512CIFAR10FashionMNISTSVHN0.00.20.40.60.81.0TargetTaskAverageAccuracyADAMSGD Table 2: The average attack accuracy for different inference targets on custom models. Inference Targets Possible Values Attack Accuracy Activation Function #. FC. Layers #. CONV. Layers #. Kernel Size Dropout Max-pooling Batch Size Optimizer relu, elu, tanh 2, 3, 4 2, 3, 4 3, 5 True, False True, False 64, 128, 256, 512 Adam, SGD 92.4 ± 0.6% 81.9 ± 1.3% 63.9 ± 1.0% 67.1 ± 0.6% 54.2 ± 1.3% 61.8 ± 1.9% 37.8 ± 0.8% 70.3 ± 3.4% (a) conv=4, ks=3, fc=2, bs=256, elu, Adam (b) conv=3, bs=5, fc=2, bs=512, relu, SGD (c) conv=2, ks=3, fc=3, bs=128, tanh, Adam Figure 4: t-SNE plots of custom CNNs trained on SVHN. ous work. Figure 4 shows examples of t-SNEs from models with different hyperparameters trained on SVHN. The t-SNE plots from custom models become almost indistinguishable for humans. The custom CNN model is comprised of 2-4 convolution layers with a kernel size of 3 or 5 and 64 chan- nels, 2-4 fully connected layers with 512 neurons, and a final fully connected layer that acts as the classifier. There are op- tional max-pooling after the convolution layers and optional dropout with a probability of 0.4 after the fully connected layers. The activation functions used are one of relu, elu, and tanh for each model. The batch size and optimization algorithms have the same selection pool as in previous sec- tions. All custom models are trained for 30 epochs and low- performing models are discarded. A total of 1,795 shadow models and 295 target models are used to generate corre- sponding t-SNE plots. The detailed hyperparameter targets, selections of values, as well as inference performance, are shown in Table 2. We observe that the number of convolu- tion layers, number of fully connected layers, and activation functions have especially high information leakage from t- SNE plots. For instance, the attack model can infer activation used in the custom model with 92.4%, given a selection pool of relu, elu, and tanh. The attacks on the 2 inference targets investigated in previous sections, batch size and optimiza- tion algorithms, still achieve good performance. The perfor- mance gap to the previous predetermined 6 model types is yet noticeable, due to the significant increase in difficulty (i.e., t- SNE plots are much more similar to one another). The attack models, however, have attained sub-optimal performance on inferring whether dropout or max-pooling are used and the kernel size of the convolution layers. 6 Figure 5: Average inference accuracy by using different num- bers of shadow models to train the attack model on SVHN. Takeaways: Our evaluation shows that t-SNE plots can be a valid side channel to infer the model information. Among all inference targets, activation function, number of fully connected layers, number of convolutional layers, and the optimization algorithm are more vulnerable than the others. 5.2 Ablation Study We further investigate whether our attack is still effective with: (1) fewer shadow models, (2) different color settings for creating the t-SNE plots, (3) different numbers of sample points for creating t-SNE, and (4) different perplexity set- tings in t-SNE. Since different optimization algorithms yield significantly different t-SNEs, we focus on model type infer- ence and batch size inference tasks instead, which are more difficult. The experiments are conducted on SVHN. Number of Shadow Models. Figure 5 shows the perfor- mance of model type inference and batch size inference when using different percentages of total shadow models trained. The inference performance indeed increases with more shadow models used for training. However, even with 5% of the shadow models, the attack model can already achieve good model type inference accuracy of 50.2%. With 50% shadow models, the inference performance is within 4% of the default setting's attack accuracy. We also have similar observations in batch size inference. Color Settings. We test the inference performance when the attack model is trained on t-SNE plots with different color settings, including the original color setting, grayscale, and binary. Figure 11 (in Appendix) shows the comparison of the three color settings. Originally, different colors denote different classes. Grayscale makes it harder to differentiate classes, and binary makes classes indistinguishable. Table 3 shows the inference accuracy generally remains unchanged with all three t-SNE color settings. For instance, for model type inference, the attack accuracy is 74.0%, 74.1%, and 73.6% for color, grayscale, and binary t-SNE plots, respec- tively. Our evaluation results reveal that the shape instead of the color of the t-SNE plot plays the most important role in distinguishing the hyperparameters. This makes our attack more practical to the t-SNE plot in the real world. We use Grad-CAM to provide an in-depth visual explanation in Sec- tion 7. Density Settings. Density denotes the number of sample 5%15%25%50%75%100%PercentageofShadowModelsUsed0.20.30.40.50.60.70.8AverageInferenceAccuracyModelTypeInference:Pretrained6ModelsBatchSizeInference64vs.128vs.256vs.512 Table 3: Inference accuracy of models trained by different color settings' t-SNE plots on SVHN. Inference Task Color GrayScale Binary 74.0 ± 1.1% 74.1 ± 1.0% 73.6 ± 1.0% Model Type Batch Size (64 vs 128 vs 256 vs 512) 60.6 ± 0.6% 57.4 ± 0.9% 57.4 ± 0.8% inference performance positively correlates with perplexity. When the perplexity is 15, the attack accuracy of model type inference increases 5.2% compared to 5, while the accuracy remains similar when the perplexity increases from 30 to 80. The increased performance with larger perplexity can be ex- plained by observing t-SNE plotted at different perplexity settings in Figure 13. When perplexity is set too low for the given dataset's size, the fitted t-SNE does not represent the target model's embeddings properly. Once the perplexity is high enough, different settings still produce different cluster shapes but share similar geometric characteristics. Takeaways: Our attack remains effective even with small numbers of shadow models and is not significantly affected by the color, density, and perplexity of t-SNE plots. Figure 6: Inference performance at different t-SNE density set- tings. The models are trained on SVHN. 5.3 Open-World Settings To simulate more realistic attack scenarios, we relax the con- straints on the attacker's knowledge of the target model, in- cluding dataset distribution and t-SNE settings. In the open- world setting, the adversary might not have access to datasets with the same distribution. The exact settings used for t-SNE plots can also be difficult to obtain based on observation. We demonstrate our attack model's robustness in the open-world setting using the model type inference task. Mixed Datasets. The geometric characteristics of t-SNE plots highly depend on the dataset used for the target task. Figure 14 shows examples of t-SNE plots created with em- beddings from target models trained on the three datasets, which have different patterns. While the attack model per- forms well for all three datasets separately, as shown above, we evaluate the attack performance with mixed datasets, sim- ulating the scenario where the attacker has a well-trained model including multiple datasets. As shown in Table 4, when the attack model is trained on all three datasets, the inference accuracy on the mixture of t-SNE plots created on three datasets is 73.5%, which shows no deterioration. We also evaluate attack performance for out-of- distribution data, where the shadow models and target models are trained with different datasets, to assess whether the model type information's characteristics in t-SNE are shared across datasets. The second row in Table 4 shows that is the inference performance decreases greatly, but still higher than random guessing (16.7%), which means the attack model still can extract model information from t-SNE plots generated from different dataset distributions. Domain shift [33] is one of the biggest challenges when deploying machine learning models in the real world. This certainly applies to our attack models as well. We discuss this limitation in Section 9. To overcome this limitation, we further evaluate whether our attack can generalize to different datasets given only a small fraction of shadow models trained on the new dataset. Concretely, we fine-tune the attack model trained on CIFAR- 10 using only a small number of t-SNE plots generated from shadow models trained on SVHN. We evaluate model type inference performance on t-SNE plots built from target models trained on SVHN. Table 4 shows that the inference 7 Figure 7: Inference performance with different perplexity set- tings. The models are trained on SVHN. points used to fit t-SNE and make the plot. As shown in Figure 12 (in Appendix), the density setting also affects the clusters' geometric characteristics. Figure 6 shows the infer- ence performance increases as density increases. The infer- ence accuracy of model type is 68.8% with 1,000 points/plot while only 55.2% with 200 points/plot, respectively 5.1% and 18.7% lower than the benchmark at 2,000 points/plot. At low-density settings, not enough sample points are used to fit t-SNE that forms clusters with unique information about the target models. Since the marker size remains unchanged, a lower density setting also results in more empty spaces in the plots. Once enough points are used, t-SNE plots represent the target models accurately and increasing density does not add more information. Perplexity Settings. Perplexity is an important hyperparam- eter for generating t-SNE which controls the number of near- est neighbors used for calculating cluster centers during the fitting process of t-SNE. With a larger number of samples involved (i.e., a larger density), a higher perplexity is pre- ferred. Figure 13 (in Appendix) shows the example t-SNEs with different perplexity settings from the same set of em- beddings of a ResNet50 model trained on SVHN (we have a similar observation for other model types). Note that 5 and 80 are the recommended lower and upper bounds of the val- ues, and 30 is the default value [4]. As we do not observe a clear change between 30-80, we try a smaller value 15 to make the plots more diverse. From Figure 7, we notice that 200500700100020004000t-SNEDensitySetting0.30.40.50.60.70.8AverageInferenceAccuracyModelTypeInference:Pretrained6ModelsBatchSizeInference64vs.128vs.256vs.5125153080t-SNEPerplexitySetting0.30.40.50.60.70.8AverageInferenceAccuracyModelTypeInference:Pretrained6ModelsBatchSizeInference64vs.128vs.256vs.512 Table 4: Model type inference with mixed datasets. Table 5: Model type inference with mixed perplexity. The mod- els are trained on SVHN. Training data Testing Data Accuracy Combined (All 3) CIFAR10 5% SVHN (fine-tuned) 15% SVHN (fine-tuned) 25% SVHN (fine-tuned) Combined (All 3) SVHN SVHN SVHN SVHN 73.5 ± 0.2% 22.9 ± 0.1% 60.3 ± 1.0% 64.9 ± 1.0% 67.3 ± 0.5% Figure 8: Model type inference performance with different t- SNE sample densities for models trained on SVHN. performance increases from 22.9% to 60.3% with only 5% shadow models trained on SVHN added. Recall that the ran- domly initialized attack model trained with 5% shadow mod- els only achieves 50.2% inference accuracy (10.1% improve- ment with fine-tuning). The benefit of using an attack model pre-trained on out-of-distribution data decreases as the num- ber of shadow models available increases. With 25% of the original number of shadow models, fine-tuning on CIFAR- 10 attack model offers only 0.3% increase in attack accu- racy, compared to the random initialization. Our observation reveals that the attack can easily transfer to other dataset dis- tributions, which further demonstrates the severe model in- formation leakage risks stemming from t-SNE. Density Transferability. Previously, we assume the t-SNE plots of shadow models and the target model share the same densities. In practice, the densities could be different. While the attacker could re-train the shadow models with the same densities, we are interested in whether the attack can transfer to different density settings. Here we consider two different settings where the first one only leverages 2,000 samples to generate the t-SNE plots and the second one leverages 500, 1,000, and 2,000 samples to generate t-SNE plots during the training procedure. From Figure 8, we observe that the at- tack model trained with 3 different densities can perform bet- ter in different density settings even if the testing density is unseen during the training. For instance, when the testing density is 4,000, the model type inference accuracy is 70.4% for the attack model trained with 3 different densities while only 44.1% for the attack model trained with 2,000 density t-SNE plots. The result demonstrates that the attack can suc- cessfully transfer to various density settings by training with t-SNE plots with limited combinations of density settings. Perplexity Transferability. In Section 5.2, we show per- plexity does not significantly affect inference results if it is set high enough. Table 5 shows the inference performance with t-SNE built with mixed perplexities. We observe that the attack model trained with t-SNE plots with single per- 8 Training Perplexity Testing Perplexity Accuracy 30 30 30 15 + 30 15 + 30 5 + 80 5 + 80 5 15 80 5 80 15 30 17.3 ± 1.9% 30.8 ± 2.5% 47.3 ± 2.5% 30.4 ± 3.4% 60.8 ± 1.2% 48.8 ± 2.2% 59.4 ± 3.2% Table 6: Comparison with query-based attack. Attack Setting Our Attack Posteriors Predicted Label Fixed Mixed 92.8 ± 0.1% 99.7 ± 0.1% 77.1 ± 1.0% 93.8 ± 0.5% 98.1 ± 0.1% 67.4 ± 0.8% plexity can generalize to t-SNE plots with different perplex- ity settings, especially for a larger perplexity. For instance, when trained with 30 perplexity t-SNE, the testing accuracy is 47.3% on t-SNE plots with 80 perplexity. We also find that having mixed perplexity in training improves the at- tack model's ability to generalize predictions for t-SNE with unseen perplexity. Both interpolation and extrapolation of perplexity show good inference performance and are signifi- cantly better than the performance of the attack model trained with single perplexity. Takeaways: The attack model can extract model infor- mation from t-SNE plots generated from different dataset distributions, density and perplexity settings. 5.4 Comparison with Existing Hyperparame- ter Stealing Attacks We compare our attack with the query-based model hyper- parameter stealing attacks (referred to as query-based at- tacks) [30]. The experiment is conducted with the model type inference task on CIFAR-10. The query-based attacks first train shadow models in the same way as our attack. A set of 100 randomly selected images from the CIFAR-10 test set is then used to query the shadow models. By querying each shadow model, the output posteriors for the 100 images are then concatenated, resulting in a 1,000-dimensional vec- tor which is used as the input for the attack model. The attack model is a multilayer perceptron (MLP) with 2 hidden layers of 1,000 neurons and trained with an SGD optimizer with a learning rate of 0.001 and momentum of 0.9 for 100 epochs. Table 6 shows, as expected, the query-based attack performs very well on the model type inference task, reaching 99.7% inference accuracy (ours is 92.8%) when the adversary has access to complete posteriors information and with other hy- perparameters fixed. Note that the query-based attack needs to query the tar- get model, which means the performance may be affected by limiting the output precision of the target model. For instance, in the mixed setting (Table 6), when the target model's response is the predicted label instead of the posteri- ors, the inference accuracy for the query-based attack is only 67.4% while our attack can still achieve 77.1% accuracy. 200500700100020004000Testingt-SNEDensity0.10.20.30.40.50.60.70.80.91.0AverageInferenceAccuracyTrainingDensity:2000TrainingDensity:500+1000+2000 Takeaways: Our attack is comparable to query-based at- tacks and even surpasses it when the target model's query output is limited. 5.5 Downstream Adversarial Examples At- tack We now demonstrate one of the potential use cases for our at- tack. We consider an adversary who aims to cause the target model to misclassify data by crafting adversarial examples with only black-box and limited query access. To achieve this goal, the adversary can craft adversarial examples from the surrogate model and transfer them to the target model. We wonder whether the t-SNE plot generated from the target model can help the adversary build a good surrogate model. For the following evaluation, we use the pre-trained model type setting in Section 5.1 on SVHN datasets. 1,300 im- ages (10% of the testing target dataset) are randomly sam- pled from the target testing dataset for crafting adversarial examples on the target models. We first use our attack model to infer the model type, batch size, and optimization algo- In this way, the adversary can rithm of the target model. minimize the interaction with the target model and keep the attack stealthy. Then based on the inference result, we ran- domly select one of the shadow models that have matching hyperparameter settings and use it as the surrogate model to craft adversarial examples on the target model. We assume that the adversary uses FGSM [12] (a simple yet effective method) to alter a given image based on the gradient infor- mation from a given model. The performance of this down- stream attack is evaluated by comparing the misclassification rates (attack success rate) of the following 3 settings. The white-box setting serves as a baseline, where the adversary has full knowledge of the target model. The inferred model setting is our attack described above. The random model set- ting is to mimic the adversary randomly selecting a shadow model and using it as the surrogate model. Table 7 shows that using our inferred model, the adversary can craft better ad- versarial examples than those from a random shadow model. For instance, the gap in attack success rate between inferred model setting and the white-box baseline is only around 7%, while the gap between the random shadow model and the white-box baseline is around 10%. ε is the pixel-wise per- turbation amount in FGSM that controls the strength of the noise added. A higher ε leads to a higher attack success rate (see Table 7), but the adversarial examples can be more ap- parent due to greater distortion. The improvement of attack success rate when using our attack is consistent given all ep- silon settings used in the experiments, which demonstrates the efficacy of our side-channel attack. Takeaways: Our attack enables the attackers to gener- ate adversarial examples more effectively by identifying a shadow model similar to the target model. 5.6 t-SNE Defense We consider the disturbance-based approaches, including rounding, thresholding, and noising, as the defense. There 9 Table 7: Adversarial examples misclassification rate on target models crafted using different attack settings. Attack Setting ε = 0.1 ε = 0.2 ε = 0.3 White-box Target Model (Baseline) Inferred Model (Our Attack) Random Shadow Model 61.6 ± 4.9% 71.9 ± 6.1% 77.4 ± 6.4% 54.1 ± 6.5% 64.8 ± 6.0% 71.5 ± 5.9% 50.6 ± 9.2% 61.3 ± 7.8% 68.5 ± 6.9% Table 8: Defense Overview. Note that we use A-B to denote a defense scenario, e.g., E-R denotes we conduct defense over Embeddings via Rounding strategy. Strategy Rounding Thresholding Noising Embeddings E-R (Security:(cid:55) Utility:(cid:51)) E-T (Security:(cid:51) Utility:(cid:51)) E-N (Security:(cid:51) Utility:(cid:55)) C-N (Security:(cid:51) Utility:(cid:51)) Coordinates C-R (Security:(cid:51) Utility:(cid:55)) NA Table 9: Defense effectiveness against different strategies. The defenses are evaluated by the models trained on SVHN. We highlight the successful defenses in bold. Defense Methods Inference Acc. Utility (kNN) Utility (Visual) No Defense E-R (0.1) E-R (INT) E-T (TOP 75%) E-T (TOP 60%) E-N (1 x STD) E-N (0.5 x STD) C-R (to INT) C-R (to EVEN INT) C-N (2% x STD) C-N (5% x STD) 74.1 ± 1.0% 70.2 ± 1.8% 69.4 ± 0.8% 43.3 ± 0.7% 33.9 ± 1.3% 36.6 ± 1.2% 55.2 ± 2.3% 67.2 ± 1.6% 41.0 ± 3.1% 59.3 ± 0.8% 37.8 ± 2.1% 89.1% 89.1% 89.1% 88.6% 88.1% 88.3% 88.7% 88.9% 88.9% 89.1% 89.0% (cid:51) (cid:51) (cid:51) (cid:51) (cid:51) (cid:55) (cid:51) (cid:55) (cid:55) (cid:51) (cid:51) are two main places to apply our defense strategies: introduc- ing disturbances to embedding values used to fit the t-SNE, or directly to the t-SNE coordinates. In total, we have 5 possible defense strategies as shown in Table 8 (thresholding coordi- nates is infeasible as the dimension of coordinates cannot be further reduced due to the visualization purpose). We use the default experimental setting with SVHN as the dataset and model type as the inference target. The defense is evaluated on security by the decrease in inference accuracy and on util- ity both quantitatively and visually. Quantitatively, we use kNN accuracy as the utility metric [40], where kNN accu- racy is defined as the k-nearest neighbor classification accu- racy with sample points' coordinates in the given t-SNE as input and class labels as output. If two t-SNE plots produce similar kNN accuracy, we can assume the 2 t-SNE plots rep- resent the features in 2-dimensional space similarly. We also evaluate the utility by visual observations, to determine if the protected t-SNE has noticeable deviations from the original version, which sometimes the kNN metric fails to capture. Table 9 shows that embedding thresholding (E-T) and co- ordinate noising (C-N) are two effective defense mechanisms as they largely reduce the attack success rate and preserve the utility. For the t-SNE plots defended by C-N (5% x STD), the inference accuracy decreases to 36.6% while the kNN accu- racy is extremely close to the original and the t-SNE with added noise shows almost no difference by visual examina- tion (Figure 18 in Appendix). We provide the detailed de- fense discussion below. Rounding Embedding Values (E-R). We conduct experi- ments on embedding with values rounded to specified dec- imal points, thus decreasing the resolution of embedding values. We observe that E-R can preserve the utility but the attack accuracy remains relatively unperturbed (74.1% to 70.2%). Threshold Embedding Values (E-T). For this defense, in each embedding, only the largest k percentage of values are maintained and the others are set to zero. Then those mod- ified embeddings are used to fit the t-SNE. We find that, by setting a proper number of k, the defense can significantly reduce the attack performance while producing t-SNE plots that strongly resemble the original. For example, when using only top 60% embedding values, the inference performance decreases from 74.1% to 33.9% with less than a 1% differ- ence in kNN accuracy compared to the original. Inspecting the t-SNE qualitatively also shows no noticeable difference from the original (see Figure 18 in Appendix). Gaussian Noise in Embedding (E-N). We also explore the effectiveness of adding Gaussian noise directly to embed- dings. Gaussian noise with standard deviation set to a per- centage of the current embedding values' standard deviation is added to the embedding before fitting the t-SNE. The de- fense is unsuccessful even with a larger standard deviation. With the added noise having 50% of the embedding values' standard deviation, the inference performance decreases to 55.2%, while maintaining a kNN accuracy same as the orig- inal. Rounding t-SNE Point Coordinates (C-R). Instead of rounding embedding values used to fit t-SNE, we directly round the sample point's coordinates and thus diminish clus- ters' geometric characteristics. Table 9 shows promising kNN classification accuracy for both rounding to integers and rounding to even integers. Rounding to an even integer also greatly mitigates attack effectiveness. However, Figure 18 shows the rounding effect can be easily detected from ob- servation. t-SNE with rounding shows a distinct grid pattern when the rounding unit is high (low rounding unit does not provide security). For example, even for rounding to the in- teger, the grid pattern is already noticeable. Gaussian Noise in t-SNE Point Coordinates (C-N). Sim- ilar to adding noise to embedding values, we add Gaussian noise directly to t-SNE points' coordinates to disturb the dis- tinct patterns in cluster shapes. The standard deviation is set to a percentage of the overall coordinates' standard devia- tion in the current plot. Table 9 shows this method can ef- fectively mitigate model information extraction from t-SNE plots. With Gaussian noise of 5% original standard deviation, the inference performance decreases to 37.8%. This method also produces t-SNE that strongly resembles the original ver- sion. kNN accuracy is extremely close to the original and the t-SNE with added noise shows almost no difference by visual examination (see Figure 18 in Appendix). Takeaways: Thresholding embedding values and adding Gaussian noise in the t-SNE point coordinates are the two most effective defenses against the attack on t-SNE plots. Table 10: Adaptive t-SNE attack performance on SVHN. Defense Methods Inference Acc. Inference Acc. (non-adaptive) No Defense E-T (TOP 60%) E-T (TOP 75%) C-N (5% x STD) C-N (2% x STD) 72.5 ± 1.9% 83.4 ± 0.8% 65.6 ± 1.1% 66.7 ± 1.3% 67.7 ± 1.2% 74.1 ± 1.0% 36.5 ± 2.4% 47.1 ± 1.2% 41.1 ± 2.7% 59.1 ± 1.2% 5.7 Adaptive Attack We then consider an adaptive attacker who is aware of the ef- fective defense mechanisms used in the t-SNE plots. In this way, they can train the attack model on the original t-SNE plots and those t-SNE plots altered by the effective defense methods, i.e., top 60% embedding values thresholding and coordinates noising (5% STD). The adaptive attack can suc- cessfully render both defense methods ineffective, as seen in Table 10. The inference accuracy of the adaptive attack model improves drastically on both protected data, achieving similar performance as unprotected data. The adaptive attack also performs well on other less effective defense methods that use the same strategy without retraining. For example, the inference accuracy for top 75% embedding thresholding and 2% STD coordinate noising are both around 66%, which is a 18% and 8% increase respectively. The adaptive attack further demonstrates that the privacy risk of model informa- tion leakage from t-SNE plots is underestimated. Takeaways: With adaptive attacks, our model nullifies two most effective defense methods proposed. 6 Loss Plot Evaluation In this section, we demonstrate the attack is not limited to t- SNE plots but is also capable of attacking loss plots, which is another type of scientific plot widely used to showcase model convergence performance over the training process. 6.1 Attack Performance The attack follows the same attack methodology and uses the same default settings for shadow, target, and attack model training as previous t-SNE attacks. The inference targets are also similar, including model type (6 pre-trained), batch size, and optimization algorithms on CIFAR-10, SVHN, and FashionMNIST datasets. We generate loss plots both with and without axis information using settings from Section 4 (see Figure 9 for an example). Table 11 shows that our attack can successfully infer model information from loss plots as well. The attack accuracy on the three types of inference targets are generally better than those on t-SNE plots. The results are expected since a loss plot is a direct reflection of the model's behavior. We also observe that additional axis in- formation improves attack performance. The average model type inference accuracy on loss plots with axis information generated from models trained on SVHN is 86.8%. For the loss plots without axis information, our attack can still achieve 76.2% accuracy, which shows that the loss curve it- self plays an important role in the attack model to distinguish 10 Table 11: The average attack accuracy on loss plots for differ- ent inference targets on 3 different datasets. The values in the parenthesis are results for loss plots without axis. Table 13: Adaptive loss plot attack performance. The value in the parenthesis denotes the original attack performance. Inference Targets CIFAR-10 SVHN FashionMNIST Model Type <6> Batch Size <4> Optimizer <2> 87.1(78.4) ± 0.9% 86.8(76.2) ± 0.8% 71.9(56.7) ± 0.3% 91.4(90.5) ± 0.4% 90.2(90.1) ± 0.5% 86.9(86.2) ± 0.6% 98.4(96.7) ± 0.2% 99.7(98.5) ± 0.4% 84.0(74.6) ± 0.3% Table 12: Loss plot defense performance on SVHN. Defense Methods Acc. w Axis Acc. wo Axis L2 Distance No Defense Gaussian Noise TensorBoard Sliding Window 86.8 ± 0.8% 76.2 ± 0.7% 48.5 ± 1.9% 48.4 ± 2.1% 81.1 ± 0.9% 65.2 ± 1.1% 44.5 ± 2.6% 57.1 ± 1.8% 0 1.211 0.310 0.827 (a) O (b) N (c) T (d) S Figure 9: Loss plots with different defenses. Here O denotes the Original model without any defense, N denotes the Gaus- sian Noise, T denotes Tensorboard Smoothing, and S denotes Sliding Window Smoothing. For the loss plots with axis infor- mation, the x-axis denotes the timestamp (an epoch is divided into 5 timestamps) and the y-axis denotes the loss value. different model types. The confusion matrix of the inference results is shown in Figure 17 (in Appendix). 6.2 Loss Plot Defense To prevent the model information leakage from loss plots, we consider three defenses below, i.e., Gaussian noise, Tensor- Board smoothing, and sliding window smoothing. We use the L2 distance between original loss curves and the pro- tected ones as the utility of the defense (a successful defense should not destroy the usefulness of the original plot, and thus should have a high utility). Gaussian Noise. One way to introduce disturbance in the loss curve while preserving overall characteristics is to add Gaussian noise to the losses. Here we use the average stan- dard deviation of loss values as the standard deviation of the Gaussian noise. As we can see in Table 12, the results show that adding Gaussian noise can mitigate the inference perfor- mance. The inference accuracy is reduced by around 40% on loss plots with the axis. The mitigation is less effective on loss plots without the axis. The L2 distance between the original and altered loss curve is 1.211, the highest among all 3 defense methods. When inspecting the loss curve visu- ally in Figure 9, we observe the defense has altered crucial Defense Methods Acc. w Axis Acc. wo Axis No Defense TensorBoard Sliding Window 89.5(86.8) ± 0.5% 77.5(76.2) ± 0.9% 89.6(81.1) ± 0.4% 67.7(65.2) ± 0.9% 84.1(44.5) ± 0.7% 59.2(57.1) ± 2.1% information in the loss curve. For instance, at around 15-th timestamp, the training loss is notably higher than the test loss, which is not a characteristic of the original loss curve. Adding Gaussian noise is thereof not ideal. TensorBoard Smoothing. We apply the loss curve smooth- ing strategy used in TensorBoard [5], a popular tool among machine learning researchers. The loss value at each times- tamp is averaged between the loss value at the current and previous timestamps, with a scalar constant controlling the weight of each value: L ∗ t = wLt−1 + (1 − w)Lt , where w is a weight factor. With the weight factor set at 0.2, i.e., with 80% of the weight on the current value, the defense is not ef- fective, decreasing the inference performance by only 5.7% and 11.0% respectively with and without axis in loss plots, although both observations and the quantitative L2 distance show TensorBoard smoothing does have high utility. Sliding Window Smoothing. Another smoothing technique is using a sliding window. The smoothed value at a given timestamp t is calculated by averaging the loss value starting from timestamp t till timestamp t + s, where s is the sliding window size. If the endpoint is beyond total timestamps, the average is calculated with existing values: L ∗ n=t Ln. With a window size of 2, sliding window smoothing pro- vides good protection against model information extraction from loss plots, compared to the previous two methods. The inference accuracy decreases for both types of loss plots. For instance, the attack accuracy decreases 42.3% on loss plots with axis. Although the L2 distance is higher than that of Tensorboard smoothing, the loss curve's overall character- istics are largely preserved (by observing Figure 9d). The altered loss curve still presents the model's convergence rate, overfitting level, and general performance accurately. ∑t+s t = 1 n 6.3 Adaptive Attack Similar to the adaptive attack on t-SNE (see Section 5.7), we assume the adaptive adversary has knowledge of the defense methods deployed. The adaptive attack model is trained on the original loss plots and the ones with the two de- fense methods, sliding window smoothing and TensorBoard smoothing (although TensorBoard smoothing is not effec- tive, for completeness, we assume the defense might be se- lected for its high utility). The attack performance is eval- uated on the original testing loss plots and the two altered versions respectively. Table 13 shows the adaptive attack achieves high accuracy across all settings. For instance, the inference accuracy on loss plots with the axis reaches 84.1% on a dataset protected with sliding window smoothing. It rep- resents an increase of 39.6% compared to the original attack. The adaptive attack also improves inference accuracy on loss 11 plots with axis more than those without. This is because the defense methods are not as effective on the loss plots without axis in the first place. Interestingly, the adaptive model per- forms better on the no-defense dataset as well. We suspect the altered loss plots serve as data augmentation and improve the attack model's generalization ability. The high accuracy of the adaptive attack further accentuates the potential threat of model information stealing attacks from loss plots. 7 Grad-CAM Analysis Gradient-weighted Class Activation Mapping (Grad-CAM) is a popular technique that provides visual explanations for CNNs [35]. We use Grad-CAM on the attack models to ana- lyze features in scientific plots that enable successful model information inference. t-SNE Plots Analysis. When conducting the ablation study on t-SNE (see Section 5.2), we notice that the attack models' performance remains similar across different color settings. We deduce that the attack model extracts information from t-SNE mostly from the clusters' geometric shapes. Figure 19 (in Appendix) shows Grad-CAM heatmaps of selected sam- ples in model type inference attack. We observe that the at- tack model can identify unique characteristics in t-SNE plots for inference targets based on the heatmaps. While the at- tack model uses the scattered clusters to classify MobileV3's t-SNE, it finds more distinct characteristics among similar model types, such as those from the ResNet family. Grad- CAM visualization also explains the high misclassification rate between ResNet34 and ResNet50 (as seen in Figure 15 in Appendix). These two model types are very similar and the patterns identified by the attack model from the t-SNE plots (see Figure 19b and Figure 19c) are also hard to dis- tinguish by human eyes. It is therefore understandable that such slight variations can indeed cause confusion between these two geometric features. Loss Plots Analysis. Figure 20 and Figure 21 (in Ap- pendix) show Grad-CAM heatmaps on loss plot attacks. For both with and without axis loss plots, the attack model uti- lizes mostly the loss information in the first 10 timestamps. When the loss plot includes axis, the attack model uses the added quantitative information to improve classification per- formance for certain classes, e.g., ResNet34 or ResNet50 (the two highest misclassified model types without axis, see Figure 17 in Appendix). Grad-CAM visualization shows that the attack model can correctly identify regions in loss plots most relevant to the original model's performance. 8 Related Work Previous research has shown that machine learning mod- els are vulnerable to model stealing attacks [7, 21, 27, 30, 31, 36, 37, 39, 42]. The core assumption of those attacks is that the adversary has black-box access to the target model and then launches stealing attacks via the query-response information. They mainly focus on extracting the target model's parameters [7,21,39], hyperparameters [30,42], and functionalities [21, 27, 31, 36, 37]. Such attacks have also been applied to different machine learning paradigms such as NLP [27], Graph Neural Networks (GNNs) [37], and Con- trastive Learning [36]. The closest work to ours is Shen et al. [37]. It shows that a query-based attack can be conducted to steal a target model's (GNN) functionality when the model provides the t-SNE coordinates as the response. Different from Shen et al. [37], our attack aims at stealing model in- formation instead of the model itself. More importantly, we show that even one single scientific plot is enough to reveal the hyperparameters of the target model. To mitigate the model stealing attacks, several defense mechanisms have been proposed [10,22–24,28,32]. Broadly speaking, existing defenses focus on query-based model stealing attacks and can be classified into two categories. The first category centers on reactively analyzing the querying data. These approaches prevent model stealing attacks by raising alerts when the query data's distribution largely de- viates from the overall benign query data distribution [23], giving incorrect predictions to OOD query samples [24], or embedding watermarks into the target model so that a model owner can later prove ownership [10, 22], etc. The sec- ond category aims at proactively defending the model steal- ing attack by using output perturbation [32], differential pri- vacy [44], model refinement [28], etc. We reveal that out- put perturbation techniques can effectively reduce our attack accuracy. However, such defenses can still be bypassed by adaptive attacks. 9 Limitations and Discussion We acknowledge that our work has some limitations. First of all, most of our evaluations assume the attacker has the knowledge of the target model's training data distribution. When directly evaluated on out-of-distribution data, the at- tack does not generalize well. However, domain shift is one of the biggest challenges when deploying machine learning models in the real world [16]. This certainly applies to our at- tack models as well. Also, our attack follows previous work's threat model where the training data distribution is not pri- vate [30, 42]. We further show that our attack is still potent when fine-tuned using a small amount of in-distribution data. Secondly, in the pre-trained model architecture settings, the evaluation is conducted on 6 model types belonging to 3 families. Though these models are the most popular ones, there are many more model types and families that we have yet to examine our attack on. However, the high attack ac- curacy in predicting model families indicates that it is easier for our attack to distinguish models from different architec- ture families. Models belonging to different families typ- ically generate more distinct scientific plots, and thus, our attack should scale well with models from more architecture families. Thirdly, all our experiments are conducted on CNN mod- els. We also perform our attacks on another type of machine learning model, namely, graph neural networks (GNNs). For the model type inference, we achieve a 95.4% accuracy, the concrete result is listed in Appendix B. We plan to explore the effectiveness of our attacks against other types of ma- chine learning models more thoroughly in the future. 12 10 Conclusion In this paper, we perform the first model information stealing attack against CNN models through scientific plots. Empir- ical evaluation shows that our attack is effective in inferring the configurations of target models. Our results also indi- cate that some defenses can effectively mitigate the attack. However, those defenses fail when an adaptive attacker is considered. This further demonstrates the severe risk of sci- entific plots leaking target model's information. We hope our discovery of model information leakage from scientific plots can inspire future work to develop more robust ones against such attacks. Acknowledgments. We thank all anonymous reviewers for their constructive comments. This work is partially funded by the Helmholtz Association within the project "Trustwor- thy Federated Data Analytics" (TFDA) (funding number ZT- I-OO1 4), by the European Health and Digital Executive Agency (HADEA) within the project "Understanding the in- dividual host response against Hepatitis D Virus to develop a personalized approach for the management of hepatitis D" (D-Solve) (grant agreement number 101057917), and by NSF grant number 2217071. References [1] https://ai.googleblog.com/2018/06/realtime-tsne- visualizations-with.html. 4 [2] https://joeddav.github.io/blog/2020/05/29/ ZSL.html. 4 [3] https://www.oreilly.com/content/an-illustrated- introduction-to-the-t-sne-algorithm/. 4 [4] https://scikit-learn.org/stable/modules/ generated/sklearn.manifold.TSNE.html. 7 [5] https://www.tensorflow.org/tensorboard. 11 [6] Nicholas Carlini, Steve Chien, Milad Nasr, Shuang Song, An- dreas Terzis, and Florian Tramèr. Membership Inference At- tacks From First Principles. In IEEE Symposium on Security and Privacy (S&P), pages 1897–1914. IEEE, 2022. 3 [7] Nicholas Carlini, Matthew Jagielski, and Ilya Mironov. Crypt- In Annual analytic Extraction of Neural Network Models. International Cryptology Conference (CRYPTO), pages 189– 218. Springer, 2020. 12 [8] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geof- frey E. Hinton. A Simple Framework for Contrastive Learn- ing of Visual Representations. In International Conference on Machine Learning (ICML), pages 1597–1607. PMLR, 2020. 4 [9] Yufei Chen, Chao Shen, Cong Wang, and Yang Zhang. Teacher Model Fingerprinting Attacks Against Transfer In USENIX Security Symposium (USENIX Secu- Learning. rity), pages 3593–3610. USENIX, 2022. 1, 2, 3 [10] Tianshuo Cong, Xinlei He, and Yang Zhang. SSLGuard: A Watermarking Scheme for Self-supervised Learning Pre- trained Encoders. In ACM SIGSAC Conference on Computer and Communications Security (CCS), pages 579–593. ACM, 2022. 12 [11] C. Lee Giles, Kurt D. Bollacker, and Steve Lawrence. Cite- In Interna- Seer: An Automatic Citation Indexing System. tional Conference on Digital Libraries (ICDL), pages 89–98. ACM, 1998. 14 [12] Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Ex- In Interna- plaining and Harnessing Adversarial Examples. tional Conference on Learning Representations (ICLR), 2015. 9 In- [13] William L. Hamilton, Zhitao Ying, and Jure Leskovec. In An- ductive Representation Learning on Large Graphs. nual Conference on Neural Information Processing Systems (NIPS), pages 1025–1035. NIPS, 2017. 14 [14] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum Contrast for Unsupervised Visual Rep- In IEEE Conference on Computer resentation Learning. Vision and Pattern Recognition (CVPR), pages 9726–9735. IEEE, 2020. 4 [15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In IEEE Con- ference on Computer Vision and Pattern Recognition (CVPR), pages 770–778. IEEE, 2016. 4 [16] Dan Hendrycks and Kevin Gimpel. A Baseline for Detect- ing Misclassified and Out-of-Distribution Examples in Neural In International Conference on Learning Repre- Networks. sentations (ICLR), 2017. 12 [17] Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco An- dreetto, and Hartwig Adam. MobileNets: Efficient Con- volutional Neural Networks for Mobile Vision Applications. CoRR abs/1704.04681, 2017. 4 [18] Christopher R. Hoyt and Art B. Owen. Probing neural net- works with t-SNE, class-specific projections and a guided tour. CoRR abs/2107.12547, 2021. 3 [19] Hongsheng Hu, Zoran Salcic, Lichao Sun, Gillian Dobbie, Philip S. Yu, and Xuyun Zhang. Membership Inference At- tacks on Machine Learning: A Survey. ACM Computing Sur- veys, 2021. 3 [20] Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kil- ian Q. Weinberger. Densely Connected Convolutional Net- works. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2261–2269. IEEE, 2017. 4 [21] Matthew Jagielski, Nicholas Carlini, David Berthelot, Alex Kurakin, and Nicolas Papernot. High Accuracy and High Fi- In USENIX Security delity Extraction of Neural Networks. Symposium (USENIX Security), pages 1345–1362. USENIX, 2020. 12 [22] Hengrui Jia, Christopher A. Choquette-Choo, Varun Chan- drasekaran, and Nicolas Papernot. Entangled Watermarks as In USENIX Security a Defense against Model Extraction. Symposium (USENIX Security), pages 1937–1954. USENIX, 2021. 12 [23] Mika Juuti, Sebastian Szyller, Samuel Marchal, and N. Asokan. PRADA: Protecting Against DNN Model Steal- ing Attacks. In IEEE European Symposium on Security and Privacy (Euro S&P), pages 512–527. IEEE, 2019. 12 [24] Sanjay Kariyappa and Moinuddin K. Qureshi. Defending Against Model Stealing Attacks With Adaptive Misinforma- In IEEE Conference on Computer Vision and Pattern tion. Recognition (CVPR), pages 767–775. IEEE, 2020. 1, 12 [25] Ramneet Kaur, Susmit Jha, Anirban Roy, Oleg Sokolsky, and Insup Lee. Are all outliers alike? On Understanding the Diver- sity of Outliers for Detecting OODs. CoRR abs/2103.12628, 2021. 3 13 [26] Manish Kesarwani, Bhaskar Mukhoty, Vijay Arya, and Sameep Mehta. Model Extraction Warning in MLaaS In Annual Computer Security Applications Con- Paradigm. ference (ACSAC), pages 371–380. ACM, 2018. 1 [27] Kalpesh Krishna, Gaurav Singh Tomar, Ankur P. Parikh, Nicolas Papernot, and Mohit Iyyer. Thieves on Sesame Street! Model Extraction of BERT-based APIs. In International Con- ference on Learning Representations (ICLR), 2020. 12 [28] Taesung Lee, Benjamin Edwards, Ian Molloy, and Dong Su. Defending Against Neural Network Model Stealing Attacks Using Deceptive Perturbations. In IEEE Security and Privacy Workshops (SPW), pages 43–49. IEEE, 2019. 12 [29] Yuanchun Li, Ziqi Zhang, Bingyan Liu, Ziyue Yang, and Yunxin Liu. ModelDiff: Testing-Based DNN Similarity Com- In ACM SIGSOFT In- parison for Model Reuse Detection. ternational Symposium on Software Testing and Analysis (IS- STA), pages 139–151. ACM, 2021. 1, 2, 3 [30] Seong Joon Oh, Max Augustin, Bernt Schiele, and Mario Fritz. Towards Reverse-Engineering Black-Box Neural Net- works. In International Conference on Learning Representa- tions (ICLR), 2018. 1, 2, 3, 8, 12 [31] Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. Knockoff Nets: Stealing Functionality of Black-Box Models. In IEEE Conference on Computer Vision and Pattern Recog- nition (CVPR), pages 4954–4963. IEEE, 2019. 12 [32] Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. Pre- diction Poisoning: Towards Defenses Against DNN Model In International Conference on Learning Stealing Attacks. Representations (ICLR), 2020. 1, 12 [33] Joaquin Quinonero-Candela, Masashi Sugiyama, Anton Schwaighofer, and Neil D. Lawrence. Dataset Shift in Ma- chine Learning. MIT Press, 2008. 7 [34] Ahmed Salem, Yang Zhang, Mathias Humbert, Pascal Berrang, Mario Fritz, and Michael Backes. ML-Leaks: Model and Data Independent Membership Inference Attacks and De- In Network and Dis- fenses on Machine Learning Models. tributed System Security Symposium (NDSS). Internet Society, 2019. 3 [35] Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad- CAM: Visual Explanations from Deep Networks via Gradient- In IEEE International Conference on Based Localization. Computer Vision (ICCV), pages 618–626. IEEE, 2017. 2, 12 [36] Zeyang Sha, Xinlei He, Ning Yu, Michael Backes, and Yang Zhang. Can't Steal? Cont-Steal! Contrastive Stealing Attacks Against Image Encoders. CoRR abs/2201.07513, 2022. 12 [37] Yun Shen, Xinlei He, Yufei Han, and Yang Zhang. Model Stealing Attacks Against Inductive Graph Neural Networks. In IEEE Symposium on Security and Privacy (S&P), pages 1175–1192. IEEE, 2022. 1, 12 [38] Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership Inference Attacks Against Machine Learning Models. In IEEE Symposium on Security and Pri- vacy (S&P), pages 3–18. IEEE, 2017. 2, 3 [39] Florian Tramèr, Fan Zhang, Ari Juels, Michael K. Reiter, and Thomas Ristenpart. Stealing Machine Learning Models via In USENIX Security Symposium (USENIX Prediction APIs. Security), pages 601–618. USENIX, 2016. 12 [40] Laurens van der Maaten and Geoffrey Hinton. Visualizing Data using t-SNE. Journal of Machine Learning Research, 2008. 1, 2, 5, 9 [41] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adri- ana Romero, Pietro Liò, and Yoshua Bengio. Graph Attention In International Conference on Learning Repre- Networks. sentations (ICLR), 2018. 14 [42] Binghui Wang and Neil Zhenqiang Gong. Stealing Hyperpa- rameters in Machine Learning. In IEEE Symposium on Secu- rity and Privacy (S&P), pages 36–52. IEEE, 2018. 1, 2, 3, 12 [43] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful are Graph Neural Networks? In International Conference on Learning Representations (ICLR), 2019. 14 [44] Huadi Zheng, Qingqing Ye, Haibo Hu, Chengfang Fang, and Jie Shi. BDPL: A Boundary Differentially Private Layer Against Machine Learning Model Extraction Attacks. In Eu- ropean Symposium on Research in Computer Security (ES- ORICS), pages 66–83. Springer, 2019. 12 [45] Barret Zoph, Deniz Yuret, Jonathan May, and Kevin Knight. Transfer Learning for Low-Resource Neural Machine Trans- lation. In Conference on Empirical Methods in Natural Lan- guage Processing (EMNLP), pages 1568–1575. ACL, 2016. 4 Appendix A Procedure of t-SNE t-SNE has two main phases. First, given the data's high- dimensional embeddings {hi}, we define the similarity be- tween each pair of embeddings as pi j = pi| j+p j|i 2n where p j|i = exp(−(cid:107)hi − h j(cid:107)2/2σ2 i ) exp(−(cid:107)hi − hk(cid:107)2/2σ2 i ) ∑ k(cid:54)=i and σi is determined by the perplexity of the similarities. Second, t-SNE finds the low-dimensional points {(cid:96)i} corresponding to {hi} that minimizes the KL-divergence , where q = {qi j} is the similarities among ∑i ∑ j pi j log {(cid:96)i}, and is defined as pi j qi j qi j = (1 + (cid:107)(cid:96)i − (cid:96) j(cid:107)2)−1 (1 + (cid:107)(cid:96)s − (cid:96)t (cid:107)2)−1 ∑ s(cid:54)=t {(cid:96)i} should have the same similarity characteristic (i.e., pairs close in high-dimensional space would also be close in low- dimensional space) as {hi}. B GNN Experiment Results While our work focuses on conducting attacks against CNN- based image classifiers, we believe the vulnerability exists in scientific plots for other types of data and models as well. We conduct an experiment predicting the model types (Graph- SAGE [13], GAT [41], GIN [43]) of graph neural network (GNN) models trained on CiteSeer-Full [11] using their cor- responding t-SNE plots. Our attack achieves 95.4% accuracy with 30 shadow models. The attack model transferred from previous experiments (CNN models) achieves 87.1% accu- racy even with only 3 shadow models (one for each model type). The high transferability indicates the attack model can 14 learn features from t-SNE plots that are useful for extract- ing target models' information even when the original target models are extremely different. C Additional Figures Here we include additional figures related to our study. (a) 5 (b) 15 (c) 30 (d) 80 Figure 13: t-SNE plots with different perplexity values. The model is ResNet50 trained on SVHN. (a) Adam (b) SGD Figure 10: t-SNE plots of ResNet18 models trained with differ- ent optimization algorithms on CIFAR-10. (a) CIFAR10 (b) FashionMNIST (c) SVHN Figure 14: datasets. t-SNE plots of ResNet18 trained on different (a) Color (b) Grayscale (c) Binary Figure 11: t-SNE plots with different color settings. The model is ResNet18 trained on SVHN. (a) 200 (b) 500 (c) 700 Figure 15: Confusion matrix for model type inference of t-SNE plots on CIFAR-10. The inference accuracy is at least 58% on each model type. The highest confusion occurs between ResNet34 and ResNet50. (d) 1000 (e) 2000 (f) 4000 Figure 12: t-SNE plots with different sample densities. The model is ResNet18 trained on SVHN. Figure 16: Confusion matrix for batch size inference of t-SNE plots on CIFAR-10. Similar batch sizes are more easily con- fused. 15 (a) Confusion Maxtrix for Loss Plots w/o Axis (b) Confusion Maxtrix for Loss Plots with Axis Figure 17: Adding axis information reduces misclassification within the ResNet family models, especially for ResNet34 and ResNet50. (a) Embedding Rounding (b) Top 75% Embedding (c) Top 60% Embedding (d) Embedding Noise (e) t-SNE Integer Rounding (f) t-SNE Even Rounding (g) t-SNE Noise (2% STD) (h) t-SNE Noise (5% STD) Figure 18: t-SNE plots under different defense methods. Embedding noise (d) fails visual examination due to much more dispersed clusters. t-SNE coordinates rounding (e) and (f) fails due to obvious artifacts (e.g., grid-like patterns). (a) ResNet18 (b) ResNet34 (c) ResNet50 (d) MobileV2 (e) MobileV3 (f) DenseNet121 Figure 19: Grad-CAM heat map on t-SNE plots. The attack model focuses on different patterns. 16 (a) ResNet18 (b) ResNet34 (c) ResNet50 (d) MobileV2 (e) MobileV3 (f) DenseNet121 Figure 20: The Grad-CAM heat map on loss plots without axis. The attack model focuses primarily on early epochs. (a) ResNet18 (b) ResNet34 (c) ResNet50 (d) MobileV2 (e) MobileV3 (f) DenseNet121 Figure 21: The Grad-CAM heat map on loss plots with the axis. The attack model uses axis information heavily for ResNet18 and ResNet34. The added axis information noticeably reduces attack model's misclassification rate within the ResNet family. 17
http://arxiv.org/abs/2302.11979v1
2023-02-23T12:51:03
2023-02-23T12:51:03
Data-Driven Observability Analysis for Nonlinear Stochastic Systems
Distinguishability and, by extension, observability are key properties of dynamical systems. Establishing these properties is challenging, especially when no analytical model is available and they are to be inferred directly from measurement data. The presence of noise further complicates this analysis, as standard notions of distinguishability are tailored to deterministic systems. We build on distributional distinguishability, which extends the deterministic notion by comparing distributions of outputs of stochastic systems. We first show that both concepts are equivalent for a class of systems that includes linear systems. We then present a method to assess and quantify distributional distinguishability from output data. Specifically, our quantification measures how much data is required to tell apart two initial states, inducing a continuous spectrum of distinguishability. We propose a statistical test to determine a threshold above which two states can be considered distinguishable with high confidence. We illustrate these tools by computing distinguishability maps over the state space in simulation, then leverage the test to compare sensor configurations on hardware.
[ "Pierre-François Massiani", "Mona Buisson-Fenet", "Friedrich Solowjow", "Florent Di Meglio", "Sebastian Trimpe" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11979v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11979v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "eess.SY", "@scheme": "http://arxiv.org/schemas/atom" }
[ "eess.SY", "cs.LG", "cs.SY" ]
DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS 1 Data-Driven Observability Analysis for Nonlinear Stochastic Systems Pierre-François Massiani† , Mona Buisson-Fenet† , Friedrich Solowjow , Florent Di Meglio , and Sebastian Trimpe 3 2 0 2 b e F 3 2 ] Y S . s s e e [ 1 v 9 7 9 1 1 . 2 0 3 2 : v i X r a systems. Establishing these properties Abstract-Distinguishability and, by extension, observability are key properties of dynamical is challenging, especially when no analytical model is available and they are to be inferred directly from measurement data. The presence of noise further complicates this analysis, as standard notions of distinguishability are tailored to deterministic systems. We build on distributional distinguishability, which extends the deterministic notion by comparing distributions of outputs of stochastic systems. We first show that both concepts are equivalent for a class of systems that includes linear systems. We then present a method to assess and quantify distributional distinguishability from output data. Specifically, our quantification measures how much data is required to tell apart two initial states, inducing a continuous spectrum of distinguishability. We propose a statistical test to determine a threshold above which two states can be considered distinguishable with high confidence. We illustrate these tools by computing distinguishability maps over the state space in simulation, then leverage the test to compare sensor configurations on hardware. Index Terms-Kernel methods; Stochastic systems; Output feedback and Observers; Statistical learning; Nonlinear systems I. INTRODUCTION D ISTINGUISHABILITY is the property that allows telling apart different initial states from output measurements; observability then refers to all states being distinguishable. It is a core assumption in observer design, and there exist multiple sufficient criteria to establish observability from analytical models [1]. However, in many cases, such an analytical model is either unavailable or impractical to work with. Examples involve engineering systems with intractable models, black-box simulators, or systems that are only partially or imperfectly modeled such that the derived properties may not transfer to the real world [2]. In contrast, we often have access to measurement data generated by these systems. In this paper, we propose to infer observability of the underlying system from such data, without relying on an explicit model of the dynamics. In many cases, measurements are corrupted by noise. Yet, the standard definition of observability is tailored to deterministic systems [3], and noise is often treated as a perturbation against which an observer should be robust [4]. This perspective circumvents defining stochastic observability by focusing on the robustness of the specific observer. In contrast, we start by defining an inherent notion of observability for stochastic systems. We argue that there is a broad class of reasonable definitions, each corresponding to † The authors contributed equally. P.-F. Massiani ([email protected]), M. Buisson-Fenet ([email protected]), F. Solowjow ([email protected] aachen.de), and S. Trimpe ([email protected]) are with the Institute for Data Science in Mechanical Engineering, RWTH Aachen University, 52068 Aachen, Germany. M. Buisson-Fenet and F. Di Meglio ([email protected]) are with the Centre Automatique et Systèmes, Mines Paris – PSL university, 75006 Paris, France. M. Buisson-Fenet is also with the Ansys Research Team, Ansys France, 69100 Villeurbanne, France. Under review. May be subject to changes. a way of comparing the underlying stochastic processes [5, 6, 7, 8, 9, 10]. We generalize distributional distinguishability, first defined for probabilistic Boolean networks (PBNs) [5], to arbitrary nonlinear systems. It consists in comparing the distributions of the output. We show that distributional distinguishability is a reasonable generalization of the deterministic notion by proving that the stochastic and nominal systems share the same classes of indistinguishability under some assumptions, which include linear systems. Our main contribution is then a method to assess and quantify this distributional distinguishability from measurement data. To achieve this, we propose to use a metric between the distributions of output measurements; its value reflects how different these distributions are. We choose the maximum mean discrepancy (MMD) [11] as this metric, for three reasons. First, it takes values in a continuous set, which induces a continuous spectrum of relative distinguishability on which some pairs are more distinguishable than others. Second, it can be estimated from data, hereby establishing distinguishability of initial distributions with high confidence given the data (absolute distinguishability) through statistical testing. Third, its continuous value is interpreted as how easily two initial distributions can be told apart, in the sense of how much data the test requires. We validate the proposed tools in simulation and on hardware. We first demonstrate using the finite-sample MMD to evaluate and quantify distinguishability. We experimentally recover the nominal system's analytical classes of indistinguishability in the cases covered by our theoretical results, and empirically demonstrate how the metric increases as we get farther from a state's class of indistinguishability. This also enables evaluating the influence of the noise on said classes. Further, we illustrate the difference between our test and empirical Gramians [12], a tool for data-driven weak observability analysis. We then use the proposed test on a Furuta pendulum for experiment design by checking whether removing specific sensors harms observability. Finally, we begin bridging the gap between the proposed tools and observer design by showcasing how an observer outputs the same distribution over estimated trajectories when the system is initialized in indistinguishable states. This is a first step towards using our tools for a priori error analysis in observer design; the MMD indicates which states observers will fail to distinguish. A. Related Work We propose a method to assess and quantify observability from output data without explicitly relying on a dynamics model. To the best of our knowledge, such a model-free, data-driven analysis has never been proposed for nonlinear stochastic systems. We start by reviewing existing notions of stochastic observability and distinguishability and corresponding metrics. Finally, we present an essential concept for the metric we propose: kernel mean embeddings (KMEs). 2 DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS is often treated as 1) Stochastic Observability: Noise a perturbation against which observers should be robust [4]; stochastic observability then reduces to (approximate) convergence of usual observers, possibly up to some probability [13]. Despite its practical appeal, this approach ties observability (a system property) to the observer (a design choice), and neglects the question of how noise affects observability independently of the chosen observer. Answering it requires defining observability for a stochastic system; yet, there is no consensus over such a definition [12]. Many approaches deal with linear systems and rely on the superposition principle to define observability of the whole system directly [14]. Extensions to nonlinear systems typically result in local notions of observability. A relevant example is stochastic Gramians [12], a generalization of empirical Gramians of nonlinear systems [15, 16]. Similarly to our method, they enable a data-driven analysis of observability with the important difference that they build on local weak observability instead of distinguishability, which only provides local information, as we illustrate in Section IV. Competing approaches aim at generalizing distinguishability [3] of (distributions over) initial states, rather than observability. Core to these approaches is a way to compare the underlying stochastic processes induced by the stochastic initial state, dynamics, and measurement. Since stochastic processes can be compared in many more ways than deterministic trajectories, there exists different notions of distinguishability for stochastic systems. Examples systems [8, 9, 10]; involve PBNs [5, 6, 7] and other their corresponding definitions of distinguishability are not always explicit, but can be straightforwardly adapted from those of observability. Interestingly, the relationship between such definitions and the existence of a probabilistic observer has not been studied, unlike for deterministic systems [1]. Our approach builds on distributional distinguishability [5], and we show that it is equivalent to observability of the nominal system in certain cases, such as linear dynamics or additive measurement noise. One advantage of this notion is also its amenability to statistical tests provided independent realizations of the system. linear to 2) Metricizing Observability: A practical way check in a scalar value or function. observability is to summarize it linear systems, such a metric is given by the rank of For the observability matrix or, equivalently, of the observability Gramian [17]. An alternative is the largest singular value of the Gramian, introducing a continuous scale and enabling a quantification of observability. These metrics translate locally to nonlinear systems with empirical Gramians [15]; they inform on the weak observability of each state. Gramians and their corresponding metrics have also been extended for stochastic systems [12]. They are formally defined for linear systems with additive or multiplicative noise, and extensions towards arbitrary nonlinear systems are only hinted at [12, Section 5]. While our theoretical analysis shares similar restrictions, our approach differs in that 1) our definition and quantification are readily applicable to both linear and nonlinear systems; and 2) we quantify distinguishability of two initial states, instead of weak observability. Finally, there is a body of research that defines observability [18] and observability metrics [19] based on information-theoretic properties of the output. This definition strongly differs from our approach, which is thus of independent interest. 3) Kernel Mean Embeddings: Our quantification of observability relies on KMEs of probability distributions [11]. In short, these embeddings represent probability distributions in a high-dimensional reproducing kernel Hilbert space (RKHS) where scalar products can be performed efficiently and often estimated from data. Therefrom developed many methods to model and compare random variables, such as modeling of conditional relations [20] or Bayesian inference [21]. Essential for this work is the MMD, a distance between probability distributions that can be estimated from data [22]. The MMD was leveraged in a distribution-free two-sample test able to compare probability distributions from independent samples [23]. We heavily rely on both the MMD and this test, which requires independent samples from the same distributions. This can be problematic for dynamical systems, where the future greatly depends on the past. Some approaches alleviate this problem with mixing [24]; in contrast, we assume independent reinitializations of the system. B. Notations The Borel σ-algebra of an open set S ⊂ Rn is B(S), and M+ 1 (S) is the set of probability measures on (S, B(S)). We assume open sets X ⊂ Rnx and Y ⊂ Rny , respectively called state and output spaces, and equip them with their Borel σ-algebras. All random variables are defined on a probability space (Ω, A, P). For a random variable Z, the notation Z ∈ S means that Z takes values in (S, B(S)), and χZ is the characteristic function of Z. II. DISTINGUISHABILITY We first recall a definition of observability for deterministic systems (Section II-A), then extend this notion to nonlinear stochastic systems by generalizing distributional distinguishability of PBNs (Section II-B). This sets the stage for our first contribution: showing that, for linear dynamics or certain nonlinear systems, the two notions are equivalent (Section II-C). For simplicity, we focus on autonomous systems. All concepts and results translate to control systems by considering distinguishability for a specific controller, as is commonly done [3, 15]. A. Deterministic Distinguishability Consider a deterministic system xt+1 = f (xt), yt = h(xt), (1) with arbitrary initial condition x0 ∈ X. The function f : X → X is the dynamics, h : X → Y is the output map. We denote by φ(t, x0) ∈ X the state of (1) initialized in x0, at time t. Additionally, define the output trajectory up to time T ∈ N of (1) initialized in x0 as γ(T, x0) = (cid:0)h(φ(0, x0)), . . . , h(φ(T, x0))(cid:1) ∈ YT +1. (2) We can then define distinguishability and observability as: Definition 1 (Sontag [3, Chapter 6]): Let T ∈ N, and let xa, xb ∈ X be two initial states of (1). We say that xa and xb are distinguishable (in time T ) if γ(T, xa) (cid:54)= γ(T, xb). Otherwise, we say that they are indistinguishable (in time T ). Finally, the system is observable (in time T ) if all different initial states are distinguishable. Intuitively, indistinguishable states produce the same output until time T . It is thus impossible to tell them apart by looking only at the output sequence. In contrast, distinguishability means that the outputs differ after some time. Definition 1 is binary, meaning that an infinitesimal difference between trajectories can make two states distinguishable. This becomes problematic in practice, in particular for stochastic systems, where two sample paths from the same initial point will differ almost surely (a.s.) for nontrivial noise, dynamics, and measurement. DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS 3 B. Distributional Distinguishability We therefore need a generalized notion of distinguishability to handle stochastic systems. They come with the additional hurdle that output measurements are now random variables (RVs). Hence, the question of distinguishability pertains to the more general problem of how to compare stochastic processes. There are many suitable ways to define the "equivalence" of stochastic processes, each leading to a specific notion of stochastic observability [7, 5]. We focus on distributional distinguishability, since the similarity with the deterministic case makes it a natural extension and because, as we will show, it lends itself to data-driven evaluation. Consider a stochastic dynamical system of the form Xt+1 = F (Xt, ηt), Yt = H(Xt, (cid:15)t). (3) The state Xt and output Yt are now RVs taking values in X and Y, respectively. The RV ηt ∈ Rnη represents the stochastic part of the dynamics, and (cid:15)t ∈ Rn(cid:15) the one of the measurement. We assume that (3) is a noisy version of (1), that is, F (x, 0) = f (x) and H(x, 0) = h(x). We allow stochastic initializations, meaning that there exists an initial distribution μ defined on X such that X0 ∼ μ. We assume that ηt and (cid:15)t are independent of the past states (Xs)s≤t. We do not make further assumptions on the noise; e.g., we allow non-centered or autocorrelated noise. Finally, we denote by Φ(t, μ) the random state of (3) initialized as per μ, at time t ∈ N, and define Γ(T, μ) = (cid:0)H(Φ(0, μ), (cid:15)0), . . . , H(Φ(T, μ), (cid:15)T )(cid:1) ∈ YT +1, (4) the random output trajectory up to time T ∈ N. We denote its law by PT μ . We are now ready to generalize distributional distinguishability, first introduced for PBNs [5], as follows: Definition 2 (Distributional Distinguishability): Let T ∈ N, and let μa, μb be two initial distributions of (3). We say that μa and μb are distributionally distinguishable (in time T ) if PT μb . Otherwise, we say that they are distributionally indistinguishable (in time T ). Finally, the system is distributionally observable (in time T ) if all different initial distributions are distributionally distinguishable. μa (cid:54)= PT Distributional observability thus compares the laws of the random trajectories instead of comparing the trajectories themselves, as Definition 1 does. Intuitively, it focuses on whether one can tell apart different initial distributions by repeating the experiment. it is also meaningful Since distributional distinguishability is defined for arbitrary initial distributions, to talk about distributional distinguishability of initial states; the initial distributions involved are then accordingly-centered Diracs. In what follows, we abuse notations and use x directly instead of δx in Φ(t, *), Γ(T, *), and PT * . C. Noise and Distinguishability (iff) if, and only if, Distributional observability reduces to the classical, deterministic notion when the system is deterministic with deterministic initializations; the distributions of Φ(T, xa) and Φ(T, xb) are then Diracs and are thus equal the variables are equal a.s. Therefore, we study whether noise influences distinguishability. In particular, can introducing noise make two states distinguishable? Conversely, can noise hide the difference between nominally-distinguishable initial states? In general, yes; the classes of indistinguishability of the nominal and noisy systems differ, as we illustrate in Section IV. In this section, we study conditions under which the noise does not influence distinguishability. We start with measurement noise and show that, under a technical assumption, it does not affect distinguishability. This implies that the deterministic and stochastic notions coincide in the absence of process noise. We then treat linear systems, for which this equivalence always holds. 1) Measurement Noise: We start with the following assumption to restrict the influence of measurement noise to the output of h: Assumption 1: There exists a measurable function K : Y × Rn(cid:15) → Y such that H(x, e) = K(h(x), e). This enables introducing the output before its corruption by measurement noise, an RV denoted by ˆYt = h(Xt) independent of (cid:15)t. Assumption 2: For all νa, νb ∈ M+ 1 (YT +1) with νa (cid:54)= νb, there exists A ∈ B(YT +1) such that, by applying K element-wise, (cid:90) YT +1 P[K(ˆγ, (cid:15)) ∈ A]dνa(ˆγ) (cid:54)= (cid:90) YT +1 P[K(ˆγ, (cid:15)) ∈ A]dνb(ˆγ). (5) This assumption is a generalized injectivity condition: it requires the mapping from a distribution ν of ˆΓ to the output distribution after corruption by measurement noise to be injective, where ˆΓ = ( ˆY0, . . . , ˆYT ) is the output trajectory before the measurement noise. It ensures that if two distributions of ˆΓ are distinct, they remain different after applying measurement noise. Example 1 (Additive Noise): Albeit technical, Assumption 2 is satisfied for additive noise. Indeed, assume K(ˆγ, e) = ˆγ +e, and take 1 (YT +1), distinct. Let ˆΓa ∼ νa, ˆΓb ∼ νb, and assume νa, νb ∈ M+ that ˆΓa, ˆΓb, and (cid:15) are independent. We have, for all A ∈ B(YT +1): (cid:90) YT +1 P[K(ˆγ, (cid:15)) ∈ A]dνi(ˆγ) = P[K(ˆΓi, (cid:15)) ∈ A], (6) where i ∈ {a, b}. Therefore, Assumption 2 is satisfied iff ˆΓa + (cid:15) and ˆΓb + (cid:15) have different laws, iff χˆΓa+(cid:15) (cid:54)= χˆΓb+(cid:15). By independence, χˆΓi+(cid:15) = χˆΓi (cid:54)= χˆΓb , which is true since νa (cid:54)= νb. * χ(cid:15). Therefore, Assumption 2 holds iff χˆΓa Importantly, Assumption 2 enables decoupling the effect of measurement and process noise on distributional distinguishability; measurement noise then does not affect distinguishability. Theorem 1: Let μa, μb ∈ M+ 1 (X) be two initial distributions, and let Assumption 1 hold. If μa and μb are distributionally the distributions of ˆΓa ̇= (h(Φ(t, μa))T distinguishable, and ˆΓb ̇= (h(Φ(t, μb))T t=0 differ. Under Assumption 2, the converse is also true. t=0 Proof: Let μa, μb ∈ M+ B(YT +1) such that PT μa [A] (cid:54)= PT distribution of ˆΓi. Marginalizing Γ(T, μi) on ˆΓi yields (cid:90) 1 (X) be distinguishable, and take A ∈ μb [A]. Let i ∈ {a, b}, and νi be the PT μi [A] = YT +1 π(ˆγ, A)dνi(ˆγ), (7) μa [A] (cid:54)= PT is the probability of where π(ˆγ, A) = P [K(ˆγ, (cid:15)) ∈ A] the observation lying in A given that the nominal observation is ˆγ; it is thus independent of μa and μb. Since PT μb [A], (7) implies that the integral of π(*, A) differs when considered w.r.t. νa and νb. Therefore, νa (cid:54)= νb. Conversely, assume that νa and νb differ. Assumption 2 ensures the existence of A ∈ B(YT +1) such that the right-hand side of (7) differ for i = a and i = b; this shows PT μa (cid:54)= PT Corollary 1: Let Assumptions 1 and 2 hold. Assume that there is no process noise, i.e., ηt = 0 a.s. for all t. Let xa, xb ∈ X. Then, xa and xb are distinguishable for (1) iff they are distributionally distinguishable for (3). μb and concludes the proof. and xb Proof: By Theorem 1, xa are distributionally distinguishable iff ˆΓa and ˆΓb have different distributions. From η = 0 a.s., we have ∀x ∈ X, (h(Φ(t, x))T t=0 = γ(T, x) a.s. The result follows from Definition 1. Unfortunately, this corollary does not generalize to non-zero process noise, as we illustrate on an example in Section IV. We expect that such a generalization requires strong joint assumptions on the noise 4 DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS and dynamics, in the absence of which the trajectories of the nominal and noisy systems need not correlate. 2) Linear Systems: For linear systems, however, the superposition principle enables such a generalization. Theorem 2: Assume that (3) is linear, i.e., F (x, n) = Ax + Qn and H(x, e) = Cx + Rn. Then, two initial states xa, xb ∈ X are distributionally distinguishable iff they are distinguishable for (1). Additionally, (3) is distributionally observable iff (1) is observable. This guarantees that, for linear systems, noise preserves the classes of indistinguishability under the single assumption that the noise is independent of the past trajectory. Additionally, Kalman's criterion on the observability matrix enables checking distributional observability. We emphasize that the second claim is not a consequence of the first one; distributional observability requires all initial distributions to be distinguishable rather than initial states. This statement thus means that, for a linear system, distinguishability of all initial states ensures observability; there is no gain in considering initial distributions. 1 (X), the superposition principle holds: Proof: For μ ∈ M+ Γ(T, μ) = Γ(T, 0) + γ(T, μ), (8) where we abusively denote γ(T, X0) with X0 ∼ μ by γ(T, μ). Crucially, Γ(T, 0) and γ(T, μ) are independent, since the former is driven by noise and the latter by its random initialization. Hence, we have χΓ(T,μ) = χΓ(T,0) * χγ(T,μ). We thus have the following equivalences, for xa, xb ∈ X: they are distributionally indistinguishable iff PT xa = PT iff xb , χγ(T,δxa ) = χγ(T,δxb iff γ(T, xa) = γ(T, xb). This shows ), that xa and xb are distributionally indistinguishable iff they are deterministically indistinguishable. iff χΓ(T,xa) = χΓ(T,xb), μa = PT 1 (X) be two initial distributions with PT We now show that deterministic observability implies distributional observability, since the converse follows immediately from what precedes. Assume deterministic observability, and let μa, μb ∈ M+ μb . We show μa = μb. A similar reasoning as previously shows χγ(T,μa) = χγ(T,μb), i.e., γ(T, μa) and γ(T, μb) have the same law and, thus, μa and μb coincide on all sets A in the σ-algebra S = γ−1(T, B(YT +1)) ⊂ B(X). We show S = B(X). From observability of (1), γ(T, *) is injective. Since it is also linear, it admits a continuous (and thus, measurable) left inverse, say, λ : YT +1 → X. We are now ready to conclude. Take A ∈ B(X), and define B = λ−1(A) ∈ B(YT +1). We have, by definition of λ as a left inverse of γ, γ−1(T, B) = γ−1(T, λ−1(A)) = A. This shows that A ∈ S, i.e., that B(X) = S. Therefore, μa(A) = μb(A) for all A ∈ B(X), which shows distributional observability of (3). Albeit distributional and deterministic distinguishability differ in general, it is reasonable to expect that a small amount of noise only mildly affects the distinguishability of two states. In the next section, we propose a quantification of distinguishability to formalize the above intuition, and a method to estimate it from output data. A. The MMD to Measure Relative Distinguishability We start with background necessary to define the MMD and state the results that justify the method we propose. 1) Background: Before introducing the MMD, we need to define RKHSs and KMEs. We focus on a minimal treatment and refer the interested reader to a dedicated survey [11] for an overview. First, one picks a positive definite kernel function k : YT +1 × YT +1 → R. Such a kernel function uniquely determines an underlying Hilbert space of functions H defined on YT +1, called an RKHS. Then, one embeds a given probability distribution P ∈ 1 (YT +1) into this RKHS through its KME μP = EX∼P[k(*, X)]. M+ The MMD between two distributions P and Q is then the distance in the RKHS between their embeddings: MMD[P, Q] = (cid:107)μP − μQ(cid:107)H, (9) where (cid:107)*(cid:107)H is the norm in the RKHS H. In general, the MMD is only a semi-metric, since the embedding P (cid:55)→ μP may not be injective. Kernels for which it is injective are called characteristic [25]; they include the Gaussian kernel. From now on, we assume a characteristic kernel. Remark 1 (A Kernel on Trajectories): We emphasize that the considered kernel k is defined on the output trajectory space YT +1, and not on the state space X nor on the output space Y. For instance, the expression of a Gaussian kernel on YT +1 with scalar width σ > 0, which is known to be characteristic [11, Table 3.1], is (cid:34) k(γa, γb) = exp − 1 2σ2 T (cid:88) ny (cid:88) (γa,i,t − γb,i,t)2 (cid:35) , (10) t=0 i=1 where γa, γb ∈ R(T +1)×ny are output trajectories. 2) A Metric of Distinguishability: The value of the MMD thus indicates whether initial distributions are distinguishable. Proposition 1: Let μa, μb be two initial distributions. Assume that μb ] = 0 iff μa and the kernel k is characteristic. Then, MMD[PT μb are distributionally indistinguishable. μa , PT Proof: The MMD is a metric when characteristic [25], which implies that MMD2[PT iff PT μb . The result follows from Definition 2. μa = PT the μa , PT is kernel μb ] = 0 The information the MMD carries is richer than a simple yes-or- no indication. Indeed, it takes continuous values; low values reveal the value of the MMD extends similar distributions. Therefore, the binary notion of absolute distinguishability to a continuous spectrum of relative distinguishability on which some pairs of initial distributions are more (or less) distinguishable than others. We postpone further interpreting this value to Section III-B3 B. Finite-Sample Approximation III. MEASURING DISTRIBUTIONAL OBSERVABILITY Distributional observability is defined as the equality of certain probability distributions. We propose to extend this binary notion to a continuous spectrum of relative distinguishability by quantifying it with the MMD, a distance between said distributions measuring how easily they can be told apart. Additionally, the MMD can be estimated from data. This leads to our main methodological contribution: use output measurements to 1) approximate relative distinguishability; and 2) leverage a two-sample test [23] to assess distributional observability with high confidence from output measurements. To access both the relative and absolute notions, one needs to evaluate the MMD. We rely on a finite-sample approximation [23] for to conclude on (absolute) distinguishability, since the approximation is never exactly 0. Finally, this test helps refine the interpretation of the MMD value. this and use a two-sample test 1) Background – Finite-Sample MMD: While a closed-form formula is often unattainable or requires perfect system knowledge, the MMD can be approximated from independent samples of output trajectories by the following empirical estimator. Theorem 3 (Gretton et al. [23]): Let μa, μb be two initial distributions. Let Γa,1, . . . , Γa,m be independent copies of Γ(μa, T ), DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS 5 and Γb,1, . . . , Γb,n independent copies of Γ(μb, T ). Assume that k is bounded, i.e., 0 ≤ k ≤ K for some K ∈ R. Then, MMD2 b[m, n] = 1 m2 m (cid:88) k(Γa,i, Γa,j) + 1 n2 n (cid:88) i,j=1 k(Γb,i, Γb,j) i,j=1 − 2 mn m,n (cid:88) i,j=1 k(Γa,i, Γb,j), (11) converges in probability to MMD2[PT concentration bound for (cid:15) > 0: μa , PT μb ] with the following (cid:34) P (cid:12) (cid:12)MMDb[m, n] − MMD[PT (cid:12) (cid:20) ≤ 2 exp − (cid:15)2 2K * mn m + n μa , PT μb ] (cid:12) (cid:12) (cid:12) > 2 (cid:32)(cid:114) K m + (cid:114) K n (cid:33) (cid:35) + (cid:15) (cid:21) . (12) (11) The outcome of is a noisy, biased, and finite-sample approximation of the population value MMD[PT μb ]. We can rely on the value of to approximate relative the estimator distinguishability, however, we cannot use it directly to check absolute distinguishability. Instead, we use a statistical test. μa , PT 2) A Two-Sample Test of Distinguishability: To determine whether two initial distributions μa and μb are distinguishable from the value of (11), we perform a statistical test of the null hypothesis H0 : PT μa = PT μb vs. H1 : PT μa (cid:54)= PT μb . (13) Such a test for equality of distributions is called a two-sample test. We propose to use one based on the concentration bound (12) [23]. One specifies an acceptable Type I risk α ∈ (0, 1), and the test provides an acceptance region threshold; if the outcome of (11) falls outside of that region, one rejects the null hypothesis H0 with confidence level at least 1 − α. Proposition 2: Let α ∈ (0, 1). Under the setting of Theorem 3 with n = m, consider a realization of MMDb[m, m]. If this empirical estimate is such that MMDb[m, m] ≥ (cid:114) 2K m √ (cid:16) 1 + 2 ln α−1 (cid:17) ̇= κ, (14) then μa and μb are distributionally distinguishable in time T with confidence level 1 − α. Proof: This immediately follows from [23, Corollary 9]. The threshold κ is conservative for many practical applications. It is common to use bootstrapping instead, as suggested in [23] and implemented in their original code. We use this bootstrapped value for κ in Section IV. to Sample Bounds: 3) From Qualitative Properties In Section III-A2, we interpreted the MMD as a measure of distinguishability based on the argument takes values in a continuous set. The two-sample test of Proposition 2 allows us to refine this interpretation: the value of the MMD indicates how much data is required for the test to successfully reject the null hypothesis H0 with high confidence. In other words, the MMD provides a sample bound for the test to achieve a specific Type II error β ∈ (0, 1). that it Corollary 2: Let β ∈ (0, 1). Under the setting of Theorem 3 with n = m, assume that the null hypothesis is incorrect and let z = MMD[PT ν ] > 0. Assume that μ , PT m > K z2 (cid:18) 4 + √ 2 + 2 (cid:18)(cid:114) ln 1 β (cid:114) + ln 2 β (cid:19)(cid:19)2 . (15) Fig. 1: MMD over an xb-grid for from reference point xa = (1.5, 0.5) (white star). The empirical class of indistinguishability (red points) is computed using output data from the noisy system. It matches the analytical class of the nominal system. linear system (17) Proof: Introduce Am = {MMDb[m, m] < κ} the test's acceptance region of level β and Bm = {|MMDb[m, m] − z| ≤ δ} the high-probability region of the concentration bound (12), with (cid:15) = 2 (cid:114) K m ln 2 β (cid:114) , and δ = 2 K m (cid:18) (cid:114) 2 + ln (cid:19) . 2 β (16) If Am ∩ Bm = ∅, then H0 is rejected with probability at least 1 − β; indeed, we then have P[Am] ≤ P[B(cid:123) m] ≤ β. It is sufficient for Am ∩ Bm = ∅ that κ < z − δ. Rearranging yields (15). Albeit the threshold (15) depends on z and thus cannot be used in practice to guide data collection, it sheds light on the interpretation of the MMD by translating a qualitative property (it measures how different outputs from two initial distributions are) into practical considerations (how much data is required to tell them apart). Intuitively, initial distributions leading to a high MMD can be told apart with confidence given only a small number of output trajectories. IV. EXPERIMENTAL RESULTS The proposed tools enable a data-driven observability analysis of nonlinear stochastic systems. We first verify that adding noise preserves distributional observability for linear systems, as stated in Theorem 2. We then illustrate the real-valued quantification by computing it on the whole state space for a nonlinear Duffing oscillator, revealing a continuous increase as we get away from the class of indistinguishability. This also enables measuring the effects of both measurement and process noise on said classes, illustrating the results of Section II-C. Finally, we demonstrate on a Furuta pendulum how to test whether a sensor configuration distinguishes certain states, with implications on experiment design1. Remark 2: We have focused on discrete-time systems; yet, dynamical systems are often described in continuous-time and only the sensor measurements are discrete-time. This discrepancy is not problematic as the results of Section III still hold if the state is a continuous-time process. In the following, we use α = 0.05 and a standard Gaussian kernel (10). A common heuristic to select the width parameter σ is to pick the median pairwise distance between the data sets at hand [23]. is not directly applicable here, however: our interpretation of It 1Code to reproduce the results is available at https://github.com/ Then, the null hypothesis is rejected with probability at least 1 − β. Data-Science-in-Mechanical-Engineering/data-obs.git. −2−1012xb,1−2.0−1.5−1.0−0.50.00.51.01.52.0xb,2MMDb<κ10−210−1100 6 DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS Fig. 2: MMD over an xb-grid for the Duffing oscillator (18) for different values of xa (white stars). The trajectory without noise (orange) initialized in xa is known to be a subset of the class of indistinguishability. The states where the test did not trigger (red points) constitute the empirical class of indistinguishability. In (a), this class contains not only the trajectory starting from xa, but also its symmetric w.r.t. the origin. In (c), the empirical class of distinguishability differs due to the significant process noise (b1 = b2 = 0.5 rather than 0.05). In all cases, vectors generating the null space of the nominal system's empirical Gramian (white arrow) are tangent to its class of indistinguishability. the MMD as a measure of relative distinguishability (Section III-A) requires that σ be the same for all points to be compared. Indeed, if the comparing different values of MMD is only meaningful underlying embeddings are all in the same RKHS, that is, use the same kernel function and parameter values. Therefore, we suggest the following meta-heuristic. We start by computing the above heuristic for each pair of data sets of interest. Then, we set σ as the 10- quantile of all previous values. These low values correspond to distributions that are indistinguishable, or hardly distinguishable, so σ has the correct order of magnitude for the noise of the system. We run all experiments with the fixed value of σ given by this meta- heuristic, which yields σ = 5, 1500, and the values given in Table I, respectively for the following sections. This leads to satisfying results in all our use cases, however, it is but an arbitrary choice; one should ensure σ is set to a suitable order of magnitude or the problem might be ill-conditioned and all MMD values close to 0. A. Influence of Noise on Observability Theorem 2 states that two states are distributionally distinguishable for a linear stochastic system iff they are distinguishable for the corresponding deterministic system. This can be interpreted as follows: for linear systems, the presence of noise does not alter distinguishability between two states and, by extension, observability. We verify this numerically on the following linear system: We then build a grid of 50×50 points and simulate m = 30 output trajectories starting from each point xb in the grid. We compute the MMD between the data set from xa and the one for each xb. This yields a heatmap of relative distinguishability depicted in Figure 1. We observe that the MMD is minimal along the diagonal x + C ⊥, and increases as the query point gets farther. This shows that the farther from the diagonal a state is, the more distinguishable it is from xa. In fact, the test of Proposition 2 does not trigger along this diagonal (red dots), and triggers everywhere else, empirically identifying this set as the class of distributional indistinguishability of xa given the output data. This class indeed corresponds to the class of deterministic indistinguishability of xa for the unperturbed version of (17) (computed analytically), as predicted by Theorem 2. B. Analyzing Observability in the State Space The proposed approach can be used to determine empirically the class of (distributional) indistinguishability of any state for an arbitrary nonlinear system, and to observe the continuous increase in relative distinguishability as we get farther from that class. We illustrate this with an undamped, unforced Duffing oscillator, often used in nonlinear observer design [26, 27]: dX1 = X2dt + b1dW1,t, dX2 = (X1 − X 3 1 )dt + b2dW2,t, (18) dXt = AXtdt + A0 sin(ωt)dt + ΣdWt, Yt = CXt + (cid:15)t, (cid:18)−2 −1 −1 −2 A = (cid:19) , C = (cid:0)−1 1(cid:1) , (17) where dW1,t, dW2,t are independent Wiener processes. The nominal system is Hamiltonian and conserves the quantity h(x) = − 1 2 x2 1 + 1 2 x2 2 + 1 4 x4 1 (19) where dWt is a 2-dimensional independent Wiener process, A0 = (3, 3), ω = 2, Σ = 0.1I2, and (cid:15)t ∼ N (0, 0.01) is Gaussian measurement noise. The term A0 sin(ωt)dt + ΣdWt is a non- centered process perturbation. The nominal linear system (A, C) is not observable. More specifically, the direction C ⊥ = span{(1, 1)} cannot be observed, meaning that the set of states indistinguishable from x ∈ R2 is x + C ⊥. This set is called the class of indistinguishability of x. We show experimentally that the non- centered noise in (17) preserves this class of indistinguishability. We emphasize that the process noise has nonzero mean over the simulation time. We select a reference point xa = (1.5, 0.5) and simulate n = 30 output trajectories for 2 s starting from xa, with time steps of length ∆t = 0.01 s, yielding discrete trajectories of length T = 200. These trajectories constitute a data set of samples from PT xa . along trajectories. We consider the output map Yt = h(Xt) + (cid:15)t with (cid:15) centered Gaussian measurement noise of variance 0.5, and two noise configurations: b1 = b2 = 0.05 (low process noise), and b1 = b2 = 0.5 (high process noise). Given an arbitrary point xa, we aim to determine its class of indistinguishability from samples of the stochastic system. For this, we generate n = 50 output trajectories of 1 s initialized in xa, and m = 50 trajectories in each other point xb on a 100 × 100 grid, with ∆t = 0.001 s (T = 1000). We then compute the empirical MMD (11) between the resulting data sets. Fig. 2 shows the resulting MMD maps for two values of xa, and the two levels of process noise. For low process noise (a and b), the MMD increases as the discrepancy in h in the initial states does; the states get more easily distinguishable. Additionally, the empirical class of indistinguishability (red squares) recovers the nominal system's one, which indeed contains the deterministic trajectory starting from xa −2−1012xb,1−2.0−1.5−1.0−0.50.00.51.01.52.0xb,2(a)xa=(1,0.5)MMDb<κ−2−1012xb,1(b)xa=(0.2,0.8)−2−1012xb,1(c)xa=(0.2,0.8),morenoise10−410−3 DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS 7 θ1 θ2 (a) Furuta pendulum Fig. 3: Scheme of the Furuta pendulum (a), and behavior of the extended Kalman filter (EKF) over time (b and c): estimation error (median and quartiles) (top), and distribution of the estimated sin(θ1) (bottom). In the distinguishable case (b), the EKF converges and the distributions of the predictions differ during the transient. In the indistinguishable case (c), the estimation error remains high and the distributions similar; the output of the observer is statistically the same for both initial states. Distributions (bottom) are interpolated by kernel density estimation. (b) y = θ1 (c) y = θ2 (orange curve), where h is constant. For higher levels of process noise, the empirical class is deformed, illustrating that Corollary 1 does not generalize without further assumptions. This continuous effect of the level of process noise on the classes highlights the interest of a continuous-valued metric of relative distinguishability; states where test triggers may still be difficult to distinguish. Remark 3: For comparison, we also compute the nominal system's empirical observability Gramian at xa [15, Eq. 4]. If the null space N of this empirical Gramian is {0} in the limit (cid:15) → 0, then the system is weakly observable in xa [15, Thm. 2]. Based on [15, Eq. (14)], we thus interpret N as the "direction of weak unobservability" in xa. We approximate the assumption (cid:15) → 0 by taking (cid:15) = 0.1 and considering the eigenspace of the smaller eigenvalue. Fig. 2 shows the resulting approximation of N by plotting a generating vector. We find that null space is the tangent space to the class of indisinguishability our test finds. In other words, empirical Gramians provide the local directions of indistinguishability, while our test recovers the whole class. Recovering the information on local observability of xa could also be achieved with our test; e.g., by checking the test outcome in an xb-spherical shell centered in xa. Indeed, states very close to xa will never trigger it due to finite-sample approximations, and should thus be excluded. We leave this connection to local observability for future work. C. Analyzing Sensor Configurations on Hardware When studying an experimental system, one can sometimes choose between possible sensor configurations whose benefits can be ambiguous. The system may be observable and allow building an observer to achieve further downstream tasks in some of these configurations but not in others. We now demonstrate how the proposed tools can help compare these configurations from measurements. For this, we collect hardware data on a Furuta pendulum: the Qube Servo 2 by Quanser (Fig. 3a). The pendulum consists of two arms, the first of which is actuated, with respective angular positions (θ1, θ2) ∈ R2 (in radians), where θ1 = 0 is arbitrary and θ2 = 0 corresponds to the upright position. The state is then (θ1, θ2, ̇θ1, ̇θ2). We collect a set of output trajectories by initializing the system by hand close to xa = (0, 0, 0, 0) and xb = (π/4, 0, 0, 0), respectively. We measure both angles with encoders and corrupt these measurements with centered Gaussian noise of variance 0.001 rad2 independently on each dimension, in order to further complicate the experiment. The trajectories of 9.75 s are sampled with ∆t = 0.01 s. 1) Choosing a Sensor Configuration: We consider three possible settings: y = (θ1, θ2), y = θ1 and y = θ2. Our goal is to determine from the collected samples which of these configurations enable distinguishing the initial states, a necessary condition to provably reconstruct the whole state of the system. For this, we run the kernel two-sample test of Theorem 2 ten times in all three settings, and present the results in Table I. The test triggers every time when y = (θ1, θ2) or y = θ1, indicating that the initial distributions are distinguishable with these outputs with high confidence. In contrast, it never triggers when y = θ2; the data does not allow to distinguish between xa and xb when only measuring θ2. This generalizes to the nonlinear system the conclusion obtained by linearizing the dynamics; Kalman's observability criterion states that the model is not locally observable around the origin for y = θ2, while it is in the other configurations. Remark 4: The test evaluates the distinguishability of the initial distributions μa and μb whereas, in practice, one is usually concerned with the distinguishability of the initial states xa and xb; yet, μa and μb are not Diracs. This could lead to a false interpretation of the test result. For example, if xa = xb but μa (cid:54)= μb (e.g., one is much more spread than the other), the output distributions may differ: the test would then trigger, although xa and xb are indistinguishable. To interpret the test result as distinguishability induced by the dynamics and not as an artifact introduced by non-ideal initial distributions, the support of the latter should be as narrow as possible around xa and 0246810Time102101100Estimation ErrorDataset 112Dataset 2120.10.20.30.40.50.00.51.01.03.05.07.09.0Dataset 1Dataset 2Timesin(1)0246810Time103102101100Estimation Error0.10.20.30.41.51.00.50.00.51.01.51.03.05.07.09.0Timesin(1) 8 DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS Measurement y = (θ1, θ2) y = θ1 y = θ2 σ (rad) MMDb κ Trigger (% of trials) 1300 1.40 100 1300 2.50 100 2500 0.34 0 TABLE I: Results for the Furuta pendulum, averaged over ten tests. Only the first two configurations are identified as distinguishable. xb. This is theoretically sound due to the continuity of the MMD: if the support of μa and μb is sufficiently small then MMD[PT μb ] is close to MMD[PT μa , PT xa , PT xb ]. In practice, several methods can ensure a small spread, such as careful reinitializations of the system or discarding trajectories that are too far from the desired initial states. We initialize the system by hand, such that some randomness is always present, but stay in the same experimental conditions. To demonstrate robustness to this issue, we run our experiments multiple times by selecting only n = m = 40 trajectories randomly from each initial distribution. 2) Consequences for Observer Behavior: Beyond choosing sensor configurations, the information provided by our test can also help in understanding the behavior of observers that fail to converge. An observer initialized in two distributionally indistinguishable initial states takes as input the same output distributions. Therefore, the output of the observer itself has the same distribution; its estimates are the same on the whole class of indistinguishability. In other words, the observer fails to distinguish the states. We demonstrate this by implementing an EKF based on a model of the pendulum and taking y as input. We run the EKF on our data set in the two settings y = θ1 (distinguishable) and y = θ2 (indistinguishable). The observer converges in the first case, but not in the second one (Fig. 3, top row). More interestingly, we estimate the evolution of the distribution of sin(θ1) as estimated by the EKF (Fig. 3, bottom row). In the distinguishable case (Fig. 3b), the two output distributions of the EKF differ, whereas they appear to be the same in the indistinguishable case (Fig. 3c). This gives a precise meaning to the idea that an observer can estimate the class of indistinguishability of the initial state, which our test can determine. V. CONCLUSION AND OUTLOOK In this paper, we present a method to assess the observability of stochastic systems from data without explicitly relying on a dynamics model; this is the first such method to the best of our knowledge. We start by extending distributional distinguishability to arbitrary nonlinear stochastic systems and investigate its relationship to deterministic observability, showing that both notions are equivalent for certain classes of systems which includes linear systems. We then introduce the MMD and a finite-sample estimate thereof to quantify distinguishability of initial states from noisy output trajectories. We leverage the MMD for a statistical test of distinguishability, hereby interpreting its value as how much data is required to tell initial states apart with confidence. We illustrate the proposed tools and notions in simulation and on hardware. We reveal experimentally the relationship between noise and distinguishability, emphasizing the interest of a continuous metric, and showcase how such an approach could benefit observer design by allowing for a priori error analysis. The theoretical analysis of distributional observability that we propose can be further pushed, e.g., by characterizing other classes of measurement noise that satisfy Assumption 2, or by finding sufficient conditions on the dynamics such that classes of process noise preserve distinguishability. ACKNOWLEDGMENT We thank Sebastian Giedyk for his help with the experiments. REFERENCES [1] P. Bernard, V. Andrieu, and D. Astolfi, "Observer Design for Continuous-Time Dynamical Systems," Annual Reviews in Control, vol. 53, pp. 224–248, 2022. [2] J. Sjöberg, Q. Zhang, L. Ljung, A. Benveniste, B. Delyon, P. Y. Glorennec, H. Hjalmarsson, and A. Juditsky, "Nonlinear black- box modeling in system identification: a unified overview," Automatica, vol. 31, no. 12, pp. 1691–1724, 1995. [3] E. D. Sontag, Mathematical Control Theory, 2nd ed. Springer, 1998. [4] D. Simon, Optimal State Estimation: Kalman, H-infinity, and Nonlinear Approaches. John Wiley & Sons, 2006. [5] R. Li, Q. Zhang, J. Zhang, and T. Chu, "Distributional observability of probabilistic Boolean networks," Systems & Control Letters, vol. 156, 2021. [6] E. Fornasini and M. E. Valcher, and Reconstructibility of Probabilistic Boolean Networks," IEEE Control Systems Letters, vol. 4, pp. 319–324, 2020. "Observability [7] R. Zhou, Y. Guo, and W. Gui, "Set reachability and observability of probabilistic Boolean networks," Automatica, vol. 106, pp. 230–241, 2019. [8] I. Hwang, H. Balakrishnan, and C. Tomlin, "Observability criteria and estimator design for stochastic linear hybrid systems," in European Control Conference, 2003, pp. 3317– 3322. [9] W. Zhang and B.-S. Chen, "On stabilizability and exact observability of stochastic systems with their applications," Automatica, vol. 40, pp. 87–94, 2004. [10] H. Sun and M. Li, "Exact observability/exact detectability and spectrum assignment of stochastic systems," in World Congress on Intelligent Control and Automation, 2010, pp. 3786–3790. [11] K. Muandet, K. Fukumizu, B. Sriperumbudur, and B. Schölkopf, "Kernel Mean Embedding of Distributions: A Review and Beyond," Foundations and Trends in Machine Learning, vol. 10, pp. 1–141, 2017. [12] N. Powel and K. A. Morgansen, "Empirical Observability Gramian for Stochastic Observability of Nonlinear Systems," 2020, preprint. [13] Y. Sunahara, S. Aihara, and M. Shiraiwa, "The stochastic systems," observability International Journal of Control, vol. 22, pp. 461–480, 1975. non-linear stochastic noisy for [14] V. Dragan and T. Morozan, "Stochastic observability and applications," IMA Journal of Mathematical Control and Information, vol. 21, pp. 323–344, 2004. [15] N. D. Powel and K. A. Morgansen, "Empirical observability Gramian rank condition for weak observability of nonlinear systems with control," in Conference on Decision and Control, 2015, pp. 6342–6348. [16] C. Himpe, "emgr-The Empirical Gramian Framework," Algorithms, vol. 11, 2018. [17] C.-T. Chen, Linear System Theory and Design, 3rd ed. Oxford University Press, 1999. [18] A. R. Liu and R. R. Bitmead, "Stochastic observability in network state estimation and control," Automatica, vol. 47, pp. 65–78, 2011. [19] Y. Subasi and M. Demirekler, "Quantitative measure of observability for linear stochastic systems," Automatica, vol. 50, pp. 1669–1674, 2014. DATA-DRIVEN OBSERVABILITY ANALYSIS FOR NONLINEAR STOCHASTIC SYSTEMS 9 [20] L. Song, K. Fukumizu, and A. Gretton, "Kernel embeddings of conditional distributions: A unified kernel framework for nonparametric inference in graphical models," IEEE Signal Processing Magazine, vol. 30, no. 4, pp. 98–111, 2013. [21] K. Fukumizu, L. Song, and A. Gretton, "Kernel Bayes' rule: Bayesian inference with positive definite kernels," The Journal of Machine Learning Research, vol. 14, no. 1, pp. 3753–3783, 2013. [22] K. M. Borgwardt, A. Gretton, M. J. Rasch, H.-P. Kriegel, B. Schölkopf, and A. J. Smola, "Integrating structured biological data by kernel maximum mean discrepancy," Bioinformatics, vol. 22, no. 14, pp. 49–57, 2006. [23] A. Gretton, K. M. Borgwardt, M. J. Rasch, B. Schölkopf, and A. Smola, "A Kernel Two-Sample Test," Journal of Machine Learning Research, vol. 13, pp. 723–773, 2012. [24] F. Solowjow, D. Baumann, C. Fiedler, A. Jocham, T. Seel, and S. Trimpe, "A Kernel Two-sample Test for Dynamical Systems," 2022, preprint. [25] B. K. Sriperumbudur, K. Fukumizu, and G. R. G. Lanckriet, "Universality, Characteristic Kernels and RKHS Embedding of Measures," Journal of Machine Learning Research, vol. 12, pp. 2389--2410, 2011. [26] D. Astolfi, R. Postoyan, and D. Neši ́c, "Uniting Observers," IEEE Transactions on Automatic Control, vol. 65, no. 7, pp. 2867–2882, 2020. [27] M. Buisson-Fenet, L. Bahr, and F. Di Meglio, "Towards gain tuning for numerical KKL observers," 2022, preprint.
http://arxiv.org/abs/2302.11978v1
2023-02-23T12:50:02
2023-02-23T12:50:02
Does Deep Learning Learn to Abstract? A Systematic Probing Framework
Abstraction is a desirable capability for deep learning models, which means to induce abstract concepts from concrete instances and flexibly apply them beyond the learning context. At the same time, there is a lack of clear understanding about both the presence and further characteristics of this capability in deep learning models. In this paper, we introduce a systematic probing framework to explore the abstraction capability of deep learning models from a transferability perspective. A set of controlled experiments are conducted based on this framework, providing strong evidence that two probed pre-trained language models (PLMs), T5 and GPT2, have the abstraction capability. We also conduct in-depth analysis, thus shedding further light: (1) the whole training phase exhibits a "memorize-then-abstract" two-stage process; (2) the learned abstract concepts are gathered in a few middle-layer attention heads, rather than being evenly distributed throughout the model; (3) the probed abstraction capabilities exhibit robustness against concept mutations, and are more robust to low-level/source-side mutations than high-level/target-side ones; (4) generic pre-training is critical to the emergence of abstraction capability, and PLMs exhibit better abstraction with larger model sizes and data scales.
[ "Shengnan An", "Zeqi Lin", "Bei Chen", "Qiang Fu", "Nanning Zheng", "Jian-Guang Lou" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11978v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11978v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.CL" ]
3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 8 7 9 1 1 . 2 0 3 2 : v i X r a Published as a conference paper at ICLR 2023 DOES DEEP LEARNING LEARN TO ABSTRACT? A SYSTEMATIC PROBING FRAMEWORK Shengnan An∗†, Zeqi Lin‡, Bei Chen‡, Qiang Fu‡, Nanning Zheng†, Jian-Guang LOU‡ † Institute of Artificial Intelligence and Robotics, Xi'an Jiaotong University ‡ Microsoft Corporation {an1006634493@stu, nnzheng@mail}.xjtu.edu.cn {Zeqi.Lin, beichen, qifu, jlou}@microsoft.com ABSTRACT Abstraction is a desirable capability for deep learning models, which means to induce abstract concepts from concrete instances and flexibly apply them beyond the learning context. At the same time, there is a lack of clear understanding about both the presence and further characteristics of this capability in deep learning models. In this paper, we introduce a systematic probing framework to explore the abstraction capability of deep learning models from a transferability perspective. A set of controlled experiments are conducted based on this framework, providing strong evidence that two probed pre-trained language models (PLMs), T5 and GPT2, have the abstraction capability. We also conduct in-depth analysis, thus shedding further light: (1) the whole training phase exhibits a "memorize-then- abstract" two-stage process; (2) the learned abstract concepts are gathered in a few middle-layer attention heads, rather than evenly distributed throughout the model; (3) the probed abstraction capabilities exhibit robustness against concept mutations, and are more robust to low-level/source-side mutations than high-level/target-side ones; (4) generic pre-training is critical to the emergence of abstraction capability, and PLMs exhibit better abstraction with larger model sizes and data scales. 1 INTRODUCTION Whereas concrete concepts are typically concerned only with things in the world, abstract concepts are about internal events. - Barsalou et al. (1999) Abstraction means capturing the general patterns (often referred to as abstract concepts) efficiently in a specific learning context and reusing these patterns flexibly beyond the context (Mitchell, 2021; Kumar et al., 2022; Giunchiglia & Walsh, 1992; Hull, 1920). For instance, the abstraction on language means recognizing the underlying syntax and semantics behind concrete sentences. It is thought to be one of the fundamental faculties in human cognition for effectively learning, understanding and robustly generalizing, and has been studied for a long time in cognitive psychology and behavioral sciences (Gentner & Medina, 1998; Barsalou et al., 1999; Shivhare & Kumar, 2016; Konidaris, 2019). The abstraction capability is also critical for deep learning, but many previous studies suggested that the surprising success of deep learning may come from the memorization of some surface patterns (also called superficial correlations or shortcuts) (Geirhos et al., 2020; Du et al., 2022), such as some special tokens (Niven & Kao, 2020; Gururangan et al., 2018), overlapping contexts (Lai et al., 2021; Sen & Saffari, 2020), and familiar vocabularies (Aji et al., 2020). It is still unclear whether the models just memorize these patterns without abstractions, or they do learn abstract concepts (yet overwhelmed by surface patterns when applied in a similar context as in training). Therefore, this paper aims to take a step forward to probe the abstraction capability of deep learning models, keeping the effects of abstract concepts and surface patterns decoupled and controlled individually. Our key idea is to probe the abstraction capability from a transferability perspective, since surface patterns are always bounded with task-specific characteristics while abstract concepts can be more ∗Work done during an internship at Microsoft Research. 1 Published as a conference paper at ICLR 2023 Figure 1: Motivating example: the abstract concepts learned in task A can be effectively reused in task B, but surface patterns are useless. Unused patterns or concepts are whitened after the update. generally reused. We consider designing multiple tasks with shared abstract concepts and totally different surface patterns, then tracing whether the learning on one task can boost the performance on another. Figure 1 demonstrates a motivating example. Motivating Example As shown in Figure 1, suppose we want to examine whether a model can learn the abstract rule (i.e., the symbolic mapping rule x1x2 → X1X2, in which xi and Xi are general variable slots) from the task A, or just memorize surface maps (e.g., ab → AB, in which a and A are task-specific symbols). To reveal the different transferability of two learning mechanisms, we utilize a probing task B that contains the same underlying abstract rule as task A but does not overlap with its symbol set. If the model could learn the abstract rule from task A, it would reuse it to interpret new context, thus effectively solving task B. But if not, memorizing some surface maps that are bounded with task-specific symbols is less effective to solve task B. Motivated by this example, we design a systematic framework for probing abstraction capability. This framework considers a set of probing tasks along with three procedures of experiments based on the transfer learning paradigm. The use of abstract concepts and task-specific characteristics in probing tasks are separately controlled. To probe the abstraction capability of language models, this work mainly considers grammar as the abstract concept1. The grammar of a formal language is a set of hidden rules behind concrete sentences and determines how terminals are combined into sentences that are valid to the syntax. We want to explore whether the model can be aware of the grammar, or simply memorize some specific word combinations. We instantiate our framework as a grammar probe that is constructed from the designed formal grammar and terminal sets. The probing results show strong evidence that two probed PLMs (specifically, T5-Base (Raffel et al., 2020) and GPT2-Medium (Radford et al., 2019)) have the abstraction capability to learn abstract concepts from concrete instances, rather than just simply memorizing surface patterns. After probing the existence of abstraction capability, we further explore the following questions. RQ1: What is the characteristic of the training dynamics on learning abstract concepts? RQ2: How are these learned abstract concepts distributed in the model? Concentrated in a few modules or evenly distributed in whole model? RQ3: How robust is the abstraction capability on tasks with mutated abstract concepts? RQ4: How would generic pre-training and general factors influence abstraction? Here we outline some interesting findings from our in-depth investigations: (1) the training phase exhibits a "memorize-then-abstract" two-stage process; (2) the abstract concepts learned in our probes are gathered in a few middle-layer heads; (3) abstraction capability is more robust to source-side/low- level mutations than to target-side/high-level ones; (4) generic pre-training is critical to the emergence of abstraction capability, and larger model size and data scale are beneficial. Contributions 1) We propose a systematic probing framework for abstraction capability, guiding the design of controlled tasks and procedures from a transferability perspective. 2) We instan- tiate this framework with concrete tasks and show strong evidence that two probed PLMs have the abstraction capability. 3) We further analyze this capability and provide insightful conclu- sions by investigating the above research questions. Our code and data are publicly available at https://github.com/microsoft/ContextualSP/tree/master/abstraction_probing. 1We also probed other abstract concepts such as operation semantics in Appendix D. 2 ab→ABac→ACba→BAbc→BCca→CAcb→CBTask AInputOutputabABacAC......Surface Patternsw/o Abstractionwith AbstractionNewContextUpdateTask BWellGeneralize×Abstract ConceptsInputOutputx1x2X1X2aA......InputOutputabABacAC......Surface PatternsInputOutputx1x2X1X2aA......Abstract Concepts Published as a conference paper at ICLR 2023 2 RELATED WORK Probing deep learning models. To explore whether deep learning models have certain capabilities, there has been much work examining these black-box models in some specially designed settings, called probes (Petroni et al., 2019; Tenney et al., 2018; Warstadt et al., 2019; Lin et al., 2019; Hewitt & Manning, 2019; Vuli ́c et al., 2020). The key challenge in designing probes is to exclude superficial correlations. That is, the performance of the model in the probing setting should be highly correlated with the capability to be probed rather than other influencing factors. For instance, to probe whether the model encodes some knowledge/information in the representation rather than just over-fit the data, a standard approach is to freeze the model parameters (Petroni et al., 2019; Tenney et al., 2018); to probe whether the model have compositionality rather than just memorize the label distribution, previous work injected statistical bias into the data splits (Lake & Baroni, 2018; Keysers et al., 2019; Kim & Linzen, 2020). In this work, to explore whether models have abstraction capability rather than just memorize surface patterns, we leverage the transferability of abstract concepts, which has been considered as one essential aspect of abstraction (Mitchell, 2021; Kumar et al., 2022) and explored from a cognitive science perspective on neural networks (Dienes et al., 1999; Geiger et al., 2022). Abstraction capability. Abstraction has been studied for a long term in cognitive psychology and behavioral sciences (Hull, 1920; Gentner & Medina, 1998; Barsalou et al., 1999; Burgoon et al., 2013; Wang, 2015; Shivhare & Kumar, 2016; Lake et al., 2017; Daniel, 2017; Konidaris, 2019) and has attracted attention in the artificial intelligence field (Giunchiglia & Walsh, 1992; Richardson et al., 2020; Clark et al., 2020; Talmor et al., 2020; Mitchell, 2021; Zadrozny, 2021; Millhouse et al., 2021; Kumar et al., 2022). The abstraction capability of DNN models has been explored in many tasks such as visual reasoning (Johnson et al., 2017; Barrett et al., 2018; Chollet, 2019; Kumar et al., 2022), grounded language understanding (Ruis et al., 2020), and game playing (Tsividis et al., 2021). As our work focuses on language models, another closely related topic is compositional generalization (Lake & Baroni, 2018; Keysers et al., 2019; Kim & Linzen, 2020), which explored whether neural models could learn high-level grammars from specially designed training examples and apply the learned grammars through compositions. These works concluded that general-propose neural models (such as LSTM and Transformer) could not learn the full grammar with biased observations and demonstrated the importance of symbolic mechanisms for abstraction (Liu et al., 2020; Chen et al., 2020; Liu et al., 2021a). Some other previous work also explored the abstraction of language models in their specially designed tasks (Chollet, 2019; Mitchell, 2021; Zadrozny, 2021). Most previous explorations of DNN abstraction capabilities did not consider to explicitly avoid and check the influence from task-specific characteristics, thus leaving potential risks that the model may perform well in terms of surface patterns over-fitted to task-specific designs (e.g., patterns in candidate answers (Zhang et al., 2019)) rather than abstract concepts. Some implicit strategies have been leveraged to alleviate such potential influence through indirect ways: some previous work considered using biased task-specific designs in training and test data separately (Kim & Linzen, 2020; Barrett et al., 2018); some have attempted to fix the observed problems in existing probes on an ad hoc basis (Hu et al., 2021; Benny et al., 2021); some considered to inject great task diversity, which implicitly increases difficulty of learning practical shortcut (Chollet, 2019). In this work, rather than implicitly alleviating this potential risks, we consider to explicitly check whether there is performance leakage from surface patterns by leveraging the transferability of abstraction capability and comparing performance among a set of controlled experiments. 3 PROBING FRAMEWORK As mentioned in Section 1, abstraction is the capability to induce abstract concepts from concrete instances in a certain learning context and flexibly generalize these concepts beyond the context. A key difference between a surface pattern and an abstract concept is their different cross-task transferability, as the former is always bounded with some task-specific characteristics (e.g., a certain vocabulary) while the latter is transferable across tasks. We define this property as following. Property: Transferability of Abstract Concepts. Consider two machine learning tasks A and B that do not share any common instances between their task-specific characteristics spaces, but have essentially the same set of abstract concepts behind them, the transferability of abstract concepts means that learning A can help better learn B. 3 Published as a conference paper at ICLR 2023 Figure 2: The illustration of the probing framework. Notations: We denote two learning paradigms: A ⇒ B as a procedure that the model is first trained on A and then fine-tuned on B, and ⇑ B as a procedure of directly training on B without the pre-training on A. The transferability can be evaluated with the performance gain from procedure A ⇒ B compared to ⇑ B, denoted as ∆(A ⇒ B). Based on this property, we can verify the learning of abstract concepts by checking whether the transferability is exhibited (i.e., assessing ∆(A ⇒ B)). In the following, we design a framework for probing the learning of abstract concepts in a systematic manner and illustrate it in Figure 2. Aiming • This framework examines whether a probed model could learn abstract concepts CA from the aiming task A with a train set A. Task Design • Probing task B with the transfer set ˆB and test set B contains the abstract concepts CB that is required to be the same as CA. The task-specific characteristics used to construct ˆB ∪ B do not overlap with that of A. In addition, the examples in ˆB are restricted to contain insufficient information for the probed model to learn CB perfectly. Thus, the gain from the abstraction in task A would be noticeable. • Contrast task C with the contrast set C aims to further confirm that the performance in task B is principally correlated with abstractions rather than other factors. The abstract concepts CC is constructed by greatly breaking (changing) CA, thus compared with task A, the abstraction on task C is less effective for solving task B. The task-specific characteristics and other latent factors in constructing C are kept the same with that in A. Procedures of Experiments (abbreviated as Exp) • Control Exp ⇑ B: only train the model on ˆB and test on B. • Main Exp A ⇒ B: train the model on A, then fine-tune on ˆB, finally test on B. • Contrast Exp C ⇒ B: train the model on C, then fine-tune on ˆB, finally test on B. Hypothesis and Expectations • Hypothesis: the probed model can learn abstract concepts CA from A. • Expectation 1: ∆(A ⇒ B) is significantly high, i.e., A ⇒ B brings considerable gain compared with ⇑ B. • Expectation 2: ∆(C ⇒ B) is significantly lower than ∆(A ⇒ B) (or close to zero), i.e., Expectation 1 is highly correlated with the learning of abstract concepts rather than other factors. 4 PROBING ABSTRACTION CAPABILITY OF LANGUAGE MODELS The abstract concepts mainly considered in this work is grammar, a set of syntactic rules hidden behind concrete sentences that determine how terminals are combined into sentences that are valid to 4 Aiming Task ATrain SetഥAProbing Task BTest SetഥBTransfer SetAbstract ConceptsSameTask-Specific CharacteristicsDifferentContrast Task CContrast SetഥCAbstract ConceptsBrokenMain ExpA⟹BPretrainFinetuneTestഥAControlExp⇑BഥBContrast ExpC⟹BഥCTask DesignProcedures of ExperimentsExpectationsGood Performance ☺Bad Performance Bad Performance ෡B෡B෡B෡BഥBഥBOther FactorsRetained Published as a conference paper at ICLR 2023 Table 1: Part of Gs and Gt. Rules in the last row are allowed to iterate up to 12 times. Target-Side Grammar Gt Source-Side Grammar Gs PREDICATE (cid:16) SP verb (cid:16) Sv AGENT / THEME / RECIPIENT (cid:16) SE sub / direct-obj / indirect-obj (cid:16) Sn CONCAT (cid:16) SC conj (cid:16) Sc sentence (cid:16) subj verb CLAUSE (cid:16) PREDICATE ( AGENT ) sentence (cid:16) subj verb direct-obj indirect-obj CLAUSE (cid:16) PREDICATE ( AGENT, THEME, RECIPIENT ) N-Production Rule sentence (cid:16) sentence conj sentence CLAUSE (cid:16) CLAUSE CONCAT CLAUSE T-Production Rule Type the syntax. To design a grammar probe, we instantiate the framework with formal language translation (FLT) tasks. We assume that the generative grammar of the source and target languages contain the abstract concepts of FLT tasks, and that the surface patterns (e.g., familiar bigrams) are bounded with task-specific terminal sets. We give a more specific definition of abstraction based on FLT tasks: Definition: Considering an FLT task T : Ls → Lt that translate the source language Ls (with grammar Gs and terminals Ss) to the target language Lt (with grammar Gt and terminals St), and a set of concrete pairs T = {(li t are sentences from Ls and Lt respectively, the abstraction capability is learning the map from Gs to Gt during training on T rather than just simply memorizing terminal-specific patterns that are bounded with Ss and St. t)}k in which li s and li s → li Our FLT tasks are majorly derived from the synthetic semantic parsing task COGS (Kim & Linzen, 2020) and the Probabilistic Context-Free Grammar (PCFG) it used. We directly take the source grammar Gs in COGS which mimics the English natural language grammar, and reconstruct the target grammar Gt in COGS to be chain-structured (detailed in Appendix K.1). The map from Gs to Gt is a homomorphism (partly shown in Table 1). Terminals can be divided into three groups: the verbs Sv in Gs (aand the PREDICATEs SP in Gt), the nouns Sn (the ENTITYs SE) and the conjunctions Sc (the CONCATs SC). The production rules can be categorized as T-Production rules (only containing terminals at the right side) and N-Production rules. s and G+ We assign to the tasks A and B the same set of production rules while different terminals. It means that task A and B share the same abstract concepts while having no overlap between the task-specific characteristic spaces. For constructing task C, we completely change the production rules for A while preserving the terminal sets, thus task A and C do not share abstract concepts while could have similar task-specific characteristics. We describe the instantiation of different sets in detail as follows. Examples in these sets are contained in Appendix F.1. Train set A. To generate examples in A, we derive G+ t by only one-to-one replacing the terminals in Gs and Gt with new ones2. New terminals are sampled from the Wordlist Corpora in NLTK (Bird et al., 2009). Additionally, as the original Sc (also SC) only contains a single terminal, we add 31 additional terminals into the new Sc (and SC) to increase the diversity. The terminal diversity will be further discussed in Section G.1. Transfer set ˆB and Test set B. We take the train set in COGS as ˆB, and take the sentential complement (Com.) set and subject modification (Mod.) set as B for two sub-probes. The ˆB only contains examples with up to 2 recursions and object modifications, while the B contains up to 12 recursions and subject modifications. It has been proved that training on ˆB is not enough for a DNN model to learn the full grammars of COGS for handling the test cases in B (Kim & Linzen, 2020). Contrast set C. Compared with A, C is generated with the same source grammar G+ grammar is totally changed as G− t : for each rule of G+ for the generative grammar, all other factors are kept the same with A during generating C. s , but the target t , its right-side word order is reversed3. Except 5 EXPERIMENTAL SETUP AND MAIN RESULTS We probe two pre-trained language models: T5-Base and GPT2-Medium. Our experiments are based on the Huggingface Transformer models (Wolf et al., 2020). For both (continue) pre-training and fine-tuning, we take Adam (Loshchilov & Hutter, 2018) with 1e-5 learning rate and 0.01 weight 2Some non-semantic terminals are kept the same, such as the period in Lsrc and parentheses in Ltgt. 3Some basic rules are preserved (e.g., the order of the preceding and following parentheses). 5 Published as a conference paper at ICLR 2023 Table 2: The main results of our probe. ∆(A ⇒ B) and ∆(C ⇒ B) are in brackets. The evaluation metric is exact match accuracy (%). Com. and Mod. represent the sentential complement and subject modification sets for B. These results are in line with our two expectations. Model Sub-Probe Control Exp ⇑ B Main Exp A ⇒ B Contrast Exp C ⇒ B Model Sub-Probe Control Exp ⇑ B Main Exp A ⇒ B Contrast Exp C ⇒ B T5 Avg. Com. Mod. 18.7 23.1 14.3 71.9 (+53.2) 16.0 (-2.7) 88.2 55.6 15.4 16.5 GPT2 Avg. Com. Mod. 8.0 1.9 14.1 47.9 (+39.8) 8.1 (+0.1) 48.2 47.6 2.6 13.6 decay. Batch size is 8 and max training step is 100k. We generate 3 groups of new terminals, repeat the experiments on each group with 2 random seeds, and finally average 6 results. The early-stopping strategy is applied to avoid catastrophic forgetting. Detailed settings are listed in Appendix K. Table 2 shows the main results of our probe. For both two sub-probes, the performances of two probed models are in line with two Expectations set in Section 3. First, the results of ⇑ B are very low, and A ⇒ B can bring significant improvement, which is in line with Expectation 1. Second, the results of C ⇒ B are much lower than A ⇒ B (and are even just comparable with ⇑ B), which is in line with Expectation 2. As two expectations are experimentally examined, we can draw a preliminary conclusion: our probing results provide strong evidence that two probed PLMs have the abstraction capability to learn abstract concepts from concrete instances rather than just memorize surface patterns, and to transfer the learned abstract concepts beyond specific tasks. 6 ANALYSIS Based on our designed probe and results above, we further analyze the abstraction capability of PLMs to answer the RQs mentioned in Section 1. All experiments below are derived from Com. sub-probe, and are mainly conducted with T5-Base model except that are explicitly mentioned. 6.1 LEARNING PROCESS OF ABSTRACT CONCEPTS To investigate the learning process of abstract concepts, we save checkpoints for every 1,000 steps during training on A. Each checkpoint is further fine-tuned on ˆB and tested on B. For comparison, we also investigate the process of memorizing surface patterns by directly examining each checkpoint on the held-out dev set in task A. Figure 3 shows the performance curves of two learning processes. The training phase exhibits a "memorize-then-abstract" two-stage process. As shown in Fig- ure 3, there is an obvious phase difference (48k training steps) between two time points that two learning processes achieve their 90% relative performance, respectively. Such a phase difference means that when the model has already performed well on task A in an early training phase, the learning of desired abstract concepts is still on-going. In other words, the in-task performance in an early training phase comes mainly from the effects of some task-specific surface patterns rather than general abstract concepts. With extending the training phase, the abstract concepts can be further extracted/enhanced. This phase difference also suggests that the pre-training process should be continued even if the model has already achieved a good in-pre-training performance. The learning of abstract concepts is accelerated after in-task examples are well learned. After the model reaches 90% in-task relative performance (i.e. right side of the red dashed line), the learning curve of abstract concepts (i.e., the blue curve) rises more rapidly. The learning of abstract concepts is not stable in the early training phase. The curve of in-task performance is much smoother than the cross-task one. This suggests that the learning and transfer of abstract concepts is not stable. Nevertheless, the large fluctuations occur mainly in the early phases of training. With increasing training steps, this instability gradually decreases. 6.2 ABSTRACT ATTENTION HEADS To investigate how the learned abstract concepts are distributed in the model, we first conduct prelim- inary experiments by separately freezing parameters in each layer and sub-layer during fine-tuning, and find that the parameters in attention sub-layers play important roles (detailed in Appendix E). To 6 Published as a conference paper at ICLR 2023 Figure 3: Two learning process. Blue curves represent the learning performance of abstract concepts and red curves represent the learning performance of in-task examples. Figure 4: DPC of each pruned head. The heads sorted from left to right are located from the first to the last layer in the model. further determine the contribution of each attention head, we consider measuring the performance degradation after excluding the effect of each head. Specifically, we evaluate the change in perplexity (PPL) of examples in B after pruning the normalized wight of each head as follows, ∆θ,B(h) = 1 |B| (cid:88) [PPL(li t|li s; θ−h) − PPL(li t|li s; θ)], i (1) s, li in which h represents a certain head, θ is the full set of parameters in PLM after fine-tuning on ˆB, θ−h means pruning the h head, and (li t) is the input-output pair in B. Note that a higher PPL means a lower performance. Considering that some heads may store the task-specific knowledge learned from fine-tuned data ˆB, pruning these heads may also lead to performance changes. Therefore, we also evaluate a baseline PPL change ∆θ, ˆB(h) on fine-tuned examples in ˆB and measure the difference in PPL changes (DPC)= ∆θ,B − ∆θ, ˆB. The DPC of each head is shown in Figure 4. Abstract concepts are largely contained in a few heads, not evenly distributed in all heads. Note that there are totally 432 attention heads in T5-Base. Figure 4 shows that among hundreds of heads, only a dozen of them are highly correlated with storing abstract concepts in our probe. These abstract attention heads are gathered in middle layers in T5. A larger index in Figure 4 means that the corresponding head is more away from the input side and closer to the output side. It shows that the abstract attention heads (i.e., heads with high DPC) are mainly located in the middle layers of T5-Base model, i.e., the last encoder layers and first decoder layers. We further explore whether abstract concepts are modularized in the model. A module is a part of parameters that can individually perform a specific target functionality (Csordás et al., 2020). To investigate modularity, we take the method of freezing certain parameters during fine-tuning to examine whether the update of these parameters can be independent. We consider the top 36 heads with the highest DPC (which contain some redundant heads) as abstract heads. For comparison, we separately experiment with freezing 36 random heads. Table 3 shows that freezing abstract heads takes effect while freezing random heads does not. We further explore the modularity in Appendix E. Table 3: Freeze abstract heads. Table 4: PLMs performance with fuzzy abstract concepts. Method A ⇒ B Baseline +Freeze Abstract Heads +Freeze Random Heads 92.8 96.6 (+3.8) 92.9 Probe Model Control Exp ⇑ B Main Exp A ⇒ B Contrast Exp C ⇒ B Fuzzy Grammar T5 GPT2 24.0 16.4 35.1 (+11.1) 26.2 (+2.2) 21.0 (+4.6) 11.6 (-4.8) 7 0.0550.0600501001502002503000.0000.0050.0100.0150.0200.025Head Index (Input Side ---> Output Side)Difference in PPL ChangesEncoder Self-Attention HeadsDecoder Self-Attention HeadsDecoder Cross-Attention Heads Published as a conference paper at ICLR 2023 (a) Source-Side Mutations (b) Target-Side Mutations Figure 5: Performance with different derivations of (a) source and (b) target grammar. 6.3 ROBUSTNESS OF ABSTRACTION CAPABILITY t by injecting mutations into the original G+ t We explore the robustness of the probed abstraction capability when the abstract concepts in our designed probes are mutated. Different from the contrast task C in which the target grammar is totally changed, here we consider partially injecting mutations into source/target-side grammar. According to the formal grammar in Table 1, we consider injecting mutations at different abstract levels: changing T-Production rules can be regarded as a low-level mutation, since only terminals will be influenced and the whole sentence structure is kept; changing non-iterative N-Production rules can be regarded as a mid-level mutation, since the local structure will be mutated but the whole recursive structure is preserved; changing iterative N-Production rules can be regarded as a high-level mutation, since the whole recursive structure will be reconstructed. Based on the grammar used in formal language task A, we design three derivations G∗ in different levels. Examples of different derivations are contained in Appendix F.4. Coarse G∗ t (low-level mutation): We omit the non-terminals AGENT, THEME, RECIPIENT, and their corresponding terminals. In other words, the second T-Production rule in Table 1 is removed. Compared with G+ Local Reverse (LocalR) G∗ t (mid-level mutation): The local word order in a sentence is reversed. Specifically, we reverse the right-side word orders of the N-Production rules, except for the rule in the last row of Table 1 which is an iterative one. It means that the order of CLAUSEs (determined by the last rule) remains the same, while the terminals in each CLAUSE are locally reversed. Nested G∗ t (high-level mutation): It is obtained by changing the iterative rule (i.e, the last rule in Table 1) from the chain-structure to be nested. The new N-Production rule is "CLAUSE (cid:16) PREDICATE ( AGENT, CONCAT CLAUSE )". We can also construct G∗ s with the same technique except for the coarse one, as the source language must contain enough information to generate targets. Thus, we design a Redundant G∗ s which contains redundant terminals that are not mapped into targets (detailed in Appendix F.3). We separately change the source and target grammars to derivations and show results in Figure 5. t does not contain detailed arguments of PREDICATE. t (also Gt), Coarse G∗ s from G+ PLMs can exhibit robustness against mutations in abstract concepts. Results of these deriva- tions with mutations are higher than the Control Exp (and Contrast Exp), indicating that even though the learned abstract concepts are only partially matched with that in downstream tasks, the abstraction capability of PLMs can still leverage the similar parts in two sets of mutated abstract concepts. Abstraction capability is more robust to low-level mutations. Among three kinds of derivations, the low-level mutated ones (Coarse G∗ s) perform best, while the high-level mutated ones (Nested G∗ t and G∗ s) perform worst. This trend implies that the robustness of the abstraction capability decreases as the mutation level of abstract concept rises. This also suggests that matching of high-level abstract concepts should be prioritized when selecting pre-training tasks. t and Redundant G∗ Abstraction capability is more robust to source-side mutations. Comparing the results in Fig- ure 5a and 5b, source-side mutations bring less affects to downstream performance than target-side ones, indicating that PLMs can more robustly reuse source-side abstract concepts. s is nearly the same with that of the original G+ Redundant information barely affects abstraction. Surprisingly, the performance of Redundant G∗ s , which means that injecting redundant information into inputs would hardly affect the learning of abstract concepts. It indicates that the abstract capability of PLM can naturally exclude the influence of irrelevant information. 8 020406080100Accuracy (%)NestLocalRRedundantOriginalControlled Exp020406080100Accuracy (%)NestLocalRCoarseOriginalControlled Exp Published as a conference paper at ICLR 2023 (a) Model Sizes of T5 (b) Model Sizes of GPT2 (c) Data Scale Figure 6: Performance with different model sizes, data scales and data diversity. Table 5: Probing results for randomly initialized models. ∆(A ⇒ B) and ∆(C ⇒ B) are in brackets. Model Sub-Probe Control Exp ⇑ B Main Exp Contrast Exp A ⇒ B C ⇒ B Model Sub-Probe Control Exp ⇑ B Main Exp Contrast Exp A ⇒ B C ⇒ B T5 Avg. Com. Mod. 4.7 0.1 9.3 6.7 (+2.0) 5.8 (+1.1) 1.0 12.3 0.1 11.6 GPT2 Avg. Com. Mod. 5.1 0.1 10.1 6.8 (+1.7) 4.7 (-0.4) 1.5 12.0 0.4 9.0 Fuzzy abstract concepts can also be learned and transferred. Compared with the formal gram- mar discussed above, which can be concretely defined, fuzzy grammar is more free (such as natural language grammar). To explore how would abstraction capability perform on fuzzy grammar, we take natural language sentences for experiments and design different sets by mimicking the Com. sub-probe. Detailed designs are described in Appendix H. We report BLEU score in Table 4. It shows that the performance of PLMs on learning fuzzy grammar is also in line with our two expectations. 6.4 GENERAL FACTORS & GENERIC PRE-TRAINING As explored in previous work, there are some general factors that influence the performance of DNN models (Bommasani et al., 2021; Wei et al., 2022; Henighan et al., 2020), such as model size and data scale. We investigate how these general factors and the generic pre-training influence the learning of abstract concepts. More results and analysis can be found in Appendix G.1. PLMs exhibit better abstraction with larger model sizes. Figure 6a and 6b show that for both T5 and GPT2 architectures, larger pre-trained language models have better abstraction capability than the smaller ones, as we can observe that the gains from the Control Exp to the Main Exp become greater with the model sizes increasing. Larger data scale in pre-training helps better exhibit abstraction. Figure 6c shows T5-Base performance with different scales of the train set A. It shows that performance increases rapidly from ∼300 to ∼3.4K (with ∼50% absolute accuracy improvement) and improves marginally (and unstably) from ∼3.4K to ∼680K (with ∼5% absolute accuracy improvement). Overall, the performance trend is going up with data scale increasing, indicating that the larger data scales benefit abstraction. Generic pre-training is critical for the emergence of abstraction. We probe the abstraction capability of randomly initialized T5-Base and GPT2-Medium (i.e., without loading pre-trained checkpoints) and report the results in Table 5. The poor performance on A ⇒ B reveals that without generic pre-training, these deep learning models can hardly extract transferable abstract concepts from task A, even though they can still achieve >98% dev set performance on task A by fitting some task-specific suffer patterns. The comparison of the results in Table 2 and Table 5 demonstrate that the broader background pre-training is critical for the emergence of abstraction capability. 7 CONCLUSIONS In this paper, we introduce a systematic probing framework from a transferability perspective to guide the design of probes for abstraction capability. We instantiate this framework as a grammar probe and show strong evidence that two probed PLMs have the abstraction capability. We further analyze this probed capability by investigating several in-depth questions and provide insightful conclusions. 9 60M220M770M20406080Accuracy (%)Main Exp (AB)Control Exp (B)117M345M762M020406080Accuracy (%)Main Exp (AB)Control Exp (B)103104105Number of Instances30507090Accuracy (%)T5-Base Published as a conference paper at ICLR 2023 ETHICS STATEMENT A sufficiently robust abstraction capability that can perfectly extract abstract concepts and exclude concrete information in any situation will help deep learning models avoid many potential risks of ethical issues such as social bias and privacy breaches. However, as investigated in this work, the abstraction capability of some commonly used deep learning models may be fragile and can be affected by their training situation. This suggests that the abstraction capabilities of these models are still not reliable enough to naturally avoid these potential ethical issues, and calls for future work to explore ways to strengthen the robustness of the abstraction capabilities of deep learning models. ACKNOWLEDGMENTS We thank all the anonymous reviewers for their valuable comments. This work was supported in part by NSFC under grant No. 62088102. We would like to thank Qian Liu for his valuable suggestions and feedback on this work. REFERENCES Alham Fikri Aji, Nikolay Bogoychev, Kenneth Heafield, and Rico Sennrich. In neural machine translation, what does transfer learning transfer? Association for Computational Linguistics, 2020. Mikel Artetxe, Sebastian Ruder, and Dani Yogatama. On the cross-lingual transferability of In Proceedings of the 58th Annual Meeting of the Association monolingual representations. for Computational Linguistics, pp. 4623–4637, 2020. David Barrett, Felix Hill, Adam Santoro, Ari Morcos, and Timothy Lillicrap. Measuring abstract In International conference on machine learning, pp. 511–520. reasoning in neural networks. PMLR, 2018. Lawrence W Barsalou et al. Perceptual symbol systems. Behavioral and brain sciences, 22(4): 577–660, 1999. Yaniv Benny, Niv Pekar, and Lior Wolf. Scale-localized abstract reasoning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12557–12565, 2021. Steven Bird, Ewan Klein, and Edward Loper. Natural language processing with Python: analyzing text with the natural language toolkit. " O'Reilly Media, Inc.", 2009. Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportuni- ties and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021. Erin M Burgoon, Marlone D Henderson, and Arthur B Markman. There are many ways to see the forest for the trees: A tour guide for abstraction. Perspectives on Psychological Science, 8(5): 501–520, 2013. Xudong Cao, David Wipf, Fang Wen, Genquan Duan, and Jian Sun. A practical transfer learning algorithm for face verification. In Proceedings of the IEEE international conference on computer vision, pp. 3208–3215, 2013. Xinyun Chen, Chen Liang, Adams Wei Yu, Dawn Song, and Denny Zhou. Compositional general- ization via neural-symbolic stack machines. Advances in Neural Information Processing Systems, 33:1690–1701, 2020. François Chollet. On the measure of intelligence. arXiv preprint arXiv:1911.01547, 2019. Peter Clark, Oyvind Tafjord, and Kyle Richardson. Transformers as soft reasoners over language. arXiv preprint arXiv:2002.05867, 2020. Róbert Csordás, Sjoerd van Steenkiste, and Jürgen Schmidhuber. Are neural nets modular? inspect- ing functional modularity through differentiable weight masks. In International Conference on Learning Representations, 2020. 10 Published as a conference paper at ICLR 2023 Kahneman Daniel. Thinking, fast and slow, 2017. Zoltán Dienes, Gerry TM Altmann, and Shi-Ji Gao. Mapping across domains without feedback: A neural network model of transfer of implicit knowledge. Cognitive Science, 23(1):53–82, 1999. Mengnan Du, Fengxiang He, Na Zou, Dacheng Tao, and Xia Hu. Shortcut learning of large language models in natural language understanding: A survey. arXiv preprint arXiv:2208.11857, 2022. Atticus Geiger, Alexandra Carstensen, Michael C Frank, and Christopher Potts. Relational reasoning and generalization using nonsymbolic neural networks. Psychological Review, 2022. Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A Wichmann. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665–673, 2020. Dedre Gentner and Jose Medina. Similarity and the development of rules. Cognition, 65(2-3): 263–297, 1998. Fausto Giunchiglia and Toby Walsh. A theory of abstraction. Artificial intelligence, 57(2-3):323–389, 1992. Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An empiri- cal investigation of catastrophic forgetting in gradient-based neural networks. arXiv preprint arXiv:1312.6211, 2013. Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A Smith. Annotation artifacts in natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pp. 107–112, 2018. Tom Henighan, Jared Kaplan, Mor Katz, Mark Chen, Christopher Hesse, Jacob Jackson, Heewoo Jun, Tom B Brown, Prafulla Dhariwal, Scott Gray, et al. Scaling laws for autoregressive generative modeling. arXiv preprint arXiv:2010.14701, 2020. John Hewitt and Percy Liang. Designing and interpreting probes with control tasks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2733– 2743, 2019. John Hewitt and Christopher D Manning. A structural probe for finding syntax in word representations. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4129–4138, 2019. Sheng Hu, Yuqing Ma, Xianglong Liu, Yanlu Wei, and Shihao Bai. Stratified rule-aware network for abstract visual reasoning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 1567–1574, 2021. Clark L Hull. Quantitative aspects of evolution of concepts: An experimental study. Psychological monographs, 28(1):i, 1920. Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1988–1997. IEEE Computer Society, 2017. Ronald Kemker, Marc McClure, Angelina Abitino, Tyler Hayes, and Christopher Kanan. Measuring catastrophic forgetting in neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. Daniel Keysers, Nathanael Schärli, Nathan Scales, Hylke Buisman, Daniel Furrer, Sergii Kashubin, Nikola Momchev, Danila Sinopalnikov, Lukasz Stafiniak, Tibor Tihon, et al. Measuring composi- tional generalization: A comprehensive method on realistic data. In International Conference on Learning Representations, 2019. 11 Published as a conference paper at ICLR 2023 Daniel Khashabi, Sewon Min, Tushar Khot, Ashish Sabharwal, Oyvind Tafjord, Peter Clark, and Hannaneh Hajishirzi. Unifiedqa: Crossing format boundaries with a single qa system. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 1896–1907, 2020. Najoung Kim and Tal Linzen. Cogs: A compositional generalization challenge based on seman- tic interpretation. In 2020 Conference on Empirical Methods in Natural Language Processing, EMNLP 2020, pp. 9087–9105. Association for Computational Linguistics (ACL), 2020. Philipp Koehn. Europarl: A parallel corpus for statistical machine translation. In Proceedings of machine translation summit x: papers, pp. 79–86, 2005. George Konidaris. On the necessity of abstraction. Current opinion in behavioral sciences, 29:1–7, 2019. Sreejan Kumar, Ishita Dasgupta, Raja Marjieh, Nathaniel D Daw, Jonathan D Cohen, and Thomas L Griffiths. Disentangling abstraction from statistical pattern matching in human and machine learning. arXiv preprint arXiv:2204.01437, 2022. Yuxuan Lai, Chen Zhang, Yansong Feng, Quzhe Huang, and Dongyan Zhao. Why machine read- ing comprehension models learn shortcuts? In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 989–1002, 2021. Brenden Lake and Marco Baroni. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In International conference on machine learning, pp. 2873–2882. PMLR, 2018. Brenden M Lake, Tomer D Ullman, Joshua B Tenenbaum, and Samuel J Gershman. Building machines that learn and think like people. Behavioral and brain sciences, 40, 2017. Yongjie Lin, Yi Chern Tan, and Robert Frank. Open sesame: Getting inside bert's linguistic knowl- In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting edge. Neural Networks for NLP, pp. 241–253, 2019. Chenyao Liu, Shengnan An, Zeqi Lin, Qian Liu, Bei Chen, Jian-Guang Lou, Lijie Wen, Nanning Zheng, and Dongmei Zhang. Learning algebraic recombination for compositional generalization. arXiv preprint arXiv:2107.06516, 2021a. Qian Liu, Shengnan An, Jian-Guang Lou, Bei Chen, Zeqi Lin, Yan Gao, Bin Zhou, Nanning Zheng, and Dongmei Zhang. Compositional generalization by learning analytical expressions. Advances in Neural Information Processing Systems, 33:11416–11427, 2020. Qian Liu, Bei Chen, Jiaqi Guo, Morteza Ziyadi, Zeqi Lin, Weizhu Chen, and Jian-Guang Lou. Tapex: Table pre-training via learning a neural sql executor. In International Conference on Learning Representations, 2021b. Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2018. Tyler Millhouse, Melanie Moses, and Melanie Mitchell. Foundations of intelligence in natural and artificial systems: A workshop report. arXiv preprint arXiv:2105.02198, 2021. Melanie Mitchell. Abstraction and analogy-making in artificial intelligence. Annals of the New York Academy of Sciences, 1505(1):79–101, 2021. Timothy Niven and Hung Yu Kao. Probing neural network comprehension of natural language arguments. In 57th Annual Meeting of the Association for Computational Linguistics, ACL 2019, pp. 4658–4664. Association for Computational Linguistics (ACL), 2020. Fabio Petroni, Tim Rocktäschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander Miller. Language models as knowledge bases? In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2463–2473, 2019. 12 Published as a conference paper at ICLR 2023 Alethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin, and Vedant Misra. Grokking: Gen- eralization beyond overfitting on small algorithmic datasets. arXiv preprint arXiv:2201.02177, 2022. Yada Pruksachatkun, Jason Phang, Haokun Liu, Phu Mon Htut, Xiaoyi Zhang, Richard Yuanzhe Pang, Clara Vania, Katharina Kann, and Samuel Bowman. Intermediate-task transfer learning with pretrained language models: When and why does it work? In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 5231–5247, 2020. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:1–67, 2020. Vinay Venkatesh Ramasesh, Aitor Lewkowycz, and Ethan Dyer. Effect of scale on catastrophic forgetting in neural networks. In International Conference on Learning Representations, 2021. Ryokan Ri and Yoshimasa Tsuruoka. Pretraining with artificial language: Studying transferable knowledge in language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 7302–7315, 2022. Kyle Richardson, Hai Hu, Lawrence Moss, and Ashish Sabharwal. Probing natural language infer- ence models through semantic fragments. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 8713–8721, 2020. Laura Ruis, Jacob Andreas, Marco Baroni, Diane Bouchacourt, and Brenden M Lake. In A benchmark for systematic generalization in grounded language understanding. H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 19861–19872. Curran Asso- ciates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/ e5a90182cc81e12ab5e72d66e0b46fe3-Paper.pdf. Priyanka Sen and Amir Saffari. What do models learn from question answering datasets? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 2429–2438, 2020. Radhika Shivhare and Ch Aswani Kumar. On the cognitive process of abstraction. Procedia Computer Science, 89:243–252, 2016. Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017. Alon Talmor, Oyvind Tafjord, Peter Clark, Yoav Goldberg, and Jonathan Berant. Leap-of-thought: Teaching pre-trained models to systematically reason over implicit knowledge. Advances in Neural Information Processing Systems, 33:20227–20237, 2020. Ian Tenney, Patrick Xia, Berlin Chen, Alex Wang, Adam Poliak, R Thomas McCoy, Najoung Kim, Benjamin Van Durme, Samuel R Bowman, Dipanjan Das, et al. What do you learn from context? probing for sentence structure in contextualized word representations. In International Conference on Learning Representations, 2018. Pedro A Tsividis, Joao Loula, Jake Burga, Nathan Foss, Andres Campero, Thomas Pouncy, Samuel J Gershman, and Joshua B Tenenbaum. Human-level reinforcement learning through theory-based modeling, exploration, and planning. arXiv preprint arXiv:2107.12544, 2021. Ivan Vuli ́c, Edoardo Maria Ponti, Robert Litschko, Goran Glavaš, and Anna Korhonen. Probing pretrained language models for lexical semantics. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 7222–7240, 2020. Yingxu Wang. Concept algebra: a denotational mathematics for formal knowledge representation and cognitive robot learning. Journal of Advanced Mathematics and Applications, 4(1):61–86, 2015. 13 Published as a conference paper at ICLR 2023 Alex Warstadt, Yu Cao, Ioana Grosu, Wei Peng, Hagen Blix, Yining Nie, Anna Alsop, Shikha Bordia, Haokun Liu, Alicia Parrish, et al. Investigating bert's knowledge of language: Five analysis methods with npis. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2877–2887, 2019. Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. arXiv preprint arXiv:2206.07682, 2022. Thomas Wolf, Julien Chaumond, Lysandre Debut, Victor Sanh, Clement Delangue, Anthony Moi, Pierric Cistac, Morgan Funtowicz, Joe Davison, Sam Shleifer, et al. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 38–45, 2020. Wlodek W Zadrozny. Abstraction, reasoning and deep learning: A study of the" look and say" sequence. arXiv preprint arXiv:2109.12755, 2021. Chi Zhang, Feng Gao, Baoxiong Jia, Yixin Zhu, and Song-Chun Zhu. Raven: A dataset for relational and analogical visual reasoning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5317–5327, 2019. 14 Published as a conference paper at ICLR 2023 This is the Appendix of the paper Does Deep Learning Learn to Abstract? A Systematic Probing Framework. A DISCUSSIONS Below are more discussions about our work. Potential factors that may hinder our probing. We consider the main factor that could block the use of our probing framework is the catastrophic forgetting problem in deep learning (Goodfellow et al., 2013; Kemker et al., 2018). Since our probing framework relies on the transferability property of abstract concepts, if catastrophic forgetting dominates the learning of downstream tasks, such transferability will hardly take effect and the probing results will fail to reveal the abstraction capabilities. Considering this problem, we utilize the early-stopping strategy (detailed in Appendix) to alleviate catastrophic forgetting. Moreover, our tested pre-trained models are naturally more robust to catastrophic forgetting (Ramasesh et al., 2021). Better understanding "why does transfer learning work". Recent success of transfer learning shows that pre-training (or continue pre-training) with similar source tasks can help better solve downstream target task (e.g., question answering (Khashabi et al., 2020; Liu et al., 2021b), face veri- fication (Cao et al., 2013), and general NLU tasks (Pruksachatkun et al., 2020)). Some previous work in cross-lingual transfer learning empirically observed that the model can transfer some knowledge beyond vocabulary (Artetxe et al., 2020; Ri & Tsuruoka, 2022), but they did not consider to exclude the influence from other potential factors. Our results can serve as stronger evidence for the reason to the success of transfer learning, that in addition to transferring some surface patterns, the better target performance can also benefit from similar abstract concepts learned from source tasks. Limitations and future work. The main limitations in this work are 1) we do not quantify the abstraction capability and 2) we only test two large pre-trained models. We leave these two points to our future work. Another future direction is to further explore the mechanisms behind abstractions. B COMPARISONS WITH PREVIOUS FINDINGS ABOUT LEARNING DYNAMIC Comparison with information bottleneck. Shwartz-Ziv & Tishby (2017) found a two-phase learn- ing process from the view of information flow in deep neural networks: empirical error minimization phase and representation compression phase. This process is different from the memorize-then- abstract process since they measure the training dynamics in quite different perspectives. The former focuses on the compression of representation (and reduction of mutual information) while the latter portrays the learning of abstract concepts. The analogy between the two may lie in that the ex- traction of abstract concepts from concrete instances is in some way have the effect of information compression. Comparison with Grokking. Power et al. (2022) revels that the improvement in generalization (on validation set) can happen well past the point of over-fitting (on train set). Both 'grokking' and 'memorize-then-abstract' phenomenon indicate that some general patterns are always learned in a later training stage. The difference is that the 'grokking' focuses on generalization beyond over-fitting training data, while 'memorize-then-abstract' portrays the transfer of abstract concepts beyond task-specific characteristics. C PRINCIPLES FOR DESIGNING PROBING TASKS To verify whether the model could learn abstract concepts from task A by assessing ∆(A ⇒ B), we propose the following principles for designing task B: 1) The space of task-specific characteristics of B should be very different from that of A so that the memorization of surface patterns in A is helpless to B. 2) The abstract concepts of B should be the same as that of A so that the abstraction on A could be reflected with a better performance on B. 3) The fine-tuning-only approach ⇑ B should be not enough to learn task B perfectly; otherwise, the gain from the abstraction on A would not be noticeable. 15 Published as a conference paper at ICLR 2023 Furthermore, to verify that the performance gain on B is from the abstraction on A rather than other factors, we consider a contrast task C of A: 4) The abstract concepts of C should be very different from A (also B), while other latent factors are kept the same such as data scale and pre-training steps. The consideration of contrast task is similar to selectivity (Hewitt & Liang, 2019). D AN OPERATION PROBE The operations semantics (e.g., conjunction) in the Boolean algebra can be regarded as transition functions between the given Boolean variables and corresponding outputs. We want to examine whether the model can learn the meaning of operations from concrete logical expressions, or just learn superficial correlations from specific sketches in expressions. In operation probe, we instantiate the framework with logical expression evaluation (LEE) tasks. We consider operation semantics in logical expressions as abstract concepts, and surface patterns (e.g., local string matching) are bounded with operation sketches. Figure 7a shows two kind of sketches: chain sketch and tree sketch. The model trained on chain sketch may learned the meaning of operations (e.g., conjunction of two Boolean variables) or simply memorize some head or tail patterns of strings (e.g., if the head of input string is "False AND ( ", the output is always "False"). Learning operation semantics can more generally help understand other expressions with different sketches, but memorizing head or tail patterns in chain sketches is helpless or even harmful to understand tree sketches, since these surface patterns can lead to wrong results in different sketches. We give a more specific definition of abstraction based on LEE tasks: s → bi Definition 2: Considering an LEE task L : Es → Bt that the source logical expressions Es (with operation semantics Ps and sketch Ks) are evaluated as Boolean values Bt, and a set of input- s is an logical expression sampled from Es and bi output pairs L = {(ei t)}k in which ei t ∈ {T rue, F alse} is the evaluation result of ei s, the abstraction capability is learning the meanings of operations Ps during training on L rather than memorizing sketch-specific patterns that are bounded with Ks. Our LLE tasks probe the learning of four logical operations: P+ s ={Conjunction (Conj.), Discon- junction (Disc.), Alternative Denial (Alt.), Joint Denial (Joi.)}. Figure 7b illustrates the transition functions of these operations.. For generating data, each operations in P+ s is constantly aligned with one operator (i.e., a concrete string) in So. Examples of these sets are contained in Appendix F.2. Train set A. We synthesize the data in A with P+ operators which are sampled from So. Transfer set ˆB and Test set B. We synthesize the data in ˆB ∪ B with P+ s and tree sketch. Each expression contains eight operators which sampled from So. When probing a certain operation s , we limit that the expression in ˆB does not contain ps, while each expression in B must ps ∈ P+ contain ps. To make the model familiar with operators in So or not forget them during further fine- tuning, we supplement ˆB with 100 two-operator expressions which cover the full So. Empirically, as DNN models can be easily influenced by the statistical bias in label distributions, we balance the 'True' and 'False' examples during sampling. s and chain sketch. Each expression contains eight Contrast set C. The operators and sketch in C are kept the same with A, but each operator in So is aligned with another set of logical operations P− s ={Material Implication, Converse Implication, Material Non-implication, Converse Non-implication}. The transition functions of these operations are listed in Appendix F.2. Results of our operation probe is shown in Table 6. 16 Published as a conference paper at ICLR 2023 (a) Two kind of sketches. (b) Transitions of operations. Figure 7: Four operations and two sketches in our operation probe. (a) shows the chain sketch used in task A and C, and the tree sketch used in ˆB ∪ B. Each 'OP' represents one operation. (b) shows the transition results of four operations with different left and right Boolean variables. Table 6: Results in our operation probe. Probe Model Sub-Probe Control Exp Main Exp A ⇒ B ⇑ B Contrast Exp C ⇒ B Operation T5 GPT2 Avg. Conj. Disc. Alt. Joi. Avg. Conj. Disc. Alt. Joi. 70.1 63.3 58.9 79.1 79.2 64.7 61.8 59.8 69.0 68.3 88.9 (+18.8) 71.2 (+1.1) 90.8 84.8 90.7 89.2 65.3 72.8 72.6 74.3 76.3 (+11.6) 64.0 (-0.7) 78.6 72.5 78.6 75.3 61.1 64.1 65.4 65.3 E ABSTRACT CONCEPTS ARE MODULARIZED IN PLMS To supplement our analysis on abstract attention heads, here we provide our detailed explorations to identify the modulars in PLMs that store abstract concepts in our probes. Our explorations are based on the following property and assumption. Property: Forgetting of Abstract Concepts. Consider the Main Exp A ⇒ B that task A and B share the abstract concepts but do not share task-specific knowledge. After fully fine-tuning on task B, the model's parameters will somehow over-fit the task-specific knowledge in task B and the abstract concepts stored in these parameters will be partially forgotten. Assumption: Identifying the Modularization of Abstract Concepts by Freezing Parameters. If a module in the model individually store a part of abstract concepts, these parameters can be directly reused in new tasks without further fine-tuning. Furthermore, considering the property above, freezing this abstract module can avoid the forgetting of abstract concepts, resulting in the performance improvement in Main Exp A ⇒ B. Based on this assumption, to identify whether abstract concepts are modularized in some parameters, we partially freeze the model in a coarse-to-fine manner. The following experiments are conducted on one of the three pre-training terminal sets. First, we freeze each layer in the model, showing in Figure 8. We find that the last layer in encoder and the first layer in decoder modularize part of abstract concepts. Furthermore, we freeze these two layers in our Contrast Exp C ⇒ B and find no improvements in Figure 9a, indicating that the improvement of freezing these two layers comes from keep abstract concepts. In next step, we try to identify the abstract concepts are stored in attention layers or FF layers. We separately freeze the attention sub-layer and FF sub-layer in the last encoder layer and first decoder layer. Figure 9b shows that attention layers take more responsibility for storing abstract concepts. Then, we analyze whether these abstract concepts are modularized in some attention heads or averaged in the whole attention layers. Our investigation in Section 6.2 finds that the abstract concepts are centralized in some middle-layer attention heads. Based on the results in Figure 4, we freeze the top 17 OP1OP2OP4OP3Chain SketchOP1OP2OP3OP4Tree SketchConjunction0Left Var.DisjunctionAlternativeDenialJointDenialRight Var.1000101110101011011010100100101 Published as a conference paper at ICLR 2023 36 heads to further verify that they are responsible for storing abstract concepts. Results in Table 7 indicate that abstract concepts are modularized in this small part of attention heads. Figure 8: Freeze 24 layers separately in A ⇒ B. (a) Freeze layers in C ⇒ B. (b) Separately freeze attention and FF in A ⇒ B. Figure 9: Further explore the modularity in the middle two layers. Table 7: Supplement to Table 3. Freeze a set of abstract heads and fine-tune. Baseline A ⇒ B +Freeze Abstract Heads +Freeze Random Heads -Prune Abstract Concepts Fine-Tuning 92.8 96.6 (+3.8) 92.9 13.6 Baseline C ⇒ B +Freeze Abstract Heads 13.9 14.4 F EXAMPLES IN OUR DESIGNED TASKS Here, we list some examples in our designed probing tasks. The full sets are contained in our Supplementary Material. F.1 GRAMMAR PROBE Table 8 and 9 shows examples in Com. and Mod. sub-probes in grammar probe, respectively. F.2 OPERATION PROBE Table 10 lists the operation behind each symbol, and Table 11 shows examples in Conj. sub-probe in operation probe. Figure 10 illustrates the transitions of operations used in contrast task in operation probe. F.3 REDUNDANT DESIGNS For Redundant G∗ s, we supplement the second T-Production rule in Table 1 as "sub / direct-obj / indirect-obj (cid:16) Sadj Sn". Terminals in Sadj can re regarded as adjectives for Sn. These terminals 18 E0E1E2E3E4E5E6E7E8E9E10E11D0D1D2D3D4D5D6D7D8D9D10D11Frozen Layer90919293949596Accuracy (%)baselineE11D0Frozen Layer101214161820Accuracy (%)baselineE-fullE-attE-ffD-fullD-attD-ffFrozen Layer90919293949596Accuracy (%)baseline Published as a conference paper at ICLR 2023 Table 8: Examples in different sets in Com. sub-probe in grammar probe. The terminal NONE in target side is omitted to more clearly show the structure of the target example. Set Train Set Transfer Set Side Source Target Source Target Soke incurve huave the soon upon huave a ban bibb huave acetum goladar . INCURVE ( SOKE ) LG UPON ( SOON ) LG BIBB ( BAN ) LG GOLADAR ( ACETUM ) Example Emma liked that a girl saw . LIKE ( EMMA ) CCOMP SEE ( GIRL ) Test Set Source Target ADMIRE ( EMMA ) CCOMP LIKE ( DANIEL ) CCOMP MEAN ( JAMES ) CCOMP FREEZE ( LION ) Emma admired that Daniel liked that James meant that a lion froze . Contrast Set Source Target Soke incurve huave the soon upon huave a ban bibb huave acetum goladar . ( ACETUM ) GOLADAR LG ( BAN ) BIBB LG ( SOON ) UPON LG ( SOKE ) INCURVE Table 9: Examples in different sets in mod. sub-probe in grammar probe. Set Side Example Train Set Source Safe above the poddy cord the soon a pial . Target CORD ( ABOVE ( SAFE , PODDY ) , PIAL , SOON ) Transfer Set Source Emma ate the ring beside a bed . Target EAT ( EMMA , BESIDE ( RING , BED ) , NONE ) Test Set Source The baby on a tray in the house screamed . Target SCREAM ( ON ( BABY , IN ( TRAY , HOUSE ) ) , NONE , NONE ) Contrast Set Source Target Safe above the poddy cord the soon a pial . ( SOON , PIAL , ( PODDY , SAFE ) ABOVE ) CORD are only contained in the source side and no terminals in target side are aligned with them. Table 13 shows an example in Redundant G∗ s. F.4 DERIVATIONS Here we show examples of different derivations of original grammars. Table 12 shows examples in different G∗ t . The terminal 'NONE' is omitted. G MORE EXPERIMENTAL RESULTS We present additional experimental results to supplement our probing and analysis. G.1 DATA SCALE AND TERMINAL DIVERSITY Figure 11a shows the effects from data scale for different model sizes. It shows that the performance improves marginally and unstably when the data scale increases from 1.7K to 680K instances. Moreover, it seems that the performance gap between models with different sizes is still considerable when the data scale is enough large. Figure 11b shows the effects from data diversity for different model sizes. Here, we consider the terminal diversity as a perspective of data diversity, i.e., the number of terminals of the grammar. Following Section 4, we only change the number of terminals in Sc and SC, increasing from 1 to 128. The overall trend is that the performance improves marginally and unstably when the diversity increases. Interestingly, we observe that for all three models, their performances achieve the peak before rising to 128 terminals and then keep oscillating. We speculate that their performances are bounded by the limited data scale, as we control the data scale as 34K instances when increasing the terminal diversity. To examine our speculation, we conduct another experiment on T5-Base that pre-training on 680K instances with 128 terminals, achieving an average accuracy rate of 93.5%. This performance is higher than the result after pre-training on 680K instances with 32 terminals (89.2%) and higher than the best average accuracy of T5-Base in Figure 11b (88.4%), suggesting that higher data diversity should be equipped with a larger data scale. 19 Published as a conference paper at ICLR 2023 Table 10: Symbols and operations in different tasks in operation probe. Symbol Operation in A and B Operation in C a1 b2 c3 d4 Conjunction Alternative Denial Disjunction Joint Denial Material Non-implication Material Implication Converse Non-implication Converse Implication Table 11: Examples in different sets in operation probe. Set Train Set Transfer Set Test Set Contrast Set Side Source Target Source Target Source Target Source Target Example False c3 ( ( ( False a1 ( ( ( False b2 ( True d4 True ) ) d4 True ) d4 True ) ) d4 False ) b2 False ) True ( ( False c3 ( False b2 False ) ) b2 True ) d4 ( True b2 ( ( False b2 ( False b2 False ) ) c3 True ) ) True ( True b2 ( ( False a1 False ) d4 False ) ) a1 ( False c3 ( ( ( True a1 True ) c3 True ) a1 True ) ) False False c3 ( ( ( False a1 ( ( ( False b2 ( True d4 True ) ) d4 True ) d4 True ) ) d4 False ) b2 False ) False G.2 MULTI-GRAMMAR PRE-TRAINING Before this section, we consider the setup in which we only see one pair of input and output grammars during pre-training. This section explores whether multi-grammar pre-training would influence the model to exhibit abstraction. Here, we consider two cases: can or can not access the golden grammar. The golden grammar is the grammar used in the downstream task. For the multi-grammar pre-training, we assemble different target grammars in Section 6.3 while keep the source grammar. During generating pre-training data with more than one target grammar, for each instance, we add a prefix (chosen from original, coarse, localreverse, nest, and reverse) at the beginning of the source tokens, guiding the model which target grammar it should use. Table 14 shows the results with different ensemble grammars. First, consider that we have no access to the golden grammar. We take the target grammar that performs the best in Section 6.3, Coarse G∗ t , as the single-grammar baseline. Table 14 shows that augmenting the Coarse G∗ t with other target grammars can always perform better than the single grammar. Even augmenting with the Reverse G∗ t from the contrast task can bring a slight gain (1.4% accuracy). It indicates that even though the model has no access to the golden abstract concepts, increasing the diversity of abstract concepts can make the model better aware of the existence of abstract concepts. This awareness can be regarded as a higher level of abstraction capibility. Then, considering that the model has access to the golden grammar, the downstream task performance is lower than only pre-training on the golden grammar (accuracy 88.2%). Therefore, augmenting other similar abstract concepts would confuse the model and make it hard to choose which concepts should be used for the downstream task. G.3 INCREASE TOTAL NUMBER OF TERMINALS We increase the total number of terminals to ∼1,500 in our probing tasks and report the results with T5-Base in Table 15. These results are similar to the original results in Table 2 and are still in line with our two expectations. H FUZZY GRAMMAR The abstract concepts discussed in grammar probe in Section 4 can be concretely defined, but in many application scenarios, abstract concepts can be fuzzy (e.g., natural language grammar). Here, we want to examine whether models can learn fuzzy grammar or just can recognize the concrete one. 20 Published as a conference paper at ICLR 2023 Figure 10: Transitions of operations used in contrast task in operation probe. Table 12: Examples in different G∗ t . Derivation Target Example Coarse LocalR Nested CLAN ( ) LG INCURVE ( ) LG UPON ( ) ( BAN ) CLAN LG ( SOKE ) INCURVE LG ( BIBB, GOALDER, SOON ) UPON CLAN ( BAN, LG INCURVE ( SOKE, LG UPON ( SOON, GOALDER, BIBB ) ) ) We take natural language sentences for experiments and design different sets by mimicking the Com. sub-probe in our grammar probe. Data in our fuzzy grammar probe is taken from Europarl v7 Koehn (2005), a large parallel corpus for machine translation . For the probing on natural language data, we can not guarantee to satisfy the requirements in our framework perfectly, as the grammar of the natural language is hard to be controllable as the formal language. We describe the instantiation of different sets as following. Train set A. We take the German-to-French (De-Fr) sentence paris as A. Transfer set ˆB and Test set B. We take English-to-Romanian (En-Ro) as the probing task B. As both German and English are belong to the West Germanic language branch while both French and Romanian are belong to Italic branch, the abstract grammars used in De-Fr and En-Ro have some similarities. To satisfy that the ⇑ B performs poorly, we limit the ˆB with only short sentences (15.7/13.8 words in En/Ro sentences in average) while B with only long sentences (78.0/74.4 words in En/Ro sentences in average). It means that the model can learn most of the lexicons from ˆB but can not be aware of the grammars of long sentences. Contrast set C. Mimicking the construction of C in the formal language task, we also reverse the word order in the target language of A. Table 4 shows the performance of two models on natural language data. These results indicate that fuzzy grammar in natural language data can also be learned and transferred by the two PLMs. In addition, as this setting can also be regarded as a length generalization problem, the low ∆(C ⇒ B) further confirm that our probing results benefit from learning abstract concepts rather than surface patterns (i.e., length distribution). I TRY TO MEASURE ABSTRACTION CAPABILITY As mentioned in Section A that one limitation in our probing is the lack of a metric that can quantita- tively measure the abstraction capibility. Thus, we can not compare the abstraction capibility of two models with different architectures. Here, we try to design such a metric to compare the abstraction capibility of T5-Base, with ∼220M parameters, and GPT2-Medium, with 345M parameters. In the beginning, we want to clarify that this metric is just for primary exploration, as it is based on a strong assumption that can not be satisfied in all situations. Assumption: We assume that the performance score of a certain task (such as accuracy and BLEU score) can linearly reflect the ability of the model to solve this task. It means that, for instance, improving the accuracy from 90% to 100% is not harder than improving from 40% to 50%. Apparently, this assumption does not suit all tasks and performance scores (even 21 MaterialNon-implication1Left Var.Right Var.0000101011101010001010111100101MaterialImplicationConverseNon-implicationConverseImplication Published as a conference paper at ICLR 2023 Table 13: Examples in Redundant G∗ targets. s. Gray terminals are redundant that would not be mapped to Derivation Source Example Redundant A angry pial was ozophen to zogo by odd dermestes . (a) Data Scale (b) Data Diversity Figure 11: More results for different data scales and data diversity. the tasks and scores in our probing). But it does not influence the comparison between T5-Base and GPT2-Medium. The reason will be discussed later. Intuitively, we consider the contribution of abstract concepts to overall performance as a measure of abstraction capibility, that is, MoA = , (2) scorea scoref in which the MoA means the Metric of Abstraction, scoref means the full performance score on a certain task without limiting the training data, and scorea means the part of the score contributed by the abstract concepts. Following our probing framework, we consider the scorea as the relative gain from ⇑ B to A ⇒ B. Furthermore, considering the influence of other factors which is reflected by C ⇒ B, we design the scorea as: scorea = score(A ⇒ B) − max[score(⇑ B), score(C ⇒ B)], (3) in which score() represents the performance score of a certain procedure, and max[score(⇑ B), score(C ⇒ B)] means to choose the maximum performance score between ⇑ B and C ⇒ B. For the full performance score in the denominator in Equation 2, we evaluate the model performance on B after (only) fine-tuning on the full set ̃B, which is sampled in the same distribution of B (rather than a limited distribution of ˆB). We denote this procedure as ̃⇑ B. Thus, the metric in Equation 2 can be formalized as: MoA = score(A ⇒ B) − max[score(⇑ B), score(C ⇒ B)] score( ̃⇑ B) . (4) Table 16 shows MoA for two models on grammar probe and fuzzy grammar probe, and lists the scores required to calculate MoA. On each task, MoA of T5-Base is higher than that of GPT2-Medium. Furthermore, during calculating MoA, the baseline score max[score(⇑ B), score(C ⇒ B)] of T5- Base is always higher than that of GPT2-Medium. As it is harder for the model to improve the accuracy and BLEU scores on these tasks from a relatively higher baseline, MoA can just under- estimate the abstract ability of T5-Base. Therefore, we can roughly conclude that the abstraction capibility of T5-Base is higher than GPT2-Medium. J COMPARISON WITH PREVIOUS NEGATIVE RESULTS Some previous work demonstrated that neural models could not learn abstract concepts (Liu et al., 2020; Chen et al., 2020; Liu et al., 2021a; Chollet, 2019; Mitchell, 2021; Zadrozny, 2021). Our probing results shed some light that neural models, especially PLMs, exhibit abstraction capibility to some extent. Compared with previous work, two points could lead to different conclusions. 22 104105Number of Instances20406080100Accuracy (%)T5-SmallT5-BaseT5-Large100101102Number of Terminals020406080100Accuracy (%)T5-SmallT5-BaseT5-Large Published as a conference paper at ICLR 2023 Table 14: Downstream performance under different multi-grammar settings. Grammars Reverse Nest LocalR Coarse Without Golden Grammar With Golden Grammar (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) Accuracy 41.6 43.0 46.4 54.6 55.3 74.0 (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) (cid:88) Table 15: Increase total number of terminals. Model Sub-Probe Control Exp Main Exp A ⇒ B ⇑ B Contrast Exp C ⇒ B T5 Avg. Com. Mod. 18.1 21.9 14.2 69.8 (+51.7) 15.9 (-2.2) 83.9 55.7 15.2 16.5 The first point is the probing methodology. In all works (including ours), the basic idea of probing abstraction is to separate it with memorization. To implement this idea, previous work has almost always involved designing a special probing task in which memorization of the train set is helpless to solve the test set. However, such an implementation constraints the generation of the train set, which could bring some biases or limitations in training data. To overcome these biases or limitations, the model should have some other abilities more than abstraction, such as reasoning and systematic generalizability. Therefore, the previous disappointing results may have been caused by the lack of other abilities rather than abstraction. The second point is the test model. Some previous work probed the vanilla Transformer or LSTM while we take the pre-trained language models. We suppose that the model may acquire better abstraction capibility from the pre-training corpus, and can better exhibit this ability with larger model sizes. K DETAILS OF EXPERIMENTS K.1 DATA We show more details about the sets described in Section 4, including data scales, average input lengths and average output lengths. For the target side grammar of our formal language tasks, we mentioned in Section 4 that we change the original target grammar of COGS to be chain-structured. In Table 18, we list some examples with the original target grammar and the new chain-structured grammar. First, to distinguish the input and output tokens, we capitalize all output tokens (e.g., from "rose" to "ROSE"). Second, we replace the variables (e.g., "x _ 1") in the original grammar with its corresponding terminals (e.g., "ROSE"). Then, we group the terminals of AGENT (e.g., "DOG"), THEME (e.g., "ROSE") and RECIPIENT with their corresponding terminal of PREDICATE (e.g., "HELP") and combine this group of terminals in a function format, i.e., "PREDICATE ( AGENT, THEME, RECIPIENT )". If the predicate is not equipped with an agent, theme or recipient in the original grammar, the corresponding new non-terminals (i.e., AGENT, THEME and RECIPIENT, respectively) in the function format above will be filled with the terminal NONE (e.g., "HELP ( DOG, ROSE, NONE )"). For simplicity, we omitted NONE in Table 1, Table 8, and Table 12. Such a function format is the minimum unit of a CLAUSE. Finally, each CLAUSE is concatenated with another CLAUSE by the terminal CCOMP (e.g., "HOPE ( LIAM, NONE, NONE ) CCOMP PREFER ( DOG, NONE, NONE )"). K.2 PROCEDURE Training Each pre-training takes 100,000 steps, and the final-step checkpoint is used for fine-tuning. Each fine-tuning takes 100,000 steps, and the checkpoints for every 10,000 steps are saved. 23 Published as a conference paper at ICLR 2023 Table 16: MoA of two models on both grammar probe and fuzzy grammar probe and the scores required to calculate MoA. T5 and GPT2 are T5-Base and GPT2-Medium, respectively. Probe Score Model Scores of Procedures A ⇒ B ⇑ B C ⇒ B Grammar Accuracy (%) Fuzzy Grammar BLEU Score T5 GPT2 T5 GPT2 88.2 48.2 35.1 21.0 23.1 1.9 24.0 16.4 15.4 2.6 26.2 11.6 ̃⇑ B 95.7 93.2 41.9 42.2 MoA 0.68 0.49 0.21 0.11 Table 17: Data scales, average input lengths, and average output lengths of different sets in our probing. Probe Data Scale Avg Input Len Avg Output Len Data Scale Avg Input Len Avg Output Len Data Scale Avg Input Len Avg Output Len Data Scale Avg Input Len Avg Output Len A ˆB B C Grammar Operation Fuzzy Grammar 34,175 100,000 400,000 16.8 16.8 38.9 29.9 1 40.8 24,155 20,000 200,000 9.5 9.5 15.7 10.5 1 13.8 1,002 1,000 1,004 34.4 34.4 78.0 76.6 1 74.4 34,175 100,000 400,000 16.8 16.8 38.9 29.9 1 40.8 Evaluation We take an early-stopping strategy in our evaluation to avoid catastrophic forgetting. First, each checkpoint saved during fine-tuning is evaluated on the held-out dev set. We choose the first checkpoint that achieves the best dev score for testing. For formal language tasks, we utilize the constraint decoding strategy that the model can only generate the words in the vocabulary. Compute and Resources We majorly use Tesla-V100-16GB GPUs for training and evaluation, except for the experiments on T5-Large or GPT2-Large, which require Tesla-V100-32GB GPUs. On average, one pre-training takes ∼15 GPU hours, one fine-tuning takes ∼15 GPU hours (including saving checkpoints), and one testing takes ∼2 GPU hours (as test cases are very long). K.3 HYPERPARAMETERS Hyperparameters used for training and testing are listed in Table 19. K.4 DEFINITION OF PERPLEXITY (PPL) Th following equation explain how to calculate PPL in Equation 1, PPL(li t|li s; θ) = exp[− 1 |li t| (cid:88) j log pθ(li,j t s, li,<j |li t )]. (5) K.5 RESULTS We list the detailed results that are plotted in the figures (i.e., Figure 5 and Figure 6), including the average scores, minimum scores, maximum scores, and standard deviations for all replicate experiments. 24 Published as a conference paper at ICLR 2023 Table 18: Examples with the original grammar and the new chain-structured grammar. Original Target Grammar Chain-Structured Target Grammar rose ( x _ 1 ) AND help . theme ( x _ 3 , x _ 1 ) AND help . agent ( x _ 3 , x _ 6 ) AND dog ( x _ 6 ) captain ( x _ 1 ) ; eat . agent ( x _ 2 , x _ 1 ) dog ( x _ 4 ) ; hope . agent ( x _ 1 , Liam ) AND hope . ccomp ( x _ 1 , x _ 5 ) AND prefer . agent ( x _ 5 , x _ 4 ) HOPE ( LIAM, NONE, NONE ) CCOMP PREFER ( DOG, NONE, NONE ) HELP ( DOG, ROSE, NONE ) EAT ( CAPTION, NONE, NONE ) Table 19: Hyperparameters for training and testing. Grammar Probe Operation Probe GPT2 T5 GPT T5 Learning Rate Weight Decay Batch Size Label Smooth Max Input Len Max Output Len Max Total Len Beam Size 1e-5 0.01 8 0.1 1024 1024 - 5 1e-5 0.01 8 0.1 - - 1024 5 1e-4 0.01 8 0.1 1024 1024 - 1 1e-4 0.01 8 0.1 - - 1024 1 Table 20: Detailed results for Figure 5. Original Redundant LocalR Nest Reverse Original Coarse LocalR Nest Reverse Input Grammar Output Grammar Avg Min Max Std 88.2 72.8 96.9 8.5 86.0 68.3 95.6 10.2 76.2 70.4 80.6 4.2 55.5 49.1 61.1 4.3 15.0 13.0 20.1 2.5 88.2 72.8 96.9 8.5 41.6 34.5 50.8 4.9 33.5 19.8 38.7 6.7 29.1 27.7 31.7 1.3 15.4 12.1 19.2 2.4 Table 21: Detailed results for Figure 6a and 6b. Main Exp T5-Small T5-Base T5-Large GPT2 GPT2-Medium GPT2-Large Control Exp T5-Small T5-Base T5-Large GPT2 GPT2-Medium GPT2-Large Avg Min Max Std 34.4 20.7 47.4 9.8 88.2 72.8 96.9 8.5 94.0 83.2 97.2 4.9 3.5 0.0 12.4 4.4 48.9 23.9 63.8 14.5 68.7 47.2 85.7 13.7 9.0 3.0 6.0 3.0 23.1 22.6 23.5 0.5 19.5 17.8 21.1 1.7 0.0 0.1 0.2 0.1 2.0 1.1 2.9 0.9 3.4 3.1 3.6 0.3 Table 22: Detailed results for Figure 6c. (a) T5-Large Data Scale (T5-Large) 1.7K 3.4K 6.8K 17K 34K 68K 170K 680K Avg Min Max Std 90.4 73.5 97.1 10.5 96.7 96.0 98.1 0.9 96.7 92.3 94.0 94.2 73.6 83.2 98.5 98.7 97.2 1.7 10.8 4.9 (b) T5-Base 98.8 98.0 99.3 0.5 97.6 92.4 99.8 3.0 98.9 96.9 99.7 1.1 Data Scale (T5-Base) 1.7K 3.4K 6.8K 17K 34K 68K 170K 680K Avg Min Max Std 75.1 61.5 90.8 10.0 82.8 74.0 88.7 4.9 84.0 85.0 88.2 69.2 79.3 72.8 94.4 97.2 96.9 8.5 6.3 8.5 (c) T5-Small 82.0 74.8 92.3 6.3 87.0 82.5 92.7 3.8 89.2 76.9 94.4 7.6 Data Scale (T5-Small) 1.7K 3.4K 6.8K 17K 34K 68K 170K 680K Avg Min Max Std 28.3 27.4 29.2 0.9 31.9 11.5 50.5 15.6 26.1 16.1 36.2 9.2 27.3 21.2 33.7 4.1 34.4 20.7 47.4 9.8 40.5 19.7 62.9 19.0 38.7 23.5 50.9 9.9 39.4 29.7 56.0 9.5 25 Published as a conference paper at ICLR 2023 Table 23: Detailed results for Figure 11b. (a) T5-Large 1 90.5 79.7 97.9 6.9 2 93.3 85.9 97.4 3.9 Avg Min Max Std 1 66.5 53.0 79.4 9.8 2 72.5 61.4 86.1 10.1 Avg Min Max Std Terminal Diversity (T5-Large) 4 8 16 96.4 97.9 95.6 95.9 98.1 98.9 0.9 1.0 (b) T5-Base 98.1 97.1 99.1 0.7 32 94.0 83.2 97.2 4.9 64 96.9 93.2 98.1 1.7 128 94.2 87.3 99.0 4.6 Terminal Diversity (T5-Base) 4 8 16 76.3 85.3 88.4 69.2 71.6 75.7 92.2 94.1 96.4 7.8 9.4 7.6 (c) T5-Small 32 88.2 72.8 96.9 8.5 64 86.4 54.6 93.7 15.2 128 84.2 71.1 97.5 10.7 Terminal Diversity (T5-Small) 1 23.5 3.3 35.8 10.1 2 24.2 12.6 34.5 7.5 4 23.3 10.2 38.6 8.3 8 26.6 16.1 41.0 9.2 16 29.3 21.0 36.1 4.9 32 34.4 20.7 47.4 9.8 64 26.7 22.6 32.4 4.3 128 32.8 24.7 47.5 9.6 Avg Min Max Std 26
http://arxiv.org/abs/2302.11974v2
2023-02-27T16:21:51
2023-02-23T12:46:11
LightCTS: A Lightweight Framework for Correlated Time Series Forecasting
Correlated time series (CTS) forecasting plays an essential role in many practical applications, such as traffic management and server load control. Many deep learning models have been proposed to improve the accuracy of CTS forecasting. However, while models have become increasingly complex and computationally intensive, they struggle to improve accuracy. Pursuing a different direction, this study aims instead to enable much more efficient, lightweight models that preserve accuracy while being able to be deployed on resource-constrained devices. To achieve this goal, we characterize popular CTS forecasting models and yield two observations that indicate directions for lightweight CTS forecasting. On this basis, we propose the LightCTS framework that adopts plain stacking of temporal and spatial operators instead of alternate stacking that is much more computationally expensive. Moreover, LightCTS features light temporal and spatial operator modules, called L-TCN and GL-Former, that offer improved computational efficiency without compromising their feature extraction capabilities. LightCTS also encompasses a last-shot compression scheme to reduce redundant temporal features and speed up subsequent computations. Experiments with single-step and multi-step forecasting benchmark datasets show that LightCTS is capable of nearly state-of-the-art accuracy at much reduced computational and storage overheads.
[ "Zhichen Lai", "Dalin Zhang", "Huan Li", "Christian S. Jensen", "Hua Lu", "Yan Zhao" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11974v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11974v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.DB" ]
LightCTS: A Lightweight Framework for Correlated Time Series Forecasting Zhichen Lai†, Dalin Zhang†∗, Huan Li‡∗, Christian S. Jensen†, Hua Lu§, Yan Zhao† †Department of Computer Science, Aalborg University, Denmark ‡College of Computer Science and Technology, Zhejiang University, China §Department of People and Technology, Roskilde University, Denmark 3 2 0 2 b e F 7 2 ] G L . s c [ 2 v 4 7 9 1 1 . 2 0 3 2 : v i X r a ABSTRACT Correlated time series (CTS) forecasting plays an essential role in many practical applications, such as traffic management and server load control. Many deep learning models have been proposed to improve the accuracy of CTS forecasting. However, while models have become increasingly complex and computationally intensive, they struggle to improve accuracy. Pursuing a different direction, this study aims instead to enable much more efficient, lightweight models that preserve accuracy while being able to be deployed on resource-constrained devices. To achieve this goal, we characterize popular CTS forecasting models and yield two observations that indicate directions for lightweight CTS forecasting. On this basis, we propose the LightCTS framework that adopts plain stacking of temporal and spatial operators instead of alternate stacking which is much more computationally expensive. Moreover, LightCTS fea- tures light temporal and spatial operator modules, called L-TCN and GL-Former, that offer improved computational efficiency with- out compromising their feature extraction capabilities. LightCTS also encompasses a last-shot compression scheme to reduce re- dundant temporal features and speed up subsequent computations. Experiments with single-step and multi-step forecasting benchmark datasets show that LightCTS is capable of nearly state-of-the-art accuracy at much reduced computational and storage overheads. CCS CONCEPTS • Information systems → Spatial-temporal systems; Data min- ing. KEYWORDS correlated time series forecasting, lightweight neural networks ACM Reference Format: Zhichen Lai†, Dalin Zhang†∗, Huan Li‡∗, Christian S. Jensen†, Hua Lu§, Yan Zhao† . 2023. LightCTS: A Lightweight Framework for Correlated Time Series Forecasting. In Proceedings of the 2023 International Conference on Management of Data (SIGMOD '23). ACM, New York, NY, USA, 15 pages. https://doi.org/nnnnn/nnnnnn.nnnnn *corresponding authors: D. Zhang ([email protected]) and H. Li ([email protected]). Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. SIGMOD '23, June 18–23, 2023, Seattle, WA, USA © 2023 Association for Computing Machinery. ACM ISBN 978-x-xxxx-xxxx-x/YY/MM. . . $15.00 https://doi.org/nnnnn/nnnnnn.nnnnn Figure 1: DL-based CTS forecasting frameworks using (a) al- ternate stacking and (b) plain stacking. 1 INTRODUCTION Driven in part by the availability of increasingly advanced and affordable sensor technologies, cyber-physical systems (CPSs) [16] are being deployed at a rapid pace. In a typical CPS, multiple sensors sample physical processes of interest and emit multiple time series with correlations. One example is sensors that sample power pro- duction by photovoltaic installations in a geographical region [32]. Extracting and exploiting correlations in correlated time series (CTS) is important in many applications, such as the forecasting of traffic situations [13, 43, 60, 68], air quality [17], server loads [18, 38], social activity [71], and wind farm maintenance [11]. In this study, we focus on CTS forecasting. One significant application occurs in the predictive maintenance of wind turbines [11], which are often deployed in remote and harsh locations. Accurate and instant fore- casts of a turbine's operating status, e.g., covering pitch speed and active power, can enable identification of potential failures, thereby enabling timely maintenance, and thus reducing regular mainte- nance costs, decreases in generated power, and potential safety hazards [33]. Hence, forecasting has attracted extensive research attention. Deep learning (DL) techniques have recently shown impressive CTS forecasting performance. A variety of DL modules, such as convolutional neural networks (CNNs) [8, 21, 28, 46, 61, 62, 65], recurrent neural networks (RNNs) [4, 6, 9, 36, 49], graph convolu- tional networks (GCNs) [8, 21, 36, 42, 46, 60, 62], and Transform- ers [44, 60, 64, 70], are used to construct operators for extracting temporal features from individual time series or spatial features across correlated time series. These two categories of operators are referred to as temporal operators (T-operators) and spatial EmbeddingModuleAggregation and Output Module (a)CTSForecast(b)EmbeddingModuleAggregation and Output Module T-operatorS-operatorCTSForecast×LSTT(S)-operatorS(T)-operator...ST-block×LS×LTTemporalFeatureCompression operators (S-operators) (see the categorization in Table 2). Stud- ies [60, 65] show that such operators are effective at feature ex- traction and enable state-of-the-art CTS forecasting accuracy. We analyze the commonalities of these DL-based models and present a generic framework as shown in Figure 1(a). The framework starts with an embedding module that ingests the raw CTS data; then, multiple spatio-temporal blocks (ST-blocks) are stacked, each con- sisting of a sequence of alternate S- and T-operators for extracting high-order spatio-temporal features (ST-features); the framework ends with a module that aggregates ST-features at different depths with residual connections and outputs a forecast. However, DL-based CTS models are often large, and inferencing is often computationally expensive. This limits the possibilities of deploying CTS forecasting on resource-constrained edge comput- ing devices, which is otherwise attractive in CPS applications due to the decentralized computation and potentially increased service responsiveness [48]. As an example, there is a pressing need to mon- itor and forecast the working status of wind turbines in real time for maintenance [11]. However, wind turbines are often deployed offshore or in high latitudes, and transmitting their operational data to a remote data center is costly, lagging, and fragile to the quality of networking. To detect potential faults in a timely manner and respond on board, an appealing solution is to place a lightweight model on an edge device operating locally. Microcontroller units (MCUs) are widely used edge devices in industry due to their sta- bility and low cost [51]. However, they have very limited memory. The popular STM32F4 series of MCUs have up to 3Mb of memory, which is insufficient for the deployment of state-of-art CTS models like GwNet [62]. Moreover, as existing CTS models are not specifi- cally designed for lightweight applications, simply lightening these models degrades their performance dramatically (see Table 10). Moreover, we observe that although recent studies on CTS fore- casting focus mainly on improving accuracy, progress has almost come to a standstill. For example, AutoCts [60], a state-of-the-art forecasting model, improves GwNet [62], a previous state-of-the- art model, by up to 0.06 miles per hour (mph) in terms of mean absolute error (MAE) on traffic speed forecasting. AutoCts mod- els are much larger and are obtained through neural architecture search, which involves the training and evaluation of thousands of large models, which may take up to hundreds of GPU hours, incurring considerable CO2 emissions [7]. This situation, character- ized by increasingly larger and computationally expensive models with diminishing accuracy improvements, motivates a different direction, where we instead aim to achieve lightweight models with competitive accuracy. This will enable edge computing as well as overall emissions savings [48]. Although several lightweight techniques have been proposed in computer vision [22, 35, 53, 69], these techniques are not readily applicable to CTS forecasting. A key reason is that lightweight computer vision models focus mainly on simplifying 2D and 3D convolutions for image and video data, while CTS models involve instead 1D convolution of temporal features and graph convolution of spatial features. In addition, recent lightweight Transformers [37, 39] reduce the computational cost of the self-attention mechanism by utilizing the similarities among adjacent and multi-scale image patches, which are not applicable to CTS data. We propose LightCTS, a framework that enables lightweight CTS forecasting at significantly reduced computational cost while retaining forecasting accuracy comparable to the state-of-the-art. We start with a comprehensive analysis of existing CTS models, placing them in a generic framework (see Figure 1(a)) and scrutiniz- ing the computational and storage overheads of their components, both theoretically and empirically. The analysis yields important observations (see Section 3) and points to two directions for achiev- ing lightness, namely 1) simplifying computations associated with ST-feature extraction and 2) optimizing the generic CTS architec- ture and compressing redundant temporal dimensions for costly S-operators. By following these directions, LightCTS offers a set of novel lightweight techniques. First, LightCTS includes a novel T-operator module called Light Temporal Convolutional Network (L-TCN) and a novel S-operator module called GlobalLocal TransFormer (GL- Former) for temporal and spatial feature extraction, respectively. Both L-TCN and GL-Former adopt grouping strategies to reduce the full connections between adjacent layers to local in-group con- nections, thus achieving lower complexity than the vanilla TCN and Transformer. Moreover, LightCTS adopts a simple but effective plain stacking based architecture (see Figure 1(b)) that decouples temporal and spatial feature extraction and renders the compres- sion and reduction of intermediate features more flexible. Along with plain stacking, a last-shot compression scheme is employed that retains only the last time-step slice of temporal features ex- tracted by T-operators. This scheme reduces the features that are fed to subsequent components with only minor information loss, as TCNs tend to capture the most significant features in the last time step [34]. The plain stacking and last-shot compression combine to considerably lower the computational and storage overheads of the subsequent S-operators as well as of the aggregation and output module. Considering both single-step and multi-step CTS forecasting, we conduct extensive experiments to evaluate LightCTS on six bench- mark datasets. We find that LightCTS achieves accuracy comparable to those of state-of-the-art models, but with much lower computa- tional and storage overheads. We have made our implementation publicly available1. The contributions of the paper are summarized as follows. • We propose LightCTS, a novel lightweight CTS forecasting frame- work. To the best of our knowledge, this is the first study of lightweight DL-based CTS forecasting. • We analyze the architectures, S/T-operators, and resource costs of mainstream CTS models, and identify key opportunities for achieving lightness. • We contribute L-TCN and GL-Former, two novel lightweight T- and S-operator modules, targeting the extraction of ST-features of CTS. We also propose a plain stacking pattern and a last-shot compression scheme, targeting a reduction of the sizes of the inputs to S-operators and the aggregation and output module. • We report on experimental findings for different tasks, offering evidence that LightCTS is capable of state-of-the-art accuracy while reducing computational costs and model sizes very sub- stantially. 1https://github.com/AI4CTS/lightcts 2 Table 1: Summary of notation. Notation X N T D P Q Description An indexed set of correlated time series (CTS) Number of time series in X Number of time steps in X Embedding size of S/T-operators Number of historical time steps used in CTS forecasting Number of future time steps of CTS forecasting Section 2 covers the definition of CTS and its forecasting tasks; Section 3 analyzes the commonalities of existing CTS models; Sec- tion 4 details the design of KDCTS; Section 5 reports on the experi- mental study; Section 6 covers related work on CTS forecasting and knowledge distillation of DL models; finally, Section 7 concludes and presents research directions. 2 PRELIMINARIES This section covers preliminaries of CTS and formalizes the problem of CTS forecasting. Frequently used notations are summarized in Table 1. 2.1 Correlated Time Series In a cyber-physical system [16], N devices each generate times- tamped data, yielding N time series. The time series are called cor- related time series (CTS) [60], denoted as X ∈ RN×T×F, where T and F denote the number of time steps and the number of sen- sor measurements per time step, respectively. For example, in a wind turbine farm consisting of 30 turbines, each turbine may emit wind speed and wind direction measurements at each time step; thus, if the system emits measurements for 500 time steps, we get X ∈ R30×500×2. Given the N time series, two kinds of correlations occur: tempo- ral correlations within time series and spatial correlations across different time series. On the one hand, consecutive measurements in a time series are naturally correlated. On the other hand, con- current measurements by different devices may be correlated due to, e.g., the spatial proximity of the devices. For example, traffic flows reported by sensors on connected road segments are naturally correlated [45, 60]. 2.2 CTS Forecasting Problems We consider single-step and multi-step CTS forecasting. First, single- step CTS forecasting aims to predict the Q-th future time step (Q ≥ 1); formally, ˆXt +P+Q ← SF (Xt +1, . . . , Xt +P), (1) where t indexes the beginning time step, P is the number of histor- ical time steps used for forecasting, ˆXt +P+Q denotes the predicted CTS at the future (t + P + Q)-th time step, and SF denotes a single- step CTS forecasting model. Next, multi-step CTS forecasting aims to predict Q (Q > 1) consecutive future time steps in one pass; formally, { ˆXt +P+1, . . . , ˆXt +P+Q} ← MF (Xt +1, . . . , Xt +P), where MF denotes a multi-step CTS forecasting model. (2) For both problems, it is essential to extract the temporal dynam- ics in each time series and the spatial correlations among different 3 time series from the historical data. To this end, deep learning (DL) techniques with powerful temporal and spatial feature extraction capabilities have been used widely in CTS models. A review of existing DL-based CTS models is provided in Section 6. Due to the characteristics of the neural network operators used to extract spatial and temporal features, the training and inferencing of DL- based CTS models incur considerable computational and storage overheads. In this study, we aim to enable lightweight CTS forecast- ing models (i.e., models with fewer computations and parameters) with forecasting accuracy comparable to the state-of-the-art CTS forecasting models. 3 ANALYSES AND DIRECTIONS In Section 3.1, we place existing DL-based CTS modeling proposals in a generic framework, map the complexity of their internal oper- ators, and investigate the computational and storage overheads of representative models. Based on this analysis, we identify directions for achieving a lightweight CTS framework in Section 3.2. 3.1 Analysis of Existing CTS Models 3.1.1 Generic Framework. To gain insight into the prospects of lightening DL-based CTS models, we consider representative pro- posals [4, 6, 8, 9, 13, 20, 21, 28, 36, 44, 46, 49, 60–62, 64, 65, 70]. Figure 1(a) shows a generic framework for these models. Generally, a CTS model has three components: (1) an embedding module that transforms the raw CTS into latent representations; (2) a stack of spatio-temporal blocks (ST-blocks) that extract spatial and tempo- ral correlations as high-order features; and (3) an aggregation and output module that aggregates ST-features from the ST-blocks and outputs the result, which is either a single-step or a multi-step forecast (see Section 2.2). Being responsible for extracting temporal and spatial correla- tions, ST-blocks make up the key component of a CTS model. Typi- cally, an ST-block includes alternating stacks of temporal operators (T-operators) and spatial operators (S-operators). For example, the alternate stacking pattern can be ⟨T , S⟩, ⟨S,T ⟩, ⟨T , S,T ⟩, etc. The S/T-operators are the basic ingredients for extracting comprehensi- ble features. S/T-operators. We proceed to study the S/T-operators em- 3.1.2 ployed by state-of-the-art models [4, 6, 8, 9, 13, 20, 21, 28, 36, 44, 46, 49, 60–62, 64, 65, 70]. Specifically, we analyze each operator's time complexity in terms of FLOPs (floating-point operations) and space complexity in terms of the number of model parameters. Referring to Table 2, we categorize popular S- and T-operators into different families based on the base operators that they extend. Consider- ing that there are only minor differences between the operators in a family (e.g., applying different attention mechanisms or con- volution kernels), we report on the time and space complexity of the base operators in Table 2. We refer interested readers to the supplemental material [2] for a detailed analysis of base operators. Three main T-operator families are identified: (1) CNN-based T-operators [8, 13, 21, 28, 46, 61, 62, 65], specifically Temporal Convo- lutional Networks (TCNs), that apply dilated causal convolutions to time series data; (2) RNN-based T-operators, such as long short term memory networks (LSTMs) [49] and gated recurrent unit networks (GRUs) [4, 6, 9, 13, 36], that process time series based on a recursive Table 2: Categorization and analysis of ST-block operators. Type Family Literature Time Complexity Space Complexity Table 3: Distribution of FLOPs and parameters in CTS mod- els. CNN RNN Transformer GCN Transformer [13, 21, 61, 62, 65] [8, 28, 46, 60] [4, 6, 9] [13, 36, 49] [44, 64] [60, 70] [21, 36, 60, 62] [8, 13, 46] [44, 64] [20, 60] O (D2 * N * P) O (D2 * N * P) O (D * N * P * (P + D)) O (D * N * P * (N + D)) O (D * N * P * (N + D)) r o t a r e p o - T r o t a r e p o - S O (D2) O (D2) O (D2) O (D2) O (D2) Embedding size D; time series number N; historical time steps P. mechanism; and (3) Transformer-based T-operators [44, 60, 64, 70] that adopt the attention mechanism to establish self-interactions of input time steps, enabling weighted temporal information ex- traction over long sequences. While all T-operator families have the same space complexity, the time complexity of the operators in the Transformer family is larger than those of the operators in the CNN and RNN families because of their large-size matrix multiplica- tion [60]. Further, although the RNN family operators have the same time complexity regarding FLOPs as the CNN family operators, the former adopt a sequential computation scheme that significantly reduces the actual efficiency. Thus, CNN-based T-operators are the most promising for lightweight CTS models. Recent TCN models, including GwNet [62], MtGnn [61], and Fogs [46], achieve the state-of-the-art accuracies. There are roughly two S-operator families: (1) GCN-based S- operators, specifically Chebyshev GCNs [8, 13, 21, 46] or Diffusion GCNs [36, 60, 62], utilize predefined or learned spatial adjacency ma- trices to capture high-order spatial correlations and (2) Transformer- based S-operators [20, 44, 60, 64] cast attention operations across different time series to obtain their weighted spatial correlations. Theoretically, GCNs and Transformers incur the same space and time complexities for S-operators (see Table 2). Moreover, no ex- isting studies compare their CTS forecasting performance in the same setting. We thus include experiments that compare these two S-operators in our LightCTS framework. The results, in Section 5.4 and Table 9, show that a Transformer-based S-operator achieves the best accuracy in our framework. FLOP and Parameter Use in CTS Models. To investigate the re- 3.1.3 source consumption of each component of CTS models, we analyze FLOPs and parameters via a case study. We select three representa- tives, namely Fogs [46] as the most accurate model, MtGnn [61] as the most lightweight model, and GwNet [62] as a widely used model. They are also all included for comparison in the experimen- tal study in Section 5. We select the METR-LA dataset (see Sec- tion 5.1.1) and use the architectures reported by the original papers. Table 3 shows the distribution of FLOPs and parameters associated with different components of CTS models, namely the embedding module, the T-operators and S-operators in the ST-component, and the aggregation and output module. As expected, a significant portion of FLOPs and parameters occur in the S- and T-operators that make up the core component of a CTS model. Moreover, S-operators consume many more FLOPs than T-operators. Surprisingly, the aggregation and output module is also responsible for many FLOPs and parameters. This is likely 4 Model Metric Input Embedding T- operators S- operators Aggregation and Output Fogs MtGnn GwNet FLOPs Parameters FLOPs Parameters FLOPs Parameters 0.01% 0.01% 0.12% 0.02% 0.03% 0.03% 2.13% 3.25% 23.54% 75.52% 6.70% 10.77% 95.72% 77.19% 70.19% 9.49% 75.23% 19.94% 2.15% 19.55% 6.15% 14.97% 18.04% 69.26% because the aggregation and output module has to process massive ST-features extracted by all ST-blocks. 3.2 Observations and Resulting Directions We highlight the main observations from the above analyses and identify promising directions for designing LightCTS. Observation 1. S- and T-operators, which make up the main com- ponent of CTS models (Section 3.1.1), incur significant computational and storage overheads (Table 3). Their time and space complexities are both proportional to D2 (Table 2). Observation 1 indicates that it is essential to lighten S- and T- operators. As presented in Table 2, the time and space complexities of all S/T-operators are positively correlated with N, P, and D2. The numbers of time series N and historical time steps P are decided by the raw CTS data and should be left unaltered in a CTS model. Therefore, manipulating the embedding size D of S/T-operators is a direction for achieving lightness. Many studies [9, 60, 61], however, have shown that simply reducing D inevitably degrades forecasting accuracy. Instead, we propose to simplify and reduce the neural net- work computations associated with D, to be detailed in Sections 4.2 and 4.4 for T- and S-operators, respectively. Observation 2. S-operators consume many more resources, espe- cially FLOPs, than T-operators (Table 3). One reason for Observation 2 is that S-operators usually have higher time complexity than T-operators (see Table 2). The complex- ity of S-operators can be reduced by manipulating D as discussed for Observation 1. Another major reason is that the input to S-operators must retain the temporal dimensions even if these contribute little to extracting spatial correlations. This is a consequence of the alter- nate stacking pattern of the existing generic CTS framework (see Section 3.1.1). Specifically, since executions of S- and T-operators in- termixed, some T-operators occur after S-operators. To allow such T-operators to properly extract temporal features, the temporal dimensions must be preserved. Although T-operators also receive redundant spatial information due to intermixing, S-operators are affected more due to their higher time complexity. Moreover, the spatial dimension N cannot be compressed as the aim is to forecast future values for all N time series. This observation suggests that a new stacking pattern of S/T- operators that compresses temporal features before applying S- operators. We thus propose to design a new stacking pattern that decouples T-operators and S-operators, to be detailed in Section 4.1. In addition, we devise a temporal feature compression scheme to condense the input feature maps for S-operators while preserving key temporal information to be used in the final forecasting, to be detailed in Section 4.3. As mentioned in Section 3.1.3, the aggrega- tion and output module takes all features extracted by ST-blocks as input, which incurs considerable FLOPs and parameters. As a by-product of the temporal feature compression, the intermediate T- and S-features can be downsized, which leads to a significant reduction in FLOPs and parameters for the aggregation and output module. 4 CONSTRUCTION OF LIGHTCTS We start by presenting the new plain stacking pattern in Section 4.1; next, we detail the light T-operator module in Section 4.2 and its subsequent last-shot compression in Section 4.3; we then present the light S-operator module in Section 4.4 and the assembly of LightCTS in Section 4.5. 4.1 Architecture with Plain Stacking As illustrated in Figure 1(a), the conventional CTS architecture relies on ST-blocks, each of which stacks S- and T-operators alternately. Such an alternate stacking pattern maintains a feature size of N×P×D throughout feature extraction. Indeed, the temporal dimension P is only considered in T-operators and is disregarded in S-operators. In other words, the output representation unnecessarily increases the computational and storage overheads of S-operators. We deviate from the alternate stacking pattern and instead com- bine a T-operator module consisting of LT T-operators and an S- operator module consisting of LS S-operators serially, yielding what we call the plain stacking scheme. Figure 1(b) presents the novel architecture, which enjoys several benefits. First, temporal and spa- tial feature extraction are decoupled, allowing compression of the temporal dimension before applying the more complex S-operators (see Observation 2). In particular, we propose a last-shot compression scheme (to be detailed in Section 4.3) that reduces the output size of temporal feature extraction from N × P × D to N × D. Moreover, the computational overhead of the aggregation and output module is also reduced by the feature compression. Indeed, the architecture further reduces costs by taking as input only the final features of the temporal and spatial feature extraction phases, instead of the features from all stacked ST-blocks in the conven- tional architecture. The plain stacking architecture does not lower the effectiveness of feature extraction but reduces computational costs, as will be shown in Section 5.4. To construct a specific LightCTS model using the new architecture, we design a light T-operator module L-TCN and a light S-operator module GL-Former, presented in Sections 4.2 and 4.4. 4.2 L-TCN 4.2.1 Background of TCN. We propose an Light Temporal Con- volutional Network (L-TCN) that is based on the Gated TCN [62], which incorporates the gating mechanism into standard TCNs to control the temporal information flow. A TCN adopts dilated causal convolutions (DCC) [55, 66] to capture both long- and short-term temporal patterns in a non-recursive fashion, thus alleviating the issue of gradient explosion in RNNs. Figure 2: A TCN with layers of (a) standard convolution (TCN), (b) group convolution (GTCN), and (c) shuffled group convolution (SGTCN). The TCN consists of three layers with dilation rates δ = {1, 2, 4} and the kernel size K = 2. Figure 2 (left) illustrates the basic structure of a standard TCN with three DCC layers. In Layer 1, a convolutional filter slides over the input without skipping any values in the filter (i.e., dilation rate δ = 1); in Layer 2, a convolutional filter that skips one value in the middle (i.e., δ = 2) is applied to the output of Layer 1; in Layer 3, convolutional operations are performed with three skipped values (i.e., δ = 4) in the filter. By stacking multiple DCC layers, a.k.a. TCN layers, with gradually increased dilation rates, a TCN T-operator module with exponentially enlarged receptive fields is built. As seen in Figure 2 (left), the receptive field of the last layer's rightmost node can cover the entire time series length of the input data, which implies that the plain stacking does not ignore important spatio- temporal correlations. With the raw input CTS X ∈ RN×P×F being embedded into the latent representation H ∈ RN×P×D by the embedding module, a TCN layer cast on H is formalized as follows. TCN(H | δ, K) = H ′, where ∑︁K−1 k=0 H ′[i; t; d] = (cid:0)H [i; t − δ × k; :] * W d [k; :](cid:1) is the d-th (d ∈ [0, D)) output feature map at time step t (t ∈ [0, P)) of the i-th (i ∈ [0, N)) time series, Wd ∈ RD×K is the d-th convolutional filter, and K (often as small as 2 or 3) and δ are the kernel size and dilation rate, respectively. To keep the temporal dimension of P constant in the output, zero padding is applied to the input of each layer [55]. 4.2.2 Lightening TCN. Previous studies [8, 61] show that directly reducing the embedding size D inevitably lowers the representation capability of the model, resulting in subpar accuracy. Therefore, we propose instead to lighten the standard TCN using a grouping strat- egy. This is motivated by observations of previous studies [63, 69] that a TCN has redundant connections between adjacent TCN lay- ers and thus can be optimized. Specifically, the standard TCN layer in Figure 2(a) has full connections between input and output feature maps, while the grouping strategy in Figure 2(b) first partitions the input TCN feature maps into GT equal-sized, consecutive, and non-overlapping groups, and then performs convolutions within the groups. A group TCN layer, i.e., a TCN layer with the grouping strategy, is represented as follows. GTCN(H | GT ) = concat({TCN(H j | δ, K)}GT j=1), GT ] ∈ RN×P× D where H j = [:, :, D×( j−1) : D×j GT is the j-th group of in- put feature maps and concat(*) denotes the concatenation operation. GT 5 Layer 2Layer 3zeropaddingt+1... ...t+P(a) standard convolution(b) group convolution(c) shuffled group convolutionLayer 1Inputgroup 1group 2group 1group 2laststeplaststeplaststep The time and space complexity of each group are O (cid:0)( D GT )2 *N*P(cid:1) and GT )2(cid:1), respectively. Therefore, the time and space complexity O (cid:0)( D of a group TCN layer with GT groups is O ( D2 GT * N * P) and O ( D2 GT ), respectively, which is 1 GT of the corresponding standard TCN. For example, in Figure 2(b), D = 4, input and output feature maps are split into GT = 2 groups, and each group consists of D/GT = 2 feature maps. The number of convolution filters is consequently reduced from D2 = 16 to D2/GT = 8. One drawback of the naive grouping strategy is the lack of in- formation exchange among groups. Thus, we propose to use a shuffled grouping strategy to support communications among fea- ture map groups. As depicted in Figure 2(c), shuffling allows group convolutions to obtain input from different groups, with one input feature map contributing to all groups. In the implementation, we stipulate that the number of feature maps in each input group is divisible by the number of output groups. The shuffling enhances the naive grouping strategy in a simple but effective way to enable inter-group communication without increasing model complexity. The group number GT is a model structure hyperparameter that controls the balance between the lightness of an L-TCN and its capacity to extract temporal information. Intuitively, a larger GT improves L-TCN's lightness but reduces its capacity. Therefore, it is important to tune GT . First, GT belongs to a small set of candidate values because it can only be a factor of the embedding size (e.g., {2, 4, 8, 16, 32} for D = 64). Therefore, we employ grid search on the small number of candidates to maximize GT while maintain- ing nearly state-of-the-art accuracy. Alternatively, it is possible to search for an optimal GT more efficiently by applying advanced multi-objective hyperparameter optimization approaches [41], such as multi-objective Bayesian optimization. The group number tuning discussed here also applies to the grouping techniques we use in other modules. The effect of varying GT is studied empirically in Section 5.3.2. Following previous studies [60, 62], we adopt the gating mech- anism to decide the ratio of temporal information extracted by a shuffled group TCN layer to flow through the model. Thus, an L-TCN layer is given as follows. L-TCN(H ) = tanh(SGTCNo (H | GT )) ⊙ σ (SGTCNg (H | GT )), where SGTCNo and SGTCNg are two parallel shuffled group TCN branches: the former extracts temporal features and the latter con- trols the ratio at which the features are passed along. The gating ratio is achieved by the sigmoid function σ (*) and is applied to every temporal feature element by the element-wise product ⊙. To sum up, an L-TCN layer reduces the time and space complex- GT of the standard TCN's counterpart, i.e., to O ( D2 ities to 1 GT * N * P) and O ( D2 GT ), respectively. So far, the output feature map is of size N × P × D. We proceed to present a last-shot compression scheme to reduce the input size for subsequent S-operators. 4.3 Last-shot Compression Inspired by the success of residual connections [24], popular CTS models aggregate the features from every ST-block to get the output. The bottom left corner of Figure 3 illustrates how such a classical ag- gregation scheme is applied to the L-TCN. In particular, the features Figure 3: Feature aggregation after last-shot compression vs the classical feature aggregation [60] (bottom left). extracted by each L-TCN layer are summed to obtain an aggregated feature tensor of shape N × P × D, with the temporal dimension P preserved for subsequent spatial feature extraction. If we are able to compress the temporal features extracted by each L-TCN layer, the computational overheads of the following S-operators and the aggregation and output module will be reduced. Note that these two components are both costly (see Table 3). To achieve this, we propose a simple but effective mechanism, named last-shot compression. The idea comes from the intuition that more distant temporal features are less important for the forecast at the current moment [5, 14, 54]. To put it simply, last-shot compres- sion retains only the features at the most recent time step as the output of each L-TCN layer. An illustration is given in Figure 2 (left), where the rightmost snippets of each layer's output (corresponding to the last time step) are extracted and summed as the input to the subsequent components. One concern may be that such aggressive compression will com- pletely lose the information from the previous (P − 1) time steps of the input feature map. This is not so because the stacking of dilated convolutions by L-TCNs ensures that the last time step feature of each layer preserves information from several most recent input time steps at different ranges. For example, in Figure 2 (left), the last time step feature from Layer 1 captures the 7th and 8th input time steps, while that from Layer 2 captures the 5th to the 8th input steps, and that from Layer 3 captures all eight input time steps. Hence, if we aggregate only the last time step feature of each L- TCN layer, we still perceive the full input, but focus more on recent input time steps while performing higher compression on more distant input time steps. The ablation study in Section 5.4 shows that this last-shot compression achieves impressive cost reductions while maintaining model accuracy. The last-shot compression and the following feature aggregation are illustrated in Figure 3. Let Hb ∈ RN×P×D be the output feature of the b-th (1 ≤ b ≤ LT ) L-TCN layer, and let Ob = Hb [:, P − 1, :] ∈ RN×1×D be the last-step feature of Hb . The aggregation sums the Ob . The aggregated last-step features of all layers, i.e., H = (cid:205)LT b=1 feature H is then sent to a squeeze and excitation (SE) module [27] for attentive feature representation: HT = H * σ (Ws2 * ReLU(Ws1 * H ◦)), (3) 6 EmbeddingL-TCN Layer L-TCN Layer ...O!∈R"×!×$H%∈R"×$H!∈R"×$×%X∈R"×$×&H'H(!O&...O')H"∈R#×%×&H'H(!...SumSumH)∈R#×%×&Squeeze and Excitation (SE) where H ◦ = GlobalAvgPool(H ) ∈ RD is achieved through the global average pooling [27], and HT ∈ RN×D is the final temporal feature. Given the reduction ratio r in the SE module, Ws1 ∈ R D r ×D and Ws2 ∈ RD× D r are weight matrices to squeeze the representation that in turn is rescaled back to produce attentions with a sigmoid function σ (*) over the original, aggregated feature H . Compared to the classical aggregation scheme that leads to the feature size of N × P × D, the last-shot compression achieves the feature size of N × D with the temporal dimension having been flattened from P to 1. Despite this reduction, the gradually enlarged receptive field of L-TCN (see Section 4.2.1) ensures that the last- shot compression upon L-TCN can obtain the temporal features across all time steps. This property enables further extraction of spatial correlations over time. The space and time complexities of the subsequent spatial feature extraction are thus reduced by a factor of 1/P. 4.4 GL-Former 4.4.1 Background and Overall Design. Transformers occur in many state-of-the-art CTS forecasting models [44, 60, 64, 70]. Aiming for light yet effective S-operators, we propose a GlobalLocal Trans- Former (GL-Former) module that aims to extract both global-scale and local-scale spatial correlations among different time series. This way, GL-Former eliminates the exhaustive global-scale spatial corre- lation extraction seen in the standard Transformer [56]. We proceed to give preliminaries of the standard Transformer and then detail the GL-Former design that targets accuracy and lightness. A standard Transformer consists of an encoding layer and Ls attention blocks. Given the input HT ∈ RN×D generated by the last- shot compression scheme (see Equation 3), a positional encoding mechanism (PE) [56] is introduced to the encoding layer. The reason is that by default, Transformers' self-attention operations are unable to interpret the permutations of the input nodes. Specifically, the encoding layer converts HT to a learned positional encoding H PE by incorporating the identity information of CTS nodes: H PE = HT + WPE, where WPE ∈ RN×D is a learnable matrix capturing the identity information. The resulting encoding H PE is fed to sequential atten- tion blocks, each of which consists of a multi-head attention (MHA) layer and a feed-forward network (FFN) layer. An MHA layer is a concatenation of h repeated self-attention modules (heads) in parallel: MHA(H PE) = concat({headi (H PE)}h i=1) headi (H PE) = softmax (cid:0)H I(cid:1) * Vi H I = (Qi * K T i )/√︁D/h Q V K i , Vi = HPE * W i , Ki = H PE * W Qi = H PE * W i , (4) (5) (6) (7) i ∈ RD× D where all learnable matrices W∗ h are used to convert the embedding size from D to D/h. In Equation 5, each head headi (*) is a self-attention module that produces attention scores for its input H PE ∈ RN×D by making the input interact with itself. MHA provides impressive power to encode multiple relationships. Figure 4: An example of GL-Former consisting of LS alter- nating global attention blocks and local attention blocks. An FFN layer merges the output H MHA ∈ RN×D of Equation 4 and provides non-linear activations via two fully-connected layers: FFN(H MHA) = FFN(1) (H MHA) * W2 + b2 (8) , W2 ∈ RD′×D, b1 ∈ RD′ FFN(1) (H MHA) = ReLU(H MHA * W1 + b1), (9) where W1 ∈ RD×D′ , and b2 ∈ RD are learn- able matrices and biases. The two layers first enlarge the embedding size from D to D′, which is typically a quadruple of D [56], and then scale it back to D. The feature generated by the (LS )-th attention block is the final output of the Transformer, i.e., H S . A standard attention block introduced above consists of an MHA and an FFN layer and captures global-scale spatial correlations among all CTS nodes. Although using global attention blocks yields powerful feature extraction capabilities, a model that learns such complicated information can be quite hard to train. Injecting prior knowledge into the model is a sensible way to increase model training efficiency, as the model does not need to extrapolate the knowledge from the data itself. Further, the prior knowledge may offer more information beyond the training data, thus helping to regularize the model and prevent overfitting [57]. Specifically, in our problem setting, using prior knowledge in the data, such as the explicit spatial proximity information of CTS nodes (modeled as an N-by-N adjacency matrix), we can focus on extracting correlations for only those pairs of nodes that are potentially relevant and can omit computations for other pairs. This kind of attention block, which we call a local attention block, is detailed in Section 4.4.2. As shown in Figure 4, an example GL-Former is a sequence of alter- nating global and local attention blocks. The alternation combats the information loss on local attentions. Note that the numbers of global and local attention blocks are not necessarily the same. For example, one global attention could be followed by two local attentions. In addition, we adopt the grouping strategy to ease the computations of the MHA and FFN layers in attention blocks, to be detailed in Section 4.4.3. 4.4.2 Local Attention Block. The computation of a local attention follows that of a global attention (Equations 4 to 7), except that a mask function is applied in Equation 6 to retain pairs of relevant nodes. Specifically, the mask function mask(Z, M) hides an element Z [i, j] in the feature matrix Z if element M [i, j] of the mask matrix is false; formally, Z [i, j] = (cid:40)Z [i, j], −∞, if M [i, j] is true otherwise 7 LSMask ML-MHAL-FFNL-MHAL-FFNGlobalAttentionHTHPELocalAttentionHSWPEPositionalEncoding⊕... A hidden value is set to −∞ because the masked feature matrix is sent to a softmax(*) function (see Equation 5). Besides, a domain may be associated with several adjacency matrices. For example, one adjacency matrix may capture the correlations in terms of the distance between a pair of nodes, while another may capture the correlations in terms of the data dependency between nodes. In this setting, we obtain mask matrix M by aggregating all relevant adjacency matrices of the domain, i.e., M = (cid:205)i Ai , where Ai is one of the adjacency matrices. Notably, Ai is a sparse adjacency matrix thresholded by a filtering function [62], which reduces the impact of noise and makes the model more robust [8]. With the mask function, the variable H I in Equation 6 is calcu- lated as follows for a local attention block. H I = mask (cid:0)(Qi * K T i )/√︁D/h, M(cid:1) (10) 4.4.3 L-MHA and L-FNN. We propose the light MHA (L-MHA) that adopts a grouping strategy similar to the one proposed for L-TCN in Section 4.2. The input encoding H PE of L-MHA is first partitioned into GM groups, and then the original MHA (see Equa- (1 ≤ j ≤ GM ). The L-MHA is tion 4) is applied to each group H PE j given as follows. L-MHA(H PE) = concat({MHA(H PE j D × ( j − 1) GM )}GM j=1), where D × j GM ] : H PE j = H PE [:, We apply multi-head attention with the same number h of heads for ) is of size N × D each partitioned group. The output of MHA(H PE GM , and the final output of L-MHA is of size N × D, the same as the standard MHA in Equation 4. Still, the time and space complexities of L-MHA are a fraction 1/GM of those of the standard MHA. j Likewise, we implement a light FFN (L-FFN) that partitions the input features into GF groups. We only apply the grouping strategy to the second layer of an original FFN (see Equation 8) and the computation in the first layer remains as shown in Equation 9. The first layer FFN(1) encapsulates the only non-linear activation in an attention block, and lightening it will reduce accuracy considerably. As a result, L-FFN is processed as follows. L-FFN(H MHA) = concat({FFN(H MHA j D × ( j − 1) GF = H MHA [:, H MHA j , where )})GF j=1 D × j GF ] : As only the second FFN layer is lightened, the complexity of L-FFN is (1 + 1/GF )/(1 + 1) as the case for the standard FFN coun- terpart. 4.5 Assembling LightCTS We compose LightCTS using the plain stacking architecture from Figure 1(b) and using the proposed light T- and S-operator modules (i.e., L-TCN and GL-Former). In particular, we use one CNN layer to implement the embedding module and configure the aggregation and output module with two fully-connected layers: o o o o ˆY = ReLU((H S + HT ) * W 2 + b 1 ) * W 1 + b 2 , where ˆY ∈ RN×L is the forecast result, L = 1 or Q denotes the forecast dimension depending on whether single-step or multi-step forecasting is performed; HT and H S are the output features of the last-shot compression and GL-Former, respectively; and Wo o o 2 are learnable matrices and biases. 1 , and b b Finally, we follow previous work [46, 60, 62] and employ mean 1 , Wo 2 , absolute error (MAE) as the loss function. It should be noted that this simple plain stacking architecture does not lower the effectiveness of feature extraction. The key rea- son is twofold: 1) the last-shot compression (detailed in Section 4.3) with the proposed T-operator module L-TCN (detailed in Section 4.2) are able to emphasize the most recent timestep's features and to reduce the noise in feature maps, thus improving the subsequent spatial feature extraction; and 2) the proposed S-operator module GL-Former (detailed in Section 4.4) addresses both local and global- scale spatial correlations. By considering adjacency matrices in the attention block through a mask, GL-Former can capture the prior knowledge of spatial correlations, which the standard Transformer is unable to do, thus enhancing the capability of spatial feature extraction. We report on empirical studies in Section 5.4 that offer evidence of the effectiveness of the proposed last-shot compression, GL-Former, and plain stacking. 5 EXPERIMENTS We evaluate LightCTS on both multi-step and single-step CTS forecasting tasks. We include many commonly-used benchmark datasets, four for multi-step forecasting (two on traffic flow fore- casting and two on traffic speed forecasting) and two for single-step forecasting. These benchmarks are associated with different accu- racy metrics. To enable direct and fair comparisons, we use the metrics employed in the original papers. The code and datasets are made available [2]. 5.1 Multi-Step Forecasting 5.1.1 Datasets. • PEMS04 [50] is a traffic flow dataset collected from 307 sensors on 29 roads in San Francisco Bay Area during January – March 2018. The traffic flow ranges from 0 to 919 with a mean of 91.74. • PEMS08 [50] is a traffic flow dataset collected from 170 sensors on 8 roads in San Bernardino during July – September 2016. The traffic flow ranges from 0 to 1,147 with a mean of 98.17. • METR-LA [36] contains traffic speed data in mph gathered dur- ing March – June 2012 from 207 loop detectors, from the road network of Los Angeles County. The speed ranges from 0 to 70 mph with a mean of 53.98 mph. • PEMS-BAY [36] is a traffic speed dataset gathered from 325 loop detectors in the road network in the San Francisco Bay Area. The speed ranges from 0 to 85.1 mph with a mean of 62.62 mph. The sampling interval of each dataset is 5 minutes. The datasets are organized and split (i.e., in train:validation:test) as in previous studies [60, 62]. The statistics are summarized in Table 4. Table 4: Dataset statistics for multi-step forecasting. Dataset Data type Split Ratio N T P Q PEMS04 PEMS08 METR-LA PEMS-BAY Traffic flow Traffic flow Traffic speed Traffic speed 307 170 207 325 16,992 17,856 34,272 52,116 12 12 12 12 12 12 12 12 6:2:2 6:2:2 7:1:2 7:1:2 5.1.2 Metrics. We consider accuracy and lightness as follows. 8 • Accuracy Metrics. Following existing multi-step forecasting studies [36, 60, 62, 65], we use mean absolute error (MAE), root mean squared error (RMSE), and mean absolute percentage error (MAPE) to measure accuracy comprehensively. The three met- rics capture the forecasting accuracy from different perspectives: MAE gives equal weights to all errors, RMSE focuses on the most severe errors, and MAPE highlights the errors when ground truth values are small. Lower MAE, RMSE, and MAPE indicate higher forecasting accuracy. • Lightness Metrics. Consistent with the existing conventions [26, 69] and to eliminate the influence of different DL platforms and operating system conditions (e.g., multiple concurrent run- ning programs), we evaluate the lightness of CTS forecasting models using FLOPs and the number of parameters2 considered during inferencing. This accords with existing studies [35, 53, 69]. In addition, we report the latency and peak memory use (ab- breviated as Peak Mem) of models during inferencing on a low- computational-resource device (see Section 5.1.4). The results are for practical reference and will vary depending on hardware, software, implementation, and other factors. 5.1.3 CTS Forecasting Models for Comparisons. All models are implemented using their original code; and if using the same dataset, we report the original results. • DcRnn [36]. A relatively early DL-based model that adopts diffu- sion GCNs and GRUs for S- and T-operators, respectively. • GwNet [62]. A widely used benchmark model that integrates adaptive GCNs and TCNs for S- and T-operators, respectively. • AgCrn [4]. A comprehensive but costly model that considers dynamic spatial correlations through different time steps. • MtGnn [61]. A successor of GwNet with new graph learning layers and an optimized overall structure. • AutoCts [60]. An automated framework that allows heteroge- neous ST-blocks with different S/T-operators and their connec- tions through automatic search. • EnhanceNet [13]. A framework that uses distinct filters for each time series and dynamic adjacency matrices to capture spatial correlations over time. TCNs are used to implement T-operators. • Fogs [46]. A recent model uses first-order gradients to avoid fitting irregularly-shaped distributions. • AutoCts-KDf/AutoCts-KDp. We construct two compressed variants of AutoCts3 using knowledge distillation (KD) for re- gression tasks [52]. Specifically, AutoCts-KDf and AutoCts- KDp are compressed to have nearly the same numbers of FLOPs and parameters as LightCTS. Implementation Details. All models are trained on a server 5.1.4 with an NVIDIA Tesla P100 GPU. To investigate models' inferencing performance in constrained computing environments, we employ an X86 device with a 380 MHz CPU. The L-TCN has (LT = 4) layers with the dilation rate δ of each layer set to [1, 2, 4, 8] to ensure that the receptive field of the last layer can cover the entire time series length of the input CTS. The GL-Former has (LS = 6) attention blocks for METR-LA and PEMS- BAY, and LS = 4 for PEMS04 and PEMS08. The stacking pattern is 2FLOPs and parameter counts are captured by Fvcore [1] from Facebook Research. 3AutoCts is selected as the teacher model for compression as it generally achieves the highest effectiveness among all competitor methods in our study. one global block followed by one local block, as shown in Figure 4. Following parameter tuning, we set the embedding size D = 48 for METR-LA, D = 64 for the other three datasets. For all datasets, the group numbers GT = 4, GM = GF = 2, and the reduction ratio r of the SE module is set to 8. We adopt the Adam optimizer with a learning rate of 0.002 to train models for 250 epochs. 5.1.5 Overall Comparisons. Following existing conventions for di- rect and fair comparison [46, 60, 61], we report the average accuracy over all 12 future time steps for the PEMS04 and PEMS08 datasets and report the accuracy at the 3rd, 6th, and 12th time steps for the METR-LA and PEMS-BAY datasets. Tables 5 and 6 show the results for both the accuracy and lightness measures. In this section, the best results are in bold, and the second-best results are underlined. Considering accuracy on PEMS04 and PEMS08 datasets, Table 5 shows that LightCTS achieves the best MAE and RMSE results and ranks second regarding MAPE. Although Fogs achieves the best MAPE on both datasets, it is only marginally better than LightCTS (less than 0.1%), and its MAE and RMSE rank only around 4th among all models. The accuracy results on METR-LA and PEMS- BAY datasets in Table 6 show that LightCTS achieves the best MAE, at least the second-best MAPE, and a competitive RMSE (top-3 in most cases). While LightCTS does not always rank in the top-3 in terms of RMSE, it is only negligibly below. For example, for the 15th-minute forecast on METR-LA dataset, LightCTS achieves an RMSE of 5.16 to rank 4th, while the top-3 models achieve 5.11, 5.14, and 5.15; the maximum margin is only 0.05, corresponding to a speed of 0.05 mph traffic speed. Given that there are always fluctuations across real-world datasets, such a small performance difference is insignificant. Considering lightness, Tables 5 and 6 show that LightCTS has significantly fewer FLOPs and model parameters and achieves lower latency and peak memory use than all other models, with the excep- tion that AgCrn achieves slightly fewer parameters and lower peak memory use on PEMS08 dataset. However, AgCrn is much less accurate. LightCTS clearly uses fewer resources than the two most accurate competing models, EnhanceNet and AutoCts (e.g., less than 1/6 and 1/10 FLOPs), while maintaining comparable accuracy. Besides, although KD [52] enables creating the AutoCts-KDf and AutoCts-KDp models that have FLOPs and parameter counts comparable to those of LightCTS, their effectiveness metrics are significantly lower, as seen in Tables 5 and 6. In summary, LightCTS offers substantially reduced computa- tional and storage overheads while providing top-tier accuracy at multi-step CTS forecasting. LightCTS thus offers unique value be- cause it enables CTS forecasting with no accuracy penalty using limited resources, which are often found in real-world applications. In addition, it also lowers costs when deployed in non-constrained settings, such as servers. 5.2 Single-Step Forecasting 5.2.1 Datasets. • Solar-Energy [32] contains records of solar power production in megawatt-hour (MWh) collected from 137 photovoltaic plants in Alabama during 2006. The records range from 0 to 88.9 MWh with a mean of 6.4 MWh. The sampling interval is 10 minutes. 9 Table 5: Accuracy and lightness comparison for multi-step traffic flow forecasting. Data Models FLOPs (unit: M) Params (unit: K) Latency (unit: s) Peak Mem (unit: Mb) MAE RMSE MAPE 4 0 S M E P 8 0 S M E P DcRnn GwNet AgCrn MtGnn AutoCts EnhanceNet Fogs AutoCts-KDf AutoCts-KDp LightCTS DcRnn GwNet AgCrn MtGnn AutoCts EnhanceNet Fogs AutoCts-KDf AutoCts-KDp LightCTS 3739 1277 3936 393 2043 969 5936 196 1278 147 2070 479 726 153 808 365 1949 100 485 70 371 311 749 547 368 283 2366 17 186 185 371 309 150 352 366 275 1294 22 181 177 22.9 4.8 9.5 5.3 5.2 4.2 14.6 3.0 4.4 1.1 14.9 1.0 3.2 2.7 3.7 1.7 6.6 1.3 1.9 0.4 8.1 6.8 19.2 12.1 7.8 6.0 42.9 5.3 6.8 4.7 4.8 4.0 2.6 4.6 4.7 3.8 14.2 3.3 4.0 2.8 24.70 19.16 19.83 19.32 19.13 19.11 19.34 25.17 22.83 38.12 30.46 32.26 31.57 30.44 30.34 31.20 38.85 35.21 17.12% 13.26% 12.97% 13.52% 12.89% 14.33% 12.71% 17.06% 15.55% 18.79 30.14 12.80% 17.86 15.13 15.95 15.71 14.82 14.82 14.92 19.47 16.89 27.83 24.07 25.22 24.62 23.64 23.60 24.09 30.26 26.40 11.45% 10.10% 10.09% 10.03% 9.51% 9.58% 9.42% 13.77% 11.08% 14.63 23.49 9.43% • Electricity [32] contains records of electricity consumption in kilowatt-hour (kWh) for 321 clients in Portugal during 2012 – 2014. The values range from 0 to 764,000 kWh, with an average of 2,514 kWh. The sampling interval is 15 minutes. The data organization and data splitting follow existing work [60, 61]. Dataset statistics are summarized in Table 8. Table 8: Dataset statistics for single-step forecasting. Dataset Split Ratio T P Q N Solar-Energy Electricity 137 321 52,560 26,304 168 168 {3, 6, 12, 24} {3, 6, 12, 24} 6:2:2 6:2:2 5.2.2 Metrics. We use the same lightness metrics as the multi-step forecasting task. We use root relative squared error (RRSE) and correlation coefficient (CORR) to measure forecasting accuracy, which are the conventional metrics used in single-step CTS fore- casting [6, 8, 60]. Specifically, RRSE indicates how well a model performs w.r.t. the average of the true values, while CORR measures the strength of the linear correlation between the forecast results and the true values. The more accurate the model, the lower the RRSE and the higher the CORR. 5.2.3 CTS Models in Comparisons. We include two CTS models that are specifically designed for single-step forecasting: • DsaNet [29]. A dual self-attention network for multivariate time series forecasting. • MaGnn [8]. A multi-branch model that extracts temporal features at different time scales. In addition, we include MtGnn [61] and AutoCts [60] (see Sec- tion 5.1.3) as they also support single-step forecasting. We use the settings that achieve the best accuracy for the comparison models; or if using the same dataset, we report their original results. Implementation Details. To build LightCTS for single-step 5.2.4 forecasting, we do almost the same as for multi-step forecasting. The differences are as follows. According to parameter tuning, we set D = 32 for the Solar-Energy dataset and D = 24 for the Electricity dataset, and we set the dilation rates in the (LT = 8) L-TCN layers 10 to [1, 2, 4, 8, 16, 32, 48, 64]. We adopt a GL-Former with (LS = 2) attention blocks (i.e., one global attention followed by one local attention). We adopt the Adam optimizer with a learning rate of 0.0005 to train models for 100 epochs. 5.2.5 Overall Comparisons. Table 7 shows the results on Solar- Energy and Electricity datasets. In accordance with existing re- search [8, 61], we report single-step forecasting results for the 3rd, 6th, 12th, and 24th future time steps. We observe similar trends as for multi-step forecasting. In terms of accuracy, LightCTS achieves the best performance on most of the comparison items, and it is very competitive on the others. Next, LightCTS is the most lightweight model with far fewer FLOPs and parameters than all competitors. For example, LightCTS uses less than 1/10 (resp. 1/3) FLOPs than AutoCts (resp. MaGnn). In addi- tion, LightCTS has the lowest latency and peak memory use among all baselines. LightCTS's low requirement of computing resource means a great potential to be deployed in resource-constrained environments. 5.3 Parameter Study We study systematically the impact of key LightCTS hyperparam- eters, including the embedding size D, the group number GT of L-TCN, and the attention block number LS of GL-Former. These hy- perparameters are selected as they are adjustable and affect model performance noticeably. We summarize the results in Figures 5 and 6 for multi-step forecasting on PEMS08 and single-step forecasting on Solar-Energy, respectively. We report the results on the other datasets in the supplemental material [2]. Impact of Embedding Size D. Figure 5(a) shows the impact 5.3.1 of D on model accuracy and lightness of single-step forecasting on the PEMS08 dataset. Both the FLOPs and number of parameters increase steadily as D increases, and so do the latency and peak memory use. Considering accuracy, as D grows from 32 to 64, MAE, RMSE, and MAPE decrease moderately. However, when D goes up from 64 to 80, the forecasting errors increase slightly. The reason may be that a smaller D restricts the model's ability to extract ST-features, while a larger D may introduce redundancy into the model and make it difficult to train, and can lead to overfitting. In Figure 6(a), the single-step forecasting exhibits similar trends as the multi-step counterpart. The FLOPs and number of parameters increase while the forecasting errors drop first and climb up afterwards. The results are consistent with those of existing studies [8, 61]- directly cutting the embedding size to a small value inevitably re- duces model accuracy. Thus, a new design for manipulating D, such as our L-TCN and GL-Former, is effective at enabling lightweight and accurate CTS forecasting models. Impact of Group Number GT . We further investigate the im- 5.3.2 pact of the group number GT of L-TCN on the performance and lightness of LightCTS. This parameter controls the tradeoff be- tween L-TCN's capacity for temporal information extraction and its lightness. The multi-step forecasting results in Figure 5(b) show that when GT =4, the evaluation errors reach a minimum that is below the Table 6: Accuracy and lightness comparison for multi-step traffic speed forecasting. Data Model FLOPs (unit: M) Params (unit: K) Latency (unit: s) Peak Mem (unit: Mb) MAE 15 mins RMSE MAPE MAE 30 mins RMSE MAPE MAE 60 mins RMSE MAPE A L - R T E M Y A B - S M E P DcRnn GwNet AgCrn MtGnn AutoCts EnhanceNet Fogs AutoCts-KDf AutoCts-KDp LightCTS DcRnn GwNet AgCrn MtGnn AutoCts EnhanceNet Fogs AutoCts-KDf AutoCts-KDp LightCTS 2521 658 2453 208 1090 648 2858 95 595 71 5386 1408 4224 432 2295 1442 6608 218 1431 208 436 309 748 405 366 453 1524 15 155 133 436 312 749 573 369 474 2551 18 248 236 16.4 1.7 7.5 3.9 2.8 2.6 7.4 1.6 2.2 0.3 22.6 3.7 10.1 7.6 5.9 5.4 16.3 3.4 4.4 1.2 13.6 8.9 22.6 11.9 11.4 13.4 45.9 5.9 7.1 5.6 13.8 10.3 22.7 19.2 11.9 14.2 76.5 9.5 10.4 9.2 2.77 2.69 2.83 2.69 2.67 2.69 2.72 3.04 2.78 2.67 1.38 1.30 1.35 1.32 1.30 1.33 1.38 1.42 1.38 1.30 5.38 5.15 5.45 5.18 5.11 5.14 5.20 5.80 5.21 5.16 2.95 2.74 2.83 2.79 2.71 2.81 2.91 2.92 2.85 2.75 7.30% 6.90% 7.56% 6.86% 6.80% 6.93% 7.05% 8.49% 7.33% 6.82% 2.90% 2.73% 2.87% 2.77% 2.69% 2.80% 2.94% 2.95% 2.87% 2.71% 3.15 3.07 3.20 3.05 3.05 3.06 3.12 3.57 3.18 3.03 1.74 1.63 1.69 1.65 1.61 1.64 1.73 1.78 1.72 1.61 6.45 6.22 6.55 6.17 6.11 6.10 6.30 7.03 6.23 6.16 3.97 3.70 3.81 3.74 3.62 3.72 3.93 4.02 3.82 3.65 8.80% 8.37% 8.79% 8.19% 8.15% 8.29% 8.60% 10.49% 9.00% 8.11% 3.90% 3.67% 3.84% 3.69% 3.55% 3.65% 3.97% 3.99% 3.86% 3.59% 3.60 3.53 3.58 3.49 3.47 3.49 3.64 4.19 3.64 3.42 2.07 1.95 1.96 1.94 1.89 1.93 2.09 2.11 2.06 1.89 7.60 7.37 7.41 7.23 7.14 7.23 7.61 8.34 7.28 7.21 4.74 4.52 4.52 4.49 4.32 4.47 4.71 4.82 4.62 4.32 10.50% 10.01% 10.13% 9.87% 9.81% 9.96% 10.62% 12.73% 10.97% 9.46% 4.90% 4.63% 4.67% 4.53% 4.36% 4.51% 4.96% 5.06% 4.73% 4.39% Table 7: Accuracy and lightness comparison for single-step CTS forecasting. Data Model FLOPs (unit: M) Params (unit: K) Latency (unit: s) Peak Mem (unit: Mb) 3-th 6-th 12-th 24-th RRSE CORR RRSE CORR RRSE CORR RRSE CORR y g r e n E - r a l o S y t i c i r t c e l E DsaNet MtGnn MaGnn AutoCts AutoCts-KDf AutoCts-KDp LightCTS DsaNet MtGnn MaGnn AutoCts AutoCts-KDf AutoCts-KDp LightCTS 914 1090 492 2237 418 1196 169 2262 4800 2215 8740 1858 3937 239 6377 348 105 91 12 41 38 6377 362 120 95 16 33 27 0.8 0.5 0.4 1.1 0.4 0.7 0.2 1.2 1.5 0.8 3.2 1.8 2.3 0.4 32.5 9.9 9.2 17.6 9.2 13.4 8.6 53.9 21.4 20.3 21.3 12.4 17.3 0.1822 0.1778 0.1771 0.1750 0.1802 0.1785 0.9842 0.9852 0.9853 0.9853 0.9834 0.9844 0.2450 0.2348 0.2361 0.2298 0.2463 0.2371 0.9701 0.9726 0.9724 0.9763 0.9696 0.9736 0.3287 0.3109 0.3105 0.2957 0.3332 0.3288 0.9444 0.9509 0.9539 0.9566 0.9403 0.9435 0.4389 0.4270 0.4108 0.4143 0.4277 0.4196 0.8943 0.9031 0.9097 0.9097 0.9021 0.9043 0.1714 0.9864 0.2202 0.9765 0.2955 0.9568 0.4129 0.9084 0.0855 0.0745 0.0745 0.0743 0.0818 0.0764 0.9264 0.9474 0.9476 0.9477 0.9292 0.9442 0.0963 0.0878 0.0876 0.0865 0.0949 0.0899 0.9040 0.9316 0.9323 0.9315 0.9148 0.9275 0.1020 0.0916 0.0908 0.0932 0.1003 0.0934 0.8910 0.9278 0.9282 0.9247 0.9007 0.9188 0.1044 0.0953 0.0963 0.0947 0.1018 0.0983 0.8898 0.9234 0.9217 0.9239 0.8935 0.9071 10.0 0.0736 0.9445 0.0831 0.9343 0.0898 0.9261 0.0952 0.9215 value for GT =1, i.e., the standard TCN without grouping. This im- plies that our grouping strategy can remove redundant connections without compromising forecasting accuracy. However, due to infor- mation loss, the evaluation errors increase substantially when the group size is increased to 8. A similar pattern is seen for single-step forecasting in Figure 6(b), where the best accuracy is also obtained when GT =4. Further, additional experiments show that similar patterns ap- pear for the other group number hyperparameters, namely GM and GF . For brevity, we report on these experiments in the supplemental material [2]. Impact of Attention Block Number LS in GL-Former. LightCTS 5.3.3 supports an elastic number of attention blocks in GL-Former. Hence, it is of interest to understand how the GL-Former attention block number LS affects accuracy and lightness. The number LT of L-TCN layers is also tunable, with its value being relevant to the input time series P for producing sufficient receptive fields. We thus focus on varying and testing the attention block number LS . As shown in Figures 5(c) and 6(c), for both multi-step and single- step forecasting, as GL-Former goes deeper (i.e., larger LS ), the evaluation errors first decrease and then increase. This happens because although deeper models can theoretically better extract information, they are prone to overfitting or hard to train [57]. Notably, in Figure 6(c), since the T-operators consume a dominant proportion of FLOPs due to the large input length (P = 168) of time series, the overall FLOPs and peak memory use of LightCTS increase only slightly when LS is increased. 5.4 Ablation Study We conduct an ablation study on PEMS08 dataset to understand the contribution of each component in LightCTS. Specifically, we implement a group of LightCTS variants by removing one of the lightweight components and observe the impact on both accuracy and lightness. The variants include: • LightCTS\T that substitutes the L-TCN with the standard TCN as the T-operator module. 11 Figure 5: Impact of (a) embedding size D, (b) group number GT , and (c) attention block number LS in GL-Former for multi-step forecasting on PEMS08 dataset. Figure 6: Impact of (a) embedding size D, (b) group number GT , and (c) attention block number LS in GL-Former for single-step forecasting on Solar-Energy dataset. Table 9: Ablation study on PEMS08. Refer to Section 5.4 for the details of the models. Model LightCTS LightCTS\T LightCTS\LS LightCTS\M LightCTS\F LightCTS\LA LightCTS-A LightCTS-CGCN LightCTS-DGCN FLOPs (unit: M) Params (unit: K) Latency (unit: s) Peak Mem (unit: Mb) 70 149 390 75 75 70 390 53 95 177 226 285 239 238 177 285 74 154 0.4 0.5 0.6 0.5 0.5 0.4 0.6 0.3 0.4 2.8 3.1 3.7 3.0 3.0 2.8 3.7 1.7 2.6 MAE RMSE MAPE 14.63 23.49 9.43% 14.64 15.31 14.57 14.64 14.70 15.64 16.53 16.24 23.55 24.21 23.48 23.59 23.71 24.52 26.34 25.79 9.48% 10.55% 9.48% 9.66% 9.55% 10.96% 10.63% 10.72% • LightCTS\LS that substitutes the last-shot compression with the classical full-shot aggregation method (see Figure 1(a)), 12 • LightCTS\M that substitutes the L-MHA component of the GL- Former with the standard MHA component. • LightCTS\F that substitutes the L-FFN component of the GL- Former with the standard FFN component. • LightCTS\LA that substitutes all local attention blocks with global attention blocks. We also introduce three other LightCTS variants to assess our de- sign choices: • LightCTS-A that adopts the alternate stacking pattern instead of the proposed plain stacking. • LightCTS-CGCN that substitutes the GL-Former with Chebyshev GCNs [15] as the S-operator module. • LightCTS-DGCN that substitutes the GL-Former with Diffusion GCNs [19] as the S-operator module. Table 9 shows the results. We make the following observations. 1) LightCTS achieves almost the best accuracy with much fewer 14.614.815.015.2MAE23.623.824.0RMSE9.49.69.810.010.2MAPE(%)328048 64020406080100FLOPs(M)060120180240Param(K)MAERMSEMAPE(%)182 4020406080100120140FLOPs(M)060120180Param(K)14.714.814.9MAE23.523.623.723.823.9RMSE9.59.69.79.89.9MAPE(%)284 6020406080100FLOPs(M)060120180240Param(K)(a)Embedding Size D(b)Group Number GT(c)Attention Block Number L(cid:54)14.714.823.523.69.59.60FLOPs(M) / Latency(s)Params(K) / Peak Mem(Mb) Latency(s)Peak Mem(Mb)0.20.401230.20.4Latency(s)2.62.83.03.2Peak Mem(Mb)0Latency(s)Peak Mem(Mb)0.20.42.62.83.03.200.20.30.4RRSE0.900.95CORR16244048320100200300FLOPs(M)0255075Params(K)0.20.30.4RRSE0.900.95CORR182 40200400600FLOPs(M)0204060Params(K)0.20.30.4RRSE0.900.95CORR162 4050100150FLOPs(M)0204060Params(K)Embedding Size D(a)(b)Group Number GT(c)Attention Block Number L(cid:54) 00.10.20.38.008.258.508.759.00 00.10.28.008.258.508.759.00 00.10.2Latency(s)8.008.258.508.759.00Peak Mem(Mb)3rd step6th step12th step24th step FLOPs(M) / Latency(s)Params(K) / Peak Mem(Mb) Latency(s)Peak Mem(Mb)Latency(s)Peak Mem(Mb) FLOPs and parameters when all the lightweight techniques are deployed, implying that the proposed modules (i.e., L-TCN and GL- Former) and the last-shot compression are more efficient than their standard counterparts. 2) LightCTS\LA is inferior to LightCTS in terms of accuracy, indicating that the local attention block utilizing prior knowledge of spatial information does help achieve better forecasting performance. 3) The comparison between LightCTS and LightCTS-A indicates that the plain stacking strategy is much better at reducing overheads than the standard alternate stacking strategy, while simultaneously improving the forecasting accuracy. 4) When comparing LightCTS-CGCN, LightCTS-DGCN, and LightCTS, we observe that although LightCTS consumes more resources, its ac- curacy surpasses the GCN-based models' by a large margin. Thus, we choose the Transformer-based S-operators in LightCTS. 5.5 Studies on Memory Constraints We evaluate the performance of LightCTS under memory con- straints of 3Mb, 2.5Mb, and 2Mb, as commonly found in commodity MCUs [3]. We include representative baselines: AutoCts (the most accurate), AutoCts-KDf/AutoCts-KDp (KD variants of AutoCts), AgCrn (the least peak memory use), and GwNet (the lowest la- tency). For fair comparisons, we adjust the embedding size D for all models to fit into the constrained memory while maintaining their structures and components. Results on PEMS08 are presented in Table 10. Results on other datasets are available elsewhere [2]. Even with the lowest possible embedding size, AutoCts and its variants are unable to comply with the memory constraints due to their large intermediate results. This is concrete evidence of the inapplicability of these models to resource-constrained de- vices such as MCUs. While GwNet and AgCrn are able to meet the memory constraints, they experience significant accuracy loss. In contrast, LightCTS shows the least accuracy degradation and surpasses the baseline models significantly with the lowest latency under all studied constraints. These results demonstrate the need for specialized lightweight designs as state-of-the-art CTS models without such considerations fail to achieve satisfactory accuracy when downscaled for low-memory settings. Table 10: Models vs memory constraints on PEMS08. Mem Constraint (unit: Mb) 3 2.5 2 Model LightCTS GwNet AgCrn LightCTS GwNet AgCrn LightCTS GwNet AgCrn FLOPs (unit: M) Params (unit: K) Latency (unit: s) Peak Mem (unit: Mb) 70 328 726 42 137 586 8 40 100 177 178 150 103 49 115 15 10 11 0.4 1.0 3.2 0.3 0.8 2.9 0.2 0.6 2.2 2.8 2.9 2.6 2.5 2.4 2.5 2.0 2.0 2.0 MAE RMSE MAPE 14.63 17.40 15.95 14.82 18.00 16.72 16.70 19.38 19.17 23.49 27.34 25.22 23.78 28.20 26.26 26.28 30.14 29.71 9.43% 11.14% 10.09% 9.66% 11.49% 11.27% 10.75% 13.58% 13.06% Recently, the Transformer and its variants have been employed as S-operators [44, 60, 64, 70] and T-operators [44, 60, 64, 70], due to the powerful correlation modeling abilities of Transformers. Neural architecture search (NAS) has been introduced to automatically select appropriate S/T-operators, resulting in competitive perfor- mance without having to design a CTS forecasting model manually [42, 60]. All existing studies focus on improving forecasting accuracy. However, progress is slowing down and becoming marginal (see Tables 6 and 7). In contrast, LightCTS contributes lightweight S/T- operators and enables lightweight CTS models (w.r.t. computation and model size) without compromising forecasting accuracy. In this sense, LightCTS renders forecasting more cost-effective and extends its potential applicability to edge devices in CPSs. Lightweight DL Models. Developing light DL models is motivated by the requirements of real-time and mobile applications. There are two streams of related work [10]: compressing well-trained big models and designing lightweight models from scratch. The first stream has been well studied in areas like CV [23, 31, 67] and NLP [30, 40, 58] fields. However, LightCTS falls outside this stream as there are no compelling well-trained CTS models. Next, impressive advances in the design of lightweight mod- els from scratch have also been widely reported in CV [25, 26, 47, 53, 59, 69]. A popular operator is the depth-wise separable con- volution that decouples the standard convolution into intra- and inter-feature map computation. It serves as the basic block of the famous MobileNets [26] and Xception [12]. A follow-up work is the inverted bottleneck structure [47] that finds a narrow-wide-narrow convolution to achieve reduced computations while competitive ac- curacy. From a different perspective, EfficientNet [53] aims to scale existing modules to meet certain constraints rather than designing new efficient modules. However, the aforementioned lightweight modules cannot be applied directly to CTS forecasting because of the inherently different data structures and tasks involved. For example, these methods focus mainly on simplifying 2D and 3D convolutions for extracting local features of image and video data, while CTS models require uncovering long-term temporal dynam- ics and non-uniform spatial correlations. Given this gap, we identify potential directions to achieve lightness of CTS forecasting based on a careful study of existing CTS models. LightCTS offers a plain stacking architecture together with a last-shot compression to ef- ficiently deal with the heterogeneity of S/T-operators, which is unique compared to models used in CV. We also design L-TCN and GL-Former according to the exclusive characteristics of temporal dynamics and spatial correlations in CTS. 6 RELATED WORK DL-based Models for CTS Forecasting. Deep learning models dominate CTS forecasting. Different studies involve different S/T- operators. GCNs and GCN variants are the most common S-operators [4, 8, 36, 61, 65]. In addition to building graphs using prior knowl- edge in GCNs, learned graphs [8, 61, 62] and adaptive graphs [4] demonstrate advantages in capturing dynamic and implicit cor- relations among time series. Further, TCNs [8, 21, 28, 61, 62, 65] and RNNs [4, 6, 9, 36, 49] are the most widely adopted T-operators. 7 CONCLUSION We present LightCTS, a new framework for lightweight forecasting of correlated time series (CTS) that achieves comparable accuracy to state-of-the-art CTS forecasting models but consumes much fewer computational resources. LightCTS integrates a set of novel computational cost reduction techniques, notably a plain stacking architecture, the L-TCN (Light Temporal Convolutional Network) and GL-Former (GlobalLocal TransFormer) modules for extract- ing spatio-temporal features, and a last-shot compression scheme 13 for reducing redundant, intermediate features. Comprehensive ex- periments offer evidence that LightCTS is capable of providing state-of-the-art CTS forecasting accuracy with much fewer FLOPs and parameters than existing CTS forecasting proposals. REFERENCES [1] 2023. Fvcore. https://github.com/facebookresearch/fvcore. (Accessed Jan 2023). [2] 2023. LightCTS project: Code, datasets and supplemental material. https://github. com/AI4CTS/lightcts. (Accessed Jan 2023). [3] 2023. Microcontrollers and microprocessors, STMicroelectronics. https://www. st.com/en/microcontrollers-microprocessors.html. (Accessed Jan 2023). [4] Lei Bai, Lina Yao, Can Li, Xianzhi Wang, and Can Wang. 2020. Adaptive graph convolutional recurrent network for traffic forecasting. In NeurIPS. 17804–17815. [5] Li-Juan Cao and Francis Eng Hock Tay. 2003. Support vector machine with adaptive parameters in financial time series forecasting. TNNLS 14, 6 (2003), 1506–1518. [6] Yen-Yu Chang, Fan-Yun Sun, Yueh-Hua Wu, and Shou-De Lin. 2018. A memory- network based solution for multivariate time-series forecasting. arXiv preprint arXiv:1809.02105 (2018). [7] Boyu Chen, Peixia Li, Baopu Li, Chen Lin, Chuming Li, Ming Sun, Junjie Yan, and Wanli Ouyang. 2021. BN-NAS: Neural architecture search with batch nor- malization. In CVPR. 307–316. [8] Ling Chen, Donghui Chen, Zongjiang Shang, Youdong Zhang, Bo Wen, and Chenghu Yang. 2022. Multi-scale adaptive graph neural network for multivariate time series forecasting. arXiv preprint arXiv:2201.04828 (2022). [9] Weiqi Chen, Ling Chen, Yu Xie, Wei Cao, Yusong Gao, and Xiaojie Feng. 2020. Multi-range attentive bicomponent graph convolutional network for traffic fore- casting. In AAAI. 3529–3536. [10] Yanjiao Chen, Baolin Zheng, Zihan Zhang, Qian Wang, Chao Shen, and Qian Zhang. 2020. Deep learning on mobile and embedded devices: State-of-the-art, challenges, and future directions. ACM Comput. Surv. 53, 4 (2020), 1–37. [11] Xu Cheng, Fan Shi, Xiufeng Liu, Meng Zhao, and Shengyong Chen. 2022. A novel deep class-imbalanced semisupervised model for wind turbine blade icing detection. TNNLS 33, 6 (2022), 2558–2570. [12] François Chollet. 2017. Xception: Deep learning with depthwise separable con- volutions. In CVPR. 1251–1258. [13] Razvan-Gabriel Cirstea, Tung Kieu, Chenjuan Guo, Bin Yang, and Sinno Jialin Pan. 2021. Enhancenet: Plugin neural networks for enhancing correlated time series forecasting. In ICDE. 1739–1750. [14] Nando de Freitas, Marta Milo, Philip Clarkson, Mahesan Niranjan, and Andrew Gee. 1999. Sequential support vector machines. In IEEE Signal Processing Society Workshop. 31–40. [15] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. 2016. Convolu- tional neural networks on graphs with fast localized spectral filtering. In NIPS. 3837–3845. [16] Patricia Derler, Edward A Lee, and Alberto Sangiovanni Vincentelli. 2011. Mod- eling cyber-physical systems. Proc. IEEE 100, 1 (2011), 13–28. [17] Shengdong Du, Tianrui Li, Yan Yang, and Shi-Jinn Horng. 2019. Deep air quality forecasting using hybrid deep learning framework. TKDE 33, 6 (2019), 2412–2424. [18] Christos Faloutsos, Jan Gasthaus, Tim Januschowski, and Yuyang Wang. 2019. Classical and contemporary approaches to big time series forecasting. In SIGMOD. 2042–2047. [19] Johannes Gasteiger, Stefan Weissenberger, and Stephan Günnemann. 2019. Diffu- sion improves graph learning. In NeurIPS. 13333–13345. [20] Jake Grigsby, Zhe Wang, and Yanjun Qi. 2021. Long-range transformers for dynamic spatiotemporal forecasting. arXiv preprint arXiv:2109.12218 (2021). [21] Shengnan Guo, Youfang Lin, Ning Feng, Chao Song, and Huaiyu Wan. 2019. Attention based spatial-temporal graph convolutional networks for traffic flow forecasting. In AAAI. 922–929. [22] Kai Han, Yunhe Wang, Qi Tian, Jianyuan Guo, Chunjing Xu, and Chang Xu. 2020. Ghostnet: More features from cheap operations. In CVPR. 1580–1589. [23] Song Han, Jeff Pool, John Tran, and William Dally. 2015. Learning both weights and connections for efficient neural network. In NIPS. 1135–1143. In IJCAI. 2355–2361. [29] Siteng Huang, Donglin Wang, Xuehan Wu, and Ao Tang. 2019. Dsanet: Dual self- attention network for multivariate time series forecasting. In CIKM. 2129–2132. [30] Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. 2020. TinyBERT: Distilling BERT for natural language understanding. In EMNLP. 4163–4174. [31] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. 2012. Imagenet classifi- cation with deep convolutional neural networks. In NIPS. 1106–1114. [32] Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. 2018. Modeling long-and short-term temporal patterns with deep neural networks. In SIGIR. 95–104. [33] Zhichen Lai, Xu Cheng, Xiufeng Liu, Lizhen Huang, and Yongping Liu. 2022. Multiscale wavelet-driven graph convolutional network for blade icing detection of wind turbines. IEEE Sensors Journal 22, 22 (2022), 21974–21985. [34] Colin Lea, Rene Vidal, Austin Reiter, and Gregory D Hager. 2016. Temporal convolutional networks: A unified approach to action segmentation. In ECCV. 47–54. [35] Changlin Li, Guangrun Wang, Bing Wang, Xiaodan Liang, Zhihui Li, and Xiaojun Chang. 2021. Dynamic slimmable network. In CVPR. 8607–8617. [36] Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. 2018. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. In ICLR. 1–10. [37] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. 2021. Swin transformer: Hierarchical vision transformer using shifted windows. In CVPR. 10012–10022. [38] Lin Ma, Dana Van Aken, Ahmed Hefny, Gustavo Mezerhane, Andrew Pavlo, and Geoffrey J Gordon. 2018. Query-based workload forecasting for self-driving database management systems. In SIGMOD. 631–645. [39] Sachin Mehta and Mohammad Rastegari. 2021. MobileViT: Light-weight, general- purpose, and mobile-friendly vision transformer. In ICLR. [40] Paul Michel, Omer Levy, and Graham Neubig. 2019. Are sixteen heads really better than one?. In NeurIPS. 14014–14024. [41] Alejandro Morales-Hernández, Inneke Van Nieuwenhuyse, and Sebastian Ro- jas Gonzalez. 2022. A survey on multi-objective hyperparameter optimization algorithms for Machine Learning. Artificial Intelligence Review (2022), 1–51. [42] Zheyi Pan, Songyu Ke, Xiaodu Yang, Yuxuan Liang, Yong Yu, Junbo Zhang, and Yu Zheng. 2021. AutoSTG: Neural architecture search for predictions of spatio-temporal graph. In WWW. 1846–1855. [43] Spiros Papadimitriou and Philip Yu. 2006. Optimal multi-scale patterns in time series streams. In SIGMOD. 647–658. [44] Cheonbok Park, Chunggi Lee, Hyojin Bahng, Yunwon Tae, Seungmin Jin, Kihwan Kim, Sungahn Ko, and Jaegul Choo. 2020. ST-GRAT: A novel spatio-temporal graph attention networks for accurately forecasting dynamically changing road speed. In CIKM. 1215–1224. [45] Simon Aagaard Pedersen, Bin Yang, and Christian S Jensen. 2020. Anytime stochastic routing with hybrid learning. PVLDB 13, 9 (2020), 1555–1567. [46] Xuan Rao, Hao Wang, Liang Zhang, Jing Li, Shuo Shang, and Peng Han. 2022. FOGS: First-order gradient supervision with learning-based graph for traffic flow forecasting. In IJCAI. [47] Mark Sandler, Andrew G. Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. 2018. MobileNetV2: Inverted residuals and linear bottlenecks. In CVPR. 4510–4520. [48] Weisong Shi, Jie Cao, Quan Zhang, Youhuizi Li, and Lanyu Xu. 2016. Edge computing: Vision and challenges. IEEE Internet Things J. 3, 5 (2016), 637–646. [49] Shun-Yao Shih, Fan-Keng Sun, and Hung-yi Lee. 2019. Temporal pattern attention for multivariate time series forecasting. Mach. Learn. 108, 8 (2019), 1421–1441. [50] Chao Song, Youfang Lin, Shengnan Guo, and Huaiyu Wan. 2020. Spatial- temporal synchronous graph convolutional networks: A new framework for spatial-temporal network data forecasting. In AAAI. 914–921. [51] Bharath Sudharsan, John G Breslin, and Muhammad Intizar Ali. 2021. Ml-mcu: A framework to train ml classifiers on mcu-based iot edge devices. IEEE Internet Things J. (2021). [52] Makoto Takamoto, Yusuke Morishita, and Hitoshi Imaoka. 2020. An efficient method of training small models for regression problems with knowledge distil- lation. In MIPR. IEEE, 67–72. [53] Mingxing Tan and Quoc Le. 2019. Efficientnet: Rethinking model scaling for [24] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2016. Deep residual convolutional neural networks. In ICML. 6105–6114. learning for image recognition. In CVPR. 770–778. [25] Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingx- ing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al. 2019. Searching for mobilenetv3. In CVPR. 1314–1324. [26] Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. 2017. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861 (2017). [27] Jie Hu, Li Shen, and Gang Sun. 2018. Squeeze-and-excitation networks. In CVPR. 7132–7141. [28] Rongzhou Huang, Chuyin Huang, Yubao Liu, Genan Dai, and Weiyang Kong. 2020. LSGCN: Long short-term traffic prediction with graph convolutional networks. 14 [54] Francis EH Tay and LJ Cao. 2002. Modified support vector machines in financial time series forecasting. Neurocomputing 48, 1-4 (2002), 847–861. [55] Aäron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew W. Senior, and Koray Kavukcuoglu. 2016. WaveNet: A generative model for raw audio. In ISCA Speech Synthesis Workshop. 125. [56] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NeurIPS, Vol. 30. [57] Mariia Vladimirova, Jakob Verbeek, Pablo Mesejo, and Julyan Arbel. 2019. Under- standing priors in Bayesian neural networks at the unit level. In ICML. 6458–6467. [58] Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang, and Ming Zhou. 2020. Minilm: Deep self-attention distillation for task-agnostic compression of pre-trained transformers. In NeurIPS. 5776–5788. [59] Bichen Wu, Alvin Wan, Xiangyu Yue, Peter Jin, Sicheng Zhao, Noah Golmant, Amir Gholaminejad, Joseph Gonzalez, and Kurt Keutzer. 2018. Shift: A zero flop, zero parameter alternative to spatial convolutions. In CVPR. 9127–9135. [60] Xinle Wu, Dalin Zhang, Chenjuan Guo, Chaoyang He, Bin Yang, and Christian S Jensen. 2021. AutoCTS: Automated correlated time series forecasting. PVLDB 15, 4 (2021), 971–983. [61] Zonghan Wu, Shirui Pan, Guodong Long, Jing Jiang, Xiaojun Chang, and Chengqi Zhang. 2020. Connecting the dots: Multivariate time series forecasting with graph neural networks. In KDD. 753–763. [62] Zonghan Wu, Shirui Pan, Guodong Long, Jing Jiang, and Chengqi Zhang. 2019. Graph WaveNet for deep spatial-temporal graph modeling. In IJCAI. 1907–1913. [63] Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. 2017. Aggregated residual transformations for deep neural networks. In CVPR. 1492– 1500. [64] Mingxing Xu, Wenrui Dai, Chunmiao Liu, Xing Gao, Weiyao Lin, Guo-Jun Qi, and Hongkai Xiong. 2020. Spatial-temporal transformer networks for traffic flow forecasting. arXiv preprint arXiv:2001.02908 (2020). [65] Bing Yu, Haoteng Yin, and Zhanxing Zhu. 2018. Spatio-temporal graph convo- lutional networks: a deep learning framework for traffic forecasting. In IJCAI. 3634–3640. [66] Fisher Yu and Vladlen Koltun. 2016. Multi-scale context aggregation by dilated convolutions. In ICLR. 1–10. [67] Ruichi Yu, Ang Li, Chun-Fu Chen, Jui-Hsin Lai, Vlad I Morariu, Xintong Han, Mingfei Gao, Ching-Yung Lin, and Larry S Davis. 2018. NISP: Pruning networks using neuron importance score propagation. In CVPR. 9194–9203. [68] Haitao Yuan, Guoliang Li, Zhifeng Bao, and Ling Feng. 2020. Effective travel time estimation: When historical trajectories over road networks matter. In SIGMOD. 2135–2149. [69] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. 2018. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In CVPR. 6848–6856. [70] Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. 2021. Informer: Beyond efficient transformer for long se- quence time-series forecasting. In AAAI. 11106–11115. [71] Yunyue Zhu and Dennis Shasha. 2002. Statstream: Statistical monitoring of thousands of data streams in real time. (2002), 358–369. 15
http://arxiv.org/abs/2302.11971v2
2023-05-14T14:14:07
2023-02-23T12:41:51
Efficiently handling constraints with Metropolis-adjusted Langevin algorithm
In this study, we investigate the performance of the Metropolis-adjusted Langevin algorithm in a setting with constraints on the support of the target distribution. We provide a rigorous analysis of the resulting Markov chain, establishing its convergence and deriving an upper bound for its mixing time. Our results demonstrate that the Metropolis-adjusted Langevin algorithm is highly effective in handling this challenging situation: the mixing time bound we obtain is superior to the best known bounds for competing algorithms without an accept-reject step. Our numerical experiments support these theoretical findings, indicating that the Metropolis-adjusted Langevin algorithm shows promising performance when dealing with constraints on the support of the target distribution.
[ "Jinyuan Chang", "Cheng Yong Tang", "Yuanzheng Zhu" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11971v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11971v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "stat.CO", "@scheme": "http://arxiv.org/schemas/atom" }
[ "stat.CO", "cs.DS", "cs.LG", "math.OC" ]
http://arxiv.org/abs/2302.11970v2
2023-02-24T13:41:35
2023-02-23T12:40:36
ArtiFact: A Large-Scale Dataset with Artificial and Factual Images for Generalizable and Robust Synthetic Image Detection
Synthetic image generation has opened up new opportunities but has also created threats in regard to privacy, authenticity, and security. Detecting fake images is of paramount importance to prevent illegal activities, and previous research has shown that generative models leave unique patterns in their synthetic images that can be exploited to detect them. However, the fundamental problem of generalization remains, as even state-of-the-art detectors encounter difficulty when facing generators never seen during training. To assess the generalizability and robustness of synthetic image detectors in the face of real-world impairments, this paper presents a large-scale dataset named ArtiFact, comprising diverse generators, object categories, and real-world challenges. Moreover, the proposed multi-class classification scheme, combined with a filter stride reduction strategy addresses social platform impairments and effectively detects synthetic images from both seen and unseen generators. The proposed solution significantly outperforms other top teams by 8.34% on Test 1, 1.26% on Test 2, and 15.08% on Test 3 in the IEEE VIP Cup challenge at ICIP 2022, as measured by the accuracy metric.
[ "Md Awsafur Rahman", "Bishmoy Paul", "Najibul Haque Sarker", "Zaber Ibn Abdul Hakim", "Shaikh Anowarul Fattah" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11970v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11970v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.CV", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.CV", "cs.AI", "cs.LG" ]
3 2 0 2 b e F 4 2 ] V C . s c [ 2 v 0 7 9 1 1 . 2 0 3 2 : v i X r a ARTIFACT: A LARGE-SCALE DATASET WITH ARTIFICIAL AND FACTUAL IMAGES FOR GENERALIZABLE AND ROBUST SYNTHETIC IMAGE DETECTION Md Awsafur Rahman§,1, Bishmoy Paul §,1, Najibul Haque Sarker §,2, Zaber Ibn Abdul Hakim §,2 Shaikh Anowarul Fattah 1 1 Dept. of EEE, BUET, Bangladesh 2 Dept. of CSE, BUET, Bangladesh ABSTRACT Synthetic image generation has opened up new opportunities but has also created threats in regard to privacy, authentic- ity, and security. Detecting fake images is of paramount im- portance to prevent illegal activities, and previous research has shown that generative models leave unique patterns in their synthetic images that can be exploited to detect them. However, the fundamental problem of generalization remains, as even state-of-the-art detectors encounter difficulty when facing generators never seen during training. To assess the generalizability and robustness of synthetic image detectors in the face of real-world impairments, this paper presents a large-scale dataset1 named ArtiFact, comprising diverse gen- erators, object categories, and real-world challenges. More- over, the proposed multi-class classification scheme, com- bined with a filter stride reduction strategy addresses social platform impairments and effectively detects synthetic images from both seen and unseen generators. The proposed solution significantly outperforms other top teams by 8.34% on Test 1, 1.26% on Test 2, and 15.08% on Test 3 in the IEEE VIP Cup challenge at ICIP 2022, as measured by the accuracy metric. Index Terms- Synthetic Image, Robust Detection, Multi-class classification, Generative Models 1. INTRODUCTION With the advent of deep learning technologies, an array of new methods have been introduced for synthetic image gen- eration. These improvements have opened up new and excit- ing opportunities in creative arts, the entertainment industry, and advertising. But they are also posing a threat in regard to privacy, authenticity, and security-for example, generating fake images of a subject in different contexts. To prevent these types of illegal and detrimental activi- ties, developing technologies to detect these fake images have paramount importance. Most generative architectures have unique patterns in their synthetic images, which are absent in real images and vary with both the generator architecture and the dataset it is trained with [1]. Recent works on synthetic image detection exploited these artifacts present in genera- tors utilizing color band correlation, intensity, Fourier spec- tra characteristics [2]–[5]. For the detection of these patterns and artifacts, methods based on hand-crafted features and fre- quency domain analysis are outperformed by very deep CNN models [6]. The most fundamental problem that still remains is gener- alization, where even state-of-the-art detectors encounter dif- ficulty when facing generators never seen during training [5]. With the rapid development of sophisticated generative mod- els, it is impossible to include all possible variants in a detec- tor's training set. This is further compounded by the preva- lence of image impairment in compressed and resized social media images, which are particularly vulnerable to synthetic image-related fraudulent activities. The development of a vi- able solution is hindered by the lack of a proper benchmark dataset as existing relevant datasets are limited by a lack of di- versity among generator sources and object classes. This ne- cessitates the creation of a dataset featuring both real and fake images from diverse generators and object categories, with real-world challenges. Given the foregoing context, this study provides the fol- lowing significant contributions: 1) A large-scale dataset namely ArtiFact is proposed, replete with diverse generators, object categories, and real-world impairments, poised to as- sess the efficacy of synthetic image detectors across a vast spectrum of sources and categories. 2) To address the gener- alizability problem of detecting fake images from previously unseen generators, while also addressing real-world impair- ments that can impact the robustness of image detectors, a multi-class classification scheme along with filter stride re- duction strategy is proposed for both generalizable and robust synthetic image detection. 2. RELATED WORK §Equal contribution 1The dataset is available at https://github.com/awsaf49/artifact Deep learning-based generative models have revolutionized image synthesis in recent years. After the breakthrough in image synthesis by generative adversarial networks(GANs), the basic GAN framework has been extended for more di- verse generations [7], [8]. Recent diffusion models [9] have shown impressive results in generating high-quality images with realistic textures and details. Generative models have unique patterns that can be used to attribute them [10]. Despite ongoing efforts to reduce these patterns in generators, even recent proposals such as Diffu- sion Models are not free from them [5]. Color band inconsis- tencies [2] or lack of variation in color intensity [4] can act as unique identifiers for generative models. Fourier domain analysis also reveals unique signatures of generative models that can be used for model attribution [3]. Marra et al. [6] shows that pre-trained state-of-the-art CNN image classifica- tion models outperform CNN models specifically designed from scratch for this task. Recent works on synthetic model attribution utilize supervised training of pre-trained CNN [11], [12]. Although they models with augmented data have shown promising results in detecting generators whose images are included in the training dataset, these methods have difficulty generalizing to unseen generators and also are susceptible to image impairments. Existing datasets for this task are either limited in the number of diverse generators or object categories. For ex- ample, a dataset comprising five classes, including one real and four synthetic classes, is introduced by [10]. However, this dataset only includes GAN models without any accom- panying image data. Bui et al. [13] introduces a dataset with ten classes, comprising eight generator classes and two real classes. But this dataset still suffers from a lack of diversity of generators and object categories. Therefore, the need for more diverse and comprehensive datasets for synthetic image detection persists. 3. METHODOLOGY 3.1. Proposed ArtiFact Dataset The challenge of evaluating the performance of synthetic im- age detectors in terms of their generalizability and robustness requires a comprehensive dataset that meets specific require- ments. These requirements include 1) a diversity of genera- tors, including GAN, Diffusion, fully manipulating, and par- tially manipulating, 2) a diversity of object categories, encom- passing various types rather than a few types, and 3) reflect- ing real-world scenarios by incorporating impairments result- ing from social platforms. However, current datasets lack these features, limiting the ability to evaluate the detectors fully, and providing only a partial view of their robustness and generalizability. To address this issue, a large-scale dataset namely ArtiFact (Artificial and Factual), has been proposed which integrates diverse generators, object categories, and real-world impairments, providing researchers with a more comprehensive understanding of synthetic image detectors' generalizability and robustness. Fig. 1: Distribution of different methods for real class Fig. 2: Distribution of different methods for fake class 3.1.1. Dataset Characteristics To include a diverse collection of real images from multiple categories, including Human/Human Faces, Animal/Animal Faces, Places, Vehicles, Art, and many other real-life objects, the proposed dataset utilizes 8 sources [7], [14]–[16] that are carefully chosen. Additionally, to inject diversity in terms of generators, the proposed dataset synthesizes images from 25 distinct methods [7]–[9], [14]–[24]. Specifically, it includes 13 GANs, 7 Diffusion, and 5 other miscellaneous generators. On the other hand, in terms of syntheticity, there are 20 fully manipulating and 5 partially manipulating generators, thus providing a broad spectrum of diversity in terms of genera- tors used. The distribution of real and fake data with different sources is shown in Fig.1 and Fig.2, respectively. The dataset contains a total of 2,496,738 images, comprising 964,989 real images and 1,531,749 fake images. The most frequently oc- curring categories in the dataset are Human/Human Faces, Animal/Animal Faces, Vehicles, Places, and Art. 3.1.2. Dataset Methodology To ensure significant diversity across different sources, the real images of the dataset are randomly sampled from source is transformed into a multi-class classification task with seven classes in accordance with IEEE VIP Cup [5]. Specifically, the proposed approach includes one class for identifying real images, five classes for identifying fake images from five seen generators (generators whose synthesized images are present in the training dataset), and one unique class, namely Unseen Fake (UF) for identifying fake images from unseen generators (data from generators that are not present during training). Traditional approaches are inadequate to account for these UF images. However, when the proposed method encounters images from previously unseen generators, the learning from the diverse UF class aids in labeling them as fake. Besides, the multi-class approach leverages the no- tion that increasing the number of classes can significantly improve the performance [25] as it exposes the model to a diverse range of visual concepts and relationships between classes, leading to the learning of more generalized and ro- bust features. The proposed method generates multi-class predictions but the evaluation metric expects binary-class, thus multi-class prediction is converted to binary-class taking the complement of real-class prediction. Fig. 4: ConvNeXt backbone with filter stride reduced (FSR) stem block and multi-class head including extra unseen class Fig. 3: Visual Summary of proposed method datasets containing numerous categories, whereas synthetic images are generated within the same categories as the real images. Captions and image masks from the COCO dataset are utilized to generate images for text2image and inpaint- ing generators, while normally distributed noise with differ- ent random seeds is used for noise2image generators. In both cases, the generator's default configuration is employed to produce images. To ensure that the proposed dataset reflects real-world scenarios, both real and synthetic images of the dataset undergo different impairments in accordance with the IEEE VIP Cup 2022 standards [5]. Specifically, random crop- ping with a ratio of r = 5 8 and minimum and maximum crop sizes of 160 and 2048, respectively, are applied to the images. They are then resized to 200 × 200 before being compressed using the JPEG format with quality Qf ∈ [65, 100]. Thereby, the proposed dataset accurately reflects real-world conditions, making it an ideal benchmark for evaluating the performance of synthetic image detectors. 3.2. Proposed Detection Scheme 3.2.2. Filter Stride Reduction (FSR) Current approaches struggle with both unseen generators and impairments. Therefore, a robust and generalizable detec- tor is necessary which is 1) capable of generalizing for both seen and unseen generators, with or without impairments, and 2) do not lose critical information by preserving generator traces in presence of impairments. To meet these require- ments, an effective method has been proposed utilizing Multi- class Scheme (Section 3.2.1) to tackle the first challenge and Filter Stride Reduction (FSR) (Section 3.2.2) to handle the second challenge. As depicted in Fig. 3, the proposed method utilizes real and fake images from seen generators for train- ing and testing, with fake images from unseen generators used solely as test data for predicting binary levels of authenticity in multi-class settings. The utilization of social media networks often results in the resizing and compression of images, which can result in the loss of critical information causing harm to invaluable traces of generator artifacts. This problem is exacerbated when the image is processed by modern CNNs and Vision Transform- ers, where the reduction of resolution in the stem block can further damage crucial information. To tackle this problem, a novel approach is put forth, which reduces the filter stride in the stem block of the ConvNeXt [26] backbone by 2× as shown in Fig. 4. This approach enables the reduction of infor- mation loss and preservation of generator artifacts while keep- ing architectural integrity and utilizing pre-trained weights, thus resulting in substantial improvement in performance. 3.2.1. Multi-class Classification Scheme This paper introduces a novel multi-class classification scheme to enhance the generalization and robustness of synthetic im- age detection. As depicted in Figure 4, the traditional binary classification problem of distinguishing real and fake images 4. EXPERIMENTS 4.1. Experimental Setup The proposed approach employs ConvNext-Large [26] as the backbone and a resolution of 200 × 200, with the Adam optimizer and Exponentially Decay scheduler with an initial learning rate of 10−4. Furthermore, it utilizes Categorical Cross Entropy loss with label smoothing, with ε = 5 × 10−2. To evaluate the detector's generalizability reliably, a four-fold hybrid cross-validation scheme is implemented with balanced accuracy which applies KFold [27] for real class and five seen fake classes where data from the same generators can appear in both the train and test sets as well as GroupKFold [27] for the unseen fake class where there is no overlap between generators in the train and test sets. To prevent overfitting, various augmentations are also employed randomly, includ- ing scale-shift-rotate-shear, contrast-brightness-hue, flips, and cutout. 4.2. Ablation Study An ablation study is conducted to evaluate the proposed method's effectiveness in terms of balanced accuracy, and the results are presented in Table 1. The table shows that the Multi-class scheme with Filter Stride Reduction (FSR) and an Unseen Fake (UF) class achieved the highest accuracy of 87.62%. This approach outperformed the traditional Binary- class method by 9.41%, demonstrating the efficacy of the proposed method. Table 1: Ablation study of the proposed method. Method Accuracy Binary-class Binary-class + FSR Multi-class Multi-class + UF class Multi-class + FSR Multi-class + FSR + UF class 78.21 81.30 83.12 84.98 85.56 87.62 4.3. Result on IEEE VIP Cup 2022 The performance of the proposed method is evaluated in IEEE VIP Cup [5] competition at ICIP 2022 using a small portion of the proposed ArtiFact dataset, totaling 222K images of 71K real images and 151K fake images from only 13 generators. As shown in Table 2, the proposed method consistently out- performs other top teams on the leaderboard by a significant margin, with an improvement of 8.34% on Test 1, 1.26% on Test 2, and 15.08% on Test 3, as measured by the accuracy metric, thus validating the efficacy of the proposed method. It is important to note that the Test data is kept confidential from all participating teams. Additionally, the generators used for the Test 1 data are known to all teams, whereas the generators for Test 2 and Test 3 are kept undisclosed. Given that all the teams sourced train data from various sources, there is a pos- sibility of overlap between generators used in Test 2 and Test 3 data. Table 2: Accuracy (%) of Top3 Teams in IEEE VIP Cup 2022 Team Names Test 1 Test 2 Test 3 Sherlock FAU Erlangen-N ̈urnberg 87.70 87.14 77.52 81.74 73.45 75.52 Megatron (Ours) 96.04 83.00 90.60 4.4. Comparison with existing approaches A quantitative comparison of the proposed method with ex- isting techniques has been presented in Table 3 which clearly demonstrates that the proposed method exhibits exceptional performance, surpassing other methods by a significant mar- gin in terms of balanced accuracy. These findings conclu- sively show the effectiveness of the proposed method in the field of synthetic image detection. Table 3: Comparison of the proposed method with existing approaches. Method Joel et al. [3] Francesco et al. [6] Wang et al. [11] Gragnaniello et al. [12] Multi-class + FSR + UF class (ours) Accuracy 63.19 79.28 79.95 81.63 87.62 5. CONCLUSION In this study, a novel dataset consisting of 2.4M images for fake image detection containing diverse generators, and object categories with real-world scenarios has been pre- sented, along with a robust methodology that is immune to social-platform impairments and attacks from unseen gen- erators. The proposed multi-class scheme with a dedicated class for unseen generators demonstrates exceptional per- formance. Additionally, the proposed filter stride reduction effectively combats the loss of critical information caused by social-platform impairments. Thus, the proposed solution is a promising contender in the field of synthetic image detection, with the potential to address crucial forensic issues related to synthetic images. 6. ACKNOWLEDGMENT The authors would like to express their gratitude to the IEEE Signal Processing Society, GRIP of the University Federico II of Naples (Italy), and NVIDIA (USA) for hosting the IEEE VIP Cup competition which acted as motivation for this work. [16] F. Zhan, Y. Yu, et al., "Multimodal image synthesis and edit- ing: A survey," arXiv preprint arXiv:2112.13592, 2021. [17] A. Nichol, P. Dhariwal, et al., "Glide: Towards photorealis- tic image generation and editing with text-guided diffusion models," arXiv preprint arXiv:2112.10741, 2021. [18] [19] J. Yu, Z. Lin, et al., "Free-form image inpainting with gated convolution," in Proc. of the IEEE/CVF Int. Conf. on Com- puter Vision, 2019, pp. 4471–4480. P. Esser, R. Rombach, and B. Ommer, "Taming transform- ers for high-resolution image synthesis," in Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recogni- tion, 2021, pp. 12 873–12 883. [20] E. Wood, T. Baltruˇsaitis, et al., "Fake it till you make it: Face analysis in the wild using synthetic data alone," in Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recog- nition, 2021, pp. 3681–3691. [21] Y. Choi, M. Choi, et al., "Stargan: Unified generative ad- versarial networks for multi-domain image-to-image transla- tion," in Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition, 2018, pp. 8789–8797. [22] W. Li, Z. Lin, et al., "Mat: Mask-aware transformer for large hole image inpainting," in Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition, 2022, pp. 10 758– 10 768. [23] D. Beniaguev, Synthetic faces high quality (sfhq) dataset, 2022. DOI: 10.34740/kaggle/dsv/4737549. [On- line]. Available: https://github.com/SelfishGene/SFHQ-dataset. [24] C. Saharia, W. Chan, H. Chang, C. Lee, J. Ho, T. Salimans, D. Fleet, and M. Norouzi, "Palette: Image-to-image diffusion models," in ACM SIGGRAPH 2022 Conference Proceedings, 2022, pp. 1–10. [25] T. Ridnik et al., "Imagenet-21k pretraining for the masses," arXiv preprint arXiv:2104.10972, 2021. [26] Z. Liu, H. Mao, et al., "A convnet for the 2020s," in Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recog- nition, 2022, pp. 11 976–11 986. [27] F. Pedregosa, G. Varoquaux, A. Gramfort, et al., "Scikit- learn: Machine learning in Python," Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011. References [1] F. Marra et al., "Do gans leave artificial fingerprints?" In 2019 IEEE Conf. on Multimedia Information Processing and Re- trieval (MIPR), IEEE, 2019, pp. 506–511. [2] H. Li, B. Li, et al., "Identification of deep network generated images using disparities in color components," Signal Pro- cessing, vol. 174, p. 107 616, 2020. [3] [4] J. Frank et al, "Leveraging frequency analysis for deep fake image recognition," in Int. Conf. on Machine Learning, PMLR, 2020, pp. 3247–3258. S. McCloskey et al., "Detecting gan-generated imagery using saturation cues," in 2019 IEEE Int. Conf. on Image Process- ing (ICIP), IEEE, 2019, pp. 4584–4588. [5] R. Corvi, D. Cozzolino, et al., On the detection of syn- thetic images generated by diffusion models, 2022. DOI: 10.48550/ARXIV.2211.00680. [Online]. Available: https://arxiv.org/abs/2211.00680. [6] F. Marra et al., "Detection of gan-generated fake images over social networks," in 2018 IEEE Conf. on Multimedia Information Processing and Retrieval (MIPR), IEEE, 2018, pp. 384–389. [7] W. Xia, Y. Zhang, et al., "Gan inversion: A survey," IEEE Trans. PAMI, 2022. [8] G. Iglesias, E. Talavera, and A. D ́ıaz- ́Alvarez, "A survey on gans for computer vision: Recent research, analysis and tax- onomy," arXiv preprint arXiv:2203.11242, 2022. [9] F.-A. Croitoru, V. Hondru, R. T. Ionescu, and M. Shah, "Diffusion models in vision: A survey," arXiv preprint arXiv:2209.04747, 2022. [10] N. Yu, L. S. Davis, and M. Fritz, "Attributing fake images to gans: Learning and analyzing gan fingerprints," in Proc. of the IEEE/CVF Int. Conf. on Computer Vision, 2019, pp. 7556– 7566. [11] S.-Y. Wang, O. Wang, et al., "Cnn-generated images are sur- prisingly easy to spot... for now," in Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition, 2020, pp. 8695–8704. [12] D. Gragnaniello, D. Cozzolino, et al., "Are gan generated im- ages easy to detect? a critical analysis of the state-of-the-art," in 2021 IEEE Int. Conf. on Multimedia and Expo (ICME), IEEE, 2021, pp. 1–6. [13] T. Bui, N. Yu, and J. Collomosse, "Repmix: Representation mixing for robust attribution of synthesized images," in Com- puter Vision–ECCV 2022: 17th European Conf., Tel Aviv, Is- rael, October 23–27, 2022, Proc., Part XIV, Springer, 2022, pp. 146–163. [14] T. Karras, M. Aittala, et al., "Alias-free generative adversarial networks," Advances in Neural Information Processing Sys- tems, vol. 34, pp. 852–863, 2021. [15] I. Anokhin, K. Demochkin, et al., "Image generators with conditionally-independent pixel synthesis," in Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recogni- tion, 2021, pp. 14 278–14 287.
http://arxiv.org/abs/2302.11966v2
2023-08-22T09:45:11
2023-02-23T12:29:20
Machine Learning for QoS Prediction in Vehicular Communication: Challenges and Solution Approaches
As cellular networks evolve towards the 6th generation, machine learning is seen as a key enabling technology to improve the capabilities of the network. Machine learning provides a methodology for predictive systems, which can make networks become proactive. This proactive behavior of the network can be leveraged to sustain, for example, a specific quality of service requirement. With predictive quality of service, a wide variety of new use cases, both safety- and entertainment-related, are emerging, especially in the automotive sector. Therefore, in this work, we consider maximum throughput prediction enhancing, for example, streaming or high-definition mapping applications. We discuss the entire machine learning workflow highlighting less regarded aspects such as the detailed sampling procedures, the in-depth analysis of the dataset characteristics, the effects of splits in the provided results, and the data availability. Reliable machine learning models need to face a lot of challenges during their lifecycle. We highlight how confidence can be built on machine learning technologies by better understanding the underlying characteristics of the collected data. We discuss feature engineering and the effects of different splits for the training processes, showcasing that random splits might overestimate performance by more than twofold. Moreover, we investigate diverse sets of input features, where network information proved to be most effective, cutting the error by half. Part of our contribution is the validation of multiple machine learning models within diverse scenarios. We also use explainable AI to show that machine learning can learn underlying principles of wireless networks without being explicitly programmed. Our data is collected from a deployed network that was under full control of the measurement team and covered different vehicular scenarios and radio environments.
[ "Alexandros Palaios", "Christian L. Vielhaus", "Daniel F. Külzer", "Cara Watermann", "Rodrigo Hernangomez", "Sanket Partani", "Philipp Geuer", "Anton Krause", "Raja Sattiraju", "Martin Kasparick", "Gerhard Fettweis", "Frank H. P. Fitzek", "Hans D. Schotten", "Slawomir Stanczak" ]
10.1109/ACCESS.2023.3303528
[ { "@title": "doi", "@href": "http://dx.doi.org/10.1109/ACCESS.2023.3303528", "@rel": "related", "@type": null }, { "@title": null, "@href": "http://arxiv.org/abs/2302.11966v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11966v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.NI", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.NI", "cs.LG" ]
3 2 0 2 g u A 2 2 ] I N . s c [ 2 v 6 6 9 1 1 . 2 0 3 2 : v i X r a 1 Machine Learning for QoS Prediction in Vehicular Communication: Challenges and Solution Approaches Alexandros Palaios1, Christian L. Vielhaus2, Daniel F. K ̈ulzer3, Cara Watermann1, Rodrigo Hernangomez4, Sanket Partani5, Philipp Geuer1, Anton Krause6, Raja Sattiraju5, Martin Kasparick4, Gerhard Fettweis6, Frank H. P. Fitzek2, Hans D. Schotten5, and Slawomir Sta ́nczak4,7 1Ericsson Research, Germany, {alex.palaios, cara.watermann, philipp.geuer}@ericsson.com 2Deutsche Telekom Chair, Technische Universit ̈at Dresden, Germany, {christian.vielhaus, frank.fitzek}@tu-dresden.de 3BMW Group, Germany, [email protected] 4Fraunhofer Heinrich Hertz Institute, Germany, {rodrigo.hernangomez, martin.kasparick, slawomir.stanczak}@hhi.fraunhofer.de 5Technische Universit ̈at Kaiserslautern, Germany, {partani, sattiraju, schotten}@eit.uni-kl.de 6Vodafone Chair, Technische Universit ̈at Dresden, Germany, {anton.krause, gerhard.fettweis}@tu-dresden.de 7Network Information Theory Group,Technische Universit ̈at Berlin, Germany Abstract-As cellular networks evolve towards the 6th gen- eration, machine learning is seen as a key enabling technology to improve the capabilities of the network. Machine learning provides a methodology for predictive systems, which, in turn, can make networks become proactive. This proactive behavior of the network can be leveraged to sustain, for example, a specific quality of service requirement. With predictive quality of service, a wide variety of new use cases, both safety- and entertainment-related, are emerging, especially in the automotive sector. Therefore, in this work, we consider maximum throughput prediction enhancing, for example, streaming or high-definition mapping applications. We discuss the entire machine learning workflow highlighting less regarded aspects such as the de- tailed sampling procedures, the in-depth analysis of the dataset characteristics, the effects of splits in the provided results, and the data availability. Reliable machine learning models need to face a lot of challenges during their lifecycle. We highlight how confidence can be built on machine learning technologies by better understanding the underlying characteristics of the collected data. We discuss feature engineering and the effects of different splits for the training processes, showcasing that random splits might overestimate performance by more than twofold. Moreover, we investigate diverse sets of input features, where network information proved to be most effective, cutting the error by half. Part of our contribution is the validation of multiple machine learning models within diverse scenarios. We also use explainable AI to show that machine learning can learn underlying principles of wireless networks without being explicitly programmed. Our data is collected from a deployed network that was under full control of the measurement team and covered different vehicular scenarios and radio environments. Index Terms-Intelligent transportation systems, machine learning, quality of service, throughput prediction, vehicular communication, wireless networks. This work was supported by the Federal Ministry of Education and Re- search (BMBF) of the Federal Republic of Germany as part of the AI4Mobile project (16KIS1170K). The authors alone are responsible for the content of the paper. I. INTRODUCTION ML has a strong potential to overcome challenges arising in vehicular communication and networking, as presented in [1, 2]. Examples of such challenges are resource allocation [3, 4] and quality of service (QoS) prediction [5]. The QoS prediction, in turn, is an enabler for a variety of use cases in the domain of vehicular communication, such as autonomous driving, platooning, cooperative maneuvering, tele-operated driving, and smart navigation. Some of these are presented in [6, 7]. Predictions can not only enhance the existing use cases and support new ones, but also be a stepping stone for a network to become proactive. Such predictions can be an integral part of a network that proactively reacts to sustain, for example, a specific key performance indicator (KPI) target, like the maximum achievable throughput under high network load. In this work, we focus on the prediction of QoS as a way of looking into the typical workflow for building and applying machine learning (ML) algorithms. We start with data acquisition, moving on to data analysis and statistical characterization of the data, proceeding to feature engineering and different split strategies, and concluding by testing the performance of the model. Predicting QoS is a relatively com- plex task since it depends on several time-varying factors. It is especially complex in the case of vehicular communication where the radio conditions might change very drastically in a short amount of time [8]. that reveal datasets Capturing inter- dependencies between network operations, radio environment and terminal behavior is a challenging task in itself. The captured data might often lack the required quality for ML-based prediction, rendering it inappropriate. There are complex the multiple factors that can reduce the quality of a collected dataset for training ML models, with a few examples being dataset imbalance, coverage of radio regions with bounded dynamics or limited network states gathered. Moreover, acquiring different types of data for a prediction task comes with varying acquisition costs that are typically not discussed extensively. From the theoretical perspective of statistical learning, a training dataset should often be independent and identically distributed (i.i.d.) and drawn from the same probability distribution as the test dataset [9, 10]. Radio terminals frequently experience drastic shifts in the data distribution [11] that usually degrade the performance of ML models [12]. Meaningful comparisons between prior art proposals, though desirable, can be hard. There are multiple reasons for this, for example, the pre-processing steps are not well reported, or the used performance metrics differ. Addition- ally, literature in the area of applying ML for wireless communications often reports the performance of the models without giving an in-depth analysis of the dataset's underlying characteristics. This raises the question of how robust such models are to changes in different environments, where the dataset's statistical properties might be different. Our results emerge from the data analysis of a dedicated measurement campaign with the goal of capturing several characteristics of the radio environment and enabling an in- depth discussion of ML workflows. The code for this analysis is based on customary functions from usual Python libraries for scientific computing (e.g., numpy, pandas, scikit-learn...). Our contributions include the following: • We study the prediction of maximum throughput predic- tion enhancing, for example, streaming or high-definition mapping applications. • We discuss the entire machine learning workflow high- lighting less regarded, but important aspects, such as the detailed sampling procedures, the in-depth analysis of the dataset characteristics, and the effects of splits on performance. For example, we test against the data stationarity assumption and discuss methods to handle those for commercial networks. Many proposals in the literature avoid discussing such theoretical violations that many ML models require. • We put the characteristics of wireless environments in the foreground explaining what might hinder and benefit the adoption of ML approaches for new-generation wireless networks. • We further showcase why the lack of this type of infor- mation, missing often from the literature, can generate overconfidence in proposed ML solutions. • We investigate the effects of diverse sets of input features specifically those that are not typically available in the prior art. • We showcase that consumer devices and low sampling speeds can be enablers for the adoption of ML in com- mercial networks. • We also use explainable AI to demonstrate that machine learning can learn underlying principles of wireless net- works without being explicitly programmed. 2 • Our data is collected from a deployed network that avoids limitations of theoretical studies or simulation- based results. The remaining of the paper is structured as follows: Section II presents related work in the area of predictive quality of service (pQoS), and the measurement campaign is described in Section III. In Section IV, we discuss various radio en- vironment properties in relation to ML workflows, such as vehicle speed and stationarity. We continue the analysis on ML workflows in Section V with a careful look into train/test data splitting and feature engineering. In Section VI, we apply a set of ML algorithms to predict the maximum achievable through- put for diverse prediction models, communication directions, feature sets, splitting strategies, and prediction horizons. In Section VII we look at the topic of explainable AI (XAI) [13] showcasing what the models have learned in the absence of explicitly programmed rule sets. Finally, we draw conclusions in Section VIII. II. RELATED WORK [14, 15]. The authors of literature, a sampling interval The application of ML for QoS prediction in vehicular networks has drawn attention recently. In the following, we present an overview of related works. Measurement campaigns that focus on the feasibility of teleoperated driving (ToD) are described in [14] also include a sensitivity analysis in their work and examine the impact of factors such as speed and distance to a serving cell. When applying gathered data from measurements to QoS prediction in the current in the order of seconds is often used (e.g., [16, 17]). This does not reflect the fast-changing wireless channel associated with high-mobility vehicular communication scenarios [18], and there is an open question as to which degree sampling schemes need to be adjusted based on the vehicle speed. Some works already have compared measurement applications running on slow-sampling consumer equipment (CE) with ded- icated measurement equipment (DME) analysis [19, 20] and propagation model tuning [21]. As vehicular communication is characterized by high mobility of the terminal, it is an open question whether CE's low-cost transceiver chains might render collected data unsuitable for applying ML. is known that the radio environment has dynamics that can drastically change its statistical properties over a distance of a few meters [22, 23]. Such changes in statistical properties of the data stream, where the ML model needs to reformulate its decision boundaries, are being discussed in the literature as concept drift [24–26]. Detection and analysis of concept drift using state-of-the-art algorithms have been explained in [27]. Extensive research is conducted on the management of concept drift, some of which are: using an ensemble learning approach [28], concept drift-aware federated averaging [29], or model updating mechanisms [30]. In [31] and [32] the authors present a measurement cam- paign and evaluate several ML models regarding their per- formance for downlink (DL) throughput prediction. One lim- itation is that the authors measure in a public network and load. The thus cannot consider features such as the cell Moreover, it authors of [33] consider the movement of the user and build a two-staged ML model to predict the transmission control protocol (TCP) throughput. In the first step, the movement pattern is identified. Based on this, a long short-term memory (LSTM), trained with corresponding data, is selected for the throughput prediction. Some preliminary results for uplink (UL) and DL throughput prediction using Random Forest and employing the dataset used for this paper are presented in [34]. QoS prediction in a 5G non-standalone network is examined in [35]. Besides throughput, ML is also used to latency [5, 36, 37] and handovers [38]. Recently, predict several datasets intended for ML-based studies have been made publicly available [39, 40] that typically do not pro- vide cell-related information. Moreover, those works focus on introducing the datasets instead of applying ML methods. An inherent limitation of ML algorithms, especially as they get more complex, is that their decision-making is difficult to understand, rendering them into black boxes. Recently, the field of explainable AI (XAI) [13] has gained traction, to ensure ML models perform as desired, not only in test environments but also in target applications. With XAI, models can be judged in the context of human domain knowledge, e.g. by investigating the learned feature importance. We extend prior art by providing detailed insights into the aspects mentioned above. Our dedicated measurement campaign, on a fully controlled private network, allowed us to perform a deep analysis and enable an in-depth discussion. We could control which devices could connect to the network, we could adjust the total network interference, and generate diverse traffic dynamics. We consider different radio envi- ronments, device types, sampling frequencies, measurement scenarios, and prediction horizons. We present the complete workflow towards building a pQoS model, predicting the maximum achievable throughput. We discuss several design decisions, such as the train-test split, various feature groups, and different models, and show the influence on the achieved performance. In the end, we discuss the issue of trustworthi- ness. III. MEASUREMENT CAMPAIGN Within the project AI4Mobile, an extensive measurement campaign was performed in the 5G-ConnectedMobility test field1. In total, more than 3000 km were driven by four vehicles for one week to perform measurements from the long term evolution (LTE) network. A detailed description of the measurement campaign is available in [41]. Since we had control over the network infrastructure, we were able to measure and collect data from all parts of the network. We were also able to define custom scenarios and set parameters accordingly. Subsequently, we briefly describe the setup and highlight some scenarios. A. Measurement Setup During the measurement campaign, four vehicles were equipped with several user equipments (UEs). In each vehicle, 1https://www.ericsson.com/en/cases/2020/5g-connectedmobility 3 Fig. 1: The map of the areas where the measurements took place. The A9 highway is highlighted in red, while the rural and side street areas are marked in green (not all rural streets are plotted to reduce clutter). The blue area is the suburban city of Feucht. an identical DME was used for measurements with high granularity. The DME is a Linux-based PC including a cellular modem connected to a 2x2 MIMO car antenna, which is placed on the roof of the respective car. Additionally, a global positioning system (GPS) receiver was placed on the roof and connected to the DME, providing accurate location and time synchronization via a pulse per second (PPS) signal. To capture the data from the cellular modem, we used the application MobileInsight [42]. Each vehicle was also equipped with several CE phones as pure data generators and measurement devices with a low sampling frequency for a comparison to the DME's measurements. The CE uses the application G-Net Track Pro [43] to capture radio measurements via the Android API. All devices used the application Iperf [44] to exchange data with a local server connected to the network. In addition to the UEs (CE and DME), we also collected data from the base stations and the core network, which were also time-synchronized. An overview of all captured data is given in Table I. The network is deployed in the south of Germany, close to Nuremberg. It consists of 10 frequency-division duplex (FDD)-LTE cells with 10 MHz of bandwidth at a carrier frequency of 700 MHz, with typical radio tower panel antennas 4 heights, frequency layers and the number of cells in an area). All these factors contribute to very unique properties in the collected data as UEs move. We first discuss the data collection procedures and how these might affect the quality of the collected dataset. We continue looking at the statistical properties of the radio environment. As many ML algorithms rely on multiple statistical assumptions [46], we try to highlight some of those, as they might need to be better understood by the research community that applies ML on wireless networks. A. Sampling the Radio Environment High sampling intervals of the radio environment come at a cost, either in terms of acquiring more capable hardware, or in terms of higher power consumption or in terms of signaling, as more data need to be transferred. We specifically study the effects of different sampling intervals on the characteristics of the collected dataset. We also study the effects of the vehicular speed in the characteristics of the collected dataset to see if higher velocities call for faster sampling intervals, for sustaining specific quality characteristics in the collected dataset. We focus on LTE signal values for the analysis, i.e., reference signal received power (RSRP) and received signal strength indicator (RSSI), since these are most affected by the vehicle's speed and influence the target throughput, in turn, as we show in Section VI and in Section VII To quantify the sensitivity of the collected measurements on these two parameters, we need to introduce the resampling error (RE) at the k-th time instance as RE(k) = xo(k) − xrs(k) , 0 ≤ k < K , (1) where xo(k) represents the original signal of length K at a sampling interval of 10 ms for the DME and 1 s for the CE. The corresponding resampled value for a lower sampling inter- val is xrs(k). To determine xrs(k), the following procedure is applied: first, the original dataset is downsampled by averaging to a target rate to obtain xds (k′): xds (k′) = 1 M M −1 (cid:88) m=0 xo (m + k′M ) , 0 ≤ k′ < K/M , (2) where M accounts for the downsampling ratio for a certain pair of original and target sampling interval, e.g., M = 10 for a target rate of 10 s when considering the CE's original sampling interval of 1 s. Secondly, the downsampled dataset are then upsampled by the forward filling method, which can be expressed by M -integer division on the original index k: xrs (k) = xds (⌊k/M ⌋) = xds (cid:18) k − (k mod M ) M (cid:19) . (3) Finally, Equations (1), (2) and (3) can be combined into RE(k) = 1 M m=0 M −1 (cid:88) xo (k) − xo (m + k − (k mod M )) . (4) For each sample at the k-th time instance, the vehicle speed v(k) is also known, which allows to explore the relation between the mobility of the terminal and the resulting RE. Fig. 2: Simplified view of the used measurement methodology. All clocks are synchronized and all generated data is marked accordingly and captured at separate entities. Figure adapted from [41]. (horizontal half-power beam width of 65◦). Since it is a test network, our devices were the only devices connected to the network. In Fig. 1, the area of the test field is shown, including the position of the distinct cells. While the cells were positioned to provide excellent connectivity along the highway and in the suburban city of Feucht, part of the rural area next to the highway was also covered, which allowed us to capture several radio environments. B. The Conducted Studies The purpose of the measurements was to thoroughly exam- ine numerous parameters through a variety of real-time scenar- ios in our captured dataset. This involved analyzing different driving patterns at different speeds, stationary measurements, recording different radio environments, and generating varied data traffic to create contrasting load scenarios. Furthermore, we utilized various protocols and generated traffic in both the UL and DL to the server and to other vehicles. Additional information on the parameters captured in the measurement campaign can be found in [41]. C. Data Preprocessing For this study, only user datagram protocol (UDP) mea- surements from the dataset were considered since the protocol properties of TCP and UDP differ. Therefore the E2E through- put could not be limited by the transport layer. We used the data, where the devices were requesting maximum throughput. i.e., when vehicles were parked for some time. The stationary mea- surements contain similar radio properties for the majority of the samples, which could result in overly optimistic prediction results. Moreover, we filtered out stationary measurements, IV. PROPERTIES OF THE RADIO ENVIRONMENT In this section, we study properties of the radio environment that might influence ML algorithms. Radio environments have very diverse characteristics that depend on multiple factors. Some of these factors are environment-based, for example, radio propagation can be drastically different in a rural area and in a crowded city center [45], as the type and density of buildings influence the radio propagation. Another factor is, for example, the specific network deployment (e.g. antenna Cell 1,2Cell 3,4Cell 5,6Cell 7,8Cell 9,10MEC, PGWMME, HSS TABLE I: Overview of captured data from all network nodes. 5 Network Node DME CE Base station Core Database Information Type Physical layer (PHY) Medium access control (MAC) Packet data convergence protocol (PDCP) Radio link control (RLC) Radio resource control (RRC) Built-in sensors (e.g., GPS) Packet capturing tool (Tcpdump) Physical layer (PHY) Measurement tool (Iperf) Standard operator averages Reconstructed real-time information Mobility management entity (MME) Traces Event-based Packet capturing tool (Tcpdump) Weather Traffic APIs RSRP, RSRQ, CQI Buffer status report (BSR) PDCP UL & DL statistics RLC transmissions & receptions OTA packet log Longitude, latitude, speed Sampling Interval Features (Examples) 10 ms 40 ms 0.5 s 45 ms Event-based 1 s Traffic-dependent 1 s 1 s 15 min 1 ms RSRP, RSRQ Interference, cell load Interference, cell load Handover Traffic-dependent 1 hour 5 min Precipitation Traffic flow QoS Measurements DL throughput & latency DL throughput UL throughput & latency (a) RSRP (DME/10 ms) (b) RSSI (DME/10 ms) (c) RSRP (CE/1 s) (d) RSSI (CE/1 ms) Fig. 3: Relation between speed and mean absolute error (MAE) for different sampling intervals (shaded areas indicate the interquartile range). Therefore, the speed range from 0 to 140 km/h is split in intervals of 5 km/h. For each interval with a lower speed boundary v′, the mean absolute resampling error REv′ is calculated according to Eq. (5). REv′ = 1 K (cid:88) |RE(k)| (5) v′≤v(k)<v′+5 km/h The results are shown for RSRP and RSSI and measure- ments from the DME and CE in Fig. 3. The shaded areas indicate the central half of the distribution of the errors. Focusing on the effect of different sampling intervals for a DME dataset (Figs. 3a and 3b), one can see that the RE increases with a larger sampling interval as expected. this increase seems to be below 2 dB for a Interestingly, sampling interval of 1 s and between 2 and 3 dB for a sampling interval of 10 s, which might still be acceptable for certain ML applications. The mobility of the terminal seems to have some effect on the quality of the collected dataset. When the terminal is stationary, the RE is close to 0. Both RSRP and RSSI are characterized by a steep rise of the error once the terminal starts to move at an approximate speed of 10 km/h. Above that speed, the error remains stable. Of particular interest is a sampling interval of 1 s, as it shows approximately the error introduced by employing a CE instead of a DME, which collects data at a sampling interval of 10 ms. The mean RE for RSRP and RSSI are well below 2 dB, which suggests that also CE samples may enable an accurate QoS prediction. Only the sampling interval of 10 s shows larger variations across different speeds. Here we notice that the variance of the error is drastically increased for the lower sampling interval. We also executed the same experiments with a dataset from the less granular CE. We received similar results for the DME dataset as shown in Fig. 3c and 3d, i.e., a rise of the error in the beginning, followed by a saturation of the RE. We empathize that a direct comparison of the resulting RE between the two different devices should be avoided, as the original sampling intervals are larger and thus the number of samples that are considered for each downsampling interval is smaller. This, combined with the simpler transceiver chain of the CE, is a potential explanation for why these results are less smooth. The results indicate that the vehicle speed does not have a noticeable impact on the absolute error for different sampling intervals, except for vehicles moving at very low speeds. The observed effects can possibly be attributed to the Doppler effect. However, no channel measurements were carried out during the measurement campaign and thus the causes cannot be conclusively assessed on the basis of our data set. The relatively constant error for slow sampling at different speeds the can further simplify the sampling procedures without need to introduce adaptive sampling schemes. Also, lower sampling speeds can still provide useful input to ML models as the reconstruction error remains low. This type of result is necessary for optimizing data collection procedures for future ML applications. In the following sections, we use downsampled data from the DME with a sampling interval of 1s that also enables a comparison with the CE. The resulting dataset sizes for DL and UL are 18846 and 19535 samples, respectively. 6SHHG>NPK@0$(>G%@VVV6SHHG>NPK@0$(>G%@VVV6SHHG>NPK@0$(>G%@VVV6SHHG>NPK@0$(>G%@VVV B. Data Stationarity Many theoretical results in ML literature are based on the assumption that the available dataset is i.i.d. [9, 10, 12]. This assumption can be violated in several ways, for instance, if i) samples are correlated in time (i.e., they are not independent), or ii) the underlying time series is non-stationary (i.e., not identically distributed). There are both parametric and non-parametric hypothesis tests available in the literature to study time stationarity. Parametric tests are often more powerful, but one needs to assure that the assumptions they require (i.e., a specific well- known underlying distribution) are met by the tested data. As such, we have opted to use the parametric augmented Dickey–Fuller (ADF) test [47], which searches a unit root in the tested time series as its null hypothesis, while the alternative hypothesis is stationarity. In other words, a low p- value (for our analysis we have considered p < 0.05) indicates strong evidence for stationarity in the data. As a parametric test, ADF requires a suitable choice of the maximum lag of the assumed autoregressive model. Since the lag order is unknown for our data, we estimate it according to the Akaike information criterion (AIC) [47]. We have run the ADF test for all physical layer (PHY) features from all measurements (c.f. Table I, first row) in an accumulated manner. That is, for every analyzed time series of size T , we construct T sub-series each one consisting of all samples from 0 to t ∈ {0, 1, . . . , T − 1}. We then run the ADF test against every sub-series and concatenate the output p-values into a vector of size T . Fig. 4 shows the resulting accumulated ADF test as a color code on top of some time series. The expected behavior is that the accumulated ADF test tends to p ≪ 0.05 as the size of the evaluated time sub-series increases. The number of samples needed for this depends on some statistics, such as the variance (c.f. Fig. 4a & 4b), but it rarely exceeds 15 minutes for our data. This time stationarity assumption is violated for measure- ments with an appreciable scenario shift, e.g., those where vehicles remain idle for some time and drive away afterward (Fig. 4c). This shows that stationarity cannot always be assumed, even though it might hold true for some datasets under a long-enough measurement time. For the measurement scenarios, we opted for a duration of 40 to 60 minutes while driving to alleviate the problem of non-stationarities. In summary, we acknowledge the presence of non-stationary portions in our data and its possible negative impact on the performance of ML algorithms. C. Radio Environment Correlations Additionally, we look at an important characteristic of the radio environment, which is the correlation in time and space [48, 49]. In Fig. 5, we show an example of the autocor- relation function of the signal-to-interference-plus-noise ratio (SINR) for three distinct radio environments. We see that the radio environment tends to be highly correlated in time for all three distinct radio environments. Some higher correlations are noted for the rural environment, with the highway having the 6 (a) Low-variance scenario (b) High-variance scenario (c) Scenario shift Fig. 4: Stationarity analysis of the data using the ADF test. weakest of the three. This is probably explained by the faster movement of the vehicles. In [50], the authors discuss that if correlations are not handled properly, there is a higher risk of reporting overly optimistic results. The reason is that the ML model does not learn the underlying relations between input and output clearly, and instead learns the existing dependencies of a dataset, which in our case, are the reported correlations. V. MACHINE LEARNING FOR WIRELESS NETWORKS In this section, we discuss important aspects that the ML engineer needs to understand before applying ML to radio data. We discuss the notion of concept drift, different strategies 12:3612:4312:5012:5713:0413:12Time of the day [hour:min]−110−100−90−80−70−60RSRP [dBm]0.000.051.00p-value of AFD test15:0715:1415:2115:2815:3615:43Time of the day [hour:min]−110−100−90−80−70−60RSRP [dBm]0.000.051.00p-value of AFD test11:1611:2411:3111:3811:4511:5212:00Time of the day [hour:min]−110−100−90−80−70−60RSRP [dBm]0.000.051.00p-value of AFD test 7 Algorithm 1: Page-Hinkley Test Input: A labeled dataset x1, x2, * * * , xT Magnitude threshold δ Detection threshold λ t=1 xt t=1(xt − ̄xT − δ) ̄xT ← 1/T (cid:80)T UT ← (cid:80)T mT ← mint=1,*** ,T (Ut) P H T ← UT − mT if P H T > λ then Θ ← True else Θ ← False Output: Drift alarm Θ Fig. 5: Autocorrelation of the SINR for excerpts of different DL measurement runs. for splitting the data into training and test datasets, and feature engineering. A. Concept Drift In this section, we introduce the idea of concept drift as a tool that can mitigate some of the effects of non-stationarity. ML models traditionally need a formal and precise definition of the problem to represent the decision boundaries. However, non-stationarity in datasets implies that the decision bound- aries, i.e., concepts, have a higher likelihood to be relearned to accommodate variations in the underlying data distributions [51] [52]. This re-learning or concept drifts must be detected to ensure that the ML models remain accurate. Given that a sample instance x belongs to a class ω (x ∈ ω), the Bayes posterior probability is: P (ω | x) = P (ω)P (x | ω) P (x) (6) This indicates that the drift may occur when: is calculated. The estimator raises an alarm if the cumulative error UT increases beyond the minimum cumulative error mT determined by detection threshold λ. Since Algorithm 1 only returns a boolean value, we build T subseries identical to the ADF test and run the PH test against all of them. In that way, we can provide an example of detecting drifts in the input dataset as the vehicle is moving through different environments. For that example, an underlying ML model has been trained on the dataset of the suburban region. The PH estimator's magnitude threshold δ to twice the standard deviation, 2σ of the training is set dataset. The dataset captured by DME 3 from Vehicle 3 in the measurement campaign is used to test for drifts. The estimator reacts to the statistical changes in the input data and raises an alarm when a drift is detected (see Table II). The number of detected drifts on the highway is higher by a factor of 3.3 than that of the suburban region. TABLE II: Detected drifts in test data streams for a model trained on the suburban region. Training region Standard deviation Test region Highway Suburban (i) Class definition P (ω | x) changes while P (x) remains Suburban 2σ 56 17 the same, i.e., real concept drift. (ii) Virtual drift: Input distribution P (x) changes while P (ω | x) remains the same, i.e., virtual concept drift. (iii) Prior probability of class P (ω) changes while P (x | ω) remains the same. However, sometimes the class boundaries may change due to hidden contexts. This drift occurs due to 'insufficient, unknown, or observable features in a dataset' [53]. We aim to test how often such hidden contexts appear in real-time scenarios such as the automotive domain, where the environ- ments change dynamically at a rapid pace. To this end, we employ the Page-Hinkley (PH) test (see Algorithm 1) to detect statistical changes in the input data stream, i.e., detect drift in data [54] [55]. The PH estimator needs a labeled dataset, a magnitude threshold (δ), and a detection threshold (λ) as inputs. The magnitude threshold defines the degree to which noise is per- mitted in the dataset. For each subsequent timestep t, a single data entry is fed to the PH estimator and a cumulative error UT To verify the time and position of these drifts, an example from the dataset, where the vehicle moves through different regions is taken (see Fig. 6). Two distinct regions, i.e., sub- urban and highway are chosen for training the PH estimator. Furthermore, the drifts are detected for different magnitude thresholds of 1σ and 2σ for the two training datasets. A change in the radio environment, when trained on the suburban dataset (see Fig. 6a), can be detected when the two different thresholds are applied. We also got similar results when we trained for highway environments and the UE was moving between suburban, rural, and highway environments (see Fig. 6b). The different types of concept drifts are expected to deteri- orate ML performance. Detecting these drifts and dealing with them as early as possible will result in a resilient and accurate ML model. One way to handle the drifts is to include all the possible scenarios in the training dataset that a ML model might face during its life cycle. As this might be hard, and even 0510152025303540Lag [s]0.00.20.40.60.81.0Autocorrelation [DL SINR]highwaysuburbanrural 8 (a) Suburban Fig. 7: Visualization of different split strategies. (b) Highway Fig. 6: Detecting data drifts in distinct radio environments. unrealistic in many cases, another approach is online training, which may be based on concept drift detection [56, 57]. Hernang ́omez et. al [58] provide some preliminary results on this dataset using said approach. B. Train/Test Split and Evaluation of ML Algorithms This section provides more details on splitting strategies, and it explains how different techniques can provide different insights. If not used properly, the splitting technique might give skewed results, and we hope to explain some of their fundamental strengths and weaknesses in the following. The train/test splits included in this study are random split, split by time, split by measurement run, and split by fold. Fig. 7 provides the reader with a graphical explanation of the different splitting strategies. Subsequently, we describe the four strategies. Random split: Each dataset sample has a nonzero prob- ability of being added to the training respectively test set. This often leads to two consecutive samples from the same device being added to the training and test set. These samples, as discussed above, share similarities, explained by their correlation structure. In the coming sections, we use a split where 70 % of the data are in the training dataset and 30 % in the testing dataset. Note that this split strategy assumes samples to be i.i.d., an assumption we have shown to be violated in the radio environment. Split by time: The dataset is split into two same-size parts based on the time domain. The first part of each measurement run (independent of the device) is added to the training set, and the second to the test set. As one measurement run consisted of driving the highway segment in two directions, this represents adding one direction of travel to the training, and the second to the test set. Hence, the training and test sets contain very similar radio environments but are uncorrelated in time. Split by measurement run: A measurement run (inde- pendent of the device) is considered part of either the training or the test set. The assignment and balancing of training and test set can be challenging, as the train and test datasets need to contain similar characteristics. This splitting scheme is best used when the model's generalization performance is the main focus. It is difficult to capture all dynamics (i.e., the parameter permutations described in Section III) in both training and test set. Bad performance on the test set results from the fact that the complexity and dynamics of the region are not reflected by any subset of the measurement runs. In our dataset, we ended up with a split where about 70 % of the data are in the training dataset, and 30 % in the test dataset to ensure that training contains most of the dynamics found in the test dataset. Split by folds: The last proposed splitting method aims to combine the split by time and random splitting. We divide the time domain into ten subsets of equal length for each mea- surement run and device. This approach promises a realistic prediction performance evaluation, as it negates many of the problems of random splitting, and combines advantages of the time splitting, where the models learn characteristics from the time-varying radio environment. Here, we assigned 70 % of the data to the training and 30 % to the test dataset. [tbp] To investigate deeper the effects of the different splitting strategies, we refer to principal component analysis (PCA) [9], an orthogonal linear transformation transforming a dataset (e.g., the training or test set) to a new basis such that 14:2014:3014:4014:5015:00Time of the day [hour:min]1401201008060RSRP (dBm)Std. Deviation1 2 RegionsHighwaySub-urbanRural14:2014:3014:4014:5015:00Time of the day [hour:min]1401201008060RSRP (dBm)Std. Deviation1 2 RegionsHighwaySub-urbanRuralMeasurement Run123Train Set Test Set123123123123Device(a) Random Split(b) Split by Time(c) Split by Measurement Run(d) Split by Fold Train Set Test Set −5 0 5 10 1st principal component (a) Random Split 5 0 5 0 t n e n o p m o c l a p i c n i r p d n 2 t n e n o p m o c l a p i c n i r p d n 2 9 Train Set Test Set −5 0 5 10 1st principal component (b) Split by Time 5 0 5 0 t n e n o p m o c l a p i c n i r p d n 2 t n e n o p m o c l a p i c n i r p d n 2 Train Set Test Set Train Set Test Set −5 0 5 10 −5 0 5 10 1st principal component 1st principal component (c) Split by Measurement Run (d) Split by Fold Fig. 8: Visualization of the first two principal components for different train/test splits. The distribution of the test and train dataset varies a lot depending on the split strategy. the dataset's greatest variance lies in the first principal com- ponents. Therefore, it can be considered as a dimensionality reduction method and considering only a subset of the original components, e.g., the first two for visualization purposes. We note that PCA captures only the second-order statistics and that there are alternative methods for visualization, such as t-SNE. Fig. 8 shows the differences between the training and test sets for the four splits using PCA. The random split's train and test datasets have very similar distributions (cf. Fig. 8a). The reason is that the test set does not contain unseen propagation, data traffic, and driving scheme scenarios. Because time-series data from the radio environment seems highly correlated, the training and test datasets include many similar points. Therefore, although this seems to be the splitting scheme most used in the literature, there is a risk that reported performance is higher than for a deployed system. This should not discourage the use of random sampling. However, the data engineer needs to understand the inherent limitations of this splitting technique and be careful when reporting results. The split by time alleviates to some extent the sample corre- lation, as consecutive samples belong to the same set (training or test). Moreover, the varying propagation environment, due to the changing direction of travel, and differences in speed, result in distributions that are less similar than for the random split (cf. Fig. 8b). Some regions, e.g., around the value five for the second principal component, are only present in the test set. The PCA can be considered a first test on how detailed collection procedures should be and highlights how time- varying components influence differences between the training and test sets. The split by time adds some limitations on the measurement duration as for balanced train and test sets more data than, e.g., for random split is required. The split by measurement run is more appropriate to test model performance under varying and unseen parameters in the measurement procedure, the devices' behavior, and the network. In Fig. 8c, it becomes clear that all these parameters have a substantial effect on the two datasets. Perhaps this is a good way to study the generalization performance of ML models, as a training dataset will never comprise all potential parameter permutations. The ML model makes predictions on samples that can be considered different, e.g., using our PCA evaluation. We consider the split by folds the best splitting strategy for our dataset as it provides enough variation for ML models to be tested on unseen data while alleviating some of the disadvantages of the other splitting strategies. C. Feature Acquisition and Availability Analysis We group different types of features based on the type and the measurement capability of a device into distinct feature groups, see Table III. The table defines a name for the feature group, a corresponding abbreviation that is used throughout the rest of the paper, and the parameters (features) that the feature group inherits. The feature group PHY includes features describing the radio environment, while channel conditions (CHAN) contains related features describing the channel. Feature group base station data (BS) contains parameters that are aggregated per cell. Vehicle information such as position, speed, and distance to the serving cell is included in the feature group vehicle infor- mation (VEH). Finally, the feature group radio environment map (REM) contains statistical information of PHY features and throughput in form of a radio environment map. Since the features are captured from several different net- work nodes, as previously shown in Table I, it is not realistic to assume that all features are readily available at a specific entity such as a vehicle or one of the network nodes. Data acquisition is associated with a cost function that is not constant for different sets of features. Also, confidentiality and privacy concerns could hinder the accessibility to specific features. This should be taken into account for ML models for wireless networks, instead of assuming full data availability, at least without discussing their acquisition costs. Subsequently, we further categorized the previously defined feature groups into different access scenarios. We define these according to possible scenarios in which different sets of feature groups can be collected from exemplary entities. The defined access scenarios can be found in Table IV. The table defines a name for each access scenario, a corresponding abbreviation that is used throughout the rest of the paper, the feature groups which can be accessed, and an exemplary entity corresponding to the access scenario. The first access scenario is modem access (MD) and refers to features available at the modem, such as parameters from feature group PHY, which can often be easily accessed, e.g., via an API. extended modem access (EMD) refers to access to more modem data provided, e.g., by specialized software. Both MD and EMD correspond to data available at a UE, while modem and network access (MDNET), extended modem and network access (EMDNET), and modem, statistics and network access (REMNET) are available for a network operator with varying acquisition costs (in terms of computing and signaling). For example, PHY features are reported by the UE to the network during measurement reports, but these are usually sent after specific events are triggered. On the other hand, features from the CHAN group are reported regularly if the UE receives DL traffic. Since the dataset is based on vehicular measurements, we also introduce access scenarios vehicle and network access (DEVNET) and full device access (DEV) which include VEH features in addition to other feature groups. For comparison, we also include a full access (FULL) access scenario, which has access to all feature groups. The aim of this paper is not to define specific acquisition costs associated with the different access scenarios, but to acknowledge the potential trade-off between data acquisition costs and ML performance and compare the performance in the next section. Additionally, we would like to highlight two aspects in particular: First, there are data acquisition costs, which vary depending on the different feature groups. Second, 10 ML models need to be tested under different assumptions on data availability including concerns of data governance and ownership. D. ML Models for QoS Prediction We briefly introduce different ML models, that are relevant to the prediction task. These include linear regression, ensem- ble methods, and neural networks. In terms of completeness, we also add a statistical model that serves as a baseline. The model hyperparameters were tuned using [60] with 5-fold cross-validation. The split by folds was used to split the dataset into a train and validation set. We used the mean absolute error (MAE) as the cost function. REM of the Throughput: After building a REM of the DL/UL throughput, the predicted value is the interpolated throughput value for the current UE position. This method serves as a statistical baseline. Linear regression (LR): Linear regression is a rela- tively simple statistical model where a dependent variable is explained by multiple independent variables multiplied by coefficients defining their weights. In a ML task, the weights of these coefficients are learned. Random forest (RF): A random forest is an ensemble method based on decision trees. The trees are built indepen- dently and in a regression task, the mean of the individual trees is the prediction result. Our RF is composed of 793 parallel trees with a maximum depth of 19. Gradient-boosted decision tree (GB): Gradient boosting is also an ensemble method based on decision trees. Here, the trees are built sequentially, minimizing the loss function with each new tree. The weighted mean according to the trees' prediction performance is the prediction result. Our GB ensemble is composed of 715 sequential trees with a maximum depth of 10. Multilayer perceptron (MLP): An MLP is a feedforward neural network that stacks together multiple layers of neurons in a sequential architecture. It is a deep learning (DL) model that has been successfully applied to regression problems with labeled tabular datasets. Our MLP consists of four hidden layers 256, 128, 64, and 32 neurons each and rectified linear unit (ReLU) activation functions. It is trained with an Adam optimizer, with a learning rate of 0.001, and a batch size of 16. The parameters of the neural network are initialized randomly. For regularization, we use early stopping with the criterion that training ends when the error does not decrease for eight epochs on a validation dataset. VI. THROUGHPUT PREDICTION In this section, we discuss the throughput prediction task based on ML. The prediction task we picked is to estimate the achieved maximum throughput under a high network load. The high network load conditions mean that the end users have to share the network resources. We start by investigating the performance of different ML models and continue by looking at the performance when different data access scenarios apply. We then compare the influence of the split strategies on the training and test datasets. 11 TABLE III: Overview of feature groups and their parameters. Abbreviation Parameters Feature Group PHY Physical layer CHAN Channel conditions BS Base station data Vehicle information VEH Radio environment map REM Mean RSRP, RSRQ, RSSI, SINR, RSRP margin, RSRQ margin, time since last handover Channel matrix dominant rank index, mean CQI Instantaneous DL/UL cell throughput (with one second resolution), number of active connected devices Position (latitude and longitude), speed, distance to serving cell (engineered from physical cell ID) Radio environment map of PHY features & instantaneous device DL/UL throughput TABLE IV: Overview of network and device access scenarios and corresponding feature groups. Access Scenario Modem access Extended modem access Modem and network access Modem access and statistics Extended modem and network access Modem, statistics and network access Vehicle and network access Full device access Full access Abbreviation MD EMD MDNET MDREM EMDNET REMNET DEVNET DEV FULL Access to Feature Groups PHY PHY, CHAN PHY, BS PHY, REM PHY, CHAN, BS PHY, BS, REM PHY, BS, VEH PHY, CHAN, VEH PHY, CHAN, BS, VEH, REM Exemplary Entity API of operating system (e.g., Android) Specialist software (e.g., MobileInsight [59]) Network operator Mapping and navigation service Network operator Network operator Car manufacturer (with MNO cooperation) Car manufacturer - We continue looking at the effects of sampling on the predic- tion task. Subsequently, we give an example of how much concept drift can deteriorate performance. We conclude by showing that CE can play an important role in ML-related tasks. For all the provided results we report multiple metrics [61], as this allows a more flexible evaluation of the prediction performance for diverse use cases and when applicable we discuss the limitations of specific metrics. A. Model Performance In Tables V and VI, we compare different models on standard regression metrics for the DL and UL direction, respectively. We assume to use all the information available for the prediction (i.e., FULL), consider all environments jointly, and refer to split by folds. Moreover, we relied on all available data samples for performance evaluation. In each table, we highlight the best-performing model per metric in bold. For the DL direction (Table V) the GB outper- forms the other models for all metrics. RF consistently shows slightly lower performance than GB. For the mean absolute percentage error (MAPE), the MLP is on par with GB, but it shows worse performance than GB and RF for most other metrics. Considering the two simpler models, LR outperforms the REM interpolation for most metrics, underlining that the use of context information, which is included in the input features, is crucial for the prediction task. Moreover, as the feature space is not linear, the LR performance is poor. The UL direction (Table VI) mainly corresponds to the per- formance observations in the DL prediction task. We observe that the absolute gap between GB and RF narrows for MAE, median absolute error (MedAE), and root mean square error (RMSE) (due to lower UL data rates), with RF showing similar performance as GB for the R2 score. The UL throughput range (up to 23 Mbps) is smaller than the DL throughput range (up to 70 Mbps), which is reflected in the prediction performance. While the average MAE in UL is significantly smaller than the average MAE in DL, the MAPE of the DL is comparably lower than in UL. As there is a trade-off between maximum performance and acquisition cost, we found that performance metrics, such as MAE, converges at around 5000 training samples. Adding further samples only leads to minor increases in prediction accuracy. However, we note that is specific to our dataset and may not generalize to other datasets because the minimum required dataset size depends on a multitude of factors. Such factors are the environment dynamics, the network dynamics, and the specific use case (i.e. required accuracy). Nevertheless, this result shows that the performance return degrades with an increasing number of samples and measurement campaigns should be planned carefully as there is space for optimizing the data acquisition expenditures. this result In summary, GB proved to be the best-performing model considering both data traffic directions and all metrics. At the same time, the interested reader should note that there are a plethora of ML algorithms that can be applied and provide good performance. The ML engineer can always pick one based on criteria like the model's complexity and the degrees of explainability. As the ensemble methods based on decision trees offer a good degree of explainability and robustness against outliers, we pick GB for the following sections. TABLE V: Performance comparison of different regression models in DL direction. Model MAE MAPE MedAE RMSE RF GB LR MLP REM(y) 2.61 2.46 4.91 2.71 6.80 0.31 0.29 0.78 0.29 0.84 1.67 1.48 3.57 1.59 4.26 3.91 3.77 6.70 4.23 9.97 R2 0.92 0.93 0.77 0.91 0.53 TABLE VI: Performance comparison of different regression models in UL direction. Model MAE MAPE MedAE RMSE RF GB LR MLP REM(y) 1.13 1.08 2.31 1.20 3.20 0.50 0.46 1.79 0.53 0.96 0.79 0.73 1.88 0.75 2.41 1.63 1.58 2.96 1.80 4.28 R2 0.90 0.90 0.66 0.87 0.25 B. Access Scenarios & Feature Groups We continue by looking at a different set of input features and how much these affect the achieved performance. In the literature, input features are very often considered quite alike in terms of acquisition costs. In a real network, there is a cost associated with collecting data from different nodes and end- users. We compare the different prediction performances for the previously defined access scenarios, from Section V, in Tables VII and VIII for DL and UL direction, respectively. In both DL and UL, the performance of different access scenarios is very similar, with the only difference that, in general, for DL the MAPE is significantly lower compared to UL, and the MAE, MedAE, and RMSE are higher for DL due to the larger value range. The worst-performing access scenario in both cases is MD, where only the feature group PHY is used. Prediction for EMD, modem access and statistics (MDREM), and DEV performs slightly better but not by a large margin. This probably indicates that additional channel or statistical/historical information might be beneficial but does not add much useful information in addition to physical layer parameters, which can be obtained easily. The prediction with only UE features (MD/EMD) achieves the worst performance across all presented metrics and access scenarios. However, adding BS features, demonstrated in access scenarios MDNET, EMDNET, REMNET and DEVNET, significantly improves the prediction performance, resulting in a halved prediction error for DL. The same holds true for UL direction except for the MAPE, which is still significantly lower by around 20 − 30 percentage points. Also, the R2 score for both DL and UL is increased to approximately 0.9 once BS features are added. The best prediction performance is achieved when access to all features is provided, which is emphasized by the bold rows for access scenario FULL. As mentioned in the previous section, we introduced this for comparison only, as access to all features is often not realistic or associated with high acquisition costs. However, we see that the performance of FULL is improved by only a small margin compared to the access scenarios including feature group BS - even compared to MDNET, which contains only simple feature group PHY in addition to feature group BS. Thus, MDNET might be a feasible candidate if one tries to find a good trade-off between better performance and lower data acquisition costs. C. Split Strategies As discussed in Section V there are different approaches for splitting the dataset into train and test sets. 12 TABLE VII: Performance comparison of different access scenarios with access to different feature groups in DL using the split by folds. Access scenario MAE MAPE MedAE RMSE MD EMD MDNET MDREM EMDNET REMNET DEVNET DEV FULL 6.21 5.54 2.93 5.81 2.56 2.78 2.68 5.01 2.46 0.62 0.56 0.32 0.53 0.30 0.30 0.29 0.49 0.29 3.86 3.43 1.86 3.46 1.57 1.69 1.65 2.79 1.48 9.27 8.27 4.38 8.85 3.91 4.21 4.07 7.96 3.77 R2 0.56 0.66 0.91 0.62 0.92 0.91 0.92 0.68 0.93 TABLE VIII: Performance comparison of different access scenarios with access to different feature groups in UL using the split by folds. Access scenario MAE MAPE MedAE RMSE R2 MD EMD MDNET MDREM EMDNET REMNET DEVNET DEV FULL 2.93 2.68 1.18 2.62 1.15 1.12 1.14 2.48 1.08 0.97 0.89 0.65 0.73 0.72 0.50 0.56 0.76 0.46 2.12 1.90 0.80 1.89 0.77 0.75 0.80 1.75 0.73 0.38 4.03 0.45 3.72 0.88 1.74 0.48 3.63 1.70 0.89 1.64 0.90 0.89 1.66 0.53 3.49 0.90 1.58 We present results for using different splitting strategies for the DL direction in Table IX. According to all analyzed metrics, the random split, as described above, yields the best prediction results. The performance would likely decrease drastically during deployment, compared to other splits, when the model is presented with new data with a different correlation structure. In our case, the performance of the random split is 56 % bet- ter compared to the split by folds. However, the performance of the random split is likely overly optimistic due to the temporal correlations between samples [50]. Hence, ML models trained with the random split strategy might perform worse on new uncorrelated data that appears in real deployments. As reasoned earlier, performance results obtained with the split by folds are more likely to be more robust to other deployment scenarios. The split by folds achieves the second- best results for most metrics. On the other hand, the performance of the splits by time and split by measurement perform worse, which supports the hypothesis that there is rather a change in the statistics over time. This change can be attributed to the radio environment, as there are different numbers and types of vehicles around during the data collection process. The results above highlight the need for picking a single or a multitude of splitting results for assessing the ML performance for a specific use case. Failure to have a clear splitting strategy might lead to a false estimation of the performance during the deployment phase. In Fig. 9, we show the predicted values against the measured ones. The DL throughput was predicted with the GB model, utilizing the features contained in the FULL access type and TABLE IX: Performance of GB for different splits for DL. Split MAE MAPE MedAE RMSE random time meas folds 1.58 3.66 4.50 2.46 0.18 0.57 0.24 0.29 0.88 2.70 3.44 1.48 2.62 5.10 6.03 3.77 R2 0.97 0.86 0.88 0.93 s / t i b M n i r o r r e e t u l o s b a n a e M 6 4 2 13 EMD MDNET DEVNET FULL 5 10 15 20 Rolling window size Fig. 10: Rolling window response variable. with the biggest change being that the MAE increases by 20 %. We also noticed that the reduction in the sampling intervals made PHY features less relevant and increased the importance of the REM features. The correlation structure of the radio environment can be further exploited to optimize sampling procedures while keeping the ML model's performance within the requirements of a use case. A deeper understanding of the correlation structure of the radio environment can drastically benefit the sampling procedures [45] supporting more efficient ML workflows. TABLE X: Performance of GB for different downsampling periods for DL. Period MAE MAPE MedAE RMSE 1s 2s 3s 4s 5s 10s 2.46 2.66 2.93 3.11 3.58 4.40 0.29 0.30 0.42 0.37 0.40 0.41 1.48 1.69 1.83 1.97 2.02 2.77 3.77 4.08 4.48 4.68 5.71 6.63 R2 0.93 0.91 0.89 0.88 0.84 0.82 E. Prediction Horizon We continue by changing the prediction problem slightly. Instead of predicting the achievable instantaneous throughput, we predict the throughput in sevaral seconds defined by the prediction horizon. This is shown in Fig. 10, for different access scenarios. We see that the access scenario EMD pro- vides poor performance, similar to the previous subsections. The biggest improvement in the prediction error occurs when we include the MDNET access group, which includes the network information. The access scenario performance DE- VNET provides marginal improvements, with the prediction performance dropping slower for longer prediction horizons. Best performance is achieved for access scenario FULL, although after a prediction horizon of 12 seconds, there is no real gain, of any extra-added features, as it performs as well as the DEVNET access scenario. F. Concept Drift and ML As was discussed in Section IV, there are concept shifts occurring frequently in the radio environment. Here, we pro- vide some examples of the degradation of the performance Fig. 9: Visualization of the predicted throughput over the given throughput. using the split by folds. In the figure, we also include two histograms for both axes. As multiple devices were competing for higher throughput, the total capacity of the network was typically split between multiple users making the highest throughput measurements a rarity. That well explains the skewed nature of the distribution. the mean type of The interested reader should note that metrics used in this section, MAE and MAPE, are heavily influenced by the long distribution tails. Therefore we have introduced median-based metrics, such as the MedAE, that are less influenced by a few large outliers. D. Sampling Intervals As discussed in Sections IV and V, the radio envi- ronment has a correlation structure that renders consecutive measurements quite alike. That means that slower sampling intervals might be used to reduce overhead, such as battery consumption and signaling. To showcase that, we compare in Table X results for slower sampling intervals than the GB results in Table V. We see that a 50 percent slower sampling interval (2 s) brings a negligible drop in the performance of an ML model. Even sampling procedures that are 75 percent slower than the initial sampling (4 s) might be used and still, performance could be more than adequate for some use cases, 010203040506070MeasuredthroughputyinMbit/s010203040506070PredictedthroughputˆyinMbit/sThroughputLinearregressionfit02004000250 for cases that ML faces concept drifts. Our example is shown in Table XI, where we trained a model on the suburban environment and afterward assumed that it was deployed on a vehicle traveling across a highway environment. We have seen already in Section IV that while driving from a suburban environment onto a highway, a large number of concept drifts is detected. The performance of the ML algorithm drops drastically, to the level of a statistical baseline as shown from the R2. TABLE XI: Performance of GB model trained on suburban environment and tested on highway environment. Direction MAE MAPE MedAE RMSE DL UL 9.68 3.50 0.47 0.56 5.02 2.33 15.18 5.00 R2 0.05 0.03 G. Consumer Grade Devices The presented results were calculated using data captured by DMEs. As DME is relatively expensive and comes with increased processing and measurement set-up effort, we com- pare it in this section to data from CE. Since CE is significantly more accessible in price and set-up, the question arises to which degree the dataset differs from the DME dataset, and, more specifically, whether a CE dataset can be sufficient for the use case of throughput prediction. For this comparison, we use data only from the vehicles that were equipped both with a CE and a DME (Vehicles 3 and 4) since this creates datasets of roughly the same size and diversity. Moreover, only feature groups PHY and BS were considered, (i.e., access scenario MDNET), to match the more limited feature set availability of the CE. Table XII presents a comparison of prediction results between the CE and the corresponding DME. Both in UL and DL, the different metrics display similar performance. The R2 scores of the CE is slightly better than the DME's. The DME has higher sensitivity and we have seen larger number of outliers at the higher throughput ranges. Such outliers negatively influence the DME's performance. Overall, our findings show that CE can be part of a data collection procedure. More expensive devices might bring some small benefits but with diminishing returns. VII. INTERPRETABILITY AND EXPLAINABILITY OF THE MODELS In this section, we use Shapley additive explanations (SHAP) [62] and accumulated local effects (ALE) [63] for TABLE XII: Performance comparison of different devices in UL and DL with MDNET features. Scenario MAE MAPE MedAE RMSE R2 UL CE (Veh. 3&4) UL DME (Veh. 3&4) DL CE (Veh. 3&4) DL DME (Veh. 3&4) 1.13 0.93 3.37 2.57 0.38 0.41 0.34 0.31 0.74 0.64 2.06 1.71 1.65 1.29 5.17 3.69 0.82 0.81 0.84 0.82 14 (a) DL (b) UL Fig. 11: Feature importance in DL and UL of the five most important features in term of SHAP values. explaining how the input features affect the prediction of the ML model. A. Shapley Additive Explanations SHAP is a framework to explain individual predictions. We use the model-agnostic variant of SHAP as described in [62]. Fig. 11 presents the SHAP values of the five most important features, in DL and UL respectively. The x-axis depicts the SHAP value that describes the impact of the input feature on the prediction. The y-axis depicts the input feature names, and the color represents the numeric input feature value. The cell load feature has both in UL and DL a strong impact on the prediction. A higher cell load value leads to a lower value on the prediction and vice versa. On the other hand, the radio-based features (RSRP, reference signal received quality (RSRQ) and SINR) seem to have the opposite tendency. A higher radio value leads to a higher value on the prediction and vice versa. B. Accumulated Local Effects We then continue using ALE for discovering the global effects of input features. Fig. 12 depicts ALE values for RSRP in UL throughput prediction. The x-axis depicts the RSRP value, the y-axis the effect on the prediction, where a higher input feature value leads to a higher value of the prediction. We note that in the ALE plot seems that there are four re- gions affecting the prediction differently as these are depicted in the figure. We added orange dotted lines at the perceived border of each region. The first one is with the lowest captured RSRP values. The UE needs to get at least some minimum RSRP before it can transmit data. The second region shows 105051015SHAP value (impact on model output)LowHighFeature valueUE DLRank index meanCell load DLSNRRSRQ64202468SHAP value (impact on model output)LowHighFeature valueRSRQRSRPUE ULRSSICell load UL 15 where this assumption is violated, by focusing mostly on the aspect of concept drifts as vehicles move between radio environments. As concept drifts degrade ML performance, a reactive ML method might be needed for retraining the ML models as required, once drifts are detected. Another option is having larger datasets that cover multiple scenarios, like in our testbed, reducing the number of concept drifts that an ML model will face when deployed. A combination of the two methods might be the most feasible way forward. We were able to predict the maximum achievable through- put under high load scenarios, where multiple users compete for maximum throughput in the network, with an MAE of 2.46 and 1.08 Mbps for down- and uplink. In particular, our findings show that the effects of data processing, different validation datasets, and sets of input features can have a very strong overall effect on the ML model performance. For that reason, simply comparing numbers from literature can be misleading. We have seen that GB models outperform neural networks while keeping a balance between complexity and explainability. At the same time, our results clearly show that low-cost consumer-grade devices can be part of ML processes. Their performance falls close to more expensive transceiver chains, further facilitating data collection procedures from end- user's terminals. Moreover, we emphasized the topics of interpretability and explainability, showing that the tested ML models were able to capture the underlying principles without being explicitly programmed. It is interesting to note that the cell load was dis- covered as the most important feature for both communication directions, showcasing the importance of network features for such prediction tasks. Our results indicate that more thorough testing of ML models is needed as complexities coming from the radio environment, the end users, and the effects of the network can considerably affect prediction performance, which might not always be precisely captured by any collected dataset. That can result in high performance variations of ML models, when deployed, that have never seen such effects in their training sets. One can also draw several other conclusions and lessons from this data and its analysis, for the wireless research community and ML engineers alike. First, reporting only the ML performance of models on a specific dataset might provide overly optimistic results. Second, the data collection procedures, the handling, and processing of the data, as well as the way of reporting results, are all equally important in the long chain of ML workflows. Third, results coming from simplified analytical assumptions and simulations should be used with caution. Our results indicate that real-world-captured intricacies might hinder the further performance of ML models than hitherto understood. Although some of these results could be regarded as in- tuitive, they have not been properly emphasized or taken into account in the literature, with only a few exceptions. Especially when it comes to applying ML in wireless networks, there has been a tendency to rate the usefulness of ML models based on their performance on some testing datasets. Our results clearly show that this can often be misleading, and Fig. 12: ALE values for UL RSRP. some linear characteristics. Higher RSRP values seem to contribute to a higher throughput significantly in this range, which demonstrates that the RSRP is contributing strongly to the prediction variable (UL throughput). The third region shows some slight saturation in the linear trend, meaning that higher RSRP values do not contribute considerably more to a higher throughput prediction. The last region looks saturated. This probably means that either higher RSRP values do not provide any benefits for higher rates, or other factors like the cell load play a more important role on the prediction variable. We note that the ML model has discovered these regions from the input features, without being explicitly programmed, which is also close to the operating principles of the cellular networks. The interested reader should note that the absolute numbers of the regions depend to a large extent on the characteristics of the network deployment that include for example the dynamic range of the receivers and the network states captured. Similar type of learnings have been shown in a previous paper [64], which was based on data from an operator in Asia. This increases the confidence that ML is able to learn about wireless environment characteristics on diverse networks and deployments. VIII. CONCLUSION Based on a dedicated measurement campaign, we have presented insights into building reliable ML models for pQoS. Our results go beyond UE data by including network and vehicular information measurements, covering a large range of scenarios. Our measurements reveal many challenges ML models will face in real deployments. Our first contribution discussed methods for improving sampling for the radio environment. Its correlation structure allows improved sampling procedures that reduce energy con- sumption and signaling for sharing collected data. The vehicle speeds do not seem to impact the statistics and characteristics of the collected data strongly, further simplifying the sampling procedures. We have also tested the data stationarity assump- tion, a precondition for many ML models and other theoretical approaches. Even though stationarity often holds true, espe- cially for datasets captured over a longer duration, it should not be expected liberally. We have provided multiple examples 13012011010090807060RSRP432101Effect on prediction (centered)1D ALE Plot - Continuous95% confidence interval more conservative estimates might need to be used. Moreover, the relevant acquisition costs of data are rarely discussed, and we believe that such aspects need to be part of future discussions and proposals. We hope that this publication serves as a starting point in that direction. We believe that ML-based predictions do not only have the potential to improve specific use cases but also serve as an important enabler for a more proactive network. We made more datasets [65, 66] available to the research community that are based on similar collection principles as the ones we described. In the future, we plan to integrate the lessons learned towards methods that can innately handle some of the dynamics we noticed in the radio environment, such as non- stationarities and concept drifts. Moreover, we would like to extend our work toward other KPI metrics, such as latency and the number of dropped packets. Finally, we would like to integrate issues of data governance since, in this study, we did not consider the acquisition cost of the different features in detail. REFERENCES [1] F. Tang, Y. Kawamoto, N. Kato, and J. Liu, "Future intel- ligent and secure vehicular network toward 6G: Machine- learning approaches," Proc. IEEE, vol. 108, no. 2, pp. 292–307, Feb. 2020. [2] K. Tan, D. Bremner, J. Le Kernec, L. Zhang, and M. Imran, "Machine learning in vehicular networking: An overview," Digit. Commun. Netw., vol. 8, no. 1, pp. 18–24, Feb. 2022. [3] H. Ye and G. Y. Li, "Deep reinforcement learning for resource allocation in V2V communications," in Proc. IEEE Int. Conference on Communications (ICC), May 2018, pp. 1–6. [4] N. Zhao, Y.-C. Liang, D. Niyato, Y. Pei, M. Wu, and Y. Jiang, "Deep reinforcement learning for user associ- ation and resource allocation in heterogeneous cellular networks," IEEE Trans. Wireless Commun., vol. 18, no. 11, pp. 5141–5152, Nov. 2019. [5] D. F. K ̈ulzer, F. Debbichi, S. Sta ́nczak, and M. Botsov, "On latency prediction with deep learning and passive probing at high mobility," in Proc. IEEE Int. Conference on Communications (ICC), Jun. 2021, pp. 1–7. [6] D. F. K ̈ulzer, M. Kasparick, A. Palaios, R. Sattiraju, O. D. Ramos-Cantor, D. Wieruch, H. Tchouankem, F. G ̈ottsch, P. Geuer, J. Schwardmann, G. Fettweis, H. D. Schotten, and S. Sta ́nczak, "AI4Mobile: Use cases and challenges of AI-based QoS prediction for high-mobility scenarios," in Proc. IEEE Vehicular Technology Conference (VTC Spring), Apr. 2021, pp. 1–7. [7] M. Boban, A. Kousaridas, K. Manolakis, J. Eichinger, and W. Xu, "Connected roads of the future: Use cases, requirements, and design considerations for vehicle-to- everything communications," IEEE Veh. Technol. Mag., vol. 13, no. 3, pp. 110–123, Sep. 2018. 16 in Proc. IEEE Vehicular Technology Conference (VTC Spring), May 2020, pp. 1–7. [9] S. Shalev-Shwartz and S. Ben-David, Understanding Machine Learning: From Theory to Algorithms. New York, NY, USA: Cambridge University Press, 2014. [10] M. Mohri, A. Rostamizadeh, and A. Talwalkar, Founda- tions of Machine Learning, 2nd ed. Cambridge, MA, USA: MIT Press, 2018. [11] J. Sarnelle, A. Sanchez, R. Capo, J. Haas, and R. Po- likar, "Quantifying the limited and gradual concept drift assumption," in Proc. Int. Joint Conf. on Neural Networks (IJCNN), Jul. 2015, pp. 1–8. [12] I. Redko, E. Morvant, A. Habrard, M. Sebban, and Y. Bennani, Advances in Domain Adaptation Theory. Oxford, UK: Elsevier, 2019. [13] A. Adadi and M. Berrada, "Peeking inside the black-box: A survey on explainable artificial intelligence (XAI)," IEEE Access, vol. 6, pp. 52 138–52 160, Sep. 2018. [14] S. Neumeier, E. A. Walelgne, V. Bajpai, J. Ott, and C. Facchi, "Measuring the feasibility of teleoperated driving in mobile networks," in Proc. Network Traf- fic Measurement and Analysis Conference (TMA), Jun. 2019, pp. 113–120. [15] A. Gaber, W. Nassar, A. M. Mohamed, and M. K. Man- sour, "Feasibility study of teleoperated vehicles using multi-operator LTE connection," in Proc. Int. Conference on Innovative Trends in Communication and Computer Engineering (ITCE), Feb. 2020, pp. 191–195. [16] A. Narayanan, E. Ramadan, R. Mehta, X. Hu, Q. Liu, R. A. Fezeu, U. K. Dayalan, S. Verma, P. Ji, T. Li et al., "Lumos5G: Mapping and predicting commercial mmWave 5G throughput," in Proc. ACM Internet Mea- surement Conference (IMC), Oct. 2020, pp. 176–193. [17] A. Kulkarni, A. Seetharam, A. Ramesh, and J. D. Herath, "Deepchannel: Wireless channel quality prediction using deep learning," IEEE Trans. Veh. Technol., vol. 69, no. 1, pp. 443–456, Jan. 2020. [18] C. F. Mecklenbrauker, A. F. Molisch, J. Karedal, F. Tufvesson, A. Paier, L. Bernado, T. Zemen, O. Klemp, and N. Czink, "Vehicular channel characterization and its implications for wireless system design and perfor- mance," Proc. IEEE, vol. 99, no. 7, pp. 1189–1212, Jul. 2011. [19] M. Lauridsen, I. Rodriguez, L. M. Mikkelsen, L. C. Gimenez, and P. Mogensen, "Verification of 3G and 4G received power measurements in a crowdsourcing Android app," in Proc. IEEE Wireless Communications and Networking Conference (WCNC), Apr. 2016, pp. 1– 6. [20] H. Al-Shamisi, H. Al-Shamsi, I. Kostanic, and J. Zec, "Verifying measurements of reference signal received power (RSRP) on LTE network using an app on An- droid smartphones," in Proc. IEEE Information Technol- ogy, Electronics and Mobile Communication Conference (IEMCON), Nov. 2018, pp. 372–377. [8] L. Torres-Figueroa, H. F. Schepker, and J. Jiru, "QoS evaluation and prediction for C-V2X communication in commercially-deployed LTE and mobile edge networks," [21] R. Enami, Y. Shi, D. Rajan, and J. Camp, "Pre- crowdsourcing: Predicting wireless propagation with phone-based channel quality measurements," Comput. Commun., vol. 132, pp. 96–110, Nov. 2018. [22] A. Ispas, G. Ascheid, C. Schneider, and R. Thoma, "Analysis of local quasi-stationarity regions in an urban macrocell scenario," in Proc. IEEE Vehicular Technology Conference (VTC Spring), May 2010, pp. 1–5. [23] L. Bernad ́o, T. Zemen, F. Tufvesson, A. F. Molisch, and C. F. Mecklenbr ̈auker, "The (in-)validity of the WSSUS assumption in vehicular radio channels," in Proc. IEEE Int. Symp. on Personal, Indoor and Mobile Radio Com- munications (PIMRC), Sep. 2012, pp. 1757–1762. [24] D. Choudhary, A. Kejariwal, and F. Orsini, "On the runtime-efficacy trade-off of anomaly detection tech- niques for real-time streaming data," arXiv preprint arXiv:1710.04735, Oct. 2017. [25] A. A. Cook, G. Mısırlı, and Z. Fan, "Anomaly detection for IoT time-series data: A survey," IEEE Internet Things J., vol. 7, no. 7, pp. 6481–6494, Jul. 2020. [26] J. C. Schlimmer and R. H. Granger, "Incremental learn- ing from noisy data," Mach. Learn., vol. 1, no. 3, p. 317–354, Sep. 1986. [27] H. Mehmood, P. Kostakos, M. Cortes, T. Anagnos- topoulos, S. Pirttikangas, and E. Gilman, "Concept drift adaptation techniques in distributed environment for real- world data streams," Smart Cities, vol. 4, no. 1, pp. 349– 371, Mar. 2021. [28] I. Abbasi, A. R. Javed, C. Chakraborty, N. Jamel, W. Zehra, and Z. Jalil, "ElStream: An ensemble learning approach for concept drift detection in dynamic social big data stream learning," IEEE Access, vol. 9, pp. 66 408 – 66 419, Apr. 2021. [29] F. E. Casado, D. Lema, M. F. Criado, R. Iglesias, C. V. Regueiro, and S. Barro, "Concept drift detection and adaptation for federated and continual learning," Multimed. Tools. Appl., vol. 81, no. 3, pp. 3397–3419, Jan. 2022. [30] B. Zhang, L. Xue, W. Wang, S. Qin, and D. Wang, "Model updating mechanism of concept drift detection in data stream based on classifier pool," EURASIP J. Wirel. Commun. Netw., vol. 2016, pp. 1–7, Sep. 2016. [31] J. Schmid, M. Schneider, A. H ̈oss, and B. Schuller, "A comparison of AI-based throughput prediction for cellular vehicle-to-server communication," in Proc. Int. Wireless Communications & Mobile Computing Confer- ence (IWCMC), Jun. 2019, pp. 471–476. [32] J. Schmid, M. Schneider, A. H ̈oss, and B. Schuller, "A deep learning approach for location independent through- put prediction," in Proc. IEEE Int. Conf. on Connected Vehicles and Expo (ICCVE), Nov. 2019, pp. 1–5. [33] B. Wei, W. Kawakami, K. Kanai, J. Katto, and S. Wang, "TRUST: A TCP throughput prediction method in mo- bile networks," in Proc. IEEE Global Communications Conference (GLOBECOM), Dec. 2018, pp. 1–6. [34] A. Palaios, C. Vielhaus, D. F. K ̈ulzer, R. Sattiraju, J. Fink, M. Kasparick, C. Watermann, G. Fettweis, F. H. P. Fitzek, H. D. Schotten, and S. Sta ́nczak, "Effect of spatial, temporal and network features on uplink and downlink throughput prediction," in Proc. IEEE 5G World Forum (5GWF), Oct. 2021, pp. 418–423. 17 [35] B. Sliwa, H. Schippers, and C. Wietfeld, "Machine learning-enabled data rate prediction for 5G NSA vehicle-to-cloud communications," in Proc. IEEE 5G World Forum (5GWF), Oct. 2021, pp. 299–304. [36] A. S. Khatouni, F. Soro, and D. Giordano, "A machine learning application for latency prediction in operational 4G networks," in Proc. IFIP/IEEE Symp. on Integrated Network and Service Management (IM), Apr. 2019, pp. 71–74. [37] J. D. Mankowitz and A. J. Paverd, "Mobile device- based cellular network coverage analysis using crowd sourcing," in Proc. IEEE Int. Conference on Computer as a Tool (EUROCON), Apr. 2011, pp. 1–6. [38] M. Feltrin and S. Tomasin, "A machine-learning-based handover prediction for anticipatory techniques in Wi-Fi networks," in Proc. Int. Conference on Ubiquitous and Future Networks (ICUFN), Jul. 2018, pp. 341–345. [39] F. Burmeister, N. Schwarzenberg, T. H ̈ossler, and G. Fet- tweis, "Measuring time-varying industrial radio channels for D2D communications on AGVs," in Proc. IEEE Wireless Communications and Networking Conference (WCNC), Mar. 2021, pp. 1–7. [40] S. Farthofer, M. Herlich, C. Maier, S. Pochaba, J. Lack- ner, and P. Dorfinger, "An open mobile communications drive test data set and its use for machine learning," IEEE Open J. Commun. Soc., vol. 3, pp. 1688–1701, Sep. 2022. [41] A. Palaios, P. Geuer, J. Fink, D. F. K ̈ulzer, F. G ̈otsch, M. Kasparick, D. Sch ̈aufele, S. Partani, R. Sattiraju, A. Kumar, F. Burmeister, A. Weinand, C. Vielhaus, F. H. P. Fitzek, G. Fettweis, H. D. Schotten, and S. Sta ́nczak, "Network under control: Multi-vehicle E2E measurements for AI-based QoS prediction," in Proc. IEEE Int. Symposium on Personal, Indoor and Mobile Radio Communications (PIMRC), Sep. 2021, pp. 1432– 1438. [42] Y. Li, C. Peng, Z. Yuan, H. Deng, J. Li, and T. Wang, "MobileInsight: Analyzing Cellular Network Information on Smartphones," GetMobile: Mobile Computing and Communications, vol. 21, no. 1, pp. 39–42, May 2017. [43] Gyokov Solutions, "G-NetTrack Pro," Google Play Store, 2016, accessed: 2022-05-05. [Online]. Available: https://gyokovsolutions.com/manual-g-nettrack [44] "Iperf 3," accessed: 2022-04-25. [Online]. Available: https://github.com/esnet/iperf [45] A. Palaios, J. Riihij ̈arvi, O. Holland, A. Achtzehn, and P. M ̈ah ̈onen, "Measurements of spectrum use in London: Exploratory data analysis and study of temporal, spatial and frequency-domain dynamics," in Proc. IEEE Int. Symp. on Dynamic Spectrum Access Networks (DyS- PAN), Oct. 2012, pp. 154–165. [46] M. Sayed-Mouchaweh and E. Lughofer, Learning in Non-Stationary Environments: Methods and Applica- tions. New York, NY, USA: Springer, 2012. [47] S. Ng and P. Perron, "Unit root tests in ARMA models with data-dependent methods for the selection of the truncation lag," J. Am. Stat. Assoc., vol. 90, no. 429, pp. 268–281, Mar. 1995. [48] N. Perpinias, J. Riihijarvi, and P. Mahonen, "Impact of 18 [62] S. M. Lundberg and S.-I. Lee, "A unified approach to interpreting model predictions," in Proc. Conference on Neural Information Processing Systems (NeurIPS), Dec. 2017, pp. 4765–4774. [63] D. W. Apley and J. Zhu, "Visualizing the effects of predictor variables in black box supervised learning models," J. R. Stat. Soc., B: Stat. Methodol., vol. 82, no. 4, pp. 1059–1086, Sep. 2020. [64] R. Zhohov, A. Palaios, and P. Geuer, "One step further: Tunable and explainable throughput prediction based on large-scale commercial networks," in Proc. IEEE 5G World Forum (5GWF), Oct. 2021, pp. 430–435. [65] R. Hernang ́omez, P. Geuer, A. Palaios, D. Sch ̈aufele, C. Watermann, K. Taleb-Bouhemadi, M. Parvini, A. Krause, S. Partani, C. Vielhaus, M. Kasparick, D. F. K ̈ulzer, F. Burmeister, S. Sta ́nczak, G. Fettweis, H. D. Schotten, and F. H. P. Fitzek, "Berlin V2X: A machine learning dataset from multiple vehicles and radio access technologies," arXiv preprint arXiv:2212.10343, Dec. 2022. [66] R. Hernang ́omez, A. Palaios, C. Watermann, D. Sch ̈aufele, P. Geuer, R. Ismayilov, M. Parvini, A. Krause, M. Kasparick, T. Neugebauer, O. D. Ramos-Cantor, H. Tchouankem, J. L. Calvo, B. Chen, S. Sta ́nczak, and G. Fettweis, "Towards an AI- enabled connected industry: AGV communication and sensor measurement datasets," arXiv preprint arXiv:2301.03364, Jan. 2023. model uncertainties on the accuracy of spatial interpola- tion based coverage estimation," in Proc. IEEE Wireless Communications and Networking Conference (WCNC), Mar. 2017, pp. 1–6. [49] U. Schilcher, C. Bettstetter, and G. Brandner, "Temporal correlation of interference in wireless networks with Rayleigh block fading," IEEE Trans. Mob. Comput., vol. 11, no. 12, pp. 2109–2120, Dec. 2012. [50] D. R. Roberts, V. Bahn, S. Ciuti, M. S. Boyce, J. Elith, G. Guillera-Arroita, S. Hauenstein, J. J. Lahoz-Monfort, B. Schr ̈oder, W. Thuiller, D. I. Warton, B. A. Win- tle, F. Hartig, and C. F. Dormann, "Cross-validation strategies for data with temporal, spatial, hierarchical, or phylogenetic structure," Ecography, vol. 40, no. 8, pp. 913–929, Aug. 2017. [51] G. Widmer and M. Kubat, "Learning in the presence of concept drift and hidden contexts," Machine Learning, vol. 23, no. 1, pp. 69–101, Apr. 1996. [52] A. Tsymbal, "The problem of concept drift: definitions and related work," Computer Science Department, Trinity College Dublin, vol. 106, no. 2, pp. 58–64, Apr. 2004, Tech. Rep. TCD-CS-2004-15. [53] R. Elwell and R. Polikar, "Incremental learning of con- cept drift in nonstationary environments," IEEE Trans. Neural Netw., vol. 22, no. 10, pp. 1517–1531, Oct. 2011. [54] J. Lu, A. Liu, F. Dong, F. Gu, J. Gama, and G. Zhang, "Learning under concept drift: A review," IEEE Trans. Knowl. Data Eng., vol. 31, no. 12, pp. 2346–2363, Dec. 2019. [55] L. Baier, J. Reimold, and N. K ̈uhl, "Handling concept drift for predictions in business process mining," in Proc. IEEE Conf. on Business Informatics (CBI), Jun. 2020, pp. 76–83. [56] G. Ditzler and R. Polikar, "Incremental learning of con- cept drift from streaming imbalanced data," IEEE Trans. Knowl. Data Eng., vol. 25, no. 10, pp. 2283–2301, Oct. 2013. [57] S. Wang, L. L. Minku, and X. Yao, "A systematic study of online class imbalance learning with concept drift," IEEE Trans. Neural Netw. Learn. Syst., vol. 29, no. 10, pp. 4802–4821, Oct. 2018. [58] R. Hernang ́omez, A. Palaios, G. Guruvayoorappan, M. Kasparick, N. U. Ain, and S. Sta ́nczak, "Online QoS estimation for vehicular radio environments," in Proc. European Signal Processing Conference (EUSIPCO), Aug. 2022, pp. 1701–1705. [59] Y. Li, C. Peng, Z. Yuan, J. Li, H. Deng, and T. Wang, "MobileInsight: Extracting and analyzing cellular net- work information on smartphones," in Proc. ACM Int. Conference on Mobile Computing and Networking (Mo- biCom), Oct. 2016, pp. 202–215. [60] T. Akiba, S. Sano, T. Yanase, T. Ohta, and M. Koyama, "Optuna: A next-generation hyperparameter optimization framework," in Proc. ACM SIGKDD Int. Conf. on Knowl- edge Discovery and Data Mining (KDD), Jul. 2019, p. 2623–2631. [61] M. Kuhn and K. Johnson, Applied Predictive Modeling. New York, NY, USA: Springer, 2013.
http://arxiv.org/abs/2302.11963v2
2023-03-24T13:40:27
2023-02-23T12:23:35
Investigating Catastrophic Overfitting in Fast Adversarial Training: A Self-fitting Perspective
Although fast adversarial training provides an efficient approach for building robust networks, it may suffer from a serious problem known as catastrophic overfitting (CO), where multi-step robust accuracy suddenly collapses to zero. In this paper, we for the first time decouple single-step adversarial examples into data-information and self-information, which reveals an interesting phenomenon called "self-fitting". Self-fitting, i.e., the network learns the self-information embedded in single-step perturbations, naturally leads to the occurrence of CO. When self-fitting occurs, the network experiences an obvious "channel differentiation" phenomenon that some convolution channels accounting for recognizing self-information become dominant, while others for data-information are suppressed. In this way, the network can only recognize images with sufficient self-information and loses generalization ability to other types of data. Based on self-fitting, we provide new insights into the existing methods to mitigate CO and extend CO to multi-step adversarial training. Our findings reveal a self-learning mechanism in adversarial training and open up new perspectives for suppressing different kinds of information to mitigate CO.
[ "Zhengbao He", "Tao Li", "Sizhe Chen", "Xiaolin Huang" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11963v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11963v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "cs.AI", "cs.CV" ]
Investigating Catastrophic Overfitting in Fast Adversarial Training: A Self-fitting Perspective Zhengbao He Sizhe Chen Xiaolin Huang* Department of Automation, Shanghai Jiao Tong University {lstefanie, li.tao, sizhe.chen, xiaolinhuang}@sjtu.edu.cn Tao Li 3 2 0 2 r a M 4 2 ] G L . s c [ 2 v 3 6 9 1 1 . 2 0 3 2 : v i X r a Abstract Although fast adversarial training provides an effi- cient approach for building robust networks, it may suf- fer from a serious problem known as catastrophic overfit- ting (CO), where multi-step robust accuracy suddenly col- lapses to zero. In this paper, we for the first time decouple single-step adversarial examples into data-information and self-information, which reveals an interesting phenomenon called "self-fitting". Self-fitting, i.e., the network learns the self-information embedded in single-step perturbations, naturally leads to the occurrence of CO. When self-fitting occurs, the network experiences an obvious "channel dif- ferentiation" phenomenon that some convolution channels accounting for recognizing self-information become domi- nant, while others for data-information are suppressed. In this way, the network can only recognize images with suf- ficient self-information and loses generalization ability to other types of data. Based on self-fitting, we provide new insights into the existing methods to mitigate CO and ex- tend CO to multi-step adversarial training. Our findings re- veal a self-learning mechanism in adversarial training and open up new perspectives for suppressing different kinds of information to mitigate CO. 1. Introduction Deep neural networks (DNNs) suffer from a significant threat from adversarial attacks, which deceive DNNs by adding invisible perturbations to the inputs [26]. In this re- gard, how to defend DNNs against such malicious attacks has attracted much attention [5, 6, 10, 18, 30]. Adversar- ial training (AT), which directly augments the datasets with adversarial examples (AEs), is considered one of the most effective defense methods [18]. However, standard AT con- *This work was partially supported by National Natural Science Foun- dation of China (61977046), Research Program of Shanghai Municipal Science and Technology Committee (22511105600), and Shanghai Munic- ipal Science and Technology Major Project (2021SHZDZX0102). Xiaolin Huang is the corresponding author. Illustration of self-fitting and channel differentiation Figure 1. phenomenon. (Left) A network with CO has a clean accuracy of 75.9% and an FGSM accuracy of 99.3%. The prediction of FGSM examples is determined by the label used to generate single-step perturbation, which suggests that the DNN learns to recognize the self-information that the network embeds in the single-step per- (Right) After pruning only one channel, the pertur- turbation. bation becomes adversarial again, leading to a drop of 86.3% in FGSM accuracy, while the clean accuracy only increases by 0.4%. The pruned channel recognizes FGSM examples which contain self-information while others recognize clean examples, suggest- ing that different parts fit different kinds of information. sumes great computation as it involves multiple forward and backward propagations to generate adversarial examples. To address such prohibitive burdens, single-step adver- sarial training (also known as fast adversarial training, FAT [28]) is proposed to generate adversarial examples effi- ciently via simply one-step gradient propagation. Unfor- tunately, a severe issue arises that during the training where multi-step (PGD) robust accuracy [18] can suddenly drop to zero within a few epochs, while the single-step robust accuracy increases rapidly. Such dramatic phenomenon is referred as "catastrophic overfitting" (CO) [28]. Currently, methods for resolving CO can be broadly clas- sified into two categories: generating diverse AEs [4,15,34] and applying proper regularization techniques [2,24]. These methods are designed based on a consensus that DNNs lose 1 robustness against multi-step attacks due to overfitting to single-step adversarial examples. More specifically, most of them have either directly or implicitly argued that the generated adversarial perturbations are "meaningless" af- ter CO, rendering them to be ineffective for model robust- ness [2, 19]. There are also some recent works studying CO from a data-feature perspective, trying to create a connec- tion between single-step AEs and the intrinsic properties of data distribution [32]. However, the effects of model infor- mation on generating AEs have not been studied, and we will demonstrate its importance in our research. In this paper, we decouple single-step AEs after CO into two parts: the data-information part and the self- information part. Based on this, we then interpret CO from a new "self-fitting" perspective that DNN eventually learns to recognize the self-information embedded in the single- step adversarial perturbations. Instead of being harmful, such self-information conversely helps the network rec- ognize single-step AEs, which were considered meaning- less previously. For example, on a ResNet18 [12] trained on Cifar10 [16], even if the target labels are completely shuffled, the network still holds an FGSM (Fast Gradient Sign Method [11]) robust accuracy of 90% after CO, which should be under 10% for a normal trained network due to meaningless labels and attack operations. This suggests that after CO, the network makes predictions mainly based on adversarial perturbations, i.e., the self-information, instead of the data information. In this way, the network prediction is consistent with the random labels for generating AEs. In more detail, DNNs use different structures to learn dif- ferent information [13, 21, 27]. We find that this is also true for self-fitting such that there are special channels for fitting self-information, namely "channel differentiation". Specif- ically, channels with high variance mainly recognize attack information, i.e., the self-information, while other channels identify clean examples. As shown in Fig. 1, by pruning only one channel with the highest variance, the FGSM ac- curacy of a ResNet18 with CO decreases from 99.3% to 13.0%, while the clean accuracy increases from 75.9% to 76.3%. That is this channel is mainly in charge of recogniz- ing the self-fitting information. From the view of self-fitting, we further give new in- sights into the existing methods to mitigate CO. For exam- ple, only adversarial initialization cannot prevent CO while proper regularization is necessary. We could postpone the happening of CO by suppressing channels that recognize self-fitting information. We also extend CO to multi-step AT, revealing that CO can also happen in multi-step AT with few iterations or large step sizes. Besides, the chan- nel differentiation provides a new starting point for study- ing single-step adversarial training from the perspective of network parameters, which can help us explore the training dynamics. Our contributions can be summarized as follows: • We propose "self-fitting", a novel perspective to inter- pret catastrophic overfitting in fast adversarial training. • We delve into the changes of network structure during CO, pointing out that there are some special channels for fitting self-information, i.e., the "channel differen- tiation" phenomenon. • Based on self-fitting, we provide new insights into pre- vious methods for mitigating CO, and also extend CO to multi-step AT. 2. Related work 2.1. Adversarial Attack Since DNNs are discovered vulnerable to adversarial ex- amples [26], a family of methods are proposed to generate AEs. FGSM [11] and PGD [18] are two popular white- box attack algorithms that craft AEs according to the gra- dient of loss w.r.t. to input. Square attack [1] is a state-of- the-art black-box attack which iteratively crafts adversar- ial examples without gradients by only querying the DNN's outputs, and there have been special defense for query at- tacks [7, 29]. AutoAttack (AA) ensembles four attack algo- rithms, including two white-box attack algorithms and two black-box attack algorithms [8]. AA is recognized as one of the strongest attack algorithms and is widely used to evalu- ate adversarial robustness. 2.2. Efficient Adversarial Training Adversarial training [17,18] is considered to be the most effective way to defend against adversarial attacks by aug- menting training data with adversarial examples. Since the generation of AEs is time-consuming, many variants of AT try to improve training efficiency. Free AT [23] updates net- work parameters while generating AEs at the same time. YOPO [33] restricts most of the forward and back propa- gation within the first layer of the network during AE up- dates. Fast AT [28] replace multi-step attacks with FGSM and generate AEs with single-step gradient. 2.3. Catastrophic Overfitting Although Fast AT can achieve comparable performance to multi-step AT, it suffers from catastrophic overfitting, i.e., the PGD accuracy drops to zero while the FGSM accuracy increases quickly within a few epochs. Some works mit- igate CO by generating more adversarial examples. For example, ATTA [34] combines AEs of the last epoch and gradient of the current epoch, and N-FGSM [9] generates AEs using a stronger noise without clipping the perturba- tion. Other works apply strong regularization terms to sta- bilize the training. For example, GradAlign [2] prevents CO by maximizing the gradient alignment around clean exam- ples to reserve local linearity. Compared to the consensus 2 that the adversarial perturbations become "meaningless" af- ter CO, we reveal that they contain much model informa- tion (self-information) to conversely facilitate the network recognition. 3. Self-fitting phenomenon in FAT Standard adversarial training [18] can be formatted as a min-max problem as: min θ E(x,y)∈D (cid:20) max δ≤(cid:15) (cid:21) (cid:96)θ(x + δ, y) , (1) where θ ∈ Rn denotes network parameters; y is the ground- truth label of sample x ∈ Rd from training set D; δ ∈ Rd is the adversarial perturbation constrained with the norm bound (cid:15); x + δ denotes the adversarial sample; (cid:96)θ(*) is the loss function correspond to the specific parameter θ. In FAT, for a certain sample pair (x, y), the optimized objective can be written as: min θ (cid:96)θ(x + α * δ(x, θ), y), (2) where δ(x, θ) = sign (∇x(cid:96)θ(x, y)). Origin data x control data information while model parameters θ control informa- tion from the network, i.e., self-information. Note that dif- ferent y correspond to different weights in the linear layer of θ. As a result, y can also control the self-information based on θ. Normal adversarial training should balance the informa- tion from both data and the network itself. The former helps the network to learn meaningful knowledge from the dataset while the latter enables the network to resist a wide range of unknown attacks. If δ is only determined by θ, the net- work may only reserve robustness to specific attacks, such as universal adversarial training [3] where different x share a common δ. If δ is only determined by x and independent with δ, the network can only gain black-box robustness, as discussed by [31]. Thus, fitting the information of the net- work with proper δ is the key for AT to achieve white-box robustness. However, it is hard to decouple the two kinds of infor- mation since x + α * δ(x, y) is sent back to network as a whole when performing the model parameter optimization. When α is large enough, δ may become the main basis for network classification. If the network pays much attention to its self-information in δ, the network may overfit one spe- cific attack. As a result, the prediction is determined by only self-information and is irrelevant to the data-information. In other words, the perturbation is not harmful but useful for the network to recognize adversarial examples. This short- cut solution has a low loss value but is hard to generalize to other attacks or even the original dataset because data- information is unimportant for classification under such a Figure 2. FGSM-AT training with different (cid:15) on Cifar10 using ResNet18. Catastrophic overfitting happens at 23rd epoch for (cid:15) = 8/255 and 10th epoch for (cid:15) = 16/255. Line "Train" accuracy is the FGSM accuracy of the training set. Line "RL-Train" accuracy is the random-label FGSM accuracy of the training set. Line "Test PGD" accuracy is the PGD10 accuracy of the test set. shortcut solution. We name the possible shortcut solution as "self-fitting". The above analysis illustrates the possible existence of self-fitting in adversarial training, which may lead to ab- normal behavior during the training process. In this sec- tion, we probe this experimentally and show that there is a connection between self-fitting and catastrophic overfitting (CO). We argue that self-fitting could be a primary underly- ing cause for the occurrence of CO - δ contains the label information y and eventually dominates the predictions. In order to demonstrate the self-fitting phenomenon in CO, we first train ResNet18 on Cifar10 with FGSM-AT method [28] with different (cid:15). The training curve is shown in Fig. 2. Catastrophic overfitting happens at 23rd epoch for (cid:15) = 8/255 and 10th epoch for (cid:15) = 16/255. The following experiment is designed to observe if the prediction changes with the self-information change. Since y can also control the self-information in sign (∇δ(cid:96)θ(x, y)), we fix origin samples xori and change labels y to gener- ate adversarial perturbations with different self-information and test the random-label FGSM accuracy (RL-FGSM ac- curacy) of a network after CO. Practically, we first assign each sample a random label before testing, and then gener- ate the adversarial example w.r.t. that random label, i.e.: xrandom = xori + α * sign (∇δ(cid:96)θ(xori, yrandom)) , where α = (cid:15) is the attack step size. Then accuracy is calcu- lated by comparing the prediction fθ(xrandom) and random label yrandom, where fθ(*) represents the parametric model 3 020406080100Epoch020406080100Accuracyeps=8, Traineps=8, RL-Traineps=8, Test PGD020406080100Epoch020406080100Accuracyeps=16, Traineps=16, RL-Traineps=16, Test PGD with θ. For a normal trained model, the accuracy on a com- pletely shuffled dataset should be 10%. After FGSM attack, the accuracy is anticipated to drop below 10%. We test the RL-FGSM accuracy of checkpoints saved at the end of each epoch for different (cid:15). The result is shown in Fig. 2. We show results using the training set, but similar ones can be observed in the test set. From the experiments, we can conclude that: i) The RL-FGSM accuracy of a network with CO is more than 10%, which suggests that for those FGSM examples gener- ated with wrong labels, the network can recognize the self- information embedded in the single-step adversarial pertur- bation and predict those AEs as specific random labels. We randomly choose one example from the test set and perform 10 FGSM attacks with different classes as the ground-truth. Fig. 3 visualizes the output probability of the network in the corresponding class when the step size of FGSM per- turbation gradually increases. We observe that when the step size is small, the perturbation can fool the network to misclassify AEs, which agrees with the decision boundary distortion phenomenon discovered by [15]. But more sur- prisingly, not only the perturbation generated with the right label but also the perturbation generated with other labels can help the network classify single-step AE as the corre- sponding label when the step size is close to (cid:15). ii) As catas- trophic overfitting (CO) occurs, the RL-FGSM accuracy of the network gradually increases with further training, which suggests that the network alters its learning approach and starts to acquire the capability to identify self-information. Consequently, it suddenly loses robustness to other attacks. iii) The network trained with larger (cid:15) exhibits higher RL- FGSM accuracy, with a maximum value exceeding 90%. In contrast, the maximum value of the network trained with (cid:15) = 8/255 is only about 40%. This discrepancy may be due to the fact that larger (cid:15) embed stronger self-information into the adversarial perturbation, making it more likely for the network to identify the self-information in single-step AEs while ignoring the information of original distribution. Previous works [2, 15, 19] have either directly or implic- itly argued that the adversarial perturbation becomes mean- ingless after CO so that the network recognize single-step AEs in the same way it recognizes clean examples. How- ever, this explanation fails to account for the low clean ac- curacy on original distribution after CO, especially when perturbation budget is large (for example, (cid:15) = 16/255). A more plausible hypothesis is that the distribution of single- step AEs after CO is distinct from the distribution of the original adversarial examples and the distribution of clean examples. As mentioned above, an adversarial-training net- work may prioritize self-information in adversarial pertur- bation. We think the change in adversarial distribution is the result of the network starting to learn the self-information embedded in adversarial perturbation when CO happens. Figure 3. Visualization of the probability of the network in the corresponding classes when the step size of FGSM perturbation gradually increases. The original class is class 4. The network is trained with (cid:15) = 16/255. This phenomenon that a network is capable to embed la- bel information into adversarial perturbation (gradient sign) and recognize the label used when generating adversarial examples could be named "self-fitting". Because the label information is generated through attacking the network, fit- ting label information of adversarial examples is fitting the network itself. 4. Channel differentiation GradAlign [2] proposes that in a single-layer CNN, a Laplace filter that can amplify high-frequency noise grows in magnitude and outcoming weights when CO happens. Motivated by their findings, we want to further explore whether there is any part that plays a decisive role in rec- ognizing self-information for a more complex network. Since the network interacts directly with the perturba- tion via the first layer, we concentrate our analysis on the first layer, as done in [33]. To further study the non-linear the features of all train- characteristics of the network, ing data after the first activation layer are extracted. For example, in ResNet18, we investigate the features f = relu(bn(conv(xFGSM))), where xFGSM is the FGSM exam- ples; conv(*), bn(*) and relu(*) respectively represent the first Convolution layer, the first BatchNorm layer and the first activation layer. By concatenating the features of all training examples, we can obtain a tensor with the shape of (N, C, H, W ), where N represents the number of training examples, C represents the number of channels, H repre- sents the feature height, and W represents the feature width. In a ResNet18 network, C is equal to 64. A simple intuition is that the greater the variance of data, the more information it contains. Therefore, we can utilize the channel variance as a metric to evaluate the significance of different channels. Channels with higher variances are 4 0246810121416Step size(pixel)0.00.20.40.60.81.0Output probabilityclass:0class:1class:2class:3class:4class:5class:6class:7class:8class:9 Table 1. Accuracy drop of different networks on Cifar10 using ResNet18 with (cid:15) = 8/255. Compared to the network without CO, the network with CO has a large drop in FGSM accuracy while little change in clean accuracy. CLEAN FGSM PGD W/O CO, NOT PRUNED W/O CO, PRUNED 75.2% -0.4% 50.0% 41.5% 0.4% -2.6% WITH CO, NOT PRUNED WITH CO, PRUNED 75.9% 0.1% 99.3% -0.4% -86.3% -2.2% information) and other channels recognize clean examples. We also calculated the variance of the corresponding pa- rameters for different channels (a large parameter variance means that this channel mainly extracts high-frequency in- formation) and find that channels with high feature variance also have high parameter variance. In general, channels that identify high-frequency information are gradually taking a dominant role in the recognition of single-step AEs. Even- tually, the over-reliance on these channels leads to the oc- currence of CO. Figure 5. Training curves of original training and the network with CO after pruning high-variance channels on Cifar10 using ResNet18 with (cid:15) = 8/255. After pruning, the network can regain PGD robustness for some epochs. To further observe the effect of high-variance channels on training, we continue the training after setting the pa- rameters associated with the pruned channel with the high- est variance to zero. Fig.5 shows that pruned high-variance channels can help the network recover robustness quickly after a short training and delay the occurrence of CO. 5. Further Discussion Is adversarial initialization sufficient to prevent FAT from falling into self-fitting? Some works [4,14,24] claim that better initialization can help to generate more adversar- ial examples and then mitigate the occurrence of CO. But from the perspective of self-fitting, simply improving the 5 Figure 4. The variance values in descending order of networks with and without the CO trained on Cifar10 using ResNet18 with (cid:15) = 8/255. The network with CO has a larger maximum variance value and more zero variance channels. considered more crucial than those with lower variances. We then calculate the feature variance of different channels extracted from the entire training data and sort them in de- scending order. The variance curves of different network checkpoints (with/without CO) in a single training exper- iment are illustrated in Fig. 4. Two prominent phenomena can be observed: i) The variance curve of the first few chan- nels becomes notably steeper after CO, indicating a sig- nificant enhancement in the information contained in these channels. More specifically, the information contained in these enhanced channels could help recognize FGSM ex- amples. ii) For the part of smaller variance values, there are many channels with nearly zero variance after CO. Upon closer inspection, we notice that these channels are virtu- ally "dead" after CO, as their corresponding variance values approach zero. These two phenomena suggest that after CO, the network may become too dependent on channels with high vari- ance after CO and might ignore other channels with lower variance. To verify this hypothesis, we prune one channel with the highest variance and re-evaluate the clean accuracy and FGSM accuracy to investigate the role of high-variance channels in recognizing clean and FGSM examples. This result in Tab. 1 suggests that the channels with high vari- ance after CO are indeed crucial for the network to rec- ognize FGSM examples. The drastic decrease in FGSM accuracy indicates that the network after CO heavily relies on these channels to recognize FGSM examples with self- information. Meanwhile, the small change in clean accu- racy and PGD accuracy suggests that these channels do not play a significant role in recognizing clean examples or in defending against more sophisticated attacks like PGD. This suggests there is a "channel differentiation" phe- nomenon after CO, i.e., different channels identify differ- ent kinds of examples. Channels with high feature variance mainly recognize single-step AEs (containing much self- 0102030405060Order012345Variance ValueWithout COWith CO020406080100Epoch020406080100AccuracyOrigin:TrainOrigin:Test PGDPruning:TrainPruning:Test PGD initialization without applying regularization to the training process cannot prevent networks from recognizing the self- information. When enough self-information is added on in- puts, i.e., (cid:15) is large enough, the network could still find the shortcut solution and fall into self-fitting. To explore whether adversarial initialization can mitigate CO, a ResNet18 is trained on Cifar10 with (cid:15) = 16 follow- ing the experiment settings in Fig. 2. The only difference is that a PGD attack with 7 steps is used here to find an ad- versarial initialization before adding the single-step pertur- bation. Fig. 6 shows that even with a sufficiently adversar- ial initialization, CO stills happens when (cid:15) is large enough. Compared to training with the random initialization, train- ing with PGD-7 as initialization is less stable and can regain robustness sometimes. However, after long enough training, CO still happens with such an initialization. in xFGSM can be captured by the network. CO also happens in multi-step adversarial training. The results above focus on self-fitting in FAT, but self-fitting should also happen in multi-step adversarial training. To ex- plore whether CO would happen in multi-step AT, we train ResNet18 on Cifar10 with different iterations and step sizes using a PGD attack. The results in Fig. 7 suggest that in some settings, the test robust accuracy would drop to nearly 0, which means CO still happens in multi-step AT as ex- pected. Firstly, for large step size α(α ≥ 12/255), increas- ing iterations cannot prevent networks from CO. Secondly, by fixing the iteration number, the robust accuracy rate rises and then falls as α increases. When α is small, increasing it can generate more adversarial examples. When α is large, increasing it leads to the decrease of robust accuracy, with first robust overfitting and finally catastrophic overfitting. Figure 6. FGSM-AT with PGD-7 perturbation initialization. We observe catastrophic overfitting still happens Regularization can help mitigate CO. Some works add proper regularization terms in loss function to guide the training, such as GradAlign [2] and NuAT [25]. From the perspective of self-fitting, these regularization terms pre- vent the network from directly using self-information for classification by matching certain properties of original ex- amples with those of adversarial examples. To some ex- tent, these regularization terms interfere with the learning of self-information while helping identify clean samples or randomly perturbed samples, thereby avoiding CO. For example, [2] found that after CO a dramatic decrease in local linearity happens. After CO the network turns to recognize self-information instead of data information. As a consequence, even though the original data point x and the data point after the random perturbation x + δ0 are close on the original data manifold, they are far from each other on the self-information manifold. The gradients at these two points are nearly orthogonal to each other. Thus, increasing the cosine similarity of x and x + δ0 can exclude the influ- ence of self-information and the mitigate CO. We also ob- serve that aligning the gradient of x and xFGSM cannot pre- vent CO, since in this regularization term self-information Figure 7. Robust accuracy of multi-step AT with different itera- tions and step sizes. (cid:15) = 16/255 and the robust accuracy is the minimum value of the last half training, tested with a PGD-10 at- tack with random start. 6. Conclusion In this paper, we propose a novel perspective, i.e., self- fitting, to interpret catastrophic overfitting in fast adversarial training. Self-fitting reveals a possible shortcut solution in adversarial training that an AT-trained DNN can embed self- information into adversarial perturbation for classification while ignoring data-information. Moreover, we also find a "channel differentiation" phenomenon that different chan- nels of the network's first layer recognize different types of examples, which gives further evidence that part of the net- work is dedicated to recognizing self-information. Based on self-fitting, we can explain the existing method to miti- gate CO and extend CO to multi-step AT. We believe that the interaction between the model and adversarial perturba- tion is an important reason for CO. Our findings provide a new perspective on CO prevention that how to preserve the adversarial properties of AEs while reducing the influence of self-information. 6 020406080100Epoch020406080100Accuracyeps=16, Traineps=16, RL-Traineps=16, Test PGD468101214Step size0510152025Robust accuracyiter=2iter=3iter=4iter=5iter=6 References [1] Maksym Andriushchenko, Francesco Croce, Nicolas Flam- marion, and Matthias Hein. Square attack: A query-efficient black-box adversarial attack via random search. In the Eu- ropean Conference on Computer Vision (ECCV), pages 484– 501, 2020. 2 [2] Maksym Andriushchenko and Nicolas Flammarion. Un- derstanding and improving fast adversarial training. Ad- vances in Neural Information Processing Systems (NeurIPS), 33:16048–16059, 2020. 1, 2, 4, 6 [3] Philipp Benz, Chaoning Zhang, Adil Karjauv, and In So Kweon. Universal adversarial training with class-wise per- turbations. In IEEE International Conference on Multimedia and Expo (ICME), pages 1–6, 2021. 3 [4] Jinghui Chen, Yu Cheng, Zhe Gan, Quanquan Gu, and Jingjing Liu. Efficient robust training via backward smooth- In Proceedings of the AAAI Conference on Artificial ing. Intelligence, volume 36, pages 6222–6230, 2022. 1, 5 [5] Sizhe Chen, Fan He, Xiaolin Huang, and Kun Zhang. Rele- vance attack on detectors. In Pattern Recognition (PR), page 108491, 2022. 1 [6] Sizhe Chen, Zhengbao He, Chengjin Sun, Jie Yang, and Xiaolin Huang. Universal adversarial attack on attention IEEE Transactions and the resulting dataset damagenet. on Pattern Analysis and Machine Intelligence (TPAMI), 44(4):2188–2197, 2020. 1 [7] Sizhe Chen, Zhehao Huang, Qinghua Tao, Yingwen Wu, Ci- hang Xie, and Xiaolin Huang. Adversarial attack on attack- ers: Post-process to mitigate black-box score-based query attacks. In Advances in Neural Information Processing Sys- tems (NeurIPS), 2022. 2 [8] Francesco Croce and Matthias Hein. Reliable evalua- tion of adversarial robustness with an ensemble of diverse parameter-free attacks. In International Conference on Ma- chine Learning (ICML), pages 2206–2216, 2020. 2 [9] Pau de Jorge, Adel Bibi, Riccardo Volpi, Amartya Sanyal, Philip Torr, Gr ́egory Rogez, and Puneet K. Dokania. To- wards fast and effective single-step adversarial training, 2022. 2 [10] Zhitao Gong, Wenlu Wang, and Wei-Shinn Ku. Ad- arXiv preprint versarial and clean data are not twins. arXiv:1704.04960, 2017. 1 [11] Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. In Inter- Explaining and harnessing adversarial examples. national Conference on Learning Representations (ICLR), 2015. 2 [12] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016. 2 [13] Hassan Ismail Fawaz, Germain Forestier, Jonathan Weber, Lhassane Idoumghar, and Pierre-Alain Muller. Deep learn- ing for time series classification: a review. Data mining and knowledge discovery, pages 917–963, 2019. 2 [14] Xiaojun Jia, Yong Zhang, Xingxing Wei, Baoyuan Wu, Ke Ma, Jue Wang, and Xiaochun Cao. Prior-guided adversar- In the Euro- ial initialization for fast adversarial training. 7 pean Conference on Computer Vision (ECCV), pages 567– 584, 2022. 5 [15] Hoki Kim, Woojin Lee, and Jaewook Lee. Understanding catastrophic overfitting in single-step adversarial training. In Proceedings of the AAAI Conference on Artificial Intelli- gence, volume 35, pages 8119–8127, 2021. 1, 4 [16] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images, 2009. 2 [17] Tao Li, Yingwen Wu, Sizhe Chen, Kun Fang, and Xiaolin Huang. Subspace adversarial training. In IEEE/CVF Confer- ence on Computer Vision and Pattern Recognition (CVPR), pages 13409–13418, 2022. 2 [18] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Con- ference on Learning Representations (ICLR), 2018. 1, 2, 3 [19] Guillermo Ortiz-Jimenez, Pau de Jorge, Amartya Sanyal, Adel Bibi, Puneet K. Dokania, Pascal Frossard, Gr ́egory Ro- gez, and Philip Torr. Catastrophic overfitting is a bug but it is caused by features, 2023. 2, 4 [20] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zem- ing Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning li- In Advances in Neural Information Processing Sys- brary. tems (NeurIPS), pages 8024–8035, 2019. 9 [21] Aseem Patil and Milind Rane. Convolutional neural net- works: an overview and its applications in pattern recogni- tion. Information and Communication Technology for Intel- ligent Systems: Proceedings of ICTIS 2020, Volume 1, pages 21–30, 2021. 2 [22] Ning Qian. On the momentum term in gradient descent learning algorithms. Neural networks, 12(1):145–151, 1999. 9 [23] Ali Shafahi, Mahyar Najibi, Mohammad Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! Advances in Neural Information Processing Systems (NeurIPS), 32:3353–3364, 2019. 2 [24] Gaurang Sriramanan, Sravanti Addepalli, Arya Baburaj, et al. Guided adversarial attack for evaluating and enhanc- ing adversarial defenses. In Advances in Neural Information Processing Systems (NeurIPS), volume 33, pages 20297– 20308, 2020. 1, 5 [25] Gaurang Sriramanan, Sravanti Addepalli, Arya Baburaj, et al. Towards efficient and effective adversarial training. Ad- vances in Neural Information Processing Systems (NeurIPS), 34:11821–11833, 2021. 6 [26] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. In International Intriguing properties of neural networks. Conference on Learning Representations (ICLR), 2014. 1, 2 [27] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszko- reit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeurIPS), 2017. 2 [28] Eric Wong, Leslie Rice, and J. Zico Kolter. Fast is better In International than free: Revisiting adversarial training. Conference on Learning Representations (ICLR), 2020. 1, 2, 3, 9 [29] Yingwen Wu, Sizhe Chen, Kun Fang, and Xiaolin Huang. Unifying gradients to improve real-world robustness for deep networks. arXiv preprint arXiv:2208.06228, 2022. 2 [30] Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan L. Yuille. Mitigating adversarial effects through ran- domization. In International Conference on Learning Rep- resentations (ICLR), 2018. 1 [31] Huanrui Yang, Jingyang Zhang, Hongliang Dong, Nathan Inkawhich, Andrew Gardner, Andrew Touchet, Wesley Wilkes, Heath Berry, and Hai Li. Dverge: diversifying vulnerabilities for enhanced robust generation of ensem- bles. In Advances in Neural Information Processing Systems (NeurIPS), pages 5505–5515, 2020. 3 [32] Pengbo Yang, Jitao Sang, Jian Yu, and Yaogong Feng. Re- visiting and improving fgsm adversarial training, 2023. 2 [33] Dinghuai Zhang, Tianyuan Zhang, Yiping Lu, Zhanxing Zhu, and Bin Dong. You only propagate once: Accelerat- ing adversarial training via maximal principle. In Advances in Neural Information Processing Systems (NeurIPS), vol- ume 32, pages 227–238, 2019. 2, 4 [34] Haizhong Zheng, Ziqi Zhang, Juncheng Gu, Honglak Lee, and Atul Prakash. Efficient adversarial training with trans- ferable adversarial examples. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1178–1187, 2020. 1, 2 8 Supplementary Material for Investigating Catastrophic Overfitting in Fast Adversarial Training: A Self-fitting Perspective A. Experiment details. FAT settings. We train ResNet18 on Cifar10 with the FGSM-AT method [28] for 100 epochs in Pytorch [20]. We set (cid:15) = 8/255 and (cid:15) = 16/255 and use a SGD [22] opti- mizer with 0.1 learning rate. The learning rate decays with a factor of 0.1 at the 80th and 90th epochs. To better study CO, we use zero initialization to generate adversarial sam- ples, and weight decay is set to 0 to reproduce CO stably. The batch size is 128. Images are padded with 4 pixels and randomly cropped and flipped horizontally. overfitting happens earlier than ResNet18. After CO, the random-label FGSM accuracy also increases quickly with training accuracy, suggesting that self-information domi- nates the classification. Probability changes with attack step size's increase. Fig. A2 visualizes that when the step size of FGSM per- turbation gradually increases, how output probability of the network in the corresponding classes. The model is trained on Cifar10 using WideResNet28-10. When the step size in- creases, the probability firstly decreases, meaning that the perturbation can fool the network, then increases, meaning that the network can recognize the self-information in the perturbation when the step size is large enough. Table A1. Accuracy drop of different networks trained on Cifar10 using WideResNet28-10. Compared to the network without CO, the network with CO has a large drop in FGSM accuracy while little change in clean accuracy. CLEAN FGSM PGD W/O CO, NOT PRUNED W/O CO, PRUNED 45.4% 51.2% 76.4% -19.9% -19.5% -16.2% WITH CO, NOT PRUNED WITH CO, PRUNED 79.2% 99.5% -10.4% -92.4% 0.0% 0.1% Figure A1. FGSM-AT training with different (cid:15) on Cifar10 using WideResNet28-10. Catastrophic overfitting happens at 15th epoch for (cid:15) = 8/255 and 4th epoch for (cid:15) = 16/255. PGD-AT details in further discussion. There is only a little difference between the settings of PGD-AT and FAT. PGD-AT uses a smaller step size and more iterations with (cid:15) = 16/255. The learning rate decays at the 75th and 90th epochs. The robust accuracy during training of different settings is shown in Fig. A3. B. Experiments on WideResnet28-10. This section reports experiments on WideResNet28-10 about self-fitting. Compared to ResNet18, WideResNet28- 10 has more parameters and therefore has a stronger learn- ing capability. Training curve. Fig. A1 shows the training curve of WideResNet28-10 on Cifar10 with FGSM-AT method. The training setting also follows Appendix A. Catastrophic Figure A2. Visualization of the probability of the network in the corresponding classes when the step size of FGSM perturbation gradually increases. The original class is class 1. The network is trained with (cid:15) = 16/255. Channel variance in descending order. Fig. A4 shows 9 020406080100Epoch020406080100Accuracyeps=8, Traineps=8, RL-Traineps=8, Test PGD020406080100Epoch020406080100Accuracyeps=16, Traineps=16, RL-Traineps=16, Test PGD0246810121416Step size(pixel)0.00.20.40.60.81.0Output probabilityclass:0class:1class:2class:3class:4class:5class:6class:7class:8class:9 Figure A3. Training curves of multi-step AT with different iterations and step sizes. PGD accuracy is calculated using a PGD20 attack with 3 random starts. the variance values in descending order of networks with and without the CO on WideResNet28-10. The features af- ter the first layer of WideResNet28-10 have only 16 chan- nels. After CO, some channels become dominant to recog- nize self-information, thus having a larger variance. While some channels for data-information become unimportant and "dead". the first layer with the highest variance is pruned. The net- work without CO has a similar drop in all accuracy after pruning. In contrast, after pruning, the network with CO has a drop of 92.4% in FGSM accuracy, while the clean accuracy only decreases by 10.4%. Figure A4. The variance values in descending order of networks with and without the CO on WideResNet28-10. The network with CO has a larger maximum variance value and more zero variance channels. Accuracy of pruned network. Tab. A1 shows the accu- racy change of different setting after pruning, which is for WideResNet28-10 trained on Cifar10. Only one channel of 10 020406080100Epoch10.012.515.017.520.022.525.027.530.0PGD AccuracyStep size=4020406080100Epoch15.017.520.022.525.027.530.0PGD AccuracyStep size=6020406080100Epoch051015202530PGD AccuracyStep size=8020406080100Epoch0510152025PGD AccuracyStep size=10020406080100Epoch0510152025PGD AccuracyStep size=12020406080100Epoch0510152025PGD AccuracyStep size=14iter=2iter=3iter=4iter=5iter=6246810121416Order0246810Variance ValueWithout COWith CO
http://arxiv.org/abs/2302.11962v2
2023-09-06T14:38:35
2023-02-23T12:18:28
Unified Convergence Theory of Stochastic and Variance-Reduced Cubic Newton Methods
We study stochastic Cubic Newton methods for solving general possibly non-convex minimization problems. We propose a new framework, which we call the helper framework, that provides a unified view of the stochastic and variance-reduced second-order algorithms equipped with global complexity guarantees. It can also be applied to learning with auxiliary information. Our helper framework offers the algorithm designer high flexibility for constructing and analyzing the stochastic Cubic Newton methods, allowing arbitrary size batches, and the use of noisy and possibly biased estimates of the gradients and Hessians, incorporating both the variance reduction and the lazy Hessian updates. We recover the best-known complexities for the stochastic and variance-reduced Cubic Newton, under weak assumptions on the noise. A direct consequence of our theory is the new lazy stochastic second-order method, which significantly improves the arithmetic complexity for large dimension problems. We also establish complexity bounds for the classes of gradient-dominated objectives, that include convex and strongly convex problems. For Auxiliary Learning, we show that using a helper (auxiliary function) can outperform training alone if a given similarity measure is small.
[ "El Mahdi Chayti", "Nikita Doikov", "Martin Jaggi" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11962v2", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11962v2", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "math.OC", "@scheme": "http://arxiv.org/schemas/atom" }
[ "math.OC", "cs.LG" ]
3 2 0 2 p e S 6 ] C O . h t a m [ 2 v 2 6 9 1 1 . 2 0 3 2 : v i X r a Unified Convergence Theory of Stochastic and Variance-Reduced Cubic Newton Methods El Mahdi Chayti EPFL [email protected] Martin Jaggi EPFL [email protected] Nikita Doikov EPFL [email protected] Abstract We study stochastic Cubic Newton methods for solving general possibly non- convex minimization problems. We propose a new framework, which we call the helper framework, that provides a unified view of the stochastic and variance- reduced second-order algorithms equipped with global complexity guarantees. It can also be applied to learning with auxiliary information. Our helper framework offers the algorithm designer high flexibility for constructing and analysis of the stochastic Cubic Newton methods, allowing arbitrary size batches, and the use of noisy and possibly biased estimates of the gradients and Hessians, incorporating both the variance reduction and the lazy Hessian updates. We recover the best- known complexities for the stochastic and variance-reduced Cubic Newton, under weak assumptions on the noise. A direct consequence of our theory is the new lazy stochastic second-order method, which significantly improves the arithmetic complexity for large dimension problems. We also establish complexity bounds for the classes of gradient dominated objectives, that include convex and strongly convex problems. For Auxiliary Learning, we show that using a helper (auxiliary function) can outperform training alone if a given similarity measure is small. 1 Introduction In many fields of machine learning, it is common to optimize a function f (x) that can be expressed as a finite sum: (cid:110) min x∈Rd f (x) = 1 n fi(x) (cid:111) , n (cid:80) i=1 (1) (cid:2)f (x, ζ)(cid:3). or, more generally, as an expectation over some given probability distribution: f (x) = Eζ When f is non-convex, this problem is especially difficult, since finding a global minimum is NP-hard in general [16]. Hence, the reasonable goal is to look for approximate solutions. The most prominent family of algorithms for solving large-scale problems of the form (1) are the first-order methods, such as the Stochastic Gradient Descent (SGD) [28, 19]. They employ only stochastic gradient information about the objective f (x) and guarantee the convergence to a stationary point, which is a point with a small gradient norm. Nevertheless, when the objective function is non-convex, a stationary point may be a saddle point or even a local maximum, which is not desirable. Another common issue is that first-order methods typically have a slow convergence rate, particularly when the problem is ill-conditioned. Therefore, they may not be suitable when high precision for the solution is required. Preprint. Under review. To address these challenges, we can take into account second-order information (the Hessian matrix) and apply Newton's method (see, e.g. [22]). Among the many versions of this algorithm, the Cubic Newton method [23] is one of the most theoretically established. With the Cubic Newton method, we can guarantee global convergence to an approximate second-order stationary point (in contrast, the pure Newton method without regularization can even diverge when it starts far from a neighborhood of the solution). For a comprehensive historical overview of the different variants of Newton's method, see [27]. Additionally, the rate of convergence of the Cubic Newton is provably better than those for the first-order methods. Therefore, theoretical guarantees of the Cubic Newton method seem to be very appealing for practical applications. However, the basic version of the Cubic Newton requires the exact gradient and Hessian information in each step, which can be very expensive to compute in the large scale setting. To overcome this issue, several techniques have been proposed: • One popular approach is to use inexact stochastic gradient and Hessian estimates with sub- sampling [36, 20, 35, 24, 14, 6, 1]. This technique avoids using the full oracle information, but typically it has a slower convergence rate compared to the exact Cubic Newton. • Variance reduction techniques [38, 32] combine the advantages of stochastic and exact methods, achievieng an improved rates by recomputing the full gradient and Hessian information at some iterations. • Lazy Hessian updates [29, 10] utilize a simple idea of reusing an old Hessian for several iterations of a second-order scheme. Indeed, since the cost of computing one Hessian is usually much more expensive than one gradient, it can improve the arithmetic complexity of our methods. • In addition, exploiting the special structure of the function f (if known) can also be helpful. For instance, gradient dominated objectives [23], a subclass of non-convex functions that have improved convergence rates and can even be shown to converge to the global minimum. Examples of such objectives include convex and star-convex functions, uniformly convex functions, and functions satisfying the PL condition [26] as a special case. Stochastic algorithms with variance reduction for gradient-dominated functions were studied previously for the first-order methods (see, e.g., [12]) and for the second-order methods with cubic regularization in [21]. In this work, we revise the current state-of-the-art convergence theory for the stochastic Cubic Newton method and propose a unified and improved complexity guarantees for different versions of the method, which combine the advanced techniques listed above. Our developments are based on the new helper framework for the second-order optimization, that we present in Section 3. For the first-order optimization, a similar in-spirit techniques called learning with auxiliary information was developed recently in [8, 33]. Thus, our results can also be seen as a generalization of the Auxiliary Learning paradigm to the second-order optimization. However, note that in our second-order case, we have more freedom for choosing the "helper functions" (namely, we use one for the gradients and one for the Hessians). That brings more flexibility into our methods and it allows, for example, to use the lazy Hessian updates. Our new helper framework provides us with a unified view of the stochastic and variance-reduced methods and can be used by an algorithm designed to construct new methods. Thus, we show how to recover already known versions of the stochastic Cubic Newton with some of the best convergence rates, as well as present the new Lazy Stochastic Second-Order Method, which significantly improves the total arithmetic complexity for large-dimension problems. Contributions. • We introduce the helper framework which we argue encompasses multiple methods in a unified way. Such methods include stochastic methods, variance reduction, Lazy methods, core sets, and semi-supervised learning. • This framework covers previous versions of the variance-reduced stochastic Cubic Newton methods with known rates. Moreover, it provides us with new algorithms that employ Lazy Hessian updates and significantly improves the arithmetic complexity (for high dimensions), by using the same Hessian snapshot for several steps of the method. 2 • In the case of Auxiliary learning we provably show a benefit from using auxiliary tasks as helpers in our framework. In particular, we can replace the smoothness constant by a similarity constant which might be smaller. • Moreover, our analysis works both for the general class of non-convex functions, as well as for the classes of gradient dominated problems, that includes convex and uniformly convex functions. Hence, in particular, we justify new improved complexity bounds for the deterministic Cubic Newton method with Lazy Hessian updates [10]; as well as for the stochastic Cubic Newton algorithms with variance reduction that takes into account the total arithmetic cost of the operations (see Table 1). In the following table, we provide a comparison of the total complexities (in terms of the number of stoch. gradient calls) for finding a point with small gradient norm E∥∇f ( ̄x)∥ ≤ ε (non-convex case), or a global solution in terms of the functional residual Ef ( ̄x) − f ⋆ ≤ ε (convex case, gradient dominated functions of degree α = 1), by different first-order and second-order optimization algorithms. We take into account that the cost of one stochastic Hessian is proportional to d times the cost of the stochastic gradient, where d is the problem dimension. Gradient Descent (GD) Stochastic Gradient Descent (SGD) Stochastic Variance Reduced Grad. (SVRG) Cubic Newton (CN) Stochastic Cubic Newton (SCN) Variance Reduced Stoch. Cubic Newton (VRCN) (new) Variance Reduced Stoch. CN with Lazy Hessians (VRCN-Lazy) Non-convex, ε-local solution n / ε2 1 / ε4 n2/3 / ε2 nd / ε3/2 Convex (α = 1), ε-global solution n / ε 1 / ε2 n2/3 / ε nd / ε1/2 Ref. [22] [13] [17] [23] 1 / ε7/2 + d / ε5/2 1 / ε5/2 + d / ε3/2 [20, 24] (nd)4/5 ∧ (n2/3d + n) / ε3/2 (nd)4/5 ∧ (n2/3d + n) / ε1/2 (new) [38, 32] (nd)5/6 ∧ n √ d / ε3/2 (new) (nd)5/6 ∧ n √ d / ε1/2 (new) this work Table 1: The total number of stochastic gradient computations for solving the problem with ε accuracy. n is the number of functions (the datasize size), d is the dimension of the problem. We use x ∧ y to denote min(x, y). We see that for d ≥ n2/3 (large dimension setting) it is better to use the new VRCN-Lazy method than VRCN algorithm. 2 Notation and Assumptions For simplicity, we consider the finite-sum optimization problem (1), while it can be also possible to generalize our results to arbitrary expectations. We assume that our objective f is bounded from below and denote f ⋆ := inf f (x), and use the following notation: F0 := f (x0) − f ⋆, for x some initial x0 ∈ Rd. We denote by ∥x∥ := ⟨x, x⟩1/2, x ∈ Rd, the standard Euclidean norm for vectors, and the spectral norm for symmetric matrices, ∥H∥ := max{λmax(H), −λmin(H)}, where H = H ⊤ ∈ Rd×d. We will also use x ∧ y to denote min(x, y). Throughout this work, we make the following smothness assumption on the objective f : Assumption 1 (Lipschitz Hessian) The Hessian of f is Lipschitz continuous, for some L > 0: ∥∇2f (x) − ∇2f (y)∥ ≤ L∥x − y∥, ∀x, y ∈ Rd Our goal is to explore the potential of using the Cubically regularized Newton methods to solve problem (1). At each iteration, being at a point x ∈ Rd, we compute the next point x+ by solving the subproblem of the form x+ ∈ arg min (cid:110) y∈Rd ΩM,g,H (y, x) := ⟨g, y − x⟩ + 1 2 ⟨H(y − x), y − x⟩ + M 6 ∥y − x∥3 (cid:111) . (2) 3 Here, g and H are estimates of the gradient ∇f (x) and the Hessian ∇2f (x), respectively. Note that solving (2) can be done efficiently even for non-convex problems (see [9, 23, 5]). Generally, the cost of computing x+ is O(d3) arithmetic operations, which are needed for evaluating an appropriate factorization of H. Hence, it is of a similar order as the cost of the classical Newton's step. We will be interested to find a second-order stationary point to (1). We call (ε, c)-approximate second-order local minimum a point x that satisfies: ∥∇f (x)∥ ≤ ε and λmin(∇2f (x)) ≥ −c √ ε, where ε, c > 0 are given tolerance parameters. Let us define the following accuracy measure (see [23]): μc(x) := max (cid:16) ∥∇f (x)∥3/2, −λmin(∇2f (x))3 c3/2 (cid:17) , x ∈ Rd, c > 0. Note that this definition implies that if μc(x) ≤ ε3/2 then x is an (ε, c)-approximate local minimum. Computing gradients and Hessians. It is clear that computing the Hessian matrix can be much more expensive than computing the gradient vector. We denote the corresponding arith- metic complexities by HessCost and GradCost. We will make and follow the convention that HessCost = d × GradCost, where d is the dimension of the problem. For example, this is known to hold for neural networks using the backpropagation algorithm [18]. However, if the Hessian has a sparse structure, the cost of computing the Hessian can be cheaper [25]. Then, we can replace d with the effective dimension deff := HessCost GradCost ≤ d. 3 Second-Order Optimization with Helper Functions In this section, we extend the helper framework previously introduced in [8] for first-order optimiza- tion methods to second-order optimization. General principle. The general idea is the following: imagine that, besides the objective function f we have access to a help function h that we think is similar in some sense (that will be defined later) to f and thus it should help to minimize it. Note that many optimization algorithms can be framed in the following sequential way. For a current state x, we compute the next state x+ as: x+ ∈ arg min y∈Rd (cid:110) ˆfx(y) + M rx(y) (cid:111) , where ˆfx(*) is an approximation of f around current point x, and rx(y) is a regularizer that encodes how accurate the approximation is, and M > 0 is a regularization parameter. In this work, we are interested in cubically regularized second-order models of the form (2) and we use rx(y) := 1 6 ∥y − x∥3. Now let us look at how we can use a helper h to construct the approximation ˆf . We notice that we can write f (y) := h(y) (cid:124)(cid:123)(cid:122)(cid:125) cheap + f (y) − h(y) (cid:125) (cid:123)(cid:122) expensive (cid:124) We discuss the actual practical choices of the helper function h below. We assume now that we can afford the second-order approximation for the cheap part h around the current point x. However, approximating the part f − h can be expensive (as for example when the number of elements n in finite sum (1) is huge), or even impossible (due to lack of data). Thus, we would prefer to approximate the expensive part less frequently. For this reason, let us introduce an extra snapshot point ˆx that is updated less often than x. Then, we use it to approximate f − h. Another question that we still need to ask is what order should we use for the approximation of f − h? We will see that order 0 (approximating by a constant) leads as to the basic stochastic methods, while for orders 1 and 2 we equip our methods with the variance reduction. Combining the two approximations for h and f − h we get the following model of our objective f : ˆfx, ̃x(y) = C(x, ̃x) + ⟨G(h, x, ̃x), y − x⟩ + 1 2 ⟨H(h, x, ̃x)(y − x), y − x⟩, (3) 4 where C(x, ̃x) is a constant, G(h, x, ̃x) is a linear term, and H(h, x, ̃x) is a matrix. Note that if ̃x ≡ x, then the best second-order model of the form (3) is the Taylor polynomial of degree two for f around x, and that would give us the exact Newton-type method. However, when the points x and ̃x are different, we obtain much more freedom in constructing our models. For using this model in our cubically regularized method (2), we only need to define the gradient g = G(h, x, ̃x) and the Hessian estimates H = H(h, x, ̃x), and we can also treat them differently (using two different helpers h1 and h2, correspondingly). Thus we come to the following general second-order (meta)algorithm. We perform S rounds, the length of each round is m ≥ 1, which is our key parameter: if t mod m = 0 then Algorithm 1 Cubic Newton with helper functions Input: x0 ∈ Rd, S, m ≥ 1, M > 0. 1: for t = 0, . . . , Sm − 1 do 2: 3: 4: 5: 6: 7: 8: Update ̃xt (using previous states xi≤t) ̃xt = ̃xt−1 else return xout using the history (xi)0≤i≤Sm Form helper functions h1, h2 Compute the gradient gt = G(h1, xt, ̃xt), and the Hessian Ht = H(h2, xt, ̃xt) Compute the cubic step xt+1 ∈ arg miny∈Rd ΩM,gt,Ht(y, xt) In Algorithm 1 we update the snapshot ̃x regularly every m iterations. The two possible options are or ̃xt = xt mod m (use the last iterate) ̃xt = arg min i∈{t−m+1,...,t} f (xi) (use the best iterate) (4) (5) Clearly, option (5) is available only in case we can efficiently estimate the function values. However, we will see that it serves us with better global convergence guarantees, for the gradient-dominated functions. It remains only to specify how we choose the helpers h1 and h2. We need to assume that they are somehow similar to f . Let us present several efficient choices that lead to implementable second-order schemes. 3.1 Basic Stochastic Methods If the objective function f is very "expensive" (for example of the form (1) with n → ∞), one option is to ignore the part f − h i.e. to approximate it by a zeroth-order approximation: f (y) − h(y) ≈ f ( ̃x) − h( ̃x). Since it is just a constant, we do not need to update ̃x. In this case, we have: G(h1, x, ̃x) := ∇h1(x), H(h2, x, ̃x) := ∇2h2(x) . To treat this choice of the helpers and motivated by the form of the errors in Theorem 5, we assume the following similarity assumptions: Assumption 2 (Bounded similarity) Let for some δ1, δ2 ≥ 0, it holds Eh1 [∥G(h1, x, ̃x)−∇f (x)∥3/2] ≤ δ3/2 , Eh2 [∥H(h2, x, ̃x)−∇2f (x)∥3] ≤ δ3 2, 1 ∀x, ̃x ∈ Rd. Under this assumption, we prove the following theorem: Theorem 1 Under Assumptions 1 and 2, and M ≥ L, for an output of Algorithm 1 xout chosen uniformly at random from (xi)0≤i≤Sm, we have: (cid:16) √ (cid:17) E[μM (xout)] = O M F0 Sm + δ3 M 3/2 + δ3/2 1 2 . 5 We see that according to this result, we can get E[μM (xout)] ≤ ε3/2 only for ε > δ1. In other words, we can converge only to a certain neighbourhood around a stationary point, that is determined by the error δ1 of the stochastic gradients. However, as we will show next, this seemingly pessimistic dependence leads to the same rate of classical subsampled Cubic Newton methods discovered in [20, 35, 36]. Let us discuss now the specific case of stochastic optimization, where f has the form of (1), with n potentially being very large. In this case, it is customary to sample batches at random and assume the noise to be bounded in expectation. Precisely speaking, if we assume the standard assumption that for one index sampled uniformly at random, we have Ei∥∇f (x) − ∇fi(x)∥2 ≤ σ2 g and Ei∥∇2f (x) − ∇2fi(x)∥3 ≤ σ3 h , then it is possible to show that for (cid:80) (cid:80) h1 = 1 bg fi i∈Bg and h2 = 1 bh fi, i∈Bh (6) for batches Bg, Bh ⊆ [n] sampled uniformly at random and of sizes bg and bh respectively, Assump- tion 2 is satisfied with [30]: δ1 = σg√ ). Note that we can use the same random bg subsets of indices Bg, Bh for all iterations. and δ2 = ̃O( σh√ bh Corollary 1 In Algorithm 1, let us choose M = L and m = 1, with basic helpers (6). Then, according to Theorem 1, for any ε > 0, to reach an (ε, L)-approximate second-order local minimum, we need at most S = ε . Therefore, the total arithmetic complexity of the method becomes iterations with bg = (cid:0) σg and bh = σ2 LF0 ε3/2 (cid:1)2 √ ε h (cid:16) σ2 ε7/2 + σ2 g h ε5/2 deff O (cid:17) × GradCost. It improves upon the complexity O( 1 tion [13], unless deff > 1 ε3/2 (high cost of computing the Hessians). ε4 ) × GradCost of the first-order SGD for non-convex optimiza- 3.2 Let the Objective Guide Us If the objective f is such that we can afford to access its gradients and Hessians from time to time (functions of the form (1) with n < ∞ and "reasonable"), then we can do better than the previous chapter. In this case, we can afford to use a better approximation of the term f (y) − h(y). From a theoretical point of view, we can treat the case when f is only differentiable once, and thus we can only use a first-order approximation of f − h, in this case, we will only be using the Hessian of the helper h but only gradients of f . However, in our case, if we assume we have access to gradients then we can also have access to the Hessians of f as well (from time to time). For this reason, we consider a second-order approximation of the term f − h. If we follow the procedure that we described above we find: G(h1, x, ̃x) H(h2, x, ̃x) := ∇h1(x) − ∇h1( ̃x) + ∇f ( ̃x) + (∇2f ( ̃x) − ∇2h1( ̃x))(x − ̃x) := ∇2h2(x) − ∇2h2( ̃x) + ∇2f ( ̃x) (7) (8) We see that there is an explicit dependence on the snapshot ̃x and thus we need to address the question of how this snapshot point should be updated in Algorithm 1. In general, we can update it with a certain probability p ∼ 1 m , and we can use more advanced combinations of past iterates (like the average). However, for our purposes, we simply choose option 4 (i.e. the last iterate), thus it is only updated once every m iterations. We also need to address the question of the measure of similarity in this case. Since we are using a second-order approximation of f − h, it is very logical to compare them using the difference between their third derivatives or equivalently, the Hessian Lipschitz constant of their difference. Precisely we make the following similarity assumption: 6 Assumption 3 (Lipschitz similarity) Let for some δ1, δ2 ≥ 0, it holds, ∀x, ̃x ∈ Rd: Eh1[∥G(h1, x, ̃x) − ∇f (x)∥3/2] ≤ δ3/2 1 ∥x − ̃x∥3, Eh2[∥H(h2, x, ̃x) − ∇2f (x)∥3] ≤ δ3 2∥x − ̃x∥3. In particular, if f − h1 and f − h2 have the Lipschitz Hessians (with constants δ1 and δ2 respectively) then h1 and h2 satisfy Assumption 3. Under this assumption, we show that the errors resulting from the use of the snapshot can be successfully balanced by choosing M satisfying: (cid:1)3/2 4(cid:0) δ1 M + 73(cid:0) δ2 M (cid:1)3 ≤ 1 24m3 . (9) And we have the following theorem. Theorem 2 For f, h1, h2 verifying Assumptions 1,3. For a regularization parameter M chosen such that M ≥ L and (9) is satisfied. For an output of Algorithm 1 xout chosen uniformly at random from (xi)0≤i≤Sm:=T , we have: E[μM (xout)] = O (cid:16) √ (cid:17) , M F0 Sm In particular, we can choose M = max(L, 32δ1m2, 16δ2m) which gives E[μM (xout)] = O (cid:16) √ LF0 Sm + √ δ2F0 √ m + S √ (cid:17) . δ1F0 S (10) Based on the choices of the helpers h1 and h2 we can have many algorithms. We discuss these in the following sections. We start by discussing variance reduction and Lazy Hessians which rely on sampling batches randomly, then move to core-sets which try to find, more intelligently, representative weighted batches of data, after this, we discuss semi-supervised learning and how unlabeled data can be used to engineer the helpers. More generally, auxiliary learning tries to leverage auxiliary tasks in training a given main task, the auxiliary tasks can be treated as helpers. 3.3 Variance Reduction and Lazy Hessians The following lemma demonstrates that we can create helper functions h with lower similarity to the main function f of the form (1) by employing sampling and averaging. (cid:80)n Lemma 1 Let f = 1 i=1 fi such that all fi are twice differentiable and have L-Lipschitz Hes- n sians. Let B ⊂ {1, * * * , n} be of size b and sampled with replacement uniformly at random, and define hB = 1 b i∈B fi, then hB satisfies Assumption 3 with δ1 = L√ b and δ2 = O( log(d)L (cid:80) √ ). √ b Choice of the parameter m in Algorithm 1. Minimizing the total arithmetic cost, we choose m = arg minm #Grad(m, ε) + d#Hess(m, ε), where #Grad(m, ε) and #Hess(m, ε) denote the number of gradients and Hessians required to find an ε stationary point. Now we are ready to discuss several special cases that are direct consequences from Theorem 2. First, note that choosing h1 = h2 = f gives the classical Cubic Newton method [23], whereas choosing h1 = f and h2 = 0, gives the Lazy Cubic Newton [10]. In both cases, we recuperate the known rates of convergence. General variance reduction. random and choose If we sample batches Bg and Bh of sizes bg and bh consecutively at h1 = 1 bg (cid:80) i∈Bg fi and h2 = 1 bh (cid:80) i∈Bh fi, and use these helpers along with the estimates (7), (8), we obtain the Variance Reduced Cubic Newton algorithm [38, 32]. According to Lemma 1, this choice corresponds to δ1 = L√ and bg 7 √ δ2 = ̃O( L√ bh rate O(cid:0) LF0 Sm iteration. Minimizing the total arithmetic cost, we can choose m = arg min ). For bg ∼ m4 ∧ n, bh ∼ m2 ∧ n and M = L, we have the non-convex convergence (cid:1), which is the same as that of the cubic Newton algorithm but with a smaller cost per dn+d(m3∧nm)+(m5∧nm) . m m Let us denote by gV R(n, d) the corresponding optimal value. Then we reach an (ε, L)-approximate second-order local minimum in at most O( gV R(n,d) ) × GradCost arithmetic operations. ε3/2 Variance reduction with Lazy Hessians. We can also use lazy updates for Hessians combined with variance-reduced gradients. This corresponds to choosing h1 = 1 bg (cid:80) i∈Bg fi and h2 = 0, which implies (according to Lemma 1) that δ1 = L√ bg to obtain a convergence rate of O(cid:0) √ LF0 √ m S and δ2 = L. In this case, we need bg ∼ m2 (cid:1), which matches the convergence rate of the Lazy Cubic nd+(m3∧mn) √ m , m Newton method while using stochastic gradients. We choose this time m = arg min as before. Let us denote gLazy(n, d) the corresponding minimum. Then we guarantee to reach an (ε, mL)-approximate second-order local minimum in at most O( gLazy(n,d) ) × GradCost operations. To be lazy or not to be? We show that gLazy(n, d) ∼ (nd)5/6 ∧ n d and gV R(n, d) ∼ (nd)4/5 ∧ (n2/3d + n). In particular, for d ≥ n2/3 we have gLazy(n, d) ≤ gV R(n, d) and thus for d ≥ n2/3 it is better to use Lazy Hessians than variance-reduced Hessians from a gradient equivalent cost perspective. We note also that for the Lazy approach, we can keep a factorization of the Hessian (this factorization induces most of the cost of solving the cubic subproblem) and thus it is as if we only need to solve the subproblem once every m iterations, so the Lazy approach has a big advantage compared to the general approach, and the advantage becomes even bigger for the case of large dimensions. Note that according to the theory, we could use the same random batches Bg, Bh ⊆ [n] generated once for all iterations. However, using the resampled batches can lead to a more stable convergence. ε3/2 √ 3.4 Other Applications The result in (10) is general enough that it can include many other applications that are only limited by our imagination. To cite a few such applications there are: Core sets. [3] The idea of core sets is simple: can we summarize a potentially big data set using only a few (weighted) important examples? Many reasons such as redundancy make the answer yes. Devising approaches to find such core sets is outside of the scope of this work, but in general, we can see from (10) that if we have batches Bg, Bh such that they are δ1 and δ2 similar to f respectively, then we can keep reusing the same batch Bg for at least all the while guaranteeing an improved rate. So then if we can design such small batches with small δ1 and δ2 then we can keep reusing them, and enjoy the improved rate without needing large batches. times, and Bh for L δ2 (cid:113) L δ1 Auxiliary learning. [4, 2, 34] study how a given task f can be trained in the presence of auxiliary (related) tasks. Our approach can be indeed used for auxiliary learning by treating the auxiliaries as LF0 S ), we helpers. If we compare (10) to the rate that we obtained without the use of the helpers: O( see that we have a better rate using the helpers/auxiliary tasks when 1 ≤ 1. + √ m + √ δ2√ mL √ δ1√ L Semi-supervised learning.[37] Semi-supervised learning is a machine learning approach that com- bines the use of both labeled data and unlabeled data during training. In general, we can use the unlabeled data to construct the helpers, we can start for example by using random labels for the helpers and improving the labels with training. There are at least two special cases where our theory implies improvement by only assigning random labels to the unlabeled data. In fact, for both regular- ized least squares and logistic regression, we notice that the Hessian is independent of the labels (only depends on inputs) and thus if the unlabeled data comes from the same distribution as the labeled data, then we can use it to construct helpers which, at least theoretically, have δ1 = δ2 = 0. Because 8 the Hessian is independent of the labels, we can technically endow the unlabeled data with random √ labels. Theorem 2 would imply in this case E[μL(xout)] = O( LF0 Sm ), where S is the number of times we use labeled data and S(m − 1) is the number of unlabeled data. 4 Gradient Dominated Functions We consider now the class of gradient-dominated functions defined below. Assumption 4 (τ, α)-gradient dominated. A function f is called gradient dominated on set if it holds, for some α ≥ 1 and τ > 0: f (x) − f ⋆ ≤ τ ∥∇f (x)∥α, ∀x ∈ Rd. (11) Examples of functions satisfying this assumption are convex functions (α = 1) and strongly convex functions (α = 2), see Appendix 4.1. For such functions, we can guarantee convergence (in expectation) to a global minimum, i.e. we can find a point x such that f (x) − f ⋆ ≤ ε. The gradient dominance property is interesting because many non-convex functions have been shown to satisfy it [31, 15, 21]. Furthermore, besides convergence to a global minimum, we get improved rates of convergence. We note that for α > 3/2 (and only for this case), we needed to assume the following (stronger) inequality: Ef (xt) − f ⋆ ≤ τ E(cid:2)∥∇f (xt)∥(cid:3)α where the expectation is taken with respect to the iterates (xt) of our algorithms. This is a stronger assumption than (11). To avoid using (12), we can assume that the iterates belong to some compact set Q ⊂ Rd and that the gradient norm is uniformly bounded: ∀x ∈ Q : ∥∇f (x)∥ ≤ G. Then, a (τ, α)-gradient dominated on set Q function is also a (τ Gα−3/2, 3/2)-gradient dominated on this set for any α > 3/2. (12) , Note. To obtain the results of the Theorems below we needed to use (5) to update the snapshot. In Theorem 3 we extend the results of Theorem 1 to gradient-dominated functions. Theorem 3 Under Assumptions 1,2,4, for M ≥ L and T := Sm we have: (cid:1) 2α 3−2α + τ δ2α - For 1 ≤ α < 3/2: E[f (xT )] − f ⋆ = O M τ 3/(2α) (cid:16)(cid:0) α √ (3−2α)T - For α = 3/2: E[f (xT )] − f ⋆ = O (cid:16) F0 exp (cid:0) −T √ 1+ M τ (cid:1) + τ δ3 2 M α + τ δ3/2 1 (cid:17) . 2 1 M α + τ δα (cid:17) . - For 3/2 < α ≤ 2 , let h0 = O( √ ( M τ F0 3 2α ) 2α 3−2α ), then for T ≥ t0 = O(h 0 2α−3 2α log(h0)) we have: E[f (xT )] − f ⋆ = O (cid:16) √ ( M τ 3 2α ) 2α 3−2α (cid:0) 1 2 (cid:1)( 2α 3 )T −t0 + τ δ2α 2 M α + τ δα 1 (cid:17) . Theorem 3 shows (up to the noise level) for 1 ≤ α < 3/2 a sublinear rate, for α = 3/2 a linear rate (obtained by taking the limit α → 3/2) and a superlinear rate for α > 3/2. We would like to point Eh1[∥∇h1(x) − ∇f (x)∥α] ≤ δα be weaker depending on the value of α. that instead of Assumption 2 we only need to assume 2 which might 1 and Eh2[∥∇2h2(x) − ∇2f (x)∥2α] ≤ δ2α We also prove the following Theorem 2 which we extend in Theorem 4. In this case, we need to set the snapshot line 3 in Algorithm 1) as in 5 i.e. the snapshot corresponds to the state with the smallest value of f during the last m iterations. 9 Theorem 4 Under Assumptions 1,3,4, for M = max(L, 34δ1m2, 11δ2m), we have: - For 1 ≤ α < 3/2 : E[f (xSm)] − f ⋆ = O (cid:16)(cid:0) α (cid:1) 2α 3−2α (cid:19) √ . M τ 3/(2α) (3−2α)Sm - For α = 3/2: E[f (xT )] − f ⋆ = O (cid:16) F0 (cid:0)1 + m√ M τ (cid:1)−S(cid:17) . - For 3/2 < α ≤ 2, let h0 = O( √ M m τ E[f (xSm)] − f ⋆ = ( 2α 3−2α √ (cid:16) ( F0 3 2α ) have: M m τ 3 2α ) (cid:1)( 2α 3 )S−s0 (cid:17) 2α 3−2α (cid:0) 1 2 ), then for S ≥ s0 = O(h 0 2α−3 2α log(h0)) we Again, the same behavior is observed as for Theorem 3 but this time without noise (variance reduction is working). To the best of our knowledge, this is the first time such analysis is made. As a direct consequence of our results, we obtain new global complexities for the variance-reduced and lazy variance-reduced Cubic Newton methods on the class of gradient dominated functions. To compare the statements of Theorems 3 and 4, for convex functions (i.e. α = 1), Theorem 3 guarantees convergence to a ε−global minimum in at most O( 1 ε3/2 ) GradCost, whereas √ Theorem 4 only needs O( g(n,d) d or gV R(n, d) = (nd)4/5 ∧ (n2/3d + n). See Appendix 4.3 for more details. ε ) GradCost, where g(n, d) is either gLazy(n, d) = (nd)5/6 ∧ n ε5/2 + d √ 5 Limitations and possible extensions Estimating similarity between the helpers and the main function. While we show in this work that we can have an improvement over training alone, this supposes that we know the similarity constants δ1, δ2, hence it will be interesting to have approaches that can adapt to such constants. Engineering helper functions. Building helper task with small similarities is also an interesting idea. Besides the examples in supervised learning and core-sets that we provide, it is not evident how to do it in a generalized way. Using the helper to regularize the cubic subproblem. We note that while we proposed to approxi- mate the "cheap" part as well in Section 3, one other theoretically viable approach is to keep it intact and approximately solve a "proximal type" problem involving h, this will lead to replacing L by δ, but the subproblem is even more difficult to solve. However our theory suggests that we don't need to solve this subproblem exactly, we only need m ≥ L δ . We do not treat this case here. 6 Conclusion In this work, we proposed a general theory for using auxiliary information in the context of the Cubically regularized Newton method. Our theory encapsulates the classical stochastic methods as well as the Variance Reduction, and the methods with the Lazy Hessian updates. For auxiliary learning, we showed a provable benefit compared to training alone. Besides investigating general non-convex functions for which we proved global convergence rates to a second-order stationary point, we also studied the classes of gradient-dominated functions with improved rates of convergence to the global minima. Acknowledgements This work was supported by the Swiss State Secretariat for Education, Research and Innovation (SERI) under contract number 22.00133. References [1] A. Agafonov, D. Kamzolov, P. Dvurechensky, A. Gasnikov, and M. Takáˇc. Inexact tensor meth- ods and their application to stochastic convex optimization. arXiv preprint arXiv:2012.15636, 2020. 10 [2] N. Aviv, A. Idan, M. Haggai, C. Gal, and F. Ethan. Auxiliary learning by implicit differentiation. ICLR 2021. [3] O. Bachem, M. Lucic, and K. Andreas. Practical coreset constructions for machine learning. arXiv:1703.06476 [stat.ML]https://arxiv.org/abs/1703.06476, 2017. [4] S. Baifeng, H. Judy, S. Kate, D. Trevor, and X. Huijuan. Auxiliary task reweighting for minimum-data learning. 34th Conference on Neural Information Processing Systems (NeurIPS 2020), Vancouver, Canada. [5] C. Cartis, N. I. Gould, and P. L. Toint. Adaptive cubic regularisation methods for uncon- strained optimization. Part I: motivation, convergence and numerical results. Mathematical Programming, 127(2):245–295, 2011. [6] C. Cartis and K. Scheinberg. Global convergence rate analysis of unconstrained optimization methods based on probabilistic models. Mathematical Programming, 169:337–375, 2018. [7] C.-C. Chang and C.-J. Lin. Libsvm: a library for support vector machines. ACM transactions on intelligent systems and technology (TIST), 2(3):1–27, 2011. [8] E. M. Chayti and S. P. Karimireddy. Optimization with access to auxiliary information. arXiv:2206.00395 [cs.LG], 2022. [9] A. R. Conn, N. I. Gould, and P. L. Toint. Trust region methods. SIAM, 2000. [10] N. Doikov, E. M. Chayti, and M. Jaggi. Second-order optimization with lazy hessians. arXiv:2212.00781 [math.OC], 2022. [11] N. Doikov and Y. Nesterov. Minimizing uniformly convex functions by cubic regularization of newton method. Journal of Optimization Theory and Applications 189:317–339, 2021. [12] I. Fatkhullin, J. Etesami, N. He, and N. Kiyavash. Sharp analysis of stochastic optimization under global Kurdyka-Lojasiewicz inequality. Advances in Neural Information Processing Systems, 35:15836–15848, 2022. [13] S. Ghadimi and G. Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [14] S. Ghadimi, H. Liu, and T. Zhang. Second-order methods with cubic regularization under inexact information. arXiv preprint arXiv:1710.05782, 2017. [15] M. Hardt and T. Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016. [16] C. J. Hillar and L.-H. Lim. Most tensor problems are np-hard. Journal of the ACM (JACM) 60 45., 2013. [17] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems, pp. 315-323, 2013. [18] H. J. Kelley. Gradient theory of optimal flight paths. Ars Journal, 30(10):947–954, 1960. [19] J. Kiefer and J. Wolfowitz. Stochastic estimation of the maximum of a regression function. Ann. Math. Statist. Volume 23, Number 3, 462-466, 1952. [20] J. M. Kohler and A. Lucchi. Sub-sampled cubic regularization for non-convex optimization. In International Conference on Machine Learning, pages 1895–1904. PMLR, 2017. [21] S. Masiha, S. Salehkaleybar, N. He, N. Kiyavash, and P. Thiran. Stochastic second-order methods improve best-known sample complexity of sgd for gradient-dominated functions. In NeurIPS 2022 - Advances in Neural Information Processing Systems, volume 35, pages 10862–10875, 2022. [22] Y. Nesterov. Lectures on convex optimization, volume 137. Springer, 2018. [23] Y. Nesterov and B. Polyak. Cubic regularization of Newton's method and its global performance. Mathematical Programming, 108(1):177–205, 2006. 11 [24] T. Nilesh, S. Mitchell, J. Chi, R. Jeffrey, and J. Michael I. Stochastic cubic regularization for fast nonconvex optimization. Part of Advances in Neural Information Processing Systems 31, 2018. [25] J. Nocedal and S. Wright. Numerical optimization. Springer Science & Business Media, 2006. [26] B. T. Polyak. Gradient methods for minimizing functionals. Zhurnal Vychislitel'noi Matematiki i Matematicheskoi Fiziki, 3(4):643–653,, 1963. [27] B. T. Polyak. Newton's method and its use in optimization. European Journal of Operational Research, 181(3):1086–1096, 2007. [28] H. Robbins and S. Monro. A stochastic approximation method the annals of mathematical statistics. Vol. 22, No. 3. pp. 400-407, 1951. [29] V. Shamanskii. A modification of Newton's method. Ukrainian Mathematical Journal, 19(1):118–122, 1967. [30] J. A. Tropp et al. An introduction to matrix concentration inequalities. Foundations and Trends® in Machine Learning, 8(1-2):1–230, 2015. [31] L. uanzhi and Y. Yang. Convergence analysis of two-layer neural networks with relu activation. Advances in neural information processing systems, 30, 2017. [32] Z. Wang, Z. Yi, L. Yingbin, and L. Guanghui. Stochastic variance-reduced cubic regularization for nonconvex optimization. AISTATS, 2019. [33] B. Woodworth, K. Mishchenko, and F. Bach. Two losses are better than one: Faster optimization using a cheaper proxy. arXiv preprint arXiv:2302.03542, 2023. [34] L. Xingyu, S. B. Harjatin, K. George, and H. David. Adaptive auxiliary task weighting for reinforcement learning. 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada. [35] P. Xu, F. Roosta-Khorasani, and M. W. Mahoney. Newton-type methods for non-convex optimization under inexact Hessian information. arXiv preprint arXiv:1708.07164 ., 2017. [36] P. Xu, J. Yang, F. Roosta-Khorasani, and M. W. Mahoney. Sub-sampled newton methods with non-uniform sampling. 2016. [37] X. Yang, Z. Song, I. King, and Z. Xu. A survey on deep semi-supervised learning. Technical report, 2021. [38] D. Zhou, P. Xu, and Q. Gu. Stochastic variance-reduced cubic regularization methods. Journal of Machine Learning Research 20 1-47, 2019. 12 0 Experiments 0.1 To be lazy or not To verify our findings from Subsection 3.3, we consider a logistic regression problem on the "a9a" data set [7]. Specifically f (x) = 1 N N (cid:88) i=1 log(1 + exp(−bix⊤ai)) + λ 2 ∥x∥2 , i=1 are samples from our data, and λ ≥ 0 is a regularization parameter. where {(ai, bi)}N We consider the variance-reduced cubic Newton method from [38] (referred to as "full VR"), its lazy version where we do not update the snapshot Hessian ("Lazy VR"), the stochastic Cubic Newton method ("SCN"), the Cubic Newton algorithm ("CN"), Gradient Descent with line search ("GD") and Stochastic Gradient Descent ("SGD"). We report the results in terms of time and gradient arithmetic computations needed to arrive at a given level of convergence. Figure 1 shows how the lazy version saves both time and arithmetic computations without sacrificing the convergence precision. Figure 1: Comparison of the convergence of different algorithms. We see that "Lazy VR" has the same convergence speed as its full version "full VR" and the cubic Newton method "CN" while needing less time and fewer arithmetic computations. The Gradcost is computed using the convention that computing one hessian is d times as expensive as computing one gradient. 0.2 Auxiliary Learning Our goal is to show that the helper framework is very general and that it goes beyond the variance reduction and lazy Hessian computations. For the previously considered problem of training the logistic regression (using the same "a9a" data set), we suppose that we also have access to unlabeled data (in this sense this becomes semi-supervised learning). Specifically, we have a labeled dataset Dl = {(ai, bi)}Nl i=Nl+1, we suppose that both data sets are sampled from the same distribution P(a,b). Our goal is to minimize i=1 and an unlabeled data set Du = {ai}Nl+Nu f (x) = E(a,b)∼P(a,b)[log(1 + exp(−bx⊤a))] . A simple computation shows that the Hessian of f only depends on Pa, and, for this reason, we can use unlabeled data to construct a good approximation of the true Hessian (if we can sample from Pa, we construct the exact Hessian and thus have a helper h with δ1 = δ2 = 0). 13 01234Arith. comput. , (Gradcost)1e8107105103101ff01020304050Time, s107105103101ffGDLazy VRfull VRCNSCNSGDLogistic regression: a9a, d = 123, n = 32561, L2-regularization Figure 2: Cubic Newton method with and without using the helper function h. For m = 1 this is simply the classic Cubic Newton method. To give an intuitive meaning to the plot, 1 m is the percentage of labeled data used during training. We can clearly see that using our approach we benefit a lot from the helper function h. Let h(x) = Ea∼Pa,b∼Random{±1}[log(1 + exp(−bx⊤a))] , where Random{±1} is any distribution on labels. In our experiments, we use uniform distribution. Figure 2 shows that, indeed we can benefit a lot from using this helper function. We note that this observed benefit comes at the cost of performing more steps using gradients and Hessians of the helper function h. 0.3 Additional experiments We go back to comparing the algorithms in 0.1. We consider now non-convex problems. First we consider logistic regression with a non-convex regularizer Reg(x) = (cid:80)d . Precisely speaking we minimize x2 i 1+x2 i i=1 f (x) = 1 n n (cid:88) i=1 log(1 + exp(−bix⊤ai)) + λReg(x) . Figure 3 shows the results in this case. Again we see that "lazy VR" reduces both time and gradient equivalent computations without sacrificing the convergence speed. Figure 3: Comparison of the convergence of different algorithms. We see that using our approach we benefit a lot from the helper function h. 14 0100200300Labeled data access, (calls of f)1010107104101ffLogistic regression with and without helpersm=1 (CN)m=10m=20m=30m=6001234Arith. comput. , (Gradcost)1e8107105103101ffGDLazy VRfull VRCNSCNSGD02040Time, s107105103101ffLogistic regression: a9a, d = 123, n = 32561, Non-convex Second, we consider a simple diagonal neural network with L2 loss with data generated from a normal distribution. specifically, we want to minimize f (x := (u, v)) = 1 n n (cid:88) i=1 ∥a⊤ i u ◦ v − bi∥2 + λ 2 ∥x∥2 , where ◦ is the element-wise vector product. Figure 4: Comparison of the convergence of the different algorithms. Except for gradient descent ("GD") which performs very well in this case, again the same conclusions as in Figure 2 with respect to "Lazy VR" can be said. Figure 4 shows again that compared to other second-order methods, "Lazy VR" has considerable time and computation savings. It also has a close performance to gradient descent with line search which performs very well in this case. 1 Theoretical Preliminaries We consider the general problem min x∈Rd f (x) Where f is twice differentiable with L-Lipschitz Hessian i.e.: As a direct consequence of (13) (see [23, 22]) we have for all x, y ∈ Rd: ∥∇2f (x) − ∇2f (y)∥ ≤ L∥x − y∥, ∀x, y ∈ Rd. ∥∇f (y) − ∇f (x) − ∇2f (x)(y − x)∥ ≤ L 2 ∥x − y∥2, |f (y) − f (x) − ⟨∇f (x), y − x⟩ − For x and x+ defined as in Equation (2) i.e. 1 2 ⟨∇2f (x)(y − x), y − x⟩| ≤ L 6 ∥y − x∥3. x+ ∈ arg min ΩM,g,H (y, x) := ⟨g, y − x⟩ + 1 2 ⟨H(y − x), y − x⟩ + M 6 ∥y − x∥3 (cid:111) . (cid:110) y∈Rd The optimality condition of (16) ensures that : ⟨g, x+ − x⟩ + ⟨H(x+ − x), x+ − x⟩ + M 2 r3 = 0 , where we denoted r = ∥x+ − x∥. It is also known that the solution to (16) verifies: We start by proving the following Theorem H + M 2 rI ⪰ 0 15 (13) (14) (15) (16) (17) (18) 0.00.51.01.52.0Arith. comput. , (Gradcost)1e81011109107105103101101ffGDLazy VRfull VRCNSCNSGD02468Time, s1011109107105103101101ffL2 loss, Diagonal Neural Network: d=100, n=10000 Theorem 5 For any x ∈ Rd, let x+ be defined by (2). Then, for M ≥ L we have: f (x) − f (x+) ≥ 1 √ 1008 M μM (x+) + M ∥x−x+∥3 72 − 4∥∇f (x)−g∥3/2 √ M − 73∥∇2f (x)−H∥3 M 2 . Using (15) with y = x+ and x = x and for M ≥ L we have: f (x+) (15) ≤ f (x) + ⟨∇f (x), x+ − x⟩ + 1 2 ⟨∇2f (x)(x+ − x), x+ − x⟩ + L 6 r3 (17)+(18) ≤ f (x) − 6M −4L 24 r3 + ⟨∇f (x) − g, x+ − x⟩ + 1 2 ⟨(∇2f (x) − H)(x+ − x), x+ − x⟩ M ≥L ≤ f (x) − M 12 r3 + ⟨∇f (x) − g, x+ − x⟩ + 1 Using Young's inequality xy ≤ xp 2 ⟨(∇2f (x) − H)(x+ − x), x+ − x⟩. p + yq q ∀x, y ∈ R ∀p, q > 1 s.t 1 p + 1 q = 1 we have: ⟨∇f (x) − g, x+ − x⟩ ≤ M 36 r3 + √ 2 √ 3 12 M ∥∇f (x) − g∥3/2 , and 1 2 ⟨(∇2f (x) − H)(x+ − x), x+ − x⟩ ≤ M 36 r3 + 72 M 2 ∥∇2f (x) − H∥3 . Mixing all these ingredients, we get Lemma 2 For any M ≥ L, it holds f (x) − f (x+) ≥ M 36 r3 − 3 √ M ∥∇f (x) − g∥3/2 − 72 M 2 ∥∇2f (x) − H∥3. (19) Using (14) we have: ∥∇f (x+) − g − H(x+ − x) + g − ∇f (x) + (H − ∇2f (x))(x+ − x)∥ ≤ L 2 r2, applying the triangular inequality we get for M ≥ L : ∥∇f (x+)∥ ≤ L 2 r2 + ∥g + H(x+ − x)∥ + ∥∇f (x) − g∥ + ∥∇2f (x) − H∥r ≤ L+2M 2 r2 + ∥∇f (x) − g∥ + 1 2M ∥∇2f (x) − H∥2 ≤ 3M 2 r2 + ∥∇f (x) − g∥ + 1 2M ∥∇2f (x) − H∥2. By the convexity of x (cid:55)→ x3/2 we have for any (ai) ≥ 0 : ((cid:80) applying this to the above inequality we get i aixi)3/2 ≤ ((cid:80) i ai)1/2 (cid:80) i aix3/2 i , Lemma 3 For any M ≥ L, it holds 1 √ M ∥∇f (x+)∥3/2 ≤ 3M r3 + 2 √ M ∥∇f (x) − g∥3/2 + 1 M 2 ∥∇2f (x) − H∥3 (20) We can also bound the smallest eigenvalue of the Hessian. Using the smoothness of the Hessian we have: ∇2f (x+) ⪰ ∇2f (x) − L∥x+ − x∥I ⪰ H + ∇2f (x) − H − LrI ⪰ H − ∥∇2f (x) − H∥I − LrI (18) ⪰ − M r 2 I − ∥∇2f (x) − H∥I − LrI. 16 Which means for M ≥ L we have: −λmin(∇2f (x+)) ≤ 3M r 2 + ∥∇2f (x) − H∥. Then the convexity of x (cid:55)→ x3 leads to the following lemma: Lemma 4 For any M ≥ L, it holds −λmin(∇2f (x+))3 M 2 ≤ 14M r3 + 4 M 2 ∥∇2f (x) − H∥3 (21) Now the quantity μM (x) = max(∥∇f (x)∥3/2, −λmin(∇2f (x+))3 Lemmas 3 and 4: M 3/2 ) which we can be bounded using 1 √ M μ(x+) ≤ 14M r3 + 2 √ M ∥∇f (x) − g∥3/2 + 4 M 2 ∥∇2f (x) − H∥3. (22) Combining Lemma 2 and (22) we get the inequality given in Theorem 5: f (x) − f (x+) ≥ 1 √ 1008 M μM (x+) + M 72 r3 − 4 √ M ∥∇f (x) − g∥3/2 − 73 M 2 ∥∇2f (x) − H∥3. □ 2 More on Section 3.1 2.1 Better Similarity using Sampling One common approach for constructing gradient and Hessian estimates is sub-sampling. The idea behind sub-sampling is simple: for an objective of the form in (1), we randomly sample two batches Bg and Bh of sizes bg and bh consecutively from the distribution D and define: gt,Bg = 1 bg (cid:88) i∈Bg ∇fi(xt) and Ht,Bh = 1 bh (cid:88) i∈Bh ∇2fi(xt). (23) In this particular scenario, the "elementary" estimates ∇f (xt, ζ) and ∇2f (xt, ζ) are unbiased, and g and Ei∥∇2f (x) − ∇2fi(x)∥3 ≤ σ3 we will assume that they satisfy Ei∥∇f (x) − ∇fi(x)∥2 ≤ σ2 h. Lemma 5 For the estimators defined in (23) we have1: E∥∇f (xt) − gt,Bg ∥2 ≤ σ2 g bg and E∥∇2f (xt) − Ht,Bh ∥3 ≤ O (cid:18) log(d)3/2 σ3 h b3/2 h (cid:19) . Lemma 5 demonstrates how the utilization of batching can decrease the noise. To simplify things, we can keep in mind this straightforward rule: If we employ a batch of size ba, then we need to modify σa by σa√ ba for a ∈ {g, h} . Lemma 5 is based on the following two Lemmas: Lemma 6 (Lyapunov's inequality) For any random variable X and any 0 < s < t we have E[|X|s]1/s ≤ E[|X|t]1/t. and 1Here and everywhere O(*) hides an absolute numerical constant. 17 Lemma 7 Suppose that q ≥ 2, p ≥ 2, and fix r ≥ max (q, 2 log(p)). Consider i.i.d. random self-adjoint matrices Y1, * * * , YN with dimension p × p, E[Yi] = 0. It holds that: (cid:2)E[∥ N (cid:88) i=1 Yi∥q 2](cid:3)1/q √ ≤ 2 er∥(cid:0) N (cid:88) i=1 E[Y 2 i ](cid:1)1/2 ∥2 + 4erE[max i ∥Yi∥q 2]1/q. Lemma 7 can be found in [38]. Now if we have X1, * * * , Xb ∈ Rd, b i.i.d vector-valued random variables such that E[Xi] = μ and E[∥Xi − μ∥2] ≤ σ2 then by applying Lemma 6 we get: E[∥ 1 b (cid:88) i Xi − μ∥3/2] ≤ E[∥ 1 b (cid:88) i Xi − μ∥2]3/4 ≤ σ3/2 b3/4 . When we have b i.i.d matrix-valued random variables Y1, * * * , Yb ∈ Rd×d such that E[Yi] = μ, E[∥Yi − μ∥2] ≤ σ2 3 (by Jensen's inequality σ2 ≤ σ3), then by applying Lemma 7 we get: 2 and E[∥Yi − μ∥3] ≤ σ3 E[∥ 1 b (cid:80) i Yi − μ∥3] ≤ (cid:18) 2 (cid:113) 2e log(d) b σ2 + 8e log(d) b σ3 (cid:19)3 = O( log(d)3/2σ3 3 b3/2 ) These last two inequalities are identical to the statement of Lemma 5. 2.2 Proof of Theorem 1 We use here δ1 = σg and δ2 = σh. Combining both Theorem 5, Assumption 2 and Lemma 6 we get: Ef (xt) − Ef (xt+1) ≥ 1 √ 1008 M EμM (xt+1) − 4√ M E∥∇f (xt) − gt∥3/2 − 73 M 2 E∥∇2f (xt) − Ht∥3 Lemma 6 ≥ 1 √ 1008 M EμM (xt+1) − 4√ M σ3/2 g − 73 M 2 σ3 h. By summing the above inequality from t = 0 to t = T − 1 and rearranging we get: 1 1008T T (cid:80) t=1 EμM (xt) ≤ √ M Ef (x0)−Ef (xT ) T + 4σ3/2 g + 73 M 3/2 σ3 h. All is left is to use the fact that Ef (x0) − Ef (xT ) ≤ f (x0) − f ⋆ = F0, and by the definition of xout: EμM (xout) = 1 T EμM (xt), thus: (cid:80)T t=1 1 1008 EμM (xout) ≤ √ M F0 T + 73 M 3/2 σ3 h + 4σ3/2 g . □ 3 Proofs of Section 3.2 3.1 Proof of Lemma 1 We have f (x) = 1 n n (cid:80) i=1 fi(x) and we suppose that each fi, 1 ≤ i ≤ n have the L-Lipschitz Hessians. Therefore, f also has the L-Lipschitz Hessian. Thus, fi − f has the 2L-Lipschitz Hessian. 18 Applying (1) and 14 to fi − f we get ∥G(fi, x, ̃x) − ∇f (x)∥ ≤ L∥x − ̃x∥2 and ∥H(fi, x, ̃x) − ∇2f (x)∥ ≤ 2L∥x − ̃x∥. We note also the if i is chosen at random then EiG(fi, x, ̃x) = ∇f (x) and EiH(fi, x, ̃x) = ∇2f (x). By using the properties of variance we have EB∥G(fB, x, ̃x) − ∇f (x)∥2 ≤ Ei∥G(fi, x, ̃x) − ∇f (x)∥2 b ≤ L2 b ∥x − ̃x∥4. Applying Lemmas 6 and 7 we get EB∥G(fB, x, ̃x) − ∇f (x)∥3 ≤ L3 b3/2 ∥x − ̃x∥3 and EB∥H(fB, x, ̃x) − ∇2f (x)∥3 ≤ (cid:18) (cid:113) 2e log(d) 2 b + 8e log(d) b (cid:19)3 Ei∥H(fi, x, ̃x) − ∇2f (x)∥3 (cid:18) (cid:114) 2 ≤ (cid:124) 2e log(d) b + 8e log(d) b (cid:123)(cid:122) O(( log(d) b )3/2) (cid:19)3 (cid:125) L3∥x − ̃x∥3. □ 3.2 Proof of Theorem 2 We use Theorem 5 and denote ri+1 = ∥xi+1 − xi∥. Then by the definition of the similarity between h1, h2 and f , we have: Ef (xsm+i) − Ef (xsm+i+1) ≥ EμM (xsm+i+1) 1 √ 216 M + E (cid:104) M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)∥xsm+i − xsm∥3(cid:105) . Summing it for 0 ≤ i ≤ m − 1, we obtain Ef (xsm) − Ef (x(s+1)m) ≥ m−1 (cid:80) i=0 1 √ 216 M EμM (xsm+i+1) + E (cid:104) M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)∥xsm+i − xsm∥3(cid:105) . We note that ∥xsm+i − xsm∥ ≤ (cid:80)i−1 Ef (xsm) − Ef (x(s+1)m) ≥ (cid:80)m−1 j=1 rsm+j. Therefore, 1 √ 216 i=0 M EμM (xsm+i+1) (cid:104) M 72 r3 We apply now the following inequality (from [10]): + E sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)((cid:80)i−1 j=1 rsm+j)3(cid:105) . which is true for any positive numbers {rk}k≥1 and any m ≥ 1. Hence, m−1 (cid:80) k=1 (cid:16) k (cid:80) i=1 (cid:17)3 ri ≤ m3 3 m−1 (cid:80) k=1 r3 k, m−1 (cid:80) i=0 (cid:2) M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)( i−1 (cid:80) j=1 rsm+j)3(cid:3) ≥ (cid:0) M 72 − m3 3 (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)(cid:1) m−1 (cid:80) i=0 r3 sm+i+1. 19 The above quantity is thus positive if M 72 − m3 3 (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1) ≥ 0. Equivalently, for M satisfying 4( δ1 M )3/2 + 73( δ2 M )3 ≤ 1 24m3 we have Ef (xsm) − Ef (x(s+1)m) ≥ Summing it up for 0 ≤ s ≤ S − 1 gives m √ 216 M 1 m m−1 (cid:80) i=0 Eμ(xsm+i+1). √ M (f (x0)−f ⋆) Sm ≥ 1 216Sm S−1 (cid:80) s=0 m−1 (cid:80) i=0 Eμ(xsm+i+1). And thus by the definition of xout we have: Eμ(xout) ≤ 216 √ M (f (x0)−f ⋆) Sm . (24) □ 4 Gradient dominated functions 4.1 Examples of gradient dominated functions Let us provide several main examples of functions satisfying (11): Example 1 Let f be convex on a bounded convex set Q of diameter D, and let solution x⋆ to (1) belong to Q. Then, we have: f (x) − f ⋆ ≤ ⟨∇f (x), x − x⋆⟩ ≤ D∥∇f (x)∥, ∀x ∈ Q. Therefore, f is (D, 1)-gradient dominated. Example 2 Let f be uniformly convex of degree s ≥ 2 with some constant μ > 0: ∀x, y ∈ Rd. f (y) ≥ f (x) + ⟨∇f (x), y − x⟩ + μ s ∥y − x∥s, Then, f is (cid:0) s−1 s ( 1 μ ) 1 s−1 , s s−1 (cid:1)-gradient dominated (see, e.g. [11]). In particular, uniformly convex functions of degree s = 2 are known as strongly convex, and we see that they satisfy condition (11) with τ = 1 2μ and α = 2. However, the function class (11) is much wider and it includes also some problems with non-convex objectives [23]. 4.2 Special cases of Theorem 3 For convex functions (the case α = 1) Theorem 3 implies that for M = max{L, δ2T rate 2D } we have the E[f (xout)] − f ⋆ = O (cid:18) LD3 T 2 + δ2D2 T (cid:19) . + δ1D (25) Equation (25) has been obtained by [1] using an assumption that the noise is bounded almost surely. Using the gradient and Hessian estimates in (23), for ε > 0 and M = L, to reach an ε-global minimum, we need at most T = O (cid:16)(cid:113) LD3 ε (cid:17) , gD2 σ2 ε2 ) and bh = O( σ2 hD Lε ) for the gradients iterations of the method, with the batches of size bg = O( and Hessians, respectively. Therefore, the total number of arithmetic operations needed to find an ε-global minimum is (cid:16) σ2 gL1/2D3/2 ε5/2 O (cid:17) × GradCost. + d σ2 hD5/2 L1/2ε3/2 20 For μ-uniformly convex functions of degree s = 3 (the case α = 3 estimates (23) and setting M = L, we reach an ε-global minimum for any ε > 0 in at most 2 and τ ∼ 1√ μ ), using stochastic T = O (cid:16)(cid:113) L (cid:17) μ log( F0 ε ) iterations of the method with the batches of sizes bg = O( Therefore, the total number of arithmetic operations is bounded as σ2 g μ2/3ε4/3 ) and bh = O( σ2 μ1/3Lε2/3 ). h √ (cid:16) σ2 g L μ7/6ε4/3 + d ̃O σ2 h √ Lε2/3 μ5/6 (cid:17) × GradCost. μ-strongly convex functions (α = 2 and τ ∼ 1 ε > 0 to get E[f (xout)] − f ⋆ < ε we need to perform at most μ ). For this class of functions, setting M = L, for any T = O (cid:16) t0 + log log( μ3 (cid:17) L2ε ) , with batches of size bg = O( σ2 g με ) and bh = O( σ2 h √ L με ) and, where √ LF 1/4 0 μ3/4 ). t0 = ̃O( Therefore, the total number of arithmetic operations needed to find an ε-global minimum, in this case, is ̃O (cid:16) t0σ2 g με + d t0σ2 h με √ L (cid:17) × GradCost. 4.3 A special case of Theorem 4 Let us consider the special case α = 1, which corresponds to minimizing convex functions. Theorem 4 implies the following global convergence rate: E[f (xout)] − f ⋆ = O (cid:18) δ1D3 S2 + δ2D3 S2m + LD3 S2m2 (cid:19) . We have the following special cases based on the choice of the helper functions. • Basic Cubic Newton [23] corresponds to δ1 = δ2 = 0. Thus, we get its known rate in the convex case. We reach an ε-global minimum using the following number of arithmetic operations: (cid:16) nd√ (cid:17) ε O × GradCost. (26) • Cubic Newton with Lazy Hessian updates [10] corresponds to δ1 = 0, δ2 = L. It gives . By choosing m = d, we reach an ε-global minimum using the (cid:17) (cid:16) LD3 S2m f (xout) − f ⋆ = O following number of arithmetic operations: (cid:17) (cid:16) n √ d√ ε O × GradCost. (27) To the best of our knowledge, this complexity estimate of the Lazy Cubic Newton for convex functions is new, and it improves the complexity of the basic Cubic Newton (26) by factor √ d. • Stochasic Cubic Newton with Variance Reduction [38, 32] corresponds to sampling random batches Bg, Bh of sizes bg, bh respectively at each iteration, and setting h1 = 1 fi in our helper framework. According to Lemma 1 we have i∈Bg bg δ1 = L√ ). Therefore, for bg ∼ m4, bh ∼ m2 and M = L, we get bg fi, h2 = 1 i∈Bg bh and δ2 = ̃O( L√ bh (cid:80) (cid:80) 21 E[f (xout)] − f ⋆ = O(cid:0) LD3 an ε-global minimum using the following number of arithmetic operations: (cid:16) min{(nd)4/5, n2/3d+n} √ (cid:1). By choosing m = (nd)1/51d≤n2/3 + n1/31d≥n2/3 , we reach S2m2 (cid:17) × GradCost. O (28) ε In [21], the global complexity estimate for the stochastic Cubic Newton with Variance Reduction was established for the gradient dominated functions of degree α = 1. However, their result is different from ours, assuming only stochastic samples of the gradients and Hessians, while in our work, we allow recomputing the full gradient and Hessian once per m iterations, similar in spirit to [38, 32]. In our analysis, we take into account the total arithmetic cost of the operations. Hence, to the best of our knowledge, our complexity estimate (28) is new. • Stochastic Cubic Newton with Variance Reduction and Lazy Hessian updates. In this n + n then we reach an ε-global minimum using the following number of arithmetic case, by using sampling, we have δ1 = L√ bg √ d1d≥ operations: and δ2 = L. If we take m = (nd)1/31d≤ √ (cid:16) min{(nd)5/6, n O √ (cid:17) d} × GradCost. √ ε This further improves the total complexity of both the method with Variance Reduction (28) and the Lazy Cubic Newton (27). 4.4 Proof of Theorem 3 From Theorem 5, we have Ef (xt) − Ef (xt+1) ≥ 1 √ 1008 M E∥∇f (xt+1)∥3/2 − 4√ M σ3/2 g − 73 M 2 σ3 h. By the definition of (τ, α)-gradient dominated functions we have which leads to f (xt) − f ⋆ ≤ τ ∥∇f (xt)∥α, E∥∇f (xt+1)∥3/2 ≥ E(cid:0) f (xt+1)−f ⋆ τ (cid:1) 3 2α . If α ≤ 3/2, then by Jensen's inequality we have E∥∇f (xt+1)∥3/2 ≥ (cid:0) Ef (xt+1)−f ⋆ τ (cid:1) 3 2α . (29) For α > 3/2 we need to assume that Ef (xt) − f ⋆ ≤ τ E[∥∇f (xt)∥]α. This gives us (29). We consider the sequence Ft = Ef (xt) − f ⋆ and denote γ = 3 4√ h. Then sequence (Ft)t≥0 satisfies: M σ3/2 g + 25 2α , C = M 2 σ3 1008 1 √ M τ γ and a = Ft − Ft+1 ≥ CF γ t+1 − a. (30) – Case γ = 1. Then From the recurrence, we have: Ft+1 ≤ Ft+a C+1 . Ft ≤ (1 + C)−tF0 + (cid:80)t−1 i=0(1 + C)−i a 1+C ≤ (1 + C)−tF0 + a C . We note that (1 + C)−t ≤ exp( −Ct 1+C ). Therefore, Ft ≤ exp (cid:16) −Ct 1+C (cid:17) F0 + a C . – Case 1 < γ ≤ 3/2. Then let ̃Ft = Ft C1/(1−γ) and ̃a = ̃Ft − ̃Ft+1 ≥ ̃F γ t+1 − ̃a. a C1/(1−γ) for which we have 22 Now let x = ̃a1/γ, and δt = ̃Ft − x. Then δt − δt+1 ≥ (δt+1 + x)γ − xγ ≥ δγ where we used in the last inequality the fact that (x + y)γ ≥ xγ + yγ for γ ≥ 1 and x, y ≥ 0. Here, we assume that δt ≥ 0. Otherwise, we have Ft ≤ ( a Therefore, δt = Ft−( a C )1/γ. t+1, C )1/γ C1/(1−γ) and δt − δt+1 ≥ δγ t+1. We have 1 (γ−1)δγ−1 t+1 − 1 (γ−1)δγ−1 t = t −δγ−1 δγ−1 (γ−1)δγ−1 t+1 δγ−1 t+1 t . The concavity of x (cid:55)→ xγ−1 (since γ ≤ 2) implies that for all x, y ≥ 0 we have xγ−1 − yγ−1 ≥ (γ − 1)xγ−2(x − y). Hence, If δt+1 ≥ δt/2 then 1 (γ−1)δγ−1 t+1 − 1 (γ−1)δγ−1 t ≥ δt−δt+1 δtδγ−1 t+1 ≥ δt+1 δt . 1 (γ − 1)δγ−1 t+1 − 1 (γ − 1)δγ−1 t ≥ 1/2 , otherwise, δt+1 ≤ δt/2, and in this case we have 1 (γ−1)δγ−1 1 (γ−1)δγ−1 1 (γ−1)δγ−1 t+1 ≥ − t t (2γ−1 − 1) ≥ 2γ−1−1 (γ−1)δγ−1 0 , where we used that (δt)t≥0 is decreasing. Thus, in all cases we have: 2γ−1−1 (γ−1)δγ−1 1 (γ−1)δγ−1 ≥ min(1/2, 1 (γ−1)δγ−1 t+1 − 0 t ) := D. By summing from t = 0 to t = T − 1, we get: In other words – Case 3/4 < γ < 1. Then we have 1 (γ−1)δγ−1 T ≥ DT. δT ≤ (cid:0) 1 (γ−1)DT (cid:1) 1 γ−1 . Ft+1 ≤ (cid:0) Ft−Ft+1+a C (cid:1)1/γ . By convexity of x (cid:55)→ x1/γ we get Ft+1 ≤ 21/γ−1(cid:0) Ft−Ft+1 C (cid:1)1/γ + 21/γ−1(cid:0) a C (cid:1)1/γ . Let δt = Ft−21/γ−1( a 21/γ C1/(1−γ) C )1/γ . Then we have δt+1 ≤ (δt − δt+1)1/γ. The sequence (δt)t≥0 is decreasing, thus: δt+1 ≤ δ1/γ This is a superlinear rate, starting from the moment δt < 1 . We can show that from the very beginning (δt)t≥0 will decrease at least at a linear rate, and thus at some point we reach the region of superlinear convergence. . t Indeed, we have δt δt+1 ≥ 1 + δt−δt+1 δt+1 δt+1 ≤ (1 + 1 δ1−γ 0 ≥ 1 + 1 ≥ 1 + 1 δ1−γ t+1 )−1δt = (1 − 1 δ1−γ 0 1+δ1−γ 0 . Therefore, )δt ≤ exp(− 1 1+δ1−γ 0 )δt. We reach δt ≤ 1/2 after t ≥ t0 = (1 + δ1−γ 0 γ )t−t0 superlinear convergence rate: δt ≤ (cid:0) 1 (cid:1)( 1 2 ) log(2δ0) iterations. After that (t ≥ t0), we enjoy a □ . This finishes the proof. 23 4.5 Proof of Theorem 4 In Theorem 4 we made the choice of updating the snapshot in the following way ̃xs+1 = xarg mini∈{0,*** ,m−1} f (xsm+i) which means that f ( ̃xs+1) ≤ f (xsm+i) for all i ∈ {0, * * * , m − 1}. For s ∈ {0, * * * , S − 1} and i ∈ {0, * * * , m − 1} We have the following inequality Ef (xsm+i) − Ef (xsm+i+1) ≥ 1 √ 216 M E∥∇f (xsm+i+1)∥3/2 + E (cid:104) M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)∥xsm+i − xsm∥3(cid:105) . By the definition of gradient dominated functions we have E∥∇f (xt+1)∥3/2 ≥ (cid:0) Ef (xt+1)−f ⋆ So τ (cid:1) 3 2α . Ef (xsm+i) − Ef (xsm+i+1) ≥ 1 √ 216 M (cid:0) Ef (xsm+i+1)−f ⋆ τ (cid:1) 3 2α + E (cid:104) M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M ≥ 1 √ 216 M (cid:0) Ef ( ̃xs+1)−f ⋆ τ (cid:1) 3 2α + E (cid:104) M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)∥xsm+i − xsm∥3(cid:105) + 73δ3 2 M 2 (cid:1)∥xsm+i − xsm∥3(cid:105) . Summing the above inequality for 0 ≤ i ≤ m − 1 and remarking that ̃xs = xsm, we get Ef ( ̃xs) − Ef (x(s+1)m) ≥ m √ 216 M (cid:0) Ef ( ̃xs+1)−f ⋆ τ (cid:1) 3 2α + E (cid:104)m−1 (cid:80) i=0 M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)∥xsm+i − xsm∥3(cid:105) . By the definition of ̃xs+1 we have f ( ̃xs+1) ≤ f ( ̃xsm+i) for all i ∈ {0, . . . , m − 1} which leads to Ef ( ̃xs) − Ef ( ̃xs+1) ≥ m √ 216 M (cid:0) Ef ( ̃xs+1)−f ⋆ τ (cid:1) 3 2α + E (cid:104)m−1 (cid:80) i=0 M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)∥xsm+i − xsm∥3(cid:105) . For M satisfying (24) we have (cid:80)m−1 i=0 have Ef ( ̃xs) − Ef ( ̃xs+1) ≥ Let us define Fs = Ef ( ̃xs) − f ⋆. Then M 72 r3 sm+i+1 − (cid:0) 4δ3/2 1√ M + 73δ3 2 M 2 (cid:1)∥xsm+i − xsm∥3 ≥ 0 thus we m √ 216 M (cid:0) Ef ( ̃xs+1)−f ⋆ τ (cid:1) 3 2α . which is a special case of inequality (30) with a = 0. Thus we can apply our findings from before □ and replace a with 0. Fs − Fs+1 ≥ CF γ s+1, 24
http://arxiv.org/abs/2302.11961v1
2023-02-23T12:17:36
2023-02-23T12:17:36
Sharp Calibrated Gaussian Processes
While Gaussian processes are a mainstay for various engineering and scientific applications, the uncertainty estimates don't satisfy frequentist guarantees, and can be miscalibrated in practice. State-of-the-art approaches for designing calibrated models rely on inflating the Gaussian process posterior variance, which yields confidence intervals that are potentially too coarse. To remedy this, we present a calibration approach that generates predictive quantiles using a computation inspired by the vanilla Gaussian process posterior variance, but using a different set of hyperparameters, chosen to satisfy an empirical calibration constraint. This results in a calibration approach that is considerably more flexible than existing approaches. Our approach is shown to yield a calibrated model under reasonable assumptions. Furthermore, it outperforms existing approaches not only when employed for calibrated regression, but also to inform the design of Bayesian optimization algorithms.
[ "Alexandre Capone", "Geoff Pleiss", "Sandra Hirche" ]
[ { "@title": null, "@href": "http://arxiv.org/abs/2302.11961v1", "@rel": "alternate", "@type": "text/html" }, { "@title": "pdf", "@href": "http://arxiv.org/pdf/2302.11961v1", "@rel": "related", "@type": "application/pdf" } ]
null
{ "@xmlns:arxiv": "http://arxiv.org/schemas/atom", "@term": "cs.LG", "@scheme": "http://arxiv.org/schemas/atom" }
[ "cs.LG", "stat.ML" ]
Sharp Calibrated Gaussian Processes Alexandre Capone 1 Geoff Pleiss 2 Sandra Hirche 1 3 2 0 2 b e F 3 2 ] G L . s c [ 1 v 1 6 9 1 1 . 2 0 3 2 : v i X r a Abstract While Gaussian processes are a mainstay for various engineering and scientific applications, the uncertainty estimates don't satisfy frequen- tist guarantees, and can be miscalibrated in prac- tice. State-of-the-art approaches for designing calibrated models rely on inflating the Gaussian process posterior variance, which yields confi- dence intervals that are potentially too coarse. To remedy this, we present a calibration approach that generates predictive quantiles using a com- putation inspired by the vanilla Gaussian process posterior variance, but using a different set of hy- perparameters, chosen to satisfy an empirical cali- bration constraint. This results in a calibration ap- proach that is considerably more flexible than ex- isting approaches. Our approach is shown to yield a calibrated model under reasonable assumptions. Furthermore, it outperforms existing approaches not only when employed for calibrated regres- sion, but also to inform the design of Bayesian optimization algorithms. 1. Introduction Gaussian process regression offers an ambitious proposi- tion: by conditioning a model on measurement data, we are provided with a Gaussian probability distribution for the unseen data. Assuming that the posterior probability distribution holds, we can then directly calibrate our model using the inverse error function. Though the distribution of unseen data seldom follows the Gaussian prior distri- bution, and the Gaussian process generally does not adapt adequately to the observed distributions after being condi- tioned on the data, Gaussian processes have become one of the most powerful and established regression techniques. Besides having found widespread use in machine learning (Deisenroth et al., 2015; Srinivas et al., 2012), their good 1School of Computation, Information and Technology, Tech- nical University of Munich, Munich, Germany 2Department of Statistics and Zuckerman Institute, Columbia University, New York, USA. Correspondence to: Alexandre Capone <alexan- [email protected]>. generalization properties have motivated applications in the fields of control (Capone & Hirche, 2019), astrophysics (Roberts et al., 2013) and chemistry (Deringer et al., 2021), to name a few. Furthermore, the Bayesian paradigm offers a powerful tool to analyze the theoretical properties of dif- ferent regression techniques (Srinivas et al., 2012; Capone et al., 2022). In this paper, we present a novel approach to obtaining calibrated Gaussian processes. Instead of computing confi- dence intervals by inflating the GP posterior variance, our approach discards it and computes a new quantity inspired by the computation of the posterior variance, where all hyperparameters are chosen in a way that results in both accurate and sharp calibration. normally obtained with obtaining an alternative variance es- timate using new hyperparmeters. In other words, we train two separate Gaussian processes: one for the posterior mean and one for obtaining confidence intervals, posterior vari- ance, which is exclusively used for calibration purposes. By doing so, we reach considerably more flexibility than exist- ing calibration approaches, which enables us to additionally optimize the sharpness of the calibration. Our approach is shown to outperform vanilla Gaussian processes, fully Bayesian Gaussian processes, as well as a state-of-the-art calibration approach, both in terms of calibration and sharp- ness. Notation. We use R+ to denote the non-negative real num- bers. Boldface lowercase/uppercase characters denote vec- tors/matrices. For two vectors a and a(cid:48) in Rd, we employ a(cid:48) to denote componentwise inequality, the notation a a(cid:48) i.e., ai i, i = 1, . . . , d. For a square matrix K, we use to denote its determinant, and [K]ij to denote the entry K | corresponding to the i-th row and j-th column. ≤ ≤ | 2. Related Work Calibration of Classification Models. There has been extensive work on obtaining calibrated models in the domain of classification. While there are many methods that do not employ post-processing, we only focus here on methods that employ some form of post-processing. Most forms post-processing-based calibration for classification fall into the category of conformal methods (Vovk et al.), which, Sharp Calibrated Gaussian Processes given an input, aim to produce sets of labels that contain the true label with a pre-specified probability. Arguably the two most common forms of calibration are isotonic regression (Niculescu-Mizil & Caruana, 2005) and Platt scaling (Platt et al., 1999). In Niculescu-Mizil & Caruana (2005), Platt scaling and isotonic regression are analyzed extensively for different types of predictive models. In Guo et al. (2017), a modified form of Platt scaling for modern classification neural networks is proposed. Calibration of Regression Models. Though initially de- veloped for classification, conformal calibration has been extended to regression settings. In Lakshminarayanan et al. (2017), a calibration approach was proposed for deep en- sembles. Gal et al. (2017) propose a dropout-based tech- nique for calibrating deep neural networks. However, these approaches require changing the regressor, potentially de- teriorating its predictive performance. It should be noted that Bayesian neural networks (MacKay, 1995), while being able to provide credible sets for the output, they fully trust the posterior, resulting in a naively calibrated model that seldom reflects the data's distribution. As a remedy for this, Kuleshov et al. (2018) present a recalibration approach that scales a model's predictive quantiles to satisfy the observed data's distribution. In Vovk et al. (2020), a similar approach is presented, where interpolation between scaling factors is randomized. An extension of both Kuleshov et al. (2018) and Vovk et al. (2020) and other recalibration is proposed in Marx et al. (2022). While these methods have been shown to yield well-calibrated models, the resulting predictive quan- tiles are potentially much too crude, resulting in predictions that perform poorly in terms of sharpness, i.e., the corre- sponding confidence intervals will overestimate the model error by a very large margin. 3. Problem Statement X ⊂ Consider a compact input space R, and an unknown data distribution Π on Rd and output space . X × Y Y ⊂ Π, consider a model that, for every Given training data x [0, 1], returns a predictive mean μD(δ, x), posterior standard deviation σD(δ, x), and scaling factor βδ. The model is then said to be calibrated if and confidence level δ D ∼ ∈ X ∈ Px,y∼Π (cid:16) y μD(δ, x) − ≤ βδσD(δ, x) (cid:17) = δ (1) [0, 1]. Furthermore, the calibrated model holds for every δ is also said to be sharp if the average length of the predicted quantiles ∈ Ex,y∼Π ( βδσD(δ, x) | | ) is small for every δ (Kuleshov et al., 2018). Our goal is to find a sharply calibrated model based on Gaussian process regression. 4. Gaussian Process Regression In this section, we briefly review GP regression, with partic- ular focus on the choice and influence of hyperparameters. A GP is formally defined as a collection of random vari- ables, any subset of which is jointly Gaussian (Rasmussen & Williams, 2006). It is fully specified by a prior mean function, which we set to zero without loss of generality, and a hyperparameter-dependent covariance function, called R, where Θ denotes the hyper- kernel k : Θ parameter space. The core concept behind GP regression lies in assuming that any finite number of measurements R at arbitrary inputs of an unknown function f : x1, . . . , xN is drawn from a GP, i.e., they are jointly Gaussian with mean zero and covariance K(θ), where × X × X → X → ∈ X [K(θ)]ij = k(θ, xi, xj) consists of kernel evaluations at the test inputs. N i=1, where Given a set of noisy observations D } (0, σ2 yi := f (xi) + εi and εi 0) is iid Gaussian mea- surement noise, we can condition the GP on them to obtain the posterior mean and covariance xi, yi { ∼ N = μD(θ, x∗) =k(θ) (cid:0)K(θ) + σ2 D(θ, x∗) =k(θ, x∗, x∗) σ2 0I(cid:1)−1 y, k(θ) (cid:0)K(θ) + σ2 0I(cid:1)−1 k(θ), − (2a) (2b) , with k(θ) := (k(θ, x∗, x1), . . . , k(θ, x∗, xN )), y = (y1, . . . , yN ), and I denoting the identity matrix. In this paper, we restrict ourselves to kernels k( ) that yield a , * posterior variance that is monotonically increasing with re- spect to the hyperparameters θ, as specified in the following assumption. Assumption 4.1. The posterior variance σ2(θ, x∗) is a con- tinuous function of θ. Furthermore, for all hyperparame- ters θ, θ(cid:48) ∈ σ2(θ(cid:48), x∗). θ(cid:48), it holds that σ2(θ, x∗) Θ with θ ≤ ≤ * * Assumption 4.1 is not very restrictive, as it holds for many commonly used kernels, e.g., linear or isotropic kernels (Capone et al., 2022). Furthermore, it can also be enforced via a reparametrization of the kernel, e.g., if θ corresponds to the inverse of the lengthscales. Assumption 4.1 will be leveraged to define a cumulative density function by also changing the parameters of the posterior covariance, as opposed to simply scaling it. Arguably one of the most challenging aspects of GP re- gression lies in the choice of hyperparameters θ, as they ultimately determine various characteristics of the posterior, e.g., smoothness and amplitude. In practice, the most com- mon way of choosing θ is by minimizing the log marginal Sharp Calibrated Gaussian Processes 5. Proposed Approach In this section, we present our approach to obtaining cali- brated GPs by discarding the posterior variance and obtain- ing an alternative variance estimate using new hyperparme- ters. As we will demonstrate, our approach has numerous advantages. First, by modifying the posterior mean hyperpa- rameters, the resulting variance and confidence intervals can be sharper than what could be obtained simply by rescaling the posterior variance. Secondly, by exploiting the monotic- ity of hyperparameters, our approach can be used to obtain intervals for multiple confidence levels δ in a very efficient manner. Finally, our method is backed by tight theoretical guarantees, obtained by exploiting its connection to confor- mal prediction. 5.1. Calibrated GP for Single Confidence Level δ In the following, we describe how to obtain a sharply cal- ibrated GP for a fixed desired calibration level δ. In this paper, we quantify sharpness using the measure suggested by Kuleshov et al. (2018), whereby a model is said be sharp if the average posterior variance of the calibrated model is low. Instead of scaling the GP posterior variance to meet the desired calibration level δ, we propose retraining the full posterior variance. In other words, we discard the posterior variance of the first GP and replace it by the posterior vari- ance of a second GP, which we train separately. This way, we allow for more degrees of freedom during calibration, which enables for a more sharply calibrated model. We assume to have a GP posterior mean μD(θR, ), where * the regressor hyperparameters θR were obtained, e.g., via log-likelihood maximization. Choosing the hyperparam- eters for the posterior via log-likelihood maximization is typically promising due to the trade-off between data fit and model complexity discussed in Section 4. However, any other way of choosing θR is permitted, e.g., expert knowl- edge or by minimizing metrics that take generalization into account (Lotfi et al., 2022). Given θR, we then aim to obtain, for an arbitrary 0 1, a vector of hyperparameters θδ, such that the corresponding posterior standard deviation σD(θδ, ) contains δ times the * total amount of data points. For this reason, we henceforth refer to θδ and σ2 ) as calibration hyperparameters Dtr * and calibration variance, respectively. (θδ, ≤ ≤ δ A naive way of choosing βδ and θδ would be by guarantee- ) contains exactly δ times the desired ing that βδσDtr (θδ, * number of data from . While a similar approach might be reasonable, e.g., for Bayesian or ensemble neural networks, it should be avoided in the case of GPs. This is because ) is approximately proportional to the measure- σDtr (θδ, * , whereas it behaves considerably differently ment noise at . Since we wish for test points that are not close to the data D D D Figure 1. Confidence interval of 90% obtained with purely Bayesian approach, where the inverse error function is employed to compute βδ. The confidence region does not capture the training nor the test data with 90% accuracy, indicating that it is exceed- ingly confident. likelihood log p(y X, θ) = | − 1 2 log K(θ) + σ2 0I | | N 2 − log(2π) 1 2 − y(cid:124) (cid:0)K(θ) + σ2 0I(cid:1)−1 y. (3) In terms of posterior mean quality, i.e., predictive perfor- mance of μ(θ, x∗), choosing the hyperparameters in this manner is often the most promising option, since it seeks a trade-off between model complexity and data fit, and has repeatedly been shown to yield a satisfactory mean square error when applied to test data (Rasmussen & Williams, 2006). However, the same generally cannot be said of the posterior variance σ2(θ, x∗), particularly whenever it is employed to estimate the model error, as it has been shown to be overly confident in practice (Capone et al., 2022; Fong & Holmes, 2020). This excess in confidence stems directly from the minimization of the log marginal likelihood (3), which measures the GP's ability to explain the existing data, but not its ability to make predictions on unseen data (Lotfi et al., 2022). This is because, on the one hand, the log marginal likelihood (3) does not account for calibration, i.e., how well the posterior variance explains the model error. On the other hand, in practice the Gaussian prior for the data often deviates much too strongly from its true distribu- tion, and the posterior, being also Gaussian, typically also presents a poor fit. This discrepancy between the posterior and the unseen data has serious implications for whenever we aim to obtain a calibrated model, i.e., a model that pro- vides accurate confidence intervals for the unseen data. This is particularly true of the Bayesian approach to confidence intervals, where we obtain confidence intervals by simply multiplying the posterior standard deviation with expected the z-score, see Figure 1 for an illustration. xf(x)μ(x)TrainingData90%ConfidenceLevelTestData Sharp Calibrated Gaussian Processes X to obtain a model that is calibrated within the whole input , we have to take this into account during training. space To this end, we randomly split the total available data into posterior variance training data D tr and calibration data ) tr * D D ) are then conditioned and the calibration variance σDtr (θδ, * uniquely on cal is employed to choose sharp cal- tr, and ibration hyperparameters θδ. To achieve this, we aim to solve the equation cal. The posterior mean μDtr (θR, cal, with ∩ D = D D D D Ncal(cid:88) i min βδ∈R θ∈Θ δ σ2 β2 Dtr (cid:0)θδ, xi cal (cid:1) Ncal(cid:88) I≥0 s.t. i (cid:0)∆yi cal − βδσDtr Ncal + 1 (cid:0)θδ, xi cal (cid:1)(cid:1) = δ (4) cal (cid:9) cal, yi cal cal := yi for θδ, where (cid:8)xi cal are samples from the cali- ∈ D bration data set, ∆yi μDtr (θR, xi cal) corresponds cal − to the difference between predicted and measured output, Ncal = corresponds to the number of data points used for calibration. Remark 5.1. Note that we employ Ncal + 1 in the denomi- nator in (4) instead of Ncal. Though this choice makes little difference in practice, we require it for theoretical guaran- tees. |D | The equality constraint in (4) is generally infeasible, e.g., if Ncal = 2 and δ = 0.5, and is discontinuous, making it hard to solve. As it turns out, this can be easily remedied, and the problem can be rendered considerably easier to solve, by substituting the equality constraint in (4) with the equality βδ = qlin(δ, Σ−1 Dtr ∆ycal), (5) where qlin(δ, Σ−1 ∆ycal) is a monotonically increasing Dtr piecewise linear function1 that maps δ = j/(Ncal + 1) to the j-th smallest entry of Σ−1 ∆ycal, and the entries of the Dtr vector Σ−1 Dtr ∆ycal = (cid:32) ∆y1 cal σDtr (θδ, x1 cal) , ..., ∆yNcal cal σDtr (θδ, xNcal cal ) (cid:33)(cid:62) correspond to the z-scores of the data under the calibration ). The original problem (4) standard deviation σDtr (θδ, then becomes * min θ∈Θ Ncal(cid:88) i (cid:2)qlin(δ, Σ−1 Dtr ∆ycal)σDtr (cid:0)θδ, xi cal (cid:1)(cid:3)2 , (6) 1For a ∈ RNcal , [1, ..., Ncal] where aij ≤ aij+1 [l/(Ncal + 1), (l + 1)/(Ncal + 1)], a permutation i1, . . . , iNcal ∈ for all j, and δ ∈ qlin(δ, a) = ail + (δ(N + 1) − l) (cid:0)ail+1 − ail (cid:1) . Algorithm 1 Training Calibration Hyperparameters for Ar- bitrary Confidence Level , * * cal, confidence levels δ1, ...δN Input: kernel k( , * data for i = 1 to M do D ), predictor μ(θR, ), calibration * θδi if βδi < 0 Compute θδi and βδi by solving (6) subject to θδi−1 ≤ θδi if βδi > 0 and θδi−1 ≥ end for Fit a continuous, monotonically increasing interpolation model ˆβ(δ) and a continuous model ˆθ(δ) using the train- ing data Output: ˆθ(δ) δi, βδi, θδi}i=1,...,N { which is considerably easier to solve due to the lack of con- sraints, and enables us to use gradient-based approaches, since qlin(δ, Σ−1 ∆ycal) is differentiable with respect to Dtr σDtr (θδ, xi cal). 5.2. Calibrated GP for Arbitrary Confidence Level δ While (6) is useful for obtaining a sharply calibrated model for a single confidence level δ, solving (6) multiple times whenever we want to obtain sharply calibrated models for different confidence levels δ can be time-consuming. Furthrmore, interpolating between any two arbitrary so- lutions of (6) won't necessarily yield a result close to the desired calibration. Fortunately, we can leverage As- sumption 4.1 to show that interpolating between two so- lutions of (6) will yield a result close to the desired cali- bration, provided that we interpolate between two strictly increasing or decreasing sets of hyperparameters. For- mally, this is achieved by solving (6) N + 1 times to obtain R, subject β0, βδ1, . . . , βδN ∈ to two additional constraints. Firstly, the calibration scaling parameters βδ must be monotonically increasing with δ, i.e., R and θ0, θδ1, . . . , θδN ∈ βδi ≤ βδj if δi < δj, and the calibration hyperparameters θδ must be decreasing with δ if βδ is negative, and increasing if βδ is positive, i.e., θδi ≤ θδi ≥ θδj , if δi < δj and βi θδj , if δi < δj and βj 0, 0. ≥ ≤ In other words, the entries of θδ are strictly decreasing with βδ up until the sign of βδ switches, after which they are increasing. The reason why we impose these restrictions is that we can then confidently interpolate between any values of βδ and θδ, since Assumption 4.1 implies that the ) is monotonically increasing quantile stipulated by βδσ(θ, * with δ. We then train simple linear interpolation models ˆβ : [0, 1] Θ, such that ˆβ(δi) = βδi → and ˆθ(δi) = θδi, with the additional constraint that ˆθ(δ) R and ˆθ : [0, 1] → Sharp Calibrated Gaussian Processes reaches a minimum whenever ˆβ(δ) = 0, which can be potentially achieved by adding an artificial vector of training hyperparameters θδ for computing ˆθ(δ). Note, however, that any other form of interpolation is also acceptable for obtaining ˆβ(δ) and ˆθ(δ). Remark 5.2. While lengthscale constraints of the form θδj ≤ θδj+1 can be easily enforced when solving (6) by substituting θ with θδj + ∆θ and minimizing over the log- βδj+1 is not enforced in arithm of ∆θ, the constraint βδj ≤ (6). However, in practice we were often able to find local minima of (6) that satisfy this requirement. We can then easily show that our approach achieves an arbi- trary calibration level as the amount of data grows provided that we choose the confidence levels δ accordingly. Theorem 5.3. Let y be absolutely continuous conditioned on x, let μDtr (θR, ) be a posterior GP mean, and let tr. , σDtr ( * (cid:9), Then, for any calibration data set choose ) be a GP posterior variance conditioned on D cal, yi cal cal = (cid:8)xi D * * a specific level of calibration is often required, as opposed to several different ones, e.g., in stochastic model predictive control, where chance constraints corresponding to a fixed risk have to be satisfied (Mesbah, 2016). In such settings, we potentially only have to train a single vector of calibration hyperparameters θδ, which reduces computational cost. Initialization and Solution. Much like in standard GP hyperparameter training, the choice of initial hyperparam- eters can affect the optimization results considerably, and choosing a good hyperparameter initialization can be chal- lenging. While this can be partially addressed by employing random restarts, we can also reuse trained models for sim- ilar calibration levels, since it is reasonable to expect that only small changes to the hyperparameters are required to achieve a slight increase or decrease in confidence level. Furthermore, we can also simplify the problem by consider- ing only a scaled version of the regression hyperparameters θR to compute θδ, which would reduce the optimization problem to a line search. δ1 = 1 Ncal + 1 , δ2 = 2 Ncal + 1 , ..., δNcal = Ncal Ncal + 1 7. Experiments R be Ncal scalars and θδ1, . . . , θδNcal ∈ βδ1, . . . , βδNcal ∈ Θ be Ncal vectors of calibration hyperparameters, such that and . . . βδNcal βδ1 ≤ θδi−1 ≥ θδi ≤ θδi θδi+1 if βδi ≤ if βδi ≥ 0 0. Then (cid:16) y Px,y∼Π (cid:20) δ μDtr ( ˆθ(δ), x) 1 Ncal + 1 , δ + − 1 Ncal + 1 − ∈ . (cid:17) ˆβ(δ)σDtr ( ˆθ(δ), x) ≤ (cid:21) Proof. The proof can be found in Appendix A. Note that Theorem 5.3 also implies that a single set of calibration parameters βδ and θδ obtained by solving (6), since we can substitute ˆβ(δ) = βδ and ˆθ(δ) = θδ into (7). 6. Discussion Computational Complexity. There are many ways to al- leviate the computational cost of our approach. Much like hyperparameter optimization for standard GPs (Rasmussen & Williams, 2006), we can employ only a subset of the data to choose the calibration variances, and afterwards the full data set for predictions. This reduces the cost of inverting the covariance matrix significantly, as the cost of inversion scales cubically. Note that our technique is also readily applicable to sparse GPs. Moreover, in many settings D In this section, we apply and analyze our approach in regres- sion and Bayesian optimization settings. 7.1. Calibrated Regression We begin with numerical regression experiments, where the goal is to obtain a calibrated regression model. We test our approach on various data sets and compare it to the state-of- the-art recalibration approaches by Kuleshov et al. (2018) and Vovk et al. (2020), the variance-free approach proposed by Marx et al. (2022), as well as the naive Bayesian ap- proach for the vanilla and fully Bayesian GPs. The tech- nique proposed by Kuleshov et al. (2018) essentially scales the posterior standard deviation such that the confidence level observed on the training data matches that of the de- sired confidence level. Vovk et al. (2020) employ a similar approach, except that random interpolation is employed to compute new scaling values, while the variance-free ap- proach proposed in Marx et al. (2022) simply computes a constant and uses it to bound the model error everywhere. In the two Bayesian approaches, the credible sets are as- sumed to correspond exactly to confidence intervals. In all aproaches, we employ a squared-exponential kernel and a prior mean of zero, except for datasets with more than 1000 training data points, where we employ sparse GPs (Titsias, 2009) with 300 inducing points. 7.1.1. TOY DATA SET The first regression data set corresponds to a one- dimensional version of the Ackley function, where the re- sults can be easily displayed visually. The main purpose of Sharp Calibrated Gaussian Processes (a) Our approach. (b) Kuleshov et al. (2018). (c) Vovk et al. (2020). (d) Variance-free (Marx et al., 2022). (e) Vanilla GP, naive. (f) Fully Bayesian GP, naive. Figure 2. Calibrated regression models obtained with a desired calibration of δ = 0.01f and our method (blue), a vanilla GP rescaled using the approach by Kuleshov et al. (2018), a naive vanilla GP (green), and a naive fully Bayesian GP (magenta). Compared to the other approaches, our approach yields a calibrated model that peaks more significantly far away from the data while staying tight when close to the data. This is because of the added flexibility that comes from being able to also change the lengthscale to design a calibrated model. Table 1. Average expected calibration error (7), scaled with a factor of 100 for ease of exposition, for six different approaches: ours, vanillas GP recalibrated using the methods of Kuleshov et al. (2018) (V-RK), Vovk et al. (2020) (V-RV) and the variance-free approach proposed in Marx et al. (2022) (V-RM), and naive (not recalibrated) vanilla and fully Bayesian Gaussian processes. Lower is better. BOSTON YACHT AUTO WINE CEMENT KIN8NM FACEBOOK2 OURS V-RK V-RV V-RM V FULLB 0.376± 0.52 0.35± 0.53 0.35± 0.53 0.55± 0.87 7.1± 21 - 0.91 ± 1.5 0.86± 1.5 0.86± 1.5 0.033± 0.046 6.8± 22 6.9± 21 0.36 ± 0.41 0.35± 0.46 0.36± 0.47 1.5± 1.6 5.1± 22 7.1± 22 0.072 ± 0.082 0.076± 0.091 0.074± 0.088 0.28± 0.41 5.4± 22 - 0.19 ± 0.18 0.23± 0.2 0.037± 0.091 2.2± 1.9 6.1± 22 - 0.015 ± 0.026 0.014± 0.023 0.23± 0.2 0.016± 0.025 0.76± 0.67 - 0.037 ± 0.091 0.038± 0.091 0.037± 0.091 0.04± 0.09 3.7± 4 - this section is to give an intuition as to how our approach ap- proaches the computation of confidence intervals compared to other approaches. We investigate the performance of our approach and compare it to that of other approaches when employed to compute centered 99% confidence intervals. We observe that the confidence intervals obtained with our approach peak more sharply far away from the data while being considerably tighter near the data compared to other approaches. This is because we allow the lengthscale to decrease in order to obtain a calibration model, whereas the other approaches simply scale the posterior variance without changing any hyperparameters. The results are depicted in Figure 2. 7.1.2. BENCHMARK DATA SETS We now experiment with different regression data sets from the UCI repository. We assess performance by employing the diagnostic tools for calibration and sharpness proposed by Kuleshov et al. (2018) and Marx et al. (2022). The score used to quantify the quality of a forecast calibration is the (normalized) calibration error cal (cid:0)μD(θR, ), β*, σDtr ( * , * )(cid:1) = * m (cid:88) j=1 ˆpj)2 , (pj − (7) where pj corresponds to the j-th desired confidence level, chosen, e.g., uniformly distributed between 0 and 1, and ˆpj is the observed confidence level, i.e., (cid:12) (cid:12) (cid:8)y∗ t (cid:12) (cid:12) ∆y∗ t ≤ ˆpj = βpj σDtr (θpj x∗ T t ), t = 1, ..., T (cid:9)(cid:12) (cid:12) . (8) Here the superscript T denotes the total number of test points, and ∆y∗ t μDtr (θR, x∗ t ) denotes test inputs and outputs, := y∗ t . To measure sharpness, we employ three ∗ − xf(x)xxxxf(x)x Sharp Calibrated Gaussian Processes Table 2. Average quantile length (7) obtained our approach, vanilla GP recalibrated using the methods of Kuleshov et al. (2018) (V-RK), Vovk et al. (2020) (V-RV). We do not report the sharpness obtained with all other approaches, as they do not achieve good calibration as per Table 1, which makes sharpness meaningless. We report the mean value of the metric shown in (9). Lower is better. DATA SET BOSTON YACHT AUTO WINE CEMENT KIN8NM FACEBOOK2 OURS V-RK V-RV V-RM 0.14 ± 0.2 0.36± 1.2 0.36± 1.2 0.42± 1.2 0.33 ± 0.55 0.46± 0.89 0.46± 0.89 0.87± 1.4 0.17 ± 0.28 0.25± 0.53 0.24± 0.53 0.55± 0.64 2.1 ± 3.5 9.6± 27 9.6± 27 2± 6.3 0.59 ± 0.73 0.68± 1 0.68± 1 1.7± 1.5 0.031 ± 0.065 0.047± 0.12 0.047± 0.12 0.034± 0.072 34 ± 160 41± 200 41± 200 43± 200 Table 3. Average length of centered 95% confidence interval obtained with our approach and vanilla GPs recalibrated using the methods of Kuleshov et al. (2018) (V-RK), Vovk et al. (2020) (V-RV) and the variance-free approach proposed in Marx et al. (2022) (V-RM). We do not report results obtained with other methods, as they do not achieve good calibration as per Table 1. Lower is better. DATA SET BOSTON YACHT AUTO WINE CEMENT KIN8NM FACEBOOK2 OURS V-RK V-RV V-RM 1.2 ± 0.14 1.9± 0.41 1.4± 0.24 2± 0.58 1.8 ± 0.26 2.3± 0.33 2.2± 0.42 1.2± 0.12 1.4 ± 0.19 1.8± 0.25 1.7± 0.23 0.89± 0.11 4.7 ± 0.35 8.7± 1.9 6.1± 0.66 7.2± 1.2 2.5 ± 0.04 2.9± 0.044 2.5± 0.086 1.5± 0.2 0.47 ± 0.025 0.47± 0.014 0.47± 0.014 0.091± 0.0032 1.7 ± 0.13 1.8± 0.15 1.8 ± 0.15 0.9 ± 0.09 different quantities, two of which were proposed by Marx et al. (2022). The first one is the average square length of the quantile, given by len (β*, σDtr( , * )) = * m (cid:88) T (cid:88) j=1 t=1 β2 pj D(θpj , x∗ σ2 t ). (9) The two other metrics correspond to the average length of th 95% confidence interval and the average negative log likelihood of the predictions. When applying the approach of Kuleshov et al. (2018), the vanilla and fully Bayesian GPs, the quantile βδσ(θpj , x∗ j ) in (7) and (9) are substituted by the corresponding posterior standard deviation multiplied by the (recalibrated) z-score. Similarly, Vovk et al. (2020) recalibrates the z-score using random interpolation, whereas the variance-free approach proposed in Marx et al. (2022) replaces βδσ(θpj , x∗ j ) with a constant for all x∗ j . In Table 1 and Table 4, we report the calibration and sharp- ness, as given by (7) and (9), respectively. As can be seen, our approach performs either marginally worse and or better in terms of expected calibration error compared to other existing calibration approaches. How- ever, it consistently performs considerably better than every other approach in terms sharpness, average length of 95% confidence intervals, and negative log likelihood. A general conclusion that we may draw from the results is that, in most settings, increasing sharpness, as measured by (9), is detrimental for calibration and vice-versa. This makes sense, since in many settings the calibration variance must be high in order to capture correspondingly high errors. 7.2. Bayesian Optimization We now investigate how the proposed calibration approach can be employed in a Bayesian optimization context using two commonly used benchmark functions, the Ackley and Rosenbrock functions. In Bayesian optimization, the goal is to find a point in input space that maximizes an unknown function f ( ). In particu- * lar, we investigate how our calibrated GP bound performs when it is used as an upper confidence bound (UCB) for a GP-UCB type acquisition function. Simply put, given a data t of size t, the GP-UCB algorithm chooses a query set point by maximizing the acquisition function D x∗ t+1 = arg max x μDt(θR, x) + βDtσDt(θR, x), (10) D where βDt is a tuning parameter that stipulates the trade-off between exploration and exploitation, and may or may not depend on the data set t. It has been shown that, if the un- ) belongs to the RKHS associated with known function f ( * the kernel k(θR, ), and βDt is chosen sufficiently large, , * * then the GP-UCB achieves sublinear regret (Chowdhury & Gopalan, 2017). However, both assumptions typically cannot be verified in practice, and choosing both the kernel k(θR, ) and the scaling factor βDt in a principled man- ner remains an open problem. We propose employing the modified acquisition function , * * x∗ = arg max x μDt(θR, x) + βδσDt (θδ, x), (11) where the hyperparameters θδ are obtained via a calibrated model and a suitable choice of confidence parameter δ. In the experiments, we set βDt = 1 and compute the calibrated hyparparameters by setting δ = 0.01, meaning that we set Sharp Calibrated Gaussian Processes Table 4. Average negative log likelihood obtained with our approachs and vanilla GPs recalibrated using the methods of Kuleshov et al. (2018) (V-RK), Vovk et al. (2020) (V-RV) and the variance-free approach proposed in Marx et al. (2022) (V-RM). We do not report results obtained with all other approaches, as they do not achieve good calibration as per Table 1, which makes NLL meaningless. Lower is better. DATA SET BOSTON YACHT AUTO WINE CEMENT KIN8NM FACEBOOK2 OURS V-RK V-RV V-RM 0.14 ± 0.13 0.36± 0.11 0.74± 0.14 0.39± 0.086 0.44 ± 0.25 0.74± 0.074 1.4± 0.18 1.5± 0.17 0.46 ± 0.055 0.58± 0.095 1± 0.16 0.97± 0.071 1.4 ± 0.073 1.5± 0.068 1.7± 0.073 1.5± 0.12 0.91 ± 0.043 1± 0.046 1± 0.032 1.5± 0.012 -0.66 ± 0.036 -0.64± 0.049 -0.63± 0.049 -0.63± 0.038 -1.2 ±0.01 -1.2±0.01 -1.2±0.02 -1.1± 0.02 (a) Cumulative regret Rcumul T of Ackley experiment. (b) Simple regret Rsimple T of Ackley experiment. (c) Cumulative regret Rcumul T of Rosenbrock experiment. (d) Simple regret Rsimple T of Rosenbrock experiment. Figure 3. Regret of Ackley (top) and Rosenbrock (bottom) experiment over the number of Bayesian optimization iterations with UCB. expect only one-percent of the evaluations to lie outside the confidence region. Note that, even though the underlying function is fixed, it is reasonable to expect that some of the data lies outside the confidence region due to noise, and we can only expect the data to lie fully within the confidence region in the noiseless case, which we do not consider in this paper. We additionally compare our results to the vanilla UCB algorithm, where the hyperparameters, chosen via log- likelihood maximization, are identical for both the posterior mean and variance, and we set βDt = 2. We evaluate the results both in terms of cumulative regret and simple regret. Cumulative regret after T steps corre- sponds to the metric Rcumul T = T (cid:88) (cid:18) t=1 (cid:19) max x∈X f (x) − f (xt) , (12) whereas simple regret is given by Rsimple T = max x∈X f (x) max t≤T − f (xt). (13) Typically, a Bayesian optimization algorithm is deemed to be useful if cumulative regret exhibits sublinear growth, as this implies that the average regret goes to zero. Simple regret, by contrast, corresponds to the best query among all past queries. In the case of the Ackley experiment, our approach typically chose lengthscales that were smaller than those computed via likelihood maximization. This results in more exhastive exploration than vanilla UCB, which in turn means that local minima are explored more carefully before the focus of the optimization is shifted elsewhere. This results in performance, both in terms of cumulative and simple regret. The results correspond to the top two figures in Figure 3. 0200400600800100012001400Iteration02500500075001000012500CumulativeregretOurapproach+UCBVanillaUCB0200400600800100012001400Iteration05101520SimpleregretOurapproach+UCBVanillaUCB02505007501000125015001750Iteration0.000.250.500.751.00Cumulativeregret×107Ourapproach+UCBVanillaUCB02505007501000125015001750Iteration0.02.55.07.510.0SimpleregretOurapproach+UCBVanillaUCB Sharp Calibrated Gaussian Processes In contrast to the Ackley experiment, in the Rosenbrock experiment our approach selects lengthscales that are larger than those suggested by the likelihood maximum. Roughly speaking, this means that the confidence intervals produced by the likelihood maximum hyperparameters are too con- servative, and our approach attempts to compensate this by indicating more confidence in the posterior mean ob- tained with the vanilla GP. This means that local minima are explored less meticulously than with the vanilla UCB algorithm. This choice is justified by the cumulative regret obtained with our approach, as it is slightly smaller than that obtained by the vanilla UCB algorithm. However, this also results in worse simple regret than the vanilla UCB algorithm, which is intuitive, as our approach opts to ex- plore local minima less accurately than the vanilla UCB algorithm. We also note that both algorithms converge to- wards the same simple regret as the number of iterations increases. 8. Conclusion We have presented a calibration method for Gaussian pro- cess regression that leverages monotonicity properties of the posterior lengthscale to obtain sharp calibrated models. We show that, under reasonable assumptions, our method yields an accurately calibrated model as the size of data used for calibration increases. When applied to different regression benchmark data sets, our approach always yielded more accurately calibrated models than other approaches, while being sharper than a state-of-the-art recalibration method. Furthermore, when employed to design an upper confidence bound Bayesian optimization algorithm, our approach re- sulted in better cumulative regret than the most commonly used approach. References Capone, A. and Hirche, S. Backstepping for partially un- known nonlinear systems using Gaussian processes. IEEE Control Systems Letters, 3:416–421, 2019. Capone, A., Lederer, A., and Hirche, S. Gaussian process uniform error bounds with unknown hyperparameters for safety-critical applications. In Chaudhuri, K., Jegelka, S., Song, L., Szepesvari, C., Niu, G., and Sabato, S. (eds.), Proceedings of the 39th International Conference on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 2609–2624. PMLR, 17– 23 Jul 2022. URL https://proceedings.mlr. press/v162/capone22a.html. Chowdhury, S. R. and Gopalan, A. On kernelized multi- armed bandits. arXiv preprint arXiv:1704.00445, 2017. Deisenroth, M. P., Fox, D., and Rasmussen, C. E. Gaussian processes for data-efficient learning in robotics and con- trol. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(2):408–423, 2015. Deringer, V. L., Bart ́ok, A. P., Bernstein, N., Wilkins, D. M., Ceriotti, M., and Cs ́anyi, G. Gaussian process regres- sion for materials and molecules. Chemical Reviews, 121(16):10073–10141, 2021. doi: 10.1021/acs.chemrev. 1c00022. URL https://doi.org/10.1021/acs. chemrev.1c00022. PMID: 34398616. Fong, E. and Holmes, C. C. On the marginal likelihood and cross-validation. Biometrika, 107(2):489–496, 01 2020. ISSN 0006-3444. doi: 10.1093/biomet/asz077. URL https://doi.org/10.1093/biomet/asz077. (eds.), Advances Gal, Y., Hron, J., and Kendall, A. Concrete dropout. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, Information Pro- R. cessing Systems, volume 30. Curran Associates, URL https://proceedings. Inc., neurips.cc/paper/2017/file/ 84ddfb34126fc3a48ee38d7044e87276-Paper. pdf. in Neural 2017. Guo, C., Pleiss, G., Sun, Y., and Weinberger, K. Q. On cali- bration of modern neural networks. In Precup, D. and Teh, Y. W. (eds.), Proceedings of the 34th International Confer- ence on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1321–1330. PMLR, 06– 11 Aug 2017. URL https://proceedings.mlr. press/v70/guo17a.html. Kuleshov, V., Fenner, N., and Ermon, S. Accurate uncer- tainties for deep learning using calibrated regression. In International Conference on Machine Learning, pp. 2796– 2804. PMLR, 2018. Lakshminarayanan, B., Pritzel, A., and Blundell, C. Simple and scalable predictive uncertainty estimation using deep ensembles. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R. (eds.), Advances in Neural Information Pro- cessing Systems, volume 30. Curran Associates, URL https://proceedings. Inc., neurips.cc/paper/2017/file/ 9ef2ed4b7fd2c810847ffa5fa85bce38-Paper. pdf. 2017. Lotfi, S., Izmailov, P., Benton, G., Goldblum, M., and Wil- son, A. G. Bayesian model selection, the marginal likeli- hood, and generalization. In Chaudhuri, K., Jegelka, S., Song, L., Szepesvari, C., Niu, G., and Sabato, S. (eds.), Proceedings of the 39th International Conference on Ma- chine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 14223–14247. PMLR, 17–23 Jul Sharp Calibrated Gaussian Processes Cherubin, G. (eds.), Proceedings of the Ninth Sympo- sium on Conformal and Probabilistic Prediction and Applications, volume 128 of Proceedings of Machine Learning Research, pp. 84–99. PMLR, 09–11 Sep 2020. URL https://proceedings.mlr.press/ v128/vovk20a.html. 2022. URL https://proceedings.mlr.press/ v162/lotfi22a.html. MacKay, D. J. Bayesian neural networks and density net- works. Nuclear Instruments and Methods in Physics Re- search Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 354(1):73–80, 1995. Marx, C., Zhao, S., Neiswanger, W., and Ermon, S. Modu- lar conformal calibration. In Chaudhuri, K., Jegelka, S., Song, L., Szepesvari, C., Niu, G., and Sabato, S. (eds.), Proceedings of the 39th International Conference on Ma- chine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 15180–15195. PMLR, 17–23 Jul 2022. URL https://proceedings.mlr.press/ v162/marx22a.html. Mesbah, A. Stochastic model predictive control: An IEEE overview and perspectives for future research. Control Systems Magazine, 36(6):30–44, 2016. Niculescu-Mizil, A. and Caruana, R. Predicting good prob- abilities with supervised learning. New York, NY, USA, 2005. Association for Computing Machinery. ISBN 1595931805. URL https://doi.org/10.1145/ 1102351.1102430. Platt, J. et al. Probabilistic outputs for support vector ma- chines and comparisons to regularized likelihood meth- ods. Advances in large margin classifiers, 10(3):61–74, 1999. Rasmussen, C. E. and Williams, C. K. Gaussian processes for machine learning. 2006. The MIT Press, Cambridge, MA, USA, 2006. Roberts, S., Osborne, M., Ebden, M., Reece, S., Gibson, N., and Aigrain, S. Gaussian processes for time-series mod- elling. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 371 (1984):20110550, 2013. Srinivas, N., Krause, A., Kakade, S. M., and Seeger, M. W. Information-theoretic regret bounds for Gaussian process optimization in the bandit setting. IEEE Transactions on Information Theory, 58(5):3250–3265, 2012. Titsias, M. Variational learning of inducing variables in sparse Gaussian processes. In Artificial Intelligence and Statistics, pp. 567–574, 2009. Vovk, V., Gammerman, A., and Shafer, G. Algorithmic learning in a random world, volume 29. Springer. Vovk, V., Petej, I., Toccaceli, P., Gammerman, A., Ahlberg, E., and Carlsson, L. Conformal calibrators. In Gam- merman, A., Vovk, V., Luo, Z., Smirnov, E., and A. Proof of Theorem 5.3 Sharp Calibrated Gaussian Processes For the sake of completeness, we state Theorem 1 from Marx et al. (2022) here in adapted form, which we then use to prove Theorem 5.3. Lemma A.1 (Marx et al. (2022), Theorem 1). Let φ : absolutely continuous random variable and, for any fixed x∗ for a set of calibration data that X × (cid:9) with Ncal = cal = (cid:8)xi cal, yi cal D R → , φ(x∗, R be a function such that that φ(x, y), x, y Π is an ) is strictly monotonically increasing. Furthermore, * [1, 2, . . . , Ncal] such ∼ cal ∈ X |D | cal) < φ(xij+1 and a permutation i1, . . . , iNcal ∈ , yij+1 cal, yij [0, 1] be a monotonically non-decreasing function, such that H(φ(xij φ(xij cal ), cal cal, yij cal)) = j Ncal+1 holds for all let H : R j = 1, . . . , Ncal. Then → (cid:16) Px,y∼Π H(φ(x, y)) (cid:17) δ ∈ ≤ (cid:20) δ 1 Ncal + 1 − , δ + (cid:21) 1 Ncal + 1 δ ∀ ∈ [0, 1]. The idea behind the proof of Theorem 5.3 is to show that the solution φ(x, y) of the implicit equation μ(θR, x) y − − ˆβ(φ(x, y))σ (cid:17) (cid:16) ˆθ (φ(x, y)) , x = 0 (14) satisfies the requirements stipulated by Lemma A.1, where ̃β(δ) and ̃θ(δ) are arbitrary continuous functions such that ̃β(δ) = ̃θ(δ) = lim δ→∞ lim δ→∞ , ∞ , ∞ lim δ→−∞ lim δ→−∞ ̃β(δ) = ̃θ(δ) = , −∞ , ∞ ̃β(δ) is strictly monotonically increasing for all δ ̃θ(δ) is monotonically increasing for all δ ̃θ(δ) is monotonically decreasing for all δ δ ∈ { ∈ R ∈ R | R ̃β(δ) > 0 } ̃β(δ) < 0 . } ∈ | ̃β(δ) > 0 ̃θ(δ) is monotonically increasing with respect to δ for all δ , and monotonically decreasing with } . Note that the functions ˆβ(δ) and ˆθ(δ) can be easily extended within the real R respect to δ for all δ axis to satisfy the requirements mentioned above, which means that they are contained within the set from which ̃β(δ) and ̃θ(δ). The reason why we choose arbitrary ̃β(δ) and ̃θ(δ), as opposed to the functions ˆβ(δ) and ˆθ(δ), is because we need φ(x, y) to be independent of the calibration data cal in order to be able to employ Lemma A.1. Showing that φ(x, y) satisfies the requirements of Lemma A.1 for any ̃β(δ) and ̃θ(δ) then implies that we can also choose any function within this class that minimizes sharpness, meaning that these properties also extend to ˆβ(δ) and ˆθ(δ). ̃β(δ) < 0 } δ ∈ { δ ∈ { D ∈ ∈ | | δ ∈ { R To achieve prove Theorem 5.3, we will require the following result. Lemma A.2. Consider the regressor μ(θR, arbitrary fixed y and x, * ), and let ̃β(δ) and ̃θ(δ) be functions that satisfy (15) and (16). Then, for is strictly monotonically decreasing with δ. μ(θR, x) y − − ̃β(δ)σ (cid:17) (cid:16) ̃θ (δ) , x (17) Proof. The proof follows directly from Assumption 4.1 and the properties (15) and (16). Proof of Theorem 5.3. Let ̃β(δ) and ̃θ(δ) be functions that satisfy (15) and (16). Due to Lemma A.2, we can define the function φ : [0, 1] as the unique solution to the implicit equation R X × → μ(θR, x) y − − ̃β(φ(x, y))σ (cid:16) ̃θ (φ(x, y)) , x (cid:17) = 0. (18) (15) (16) Note that, since y function of y for any fixed x. Furthermore, since y is absolutely continuous, − μ(θR, x) is strictly monotonically increasing with y, φ(x, y) is a strictly monotonically increasing Sharp Calibrated Gaussian Processes cal − = φ(xj = j almost surely. Hence, φ(x, y), Π, corresponds to an absolutely continuous random variable. Hence, given any monotonically non-decreasing = j almost surely, which implies φ(xi cal) for all i cal, yj cal, yi cal) yi cal − μ(θR, xi cal) = yj μ(θR, xj cal) holds for all i x, y ∼ function H( * ) that satisfies the requirement (cid:16) H φ(xij cal, yij cal) (cid:17) = j Ncal + 1 , Lemma A.1 implies that (cid:16) Px,y∼Π H (φ(x, y)) (cid:17) δ ∈ ≤ (cid:20) δ 1 Ncal + 1 − , δ + (cid:21) 1 Ncal + 1 δ ∀ ∈ [0, 1]. Since ̃β(δ) and ˆθ (δ) are arbitrary, and ˆβ(δ) and ̃θ (δ) are continuous and also satisfy (15) and (16) within δ can substitute φ( * ), which is the unique solution of the implicit equation * ) in (19) with ˆφ( * * , , μ(θR, x) y − − ˆβ( ˆφ(x, y))σ (cid:16) ˆθ ( ˆφ(x, y)) , x (cid:17) = 0. Now, in the particular case of ˆφ( , * ), due to (6), we have that * ˆφ(xij cal, yij cal) = j Ncal + 1 , (19) [0, 1], we ∈ (20) cal, yij meaning that H( ˆφ(xij Furthermore, since ˆφ( , * with δ, this in turn implies cal)) = ˆφ(xij cal, yij ) and the identity function H(δ) = δ. ) = ˆφ( * * ) is uniquely defined by the implicit equation (20) and ˆβ(δ)σ( ˆθ(δ), x) is monotonically increasing * cal), i.e., (19) holds for φ( , * , * (cid:16) Px,y∼Π ˆφ(x, y) (cid:17) δ ≤ (cid:32) = Px,y∼Π ̃β( ˆφ(x, y))σ (cid:16) ̃θ ( ˆφ(x, y)) , x (cid:17) ≤ ̃β(δ)σ (cid:16) ̃θ (δ) , x (cid:17) (cid:33) =Px,y∼Π (cid:32) y − μ(θR, x) ≤ ̃β(δ)σ (cid:16) ̃θ (δ) , x (cid:17) (cid:33) . Since ̃β(δ) and ˆθ (δ) are arbitrary, and ˆβ(δ) and ̃θ (δ) which, together with (19), implies the desired result. (cid:54) (cid:54) (cid:54) (cid:54) Sharp Calibrated Gaussian Processes (a) Observed confidence level over expected rate of constraint satisfaction. (b) Logarithm of sharpness over expected rate of constraint satis- faction. Figure 4. Detailed results for wine data set. (a) Observed confidence level over expected rate of constraint satisfaction. (b) Logarithm of sharpness over expected rate of constraint satis- faction. Figure 5. Detailed results for cement data set. B. Extended Experimental Section In Figure 4, we plot results for the Boston house price data sets. More specifically, in Figure 4a, we plot the observed confidence level ˆpj, as given by (8), over the desired confidence level pj, and, in Figure 5b, the sharpness metric T (cid:88) t=1 β2 pj σ2 Dtr (θpj , x∗ t ), over pj. Here we present graphs containing the detailed calibration and sharpness results for each experiment performed in Sec- tion 7.1.2. 020406080100Expectedconfidencelevel025005000750010000LogsharpnessOurApproachVanilla(naive)FullBayesVanilla+Kuleshov020406080100Expectedconfidencelevel020406080100ObservedconfidencelevelDesired020406080100Expectedconfidencelevel10−2100102104Logsharpness020406080100Expectedconfidencelevel020406080100ObservedconfidencelevelDesired020406080100Expectedconfidencelevel10−310−1101103105Logsharpness Sharp Calibrated Gaussian Processes (a) Observed confidence level over expected rate of constraint satisfaction. (b) Logarithm of sharpness over expected rate of constraint satis- faction. Figure 6. Detailed results for cement data set. 020406080100Expectedconfidencelevel020406080100ObservedconfidencelevelDesired020406080100Expectedconfidencelevel10−510−410−310−210−1Logsharpness